@tailwindcss/node 4.0.3 → 4.0.5

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/dist/index.d.mts CHANGED
@@ -28,6 +28,7 @@ type DesignSystem = {
28
28
  compileAstNodes(candidate: Candidate): ReturnType<typeof compileAstNodes>;
29
29
  getVariantOrder(): Map<Variant, number>;
30
30
  resolveThemeValue(path: string): string | undefined;
31
+ trackUsedVariables(raw: string): void;
31
32
  candidatesToCss(classes: string[]): (string | null)[];
32
33
  };
33
34
 
package/dist/index.d.ts CHANGED
@@ -28,6 +28,7 @@ type DesignSystem = {
28
28
  compileAstNodes(candidate: Candidate): ReturnType<typeof compileAstNodes>;
29
29
  getVariantOrder(): Map<Variant, number>;
30
30
  resolveThemeValue(path: string): string | undefined;
31
+ trackUsedVariables(raw: string): void;
31
32
  candidatesToCss(classes: string[]): (string | null)[];
32
33
  };
33
34
 
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- "use strict";var Ce=Object.create;var $=Object.defineProperty;var Ee=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty;var Y=(e,t)=>{for(var r in t)$(e,r,{get:t[r],enumerable:!0})},X=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $e(t))!ke.call(e,i)&&i!==r&&$(e,i,{get:()=>t[i],enumerable:!(s=Ee(t,i))||s.enumerable});return e};var g=(e,t,r)=>(r=e!=null?Ce(_e(e)):{},X(t||!e||!e.__esModule?$(r,"default",{value:e,enumerable:!0}):r,e)),Ne=e=>X($({},"__esModule",{value:!0}),e);var dt={};Y(dt,{Features:()=>h.Features,Instrumentation:()=>Q,__unstable__loadDesignSystem:()=>lt,compile:()=>ot,compileAst:()=>nt,env:()=>_,loadModule:()=>q,normalizePath:()=>U});module.exports=Ne(dt);var ve=g(require("module")),Se=require("url");var _={};Y(_,{DEBUG:()=>F});var F=be(process.env.DEBUG);function be(e){if(e===void 0)return!1;if(e==="true"||e==="1")return!0;if(e==="false"||e==="0")return!1;if(e==="*")return!0;let t=e.split(",").map(r=>r.split(":")[0]);return t.includes("-tailwindcss")?!1:!!t.includes("tailwindcss")}var y=g(require("enhanced-resolve")),xe=require("jiti"),O=g(require("fs")),V=g(require("fs/promises")),A=g(require("path")),H=require("url"),h=require("tailwindcss");var k=g(require("fs/promises")),R=g(require("path")),Pe=[/import[\s\S]*?['"](.{3,}?)['"]/gi,/import[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/export[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/require\(['"`](.+)['"`]\)/gi],De=[".js",".cjs",".mjs"],Te=["",".js",".cjs",".mjs",".ts",".cts",".mts",".jsx",".tsx"],Ue=["",".ts",".cts",".mts",".tsx",".js",".cjs",".mjs",".jsx"];async function Oe(e,t){for(let r of t){let s=`${e}${r}`;if((await k.default.stat(s).catch(()=>null))?.isFile())return s}for(let r of t){let s=`${e}/index${r}`;if(await k.default.access(s).then(()=>!0,()=>!1))return s}return null}async function Z(e,t,r,s){let i=De.includes(s)?Te:Ue,o=await Oe(R.default.resolve(r,t),i);if(o===null||e.has(o))return;e.add(o),r=R.default.dirname(o),s=R.default.extname(o);let n=await k.default.readFile(o,"utf-8"),a=[];for(let l of Pe)for(let c of n.matchAll(l))c[1].startsWith(".")&&a.push(Z(e,c[1],r,s));await Promise.all(a)}async function ee(e){let t=new Set;return await Z(t,e,R.default.dirname(e),R.default.extname(e)),Array.from(t)}var G=g(require("path"));var v=92,N=47,b=42,je=34,Ie=39,Fe=58,P=59,x=10,S=32,D=9,te=123,M=125,W=40,re=41,Me=91,Le=93,se=45,L=64,Be=33;function ie(e){e=e.replaceAll(`\r
1
+ "use strict";var Ce=Object.create;var N=Object.defineProperty;var Ne=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var ke=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var X=(e,t)=>{for(var r in t)N(e,r,{get:t[r],enumerable:!0})},Z=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $e(t))!Te.call(e,i)&&i!==r&&N(e,i,{get:()=>t[i],enumerable:!(s=Ne(t,i))||s.enumerable});return e};var g=(e,t,r)=>(r=e!=null?Ce(ke(e)):{},Z(t||!e||!e.__esModule?N(r,"default",{value:e,enumerable:!0}):r,e)),_e=e=>Z(N({},"__esModule",{value:!0}),e);var dt={};X(dt,{Features:()=>h.Features,Instrumentation:()=>Y,__unstable__loadDesignSystem:()=>at,compile:()=>ot,compileAst:()=>lt,env:()=>$,loadModule:()=>q,normalizePath:()=>U});module.exports=_e(dt);var Re=g(require("module")),Ee=require("url");var $={};X($,{DEBUG:()=>K});var K=be(process.env.DEBUG);function be(e){if(e===void 0)return!1;if(e==="true"||e==="1")return!0;if(e==="false"||e==="0")return!1;if(e==="*")return!0;let t=e.split(",").map(r=>r.split(":")[0]);return t.includes("-tailwindcss")?!1:!!t.includes("tailwindcss")}var y=g(require("enhanced-resolve")),ye=require("jiti"),I=g(require("fs")),J=g(require("fs/promises")),v=g(require("path")),H=require("url"),h=require("tailwindcss");var k=g(require("fs/promises")),w=g(require("path")),De=[/import[\s\S]*?['"](.{3,}?)['"]/gi,/import[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/export[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/require\(['"`](.+)['"`]\)/gi],Oe=[".js",".cjs",".mjs"],Ue=["",".js",".cjs",".mjs",".ts",".cts",".mts",".jsx",".tsx"],Ie=["",".ts",".cts",".mts",".tsx",".js",".cjs",".mjs",".jsx"];async function Pe(e,t){for(let r of t){let s=`${e}${r}`;if((await k.default.stat(s).catch(()=>null))?.isFile())return s}for(let r of t){let s=`${e}/index${r}`;if(await k.default.access(s).then(()=>!0,()=>!1))return s}return null}async function ee(e,t,r,s){let i=Oe.includes(s)?Ue:Ie,l=await Pe(w.default.resolve(r,t),i);if(l===null||e.has(l))return;e.add(l),r=w.default.dirname(l),s=w.default.extname(l);let n=await k.default.readFile(l,"utf-8"),a=[];for(let o of De)for(let u of n.matchAll(o))u[1].startsWith(".")&&a.push(ee(e,u[1],r,s));await Promise.all(a)}async function te(e){let t=new Set;return await ee(t,e,w.default.dirname(e),w.default.extname(e)),Array.from(t)}var z=g(require("path"));var R=92,T=47,_=42,Fe=34,Ke=39,je=58,b=59,x=10,E=32,D=9,re=123,j=125,W=40,se=41,Le=91,Me=93,ie=45,L=64,We=33;function ne(e){e=e.replaceAll(`\r
2
2
  `,`
3
- `);let t=[],r=[],s=[],i=null,o=null,n="",a="",l;for(let c=0;c<e.length;c++){let f=e.charCodeAt(c);if(f===v)n+=e.slice(c,c+2),c+=1;else if(f===N&&e.charCodeAt(c+1)===b){let u=c;for(let p=c+2;p<e.length;p++)if(l=e.charCodeAt(p),l===v)p+=1;else if(l===b&&e.charCodeAt(p+1)===N){c=p+1;break}let m=e.slice(u,c+1);m.charCodeAt(2)===Be&&r.push(le(m.slice(2,-2)))}else if(f===Ie||f===je){let u=c;for(let m=c+1;m<e.length;m++)if(l=e.charCodeAt(m),l===v)m+=1;else if(l===f){c=m;break}else{if(l===P&&e.charCodeAt(m+1)===x)throw new Error(`Unterminated string: ${e.slice(u,m+1)+String.fromCharCode(f)}`);if(l===x)throw new Error(`Unterminated string: ${e.slice(u,m)+String.fromCharCode(f)}`)}n+=e.slice(u,c+1)}else{if((f===S||f===x||f===D)&&(l=e.charCodeAt(c+1))&&(l===S||l===x||l===D))continue;if(f===x){if(n.length===0)continue;l=n.charCodeAt(n.length-1),l!==S&&l!==x&&l!==D&&(n+=" ")}else if(f===se&&e.charCodeAt(c+1)===se&&n.length===0){let u="",m=c,p=-1;for(let d=c+2;d<e.length;d++)if(l=e.charCodeAt(d),l===v)d+=1;else if(l===N&&e.charCodeAt(d+1)===b){for(let w=d+2;w<e.length;w++)if(l=e.charCodeAt(w),l===v)w+=1;else if(l===b&&e.charCodeAt(w+1)===N){d=w+1;break}}else if(p===-1&&l===Fe)p=n.length+d-m;else if(l===P&&u.length===0){n+=e.slice(m,d),c=d;break}else if(l===W)u+=")";else if(l===Me)u+="]";else if(l===te)u+="}";else if((l===M||e.length-1===d)&&u.length===0){c=d-1,n+=e.slice(m,d);break}else(l===re||l===Le||l===M)&&u.length>0&&e[d]===u[u.length-1]&&(u=u.slice(0,-1));let I=B(n,p);if(!I)throw new Error("Invalid custom property, expected a value");i?i.nodes.push(I):t.push(I),n=""}else if(f===P&&n.charCodeAt(0)===L)o=C(n),i?i.nodes.push(o):t.push(o),n="",o=null;else if(f===P&&a[a.length-1]!==")"){let u=B(n);if(!u)throw n.length===0?new Error("Unexpected semicolon"):new Error(`Invalid declaration: \`${n.trim()}\``);i?i.nodes.push(u):t.push(u),n=""}else if(f===te&&a[a.length-1]!==")")a+="}",o=ne(n.trim()),i&&i.nodes.push(o),s.push(i),i=o,n="",o=null;else if(f===M&&a[a.length-1]!==")"){if(a==="")throw new Error("Missing opening {");if(a=a.slice(0,-1),n.length>0)if(n.charCodeAt(0)===L)o=C(n),i?i.nodes.push(o):t.push(o),n="",o=null;else{let m=n.indexOf(":");if(i){let p=B(n,m);if(!p)throw new Error(`Invalid declaration: \`${n.trim()}\``);i.nodes.push(p)}}let u=s.pop()??null;u===null&&i&&t.push(i),i=u,n="",o=null}else if(f===W)a+=")",n+="(";else if(f===re){if(a[a.length-1]!==")")throw new Error("Missing opening (");a=a.slice(0,-1),n+=")"}else{if(n.length===0&&(f===S||f===x||f===D))continue;n+=String.fromCharCode(f)}}}if(n.charCodeAt(0)===L&&t.push(C(n)),a.length>0&&i){if(i.kind==="rule")throw new Error(`Missing closing } at ${i.selector}`);if(i.kind==="at-rule")throw new Error(`Missing closing } at ${i.name} ${i.params}`)}return r.length>0?r.concat(t):t}function C(e,t=[]){for(let r=5;r<e.length;r++){let s=e.charCodeAt(r);if(s===S||s===W){let i=e.slice(0,r).trim(),o=e.slice(r).trim();return z(i,o,t)}}return z(e.trim(),"",t)}function B(e,t=e.indexOf(":")){if(t===-1)return null;let r=e.indexOf("!important",t+1);return oe(e.slice(0,t).trim(),e.slice(t+1,r===-1?e.length:r).trim(),r!==-1)}var We=64;function ze(e,t=[]){return{kind:"rule",selector:e,nodes:t}}function z(e,t="",r=[]){return{kind:"at-rule",name:e,params:t,nodes:r}}function ne(e,t=[]){return e.charCodeAt(0)===We?C(e,t):ze(e,t)}function oe(e,t,r=!1){return{kind:"declaration",property:e,value:t,important:r}}function le(e){return{kind:"comment",value:e}}function T(e,t,r=[],s={}){for(let i=0;i<e.length;i++){let o=e[i],n=r[r.length-1]??null;if(o.kind==="context"){if(T(o.nodes,t,r,{...s,...o.context})===2)return 2;continue}r.push(o);let a=t(o,{parent:n,context:s,path:r,replaceWith(l){Array.isArray(l)?l.length===0?e.splice(i,1):l.length===1?e[i]=l[0]:e.splice(i,1,...l):e[i]=l,i--}})??0;if(r.pop(),a===2)return 2;if(a!==1&&(o.kind==="rule"||o.kind==="at-rule")){r.push(o);let l=T(o.nodes,t,r,s);if(r.pop(),l===2)return 2}}}function ae(e){function t(s,i=0){let o="",n=" ".repeat(i);if(s.kind==="declaration")o+=`${n}${s.property}: ${s.value}${s.important?" !important":""};
4
- `;else if(s.kind==="rule"){o+=`${n}${s.selector} {
5
- `;for(let a of s.nodes)o+=t(a,i+1);o+=`${n}}
3
+ `);let t=[],r=[],s=[],i=null,l=null,n="",a="",o;for(let u=0;u<e.length;u++){let f=e.charCodeAt(u);if(f===R)n+=e.slice(u,u+2),u+=1;else if(f===T&&e.charCodeAt(u+1)===_){let c=u;for(let d=u+2;d<e.length;d++)if(o=e.charCodeAt(d),o===R)d+=1;else if(o===_&&e.charCodeAt(d+1)===T){u=d+1;break}let p=e.slice(c,u+1);p.charCodeAt(2)===We&&r.push(ae(p.slice(2,-2)))}else if(f===Ke||f===Fe){let c=u;for(let p=u+1;p<e.length;p++)if(o=e.charCodeAt(p),o===R)p+=1;else if(o===f){u=p;break}else{if(o===b&&e.charCodeAt(p+1)===x)throw new Error(`Unterminated string: ${e.slice(c,p+1)+String.fromCharCode(f)}`);if(o===x)throw new Error(`Unterminated string: ${e.slice(c,p)+String.fromCharCode(f)}`)}n+=e.slice(c,u+1)}else{if((f===E||f===x||f===D)&&(o=e.charCodeAt(u+1))&&(o===E||o===x||o===D))continue;if(f===x){if(n.length===0)continue;o=n.charCodeAt(n.length-1),o!==E&&o!==x&&o!==D&&(n+=" ")}else if(f===ie&&e.charCodeAt(u+1)===ie&&n.length===0){let c="",p=u,d=-1;for(let m=u+2;m<e.length;m++)if(o=e.charCodeAt(m),o===R)m+=1;else if(o===T&&e.charCodeAt(m+1)===_){for(let A=m+2;A<e.length;A++)if(o=e.charCodeAt(A),o===R)A+=1;else if(o===_&&e.charCodeAt(A+1)===T){m=A+1;break}}else if(d===-1&&o===je)d=n.length+m-p;else if(o===b&&c.length===0){n+=e.slice(p,m),u=m;break}else if(o===W)c+=")";else if(o===Le)c+="]";else if(o===re)c+="}";else if((o===j||e.length-1===m)&&c.length===0){u=m-1,n+=e.slice(p,m);break}else(o===se||o===Me||o===j)&&c.length>0&&e[m]===c[c.length-1]&&(c=c.slice(0,-1));let F=M(n,d);if(!F)throw new Error("Invalid custom property, expected a value");i?i.nodes.push(F):t.push(F),n=""}else if(f===b&&n.charCodeAt(0)===L)l=C(n),i?i.nodes.push(l):t.push(l),n="",l=null;else if(f===b&&a[a.length-1]!==")"){let c=M(n);if(!c)throw n.length===0?new Error("Unexpected semicolon"):new Error(`Invalid declaration: \`${n.trim()}\``);i?i.nodes.push(c):t.push(c),n=""}else if(f===re&&a[a.length-1]!==")")a+="}",l=le(n.trim()),i&&i.nodes.push(l),s.push(i),i=l,n="",l=null;else if(f===j&&a[a.length-1]!==")"){if(a==="")throw new Error("Missing opening {");if(a=a.slice(0,-1),n.length>0)if(n.charCodeAt(0)===L)l=C(n),i?i.nodes.push(l):t.push(l),n="",l=null;else{let p=n.indexOf(":");if(i){let d=M(n,p);if(!d)throw new Error(`Invalid declaration: \`${n.trim()}\``);i.nodes.push(d)}}let c=s.pop()??null;c===null&&i&&t.push(i),i=c,n="",l=null}else if(f===W)a+=")",n+="(";else if(f===se){if(a[a.length-1]!==")")throw new Error("Missing opening (");a=a.slice(0,-1),n+=")"}else{if(n.length===0&&(f===E||f===x||f===D))continue;n+=String.fromCharCode(f)}}}if(n.charCodeAt(0)===L&&t.push(C(n)),a.length>0&&i){if(i.kind==="rule")throw new Error(`Missing closing } at ${i.selector}`);if(i.kind==="at-rule")throw new Error(`Missing closing } at ${i.name} ${i.params}`)}return r.length>0?r.concat(t):t}function C(e,t=[]){for(let r=5;r<e.length;r++){let s=e.charCodeAt(r);if(s===E||s===W){let i=e.slice(0,r).trim(),l=e.slice(r).trim();return B(i,l,t)}}return B(e.trim(),"",t)}function M(e,t=e.indexOf(":")){if(t===-1)return null;let r=e.indexOf("!important",t+1);return oe(e.slice(0,t).trim(),e.slice(t+1,r===-1?e.length:r).trim(),r!==-1)}var S=class extends Map{constructor(r){super();this.factory=r}get(r){let s=super.get(r);return s===void 0&&(s=this.factory(r,this),this.set(r,s)),s}};var Be=64;function ze(e,t=[]){return{kind:"rule",selector:e,nodes:t}}function B(e,t="",r=[]){return{kind:"at-rule",name:e,params:t,nodes:r}}function le(e,t=[]){return e.charCodeAt(0)===Be?C(e,t):ze(e,t)}function oe(e,t,r=!1){return{kind:"declaration",property:e,value:t,important:r}}function ae(e){return{kind:"comment",value:e}}function O(e,t,r=[],s={}){for(let i=0;i<e.length;i++){let l=e[i],n=r[r.length-1]??null;if(l.kind==="context"){if(O(l.nodes,t,r,{...s,...l.context})===2)return 2;continue}r.push(l);let a=!1,o=0,u=t(l,{parent:n,context:s,path:r,replaceWith(f){a=!0,Array.isArray(f)?f.length===0?(e.splice(i,1),o=0):f.length===1?(e[i]=f[0],o=1):(e.splice(i,1,...f),o=f.length):(e[i]=f,o=1)}})??0;if(r.pop(),a){u===0?i--:i+=o-1;continue}if(u===2)return 2;if(u!==1&&"nodes"in l){r.push(l);let f=O(l.nodes,t,r,s);if(r.pop(),f===2)return 2}}}function fe(e){function t(s,i=0){let l="",n=" ".repeat(i);if(s.kind==="declaration")l+=`${n}${s.property}: ${s.value}${s.important?" !important":""};
4
+ `;else if(s.kind==="rule"){l+=`${n}${s.selector} {
5
+ `;for(let a of s.nodes)l+=t(a,i+1);l+=`${n}}
6
6
  `}else if(s.kind==="at-rule"){if(s.nodes.length===0)return`${n}${s.name} ${s.params};
7
- `;o+=`${n}${s.name}${s.params?` ${s.params} `:" "}{
8
- `;for(let a of s.nodes)o+=t(a,i+1);o+=`${n}}
9
- `}else if(s.kind==="comment")o+=`${n}/*${s.value}*/
10
- `;else if(s.kind==="context"||s.kind==="at-root")return"";return o}let r="";for(let s of e){let i=t(s);i!==""&&(r+=i)}return r}function Ge(e,t){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var r=e.length;if(r<=1)return e;var s="";if(r>4&&e[3]==="\\"){var i=e[2];(i==="?"||i===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),s="//")}var o=e.split(/[/\\]+/);return t!==!1&&o[o.length-1]===""&&o.pop(),s+o.join("/")}function U(e){let t=Ge(e);return e.startsWith("\\\\")&&t.startsWith("/")&&!t.startsWith("//")?`/${t}`:t}var K=/(?<!@import\s+)(?<=^|[^\w\-\u0080-\uffff])url\((\s*('[^']+'|"[^"]+")\s*|[^'")]+)\)/,ce=/(?<=image-set\()((?:[\w-]{1,256}\([^)]*\)|[^)])*)(?=\))/,Ke=/(?:gradient|element|cross-fade|image)\(/,He=/^\s*data:/i,Je=/^([a-z]+:)?\/\//,Ve=/^[A-Z_][.\w-]*\(/i,qe=/(?:^|\s)(?<url>[\w-]+\([^)]*\)|"[^"]*"|'[^']*'|[^,]\S*[^,])\s*(?:\s(?<descriptor>\w[^,]+))?(?:,|$)/g,Qe=/(?<!\\)"/g,Ye=/(?: |\\t|\\n|\\f|\\r)+/g,Xe=e=>He.test(e),Ze=e=>Je.test(e);async function fe({css:e,base:t,root:r}){if(!e.includes("url(")&&!e.includes("image-set("))return e;let s=ie(e),i=[];function o(n){if(n[0]==="/")return n;let a=G.posix.join(U(t),n),l=G.posix.relative(U(r),a);return l.startsWith(".")||(l="./"+l),l}return T(s,n=>{if(n.kind!=="declaration"||!n.value)return;let a=K.test(n.value),l=ce.test(n.value);if(a||l){let c=l?et:ue;i.push(c(n.value,o).then(f=>{n.value=f}))}}),i.length&&await Promise.all(i),ae(s)}function ue(e,t){return de(e,K,async r=>{let[s,i]=r;return await me(i.trim(),s,t)})}async function et(e,t){return await de(e,ce,async r=>{let[,s]=r;return await rt(s,async({url:o})=>K.test(o)?await ue(o,t):Ke.test(o)?o:await me(o,o,t))})}async function me(e,t,r,s="url"){let i="",o=e[0];if((o==='"'||o==="'")&&(i=o,e=e.slice(1,-1)),tt(e))return t;let n=await r(e);return i===""&&n!==encodeURI(n)&&(i='"'),i==="'"&&n.includes("'")&&(i='"'),i==='"'&&n.includes('"')&&(n=n.replace(Qe,'\\"')),`${s}(${i}${n}${i})`}function tt(e,t){return Ze(e)||Xe(e)||!e[0].match(/[\.a-zA-Z0-9_]/)||Ve.test(e)}function rt(e,t){return Promise.all(st(e).map(async({url:r,descriptor:s})=>({url:await t({url:r,descriptor:s}),descriptor:s}))).then(it)}function st(e){let t=e.trim().replace(Ye," ").replace(/\r?\n/,"").replace(/,\s+/,", ").replaceAll(/\s+/g," ").matchAll(qe);return Array.from(t,({groups:r})=>({url:r?.url?.trim()??"",descriptor:r?.descriptor?.trim()??""})).filter(({url:r})=>!!r)}function it(e){return e.map(({url:t,descriptor:r})=>t+(r?` ${r}`:"")).join(", ")}async function de(e,t,r){let s,i=e,o="";for(;s=t.exec(i);)o+=i.slice(0,s.index),o+=await r(s),i=i.slice(s.index+s[0].length);return o+=i,o}var mt={};function ye({base:e,onDependency:t,shouldRewriteUrls:r,customCssResolver:s,customJsResolver:i}){return{base:e,async loadModule(o,n){return q(o,n,t,i)},async loadStylesheet(o,n){let a=await we(o,n,t,s);return r&&(a.content=await fe({css:a.content,root:n,base:a.base})),a}}}async function Ae(e,t){if(e.root&&e.root!=="none"){let r=/[*{]/,s=[];for(let o of e.root.pattern.split("/")){if(r.test(o))break;s.push(o)}if(!await V.default.stat(A.default.resolve(t,s.join("/"))).then(o=>o.isDirectory()).catch(()=>!1))throw new Error(`The \`source(${e.root.pattern})\` does not exist`)}}async function nt(e,t){let r=await(0,h.compileAst)(e,ye(t));return await Ae(r,t.base),r}async function ot(e,t){let r=await(0,h.compile)(e,ye(t));return await Ae(r,t.base),r}async function lt(e,{base:t}){return(0,h.__unstable__loadDesignSystem)(e,{base:t,async loadModule(r,s){return q(r,s,()=>{})},async loadStylesheet(r,s){return we(r,s,()=>{})}})}async function q(e,t,r,s){if(e[0]!=="."){let a=await he(e,t,s);if(!a)throw new Error(`Could not resolve '${e}' from '${t}'`);let l=await ge((0,H.pathToFileURL)(a).href);return{base:(0,A.dirname)(a),module:l.default??l}}let i=await he(e,t,s);if(!i)throw new Error(`Could not resolve '${e}' from '${t}'`);let[o,n]=await Promise.all([ge((0,H.pathToFileURL)(i).href+"?id="+Date.now()),ee(i)]);for(let a of n)r(a);return{base:(0,A.dirname)(i),module:o.default??o}}async function we(e,t,r,s){let i=await ct(e,t,s);if(!i)throw new Error(`Could not resolve '${e}' from '${t}'`);if(r(i),typeof globalThis.__tw_readFile=="function"){let n=await globalThis.__tw_readFile(i,"utf-8");if(n)return{base:A.default.dirname(i),content:n}}let o=await V.default.readFile(i,"utf-8");return{base:A.default.dirname(i),content:o}}var pe=null;async function ge(e){if(typeof globalThis.__tw_load=="function"){let t=await globalThis.__tw_load(e);if(t)return t}try{return await import(e)}catch{return pe??=(0,xe.createJiti)(mt.url,{moduleCache:!1,fsCache:!1}),await pe.import(e)}}var at=y.default.ResolverFactory.createResolver({fileSystem:new y.default.CachedInputFileSystem(O.default,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"]});async function ct(e,t,r){if(typeof globalThis.__tw_resolve=="function"){let s=globalThis.__tw_resolve(e,t);if(s)return Promise.resolve(s)}if(r){let s=await r(e,t);if(s)return s}return J(at,e,t)}var ft=y.default.ResolverFactory.createResolver({fileSystem:new y.default.CachedInputFileSystem(O.default,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","import"]}),ut=y.default.ResolverFactory.createResolver({fileSystem:new y.default.CachedInputFileSystem(O.default,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","require"]});async function he(e,t,r){if(typeof globalThis.__tw_resolve=="function"){let s=globalThis.__tw_resolve(e,t);if(s)return Promise.resolve(s)}if(r){let s=await r(e,t);if(s)return s}return J(ft,e,t).catch(()=>J(ut,e,t))}function J(e,t,r){return new Promise((s,i)=>e.resolve({},r,t,{},(o,n)=>{if(o)return i(o);s(n)}))}var E=class extends Map{constructor(r){super();this.factory=r}get(r){let s=super.get(r);return s===void 0&&(s=this.factory(r,this),this.set(r,s)),s}};Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var Q=class{constructor(t=r=>void process.stderr.write(`${r}
11
- `)){this.defaultFlush=t}#r=new E(()=>({value:0}));#t=new E(()=>({value:0n}));#e=[];hit(t){this.#r.get(t).value++}start(t){let r=this.#e.map(i=>i.label).join("//"),s=`${r}${r.length===0?"":"//"}${t}`;this.#r.get(s).value++,this.#t.get(s),this.#e.push({id:s,label:t,namespace:r,value:process.hrtime.bigint()})}end(t){let r=process.hrtime.bigint();if(this.#e[this.#e.length-1].label!==t)throw new Error(`Mismatched timer label: \`${t}\`, expected \`${this.#e[this.#e.length-1].label}\``);let s=this.#e.pop(),i=r-s.value;this.#t.get(s.id).value+=i}reset(){this.#r.clear(),this.#t.clear(),this.#e.splice(0)}report(t=this.defaultFlush){let r=[],s=!1;for(let n=this.#e.length-1;n>=0;n--)this.end(this.#e[n].label);for(let[n,{value:a}]of this.#r.entries()){if(this.#t.has(n))continue;r.length===0&&(s=!0,r.push("Hits:"));let l=n.split("//").length;r.push(`${" ".repeat(l)}${n} ${j(Re(`\xD7 ${a}`))}`)}this.#t.size>0&&s&&r.push(`
12
- Timers:`);let i=-1/0,o=new Map;for(let[n,{value:a}]of this.#t){let l=`${(Number(a)/1e6).toFixed(2)}ms`;o.set(n,l),i=Math.max(i,l.length)}for(let n of this.#t.keys()){let a=n.split("//").length;r.push(`${j(`[${o.get(n).padStart(i," ")}]`)}${" ".repeat(a-1)}${a===1?" ":j(" \u21B3 ")}${n.split("//").pop()} ${this.#r.get(n).value===1?"":j(Re(`\xD7 ${this.#r.get(n).value}`))}`.trimEnd())}t(`
7
+ `;l+=`${n}${s.name}${s.params?` ${s.params} `:" "}{
8
+ `;for(let a of s.nodes)l+=t(a,i+1);l+=`${n}}
9
+ `}else if(s.kind==="comment")l+=`${n}/*${s.value}*/
10
+ `;else if(s.kind==="context"||s.kind==="at-root")return"";return l}let r="";for(let s of e){let i=t(s);i!==""&&(r+=i)}return r}function Ge(e,t){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var r=e.length;if(r<=1)return e;var s="";if(r>4&&e[3]==="\\"){var i=e[2];(i==="?"||i===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),s="//")}var l=e.split(/[/\\]+/);return t!==!1&&l[l.length-1]===""&&l.pop(),s+l.join("/")}function U(e){let t=Ge(e);return e.startsWith("\\\\")&&t.startsWith("/")&&!t.startsWith("//")?`/${t}`:t}var G=/(?<!@import\s+)(?<=^|[^\w\-\u0080-\uffff])url\((\s*('[^']+'|"[^"]+")\s*|[^'")]+)\)/,ue=/(?<=image-set\()((?:[\w-]{1,256}\([^)]*\)|[^)])*)(?=\))/,He=/(?:gradient|element|cross-fade|image)\(/,Ve=/^\s*data:/i,Je=/^([a-z]+:)?\/\//,qe=/^[A-Z_][.\w-]*\(/i,Qe=/(?:^|\s)(?<url>[\w-]+\([^)]*\)|"[^"]*"|'[^']*'|[^,]\S*[^,])\s*(?:\s(?<descriptor>\w[^,]+))?(?:,|$)/g,Ye=/(?<!\\)"/g,Xe=/(?: |\\t|\\n|\\f|\\r)+/g,Ze=e=>Ve.test(e),et=e=>Je.test(e);async function ce({css:e,base:t,root:r}){if(!e.includes("url(")&&!e.includes("image-set("))return e;let s=ne(e),i=[];function l(n){if(n[0]==="/")return n;let a=z.posix.join(U(t),n),o=z.posix.relative(U(r),a);return o.startsWith(".")||(o="./"+o),o}return O(s,n=>{if(n.kind!=="declaration"||!n.value)return;let a=G.test(n.value),o=ue.test(n.value);if(a||o){let u=o?tt:pe;i.push(u(n.value,l).then(f=>{n.value=f}))}}),i.length&&await Promise.all(i),fe(s)}function pe(e,t){return de(e,G,async r=>{let[s,i]=r;return await me(i.trim(),s,t)})}async function tt(e,t){return await de(e,ue,async r=>{let[,s]=r;return await st(s,async({url:l})=>G.test(l)?await pe(l,t):He.test(l)?l:await me(l,l,t))})}async function me(e,t,r,s="url"){let i="",l=e[0];if((l==='"'||l==="'")&&(i=l,e=e.slice(1,-1)),rt(e))return t;let n=await r(e);return i===""&&n!==encodeURI(n)&&(i='"'),i==="'"&&n.includes("'")&&(i='"'),i==='"'&&n.includes('"')&&(n=n.replace(Ye,'\\"')),`${s}(${i}${n}${i})`}function rt(e,t){return et(e)||Ze(e)||!e[0].match(/[\.a-zA-Z0-9_]/)||qe.test(e)}function st(e,t){return Promise.all(it(e).map(async({url:r,descriptor:s})=>({url:await t({url:r,descriptor:s}),descriptor:s}))).then(nt)}function it(e){let t=e.trim().replace(Xe," ").replace(/\r?\n/,"").replace(/,\s+/,", ").replaceAll(/\s+/g," ").matchAll(Qe);return Array.from(t,({groups:r})=>({url:r?.url?.trim()??"",descriptor:r?.descriptor?.trim()??""})).filter(({url:r})=>!!r)}function nt(e){return e.map(({url:t,descriptor:r})=>t+(r?` ${r}`:"")).join(", ")}async function de(e,t,r){let s,i=e,l="";for(;s=t.exec(i);)l+=i.slice(0,s.index),l+=await r(s),i=i.slice(s.index+s[0].length);return l+=i,l}var mt={};function ve({base:e,onDependency:t,shouldRewriteUrls:r,customCssResolver:s,customJsResolver:i}){return{base:e,async loadModule(l,n){return q(l,n,t,i)},async loadStylesheet(l,n){let a=await we(l,n,t,s);return r&&(a.content=await ce({css:a.content,root:n,base:a.base})),a}}}async function Ae(e,t){if(e.root&&e.root!=="none"){let r=/[*{]/,s=[];for(let l of e.root.pattern.split("/")){if(r.test(l))break;s.push(l)}if(!await J.default.stat(v.default.resolve(t,s.join("/"))).then(l=>l.isDirectory()).catch(()=>!1))throw new Error(`The \`source(${e.root.pattern})\` does not exist`)}}async function lt(e,t){let r=await(0,h.compileAst)(e,ve(t));return await Ae(r,t.base),r}async function ot(e,t){let r=await(0,h.compile)(e,ve(t));return await Ae(r,t.base),r}async function at(e,{base:t}){return(0,h.__unstable__loadDesignSystem)(e,{base:t,async loadModule(r,s){return q(r,s,()=>{})},async loadStylesheet(r,s){return we(r,s,()=>{})}})}async function q(e,t,r,s){if(e[0]!=="."){let a=await xe(e,t,s);if(!a)throw new Error(`Could not resolve '${e}' from '${t}'`);let o=await he((0,H.pathToFileURL)(a).href);return{base:(0,v.dirname)(a),module:o.default??o}}let i=await xe(e,t,s);if(!i)throw new Error(`Could not resolve '${e}' from '${t}'`);let[l,n]=await Promise.all([he((0,H.pathToFileURL)(i).href+"?id="+Date.now()),te(i)]);for(let a of n)r(a);return{base:(0,v.dirname)(i),module:l.default??l}}async function we(e,t,r,s){let i=await ut(e,t,s);if(!i)throw new Error(`Could not resolve '${e}' from '${t}'`);if(r(i),typeof globalThis.__tw_readFile=="function"){let n=await globalThis.__tw_readFile(i,"utf-8");if(n)return{base:v.default.dirname(i),content:n}}let l=await J.default.readFile(i,"utf-8");return{base:v.default.dirname(i),content:l}}var ge=null;async function he(e){if(typeof globalThis.__tw_load=="function"){let t=await globalThis.__tw_load(e);if(t)return t}try{return await import(e)}catch{return ge??=(0,ye.createJiti)(mt.url,{moduleCache:!1,fsCache:!1}),await ge.import(e)}}var Q=["node_modules",...process.env.NODE_PATH?[process.env.NODE_PATH]:[]],ft=y.default.ResolverFactory.createResolver({fileSystem:new y.default.CachedInputFileSystem(I.default,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"],modules:Q});async function ut(e,t,r){if(typeof globalThis.__tw_resolve=="function"){let s=globalThis.__tw_resolve(e,t);if(s)return Promise.resolve(s)}if(r){let s=await r(e,t);if(s)return s}return V(ft,e,t)}var ct=y.default.ResolverFactory.createResolver({fileSystem:new y.default.CachedInputFileSystem(I.default,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","import"],modules:Q}),pt=y.default.ResolverFactory.createResolver({fileSystem:new y.default.CachedInputFileSystem(I.default,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","require"],modules:Q});async function xe(e,t,r){if(typeof globalThis.__tw_resolve=="function"){let s=globalThis.__tw_resolve(e,t);if(s)return Promise.resolve(s)}if(r){let s=await r(e,t);if(s)return s}return V(ct,e,t).catch(()=>V(pt,e,t))}function V(e,t,r){return new Promise((s,i)=>e.resolve({},r,t,{},(l,n)=>{if(l)return i(l);s(n)}))}Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var Y=class{constructor(t=r=>void process.stderr.write(`${r}
11
+ `)){this.defaultFlush=t}#r=new S(()=>({value:0}));#t=new S(()=>({value:0n}));#e=[];hit(t){this.#r.get(t).value++}start(t){let r=this.#e.map(i=>i.label).join("//"),s=`${r}${r.length===0?"":"//"}${t}`;this.#r.get(s).value++,this.#t.get(s),this.#e.push({id:s,label:t,namespace:r,value:process.hrtime.bigint()})}end(t){let r=process.hrtime.bigint();if(this.#e[this.#e.length-1].label!==t)throw new Error(`Mismatched timer label: \`${t}\`, expected \`${this.#e[this.#e.length-1].label}\``);let s=this.#e.pop(),i=r-s.value;this.#t.get(s.id).value+=i}reset(){this.#r.clear(),this.#t.clear(),this.#e.splice(0)}report(t=this.defaultFlush){let r=[],s=!1;for(let n=this.#e.length-1;n>=0;n--)this.end(this.#e[n].label);for(let[n,{value:a}]of this.#r.entries()){if(this.#t.has(n))continue;r.length===0&&(s=!0,r.push("Hits:"));let o=n.split("//").length;r.push(`${" ".repeat(o)}${n} ${P(Se(`\xD7 ${a}`))}`)}this.#t.size>0&&s&&r.push(`
12
+ Timers:`);let i=-1/0,l=new Map;for(let[n,{value:a}]of this.#t){let o=`${(Number(a)/1e6).toFixed(2)}ms`;l.set(n,o),i=Math.max(i,o.length)}for(let n of this.#t.keys()){let a=n.split("//").length;r.push(`${P(`[${l.get(n).padStart(i," ")}]`)}${" ".repeat(a-1)}${a===1?" ":P(" \u21B3 ")}${n.split("//").pop()} ${this.#r.get(n).value===1?"":P(Se(`\xD7 ${this.#r.get(n).value}`))}`.trimEnd())}t(`
13
13
  ${r.join(`
14
14
  `)}
15
- `),this.reset()}[Symbol.dispose](){F&&this.report()}};function j(e){return`\x1B[2m${e}\x1B[22m`}function Re(e){return`\x1B[34m${e}\x1B[39m`}process.versions.bun||ve.register?.((0,Se.pathToFileURL)(require.resolve("@tailwindcss/node/esm-cache-loader")));0&&(module.exports={Features,Instrumentation,__unstable__loadDesignSystem,compile,compileAst,env,loadModule,normalizePath});
15
+ `),this.reset()}[Symbol.dispose](){K&&this.report()}};function P(e){return`\x1B[2m${e}\x1B[22m`}function Se(e){return`\x1B[34m${e}\x1B[39m`}process.versions.bun||Re.register?.((0,Ee.pathToFileURL)(require.resolve("@tailwindcss/node/esm-cache-loader")));0&&(module.exports={Features,Instrumentation,__unstable__loadDesignSystem,compile,compileAst,env,loadModule,normalizePath});
package/dist/index.mjs CHANGED
@@ -1,15 +1,15 @@
1
- var xe=Object.defineProperty;var Ae=(e,t)=>{for(var r in t)xe(e,r,{get:t[r],enumerable:!0})};import*as N from"node:module";import{pathToFileURL as lt}from"node:url";var D={};Ae(D,{DEBUG:()=>P});var P=we(process.env.DEBUG);function we(e){if(e===void 0)return!1;if(e==="true"||e==="1")return!0;if(e==="false"||e==="0")return!1;if(e==="*")return!0;let t=e.split(",").map(r=>r.split(":")[0]);return t.includes("-tailwindcss")?!1:!!t.includes("tailwindcss")}import y from"enhanced-resolve";import{createJiti as qe}from"jiti";import G from"node:fs";import ue from"node:fs/promises";import W,{dirname as oe}from"node:path";import{pathToFileURL as le}from"node:url";import{__unstable__loadDesignSystem as Qe,compile as Ye,compileAst as Xe,Features as Ze}from"tailwindcss";import T from"node:fs/promises";import x from"node:path";var Re=[/import[\s\S]*?['"](.{3,}?)['"]/gi,/import[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/export[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/require\(['"`](.+)['"`]\)/gi],ve=[".js",".cjs",".mjs"],Se=["",".js",".cjs",".mjs",".ts",".cts",".mts",".jsx",".tsx"],Ce=["",".ts",".cts",".mts",".tsx",".js",".cjs",".mjs",".jsx"];async function Ee(e,t){for(let r of t){let s=`${e}${r}`;if((await T.stat(s).catch(()=>null))?.isFile())return s}for(let r of t){let s=`${e}/index${r}`;if(await T.access(s).then(()=>!0,()=>!1))return s}return null}async function K(e,t,r,s){let i=ve.includes(s)?Se:Ce,o=await Ee(x.resolve(r,t),i);if(o===null||e.has(o))return;e.add(o),r=x.dirname(o),s=x.extname(o);let n=await T.readFile(o,"utf-8"),a=[];for(let l of Re)for(let c of n.matchAll(l))c[1].startsWith(".")&&a.push(K(e,c[1],r,s));await Promise.all(a)}async function H(e){let t=new Set;return await K(t,e,x.dirname(e),x.extname(e)),Array.from(t)}import*as L from"node:path";var A=92,S=47,C=42,_e=34,$e=39,ke=58,E=59,g=10,w=32,_=9,J=123,U=125,I=40,V=41,Ne=91,be=93,q=45,O=64,Pe=33;function Q(e){e=e.replaceAll(`\r
1
+ var ve=Object.defineProperty;var Ae=(e,t)=>{for(var r in t)ve(e,r,{get:t[r],enumerable:!0})};import*as k from"node:module";import{pathToFileURL as at}from"node:url";var D={};Ae(D,{DEBUG:()=>b});var b=we(process.env.DEBUG);function we(e){if(e===void 0)return!1;if(e==="true"||e==="1")return!0;if(e==="false"||e==="0")return!1;if(e==="*")return!0;let t=e.split(",").map(r=>r.split(":")[0]);return t.includes("-tailwindcss")?!1:!!t.includes("tailwindcss")}import y from"enhanced-resolve";import{createJiti as Qe}from"jiti";import z from"node:fs";import me from"node:fs/promises";import W,{dirname as oe}from"node:path";import{pathToFileURL as ae}from"node:url";import{__unstable__loadDesignSystem as Ye,compile as Xe,compileAst as Ze,Features as et}from"tailwindcss";import O from"node:fs/promises";import v from"node:path";var Se=[/import[\s\S]*?['"](.{3,}?)['"]/gi,/import[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/export[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/require\(['"`](.+)['"`]\)/gi],Re=[".js",".cjs",".mjs"],Ee=["",".js",".cjs",".mjs",".ts",".cts",".mts",".jsx",".tsx"],Ce=["",".ts",".cts",".mts",".tsx",".js",".cjs",".mjs",".jsx"];async function Ne(e,t){for(let r of t){let s=`${e}${r}`;if((await O.stat(s).catch(()=>null))?.isFile())return s}for(let r of t){let s=`${e}/index${r}`;if(await O.access(s).then(()=>!0,()=>!1))return s}return null}async function H(e,t,r,s){let i=Re.includes(s)?Ee:Ce,l=await Ne(v.resolve(r,t),i);if(l===null||e.has(l))return;e.add(l),r=v.dirname(l),s=v.extname(l);let n=await O.readFile(l,"utf-8"),a=[];for(let o of Se)for(let f of n.matchAll(o))f[1].startsWith(".")&&a.push(H(e,f[1],r,s));await Promise.all(a)}async function V(e){let t=new Set;return await H(t,e,v.dirname(e),v.extname(e)),Array.from(t)}import*as L from"node:path";var A=92,R=47,E=42,$e=34,_e=39,ke=58,C=59,g=10,w=32,N=9,q=123,U=125,F=40,J=41,Te=91,be=93,Q=45,I=64,De=33;function Y(e){e=e.replaceAll(`\r
2
2
  `,`
3
- `);let t=[],r=[],s=[],i=null,o=null,n="",a="",l;for(let c=0;c<e.length;c++){let f=e.charCodeAt(c);if(f===A)n+=e.slice(c,c+2),c+=1;else if(f===S&&e.charCodeAt(c+1)===C){let u=c;for(let p=c+2;p<e.length;p++)if(l=e.charCodeAt(p),l===A)p+=1;else if(l===C&&e.charCodeAt(p+1)===S){c=p+1;break}let m=e.slice(u,c+1);m.charCodeAt(2)===Pe&&r.push(Z(m.slice(2,-2)))}else if(f===$e||f===_e){let u=c;for(let m=c+1;m<e.length;m++)if(l=e.charCodeAt(m),l===A)m+=1;else if(l===f){c=m;break}else{if(l===E&&e.charCodeAt(m+1)===g)throw new Error(`Unterminated string: ${e.slice(u,m+1)+String.fromCharCode(f)}`);if(l===g)throw new Error(`Unterminated string: ${e.slice(u,m)+String.fromCharCode(f)}`)}n+=e.slice(u,c+1)}else{if((f===w||f===g||f===_)&&(l=e.charCodeAt(c+1))&&(l===w||l===g||l===_))continue;if(f===g){if(n.length===0)continue;l=n.charCodeAt(n.length-1),l!==w&&l!==g&&l!==_&&(n+=" ")}else if(f===q&&e.charCodeAt(c+1)===q&&n.length===0){let u="",m=c,p=-1;for(let d=c+2;d<e.length;d++)if(l=e.charCodeAt(d),l===A)d+=1;else if(l===S&&e.charCodeAt(d+1)===C){for(let h=d+2;h<e.length;h++)if(l=e.charCodeAt(h),l===A)h+=1;else if(l===C&&e.charCodeAt(h+1)===S){d=h+1;break}}else if(p===-1&&l===ke)p=n.length+d-m;else if(l===E&&u.length===0){n+=e.slice(m,d),c=d;break}else if(l===I)u+=")";else if(l===Ne)u+="]";else if(l===J)u+="}";else if((l===U||e.length-1===d)&&u.length===0){c=d-1,n+=e.slice(m,d);break}else(l===V||l===be||l===U)&&u.length>0&&e[d]===u[u.length-1]&&(u=u.slice(0,-1));let b=j(n,p);if(!b)throw new Error("Invalid custom property, expected a value");i?i.nodes.push(b):t.push(b),n=""}else if(f===E&&n.charCodeAt(0)===O)o=R(n),i?i.nodes.push(o):t.push(o),n="",o=null;else if(f===E&&a[a.length-1]!==")"){let u=j(n);if(!u)throw n.length===0?new Error("Unexpected semicolon"):new Error(`Invalid declaration: \`${n.trim()}\``);i?i.nodes.push(u):t.push(u),n=""}else if(f===J&&a[a.length-1]!==")")a+="}",o=Y(n.trim()),i&&i.nodes.push(o),s.push(i),i=o,n="",o=null;else if(f===U&&a[a.length-1]!==")"){if(a==="")throw new Error("Missing opening {");if(a=a.slice(0,-1),n.length>0)if(n.charCodeAt(0)===O)o=R(n),i?i.nodes.push(o):t.push(o),n="",o=null;else{let m=n.indexOf(":");if(i){let p=j(n,m);if(!p)throw new Error(`Invalid declaration: \`${n.trim()}\``);i.nodes.push(p)}}let u=s.pop()??null;u===null&&i&&t.push(i),i=u,n="",o=null}else if(f===I)a+=")",n+="(";else if(f===V){if(a[a.length-1]!==")")throw new Error("Missing opening (");a=a.slice(0,-1),n+=")"}else{if(n.length===0&&(f===w||f===g||f===_))continue;n+=String.fromCharCode(f)}}}if(n.charCodeAt(0)===O&&t.push(R(n)),a.length>0&&i){if(i.kind==="rule")throw new Error(`Missing closing } at ${i.selector}`);if(i.kind==="at-rule")throw new Error(`Missing closing } at ${i.name} ${i.params}`)}return r.length>0?r.concat(t):t}function R(e,t=[]){for(let r=5;r<e.length;r++){let s=e.charCodeAt(r);if(s===w||s===I){let i=e.slice(0,r).trim(),o=e.slice(r).trim();return F(i,o,t)}}return F(e.trim(),"",t)}function j(e,t=e.indexOf(":")){if(t===-1)return null;let r=e.indexOf("!important",t+1);return X(e.slice(0,t).trim(),e.slice(t+1,r===-1?e.length:r).trim(),r!==-1)}var De=64;function Te(e,t=[]){return{kind:"rule",selector:e,nodes:t}}function F(e,t="",r=[]){return{kind:"at-rule",name:e,params:t,nodes:r}}function Y(e,t=[]){return e.charCodeAt(0)===De?R(e,t):Te(e,t)}function X(e,t,r=!1){return{kind:"declaration",property:e,value:t,important:r}}function Z(e){return{kind:"comment",value:e}}function $(e,t,r=[],s={}){for(let i=0;i<e.length;i++){let o=e[i],n=r[r.length-1]??null;if(o.kind==="context"){if($(o.nodes,t,r,{...s,...o.context})===2)return 2;continue}r.push(o);let a=t(o,{parent:n,context:s,path:r,replaceWith(l){Array.isArray(l)?l.length===0?e.splice(i,1):l.length===1?e[i]=l[0]:e.splice(i,1,...l):e[i]=l,i--}})??0;if(r.pop(),a===2)return 2;if(a!==1&&(o.kind==="rule"||o.kind==="at-rule")){r.push(o);let l=$(o.nodes,t,r,s);if(r.pop(),l===2)return 2}}}function ee(e){function t(s,i=0){let o="",n=" ".repeat(i);if(s.kind==="declaration")o+=`${n}${s.property}: ${s.value}${s.important?" !important":""};
4
- `;else if(s.kind==="rule"){o+=`${n}${s.selector} {
5
- `;for(let a of s.nodes)o+=t(a,i+1);o+=`${n}}
3
+ `);let t=[],r=[],s=[],i=null,l=null,n="",a="",o;for(let f=0;f<e.length;f++){let u=e.charCodeAt(f);if(u===A)n+=e.slice(f,f+2),f+=1;else if(u===R&&e.charCodeAt(f+1)===E){let c=f;for(let d=f+2;d<e.length;d++)if(o=e.charCodeAt(d),o===A)d+=1;else if(o===E&&e.charCodeAt(d+1)===R){f=d+1;break}let m=e.slice(c,f+1);m.charCodeAt(2)===De&&r.push(ee(m.slice(2,-2)))}else if(u===_e||u===$e){let c=f;for(let m=f+1;m<e.length;m++)if(o=e.charCodeAt(m),o===A)m+=1;else if(o===u){f=m;break}else{if(o===C&&e.charCodeAt(m+1)===g)throw new Error(`Unterminated string: ${e.slice(c,m+1)+String.fromCharCode(u)}`);if(o===g)throw new Error(`Unterminated string: ${e.slice(c,m)+String.fromCharCode(u)}`)}n+=e.slice(c,f+1)}else{if((u===w||u===g||u===N)&&(o=e.charCodeAt(f+1))&&(o===w||o===g||o===N))continue;if(u===g){if(n.length===0)continue;o=n.charCodeAt(n.length-1),o!==w&&o!==g&&o!==N&&(n+=" ")}else if(u===Q&&e.charCodeAt(f+1)===Q&&n.length===0){let c="",m=f,d=-1;for(let p=f+2;p<e.length;p++)if(o=e.charCodeAt(p),o===A)p+=1;else if(o===R&&e.charCodeAt(p+1)===E){for(let h=p+2;h<e.length;h++)if(o=e.charCodeAt(h),o===A)h+=1;else if(o===E&&e.charCodeAt(h+1)===R){p=h+1;break}}else if(d===-1&&o===ke)d=n.length+p-m;else if(o===C&&c.length===0){n+=e.slice(m,p),f=p;break}else if(o===F)c+=")";else if(o===Te)c+="]";else if(o===q)c+="}";else if((o===U||e.length-1===p)&&c.length===0){f=p-1,n+=e.slice(m,p);break}else(o===J||o===be||o===U)&&c.length>0&&e[p]===c[c.length-1]&&(c=c.slice(0,-1));let T=P(n,d);if(!T)throw new Error("Invalid custom property, expected a value");i?i.nodes.push(T):t.push(T),n=""}else if(u===C&&n.charCodeAt(0)===I)l=S(n),i?i.nodes.push(l):t.push(l),n="",l=null;else if(u===C&&a[a.length-1]!==")"){let c=P(n);if(!c)throw n.length===0?new Error("Unexpected semicolon"):new Error(`Invalid declaration: \`${n.trim()}\``);i?i.nodes.push(c):t.push(c),n=""}else if(u===q&&a[a.length-1]!==")")a+="}",l=X(n.trim()),i&&i.nodes.push(l),s.push(i),i=l,n="",l=null;else if(u===U&&a[a.length-1]!==")"){if(a==="")throw new Error("Missing opening {");if(a=a.slice(0,-1),n.length>0)if(n.charCodeAt(0)===I)l=S(n),i?i.nodes.push(l):t.push(l),n="",l=null;else{let m=n.indexOf(":");if(i){let d=P(n,m);if(!d)throw new Error(`Invalid declaration: \`${n.trim()}\``);i.nodes.push(d)}}let c=s.pop()??null;c===null&&i&&t.push(i),i=c,n="",l=null}else if(u===F)a+=")",n+="(";else if(u===J){if(a[a.length-1]!==")")throw new Error("Missing opening (");a=a.slice(0,-1),n+=")"}else{if(n.length===0&&(u===w||u===g||u===N))continue;n+=String.fromCharCode(u)}}}if(n.charCodeAt(0)===I&&t.push(S(n)),a.length>0&&i){if(i.kind==="rule")throw new Error(`Missing closing } at ${i.selector}`);if(i.kind==="at-rule")throw new Error(`Missing closing } at ${i.name} ${i.params}`)}return r.length>0?r.concat(t):t}function S(e,t=[]){for(let r=5;r<e.length;r++){let s=e.charCodeAt(r);if(s===w||s===F){let i=e.slice(0,r).trim(),l=e.slice(r).trim();return K(i,l,t)}}return K(e.trim(),"",t)}function P(e,t=e.indexOf(":")){if(t===-1)return null;let r=e.indexOf("!important",t+1);return Z(e.slice(0,t).trim(),e.slice(t+1,r===-1?e.length:r).trim(),r!==-1)}var x=class extends Map{constructor(r){super();this.factory=r}get(r){let s=super.get(r);return s===void 0&&(s=this.factory(r,this),this.set(r,s)),s}};var Oe=64;function Ue(e,t=[]){return{kind:"rule",selector:e,nodes:t}}function K(e,t="",r=[]){return{kind:"at-rule",name:e,params:t,nodes:r}}function X(e,t=[]){return e.charCodeAt(0)===Oe?S(e,t):Ue(e,t)}function Z(e,t,r=!1){return{kind:"declaration",property:e,value:t,important:r}}function ee(e){return{kind:"comment",value:e}}function $(e,t,r=[],s={}){for(let i=0;i<e.length;i++){let l=e[i],n=r[r.length-1]??null;if(l.kind==="context"){if($(l.nodes,t,r,{...s,...l.context})===2)return 2;continue}r.push(l);let a=!1,o=0,f=t(l,{parent:n,context:s,path:r,replaceWith(u){a=!0,Array.isArray(u)?u.length===0?(e.splice(i,1),o=0):u.length===1?(e[i]=u[0],o=1):(e.splice(i,1,...u),o=u.length):(e[i]=u,o=1)}})??0;if(r.pop(),a){f===0?i--:i+=o-1;continue}if(f===2)return 2;if(f!==1&&"nodes"in l){r.push(l);let u=$(l.nodes,t,r,s);if(r.pop(),u===2)return 2}}}function te(e){function t(s,i=0){let l="",n=" ".repeat(i);if(s.kind==="declaration")l+=`${n}${s.property}: ${s.value}${s.important?" !important":""};
4
+ `;else if(s.kind==="rule"){l+=`${n}${s.selector} {
5
+ `;for(let a of s.nodes)l+=t(a,i+1);l+=`${n}}
6
6
  `}else if(s.kind==="at-rule"){if(s.nodes.length===0)return`${n}${s.name} ${s.params};
7
- `;o+=`${n}${s.name}${s.params?` ${s.params} `:" "}{
8
- `;for(let a of s.nodes)o+=t(a,i+1);o+=`${n}}
9
- `}else if(s.kind==="comment")o+=`${n}/*${s.value}*/
10
- `;else if(s.kind==="context"||s.kind==="at-root")return"";return o}let r="";for(let s of e){let i=t(s);i!==""&&(r+=i)}return r}function Ue(e,t){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var r=e.length;if(r<=1)return e;var s="";if(r>4&&e[3]==="\\"){var i=e[2];(i==="?"||i===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),s="//")}var o=e.split(/[/\\]+/);return t!==!1&&o[o.length-1]===""&&o.pop(),s+o.join("/")}function M(e){let t=Ue(e);return e.startsWith("\\\\")&&t.startsWith("/")&&!t.startsWith("//")?`/${t}`:t}var B=/(?<!@import\s+)(?<=^|[^\w\-\u0080-\uffff])url\((\s*('[^']+'|"[^"]+")\s*|[^'")]+)\)/,te=/(?<=image-set\()((?:[\w-]{1,256}\([^)]*\)|[^)])*)(?=\))/,Oe=/(?:gradient|element|cross-fade|image)\(/,je=/^\s*data:/i,Ie=/^([a-z]+:)?\/\//,Fe=/^[A-Z_][.\w-]*\(/i,Me=/(?:^|\s)(?<url>[\w-]+\([^)]*\)|"[^"]*"|'[^']*'|[^,]\S*[^,])\s*(?:\s(?<descriptor>\w[^,]+))?(?:,|$)/g,Le=/(?<!\\)"/g,Be=/(?: |\\t|\\n|\\f|\\r)+/g,We=e=>je.test(e),ze=e=>Ie.test(e);async function re({css:e,base:t,root:r}){if(!e.includes("url(")&&!e.includes("image-set("))return e;let s=Q(e),i=[];function o(n){if(n[0]==="/")return n;let a=L.posix.join(M(t),n),l=L.posix.relative(M(r),a);return l.startsWith(".")||(l="./"+l),l}return $(s,n=>{if(n.kind!=="declaration"||!n.value)return;let a=B.test(n.value),l=te.test(n.value);if(a||l){let c=l?Ge:se;i.push(c(n.value,o).then(f=>{n.value=f}))}}),i.length&&await Promise.all(i),ee(s)}function se(e,t){return ne(e,B,async r=>{let[s,i]=r;return await ie(i.trim(),s,t)})}async function Ge(e,t){return await ne(e,te,async r=>{let[,s]=r;return await He(s,async({url:o})=>B.test(o)?await se(o,t):Oe.test(o)?o:await ie(o,o,t))})}async function ie(e,t,r,s="url"){let i="",o=e[0];if((o==='"'||o==="'")&&(i=o,e=e.slice(1,-1)),Ke(e))return t;let n=await r(e);return i===""&&n!==encodeURI(n)&&(i='"'),i==="'"&&n.includes("'")&&(i='"'),i==='"'&&n.includes('"')&&(n=n.replace(Le,'\\"')),`${s}(${i}${n}${i})`}function Ke(e,t){return ze(e)||We(e)||!e[0].match(/[\.a-zA-Z0-9_]/)||Fe.test(e)}function He(e,t){return Promise.all(Je(e).map(async({url:r,descriptor:s})=>({url:await t({url:r,descriptor:s}),descriptor:s}))).then(Ve)}function Je(e){let t=e.trim().replace(Be," ").replace(/\r?\n/,"").replace(/,\s+/,", ").replaceAll(/\s+/g," ").matchAll(Me);return Array.from(t,({groups:r})=>({url:r?.url?.trim()??"",descriptor:r?.descriptor?.trim()??""})).filter(({url:r})=>!!r)}function Ve(e){return e.map(({url:t,descriptor:r})=>t+(r?` ${r}`:"")).join(", ")}async function ne(e,t,r){let s,i=e,o="";for(;s=t.exec(i);)o+=i.slice(0,s.index),o+=await r(s),i=i.slice(s.index+s[0].length);return o+=i,o}function me({base:e,onDependency:t,shouldRewriteUrls:r,customCssResolver:s,customJsResolver:i}){return{base:e,async loadModule(o,n){return pe(o,n,t,i)},async loadStylesheet(o,n){let a=await ge(o,n,t,s);return r&&(a.content=await re({css:a.content,root:n,base:a.base})),a}}}async function de(e,t){if(e.root&&e.root!=="none"){let r=/[*{]/,s=[];for(let o of e.root.pattern.split("/")){if(r.test(o))break;s.push(o)}if(!await ue.stat(W.resolve(t,s.join("/"))).then(o=>o.isDirectory()).catch(()=>!1))throw new Error(`The \`source(${e.root.pattern})\` does not exist`)}}async function et(e,t){let r=await Xe(e,me(t));return await de(r,t.base),r}async function tt(e,t){let r=await Ye(e,me(t));return await de(r,t.base),r}async function rt(e,{base:t}){return Qe(e,{base:t,async loadModule(r,s){return pe(r,s,()=>{})},async loadStylesheet(r,s){return ge(r,s,()=>{})}})}async function pe(e,t,r,s){if(e[0]!=="."){let a=await fe(e,t,s);if(!a)throw new Error(`Could not resolve '${e}' from '${t}'`);let l=await ce(le(a).href);return{base:oe(a),module:l.default??l}}let i=await fe(e,t,s);if(!i)throw new Error(`Could not resolve '${e}' from '${t}'`);let[o,n]=await Promise.all([ce(le(i).href+"?id="+Date.now()),H(i)]);for(let a of n)r(a);return{base:oe(i),module:o.default??o}}async function ge(e,t,r,s){let i=await it(e,t,s);if(!i)throw new Error(`Could not resolve '${e}' from '${t}'`);if(r(i),typeof globalThis.__tw_readFile=="function"){let n=await globalThis.__tw_readFile(i,"utf-8");if(n)return{base:W.dirname(i),content:n}}let o=await ue.readFile(i,"utf-8");return{base:W.dirname(i),content:o}}var ae=null;async function ce(e){if(typeof globalThis.__tw_load=="function"){let t=await globalThis.__tw_load(e);if(t)return t}try{return await import(e)}catch{return ae??=qe(import.meta.url,{moduleCache:!1,fsCache:!1}),await ae.import(e)}}var st=y.ResolverFactory.createResolver({fileSystem:new y.CachedInputFileSystem(G,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"]});async function it(e,t,r){if(typeof globalThis.__tw_resolve=="function"){let s=globalThis.__tw_resolve(e,t);if(s)return Promise.resolve(s)}if(r){let s=await r(e,t);if(s)return s}return z(st,e,t)}var nt=y.ResolverFactory.createResolver({fileSystem:new y.CachedInputFileSystem(G,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","import"]}),ot=y.ResolverFactory.createResolver({fileSystem:new y.CachedInputFileSystem(G,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","require"]});async function fe(e,t,r){if(typeof globalThis.__tw_resolve=="function"){let s=globalThis.__tw_resolve(e,t);if(s)return Promise.resolve(s)}if(r){let s=await r(e,t);if(s)return s}return z(nt,e,t).catch(()=>z(ot,e,t))}function z(e,t,r){return new Promise((s,i)=>e.resolve({},r,t,{},(o,n)=>{if(o)return i(o);s(n)}))}var v=class extends Map{constructor(r){super();this.factory=r}get(r){let s=super.get(r);return s===void 0&&(s=this.factory(r,this),this.set(r,s)),s}};Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var he=class{constructor(t=r=>void process.stderr.write(`${r}
11
- `)){this.defaultFlush=t}#r=new v(()=>({value:0}));#t=new v(()=>({value:0n}));#e=[];hit(t){this.#r.get(t).value++}start(t){let r=this.#e.map(i=>i.label).join("//"),s=`${r}${r.length===0?"":"//"}${t}`;this.#r.get(s).value++,this.#t.get(s),this.#e.push({id:s,label:t,namespace:r,value:process.hrtime.bigint()})}end(t){let r=process.hrtime.bigint();if(this.#e[this.#e.length-1].label!==t)throw new Error(`Mismatched timer label: \`${t}\`, expected \`${this.#e[this.#e.length-1].label}\``);let s=this.#e.pop(),i=r-s.value;this.#t.get(s.id).value+=i}reset(){this.#r.clear(),this.#t.clear(),this.#e.splice(0)}report(t=this.defaultFlush){let r=[],s=!1;for(let n=this.#e.length-1;n>=0;n--)this.end(this.#e[n].label);for(let[n,{value:a}]of this.#r.entries()){if(this.#t.has(n))continue;r.length===0&&(s=!0,r.push("Hits:"));let l=n.split("//").length;r.push(`${" ".repeat(l)}${n} ${k(ye(`\xD7 ${a}`))}`)}this.#t.size>0&&s&&r.push(`
12
- Timers:`);let i=-1/0,o=new Map;for(let[n,{value:a}]of this.#t){let l=`${(Number(a)/1e6).toFixed(2)}ms`;o.set(n,l),i=Math.max(i,l.length)}for(let n of this.#t.keys()){let a=n.split("//").length;r.push(`${k(`[${o.get(n).padStart(i," ")}]`)}${" ".repeat(a-1)}${a===1?" ":k(" \u21B3 ")}${n.split("//").pop()} ${this.#r.get(n).value===1?"":k(ye(`\xD7 ${this.#r.get(n).value}`))}`.trimEnd())}t(`
7
+ `;l+=`${n}${s.name}${s.params?` ${s.params} `:" "}{
8
+ `;for(let a of s.nodes)l+=t(a,i+1);l+=`${n}}
9
+ `}else if(s.kind==="comment")l+=`${n}/*${s.value}*/
10
+ `;else if(s.kind==="context"||s.kind==="at-root")return"";return l}let r="";for(let s of e){let i=t(s);i!==""&&(r+=i)}return r}function Ie(e,t){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var r=e.length;if(r<=1)return e;var s="";if(r>4&&e[3]==="\\"){var i=e[2];(i==="?"||i===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),s="//")}var l=e.split(/[/\\]+/);return t!==!1&&l[l.length-1]===""&&l.pop(),s+l.join("/")}function j(e){let t=Ie(e);return e.startsWith("\\\\")&&t.startsWith("/")&&!t.startsWith("//")?`/${t}`:t}var M=/(?<!@import\s+)(?<=^|[^\w\-\u0080-\uffff])url\((\s*('[^']+'|"[^"]+")\s*|[^'")]+)\)/,re=/(?<=image-set\()((?:[\w-]{1,256}\([^)]*\)|[^)])*)(?=\))/,Pe=/(?:gradient|element|cross-fade|image)\(/,Fe=/^\s*data:/i,Ke=/^([a-z]+:)?\/\//,je=/^[A-Z_][.\w-]*\(/i,Le=/(?:^|\s)(?<url>[\w-]+\([^)]*\)|"[^"]*"|'[^']*'|[^,]\S*[^,])\s*(?:\s(?<descriptor>\w[^,]+))?(?:,|$)/g,Me=/(?<!\\)"/g,We=/(?: |\\t|\\n|\\f|\\r)+/g,Be=e=>Fe.test(e),ze=e=>Ke.test(e);async function se({css:e,base:t,root:r}){if(!e.includes("url(")&&!e.includes("image-set("))return e;let s=Y(e),i=[];function l(n){if(n[0]==="/")return n;let a=L.posix.join(j(t),n),o=L.posix.relative(j(r),a);return o.startsWith(".")||(o="./"+o),o}return $(s,n=>{if(n.kind!=="declaration"||!n.value)return;let a=M.test(n.value),o=re.test(n.value);if(a||o){let f=o?Ge:ie;i.push(f(n.value,l).then(u=>{n.value=u}))}}),i.length&&await Promise.all(i),te(s)}function ie(e,t){return le(e,M,async r=>{let[s,i]=r;return await ne(i.trim(),s,t)})}async function Ge(e,t){return await le(e,re,async r=>{let[,s]=r;return await Ve(s,async({url:l})=>M.test(l)?await ie(l,t):Pe.test(l)?l:await ne(l,l,t))})}async function ne(e,t,r,s="url"){let i="",l=e[0];if((l==='"'||l==="'")&&(i=l,e=e.slice(1,-1)),He(e))return t;let n=await r(e);return i===""&&n!==encodeURI(n)&&(i='"'),i==="'"&&n.includes("'")&&(i='"'),i==='"'&&n.includes('"')&&(n=n.replace(Me,'\\"')),`${s}(${i}${n}${i})`}function He(e,t){return ze(e)||Be(e)||!e[0].match(/[\.a-zA-Z0-9_]/)||je.test(e)}function Ve(e,t){return Promise.all(qe(e).map(async({url:r,descriptor:s})=>({url:await t({url:r,descriptor:s}),descriptor:s}))).then(Je)}function qe(e){let t=e.trim().replace(We," ").replace(/\r?\n/,"").replace(/,\s+/,", ").replaceAll(/\s+/g," ").matchAll(Le);return Array.from(t,({groups:r})=>({url:r?.url?.trim()??"",descriptor:r?.descriptor?.trim()??""})).filter(({url:r})=>!!r)}function Je(e){return e.map(({url:t,descriptor:r})=>t+(r?` ${r}`:"")).join(", ")}async function le(e,t,r){let s,i=e,l="";for(;s=t.exec(i);)l+=i.slice(0,s.index),l+=await r(s),i=i.slice(s.index+s[0].length);return l+=i,l}function pe({base:e,onDependency:t,shouldRewriteUrls:r,customCssResolver:s,customJsResolver:i}){return{base:e,async loadModule(l,n){return ge(l,n,t,i)},async loadStylesheet(l,n){let a=await he(l,n,t,s);return r&&(a.content=await se({css:a.content,root:n,base:a.base})),a}}}async function de(e,t){if(e.root&&e.root!=="none"){let r=/[*{]/,s=[];for(let l of e.root.pattern.split("/")){if(r.test(l))break;s.push(l)}if(!await me.stat(W.resolve(t,s.join("/"))).then(l=>l.isDirectory()).catch(()=>!1))throw new Error(`The \`source(${e.root.pattern})\` does not exist`)}}async function tt(e,t){let r=await Ze(e,pe(t));return await de(r,t.base),r}async function rt(e,t){let r=await Xe(e,pe(t));return await de(r,t.base),r}async function st(e,{base:t}){return Ye(e,{base:t,async loadModule(r,s){return ge(r,s,()=>{})},async loadStylesheet(r,s){return he(r,s,()=>{})}})}async function ge(e,t,r,s){if(e[0]!=="."){let a=await ce(e,t,s);if(!a)throw new Error(`Could not resolve '${e}' from '${t}'`);let o=await fe(ae(a).href);return{base:oe(a),module:o.default??o}}let i=await ce(e,t,s);if(!i)throw new Error(`Could not resolve '${e}' from '${t}'`);let[l,n]=await Promise.all([fe(ae(i).href+"?id="+Date.now()),V(i)]);for(let a of n)r(a);return{base:oe(i),module:l.default??l}}async function he(e,t,r,s){let i=await nt(e,t,s);if(!i)throw new Error(`Could not resolve '${e}' from '${t}'`);if(r(i),typeof globalThis.__tw_readFile=="function"){let n=await globalThis.__tw_readFile(i,"utf-8");if(n)return{base:W.dirname(i),content:n}}let l=await me.readFile(i,"utf-8");return{base:W.dirname(i),content:l}}var ue=null;async function fe(e){if(typeof globalThis.__tw_load=="function"){let t=await globalThis.__tw_load(e);if(t)return t}try{return await import(e)}catch{return ue??=Qe(import.meta.url,{moduleCache:!1,fsCache:!1}),await ue.import(e)}}var G=["node_modules",...process.env.NODE_PATH?[process.env.NODE_PATH]:[]],it=y.ResolverFactory.createResolver({fileSystem:new y.CachedInputFileSystem(z,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"],modules:G});async function nt(e,t,r){if(typeof globalThis.__tw_resolve=="function"){let s=globalThis.__tw_resolve(e,t);if(s)return Promise.resolve(s)}if(r){let s=await r(e,t);if(s)return s}return B(it,e,t)}var lt=y.ResolverFactory.createResolver({fileSystem:new y.CachedInputFileSystem(z,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","import"],modules:G}),ot=y.ResolverFactory.createResolver({fileSystem:new y.CachedInputFileSystem(z,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"],conditionNames:["node","require"],modules:G});async function ce(e,t,r){if(typeof globalThis.__tw_resolve=="function"){let s=globalThis.__tw_resolve(e,t);if(s)return Promise.resolve(s)}if(r){let s=await r(e,t);if(s)return s}return B(lt,e,t).catch(()=>B(ot,e,t))}function B(e,t,r){return new Promise((s,i)=>e.resolve({},r,t,{},(l,n)=>{if(l)return i(l);s(n)}))}Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var xe=class{constructor(t=r=>void process.stderr.write(`${r}
11
+ `)){this.defaultFlush=t}#r=new x(()=>({value:0}));#t=new x(()=>({value:0n}));#e=[];hit(t){this.#r.get(t).value++}start(t){let r=this.#e.map(i=>i.label).join("//"),s=`${r}${r.length===0?"":"//"}${t}`;this.#r.get(s).value++,this.#t.get(s),this.#e.push({id:s,label:t,namespace:r,value:process.hrtime.bigint()})}end(t){let r=process.hrtime.bigint();if(this.#e[this.#e.length-1].label!==t)throw new Error(`Mismatched timer label: \`${t}\`, expected \`${this.#e[this.#e.length-1].label}\``);let s=this.#e.pop(),i=r-s.value;this.#t.get(s.id).value+=i}reset(){this.#r.clear(),this.#t.clear(),this.#e.splice(0)}report(t=this.defaultFlush){let r=[],s=!1;for(let n=this.#e.length-1;n>=0;n--)this.end(this.#e[n].label);for(let[n,{value:a}]of this.#r.entries()){if(this.#t.has(n))continue;r.length===0&&(s=!0,r.push("Hits:"));let o=n.split("//").length;r.push(`${" ".repeat(o)}${n} ${_(ye(`\xD7 ${a}`))}`)}this.#t.size>0&&s&&r.push(`
12
+ Timers:`);let i=-1/0,l=new Map;for(let[n,{value:a}]of this.#t){let o=`${(Number(a)/1e6).toFixed(2)}ms`;l.set(n,o),i=Math.max(i,o.length)}for(let n of this.#t.keys()){let a=n.split("//").length;r.push(`${_(`[${l.get(n).padStart(i," ")}]`)}${" ".repeat(a-1)}${a===1?" ":_(" \u21B3 ")}${n.split("//").pop()} ${this.#r.get(n).value===1?"":_(ye(`\xD7 ${this.#r.get(n).value}`))}`.trimEnd())}t(`
13
13
  ${r.join(`
14
14
  `)}
15
- `),this.reset()}[Symbol.dispose](){P&&this.report()}};function k(e){return`\x1B[2m${e}\x1B[22m`}function ye(e){return`\x1B[34m${e}\x1B[39m`}if(!process.versions.bun){let e=N.createRequire(import.meta.url);N.register?.(lt(e.resolve("@tailwindcss/node/esm-cache-loader")))}export{Ze as Features,he as Instrumentation,rt as __unstable__loadDesignSystem,tt as compile,et as compileAst,D as env,M as normalizePath};
15
+ `),this.reset()}[Symbol.dispose](){b&&this.report()}};function _(e){return`\x1B[2m${e}\x1B[22m`}function ye(e){return`\x1B[34m${e}\x1B[39m`}if(!process.versions.bun){let e=k.createRequire(import.meta.url);k.register?.(at(e.resolve("@tailwindcss/node/esm-cache-loader")))}export{et as Features,xe as Instrumentation,st as __unstable__loadDesignSystem,rt as compile,tt as compileAst,D as env,j as normalizePath};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailwindcss/node",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "enhanced-resolve": "^5.18.0",
37
37
  "jiti": "^2.4.2",
38
- "tailwindcss": "4.0.3"
38
+ "tailwindcss": "4.0.5"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "tsup-node",