@tailwindcss/node 4.0.7 → 4.0.9

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