import e from"../../../../../_virtual/_node_path.mjs";import r from"../../../../../_virtual/index13.mjs";import{__require as s}from"../../utils/atRuleParamIndex.mjs";import{__require as a}from"../../utils/namespace.mjs";import{__require as t}from"../../utils/ruleUrl.mjs";var i,l;function n(){if(l)return i;l=1;const n=e,{utils:o}=r,m=s(),p=a(),c=t(),u=p("load-partial-extension"),d=o.ruleMessages(u,{expected:(e="import")=>`Expected @${e} to have an extension`,rejected:(e,r="import")=>`Unexpected extension ".${e}" in @${r}`}),f={url:c(u),fixable:!0},x=new RegExp(`(${["all","print","screen","speech","tv","tty","projection","handheld","braille","embossed","aural"].join("|")})$`,"i"),_=/\(\s*([^)]+?)\s*\)/,$=["import","use","forward","include"];function h(e){return(r,s)=>{o.validateOptions(s,u,{actual:e,possible:["always","never"]})&&r.walkAtRules(r=>{if($.includes(r.name)){let a=r.name,t=r.params.split(/["']\s*,/).filter(e=>!x.test(e.trim()));const i=!!r.params.match(/load-css/);if(i)a="meta.load-css",t=[_.exec(r.params)[0].split(",")[0].replace(/[()]/g,"")];else if("include"===r.name)return;t.forEach(t=>{const l=(e=>e.replace(/^\s*(["'])\s*/,"").replace(/\s*(["'])\s*$/,""))(t);if("url("===l.slice(0,4)||".css"===l.slice(-4)||-1!==l.search("//")||-1!==l.search(":"))return;const p=n.extname(l).slice(1);if(!p&&"always"===e)return void o.report({message:d.expected(a),node:r,result:s,ruleName:u,word:l});if(p&&"scss"===p&&"never"===e){const e=()=>{const e=new RegExp(`\\.${p}(['" ]*)$`,"g");i&&(r.params=r.params.replace(t,t.replace(e,"$1"))),r.params=r.params.replace(e,"$1")},l=`.${p}`,n=m(r)+r.params.lastIndexOf(l);o.report({message:d.rejected(p,a),node:r,index:n,endIndex:n+l.length,result:s,ruleName:u,fix:e})}})}})}}return h.ruleName=u,h.messages=d,h.meta=f,i=h}export{n as __require};