import e from"../../../../../_virtual/_node_path.mjs";import t from"../../../../../_virtual/index13.mjs";import{__require as r}from"../../utils/atRuleParamIndex.mjs";import{__require as s}from"../../utils/namespace.mjs";import{__require as a}from"../../utils/ruleUrl.mjs";var i,n;function l(){if(n)return i;n=1;const l=e,{utils:o}=t,p=r(),m=s(),c=a(),u=m("at-import-partial-extension"),d=o.ruleMessages(u,{expected:"Expected @import to have an extension",rejected:e=>`Unexpected extension ".${e}" in @import`}),x={url:c(u),deprecated:!0,fixable:!0},f=new RegExp(`(${["all","print","screen","speech","tv","tty","projection","handheld","braille","embossed","aural"].join("|")})$`,"i");function _(e){return(t,r)=>{o.validateOptions(r,u,{actual:e,possible:["always","never"]})&&(r.warn("'at-import-partial-extension has been deprecated, and will be removed in '7.0'. Use 'load-partial-extension' instead.",{stylelintType:"deprecation",stylelintReference:"https://github.com/stylelint-scss/stylelint-scss/blob/v6.3.0/src/rules/at-import-partial-extension/README.md"}),t.walkAtRules("import",t=>{t.params.split(/["']\s*,/).filter(e=>!f.test(e.trim())).forEach(s=>{const a=(e=>e.replace(/^\s*(["'])\s*/,"").replace(/\s*(["'])\s*$/,""))(s);if("url("===a.slice(0,4)||".css"===a.slice(-4)||-1!==a.search("//"))return;const i=l.extname(a).slice(1);if(!i&&"always"===e)return void o.report({message:d.expected,node:t,result:r,ruleName:u,word:a});if(i&&"scss"===i&&"never"===e){const e=()=>{const e=new RegExp(`\\.${i}(['" ]*)$`,"g");t.params=t.params.replace(e,"$1")},s=`.${i}`,a=p(t)+t.params.lastIndexOf(s);o.report({message:d.rejected(i),node:t,index:a,endIndex:a+s.length,result:r,ruleName:u,fix:e})}})}))}}return _.ruleName=u,_.messages=d,_.meta=x,i=_}export{l as __require};