@tailwindcss/language-server 0.14.5 → 0.14.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ThirdPartyNotices.txt +362 -287
- package/bin/css-language-server +116 -0
- package/bin/tailwindcss-language-server +2 -2
- package/package.json +4 -3
@@ -3542,9 +3542,9 @@ input:where([type='button'], [type='reset'], [type='submit']),
|
|
3542
3542
|
`;var UO=`@tailwind utilities;
|
3543
3543
|
`;var WO={tailwindcss:tL,"tailwindcss/index":tL,"tailwindcss/index.css":tL,"tailwindcss/preflight":BO,"tailwindcss/preflight.css":BO,"tailwindcss/theme":jO,"tailwindcss/theme.css":jO,"tailwindcss/utilities":UO,"tailwindcss/utilities.css":UO};var dVe=/@import\s*(?:'tailwindcss'|"tailwindcss")/,HVe=/@theme\s*\{/;async function fVe(t){return HVe.test(t)||dVe.test(t)}function VO({dependencies:t,legacy:e,jiti:n,filepath:i,resolver:o,onError:r}){let l=`${+Date.now()}`;async function s(p,c,a){try{let u=await o.resolveJsId(p,c);t.add(u);let d=gp(u);return d.searchParams.append("t",l),await n.import(d.href,{default:!0})}catch(u){return r(p,u,a)}}if(e){let p=rL.dirname(i);return c=>s(c,p,"module")}return async(p,c,a)=>({base:c,module:await s(p,c,a)})}async function XO(t,e,n,i,o){if(!e.__unstable__loadDesignSystem||!fVe(i))return null;let r=new Set,l=!1;try{await e.__unstable__loadDesignSystem(i,{loadStylesheet:async(c,a)=>(l=!0,{base:a,content:""})})}catch{}l||(i=(await eL({resolver:t}).process(i,{from:n})).css);let s=Dse(__filename,{moduleCache:!1,fsCache:!1}),p=await e.__unstable__loadDesignSystem(i,{base:rL.dirname(n),loadModule:VO({dependencies:r,legacy:!1,jiti:s,filepath:n,resolver:t,onError:(c,a,u)=>{if(console.error(`Unable to load ${u}: ${c}`,a),u==="config")return{};if(u==="plugin")return()=>{}}}),loadStylesheet:async(c,a)=>{try{let u=await t.resolveCssId(c,a);return r.add(u),{base:rL.dirname(u),content:await Gae.readFile(u,"utf-8")}}catch(u){return o&&c in WO?(console.error(`Loading fallback stylesheet for: ${c}`),{base:a,content:WO[c]}):(console.error(`Unable to load stylesheet: ${c}`,u),{base:a,content:""})}},loadPlugin:VO({dependencies:r,legacy:!0,jiti:s,filepath:n,resolver:t,onError(c,a){return console.error(`Unable to load plugin: ${c}`,a),()=>{}}}),loadConfig:VO({dependencies:r,legacy:!0,jiti:s,filepath:n,resolver:t,onError(c,a){return console.error(`Unable to load config: ${c}`,a),{}}})});return Object.assign(p,{dependencies:()=>r,compile(c){let a=p.candidatesToCss(c),u=[],d=a.map(H=>{if(H===null)return Ml.root();try{return Ml.parse(H.trimEnd())}catch(h){return u.push(h),Ml.root()}});return u.length>0&&console.error(JSON.stringify(u)),d},toCss(c){return Array.isArray(c)?Ml.root({nodes:c}).toString().trim():c.toString().trim()}}),p}var zae=require("node:fs/promises");async function Af(t){try{let e=await(0,zae.readFile)(t,"utf8");return Ts(e,"css")}catch{return null}}var W0e=Object.keys(Y0e.default);function V0e(t,e){return JSON.stringify([t,...e].map(n=>[n,Kf.statSync(n).mtimeMs]))}function Q0e(t){if(typeof t.mode<"u")return t.mode;if(Array.isArray(t.presets))for(let e=t.presets.length-1;e>=0;e--){let n=Q0e(t.presets[e]);if(typeof n<"u")return n}}function ebe(t){if(delete t.mode,Array.isArray(t.presets))for(let e of t.presets)ebe(e)}function WP(t,e){let n,i=ms.dirname(t),o=[t,i];if(i===e)return o;for(;i=ms.dirname(n=i),n!==i;)if(o.push(i),i===e)break;return o}async function tbe(t,e,n,i,o,r,l,s,p,c,a,u,d){let H=new Set;H.add(e.configPath);let h=!1,y=e.folder,b=[],_=e.documentSelector,m=i.capabilities.textDocument?.completion?.completionList?.itemDefaults??[];i.clientInfo?.name?.includes("Visual Studio Code")&&!m.includes("data")&&m.push("data");let g={enabled:!1,completionItemData:{_projectKey:t},editor:{connection:n,folder:y,userLanguages:u,capabilities:{configuration:!0,diagnosticRelatedInformation:!0,itemDefaults:m},getConfiguration:a,getDocumentSymbols:N=>n.sendRequest("@/tailwindCSS/getDocumentSymbols",{uri:N}),async readDirectory(N,R){try{let F=ms.dirname(KS(N.uri));R=await A.substituteId(`${R}/`,F),R=ms.resolve(F,R);let j=await Kf.promises.readdir(R,{withFileTypes:!0});return(await Promise.all(j.map(async B=>{let k=B.isDirectory();return await zd(g,N,ms.join(R,B.name,k?"/":""))?null:[B.name,{isDirectory:k}]}))).filter(B=>B!==null)}catch{return[]}}}};if(e.configPath&&e.config.source==="js"){let N=[];try{N=GS(e.configPath)}catch{}p([...WP(e.configPath,e.folder),...N.flatMap(R=>WP(R,e.folder))])}let A=await d.child({root:e.folder});function L(...N){console.log(`[${ms.relative(e.folder,e.configPath)}] ${N.join(" ")}`)}function I(N){let R=!1,F=!1,j=(0,G0e.default)(`**/${Fh}`,{dot:!0});for(let K of N){let B=eo(ia(K.file)),k=jh(B,[e.configPath]),X=jh(B,g.dependencies??[]),J=j(B);if(!(!k&&!X&&!J)){if(!h){!e.isUserConfigured&&e.configPath&&(k||X)&&(_=[..._.filter(({priority:se})=>se!==1),...q0e(e.configPath,c,e.folder)],l());continue}if(K.type===VP.FileChangeType.Created){L("File created:",K.file),R=!0;break}else if(K.type===VP.FileChangeType.Changed)if(L("File changed:",K.file),!g.enabled||J){R=!0;break}else F=!0;else if(K.type===VP.FileChangeType.Deleted)if(L("File deleted:",K.file),!g.enabled||k||J){R=!0;break}else F=!0}}R?S():F&&x()}function v(){Object.keys(g).forEach(N=>{N!=="editor"&&N!=="dependencies"&&delete g[N]}),g.enabled=!1,s(),r(),n.sendNotification("@/tailwindCSS/projectReset")}async function S(){if(h)try{await T(),n.sendNotification("@/tailwindCSS/projectInitialized")}catch(N){v(),Ow(n,N)}}async function x(){if(h)try{await D()}catch(N){v(),Ow(n,N)}}async function T(){L("Initializing..."),c0();let N=e.configPath;if(!N)throw new GA("No config file found.");p(WP(N,e.folder));let R=vH.default.sync(de=>{let Ee=ms.join(de,".pnp.js");if(vH.default.sync.exists(Ee)||(Ee=ms.join(de,".pnp.cjs"),vH.default.sync.exists(Ee)))return Ee;if(de===ms.normalize(y))return vH.default.stop},{cwd:y});if(R){let de=require(R);de.setup(),YW(de)}let F=e.config.source==="js"?GS(N):[],j=V0e(N,F),K=ms.dirname(N),B,k,X,J,se,Q,re,V,U,Z,z,ne={future:[],experimental:[]},ye;try{let de=await A.resolveCjsId("tailwindcss/package.json",K),Ee=ms.dirname(de);if(se=require(de).version,await A.hasPnP()){let he=await A.resolveCjsId("tailwindcss",K);B=require(he)}else{let he=await A.resolveJsId("tailwindcss",K);B=await import(gp(he).href)}let Ve=bf(se,B);if(L(`supported features: ${JSON.stringify(Ve)}`),Ve.includes("css-at-theme")||(B=B.default??B),L(`Loaded tailwindcss v${se}: ${Ee}`),Ve.includes("css-at-theme"))return g.configPath=N,g.version=se,g.isCssConfig=!0,g.v4=!0,g.jit=!0,g.modules={tailwindcss:{version:se,module:B},postcss:{version:null,module:null},resolveConfig:{module:null},loadConfig:{module:null}},x();if(e.config.source==="css"){L("CSS-based configuration is not supported before Tailwind CSS v4"),g.enabled=!1,h=!1;return}let Be=await A.resolveCjsId("postcss",Ee),me=await A.resolveCjsId("postcss/package.json",Ee),ue=ms.dirname(me),$e=await A.resolveCjsId("postcss-selector-parser",Ee);if(Q=require(me).version,re=Object.keys(Iv).map(he=>{try{return require(ds(K,`${he}/package.json`)).version}catch{return""}}).join(","),g.enabled&&Q===g.modules.postcss.version&&se===g.modules.tailwindcss.version&&re===g.pluginVersions&&N===g.configPath&&j===g.configId)return;L(`Loaded Tailwind CSS config file: ${N}`),k=require(Be),X=require($e),L(`Loaded postcss v${Q}: ${ue}`);try{U=require(ds(Ee,"./resolveConfig.js"))}catch{try{let ie=require(ds(Ee,"./lib/util/resolveConfig.js")),Ie=require(ds(Ee,"./stubs/defaultConfig.stub.js"));U=be=>ie([be,Ie])}catch{try{let Ie=require(ds(Ee,"./lib/util/mergeConfigWithDefaults.js")),be=require(ds(Ee,"./defaultConfig.js"));U=Me=>Ie.default(Me,be())}catch{throw Error("Failed to load resolveConfig function.")}}}try{let he=require(ds(Ee,"./lib/util/transformThemeValue.js"));Z=he.default??he}catch{}try{z=require(ds(Ee,"./loadConfig.js"))}catch{}if(Tn(se,"1.4.0")&&Ld(se,"1.99.0")){let he=ds(Ee,"browserslist");V=require(he)(void 0,{path:y})}Tn(se,"1.99.0")?ye=kw(()=>require(ds(Ee,"./lib/lib/substituteClassApplyAtRules"))):Tn(se,"1.7.0")&&(ye=require(ds(Ee,"./lib/flagged/applyComplexClasses")));try{ne=require(ds(Ee,"./lib/featureFlags.js")).default}catch{}let je=new Set,Fe=k.root(),te={opts:{},messages:[]},fe=()=>{};try{let he=VA(()=>{let ie=require(ds(K,"tailwindcss/lib/lib/setupContextUtils")).createContext;return l1.default.strictEqual(typeof ie,"function"),Ie=>ie(Ie.config)},()=>{let ie=require(ds(K,"tailwindcss/lib/jit/lib/setupContextUtils")).createContext;return l1.default.strictEqual(typeof ie,"function"),Ie=>ie(Ie.config)},()=>{let ie=require(ds(K,"tailwindcss/lib/jit/lib/setupTrackingContext")).default;return l1.default.strictEqual(typeof ie,"function"),Ie=>ie(Ie.configPath,je,fe)(te,Fe)},()=>{let ie=require(ds(K,"tailwindcss/lib/jit/lib/setupContext")).default;return l1.default.strictEqual(typeof ie,"function"),Ie=>ie(Ie.configPath,je)(te,Fe)});J={generateRules:{module:VA(()=>require(ds(K,"tailwindcss/lib/lib/generateRules")).generateRules,()=>require(ds(K,"tailwindcss/lib/jit/lib/generateRules")).generateRules)},createContext:{module:he},expandApplyAtRules:{module:VA(()=>require(ds(K,"tailwindcss/lib/lib/expandApplyAtRules")).default,()=>require(ds(K,"tailwindcss/lib/jit/lib/expandApplyAtRules")).default)},evaluateTailwindFunctions:{module:kw(()=>require(ds(K,"tailwindcss/lib/lib/evaluateTailwindFunctions")).default)}}}catch{try{let ie=require(ds(K,"tailwindcss/jit/lib/setupContext"));J={generateRules:{module:require(ds(K,"tailwindcss/jit/lib/generateRules")).generateRules},createContext:{module:Ie=>ie(Ie.configPath,je)(te,Fe)},expandApplyAtRules:{module:require(ds(K,"tailwindcss/jit/lib/expandApplyAtRules"))}}}catch{}}}catch(de){if(e.config.source==="css"){let Ve=await Promise.resolve().then(()=>(f3(),H3)),Be=h3().version,me=bf(Be,Ve);return L("Failed to load workspace modules."),L(`Using bundled version of \`tailwindcss\`: v${Be}`),g.configPath=N,g.version=Be,g.isCssConfig=!0,g.v4=!0,g.v4Fallback=!0,g.jit=!0,g.modules={tailwindcss:{version:Be,module:Ve},postcss:{version:null,module:null},resolveConfig:{module:null},loadConfig:{module:null}},x()}let Ee=await import("node:util");console.error(Ee.format(de)),B=K7(),U=Vk(),Z=dy().default,z=j0e(),k=tO(),se=SE().version,Q=U0e().version,X=qv(),J={generateRules:{module:TE().generateRules},createContext:{module:Ve=>hy().createContext(Ve.config)},expandApplyAtRules:{module:I7().default}},L("Failed to load workspace modules."),L(`Using bundled version of \`tailwindcss\`: v${se}`),L(`Using bundled version of \`postcss\`: v${Q}`)}g.configPath=N,g.modules={tailwindcss:{version:se,module:B},postcss:{version:Q,module:k},postcssSelectorParser:{module:X},resolveConfig:{module:U},loadConfig:{module:z},transformThemeValue:{module:Z},jit:J},g.browserslist=V,g.featureFlags=ne,g.version=se,g.pluginVersions=re;try{g.corePlugins=Object.keys(require(ds(ms.dirname(g.configPath),"tailwindcss/lib/plugins/index.js")))}catch{}if(ye&&!ye.default.__patched){let de=ye.default;ye.default=(Ee,...Ve)=>{if(g.jit)return g.modules.jit.expandApplyAtRules.module(g.jitContext);let Be=Pd(Ee);Be.separator=typeof g.separator>"u"?":":g.separator;let me=de(Be,...Ve);return async ue=>(ue.walkRules($e=>{let je=$e.selector.replace(/__TWSEP__(.*?)__TWSEP__/g,"$1");je!==$e.selector&&($e.before(k.comment({text:"__ORIGINAL_SELECTOR__:"+$e.selector})),$e.selector=je)}),await me(ue),ue.walkComments($e=>{$e.text.startsWith("__ORIGINAL_SELECTOR__:")&&($e.next().selector=$e.text.replace(/^__ORIGINAL_SELECTOR__:/,""),$e.remove())}),ue)},ye.default.__patched=!0}await x()}async function D(){L("Building..."),c0();let{tailwindcss:N,postcss:R,resolveConfig:F,loadConfig:j}=g.modules,K=Tn(N.version,"0.99.0")?["separator"]:["options","separator"],B=[],k,X=Tn(N.version,"2.99.0"),J;if(g.isCssConfig)try{let re=await Af(g.configPath),V=await XO(A,g.modules.tailwindcss.module,g.configPath,re,g.v4Fallback??!1);g.designSystem=V;let U=V.dependencies();for(let Z of U)H.add(Z);p(Array.from(U)),k={theme:{}}}catch{h=!1,g.enabled=!1;return}else if(j.module){J=new em(Kf.realpathSync(g.configPath));try{k=await j.module(g.configPath),k=k.default??k,g.jit=!0}catch(re){k=await F.module({}),g.jit=!0,console.error(`Unable to load config file at: ${g.configPath}`),console.error(re),yq(n,"Tailwind CSS is unable to load your config file",re)}finally{J.unhook()}}else{J=new em(Kf.realpathSync(g.configPath),re=>{k=Pd(re);let V=(0,dc.default)(re,K);typeof V!="string"&&(V=":"),Cl(re,K,`__TWSEP__${V}__TWSEP__`),re[X?"content":"purge"]=[];let U=Q0e(re);if(ebe(re),X||g.modules.jit&&U==="jit"){if(g.jit=!0,re.variants=[],Array.isArray(re.presets))for(let z of re.presets)B.push(z.variants),z.variants=[]}else g.jit=!1;if(g.corePlugins){let z={};for(let ne of g.corePlugins)z[ne]=!0;re.corePlugins=z}return Array.isArray(re.plugins)&&(re.plugins=re.plugins.map(z=>{if(z.__isOptionsFunction&&(z=z()),typeof z=="function"){let ne=(...ye)=>(ye[0].matchUtilities||(ye[0].matchUtilities=()=>{}),z(...ye));return ne.__intellisense_cache_bust=Math.random(),ne}return z.handler?{...z,handler:(...ne)=>(ne[0].matchUtilities||(ne[0].matchUtilities=()=>{}),z.handler(...ne)),__intellisense_cache_bust:Math.random()}:z})),re});try{e.config.source==="js"&&require(g.configPath)}catch(re){throw J.unhook(),re}}if(!k)throw new GA(`Failed to load config file: ${g.configPath}`);e.isUserConfigured||(_=[..._.filter(({priority:re})=>re!==1),...q0e(g.configPath,N.version,e.folder,k)]);try{if(g.config=g.isCssConfig?k:F.module(k),g.separator=(0,dc.default)(g.config,K),typeof g.separator!="string"&&(g.separator=":"),g.blocklist=Array.isArray(g.config.blocklist)?g.config.blocklist:[],delete g.config.blocklist,g.v4){let re=g.designSystem.getClassList();g.classList=re.map(V=>[V[0],{...V[1],color:fu(g,V[0])}])}else if(g.jit){if(g.jitContext=g.modules.jit.createContext.module(g),g.jitContext.tailwindConfig.separator=g.config.separator,g.jitContext.getClassList){let re=g.jitContext.getClassList({includeMetadata:!0}).filter(V=>V!=="*");g.classListContainsMetadata=re.some(V=>Array.isArray(V)),g.classList=re.map(V=>Array.isArray(V)?[V[0],{color:fu(g,V[0]),...V[1]??{}}]:[V,{color:fu(g,V)}])}}else delete g.jitContext,delete g.classList}catch(re){throw J?.unhook(),re}let se;if(g.classList)J?.unhook();else try{se=await R.module([N.module(g.configPath)]).process([Tn(N.version,"0.99.0")?"base":"preflight","components","utilities"].map(re=>`/*__tw_intellisense_layer_${re}__*/
|
3544
3544
|
@tailwind ${re};`).join(`
|
3545
|
-
`),{from:void 0})}catch(re){throw re}finally{J?.unhook()}g.dependencies=GS(g.configPath),p((g.dependencies??[]).flatMap(re=>WP(re,e.folder))),g.configId=V0e(g.configPath,g.dependencies),g.plugins=await lht(k),se&&(g.classNames=await XY(se.root)),g.variants=K0e(g);let Q=(0,dc.default)(g.config,"theme.screens",(0,dc.default)(g.config,"screens",{}));g.screens=Pc(Q)?Object.keys(Q):[],g.enabled=!0,s(),r()}for(let N of e.config.entries){H.add(N.path);for(let R of N.deps)H.add(R.path)}return{projectConfig:e,enabled(){return h},enable(){h=!0},dependencies:()=>H,async reload(){if(!g.v4)return;console.log("---- RELOADING DESIGN SYSTEM ----"),console.log(`---- ${g.configPath} ----`);let N=await Af(g.configPath),R,F=process.hrtime.bigint();try{R=await XO(A,g.modules.tailwindcss.module,g.configPath,N,g.v4Fallback??!1)}catch(X){throw console.error(X),X}let j=Object.create(g,{designSystem:{value:R}}),K=R.getClassList().map(X=>[X[0],{...X[1],color:fu(j,X[0])}]);g.designSystem=R,g.classList=K,g.variants=K0e(g);let B=R.dependencies();for(let X of B)H.add(X);p(Array.from(B));let k=process.hrtime.bigint()-F;console.log(`---- RELOADED IN ${(Number(k)/1e6).toFixed(2)}ms ----`)},state:g,documentSelector(){return _},tryInit:S,async dispose(){g={enabled:!1};for(let N of b)(await N).dispose()},async onUpdateSettings(N){g.enabled&&s(),N.editor?.colorDecorators?r():n.sendNotification("@/tailwindCSS/clearColors")},onFileEvents:I,async onHover(N){return Bh(async()=>{if(!g.enabled)return null;let R=o.getDocument(N.textDocument.uri);return!R||!(await g.editor.getConfiguration(R.uri)).tailwindCSS.hovers||await zd(g,R)?null:Pie(g,R,N.position)},null)},async onCompletion(N){return Bh(async()=>{if(!g.enabled)return null;let R=o.getDocument(N.textDocument.uri);return!R||!(await g.editor.getConfiguration(R.uri)).tailwindCSS.suggestions||await zd(g,R)?null:Bie(g,R,N.position,N.context)},null)},onCompletionResolve(N){return Bh(()=>g.enabled?jie(g,N):null,null)},async onCodeAction(N){return Bh(async()=>{if(!g.enabled)return null;let R=o.getDocument(N.textDocument.uri);return!R||!(await g.editor.getConfiguration(R.uri)).tailwindCSS.codeActions?null:hse(g,N,R)},null)},onDocumentLinks(N){if(!g.enabled)return null;let R=o.getDocument(N.textDocument.uri);if(!R)return null;let F=z7.URI.parse(R.uri).fsPath,j=ms.dirname(F);async function K(B){return B=await A.substituteId(B,j)??B,z7.URI.file(ms.resolve(j,B)).toString()}return gse(g,R,K)},provideDiagnostics:(0,J0e.debounce)(N=>{g.enabled&&AO(g,N)},i.initializationOptions?.testMode?0:500),provideDiagnosticsForce:N=>{g.enabled&&AO(g,N)},async onDocumentColor(N){return Bh(async()=>{if(!g.enabled)return[];let R=o.getDocument(N.textDocument.uri);return R?await zd(g,R)?null:yse(g,R):[]},null)},async onColorPresentation(N){let R=o.getDocument(N.textDocument.uri);if(!R)return[];let F=R.getText(N.range),j=F.match(new RegExp(`-\\[(${W0e.join("|")}|(?:(?:#|rgba?\\(|hsla?\\())[^\\]]+)\\]$`,"i"));if(j===null)return[];let K=j[1],B=W0e.includes(K),k={mode:"rgb",r:N.color.red,g:N.color.green,b:N.color.blue,alpha:N.color.alpha},X=Vb(k);if(!B&&(K.length===4||K.length===5)){let[,...se]=X.match(/^#([a-f\d])\1([a-f\d])\2([a-f\d])\3(?:([a-f\d])\4)?$/i)??[];se.length&&(X=`#${se.filter(Boolean).join("")}`)}X.length===5?X=X.replace(/f$/,""):X.length===9&&(X=X.replace(/ff$/,""));let J=F.substr(0,j.index);return[X,Em(k).replace(/ /g,""),pM(k).replace(/ /g,"").replace(/\d+\.\d+(%?)/g,(se,Q)=>`${Math.round(parseFloat(se))}${Q}`)].map(se=>({label:`${J}-[${se}]`}))},sortClassLists(N){return g.jit?N.map(R=>{let F="",j=R.split(/(\s+)/),K=j.filter((X,J)=>J%2===0),B=j.filter((X,J)=>J%2!==0);K[K.length-1]===""&&K.pop();let k;g.v4?k=g.designSystem.getClassOrder(K):g.jitContext.getClassOrder?k=g.jitContext.getClassOrder(K):k=sht(g,K),K=k.sort(([,X],[,J])=>X===J?0:X===null?-1:J===null?1:Im(X-J)).map(([X])=>X);for(let X=0;X<K.length;X++)F+=`${K[X]}${B[X]??""}`;return F}):N}}}function X0e(t,e){let n=t.config.prefix;return typeof n=="function"?n(e):n+e}function sht(t,e){let n=new Set([X0e(t,"group"),X0e(t,"peer")]),i=[];for(let o of e){let r=t.modules.jit.generateRules.module(new Set([o]),t.jitContext).sort(([l],[s])=>Im(s-l))[0]?.[0]??null;r===null&&n.has(o)&&(r=t.jitContext.layerOrder.components),i.push([o,r])}return i}function aht(t,e,n={}){let i=e.config,o=e.modules.postcss.module,r=e.browserslist,l=r&&r.includes("ie 11")?"ie11":"relaxed",s=typeof t=="function"?t:t.handler;try{s({addUtilities:()=>{},addComponents:()=>{},addBase:()=>{},matchUtilities:()=>{},addVariant:()=>{},e:p=>p,prefix:p=>p,theme:(p,c)=>(0,dc.default)(i,`theme.${p}`,c),variants:()=>[],config:(p,c)=>(0,dc.default)(i,p,c),corePlugins:p=>Array.isArray(i.corePlugins)?i.corePlugins.includes(p):(0,dc.default)(i,`corePlugins.${p}`,!0),target:p=>{if(typeof i.target=="string")return i.target==="browserslist"?l:i.target;let[c,a]=(0,dc.default)(i,"target"),u=(0,dc.default)(a,p,c);return u==="browserslist"?l:u},postcss:o,...n})}catch{}}function oht(t){return t.type==="atrule"}function K0e(t){if(t.v4){let r=Array.from(t.designSystem.getVariants()),l=t.designSystem.theme.prefix??"";return l.length>0&&r.unshift({name:l,values:[],isArbitrary:!1,hasDash:!0,selectors:()=>["&"]}),r}if(t.jitContext?.getVariants)return t.jitContext.getVariants();if(t.jit){let r=[];return Array.from(t.jitContext.variantMap).forEach(([l,s])=>{r.push({name:l,values:[],isArbitrary:!1,hasDash:!0,selectors:()=>{function p(b){let _=t.modules.postcssSelectorParser.module.className();return _.value=b,(0,dc.default)(_,"raws.value",_.value)}let c=(Array.isArray(s[0])?s:[s]).map(([b,_])=>_),a="__variant_placeholder__",u=t.modules.postcss.module.root({nodes:[t.modules.postcss.module.rule({selector:`.${p(a)}`,nodes:[]})]}),d=t.modules.postcssSelectorParser.module(b=>b.first.filter(({type:_})=>_==="class").pop().value);function H(b){return d.transformSync(b)}function h(b){return u.each(_=>{_.type==="rule"&&(_.selectors=_.selectors.map(m=>b({get className(){return H(m)},selector:m})))}),u}let y=[];for(let b of c){let _,m=u.clone(),g=pq(()=>b({container:m,separator:t.separator,modifySelectors:h,format:A=>{_=A.replace(/:merge\(([^)]+)\)/g,"$1")},wrap:A=>{oht(A)&&(_=`@${A.name} ${A.params}`)}}));if(_||(_=g),_){y.push(_);continue}m.walkDecls(A=>{A.remove()}),_=m.toString().replace(`.${p(`${l}:${a}`)}`,"&").replace(/(?<!\\)[{}]/g,"").replace(/\s*\n\s*/g," ").trim(),_.includes(a)||y.push(_)}return y}})}),r}let e=t.config,n=t.modules.tailwindcss.version,i=["responsive","hover"];return Tn(n,"0.3.0")&&i.push("focus","group-hover"),Tn(n,"0.5.0")&&i.push("active"),Tn(n,"0.7.0")&&i.push("focus-within"),Tn(n,"1.0.0-beta.1")&&i.push("default"),Tn(n,"1.1.0")&&i.push("first","last","odd","even","disabled","visited"),Tn(n,"1.3.0")&&i.push("group-focus"),Tn(n,"1.5.0")&&i.push("focus-visible","checked"),Tn(n,"1.6.0")&&i.push("motion-safe","motion-reduce"),Tn(n,"2.0.0-alpha.1")&&i.push("dark"),(Array.isArray(e.plugins)?e.plugins:[]).forEach(r=>{aht(r,t,{addVariant:l=>{i.push(l)}})}),i.map(r=>({name:r,values:[],isArbitrary:!1,hasDash:!0,selectors:()=>[]}))}async function lht(t){let e=t.plugins;return Array.isArray(e)?Promise.all(e.map(async n=>{let i=n.config;Pc(i)||(i={});let o={theme:Pc(i.theme)?Object.keys(i.theme):[],variants:Pc(i.variants)?Object.keys(i.variants):[]},r=n.handler||n,l=typeof r.name=="string"&&r.name!=="handler"&&r.name!==""?r.name:null;try{r()}catch(s){let p=Z0e.default.parse(s);if(p.length===0)return{name:l};let c=p[0].fileName,a=ms.dirname(c);if(!z0e.default.sync({cwd:a}))return{name:l};let d;try{d=require(d)}catch{return{name:l}}if(d.name&&ms.resolve(a,d.main||"index.js")===c)return{name:d.name,homepage:d.homepage,contributes:o}}return{name:l}})):[]}function uht(t,e){try{let n=vH.default.sync(i=>{let o=ms.join(i,"package.json");if(vH.default.sync.exists(o))return o;if(i===ms.normalize(e))return vH.default.stop},{cwd:t});return n?ms.dirname(n):e}catch{return e}}function q0e(t,e,n,i){let o=i??require(t),r=o.content?.files??o.content,l=Array.isArray(r)?r:[],s=Tn(e,"3.2.0")?o.future?.relativeContentPathsByDefault||o.content?.relative:!1,p;return s?p=ms.dirname(t):p=uht(ms.dirname(t),n),l.filter(c=>typeof c=="string").map(c=>c.startsWith("!")?`!${ms.resolve(p,c.slice(1))}`:ms.resolve(p,c)).map(c=>({pattern:eo(ia(c)),priority:1}))}var abe=Ar(sbe());function vht(){return{editor:{tabSize:2},tailwindCSS:{emmetCompletions:!1,classAttributes:["class","className","ngClass","class:list"],codeActions:!0,hovers:!0,suggestions:!0,validate:!0,colorDecorators:!0,rootFontSize:16,lint:{cssConflict:"warning",invalidApply:"error",invalidScreen:"error",invalidVariant:"error",invalidConfigPath:"error",invalidTailwindDirective:"error",invalidSourceDirective:"error",recommendedVariantOrder:"warning"},showPixelEquivalents:!0,includeLanguages:{},files:{exclude:["**/.git/**","**/node_modules/**","**/.hg/**","**/.svn/**"]},experimental:{classRegex:[],configFile:null}}}}function obe(t){let e=new Map;async function n(o){let r=e.get(o);return r||(r=await i(o),e.set(o,r)),r}async function i(o){let[r,l]=await Promise.all([t.workspace.getConfiguration({section:"editor",scopeUri:o}),t.workspace.getConfiguration({section:"tailwindCSS",scopeUri:o})]);return r=Pc(r)?r:{},l=Pc(l)?l:{},(0,abe.default)(vht(),{editor:r,tailwindCSS:l},{arrayMerge:(s,p,c)=>p})}return{get:n,clear(){e.clear()}}}var Ybe=Ar(require("node:os")),ha=Ar(require("node:path")),c1=Ar(require("node:fs/promises")),Qbe=Ar(zbe()),e_e=Ar(u0());var JP=class{constructor(){this.parents=new Map;this.children=new Map;this.nodes=new Map}add(e,n){return this.nodes.has(e)?this.nodes.get(e):(this.nodes.set(e,n),this.parents.set(e,new Set),this.children.set(e,new Set),n)}connect(e,n){let i=this.children.get(e);if(!i)throw new Error(`Node ${e} does not exist`);let o=this.parents.get(n);if(!o)throw new Error(`Node ${n} does not exist`);o.add(e),i.add(n)}*descendants(e){let n=[],i=new Set;for(let o of this.children.get(e))n.push(o);for(;n.length>0;){let o=n.shift();if(!i.has(o)){yield this.nodes.get(o),i.add(o);for(let r of this.children.get(o))n.push(r)}}}*roots(){for(let[e,n]of this.parents)n.size===0&&(yield this.nodes.get(e))}*leaves(){for(let[e,n]of this.children)n.size===0&&(yield this.nodes.get(e))}};var YP=class extends Map{remember(e,n){let i=super.get(e);return i||(i=n(e),this.set(e,i)),i}};var QP=Ar(YA()),tg=Ar(require("node:path"));async function wB(t,e){async function n(i){let o=tg.join(i,"package.json");if(await QP.default.exists(o))return o;if(i===tg.normalize(e))return QP.default.stop}try{let i=await(0,QP.default)(n,{cwd:t});return i?tg.dirname(i):e}catch{return e}}async function Umt(t){let e=await import(t);return e.scanDir?e:null}async function Zbe(t){let e=await Umt(t.oxidePath);if(!e)return null;if(Ld(t.oxideVersion,"4.0.0-alpha.18")){let i=e.scanDir?.({base:t.basePath,globs:!0});return{files:i.files,globs:i.globs.map(o=>({base:o.base,pattern:o.glob}))}}if(Ld(t.oxideVersion,"4.0.0-alpha.19")){let i=e.scanDir({base:t.basePath,sources:t.sources});return{files:i.files,globs:i.globs}}if(Ld(t.oxideVersion,"4.0.0-alpha.30")){let i=new e.Scanner({detectSources:{base:t.basePath},sources:t.sources});return{files:i.files,globs:i.globs}}let n=new e.Scanner({sources:[{base:t.basePath,pattern:"**/*"},...t.sources]});return{files:n.files,globs:n.globs}}var Vmt=/@import\s*['"]tailwindcss(?:\/[^'"]+)?['"]/,Xmt=/@(theme|plugin|utility|custom-variant|variant|reference)\s*[^;{]+[;{]/,Kmt=/--(alpha|spacing|theme)\(/,qmt=/@tailwind\s*(base|preflight|components|variants|screens)+;/,Gmt=/@tailwind\s*utilities\s*[^;]*;/,zmt=/@tailwind\s*[^;]+;/,Zmt=/@(config|apply)\s*[^;{]+[;{]/,Jmt=/@import\s*['"]/;function Jbe(t){return Vmt.test(t)?{root:!0,versions:["4"]}:Xmt.test(t)?Gmt.test(t)?{root:!0,versions:["4"]}:{root:!1,versions:["4"]}:Kmt.test(t)?{root:!1,versions:["4"]}:qmt.test(t)?{root:!1,versions:["3"]}:zmt.test(t)?{root:!0,versions:["4","3"]}:Zmt.test(t)?{root:!1,versions:["4","3"]}:Jmt.test(t)?{root:!0,versions:["4","3"]}:{root:!1,versions:[]}}var ex=class{constructor(e,n,i){this.base=e;this.settings=n;this.resolver=i}async search(){let e=await this.findConfigs(),n=await Promise.allSettled(e.map(o=>this.createProject(o))),i=[];for(let o of n)o.status==="rejected"?console.error(`[GLOBAL] Error creating project: ${o.reason}`):o.status==="fulfilled"&&o.value&&i.push(o.value);i.length===1&&i[0].documentSelector.push({pattern:ia(ha.join(this.base,"**")),priority:5});for(let o of i){o.folder=eo(o.folder),o.configPath=eo(o.configPath),o.config.path=eo(o.config.path);for(let r of o.config.entries)r.path=eo(r.path);for(let r of o.documentSelector)r.pattern=eo(r.pattern)}return i}async loadAllFromWorkspace(e){return Promise.all(e.map(n=>this.loadFromWorkspace(n[0],n[1])))}async loadFromWorkspace(e,n){let i=e.endsWith(".css")?{type:"css",path:e,source:"css",entries:[],content:[],packageRoot:""}:{type:"js",path:e,source:"js",entries:[],content:[],packageRoot:""},o=await this.detectTailwindVersion(i);return i.packageRoot=await wB(ha.dirname(i.path),this.base),{config:i,folder:this.base,isUserConfigured:!0,configPath:i.path,documentSelector:n.map(r=>({priority:0,pattern:r})),tailwind:o}}async createProject(e){let n=await this.detectTailwindVersion(e),i=e.entries.flatMap(r=>r.meta?.versions??[]);if(console.log(JSON.stringify({tailwind:n,path:e.path})),e.type==="js"&&e.source==="css"&&(n.isDefaultVersion||!n.features.includes("css-at-config-as-project")))return null;if(e.type==="css"){if(!n.features.includes("css-at-theme"))return null;if(!i.includes("4"))return console.warn(`The config ${e.path} looks like it might be for a different Tailwind CSS version. Skipping.`),null;if(t_e(e.path))return console.warn(`The config ${e.path} requires a preprocessor and is not supported by Tailwind CSS v4.0.`),null}if(e.type==="js"&&n.features.includes("css-at-theme")||e.type==="js"&&(e.path.endsWith(".ts")||e.path.endsWith(".mjs"))&&!n.features.includes("transpiled-configs"))return null;e.packageRoot=await wB(ha.dirname(e.path),this.base);let o=[];for(let r of e.entries)r.type==="css"&&o.push({pattern:r.path,priority:0});o.push({pattern:e.path,priority:0});for await(let r of Ymt(e,n.features,this.resolver))o.push(r);for(let r of e.entries)r.type==="css"&&o.push({pattern:ia(ha.join(ha.dirname(r.path),"**")),priority:2});return o.push({pattern:ia(ha.join(ha.dirname(e.path),"**")),priority:3}),o.push({pattern:ia(ha.join(e.packageRoot,"**")),priority:4}),o.sort((r,l)=>r.priority-l.priority),o=o.filter(({pattern:r},l,s)=>s.findIndex(({pattern:p})=>p===r)===l),{config:e,folder:this.base,isUserConfigured:!1,configPath:e.path,documentSelector:o,tailwind:n}}async findConfigs(){let e=await(0,Qbe.default)([`**/${Rh}`,`**/${bd}`],{cwd:this.base,ignore:this.settings.tailwindCSS.files.exclude,onlyFiles:!0,absolute:!0,suppressErrors:!0,dot:!0,concurrency:Math.max(Ybe.cpus().length,1)}),n=await Promise.all(e.map(d=>c1.realpath(d)));e=e.filter((d,H)=>{let h=n[H];return d===h?!0:!e.includes(h)}),e=e.map(d=>ia(d)),e=Array.from(new Set(e)).sort();let i=new YP,o=(0,e_e.default)(`**/${bd}`,{dot:!0}),r=e.map(d=>o(d)?new tx("css",d):new tx("js",d,[i.remember(d,()=>({source:"js",type:"js",path:d,entries:[],packageRoot:null,content:[]}))])),l=r.filter(d=>d.type==="css");await Promise.all(l.map(d=>d.read())),await Promise.all(l.map(d=>d.resolvePossibleVersions()));let s=[];for(let d of l){if(!d.content||!d.meta||d.meta.versions.length===0)continue;let H=d.configPathInCss();H&&d.configs.push(i.remember(H,()=>({source:"css",type:"js",path:H,entries:[],packageRoot:null,content:[]}))),s.push(d)}await Promise.all(s.map(d=>d.resolveImports(this.resolver))),await Promise.all(s.map(d=>d.resolveRealpaths())),await Promise.all(s.map(d=>d.resolveSourceDirectives()));let p=new JP,c=null,a=null,u=null;for(let d of s){p.add(d.realpath,d);for(let H of d.deps)p.add(H.realpath,H),p.connect(d.realpath,H.realpath);d.realpath.includes("node_modules/tailwindcss/index.css")?c=d.realpath:d.realpath.includes("node_modules/tailwindcss/theme.css")?a=d.realpath:d.realpath.includes("node_modules/tailwindcss/utilities.css")&&(u=d.realpath)}c&&a&&p.connect(c,a),c&&u&&p.connect(c,u);for(let d of p.roots()){if(!d.meta||d.meta.root===!1)continue;let H=i.remember(d.path,()=>({source:"css",type:"css",path:d.path,entries:[],packageRoot:null,content:[{kind:"auto"}]}));d.configs.push(H);for(let h of p.descendants(d.realpath))h.configs.push(H)}for(let d of r)for(let H of d.configs)H.entries.push(d);return Array.from(i.values())}async detectTailwindVersion(e){try{let r=await this.resolver.resolveCjsId("tailwindcss/package.json",ha.dirname(e.path)),{version:l}=require(r),s;if(this.resolver.hasPnP()){let c=await this.resolver.resolveCjsId("tailwindcss",ha.dirname(e.path));s=require(c)}else{let c=await this.resolver.resolveJsId("tailwindcss",ha.dirname(e.path));s=await import(gp(c).href)}let p=bf(l,s);if(typeof l=="string")return{version:l,features:p,isDefaultVersion:!1}}catch{}if(e.type==="css"){let{version:r}=h3(),l=await Promise.resolve().then(()=>(f3(),H3)),s=bf(r,l);return{version:r,features:s,isDefaultVersion:!0}}let{version:n}=SE(),i=K7(),o=bf(n,i);return{version:n,features:o,isDefaultVersion:!0}}};function Ymt(t,e,n){if(t.type==="css")return eyt(t,n);if(t.type==="js")return Qmt(t,e)}async function*Qmt(t,e,n){let i;try{i=n??require(t.path)}catch{return}let o=i.content?.files??i.content,r=Array.isArray(o)?o:[],s=(e.includes("relative-content-paths")?i.future?.relativeContentPathsByDefault||i.content?.relative:!1)?ha.dirname(t.path):t.packageRoot;for(let p of r){if(typeof p!="string")continue;let c=p.startsWith("!")?`!${ha.resolve(s,p.slice(1))}`:ha.resolve(s,p);yield{pattern:ia(c),priority:1}}}async function*eyt(t,e){let n=!1;for(let i of t.content)if(i.kind==="file")yield{pattern:ia(i.file),priority:1};else if(i.kind==="auto"&&!n){n=!0;let o=t.entries.flatMap(r=>r.sources);for await(let r of tyt(t.packageRoot,t.path,o,e))yield{pattern:r,priority:1}}}async function*tyt(t,e,n,i){try{let o=await i.resolveJsId("@tailwindcss/oxide",ha.dirname(t));o=gp(o).href;let r=await i.resolveJsId("@tailwindcss/oxide/package.json",ha.dirname(t)),l=JSON.parse(await c1.readFile(r,"utf8")),s=await Zbe({oxidePath:o,oxideVersion:l.version,basePath:t,sources:n.map(p=>({base:ha.dirname(e),pattern:p}))});if(!s)return;for(let p of s.files)yield ia(p);for(let{base:p,pattern:c}of s.globs)yield ia(p)+"/"+c}catch{}}var tx=class t{constructor(e,n,i=[]){this.type=e;this.path=n;this.configs=i;this.deps=[];this.sources=[];this.meta=null}async read(){try{this.content=await Af(this.path)}catch{this.content=null}}async resolveImports(e){if(!t_e(this.path))try{let n=await eL({resolver:e,loose:!0}).process(this.content,{from:this.path}),i=n.messages.filter(o=>o.type==="dependency");i=i.filter(o=>!o.file.startsWith("/virtual:missing/")),this.deps=i.map(o=>new t("css",ia(o.file))),this.content=n.css}catch(n){console.debug(`Unable to resolve imports for ${this.path}.`),console.debug("This may result in failure to locate Tailwind CSS projects."),console.error(n)}}async resolveRealpaths(){this.realpath=ia(await c1.realpath(this.path)),await Promise.all(this.deps.map(e=>e.resolveRealpaths()))}async resolveSourceDirectives(){try{if(this.sources.length>0)return;await Ml([qae(this.sources)]).process(this.content,{from:this.realpath})}catch{}}async resolvePossibleVersions(){this.meta=this.content?Jbe(this.content):null}configPathInCss(){if(!this.content)return null;let e=this.content.match(/@config\s*(?<config>'[^']+'|"[^"]+")/);return e?ia(ha.resolve(ha.dirname(this.path),e.groups.config.slice(1,-1))):null}};function t_e(t){let e=ha.extname(t);return e===".scss"||e===".sass"||e===".less"||e===".styl"||e===".pcss"}var Hgt=Ar(require("node:fs")),sEe=Ar(require("node:path")),ug=Ar(ED());var r_e=Ar(YA()),rx=Ar(require("node:path"));var $B=new Map;async function n_e(t){let e=$B.get(t);if(e!==void 0)return e;let n=await ryt(rx.normalize(t));if(!n)return $B.set(t,null),null;let r=(await import(gp(n).href)).default;return r.setup(),$B.set(t,r),r}async function ryt(t){let e=[".pnp.js",".pnp.cjs"];for(let n of e){let i=rx.join(t,n);if(await r_e.default.exists(i))return i}return null}var eh=Ar(require("node:path")),nEe=Ar(R_e());var Qf=Ar(require("node:path"),1),U_e=Ar(require("node:fs"),1);var qo=Ar(require("node:path"),1),j_e=require("node:fs"),Kyt=new RegExp("\\"+qo.default.posix.sep,"g"),qyt=new RegExp("\\"+qo.default.sep,"g"),JB=new Map,ag="**/*",px=[".ts",".tsx",".mts",".cts"],Gyt=[".js",".jsx",".mjs",".cjs"],QB=px.concat(Gyt),zyt=`\\.(?:${px.map(t=>t.substring(1)).join("|")})`,Zyt=`\\.(?:${QB.map(t=>t.substring(1)).join("|")})`,dx=qo.default.posix.sep===qo.default.sep;function h1(){let t,e;return{promise:new Promise((i,o)=>{t=i,e=o}),resolve:t,reject:e}}async function ej(t,e){if(qo.default.extname(t)!==".json")return;let n=qo.default.resolve(t);return e&&(e.hasParseResult(n)||e.hasParseResult(t))?n:j_e.promises.stat(n).then(i=>{if(i.isFile()||i.isFIFO())return n;throw new Error(`${t} exists but is not a regular file.`)})}var tj=dx?t=>t.includes("/node_modules/"):t=>t.match(/[/\\]node_modules[/\\]/),YB=dx?t=>t:t=>t.replace(Kyt,qo.default.sep),Yf=dx?t=>t:t=>t.replace(qyt,qo.default.posix.sep),og=dx?(t,e)=>t?qo.default.resolve(t,e):qo.default.resolve(e):(t,e)=>Yf(t?qo.default.resolve(YB(t),YB(e)):qo.default.resolve(YB(e)));function rj(t,e){let n=qo.default.dirname(t.tsconfigFile);return t.tsconfig.references.map(i=>{let o=i.path.endsWith(".json")?i.path:qo.default.join(i.path,e?.configName??"tsconfig.json");return og(n,o)})}function nj(t,e){let i=e.tsconfig.compilerOptions?.allowJs?QB:px;if(e.referenced&&i.some(o=>t.endsWith(o))&&!F_e(t,e)){let o=e.referenced.find(r=>F_e(t,r));if(o)return o}return e}function F_e(t,e){let n=Yf(qo.default.dirname(e.tsconfigFile)),i=(e.tsconfig.files||[]).map(s=>og(n,s)),o=og(null,t);if(i.includes(t))return!0;let r=e.tsconfig.compilerOptions?.allowJs;return B_e(o,n,e.tsconfig.include||(e.tsconfig.files?[]:[ag]),r)?!B_e(o,n,e.tsconfig.exclude||[],r):!1}function B_e(t,e,n,i){let o=i?QB:px;return n.some(r=>{let l=r.length,s=!1,p=!1,c=!1,a=-1;for(let h=r.length-1;h>-1;h--){let y=r[h];if(s||(y==="*"||y==="?")&&(l=h,s=!0),c||(y==="."?p=!0:y==="/"&&(a=h,c=!0)),s&&c)break}if(!p&&(!s||l<a)&&(r+=`${r.endsWith("/")?"":"/"}${ag}`,l=r.length-1,s=!0),l<r.length-1&&!t.endsWith(r.slice(l+1))||r.endsWith("*")&&!o.some(h=>t.endsWith(h)))return!1;if(r===ag)return t.startsWith(`${e}/`);let u=og(e,r),d=-1;for(let h=0;h<u.length;h++)if(u[h]==="*"||u[h]==="?"){d=h,s=!0;break}if(d>1&&!t.startsWith(u.slice(0,d-1)))return!1;if(s){if(d+ag.length===u.length-(r.length-1-l)&&u.slice(d,d+ag.length)===ag)return!0}else return t===u;if(JB.has(u))return JB.get(u).test(t);let H=Jyt(u,i);return JB.set(u,H),H.test(t)})}function Jyt(t,e){let n="^";for(let i=0;i<t.length;i++){let o=t[i];if(o==="?"){n+="[^\\/]";continue}if(o==="*"){if(t[i+1]==="*"&&t[i+2]==="/"){i+=2,n+="(?:[^\\/]*\\/)*";continue}n+="[^\\/]*";continue}"/.+^${}()|[]\\".includes(o)&&(n+="\\"),n+=o}return t.endsWith("*")&&(n+=e?Zyt:zyt),n+="$",new RegExp(n)}function ij(t,e){return JSON.parse(JSON.stringify(t).replaceAll(/"\${configDir}/g,`"${Yf(e)}`))}async function sj(t,e){let n=Qf.default.dirname(Qf.default.resolve(t));if(e?.ignoreNodeModules&&tj(n))return null;let i=e?.cache,o=e?.configName??"tsconfig.json";if(i?.hasConfigPath(n,o))return i.getConfigPath(n,o);let{promise:r,resolve:l,reject:s}=h1();return e?.root&&!Qf.default.isAbsolute(e.root)&&(e.root=Qf.default.resolve(e.root)),W_e(n,{promise:r,resolve:l,reject:s},e),r}function W_e(t,{resolve:e,reject:n,promise:i},o){let{cache:r,root:l,configName:s}=o??{};if(r)if(r.hasConfigPath(t,s)){let c;try{c=r.getConfigPath(t,s)}catch(a){n(a);return}c?.then?c.then(e).catch(n):e(c)}else r.setConfigPath(t,i,s);let p=Qf.default.join(t,o?.configName??"tsconfig.json");U_e.default.stat(p,(c,a)=>{if(a&&(a.isFile()||a.isFIFO()))e(p);else if(c?.code!=="ENOENT")n(c);else{let u;l===t||(u=Qf.default.dirname(t))===t?e(null):W_e(u,{promise:i,resolve:e,reject:n},o)}})}var aj=Ar(require("node:path"),1),X_e=require("node:fs"),V_e=aj.default.sep;async function oj(t,e){let n={files:[],calls:0,skip:e?.skip,err:!1,configNames:e?.configNames??["tsconfig.json"]};return new Promise((i,o)=>{K_e(aj.default.resolve(t),n,(r,l)=>r?o(r):i(l))})}function K_e(t,e,n){e.err||(e.calls++,(0,X_e.readdir)(t,{withFileTypes:!0},(i,o=[])=>{if(!e.err)if(i&&!(i.code==="ENOENT"||i.code==="EACCES"||i.code==="EPERM"))e.err=!0,n(i);else{for(let r of o)r.isDirectory()&&!e.skip?.(r.name)?K_e(`${t}${V_e}${r.name}`,e,n):r.isFile()&&e.configNames.includes(r.name)&&e.files.push(`${t}${V_e}${r.name}`);--e.calls===0&&(e.err||n(null,e.files))}}))}function uj(t){let e=Yyt(Qyt(egt(t)));return e.trim()===""?"{}":e}function Yyt(t){let e=!1,n=0,i="",o=null;for(let r=0;r<t.length;r++){let l=t[r];if(l==='"'&&(G_e(t,r)||(e=!e)),e){o=null;continue}if(l===","){o=r;continue}o&&(l==="}"||l==="]"?(i+=t.slice(n,o)+" ",n=o+1,o=null):l.match(/\s/)||(o=null))}return i+t.substring(n)}function G_e(t,e){let n=e-1,i=0;for(;t[n]==="\\";)n-=1,i+=1;return!!(i%2)}function Hx(t,e,n){return t.slice(e,n).replace(/\S/g," ")}var lj=Symbol("singleComment"),q_e=Symbol("multiComment");function Qyt(t){let e=!1,n=!1,i=0,o="";for(let r=0;r<t.length;r++){let l=t[r],s=t[r+1];!n&&l==='"'&&(G_e(t,r)||(e=!e)),!e&&(!n&&l+s==="//"?(o+=t.slice(i,r),i=r,n=lj,r++):n===lj&&l+s===`\r
|
3545
|
+
`),{from:void 0})}catch(re){throw re}finally{J?.unhook()}g.dependencies=GS(g.configPath),p((g.dependencies??[]).flatMap(re=>WP(re,e.folder))),g.configId=V0e(g.configPath,g.dependencies),g.plugins=await lht(k),se&&(g.classNames=await XY(se.root)),g.variants=K0e(g);let Q=(0,dc.default)(g.config,"theme.screens",(0,dc.default)(g.config,"screens",{}));g.screens=Pc(Q)?Object.keys(Q):[],g.enabled=!0,s(),r()}for(let N of e.config.entries){H.add(N.path);for(let R of N.deps)H.add(R.path)}return{projectConfig:e,enabled(){return h},enable(){h=!0},dependencies:()=>H,async reload(){if(!g.v4)return;console.log("---- RELOADING DESIGN SYSTEM ----"),console.log(`---- ${g.configPath} ----`);let N=await Af(g.configPath),R,F=process.hrtime.bigint();try{R=await XO(A,g.modules.tailwindcss.module,g.configPath,N,g.v4Fallback??!1)}catch(X){throw console.error(X),X}let j=Object.create(g,{designSystem:{value:R}}),K=R.getClassList().map(X=>[X[0],{...X[1],color:fu(j,X[0])}]);g.designSystem=R,g.classList=K,g.variants=K0e(g);let B=R.dependencies();for(let X of B)H.add(X);p(Array.from(B));let k=process.hrtime.bigint()-F;console.log(`---- RELOADED IN ${(Number(k)/1e6).toFixed(2)}ms ----`)},state:g,documentSelector(){return _},tryInit:S,async dispose(){g={enabled:!1};for(let N of b)(await N).dispose()},async onUpdateSettings(N){g.enabled&&s(),N.editor?.colorDecorators?r():n.sendNotification("@/tailwindCSS/clearColors")},onFileEvents:I,async onHover(N){return Bh(async()=>{if(!g.enabled)return null;let R=o.getDocument(N.textDocument.uri);return!R||!(await g.editor.getConfiguration(R.uri)).tailwindCSS.hovers||await zd(g,R)?null:Pie(g,R,N.position)},null)},async onCompletion(N){return Bh(async()=>{if(!g.enabled)return null;let R=o.getDocument(N.textDocument.uri);return!R||!(await g.editor.getConfiguration(R.uri)).tailwindCSS.suggestions||await zd(g,R)?null:Bie(g,R,N.position,N.context)},null)},onCompletionResolve(N){return Bh(()=>g.enabled?jie(g,N):null,null)},async onCodeAction(N){return Bh(async()=>{if(!g.enabled)return null;let R=o.getDocument(N.textDocument.uri);return!R||!(await g.editor.getConfiguration(R.uri)).tailwindCSS.codeActions?null:hse(g,N,R)},null)},onDocumentLinks(N){if(!g.enabled)return null;let R=o.getDocument(N.textDocument.uri);if(!R)return null;let F=z7.URI.parse(R.uri).fsPath,j=ms.dirname(F);async function K(B){return B=await A.substituteId(B,j)??B,z7.URI.file(ms.resolve(j,B)).toString()}return gse(g,R,K)},provideDiagnostics:(0,J0e.debounce)(N=>{g.enabled&&AO(g,N)},i.initializationOptions?.testMode?0:500),provideDiagnosticsForce:N=>{g.enabled&&AO(g,N)},async onDocumentColor(N){return Bh(async()=>{if(!g.enabled)return[];let R=o.getDocument(N.textDocument.uri);return R?await zd(g,R)?null:yse(g,R):[]},null)},async onColorPresentation(N){let R=o.getDocument(N.textDocument.uri);if(!R)return[];let F=R.getText(N.range),j=F.match(new RegExp(`-\\[(${W0e.join("|")}|(?:(?:#|rgba?\\(|hsla?\\())[^\\]]+)\\]$`,"i"));if(j===null)return[];let K=j[1],B=W0e.includes(K),k={mode:"rgb",r:N.color.red,g:N.color.green,b:N.color.blue,alpha:N.color.alpha},X=Vb(k);if(!B&&(K.length===4||K.length===5)){let[,...se]=X.match(/^#([a-f\d])\1([a-f\d])\2([a-f\d])\3(?:([a-f\d])\4)?$/i)??[];se.length&&(X=`#${se.filter(Boolean).join("")}`)}X.length===5?X=X.replace(/f$/,""):X.length===9&&(X=X.replace(/ff$/,""));let J=F.substr(0,j.index);return[X,Em(k).replace(/ /g,""),pM(k).replace(/ /g,"").replace(/\d+\.\d+(%?)/g,(se,Q)=>`${Math.round(parseFloat(se))}${Q}`)].map(se=>({label:`${J}-[${se}]`}))},sortClassLists(N){return g.jit?N.map(R=>{let F="",j=R.split(/(\s+)/),K=j.filter((X,J)=>J%2===0),B=j.filter((X,J)=>J%2!==0);K[K.length-1]===""&&K.pop();let k;g.v4?k=g.designSystem.getClassOrder(K):g.jitContext.getClassOrder?k=g.jitContext.getClassOrder(K):k=sht(g,K),K=k.sort(([,X],[,J])=>X===J?0:X===null?-1:J===null?1:Im(X-J)).map(([X])=>X);for(let X=0;X<K.length;X++)F+=`${K[X]}${B[X]??""}`;return F}):N}}}function X0e(t,e){let n=t.config.prefix;return typeof n=="function"?n(e):n+e}function sht(t,e){let n=new Set([X0e(t,"group"),X0e(t,"peer")]),i=[];for(let o of e){let r=t.modules.jit.generateRules.module(new Set([o]),t.jitContext).sort(([l],[s])=>Im(s-l))[0]?.[0]??null;r===null&&n.has(o)&&(r=t.jitContext.layerOrder.components),i.push([o,r])}return i}function aht(t,e,n={}){let i=e.config,o=e.modules.postcss.module,r=e.browserslist,l=r&&r.includes("ie 11")?"ie11":"relaxed",s=typeof t=="function"?t:t.handler;try{s({addUtilities:()=>{},addComponents:()=>{},addBase:()=>{},matchUtilities:()=>{},addVariant:()=>{},e:p=>p,prefix:p=>p,theme:(p,c)=>(0,dc.default)(i,`theme.${p}`,c),variants:()=>[],config:(p,c)=>(0,dc.default)(i,p,c),corePlugins:p=>Array.isArray(i.corePlugins)?i.corePlugins.includes(p):(0,dc.default)(i,`corePlugins.${p}`,!0),target:p=>{if(typeof i.target=="string")return i.target==="browserslist"?l:i.target;let[c,a]=(0,dc.default)(i,"target"),u=(0,dc.default)(a,p,c);return u==="browserslist"?l:u},postcss:o,...n})}catch{}}function oht(t){return t.type==="atrule"}function K0e(t){if(t.v4){let r=Array.from(t.designSystem.getVariants()),l=t.designSystem.theme.prefix??"";return l.length>0&&r.unshift({name:l,values:[],isArbitrary:!1,hasDash:!0,selectors:()=>["&"]}),r}if(t.jitContext?.getVariants)return t.jitContext.getVariants();if(t.jit){let r=[];return Array.from(t.jitContext.variantMap).forEach(([l,s])=>{r.push({name:l,values:[],isArbitrary:!1,hasDash:!0,selectors:()=>{function p(b){let _=t.modules.postcssSelectorParser.module.className();return _.value=b,(0,dc.default)(_,"raws.value",_.value)}let c=(Array.isArray(s[0])?s:[s]).map(([b,_])=>_),a="__variant_placeholder__",u=t.modules.postcss.module.root({nodes:[t.modules.postcss.module.rule({selector:`.${p(a)}`,nodes:[]})]}),d=t.modules.postcssSelectorParser.module(b=>b.first.filter(({type:_})=>_==="class").pop().value);function H(b){return d.transformSync(b)}function h(b){return u.each(_=>{_.type==="rule"&&(_.selectors=_.selectors.map(m=>b({get className(){return H(m)},selector:m})))}),u}let y=[];for(let b of c){let _,m=u.clone(),g=pq(()=>b({container:m,separator:t.separator,modifySelectors:h,format:A=>{_=A.replace(/:merge\(([^)]+)\)/g,"$1")},wrap:A=>{oht(A)&&(_=`@${A.name} ${A.params}`)}}));if(_||(_=g),_){y.push(_);continue}m.walkDecls(A=>{A.remove()}),_=m.toString().replace(`.${p(`${l}:${a}`)}`,"&").replace(/(?<!\\)[{}]/g,"").replace(/\s*\n\s*/g," ").trim(),_.includes(a)||y.push(_)}return y}})}),r}let e=t.config,n=t.modules.tailwindcss.version,i=["responsive","hover"];return Tn(n,"0.3.0")&&i.push("focus","group-hover"),Tn(n,"0.5.0")&&i.push("active"),Tn(n,"0.7.0")&&i.push("focus-within"),Tn(n,"1.0.0-beta.1")&&i.push("default"),Tn(n,"1.1.0")&&i.push("first","last","odd","even","disabled","visited"),Tn(n,"1.3.0")&&i.push("group-focus"),Tn(n,"1.5.0")&&i.push("focus-visible","checked"),Tn(n,"1.6.0")&&i.push("motion-safe","motion-reduce"),Tn(n,"2.0.0-alpha.1")&&i.push("dark"),(Array.isArray(e.plugins)?e.plugins:[]).forEach(r=>{aht(r,t,{addVariant:l=>{i.push(l)}})}),i.map(r=>({name:r,values:[],isArbitrary:!1,hasDash:!0,selectors:()=>[]}))}async function lht(t){let e=t.plugins;return Array.isArray(e)?Promise.all(e.map(async n=>{let i=n.config;Pc(i)||(i={});let o={theme:Pc(i.theme)?Object.keys(i.theme):[],variants:Pc(i.variants)?Object.keys(i.variants):[]},r=n.handler||n,l=typeof r.name=="string"&&r.name!=="handler"&&r.name!==""?r.name:null;try{r()}catch(s){let p=Z0e.default.parse(s);if(p.length===0)return{name:l};let c=p[0].fileName,a=ms.dirname(c);if(!z0e.default.sync({cwd:a}))return{name:l};let d;try{d=require(d)}catch{return{name:l}}if(d.name&&ms.resolve(a,d.main||"index.js")===c)return{name:d.name,homepage:d.homepage,contributes:o}}return{name:l}})):[]}function uht(t,e){try{let n=vH.default.sync(i=>{let o=ms.join(i,"package.json");if(vH.default.sync.exists(o))return o;if(i===ms.normalize(e))return vH.default.stop},{cwd:t});return n?ms.dirname(n):e}catch{return e}}function q0e(t,e,n,i){let o=i??require(t),r=o.content?.files??o.content,l=Array.isArray(r)?r:[],s=Tn(e,"3.2.0")?o.future?.relativeContentPathsByDefault||o.content?.relative:!1,p;return s?p=ms.dirname(t):p=uht(ms.dirname(t),n),l.filter(c=>typeof c=="string").map(c=>c.startsWith("!")?`!${ms.resolve(p,c.slice(1))}`:ms.resolve(p,c)).map(c=>({pattern:eo(ia(c)),priority:1}))}var abe=Ar(sbe());function vht(){return{editor:{tabSize:2},tailwindCSS:{inspectPort:null,emmetCompletions:!1,classAttributes:["class","className","ngClass","class:list"],codeActions:!0,hovers:!0,suggestions:!0,validate:!0,colorDecorators:!0,rootFontSize:16,lint:{cssConflict:"warning",invalidApply:"error",invalidScreen:"error",invalidVariant:"error",invalidConfigPath:"error",invalidTailwindDirective:"error",invalidSourceDirective:"error",recommendedVariantOrder:"warning"},showPixelEquivalents:!0,includeLanguages:{},files:{exclude:["**/.git/**","**/node_modules/**","**/.hg/**","**/.svn/**"]},experimental:{classRegex:[],configFile:null}}}}function obe(t){let e=new Map;async function n(o){let r=e.get(o);return r||(r=await i(o),e.set(o,r)),r}async function i(o){let[r,l]=await Promise.all([t.workspace.getConfiguration({section:"editor",scopeUri:o}),t.workspace.getConfiguration({section:"tailwindCSS",scopeUri:o})]);return r=Pc(r)?r:{},l=Pc(l)?l:{},(0,abe.default)(vht(),{editor:r,tailwindCSS:l},{arrayMerge:(s,p,c)=>p})}return{get:n,clear(){e.clear()}}}var Ybe=Ar(require("node:os")),ha=Ar(require("node:path")),c1=Ar(require("node:fs/promises")),Qbe=Ar(zbe()),e_e=Ar(u0());var JP=class{constructor(){this.parents=new Map;this.children=new Map;this.nodes=new Map}add(e,n){return this.nodes.has(e)?this.nodes.get(e):(this.nodes.set(e,n),this.parents.set(e,new Set),this.children.set(e,new Set),n)}connect(e,n){let i=this.children.get(e);if(!i)throw new Error(`Node ${e} does not exist`);let o=this.parents.get(n);if(!o)throw new Error(`Node ${n} does not exist`);o.add(e),i.add(n)}*descendants(e){let n=[],i=new Set;for(let o of this.children.get(e))n.push(o);for(;n.length>0;){let o=n.shift();if(!i.has(o)){yield this.nodes.get(o),i.add(o);for(let r of this.children.get(o))n.push(r)}}}*roots(){for(let[e,n]of this.parents)n.size===0&&(yield this.nodes.get(e))}*leaves(){for(let[e,n]of this.children)n.size===0&&(yield this.nodes.get(e))}};var YP=class extends Map{remember(e,n){let i=super.get(e);return i||(i=n(e),this.set(e,i)),i}};var QP=Ar(YA()),tg=Ar(require("node:path"));async function wB(t,e){async function n(i){let o=tg.join(i,"package.json");if(await QP.default.exists(o))return o;if(i===tg.normalize(e))return QP.default.stop}try{let i=await(0,QP.default)(n,{cwd:t});return i?tg.dirname(i):e}catch{return e}}async function Umt(t){let e=await import(t);return e.scanDir?e:null}async function Zbe(t){let e=await Umt(t.oxidePath);if(!e)return null;if(Ld(t.oxideVersion,"4.0.0-alpha.18")){let i=e.scanDir?.({base:t.basePath,globs:!0});return{files:i.files,globs:i.globs.map(o=>({base:o.base,pattern:o.glob}))}}if(Ld(t.oxideVersion,"4.0.0-alpha.19")){let i=e.scanDir({base:t.basePath,sources:t.sources});return{files:i.files,globs:i.globs}}if(Ld(t.oxideVersion,"4.0.0-alpha.30")){let i=new e.Scanner({detectSources:{base:t.basePath},sources:t.sources});return{files:i.files,globs:i.globs}}let n=new e.Scanner({sources:[{base:t.basePath,pattern:"**/*"},...t.sources]});return{files:n.files,globs:n.globs}}var Vmt=/@import\s*['"]tailwindcss(?:\/[^'"]+)?['"]/,Xmt=/@(theme|plugin|utility|custom-variant|variant|reference)\s*[^;{]+[;{]/,Kmt=/--(alpha|spacing|theme)\(/,qmt=/@tailwind\s*(base|preflight|components|variants|screens)+;/,Gmt=/@tailwind\s*utilities\s*[^;]*;/,zmt=/@tailwind\s*[^;]+;/,Zmt=/@(config|apply)\s*[^;{]+[;{]/,Jmt=/@import\s*['"]/;function Jbe(t){return Vmt.test(t)?{root:!0,versions:["4"]}:Xmt.test(t)?Gmt.test(t)?{root:!0,versions:["4"]}:{root:!1,versions:["4"]}:Kmt.test(t)?{root:!1,versions:["4"]}:qmt.test(t)?{root:!1,versions:["3"]}:zmt.test(t)?{root:!0,versions:["4","3"]}:Zmt.test(t)?{root:!1,versions:["4","3"]}:Jmt.test(t)?{root:!0,versions:["4","3"]}:{root:!1,versions:[]}}var ex=class{constructor(e,n,i){this.base=e;this.settings=n;this.resolver=i}async search(){let e=await this.findConfigs(),n=await Promise.allSettled(e.map(o=>this.createProject(o))),i=[];for(let o of n)o.status==="rejected"?console.error(`[GLOBAL] Error creating project: ${o.reason}`):o.status==="fulfilled"&&o.value&&i.push(o.value);i.length===1&&i[0].documentSelector.push({pattern:ia(ha.join(this.base,"**")),priority:5});for(let o of i){o.folder=eo(o.folder),o.configPath=eo(o.configPath),o.config.path=eo(o.config.path);for(let r of o.config.entries)r.path=eo(r.path);for(let r of o.documentSelector)r.pattern=eo(r.pattern)}return i}async loadAllFromWorkspace(e){return Promise.all(e.map(n=>this.loadFromWorkspace(n[0],n[1])))}async loadFromWorkspace(e,n){let i=e.endsWith(".css")?{type:"css",path:e,source:"css",entries:[],content:[],packageRoot:""}:{type:"js",path:e,source:"js",entries:[],content:[],packageRoot:""},o=await this.detectTailwindVersion(i);return i.packageRoot=await wB(ha.dirname(i.path),this.base),{config:i,folder:this.base,isUserConfigured:!0,configPath:i.path,documentSelector:n.map(r=>({priority:0,pattern:r})),tailwind:o}}async createProject(e){let n=await this.detectTailwindVersion(e),i=e.entries.flatMap(r=>r.meta?.versions??[]);if(console.log(JSON.stringify({tailwind:n,path:e.path})),e.type==="js"&&e.source==="css"&&(n.isDefaultVersion||!n.features.includes("css-at-config-as-project")))return null;if(e.type==="css"){if(!n.features.includes("css-at-theme"))return null;if(!i.includes("4"))return console.warn(`The config ${e.path} looks like it might be for a different Tailwind CSS version. Skipping.`),null;if(t_e(e.path))return console.warn(`The config ${e.path} requires a preprocessor and is not supported by Tailwind CSS v4.0.`),null}if(e.type==="js"&&n.features.includes("css-at-theme")||e.type==="js"&&(e.path.endsWith(".ts")||e.path.endsWith(".mjs"))&&!n.features.includes("transpiled-configs"))return null;e.packageRoot=await wB(ha.dirname(e.path),this.base);let o=[];for(let r of e.entries)r.type==="css"&&o.push({pattern:r.path,priority:0});o.push({pattern:e.path,priority:0});for await(let r of Ymt(e,n.features,this.resolver))o.push(r);for(let r of e.entries)r.type==="css"&&o.push({pattern:ia(ha.join(ha.dirname(r.path),"**")),priority:2});return o.push({pattern:ia(ha.join(ha.dirname(e.path),"**")),priority:3}),o.push({pattern:ia(ha.join(e.packageRoot,"**")),priority:4}),o.sort((r,l)=>r.priority-l.priority),o=o.filter(({pattern:r},l,s)=>s.findIndex(({pattern:p})=>p===r)===l),{config:e,folder:this.base,isUserConfigured:!1,configPath:e.path,documentSelector:o,tailwind:n}}async findConfigs(){let e=await(0,Qbe.default)([`**/${Rh}`,`**/${bd}`],{cwd:this.base,ignore:this.settings.tailwindCSS.files.exclude,onlyFiles:!0,absolute:!0,suppressErrors:!0,dot:!0,concurrency:Math.max(Ybe.cpus().length,1)}),n=await Promise.all(e.map(H=>c1.realpath(H)));e=e.filter((H,h)=>{let y=n[h];return H===y?!0:!e.includes(y)}),e=e.map(H=>ia(H)),e=Array.from(new Set(e)).sort();let i=new YP,o=(0,e_e.default)(`**/${bd}`,{dot:!0}),r=e.map(H=>o(H)?new tx("css",H):new tx("js",H,[i.remember(H,()=>({source:"js",type:"js",path:H,entries:[],packageRoot:null,content:[]}))])),l=r.filter(H=>H.type==="css");await Promise.all(l.map(H=>H.read())),await Promise.all(l.map(H=>H.resolvePossibleVersions()));let s=[];for(let H of l){if(!H.content||!H.meta||H.meta.versions.length===0)continue;let h=H.configPathInCss();h&&H.configs.push(i.remember(h,()=>({source:"css",type:"js",path:h,entries:[],packageRoot:null,content:[]}))),s.push(H)}await Promise.all(s.map(H=>H.resolveImports(this.resolver))),await Promise.all(s.map(H=>H.resolveRealpaths())),await Promise.all(s.map(H=>H.resolveSourceDirectives()));let p=new JP,c=null,a=null,u=null;for(let H of s){p.add(H.realpath,H);for(let h of H.deps)p.add(h.realpath,h),p.connect(H.realpath,h.realpath);H.realpath.includes("node_modules/tailwindcss/index.css")?c=H.realpath:H.realpath.includes("node_modules/tailwindcss/theme.css")?a=H.realpath:H.realpath.includes("node_modules/tailwindcss/utilities.css")&&(u=H.realpath)}c&&a&&p.connect(c,a),c&&u&&p.connect(c,u);let d=Array.from(p.roots());d.sort((H,h)=>H.meta.root===h.meta.root?0:H.meta.root?-1:1);for(let H of d){if(!H.meta)continue;let h=i.remember(H.path,()=>({source:"css",type:"css",path:H.path,entries:[],packageRoot:null,content:[{kind:"auto"}]}));H.configs.push(h);for(let y of p.descendants(H.realpath))y.configs.push(h)}for(let H of r)for(let h of H.configs)h.entries.push(H);return Array.from(i.values())}async detectTailwindVersion(e){try{let r=await this.resolver.resolveCjsId("tailwindcss/package.json",ha.dirname(e.path)),{version:l}=require(r),s;if(this.resolver.hasPnP()){let c=await this.resolver.resolveCjsId("tailwindcss",ha.dirname(e.path));s=require(c)}else{let c=await this.resolver.resolveJsId("tailwindcss",ha.dirname(e.path));s=await import(gp(c).href)}let p=bf(l,s);if(typeof l=="string")return{version:l,features:p,isDefaultVersion:!1}}catch{}if(e.type==="css"){let{version:r}=h3(),l=await Promise.resolve().then(()=>(f3(),H3)),s=bf(r,l);return{version:r,features:s,isDefaultVersion:!0}}let{version:n}=SE(),i=K7(),o=bf(n,i);return{version:n,features:o,isDefaultVersion:!0}}};function Ymt(t,e,n){if(t.type==="css")return eyt(t,n);if(t.type==="js")return Qmt(t,e)}async function*Qmt(t,e,n){let i;try{i=n??require(t.path)}catch{return}let o=i.content?.files??i.content,r=Array.isArray(o)?o:[],s=(e.includes("relative-content-paths")?i.future?.relativeContentPathsByDefault||i.content?.relative:!1)?ha.dirname(t.path):t.packageRoot;for(let p of r){if(typeof p!="string")continue;let c=p.startsWith("!")?`!${ha.resolve(s,p.slice(1))}`:ha.resolve(s,p);yield{pattern:ia(c),priority:1}}}async function*eyt(t,e){let n=!1;for(let i of t.content)if(i.kind==="file")yield{pattern:ia(i.file),priority:1};else if(i.kind==="auto"&&!n){n=!0;let o=t.entries.flatMap(r=>r.sources);for await(let r of tyt(t.packageRoot,t.path,o,e))yield{pattern:r,priority:1}}}async function*tyt(t,e,n,i){try{let o=await i.resolveJsId("@tailwindcss/oxide",ha.dirname(t));o=gp(o).href;let r=await i.resolveJsId("@tailwindcss/oxide/package.json",ha.dirname(t)),l=JSON.parse(await c1.readFile(r,"utf8")),s=await Zbe({oxidePath:o,oxideVersion:l.version,basePath:t,sources:n.map(p=>({base:ha.dirname(e),pattern:p}))});if(!s)return;for(let p of s.files)yield ia(p);for(let{base:p,pattern:c}of s.globs)yield ia(p)+"/"+c}catch{}}var tx=class t{constructor(e,n,i=[]){this.type=e;this.path=n;this.configs=i;this.deps=[];this.sources=[];this.meta=null}async read(){try{this.content=await Af(this.path)}catch{this.content=null}}async resolveImports(e){if(!t_e(this.path))try{let n=await eL({resolver:e,loose:!0}).process(this.content,{from:this.path}),i=n.messages.filter(o=>o.type==="dependency");i=i.filter(o=>!o.file.startsWith("/virtual:missing/")),this.deps=i.map(o=>new t("css",ia(o.file))),this.content=n.css}catch(n){console.debug(`Unable to resolve imports for ${this.path}.`),console.debug("This may result in failure to locate Tailwind CSS projects."),console.error(n)}}async resolveRealpaths(){this.realpath=ia(await c1.realpath(this.path)),await Promise.all(this.deps.map(e=>e.resolveRealpaths()))}async resolveSourceDirectives(){try{if(this.sources.length>0)return;await Ml([qae(this.sources)]).process(this.content,{from:this.realpath})}catch{}}async resolvePossibleVersions(){this.meta=this.content?Jbe(this.content):null}configPathInCss(){if(!this.content)return null;let e=this.content.match(/@config\s*(?<config>'[^']+'|"[^"]+")/);return e?ia(ha.resolve(ha.dirname(this.path),e.groups.config.slice(1,-1))):null}};function t_e(t){let e=ha.extname(t);return e===".scss"||e===".sass"||e===".less"||e===".styl"||e===".pcss"}var Hgt=Ar(require("node:fs")),sEe=Ar(require("node:path")),ug=Ar(ED());var r_e=Ar(YA()),rx=Ar(require("node:path"));var $B=new Map;async function n_e(t){let e=$B.get(t);if(e!==void 0)return e;let n=await ryt(rx.normalize(t));if(!n)return $B.set(t,null),null;let r=(await import(gp(n).href)).default;return r.setup(),$B.set(t,r),r}async function ryt(t){let e=[".pnp.js",".pnp.cjs"];for(let n of e){let i=rx.join(t,n);if(await r_e.default.exists(i))return i}return null}var eh=Ar(require("node:path")),nEe=Ar(R_e());var Qf=Ar(require("node:path"),1),U_e=Ar(require("node:fs"),1);var qo=Ar(require("node:path"),1),j_e=require("node:fs"),Kyt=new RegExp("\\"+qo.default.posix.sep,"g"),qyt=new RegExp("\\"+qo.default.sep,"g"),JB=new Map,ag="**/*",px=[".ts",".tsx",".mts",".cts"],Gyt=[".js",".jsx",".mjs",".cjs"],QB=px.concat(Gyt),zyt=`\\.(?:${px.map(t=>t.substring(1)).join("|")})`,Zyt=`\\.(?:${QB.map(t=>t.substring(1)).join("|")})`,dx=qo.default.posix.sep===qo.default.sep;function h1(){let t,e;return{promise:new Promise((i,o)=>{t=i,e=o}),resolve:t,reject:e}}async function ej(t,e){if(qo.default.extname(t)!==".json")return;let n=qo.default.resolve(t);return e&&(e.hasParseResult(n)||e.hasParseResult(t))?n:j_e.promises.stat(n).then(i=>{if(i.isFile()||i.isFIFO())return n;throw new Error(`${t} exists but is not a regular file.`)})}var tj=dx?t=>t.includes("/node_modules/"):t=>t.match(/[/\\]node_modules[/\\]/),YB=dx?t=>t:t=>t.replace(Kyt,qo.default.sep),Yf=dx?t=>t:t=>t.replace(qyt,qo.default.posix.sep),og=dx?(t,e)=>t?qo.default.resolve(t,e):qo.default.resolve(e):(t,e)=>Yf(t?qo.default.resolve(YB(t),YB(e)):qo.default.resolve(YB(e)));function rj(t,e){let n=qo.default.dirname(t.tsconfigFile);return t.tsconfig.references.map(i=>{let o=i.path.endsWith(".json")?i.path:qo.default.join(i.path,e?.configName??"tsconfig.json");return og(n,o)})}function nj(t,e){let i=e.tsconfig.compilerOptions?.allowJs?QB:px;if(e.referenced&&i.some(o=>t.endsWith(o))&&!F_e(t,e)){let o=e.referenced.find(r=>F_e(t,r));if(o)return o}return e}function F_e(t,e){let n=Yf(qo.default.dirname(e.tsconfigFile)),i=(e.tsconfig.files||[]).map(s=>og(n,s)),o=og(null,t);if(i.includes(t))return!0;let r=e.tsconfig.compilerOptions?.allowJs;return B_e(o,n,e.tsconfig.include||(e.tsconfig.files?[]:[ag]),r)?!B_e(o,n,e.tsconfig.exclude||[],r):!1}function B_e(t,e,n,i){let o=i?QB:px;return n.some(r=>{let l=r.length,s=!1,p=!1,c=!1,a=-1;for(let h=r.length-1;h>-1;h--){let y=r[h];if(s||(y==="*"||y==="?")&&(l=h,s=!0),c||(y==="."?p=!0:y==="/"&&(a=h,c=!0)),s&&c)break}if(!p&&(!s||l<a)&&(r+=`${r.endsWith("/")?"":"/"}${ag}`,l=r.length-1,s=!0),l<r.length-1&&!t.endsWith(r.slice(l+1))||r.endsWith("*")&&!o.some(h=>t.endsWith(h)))return!1;if(r===ag)return t.startsWith(`${e}/`);let u=og(e,r),d=-1;for(let h=0;h<u.length;h++)if(u[h]==="*"||u[h]==="?"){d=h,s=!0;break}if(d>1&&!t.startsWith(u.slice(0,d-1)))return!1;if(s){if(d+ag.length===u.length-(r.length-1-l)&&u.slice(d,d+ag.length)===ag)return!0}else return t===u;if(JB.has(u))return JB.get(u).test(t);let H=Jyt(u,i);return JB.set(u,H),H.test(t)})}function Jyt(t,e){let n="^";for(let i=0;i<t.length;i++){let o=t[i];if(o==="?"){n+="[^\\/]";continue}if(o==="*"){if(t[i+1]==="*"&&t[i+2]==="/"){i+=2,n+="(?:[^\\/]*\\/)*";continue}n+="[^\\/]*";continue}"/.+^${}()|[]\\".includes(o)&&(n+="\\"),n+=o}return t.endsWith("*")&&(n+=e?Zyt:zyt),n+="$",new RegExp(n)}function ij(t,e){return JSON.parse(JSON.stringify(t).replaceAll(/"\${configDir}/g,`"${Yf(e)}`))}async function sj(t,e){let n=Qf.default.dirname(Qf.default.resolve(t));if(e?.ignoreNodeModules&&tj(n))return null;let i=e?.cache,o=e?.configName??"tsconfig.json";if(i?.hasConfigPath(n,o))return i.getConfigPath(n,o);let{promise:r,resolve:l,reject:s}=h1();return e?.root&&!Qf.default.isAbsolute(e.root)&&(e.root=Qf.default.resolve(e.root)),W_e(n,{promise:r,resolve:l,reject:s},e),r}function W_e(t,{resolve:e,reject:n,promise:i},o){let{cache:r,root:l,configName:s}=o??{};if(r)if(r.hasConfigPath(t,s)){let c;try{c=r.getConfigPath(t,s)}catch(a){n(a);return}c?.then?c.then(e).catch(n):e(c)}else r.setConfigPath(t,i,s);let p=Qf.default.join(t,o?.configName??"tsconfig.json");U_e.default.stat(p,(c,a)=>{if(a&&(a.isFile()||a.isFIFO()))e(p);else if(c?.code!=="ENOENT")n(c);else{let u;l===t||(u=Qf.default.dirname(t))===t?e(null):W_e(u,{promise:i,resolve:e,reject:n},o)}})}var aj=Ar(require("node:path"),1),X_e=require("node:fs"),V_e=aj.default.sep;async function oj(t,e){let n={files:[],calls:0,skip:e?.skip,err:!1,configNames:e?.configNames??["tsconfig.json"]};return new Promise((i,o)=>{K_e(aj.default.resolve(t),n,(r,l)=>r?o(r):i(l))})}function K_e(t,e,n){e.err||(e.calls++,(0,X_e.readdir)(t,{withFileTypes:!0},(i,o=[])=>{if(!e.err)if(i&&!(i.code==="ENOENT"||i.code==="EACCES"||i.code==="EPERM"))e.err=!0,n(i);else{for(let r of o)r.isDirectory()&&!e.skip?.(r.name)?K_e(`${t}${V_e}${r.name}`,e,n):r.isFile()&&e.configNames.includes(r.name)&&e.files.push(`${t}${V_e}${r.name}`);--e.calls===0&&(e.err||n(null,e.files))}}))}function uj(t){let e=Yyt(Qyt(egt(t)));return e.trim()===""?"{}":e}function Yyt(t){let e=!1,n=0,i="",o=null;for(let r=0;r<t.length;r++){let l=t[r];if(l==='"'&&(G_e(t,r)||(e=!e)),e){o=null;continue}if(l===","){o=r;continue}o&&(l==="}"||l==="]"?(i+=t.slice(n,o)+" ",n=o+1,o=null):l.match(/\s/)||(o=null))}return i+t.substring(n)}function G_e(t,e){let n=e-1,i=0;for(;t[n]==="\\";)n-=1,i+=1;return!!(i%2)}function Hx(t,e,n){return t.slice(e,n).replace(/\S/g," ")}var lj=Symbol("singleComment"),q_e=Symbol("multiComment");function Qyt(t){let e=!1,n=!1,i=0,o="";for(let r=0;r<t.length;r++){let l=t[r],s=t[r+1];!n&&l==='"'&&(G_e(t,r)||(e=!e)),!e&&(!n&&l+s==="//"?(o+=t.slice(i,r),i=r,n=lj,r++):n===lj&&l+s===`\r
|
3546
3546
|
`?(r++,n=!1,o+=Hx(t,i,r),i=r):n===lj&&l===`
|
3547
|
-
`?(n=!1,o+=Hx(t,i,r),i=r):!n&&l+s==="/*"?(o+=t.slice(i,r),i=r,n=q_e,r++):n===q_e&&l+s==="*/"&&(r++,n=!1,o+=Hx(t,i,r+1),i=r+1))}return o+(n?Hx(t.slice(i)):t.slice(i))}function egt(t){return t.charCodeAt(0)===65279?t.slice(1):t}var Cu=Ar(require("node:path"),1),Y_e=require("node:fs"),Q_e=require("module");var tgt={tsconfigFile:null,tsconfig:{}};async function pj(t,e){let n=e?.cache;if(n?.hasParseResult(t))return z_e(t,n,e);let{resolve:i,reject:o,promise:r}=h1();n?.setParseResult(t,r,!0);try{let l=await ej(t,n)||await sj(t,e);if(!l)return i(tgt),r;let s;t!==l&&n?.hasParseResult(l)?s=await z_e(l,n,e):(s=await dj(l,n,t===l),await Promise.all([Hj(s,n),eEe(s,e)])),s.tsconfig=ij(s.tsconfig,Cu.default.dirname(l)),i(nj(t,s))}catch(l){o(l)}return r}async function z_e(t,e,n){let i=await e.getParseResult(t);if(i.tsconfig.extends&&!i.extended||i.tsconfig.references&&!i.referenced){let o=Promise.all([Hj(i,e),eEe(i,n)]).then(()=>i);return e.setParseResult(t,o,!0),o}return i}async function dj(t,e,n){if(!n&&e?.hasParseResult(t)&&!e.getParseResult(t)._isRootFile_)return e.getParseResult(t);let i=Y_e.promises.readFile(t,"utf-8").then(uj).then(o=>{let r=JSON.parse(o);return agt(r,t),{tsconfigFile:t,tsconfig:rgt(r,Cu.default.dirname(t))}}).catch(o=>{throw new lg(`parsing ${t} failed: ${o}`,"PARSE_FILE",t,o)});return!n&&(!e?.hasParseResult(t)||!e.getParseResult(t)._isRootFile_)&&e?.setParseResult(t,i),i}function rgt(t,e){let n=t.compilerOptions?.baseUrl;return n&&!n.startsWith("${")&&!Cu.default.isAbsolute(n)&&(t.compilerOptions.baseUrl=og(e,n)),t}async function eEe(t,e){if(!t.tsconfig.references)return;let n=rj(t,e),i=await Promise.all(n.map(o=>dj(o,e?.cache)));await Promise.all(i.map(o=>Hj(o,e?.cache))),i.forEach(o=>{o.solution=t}),t.referenced=i}async function Hj(t,e){if(!t.tsconfig.extends)return;let n=[{tsconfigFile:t.tsconfigFile,tsconfig:JSON.parse(JSON.stringify(t.tsconfig))}],i=0,o=[],r=0;for(;i<n.length;){let l=n[i];if(o.push(l.tsconfigFile),l.tsconfig.extends){r+=1;let s;Array.isArray(l.tsconfig.extends)?s=l.tsconfig.extends.reverse().map(c=>Z_e(c,l.tsconfigFile)):s=[Z_e(l.tsconfig.extends,l.tsconfigFile)];let p=s.find(c=>o.includes(c));if(p){let c=o.concat([p]).join(" -> ");throw new lg(`Circular dependency in "extends": ${c}`,"EXTENDS_CIRCULAR",t.tsconfigFile)}n.splice(i+1,0,...await Promise.all(s.map(c=>dj(c,e))))}else o.splice(-r),r=0;i=i+1}t.extended=n;for(let l of t.extended.slice(1))igt(t,l)}function Z_e(t,e){t===".."&&(t="../tsconfig.json");let n=(0,Q_e.createRequire)(e),i;try{return n.resolve(t)}catch(o){i=o}if(t[0]!=="."&&!Cu.default.isAbsolute(t))try{return n.resolve(`${t}/tsconfig.json`)}catch(o){i=o}throw new lg(`failed to resolve "extends":"${t}" in ${e}`,"EXTENDS_RESOLVE",e,i)}var ngt=["compilerOptions","files","include","exclude","watchOptions","compileOnSave","typeAcquisition","buildOptions"];function igt(t,e){let n=t.tsconfig,i=e.tsconfig,o=Yf(Cu.default.relative(Cu.default.dirname(t.tsconfigFile),Cu.default.dirname(e.tsconfigFile)));for(let r of Object.keys(i).filter(l=>ngt.includes(l)))if(r==="compilerOptions"){n.compilerOptions||(n.compilerOptions={});for(let l of Object.keys(i.compilerOptions))Object.prototype.hasOwnProperty.call(n.compilerOptions,l)||(n.compilerOptions[l]=cj(l,i.compilerOptions[l],o))}else if(n[r]===void 0)if(r==="watchOptions"){n.watchOptions={};for(let l of Object.keys(i.watchOptions))n.watchOptions[l]=cj(l,i.watchOptions[l],o)}else n[r]=cj(r,i[r],o)}var sgt=["files","include","exclude","baseUrl","rootDir","rootDirs","typeRoots","outDir","outFile","declarationDir","excludeDirectories","excludeFiles"];function cj(t,e,n){return sgt.includes(t)?Array.isArray(e)?e.map(i=>J_e(i,n)):J_e(e,n):e}function J_e(t,e){return Cu.default.isAbsolute(t)||t.startsWith("${configDir}")?t:Cu.default.posix.normalize(Cu.default.posix.join(e,t))}var lg=class t extends Error{code;cause;tsconfigFile;constructor(e,n,i,o){super(e),Object.setPrototypeOf(this,t.prototype),this.name=t.name,this.code=n,this.cause=o,this.tsconfigFile=i}};function agt(t,e){lgt(e)&&(t.compilerOptions={...ogt,...t.compilerOptions})}var ogt={allowJs:!0,maxNodeModuleJsDepth:2,allowSyntheticDefaultImports:!0,skipLibCheck:!0,noEmit:!0};function lgt(t){return Cu.default.basename(t)==="jsconfig.json"}var m1=class{clear(){this.#e.clear(),this.#t.clear()}hasConfigPath(e,n="tsconfig.json"){return this.#e.has(`${e}/${n}`)}getConfigPath(e,n="tsconfig.json"){let i=`${e}/${n}`,o=this.#e.get(i);if(o==null||o.length||o.then)return o;throw o}hasParseResult(e){return this.#t.has(e)}getParseResult(e){let n=this.#t.get(e);if(n.then||n.tsconfig)return n;throw n}setParseResult(e,n,i=!1){Object.defineProperty(n,"_isRootFile_",{value:i,writable:!1,enumerable:!1,configurable:!1}),this.#t.set(e,n),n.then(o=>{this.#t.get(e)===n&&this.#t.set(e,o)}).catch(o=>{this.#t.get(e)===n&&this.#t.set(e,o)})}setConfigPath(e,n,i="tsconfig.json"){let o=`${e}/${i}`;this.#e.set(o,n),n.then(r=>{this.#e.get(o)===n&&this.#e.set(o,r)}).catch(r=>{this.#e.get(o)===n&&this.#e.set(o,r)})}#e=new Map;#t=new Map};var fx=class extends Map{constructor(n){super();this.factory=n}get(n){let i=super.get(n);return i===void 0&&(i=this.factory(n,this),this.set(n,i)),i}};async function iEe(t){let{configs:e,errors:n}=await tEe(t),i=await rEe(e);async function o(p,c){for(let a of fj(c))for(let{match:u}of i.get(a))try{return await u(p)}catch{return null}return null}async function r(p,c){for(let a of fj(c))for(let{match:u}of i.get(a))try{return await u(p,{mustExist:!1})}catch{return null}return null}async function l(p){for(let c of fj(p))for(let{paths:a}of i.get(c))if(Object.keys(a).length)return a;return{}}async function s(){let{configs:p,errors:c}=await tEe(t);if(i=await rEe(p),c.length)throw new AggregateError(c)}return{resolveId:o,substituteId:r,paths:l,refresh:s,errors:n}}async function tEe(t){let e=await oj(t,{configNames:["tsconfig.json","jsconfig.json"],skip(r){return r==="node_modules"||r===".git"}}),n={root:t,cache:new m1},i=new Set,o=[];for(let r of e)try{let l=await pj(r,n);i.add(l)}catch(l){o.push(l)}for(let r of i)if(r.referenced){for(let l of r.referenced)i.add(l);i.delete(r),i.add(r),r.referenced=void 0}for(let r of o)console.error(r);return{configs:i,errors:o}}async function rEe(t){let e=new fx(()=>[]),n=(i,o)=>o(void 0,!0);for(let i of t){let c=function(a,{mustExist:u=!0}={}){p??=nEe.createMatchPathAsync(s,r.paths??{},void 0,l!==void 0);let d=u===!1?a.endsWith("/"):!1;return d&&(a+="__placeholder__"),new Promise((H,h)=>{p(a,void 0,u===!1?n:void 0,void 0,(y,b)=>y?h(y):(d&&(b=b.replace(/__placeholder__$/,"")),H(b)))})},o=eo(ia(eh.dirname(i.tsconfigFile))),r=i.tsconfig.compilerOptions??{},l=dgt(i),s=eh.resolve(o,l||""),p;e.get(o).push({match:c,paths:r.paths??{}})}return e}function*fj(t){let e=eo(ia(t)),n;for(;e!==n;)yield e,n=e,e=eh.dirname(e);return null}function dgt(t){let e=t.tsconfig.compilerOptions?.baseUrl;if(e)return e;for(let n of t.extended??[])if((n.tsconfig.compilerOptions??{})?.paths)return eh.dirname(n.tsconfigFile);return eh.dirname(t.tsconfigFile)}async function hj(t){let e=null;typeof t.pnp=="object"?e=t.pnp:t.pnp&&(e=await n_e(t.root));let n=t.fileSystem?t.fileSystem:new ug.CachedInputFileSystem(Hgt,4e3),i=null;if(typeof t.tsconfig=="object")i=t.tsconfig;else if(t.tsconfig)try{i=await iEe(t.root)}catch(y){console.error("Failed to load tsconfig",y)}let o=ug.ResolverFactory.createResolver({fileSystem:n,extensions:[".mjs",".js",".node",".mts",".ts"],mainFields:["module"],conditionNames:["node","import"],pnpApi:e}),r=ug.ResolverFactory.createResolver({fileSystem:n,extensions:[".cjs",".js",".json",".node",".cts",".ts"],mainFields:["main"],conditionNames:["node","require"],pnpApi:e}),l=ug.ResolverFactory.createResolver({fileSystem:n,extensions:[".css"],mainFields:["style"],conditionNames:["style"],pnpApi:e,preferRelative:!0});async function s(y,b,_){if(sEe.sep==="\\"){if(b.startsWith("\\\\")||b.startsWith("//"))return b;_.startsWith("//")&&(_=`\\\\${_.slice(2)}`)}if(i){let m=await i.resolveId(b,_);m&&(b=m)}return b=Nw(b),_=Nw(_),new Promise((m,g)=>{y.resolve({},_,b,{},(A,L)=>{A?g(A):m(L)})})}async function p(y,b){try{return await s(o,y,b)||y}catch{return await s(r,y,b)||y}}async function c(y,b){return await s(r,y,b)||y}async function a(y,b){return await s(l,y,b)||y}async function u(y,b){return await i?.substituteId(y,b)??y}async function d(y){return i?await i.paths(y):{}}async function H(){await i?.refresh()}async function h(){return!!e}return{resolveJsId:p,resolveCjsId:c,resolveCssId:a,substituteId:u,refresh:H,hasPnP:h,aliases:d,child(y){return hj({...t,...y,pnp:y.pnp??e,tsconfig:y.tsconfig??i,fileSystem:y.fileSystem??n})}}}var t1e=['"',"'","`"," ",".","(","[","]","!","/","-"];async function r1e(t){let e=await Af(t);if(!e)return null;let n=e.match(/@config\s*(?<config>'[^']+'|"[^"]+")/);return n?eo((0,Hg.default)(wu.resolve(wu.dirname(t),n.groups.config.slice(1,-1)))):null}var Px=class{constructor(e){this.connection=e;this.lspHandlersAdded=!1;this.disposables=[];this.watchPatterns=()=>{};this.watched=[];this.documentService=new qA(this.connection),this.projects=new Map,this.projectCounter=0,this.settingsCache=obe(e)}async init(){this.initPromise||(this.initPromise=this._init()),await this.initPromise}getWorkspaceFolders(){return this.initializeParams.workspaceFolders?.length?this.initializeParams.workspaceFolders.map(e=>({uri:id.URI.parse(e.uri).fsPath,name:e.name})):this.initializeParams.rootUri?[{uri:id.URI.parse(this.initializeParams.rootUri).fsPath,name:"Root"}]:this.initializeParams.rootPath?[{uri:id.URI.file(this.initializeParams.rootPath).fsPath,name:"Root"}]:[]}async _init(){c0();let e=this.getWorkspaceFolders().map(i=>(0,Hg.default)(i.uri));if(e.length===0){console.error("No workspace folders found, not initializing.");return}let n=await Promise.allSettled(e.map(i=>this._initFolder(id.URI.file(i))));for(let[i,o]of n.entries())o.status==="rejected"&&console.error("Failed to initialize workspace folder",e[i],o.reason);await this.listenForEvents()}async _initFolder(e){let n=this.initializeParams.initializationOptions?.userLanguages??{};Object.keys(n).length>0&&console.warn("Language mappings are currently set via initialization options (`userLanguages`). This is deprecated and will be removed in a future release. Please use the `tailwindCSS.includeLanguages` setting instead.");let i=e.fsPath,o=[],r=await this.settingsCache.get(),l=r.tailwindCSS.files.exclude,s=await this.settingsCache.get(e.toString()),p={...n,...s.tailwindCSS.includeLanguages??{}},c=new Map,a=new Map,u=this.initializeParams.initializationOptions?.workspaceFile?wu.dirname(this.initializeParams.initializationOptions.workspaceFile):i;function d(L){function I(x){return eo((0,Hg.default)(wu.resolve(u,x)))}let v=L.experimental.configFile,S={};if(typeof v=="string"){let x=I(v),T=[I(wu.resolve(i,"**"))];S[x]=T}else if(Pc(v))for(let[x,T]of Object.entries(v)){if(typeof x!="string")return null;x=I(x);let D;if(typeof T=="string")D=[I(T)];else if(Array.isArray(T))D=T.map(I);else return null;S[x]=D}else if(v)return null;return Object.entries(S)}let H=d(r.tailwindCSS);if(H===null){console.error("Invalid `experimental.configFile` configuration, not initializing.");return}let h=await hj({root:i,pnp:!0,tsconfig:!0}),y=new ex(i,r,h);H.length>0?(console.log("Loading Tailwind CSS projects from the workspace settings."),o=await y.loadAllFromWorkspace(H)):(console.log("Searching for Tailwind CSS projects in the workspace's folders."),o=await y.search());for(let L of o)if(a.set(L.config.path,L.tailwind.version),L.config.source==="css")for(let I of L.config.entries)I.type==="css"&&c.set(I.path,L.config.path);let b=o.map(L=>({folder:L.folder,config:L.config.path,selectors:L.documentSelector,user:L.isUserConfigured,tailwind:L.tailwind}));console.log(`[Global] Creating projects: ${JSON.stringify(b)}`);let _=async L=>{let I=!1,v=!1,S=(0,lp.default)(`**/${Fh}`,{dot:!0}),x=(0,lp.default)(`**/${bd}`,{dot:!0}),T=(0,lp.default)(`**/${Rh}`,{dot:!0}),D=(0,lp.default)(`**/${UA}`,{dot:!0});e:for(let N of L){let R=(0,Hg.default)(N.file);R=eo(R);for(let k of l)if((0,lp.default)(k,{dot:!0})(R))continue e;if(S(R))for(let[,k]of this.projects){let X=SE().version;try{let J=require(await h.resolveCjsId("tailwindcss/package.json",wu.dirname(k.projectConfig.configPath))).version;typeof J=="string"&&(X=J)}catch{}if(a.get(k.projectConfig.configPath)!==X){I=!0;break e}}if(D(R)){I=!0;break e}for(let[,k]of this.projects)if(k.state.v4&&jh(R,k.dependencies())){v=!0;break e}if(x(`**/${bd}`)&&N.type!==As.FileChangeType.Deleted){let k=await r1e(R)||await r1e(N.file);if(c.has(R)&&c.get(R)!==k){I=!0;break}else if(!c.has(R)&&k){I=!0;break}}if(T(R)&&N.type===As.FileChangeType.Created){I=!0;break}for(let[,k]of this.projects)if(N.type===As.FileChangeType.Deleted&&jh(R,[k.projectConfig.configPath])){I=!0;break e}}if(I){this.restart();return}if(v){try{await this.softRestart()}catch{this.restart()}return}for(let[,N]of this.projects)N.onFileEvents(L)};if(this.initializeParams.capabilities.workspace?.didChangeWatchedFiles?.dynamicRegistration){this.disposables.push(this.connection.onDidChangeWatchedFiles(async({changes:I})=>{let v=I.map(({uri:S,type:x})=>({file:id.URI.parse(S).fsPath,type:x})).filter((S,x,T)=>T.findIndex(D=>D.file===S.file&&D.type===S.type)===x);await _(v)}));let L=await this.connection.client.register(As.DidChangeWatchedFilesNotification.type,{watchers:[{globPattern:`**/${Rh}`},{globPattern:`**/${Fh}`},{globPattern:`**/${bd}`},{globPattern:`**/${UA}`}]});this.disposables.push(L),this.watchPatterns=I=>{let v=this.filterNewWatchPatterns(I);v.length&&(console.log(`[Global] Adding watch patterns: ${v.join(", ")}`),this.connection.client.register(As.DidChangeWatchedFilesNotification.type,{watchers:v.map(S=>({globPattern:S}))}).then(S=>{this.disposables.push(S)}))}}else if(xx.getBinding()){let L={create:As.FileChangeType.Created,update:As.FileChangeType.Changed,delete:As.FileChangeType.Deleted},I=await xx.subscribe(i,(v,S)=>{_(S.map(x=>({file:x.path,type:L[x.type]})))},{ignore:l.map(v=>wu.resolve(i,v.replace(/^[*/]+/,"").replace(/[*/]+$/,"")))});this.disposables.push({dispose(){I.unsubscribe()}})}else{let L=e1e().watch,I=L([`**/${Rh}`,`**/${Fh}`,`**/${bd}`,`**/${UA}`],{cwd:i,ignorePermissionErrors:!0,ignoreInitial:!0,ignored:l,awaitWriteFinish:{stabilityThreshold:100,pollInterval:20}});await new Promise(v=>{I.on("ready",()=>v())}),I.on("add",v=>_([{file:wu.resolve(i,v),type:As.FileChangeType.Created}])).on("change",v=>_([{file:wu.resolve(i,v),type:As.FileChangeType.Changed}])).on("unlink",v=>_([{file:wu.resolve(i,v),type:As.FileChangeType.Deleted}])),this.disposables.push({dispose(){I.close()}}),this.watchPatterns=v=>{let S=this.filterNewWatchPatterns(v);S.length&&(console.log(`[Global] Adding watch patterns: ${S.join(", ")}`),I.add(S))}}console.log("[Global] Preparing projects..."),await Promise.all(o.map(L=>this.addProject(L,this.initializeParams,this.watchPatterns,a.get(L.configPath),p,h))),console.log("[Global] Initializing projects...");let m=[],g=0;for(let L of this.documentService.getAllDocuments()){let I=this.getProject(L);I&&!I.enabled()&&(I.enable(),await I.tryInit(),g++),m.push(L.uri)}console.log(`[Global] Initialized ${g} projects`),this.setupLSPHandlers(),this.disposables.push(this.connection.onDidChangeConfiguration(async({settings:L})=>{let I=r.tailwindCSS.files.exclude;if(this.settingsCache.clear(),r=await this.settingsCache.get(),!Zl(I,r.tailwindCSS.files.exclude)){this.restart();return}for(let[,v]of this.projects)v.onUpdateSettings(L)})),(this.initializeParams.initializationOptions?.testMode??!1)&&(console.log("[Global][Test] Sending document notifications..."),await Promise.all(m.map(L=>this.connection.sendNotification("@/tailwindCSS/documentReady",{uri:L}))))}async listenForEvents(){let e=this.initializeParams.initializationOptions?.testMode??!1;this.disposables.push(this.connection.onShutdown(()=>{this.dispose()})),this.disposables.push(this.documentService.onDidChangeContent(n=>{this.getProject(n.document)?.provideDiagnostics(n.document)})),this.disposables.push(this.documentService.onDidOpen(async n=>{let i=this.getProject(n.document);i&&(i.enabled()||(i.enable(),await i.tryInit()),e&&await this.connection.sendNotification("@/tailwindCSS/documentReady",{uri:n.document.uri}))})),this.initializeParams.capabilities.workspace.workspaceFolders&&this.disposables.push(this.connection.workspace.onDidChangeWorkspaceFolders(async n=>{let i=n.added.map(o=>({uri:id.URI.parse(o.uri).fsPath,name:o.name})).map(o=>(0,Hg.default)(o.uri));await Promise.allSettled(i.map(o=>this._initFolder(id.URI.file(o))))}))}filterNewWatchPatterns(e){return e=Array.from(new Set(e)),e=e.filter(n=>!this.watched.includes(n)),this.watched.push(...e),e}async addProject(e,n,i,o,r,l){let s=String(this.projectCounter++),p=await tbe(s,e,this.connection,n,this.documentService,()=>this.updateCapabilities(),()=>{for(let c of this.documentService.getAllDocuments()){let a=this.getProject(c);if(a&&!a.enabled()){a.enable(),a.tryInit();break}}},()=>this.refreshDiagnostics(),c=>i(c),o,this.settingsCache.get,r,l);this.projects.set(s,p),this.supportsTailwindProjectDetails&&this.connection.sendNotification("@/tailwindCSS/projectDetails",{config:e.configPath,tailwind:e.tailwind})}get supportsTailwindProjectDetails(){return this.initializeParams.capabilities.experimental?.tailwind?.projectDetails??!1}refreshDiagnostics(){for(let e of this.documentService.getAllDocuments()){let n=this.getProject(e);n?n.provideDiagnosticsForce(e):this.connection.sendDiagnostics({uri:e.uri,diagnostics:[]})}}setupLSPHandlers(){this.lspHandlersAdded||(this.lspHandlersAdded=!0,this.connection.onHover(this.onHover.bind(this)),this.connection.onCompletion(this.onCompletion.bind(this)),this.connection.onCompletionResolve(this.onCompletionResolve.bind(this)),this.connection.onDocumentColor(this.onDocumentColor.bind(this)),this.connection.onColorPresentation(this.onColorPresentation.bind(this)),this.connection.onCodeAction(this.onCodeAction.bind(this)),this.connection.onDocumentLinks(this.onDocumentLinks.bind(this)),this.connection.onRequest(this.onRequest.bind(this)))}onRequest(e,n){if(e==="@/tailwindCSS/sortSelection"){let i=this.getProject({uri:n.uri});if(!i)return{error:"no-project"};try{return{classLists:i.sortClassLists(n.classLists)}}catch{return{error:"unknown"}}}if(e==="@/tailwindCSS/getProject"){let i=this.getProject({uri:n.uri});return!i||!i.enabled()||!i.state?.enabled?null:{version:i.state.version}}}updateCapabilities(){if(!n1e(this.initializeParams))return;this.registrations&&this.registrations.then(i=>i.dispose());let e=Array.from(this.projects.values()),n=As.BulkRegistration.create();n.add(As.HoverRequest.type,{documentSelector:null}),n.add(As.DocumentColorRequest.type,{documentSelector:null}),n.add(As.CodeActionRequest.type,{documentSelector:null}),n.add(As.DocumentLinkRequest.type,{documentSelector:null}),n.add(As.CompletionRequest.type,{documentSelector:null,resolveProvider:!0,triggerCharacters:[...t1e,...e.map(i=>i.state.separator).filter(i=>typeof i=="string").map(i=>i.slice(-1))].filter(Boolean)}),this.registrations=this.connection.client.register(n)}getProject(e){let n,i,o=1/0,r=id.URI.parse(e.uri),l=r.fsPath,s=r.path;l=eo(l);for(let c of this.projects.values()){if(!c.projectConfig.configPath){n=n??c;continue}let a=c.documentSelector().concat().sort((u,d)=>u.pattern.startsWith("!")&&!d.pattern.startsWith("!")?-1:!u.pattern.startsWith("!")&&d.pattern.startsWith("!")?1:0);for(let u of a){let d=u.pattern.replace(/[\[\]{}()]/g,H=>`\\${H}`);if(d.startsWith("!")&&((0,lp.default)(d.slice(1),{dot:!0})(l)||(0,lp.default)(d.slice(1),{dot:!0})(s)))break;if((0,lp.default)(d,{dot:!0})(l)&&u.priority<o){i=c,o=u.priority;continue}if((0,lp.default)(d,{dot:!0})(s)&&u.priority<o){i=c,o=u.priority;continue}}}let p=i??n;return p||console.debug("[GLOBAL] No matching project for document",{fsPath:l,normalPath:s}),p}async onDocumentColor(e){return await this.init(),this.getProject(e.textDocument)?.onDocumentColor(e)??[]}async onColorPresentation(e){return await this.init(),this.getProject(e.textDocument)?.onColorPresentation(e)??[]}async onHover(e){return await this.init(),this.getProject(e.textDocument)?.onHover(e)??null}async onCompletion(e){return await this.init(),this.getProject(e.textDocument)?.onCompletion(e)??null}async onCompletionResolve(e){return await this.init(),this.projects.get(e.data?._projectKey)?.onCompletionResolve(e)??null}async onCodeAction(e){return await this.init(),this.getProject(e.textDocument)?.onCodeAction(e)??null}async onDocumentLinks(e){return await this.init(),this.getProject(e.textDocument)?.onDocumentLinks(e)??null}setup(){this.connection.onInitialize(async e=>(this.initializeParams=e,n1e(e)?{capabilities:{textDocumentSync:As.TextDocumentSyncKind.Full}}:(this.setupLSPHandlers(),{capabilities:{textDocumentSync:As.TextDocumentSyncKind.Full,hoverProvider:!0,colorProvider:!0,codeActionProvider:!0,documentLinkProvider:{},completionProvider:{resolveProvider:!0,triggerCharacters:[...t1e,":"]}}}))),this.connection.onInitialized(()=>this.init())}listen(){this.connection.listen()}dispose(){this.connection.sendNotification("@/tailwindCSS/projectsDestroyed");for(let[,e]of this.projects)e.dispose();this.projects=new Map,this.refreshDiagnostics(),this.registrations&&(this.registrations.then(e=>e.dispose()),this.registrations=void 0),this.disposables.forEach(e=>e.dispose()),this.disposables.length=0,this.watched.length=0}restart(){console.log(`----------
|
3547
|
+
`?(n=!1,o+=Hx(t,i,r),i=r):!n&&l+s==="/*"?(o+=t.slice(i,r),i=r,n=q_e,r++):n===q_e&&l+s==="*/"&&(r++,n=!1,o+=Hx(t,i,r+1),i=r+1))}return o+(n?Hx(t.slice(i)):t.slice(i))}function egt(t){return t.charCodeAt(0)===65279?t.slice(1):t}var Cu=Ar(require("node:path"),1),Y_e=require("node:fs"),Q_e=require("module");var tgt={tsconfigFile:null,tsconfig:{}};async function pj(t,e){let n=e?.cache;if(n?.hasParseResult(t))return z_e(t,n,e);let{resolve:i,reject:o,promise:r}=h1();n?.setParseResult(t,r,!0);try{let l=await ej(t,n)||await sj(t,e);if(!l)return i(tgt),r;let s;t!==l&&n?.hasParseResult(l)?s=await z_e(l,n,e):(s=await dj(l,n,t===l),await Promise.all([Hj(s,n),eEe(s,e)])),s.tsconfig=ij(s.tsconfig,Cu.default.dirname(l)),i(nj(t,s))}catch(l){o(l)}return r}async function z_e(t,e,n){let i=await e.getParseResult(t);if(i.tsconfig.extends&&!i.extended||i.tsconfig.references&&!i.referenced){let o=Promise.all([Hj(i,e),eEe(i,n)]).then(()=>i);return e.setParseResult(t,o,!0),o}return i}async function dj(t,e,n){if(!n&&e?.hasParseResult(t)&&!e.getParseResult(t)._isRootFile_)return e.getParseResult(t);let i=Y_e.promises.readFile(t,"utf-8").then(uj).then(o=>{let r=JSON.parse(o);return agt(r,t),{tsconfigFile:t,tsconfig:rgt(r,Cu.default.dirname(t))}}).catch(o=>{throw new lg(`parsing ${t} failed: ${o}`,"PARSE_FILE",t,o)});return!n&&(!e?.hasParseResult(t)||!e.getParseResult(t)._isRootFile_)&&e?.setParseResult(t,i),i}function rgt(t,e){let n=t.compilerOptions?.baseUrl;return n&&!n.startsWith("${")&&!Cu.default.isAbsolute(n)&&(t.compilerOptions.baseUrl=og(e,n)),t}async function eEe(t,e){if(!t.tsconfig.references)return;let n=rj(t,e),i=await Promise.all(n.map(o=>dj(o,e?.cache)));await Promise.all(i.map(o=>Hj(o,e?.cache))),i.forEach(o=>{o.solution=t}),t.referenced=i}async function Hj(t,e){if(!t.tsconfig.extends)return;let n=[{tsconfigFile:t.tsconfigFile,tsconfig:JSON.parse(JSON.stringify(t.tsconfig))}],i=0,o=[],r=0;for(;i<n.length;){let l=n[i];if(o.push(l.tsconfigFile),l.tsconfig.extends){r+=1;let s;Array.isArray(l.tsconfig.extends)?s=l.tsconfig.extends.reverse().map(c=>Z_e(c,l.tsconfigFile)):s=[Z_e(l.tsconfig.extends,l.tsconfigFile)];let p=s.find(c=>o.includes(c));if(p){let c=o.concat([p]).join(" -> ");throw new lg(`Circular dependency in "extends": ${c}`,"EXTENDS_CIRCULAR",t.tsconfigFile)}n.splice(i+1,0,...await Promise.all(s.map(c=>dj(c,e))))}else o.splice(-r),r=0;i=i+1}t.extended=n;for(let l of t.extended.slice(1))igt(t,l)}function Z_e(t,e){t===".."&&(t="../tsconfig.json");let n=(0,Q_e.createRequire)(e),i;try{return n.resolve(t)}catch(o){i=o}if(t[0]!=="."&&!Cu.default.isAbsolute(t))try{return n.resolve(`${t}/tsconfig.json`)}catch(o){i=o}throw new lg(`failed to resolve "extends":"${t}" in ${e}`,"EXTENDS_RESOLVE",e,i)}var ngt=["compilerOptions","files","include","exclude","watchOptions","compileOnSave","typeAcquisition","buildOptions"];function igt(t,e){let n=t.tsconfig,i=e.tsconfig,o=Yf(Cu.default.relative(Cu.default.dirname(t.tsconfigFile),Cu.default.dirname(e.tsconfigFile)));for(let r of Object.keys(i).filter(l=>ngt.includes(l)))if(r==="compilerOptions"){n.compilerOptions||(n.compilerOptions={});for(let l of Object.keys(i.compilerOptions))Object.prototype.hasOwnProperty.call(n.compilerOptions,l)||(n.compilerOptions[l]=cj(l,i.compilerOptions[l],o))}else if(n[r]===void 0)if(r==="watchOptions"){n.watchOptions={};for(let l of Object.keys(i.watchOptions))n.watchOptions[l]=cj(l,i.watchOptions[l],o)}else n[r]=cj(r,i[r],o)}var sgt=["files","include","exclude","baseUrl","rootDir","rootDirs","typeRoots","outDir","outFile","declarationDir","excludeDirectories","excludeFiles"];function cj(t,e,n){return sgt.includes(t)?Array.isArray(e)?e.map(i=>J_e(i,n)):J_e(e,n):e}function J_e(t,e){return Cu.default.isAbsolute(t)||t.startsWith("${configDir}")?t:Cu.default.posix.normalize(Cu.default.posix.join(e,t))}var lg=class t extends Error{code;cause;tsconfigFile;constructor(e,n,i,o){super(e),Object.setPrototypeOf(this,t.prototype),this.name=t.name,this.code=n,this.cause=o,this.tsconfigFile=i}};function agt(t,e){lgt(e)&&(t.compilerOptions={...ogt,...t.compilerOptions})}var ogt={allowJs:!0,maxNodeModuleJsDepth:2,allowSyntheticDefaultImports:!0,skipLibCheck:!0,noEmit:!0};function lgt(t){return Cu.default.basename(t)==="jsconfig.json"}var m1=class{clear(){this.#e.clear(),this.#t.clear()}hasConfigPath(e,n="tsconfig.json"){return this.#e.has(`${e}/${n}`)}getConfigPath(e,n="tsconfig.json"){let i=`${e}/${n}`,o=this.#e.get(i);if(o==null||o.length||o.then)return o;throw o}hasParseResult(e){return this.#t.has(e)}getParseResult(e){let n=this.#t.get(e);if(n.then||n.tsconfig)return n;throw n}setParseResult(e,n,i=!1){Object.defineProperty(n,"_isRootFile_",{value:i,writable:!1,enumerable:!1,configurable:!1}),this.#t.set(e,n),n.then(o=>{this.#t.get(e)===n&&this.#t.set(e,o)}).catch(o=>{this.#t.get(e)===n&&this.#t.set(e,o)})}setConfigPath(e,n,i="tsconfig.json"){let o=`${e}/${i}`;this.#e.set(o,n),n.then(r=>{this.#e.get(o)===n&&this.#e.set(o,r)}).catch(r=>{this.#e.get(o)===n&&this.#e.set(o,r)})}#e=new Map;#t=new Map};var fx=class extends Map{constructor(n){super();this.factory=n}get(n){let i=super.get(n);return i===void 0&&(i=this.factory(n,this),this.set(n,i)),i}};async function iEe(t){let{configs:e,errors:n}=await tEe(t),i=await rEe(e);async function o(p,c){for(let a of fj(c))for(let{match:u}of i.get(a))try{return await u(p)}catch{return null}return null}async function r(p,c){for(let a of fj(c))for(let{match:u}of i.get(a))try{return await u(p,{mustExist:!1})}catch{return null}return null}async function l(p){for(let c of fj(p))for(let{paths:a}of i.get(c))if(Object.keys(a).length)return a;return{}}async function s(){let{configs:p,errors:c}=await tEe(t);if(i=await rEe(p),c.length)throw new AggregateError(c)}return{resolveId:o,substituteId:r,paths:l,refresh:s,errors:n}}async function tEe(t){let e=await oj(t,{configNames:["tsconfig.json","jsconfig.json"],skip(r){return r==="node_modules"||r===".git"}}),n={root:t,cache:new m1},i=new Set,o=[];for(let r of e)try{let l=await pj(r,n);i.add(l)}catch(l){o.push(l)}for(let r of i)if(r.referenced){for(let l of r.referenced)i.add(l);i.delete(r),i.add(r),r.referenced=void 0}for(let r of o)console.error(r);return{configs:i,errors:o}}async function rEe(t){let e=new fx(()=>[]),n=(i,o)=>o(void 0,!0);for(let i of t){let c=function(a,{mustExist:u=!0}={}){p??=nEe.createMatchPathAsync(s,r.paths??{},void 0,l!==void 0);let d=u===!1?a.endsWith("/"):!1;return d&&(a+="__placeholder__"),new Promise((H,h)=>{p(a,void 0,u===!1?n:void 0,void 0,(y,b)=>y?h(y):(d&&(b=b.replace(/__placeholder__$/,"")),H(b)))})},o=eo(ia(eh.dirname(i.tsconfigFile))),r=i.tsconfig.compilerOptions??{},l=dgt(i),s=eh.resolve(o,l||""),p;e.get(o).push({match:c,paths:r.paths??{}})}return e}function*fj(t){let e=eo(ia(t)),n;for(;e!==n;)yield e,n=e,e=eh.dirname(e);return null}function dgt(t){let e=t.tsconfig.compilerOptions?.baseUrl;if(e)return e;for(let n of t.extended??[])if((n.tsconfig.compilerOptions??{})?.paths)return eh.dirname(n.tsconfigFile);return eh.dirname(t.tsconfigFile)}async function hj(t){let e=null;typeof t.pnp=="object"?e=t.pnp:t.pnp&&(e=await n_e(t.root));let n=t.fileSystem?t.fileSystem:new ug.CachedInputFileSystem(Hgt,4e3),i=null;if(typeof t.tsconfig=="object")i=t.tsconfig;else if(t.tsconfig)try{i=await iEe(t.root)}catch(y){console.error("Failed to load tsconfig",y)}let o=ug.ResolverFactory.createResolver({fileSystem:n,extensions:[".mjs",".js",".node",".mts",".ts"],mainFields:["module"],conditionNames:["node","import"],pnpApi:e}),r=ug.ResolverFactory.createResolver({fileSystem:n,extensions:[".cjs",".js",".json",".node",".cts",".ts"],mainFields:["main"],conditionNames:["node","require"],pnpApi:e}),l=ug.ResolverFactory.createResolver({fileSystem:n,extensions:[".css"],mainFields:["style"],conditionNames:["style"],pnpApi:e,preferRelative:!0});async function s(y,b,_){if(sEe.sep==="\\"){if(b.startsWith("\\\\")||b.startsWith("//"))return b;_.startsWith("//")&&(_=`\\\\${_.slice(2)}`)}if(i){let g=await i.resolveId(b,_);g&&(b=g)}b=Nw(b),_=Nw(_);let m=await new Promise((g,A)=>{y.resolve({},_,b,{},(L,I)=>{L?A(L):g(I)})});return m?(m=m.replace(/\0(.)/g,"$1"),m):!1}async function p(y,b){try{return await s(o,y,b)||y}catch{return await s(r,y,b)||y}}async function c(y,b){return await s(r,y,b)||y}async function a(y,b){return await s(l,y,b)||y}async function u(y,b){return await i?.substituteId(y,b)??y}async function d(y){return i?await i.paths(y):{}}async function H(){await i?.refresh()}async function h(){return!!e}return{resolveJsId:p,resolveCjsId:c,resolveCssId:a,substituteId:u,refresh:H,hasPnP:h,aliases:d,child(y){return hj({...t,...y,pnp:y.pnp??e,tsconfig:y.tsconfig??i,fileSystem:y.fileSystem??n})}}}var t1e=['"',"'","`"," ",".","(","[","]","!","/","-"];async function r1e(t){let e=await Af(t);if(!e)return null;let n=e.match(/@config\s*(?<config>'[^']+'|"[^"]+")/);return n?eo((0,Hg.default)(wu.resolve(wu.dirname(t),n.groups.config.slice(1,-1)))):null}var Px=class{constructor(e){this.connection=e;this.lspHandlersAdded=!1;this.disposables=[];this.watchPatterns=()=>{};this.watched=[];this.documentService=new qA(this.connection),this.projects=new Map,this.projectCounter=0,this.settingsCache=obe(e)}async init(){this.initPromise||(this.initPromise=this._init()),await this.initPromise}getWorkspaceFolders(){return this.initializeParams.workspaceFolders?.length?this.initializeParams.workspaceFolders.map(e=>({uri:id.URI.parse(e.uri).fsPath,name:e.name})):this.initializeParams.rootUri?[{uri:id.URI.parse(this.initializeParams.rootUri).fsPath,name:"Root"}]:this.initializeParams.rootPath?[{uri:id.URI.file(this.initializeParams.rootPath).fsPath,name:"Root"}]:[]}async _init(){c0();let e=this.getWorkspaceFolders().map(i=>(0,Hg.default)(i.uri));if(e.length===0){console.error("No workspace folders found, not initializing.");return}let n=await Promise.allSettled(e.map(i=>this._initFolder(id.URI.file(i))));for(let[i,o]of n.entries())o.status==="rejected"&&console.error("Failed to initialize workspace folder",e[i],o.reason);await this.listenForEvents()}async _initFolder(e){let n=this.initializeParams.initializationOptions?.userLanguages??{};Object.keys(n).length>0&&console.warn("Language mappings are currently set via initialization options (`userLanguages`). This is deprecated and will be removed in a future release. Please use the `tailwindCSS.includeLanguages` setting instead.");let i=e.fsPath,o=[],r=await this.settingsCache.get(),l=r.tailwindCSS.files.exclude,s=await this.settingsCache.get(e.toString()),p={...n,...s.tailwindCSS.includeLanguages??{}},c=new Map,a=new Map,u=this.initializeParams.initializationOptions?.workspaceFile?wu.dirname(this.initializeParams.initializationOptions.workspaceFile):i;function d(L){function I(x){return eo((0,Hg.default)(wu.resolve(u,x)))}let v=L.experimental.configFile,S={};if(typeof v=="string"){let x=I(v),T=[I(wu.resolve(i,"**"))];S[x]=T}else if(Pc(v))for(let[x,T]of Object.entries(v)){if(typeof x!="string")return null;x=I(x);let D;if(typeof T=="string")D=[I(T)];else if(Array.isArray(T))D=T.map(I);else return null;S[x]=D}else if(v)return null;return Object.entries(S)}let H=d(r.tailwindCSS);if(H===null){console.error("Invalid `experimental.configFile` configuration, not initializing.");return}let h=await hj({root:i,pnp:!0,tsconfig:!0}),y=new ex(i,r,h);H.length>0?(console.log("Loading Tailwind CSS projects from the workspace settings."),o=await y.loadAllFromWorkspace(H)):(console.log("Searching for Tailwind CSS projects in the workspace's folders."),o=await y.search());for(let L of o)if(a.set(L.config.path,L.tailwind.version),L.config.source==="css")for(let I of L.config.entries)I.type==="css"&&c.set(I.path,L.config.path);let b=o.map(L=>({folder:L.folder,config:L.config.path,selectors:L.documentSelector,user:L.isUserConfigured,tailwind:L.tailwind}));console.log(`[Global] Creating projects: ${JSON.stringify(b)}`);let _=async L=>{let I=!1,v=!1,S=(0,lp.default)(`**/${Fh}`,{dot:!0}),x=(0,lp.default)(`**/${bd}`,{dot:!0}),T=(0,lp.default)(`**/${Rh}`,{dot:!0}),D=(0,lp.default)(`**/${UA}`,{dot:!0});e:for(let N of L){let R=(0,Hg.default)(N.file);R=eo(R);for(let k of l)if((0,lp.default)(k,{dot:!0})(R))continue e;if(S(R))for(let[,k]of this.projects){let X=SE().version;try{let J=require(await h.resolveCjsId("tailwindcss/package.json",wu.dirname(k.projectConfig.configPath))).version;typeof J=="string"&&(X=J)}catch{}if(a.get(k.projectConfig.configPath)!==X){I=!0;break e}}if(D(R)){I=!0;break e}for(let[,k]of this.projects)if(k.state.v4&&jh(R,k.dependencies())){v=!0;break e}if(x(`**/${bd}`)&&N.type!==As.FileChangeType.Deleted){let k=await r1e(R)||await r1e(N.file);if(c.has(R)&&c.get(R)!==k){I=!0;break}else if(!c.has(R)&&k){I=!0;break}}if(T(R)&&N.type===As.FileChangeType.Created){I=!0;break}for(let[,k]of this.projects)if(N.type===As.FileChangeType.Deleted&&jh(R,[k.projectConfig.configPath])){I=!0;break e}}if(I){this.restart();return}if(v){try{await this.softRestart()}catch{this.restart()}return}for(let[,N]of this.projects)N.onFileEvents(L)};if(this.initializeParams.capabilities.workspace?.didChangeWatchedFiles?.dynamicRegistration){this.disposables.push(this.connection.onDidChangeWatchedFiles(async({changes:I})=>{let v=I.map(({uri:S,type:x})=>({file:id.URI.parse(S).fsPath,type:x})).filter((S,x,T)=>T.findIndex(D=>D.file===S.file&&D.type===S.type)===x);await _(v)}));let L=await this.connection.client.register(As.DidChangeWatchedFilesNotification.type,{watchers:[{globPattern:`**/${Rh}`},{globPattern:`**/${Fh}`},{globPattern:`**/${bd}`},{globPattern:`**/${UA}`}]});this.disposables.push(L),this.watchPatterns=I=>{let v=this.filterNewWatchPatterns(I);v.length&&(console.log(`[Global] Adding watch patterns: ${v.join(", ")}`),this.connection.client.register(As.DidChangeWatchedFilesNotification.type,{watchers:v.map(S=>({globPattern:S}))}).then(S=>{this.disposables.push(S)}))}}else if(xx.getBinding()){let L={create:As.FileChangeType.Created,update:As.FileChangeType.Changed,delete:As.FileChangeType.Deleted},I=await xx.subscribe(i,(v,S)=>{_(S.map(x=>({file:x.path,type:L[x.type]})))},{ignore:l.map(v=>wu.resolve(i,v.replace(/^[*/]+/,"").replace(/[*/]+$/,"")))});this.disposables.push({dispose(){I.unsubscribe()}})}else{let L=e1e().watch,I=L([`**/${Rh}`,`**/${Fh}`,`**/${bd}`,`**/${UA}`],{cwd:i,ignorePermissionErrors:!0,ignoreInitial:!0,ignored:l,awaitWriteFinish:{stabilityThreshold:100,pollInterval:20}});await new Promise(v=>{I.on("ready",()=>v())}),I.on("add",v=>_([{file:wu.resolve(i,v),type:As.FileChangeType.Created}])).on("change",v=>_([{file:wu.resolve(i,v),type:As.FileChangeType.Changed}])).on("unlink",v=>_([{file:wu.resolve(i,v),type:As.FileChangeType.Deleted}])),this.disposables.push({dispose(){I.close()}}),this.watchPatterns=v=>{let S=this.filterNewWatchPatterns(v);S.length&&(console.log(`[Global] Adding watch patterns: ${S.join(", ")}`),I.add(S))}}console.log("[Global] Preparing projects..."),await Promise.all(o.map(L=>this.addProject(L,this.initializeParams,this.watchPatterns,a.get(L.configPath),p,h,e))),console.log("[Global] Initializing projects...");let m=[],g=0;for(let L of this.documentService.getAllDocuments()){let I=this.getProject(L);I&&!I.enabled()&&(I.enable(),await I.tryInit(),g++),m.push(L.uri)}console.log(`[Global] Initialized ${g} projects`),this.setupLSPHandlers(),this.disposables.push(this.connection.onDidChangeConfiguration(async({settings:L})=>{let I=r.tailwindCSS.files.exclude;if(this.settingsCache.clear(),r=await this.settingsCache.get(),!Zl(I,r.tailwindCSS.files.exclude)){this.restart();return}for(let[,v]of this.projects)v.onUpdateSettings(L)})),(this.initializeParams.initializationOptions?.testMode??!1)&&(console.log("[Global][Test] Sending document notifications..."),await Promise.all(m.map(L=>this.connection.sendNotification("@/tailwindCSS/documentReady",{uri:L}))))}async listenForEvents(){let e=this.initializeParams.initializationOptions?.testMode??!1;this.disposables.push(this.connection.onShutdown(()=>{this.dispose()})),this.disposables.push(this.documentService.onDidChangeContent(n=>{this.getProject(n.document)?.provideDiagnostics(n.document)})),this.disposables.push(this.documentService.onDidOpen(async n=>{let i=this.getProject(n.document);i&&(i.enabled()||(i.enable(),await i.tryInit()),e&&await this.connection.sendNotification("@/tailwindCSS/documentReady",{uri:n.document.uri}))})),this.initializeParams.capabilities.workspace.workspaceFolders&&this.disposables.push(this.connection.workspace.onDidChangeWorkspaceFolders(async n=>{let i=n.added.map(o=>({uri:id.URI.parse(o.uri).fsPath,name:o.name})).map(o=>(0,Hg.default)(o.uri));await Promise.allSettled(i.map(o=>this._initFolder(id.URI.file(o))))})),e&&await this.connection.sendNotification("@/tailwindCSS/serverReady")}filterNewWatchPatterns(e){return e=Array.from(new Set(e)),e=e.filter(n=>!this.watched.includes(n)),this.watched.push(...e),e}async addProject(e,n,i,o,r,l,s){let p=String(this.projectCounter++),c=await tbe(p,e,this.connection,n,this.documentService,()=>this.updateCapabilities(),()=>{for(let a of this.documentService.getAllDocuments()){let u=this.getProject(a);if(u&&!u.enabled()){u.enable(),u.tryInit();break}}},()=>this.refreshDiagnostics(),a=>i(a),o,this.settingsCache.get,r,l);this.projects.set(p,c),this.supportsTailwindProjectDetails&&this.connection.sendNotification("@/tailwindCSS/projectDetails",{uri:s.toString(),config:e.configPath,tailwind:e.tailwind})}get supportsTailwindProjectDetails(){return this.initializeParams.capabilities.experimental?.tailwind?.projectDetails??!1}refreshDiagnostics(){for(let e of this.documentService.getAllDocuments()){let n=this.getProject(e);n?n.provideDiagnosticsForce(e):this.connection.sendDiagnostics({uri:e.uri,diagnostics:[]})}}setupLSPHandlers(){this.lspHandlersAdded||(this.lspHandlersAdded=!0,this.connection.onHover(this.onHover.bind(this)),this.connection.onCompletion(this.onCompletion.bind(this)),this.connection.onCompletionResolve(this.onCompletionResolve.bind(this)),this.connection.onDocumentColor(this.onDocumentColor.bind(this)),this.connection.onColorPresentation(this.onColorPresentation.bind(this)),this.connection.onCodeAction(this.onCodeAction.bind(this)),this.connection.onDocumentLinks(this.onDocumentLinks.bind(this)),this.connection.onRequest(this.onRequest.bind(this)))}onRequest(e,n){if(e==="@/tailwindCSS/sortSelection"){let i=this.getProject({uri:n.uri});if(!i)return{error:"no-project"};try{return{classLists:i.sortClassLists(n.classLists)}}catch{return{error:"unknown"}}}if(e==="@/tailwindCSS/getProject"){let i=this.getProject({uri:n.uri});return!i||!i.enabled()||!i.state?.enabled?null:{version:i.state.version}}}updateCapabilities(){if(!n1e(this.initializeParams))return;this.registrations&&this.registrations.then(i=>i.dispose());let e=Array.from(this.projects.values()),n=As.BulkRegistration.create();n.add(As.HoverRequest.type,{documentSelector:null}),n.add(As.DocumentColorRequest.type,{documentSelector:null}),n.add(As.CodeActionRequest.type,{documentSelector:null}),n.add(As.DocumentLinkRequest.type,{documentSelector:null}),n.add(As.CompletionRequest.type,{documentSelector:null,resolveProvider:!0,triggerCharacters:[...t1e,...e.map(i=>i.state.separator).filter(i=>typeof i=="string").map(i=>i.slice(-1))].filter(Boolean)}),this.registrations=this.connection.client.register(n)}getProject(e){let n,i,o=1/0,r=id.URI.parse(e.uri),l=r.fsPath,s=r.path;l=eo(l);for(let c of this.projects.values()){if(!c.projectConfig.configPath){n=n??c;continue}let a=c.documentSelector().concat().sort((u,d)=>u.pattern.startsWith("!")&&!d.pattern.startsWith("!")?-1:!u.pattern.startsWith("!")&&d.pattern.startsWith("!")?1:0);for(let u of a){let d=u.pattern.replace(/[\[\]{}()]/g,H=>`\\${H}`);if(d.startsWith("!")&&((0,lp.default)(d.slice(1),{dot:!0})(l)||(0,lp.default)(d.slice(1),{dot:!0})(s)))break;if((0,lp.default)(d,{dot:!0})(l)&&u.priority<o){i=c,o=u.priority;continue}if((0,lp.default)(d,{dot:!0})(s)&&u.priority<o){i=c,o=u.priority;continue}}}let p=i??n;return p||console.debug("[GLOBAL] No matching project for document",{fsPath:l,normalPath:s}),p}async onDocumentColor(e){return await this.init(),this.getProject(e.textDocument)?.onDocumentColor(e)??[]}async onColorPresentation(e){return await this.init(),this.getProject(e.textDocument)?.onColorPresentation(e)??[]}async onHover(e){return await this.init(),this.getProject(e.textDocument)?.onHover(e)??null}async onCompletion(e){return await this.init(),this.getProject(e.textDocument)?.onCompletion(e)??null}async onCompletionResolve(e){return await this.init(),this.projects.get(e.data?._projectKey)?.onCompletionResolve(e)??null}async onCodeAction(e){return await this.init(),this.getProject(e.textDocument)?.onCodeAction(e)??null}async onDocumentLinks(e){return await this.init(),this.getProject(e.textDocument)?.onDocumentLinks(e)??null}setup(){this.connection.onInitialize(async e=>(this.initializeParams=e,n1e(e)?{capabilities:{textDocumentSync:As.TextDocumentSyncKind.Full,workspace:{workspaceFolders:{changeNotifications:!0}}}}:(this.setupLSPHandlers(),{capabilities:{textDocumentSync:As.TextDocumentSyncKind.Full,hoverProvider:!0,colorProvider:!0,codeActionProvider:!0,documentLinkProvider:{},completionProvider:{resolveProvider:!0,triggerCharacters:[...t1e,":"]},workspace:{workspaceFolders:{changeNotifications:!0}}}}))),this.connection.onInitialized(()=>this.init())}listen(){this.connection.listen()}dispose(){this.connection.sendNotification("@/tailwindCSS/projectsDestroyed");for(let[,e]of this.projects)e.dispose();this.projects=new Map,this.refreshDiagnostics(),this.registrations&&(this.registrations.then(e=>e.dispose()),this.registrations=void 0),this.disposables.forEach(e=>e.dispose()),this.disposables.length=0,this.watched.length=0}restart(){console.log(`----------
|
3548
3548
|
RESTARTING
|
3549
3549
|
----------`),this.dispose(),this.initPromise=void 0,this.init()}async softRestart(){for(let[,e]of this.projects)if(e.state.v4)try{await e.reload()}catch{}}};function n1e(t){return t.capabilities.textDocument.hover?.dynamicRegistration&&t.capabilities.textDocument.colorProvider?.dynamicRegistration&&t.capabilities.textDocument.codeAction?.dynamicRegistration&&t.capabilities.textDocument.completion?.dynamicRegistration&&t.capabilities.textDocument.documentLink?.dynamicRegistration}var i1e=require("node:util");function L1(t){return t.map(e=>(0,i1e.format)(e)).join(" ")}function s1e(t,e){t.debug=(...n)=>e.console.info(L1(n)),t.error=(...n)=>e.console.error(L1(n)),t.warn=(...n)=>e.console.warn(L1(n)),t.info=(...n)=>e.console.info(L1(n)),t.log=(...n)=>e.console.log(L1(n))}global.__preflight=lK;new Function("require","__dirname",`
|
3550
3550
|
let oldReadFileSync = require('fs').readFileSync
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tailwindcss/language-server",
|
3
|
-
"version": "0.14.
|
3
|
+
"version": "0.14.7",
|
4
4
|
"description": "Tailwind CSS Language Server",
|
5
5
|
"license": "MIT",
|
6
6
|
"repository": {
|
@@ -84,14 +84,15 @@
|
|
84
84
|
"vscode-languageserver-protocol": "^3.17.5",
|
85
85
|
"vscode-languageserver-textdocument": "1.0.11",
|
86
86
|
"vscode-uri": "3.0.2",
|
87
|
-
"@tailwindcss/language-service": "0.14.
|
87
|
+
"@tailwindcss/language-service": "0.14.7"
|
88
88
|
},
|
89
89
|
"engines": {
|
90
90
|
"node": ">=18.0.0"
|
91
91
|
},
|
92
92
|
"scripts": {
|
93
|
-
"build": "pnpm run clean && pnpm run _esbuild && pnpm run hashbang",
|
93
|
+
"build": "pnpm run clean && pnpm run _esbuild && pnpm run _esbuild:css && pnpm run hashbang",
|
94
94
|
"_esbuild": "node ../../esbuild.mjs src/server.ts --outfile=bin/tailwindcss-language-server --minify",
|
95
|
+
"_esbuild:css": "node ../../esbuild.mjs src/language/css.ts --outfile=bin/css-language-server --minify",
|
95
96
|
"clean": "rimraf bin",
|
96
97
|
"hashbang": "node scripts/hashbang.mjs",
|
97
98
|
"create-notices-file": "node scripts/createNoticesFile.mjs",
|