39 lines
225 KiB
JavaScript
39 lines
225 KiB
JavaScript
|
|
import{a as qt,b as L,c as H,d as Zt,e as P,f as kt,g as oe,h as Xe,i as Jt}from"./chunk-GFBUASX3.mjs";import{a as Ht}from"./chunk-HTB5LLOP.mjs";var Qt="4.1.17";var ze=92,et=47,tt=42,Xt=34,er=39,Wi=58,rt=59,le=10,it=13,Fe=32,We=9,tr=123,bt=125,Ct=40,rr=41,Bi=91,Yi=93,ir=45,xt=64,Gi=33;function Ce(e,r){let i=r?.from?{file:r.from,code:e}:null;e[0]==="\uFEFF"&&(e=" "+e.slice(1));let t=[],n=[],s=[],a=null,p=null,u="",f="",m=0,d;for(let c=0;c<e.length;c++){let w=e.charCodeAt(c);if(!(w===it&&(d=e.charCodeAt(c+1),d===le)))if(w===ze)u===""&&(m=c),u+=e.slice(c,c+2),c+=1;else if(w===et&&e.charCodeAt(c+1)===tt){let h=c;for(let x=c+2;x<e.length;x++)if(d=e.charCodeAt(x),d===ze)x+=1;else if(d===tt&&e.charCodeAt(x+1)===et){c=x+1;break}let y=e.slice(h,c+1);if(y.charCodeAt(2)===Gi){let x=nt(y.slice(2,-2));n.push(x),i&&(x.src=[i,h,c+1],x.dst=[i,h,c+1])}}else if(w===er||w===Xt){let h=nr(e,c,w);u+=e.slice(c,h+1),c=h}else{if((w===Fe||w===le||w===We)&&(d=e.charCodeAt(c+1))&&(d===Fe||d===le||d===We||d===it&&(d=e.charCodeAt(c+2))&&d==le))continue;if(w===le){if(u.length===0)continue;d=u.charCodeAt(u.length-1),d!==Fe&&d!==le&&d!==We&&(u+=" ")}else if(w===ir&&e.charCodeAt(c+1)===ir&&u.length===0){let h="",y=c,x=-1;for(let A=c+2;A<e.length;A++)if(d=e.charCodeAt(A),d===ze)A+=1;else if(d===er||d===Xt)A=nr(e,A,d);else if(d===et&&e.charCodeAt(A+1)===tt){for(let k=A+2;k<e.length;k++)if(d=e.charCodeAt(k),d===ze)k+=1;else if(d===tt&&e.charCodeAt(k+1)===et){A=k+1;break}}else if(x===-1&&d===Wi)x=u.length+A-y;else if(d===rt&&h.length===0){u+=e.slice(y,A),c=A;break}else if(d===Ct)h+=")";else if(d===Bi)h+="]";else if(d===tr)h+="}";else if((d===bt||e.length-1===A)&&h.length===0){c=A-1,u+=e.slice(y,A);break}else(d===rr||d===Yi||d===bt)&&h.length>0&&e[A]===h[h.length-1]&&(h=h.slice(0,-1));let V=At(u,x);if(!V)throw new Error("Invalid custom property, expected a value");i&&(V.src=[i,y,c],V.dst=[i,y,c]),a?a.nodes.push(V):t.push(V),u=""}else if(w===rt&&u.charCodeAt(0)===xt)p=Be(u),i&&(p.src=[i,m,c],p.dst=[i,m,c]),a?a.nodes.push(p):t.push(p),u="",p=null;else if(w===rt&&f[f.length-1]!==")"){let h=At(u);if(!h){if(u.length===0)continue;throw new Error(`Invalid declaration: \`${u.trim()}\``)}i&&(h.src=[i,m,c],h.dst=[i,m,c]),a?a.nodes.push(h):t.push(h),u=""}else if(w===tr&&f[f.length-1]!==")")f+="}",p=J(u.trim()),i&&(p.src=[i,m,c],p.dst=[i,m,c]),a&&a.nodes.push(p),s.push(a),a=p,u="",p=null;else if(w===bt&&f[f.length-1]!==")"){if(f==="")throw new Error("Missing opening {");if(f=f.slice(0,-1),u.length>0)if(u.charCodeAt(0)===xt)p=Be(u),i&&(p.src=[i,m,c],p.dst=[i,m,c]),a?a.nodes.push(p):t.push(p),u="",p=null;else{let y=u.indexOf(":");if(a){let x=At(u,y);if(!x)throw new Error(`Invalid declaration: \`${u.trim()}\``);i&&(x.src=[i,m,c],x.dst=[i,m,c]),a.nodes.push(x)}}let h=s.pop()??null;h===null&&a&&t.push(a),a=h,u="",p=null}else if(w===Ct)f+=")",u+="(";else if(w===rr){if(f[f.length-1]!==")")throw new Error("Missing opening (");f=f.slice(0,-1),u+=")"}else{if(u.length===0&&(w===Fe||w===le||w===We))continue;u===""&&(m=c),u+=String.fromCharCode(w)}}}if(u.charCodeAt(0)===xt){let c=Be(u);i&&(c.src=[i,m,e.length],c.dst=[i,m,e.length]),t.push(c)}if(f.length>0&&a){if(a.kind==="rule")throw new Error(`Missing closing } at ${a.selector}`);if(a.kind==="at-rule")throw new Error(`Missing closing } at ${a.name} ${a.params}`)}return n.length>0?n.concat(t):t}function Be(e,r=[]){let i=e,t="";for(let n=5;n<e.length;n++){let s=e.charCodeAt(n);if(s===Fe||s===We||s===Ct){i=e.slice(0,n),t=e.slice(n);break}}return F(i.trim(),t.trim(),r)}function At(e,r=e.indexOf(":")){if(r===-1)return null;let i=e.indexOf("!important",r+1);return o(e.slice(0,r).trim(),e.slice(r+1,i===-1?e.length:i).trim(),i!==-1)}function nr(e,r,i){let t;for(let n=r+1;n<e.length;n++)if(t=e.charCodeAt(n),t===ze)n+=1;else{if(t===i)return n;if(t===rt&&(e.charCodeAt(n+1)===le||e.charCodeAt(n+1)===it&&e.charCodeAt(n+2)===le))throw new Error(`Unterminated string: ${e.slice(r,n+1)+String.fromCharCode(i)}`);if(t===le||t===it&&e.charCodeAt(n+1)===le)throw new Error(`Unterminated string: ${e.slice(r,n)+String.fromCharCode(i)}`)}return r}function
|
||
|
|
`,`
|
||
|
|
`);let r=[],i=[],t=null,n="",s;for(let a=0;a<e.length;a++){let p=e.charCodeAt(a);switch(p){case lr:{n+=e[a]+e[a+1],a++;break}case en:{if(n.length>0){let f=ie(n);t?t.nodes.push(f):r.push(f),n=""}let u=ie(e[a]);t?t.nodes.push(u):r.push(u);break}case sr:case ur:case fr:case cr:case pr:case dr:case mr:case gr:{if(n.length>0){let d=ie(n);t?t.nodes.push(d):r.push(d),n=""}let u=a,f=a+1;for(;f<e.length&&(s=e.charCodeAt(f),!(s!==sr&&s!==ur&&s!==fr&&s!==cr&&s!==pr&&s!==dr&&s!==mr&&s!==gr));f++);a=f-1;let m=Zi(e.slice(u,f));t?t.nodes.push(m):r.push(m);break}case Xi:case Ji:{let u=a;for(let f=a+1;f<e.length;f++)if(s=e.charCodeAt(f),s===lr)f+=1;else if(s===p){a=f;break}n+=e.slice(u,a+1);break}case Qi:{let u=qi(n,[]);n="",t?t.nodes.push(u):r.push(u),i.push(u),t=u;break}case Hi:{let u=i.pop();if(n.length>0){let f=ie(n);u?.nodes.push(f),n=""}i.length>0?t=i[i.length-1]:t=null;break}default:n+=String.fromCharCode(p)}}return n.length>0&&r.push(ie(n)),r}var St=(a=>(a[a.Continue=0]="Continue",a[a.Skip=1]="Skip",a[a.Stop=2]="Stop",a[a.Replace=3]="Replace",a[a.ReplaceSkip=4]="ReplaceSkip",a[a.ReplaceStop=5]="ReplaceStop",a))(St||{}),R={Continue:{kind:0},Skip:{kind:1},Stop:{kind:2},Replace:e=>({kind:3,nodes:Array.isArray(e)?e:[e]}),ReplaceSkip:e=>({kind:4,nodes:Array.isArray(e)?e:[e]}),ReplaceStop:e=>({kind:5,nodes:Array.isArray(e)?e:[e]})};function I(e,r){typeof r=="function"?hr(e,r):hr(e,r.enter,r.exit)}function hr(e,r=()=>R.Continue,i=()=>R.Continue){let t=[[e,0,null]],n={parent:null,depth:0,path(){let s=[];for(let a=1;a<t.length;a++){let p=t[a][2];p&&s.push(p)}return s}};for(;t.length>0;){let s=t.length-1,a=t[s],p=a[0],u=a[1],f=a[2];if(u>=p.length){t.pop();continue}if(n.parent=f,n.depth=s,u>=0){let w=p[u],h=r(w,n)??R.Continue;switch(h.kind){case 0:{w.nodes&&w.nodes.length>0&&t.push([w.nodes,0,w]),a[1]=~u;continue}case 2:return;case 1:{a[1]=~u;continue}case 3:{p.splice(u,1,...h.nodes);continue}case 5:{p.splice(u,1,...h.nodes);return}case 4:{p.splice(u,1,...h.nodes),a[1]+=h.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${St[h.kind]??`Unknown(${h.kind})`}\` in enter.`)}}let m=~u,d=p[m],c=i(d,n)??R.Continue;switch(c.kind){case 0:a[1]=m+1;continue;case 2:return;case 3:{p.splice(m,1,...c.nodes),a[1]=m+c.nodes.length;continue}case 5:{p.splice(m,1,...c.nodes);return}case 4:{p.splice(m,1,...c.nodes),a[1]=m+c.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${St[c.kind]??`Unknown(${c.kind})`}\` in exit.`)}}}function ot(e){let r=[];return I(B(e),i=>{if(!(i.kind!=="function"||i.value!=="var"))return I(i.nodes,t=>{t.kind!=="word"||t.value[0]!=="-"||t.value[1]!=="-"||r.push(t.value)}),R.Skip}),r}var tn=64;function G(e,r=[]){return{kind:"rule",selector:e,nodes:r}}function F(e,r="",i=[]){return{kind:"at-rule",name:e,params:r,nodes:i}}function J(e,r=[]){return e.charCodeAt(0)===tn?Be(e,r):G(e,r)}function o(e,r,i=!1){return{kind:"declaration",property:e,value:r,important:i}}function nt(e){return{kind:"comment",value:e}}function fe(e,r){return{kind:"context",context:e,nodes:r}}function W(e){return{kind:"at-root",nodes:e}}function ee(e){switch(e.kind){case"rule":return{kind:e.kind,selector:e.selector,nodes:e.nodes.map(ee),src:e.src,dst:e.dst};case"at-rule":return{kind:e.kind,name:e.name,params:e.params,nodes:e.nodes.map(ee),src:e.src,dst:e.dst};case"at-root":return{kind:e.kind,nodes:e.nodes.map(ee),src:e.src,dst:e.dst};case"context":return{kind:e.kind,context:{...e.context},nodes:e.nodes.map(ee),src:e.src,dst:e.dst};case"declaration":return{kind:e.kind,property:e.property,value:e.value,important:e.important,src:e.src,dst:e.dst};case"comment":return{kind:e.kind,value:e.value,src:e.src,dst:e.dst};default:throw new Error(`Unknown node kind: ${e.kind}`)}}function Ge(e){return{depth:e.depth,get context(){let r={};for(let i of e.path())i.kind==="context"&&Object.assign(r,i.context);return Object.defineProperty(this,"context",{value:r}),r},get parent(){let r=this.path().pop()??null;return Object.defineProperty(this,"parent",{value:r}),r},path(){return e.path().filter(r=>r.kind!=="context")}}}function Se(e,r,i=3){let t=[],n=ne
|
||
|
|
`,r){i+=f.length;let m=i;i+=a.property.length,i+=2,i+=a.value?.length??0,a.important&&(i+=11);let d=i;i+=2,a.dst=[t,m,d]}}else if(a.kind==="rule"){if(u+=`${f}${a.selector} {
|
||
|
|
`,r){i+=f.length;let m=i;i+=a.selector.length,i+=1;let d=i;a.dst=[t,m,d],i+=2}for(let m of a.nodes)u+=n(m,p+1);u+=`${f}}
|
||
|
|
`,r&&(i+=f.length,i+=2)}else if(a.kind==="at-rule"){if(a.nodes.length===0){let m=`${f}${a.name} ${a.params};
|
||
|
|
`;if(r){i+=f.length;let d=i;i+=a.name.length,i+=1,i+=a.params.length;let c=i;i+=2,a.dst=[t,d,c]}return m}if(u+=`${f}${a.name}${a.params?` ${a.params} `:" "}{
|
||
|
|
`,r){i+=f.length;let m=i;i+=a.name.length,a.params&&(i+=1,i+=a.params.length),i+=1;let d=i;a.dst=[t,m,d],i+=2}for(let m of a.nodes)u+=n(m,p+1);u+=`${f}}
|
||
|
|
`,r&&(i+=f.length,i+=2)}else if(a.kind==="comment"){if(u+=`${f}/*${a.value}*/
|
||
|
|
`,r){i+=f.length;let m=i;i+=2+a.value.length+2;let d=i;a.dst=[t,m,d],i+=1}}else if(a.kind==="context"||a.kind==="at-root")return"";return u}let s="";for(let a of e)s+=n(a,0);return t.code=s,s}function rn(e,r){let i=[];return I(e,(t,n)=>{if(r(t))return i=n.path(),i.push(t),R.Stop}),i}function wr(e,r,i,t=new Set){if(t.has(e)||(t.add(e),r.getOptions(e)&24))return!0;{let s=i.get(e)??[];for(let a of s)if(wr(a,r,i,t))return!0}return!1}function vr(e){return e.split(/[\s,]+/)}function ye(e){if(e.indexOf("(")===-1)return Pe(e);let r=B(e);return Vt(r),e=Z(r),e=qt(e),e}function Pe(e,r=!1){let i="";for(let t=0;t<e.length;t++){let n=e[t];n==="\\"&&e[t+1]==="_"?(i+="_",t+=1):n==="_"&&!r?i+=" ":i+=n}return i}function Vt(e){for(let r of e)switch(r.kind){case"function":{if(r.value==="url"||r.value.endsWith("_url")){r.value=Pe(r.value);break}if(r.value==="var"||r.value.endsWith("_var")||r.value==="theme"||r.value.endsWith("_theme")){r.value=Pe(r.value);for(let i=0;i<r.nodes.length;i++){if(i==0&&r.nodes[i].kind==="word"){r.nodes[i].value=Pe(r.nodes[i].value,!0);continue}Vt([r.nodes[i]])}break}r.value=Pe(r.value),Vt(r.nodes);break}case"separator":case"word":{r.value=Pe(r.value);break}default:nn(r)}}function nn(e){throw new Error(`Unexpected value: ${e}`)}var Nt=new Uint8Array(256);function ge(e){let r=0,i=e.length;for(let t=0;t<i;t++){let n=e.charCodeAt(t);switch(n){case 92:t+=1;break;case 39:case 34:for(;++t<i;){let s=e.charCodeAt(t);if(s===92){t+=1;continue}if(s===n)break}break;case 40:Nt[r]=41,r++;break;case 91:Nt[r]=93,r++;break;case 123:break;case 93:case 125:case 41:if(r===0)return!1;r>0&&n===Nt[r-1]&&r--;break;case 59:if(r===0)return!1;break}}return!0}var an=58,yr=45,kr=97,br=122;function xr(e){switch(e.kind){case"arbitrary":return{kind:e.kind,property:e.property,value:e.value,modifier:e.modifier?{kind:e.modifier.kind,value:e.modifier.value}:null,variants:e.variants.map(Ie),important:e.important,raw:e.raw};case"static":return{kind:e.kind,root:e.root,variants:e.variants.map(Ie),important:e.important,raw:e.raw};case"functional":return{kind:e.kind,root:e.root,value:e.value?e.value.kind==="arbitrary"?{kind:e.value.kind,dataType:e.value.dataType,value:e.value.value}:{kind:e.value.kind,value:e.value.value,fraction:e.value.fraction}:null,modifier:e.modifier?{kind:e.modifier.kind,value:e.modifier.value}:null,variants:e.variants.map(Ie),important:e.important,raw:e.raw};default:throw new Error("Unknown candidate kind")}}function Ie(e){switch(e.kind){case"arbitrary":return{kind:e.kind,selector:e.selector,relative:e.relative};case"static":return{kind:e.kind,root:e.root};case"functional":return{kind:e.kind,root:e.root,value:e.value?{kind:e.value.kind,value:e.value.value}:null,modifier:e.modifier?{kind:e.modifier.kind,value:e.modifier.value}:null};case"compound":return{kind:e.kind,root:e.root,variant:Ie(e.variant),modifier:e.modifier?{kind:e.modifier.kind,value:e.modifier.value}:null};default:throw new Error("Unknown variant kind")}}function*Ar(e,r){let i=L(e,":");if(r.theme.prefix){if(i.length===1||i[0]!==r.theme.prefix)return null;i.shift()}let t=i.pop(),n=[];for(let d=i.length-1;d>=0;--d){let c=r.parseVariant(i[d]);if(c===null)return;n.push(c)}let s=!1;t[t.length-1]==="!"?(s=!0,t=t.slice(0,-1)):t[0]==="!"&&(s=!0,t=t.slice(1)),r.utilities.has(t,"static")&&!t.includes("[")&&(yield{kind:"static",root:t,variants:n,important:s,raw:e});let[a,p=null,u]=L(t,"/");if(u)return;let f=p===null?null:Et(p);if(p!==null&&f===null)return;if(a[0]==="["){if(a[a.length-1]!=="]")return;let d=a.charCodeAt(1);if(d!==yr&&!(d>=kr&&d<=br))return;a=a.slice(1,-1);let c=a.indexOf(":");if(c===-1||c===0||c===a.length-1)return;let w=a.slice(0,c),h=ye(a.slice(c+1));if(!ge(h))return;yield{kind:"arbitrary",property:w,value:h,modifier:f,variants:n,important:s,raw:e};return}let m;if(a[a.length-1]==="]"){let d=a.indexOf("-[");if(d===-1)return;let c=a.slice(0,d);if(!r.utilities.has(c,"functional"))return;let w=a.slice(d+1);m=[[c,w]]}else if(a[a.length-1]===")"){let d=a.indexOf("-(");if(d===-1)return;let c=a.slice(0,d);if(!r.utilities.has(c,"functional"))return;let w=a.slice(d+2,-1),
|
||
|
|
Only valid data types are: ${It.map(y=>`"${y}"`).join(", ")}.
|
||
|
|
`);let f=u.value,m=structuredClone(a),d="\xB6";I(m.nodes,y=>{if(y.kind==="word"&&y.value===f)return R.ReplaceSkip({kind:"word",value:d})});let c="^".repeat(Z([u]).length),w=Z([m]).indexOf(d),h=["```css",Z([a])," ".repeat(w)+c,"```"].join(`
|
||
|
|
`);console.warn(h)}}),n.value=Z(s)}),i.utilities.functional(r.slice(0,-2),n=>{let s=ee(e),a=n.value,p=n.modifier;if(a===null)return;let u=!1,f=!1,m=!1,d=!1,c=new Map,w=!1;if(I([s],(h,y)=>{let x=y.parent;if(x?.kind!=="rule"&&x?.kind!=="at-rule"||h.kind!=="declaration"||!h.value)return;let V=!1,A=B(h.value);if(I(A,k=>{if(k.kind==="function"){if(k.value==="--value"){u=!0;let U=Vr(a,k,i);return U?(f=!0,U.ratio?w=!0:c.set(h,x),R.ReplaceSkip(U.nodes)):(u||=!1,V=!0,R.Stop)}else if(k.value==="--modifier"){if(p===null)return V=!0,R.Stop;m=!0;let U=Vr(p,k,i);return U?(d=!0,R.ReplaceSkip(U.nodes)):(m||=!1,V=!0,R.Stop)}}}),V)return R.ReplaceSkip([]);h.value=Z(A)}),u&&!f||m&&!d||w&&d||p&&!w&&!d)return null;if(w)for(let[h,y]of c){let x=y.nodes.indexOf(h);x!==-1&&y.nodes.splice(x,1)}return s.nodes}),i.utilities.suggest(r.slice(0,-2),()=>{let n=[],s=[];for(let[a,{literals:p,usedSpacingNumber:u,usedSpacingInteger:f,themeKeys:m}]of[[n,t["--value"]],[s,t["--modifier"]]]){for(let d of p)a.push(d);if(u)a.push(...ut);else if(f)for(let d of ut)P(d)&&a.push(d);for(let d of i.theme.keysInNamespaces(m))a.push(d.replace(Er,(c,w,h)=>`${w}.${h}`))}return[{values:n,modifiers:s}]})}:dn.test(r)?i=>{i.utilities.static(r,()=>e.nodes.map(ee))}:null}function Vr(e,r,i){for(let t of r.nodes){if(e.kind==="named"&&t.kind==="word"&&(t.value[0]==="'"||t.value[0]==='"')&&t.value[t.value.length-1]===t.value[0]&&t.value.slice(1,-1)===e.value)return{nodes:B(e.value)};if(e.kind==="named"&&t.kind==="word"&&t.value[0]==="-"&&t.value[1]==="-"){let n=t.value;if(n.endsWith("-*")){n=n.slice(0,-2);let s=i.theme.resolve(e.value,[n]);if(s)return{nodes:B(s)}}else{let s=n.split("-*");if(s.length<=1)continue;let a=[s.shift()],p=i.theme.resolveWith(e.value,a,s);if(p){let[,u={}]=p;{let f=u[s.pop()];if(f)return{nodes:B(f)}}}}}else if(e.kind==="named"&&t.kind==="word"){if(!It.includes(t.value))continue;let n=t.value==="ratio"&&"fraction"in e?e.fraction:e.value;if(!n)continue;let s=H(n,[t.value]);if(s===null)continue;if(s==="ratio"){let[a,p]=L(n,"/");if(!P(a)||!P(p))continue}else{if(s==="number"&&!oe(n))continue;if(s==="percentage"&&!P(n.slice(0,-1)))continue}return{nodes:B(n),ratio:s==="ratio"}}else if(e.kind==="arbitrary"&&t.kind==="word"&&t.value[0]==="["&&t.value[t.value.length-1]==="]"){let n=t.value.slice(1,-1);if(n==="*")return{nodes:B(e.value)};if("dataType"in e&&e.dataType&&e.dataType!==n)continue;if("dataType"in e&&e.dataType)return{nodes:B(e.value)};if(H(e.value,[n])!==null)return{nodes:B(e.value)}}}}function he(e,r,i,t,n=""){let s=!1,a=He(r,u=>i==null?t(u):u.startsWith("current")?t(Q(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(s=!0),t(Nr(u,i))));function p(u){return n?L(u,",").map(f=>n+f).join(","):u}return s?[o(e,p(He(r,t))),J("@supports (color: lab(from red l a b))",[o(e,p(a))])]:[o(e,p(a))]}function st(e,r,i,t,n=""){let s=!1,a=L(r,",").map(p=>He(p,u=>i==null?t(u):u.startsWith("current")?t(Q(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(s=!0),t(Nr(u,i))))).map(p=>`drop-shadow(${p})`).join(" ");return s?[o(e,n+L(r,",").map(p=>`drop-shadow(${He(p,t)})`).join(" ")),J("@supports (color: lab(from red l a b))",[o(e,n+a)])]:[o(e,n+a)]}var _t={"--alpha":gn,"--spacing":hn,"--theme":vn,theme:wn};function gn(e,r,i,...t){let[n,s]=L(i,"/").map(a=>a.trim());if(!n||!s)throw new Error(`The --alpha(\u2026) function requires a color and an alpha value, e.g.: \`--alpha(${n||"var(--my-color)"} / ${s||"50%"})\``);if(t.length>0)throw new Error(`The --alpha(\u2026) function only accepts one argument, e.g.: \`--alpha(${n||"var(--my-color)"} / ${s||"50%"})\``);return Q(n,s)}function hn(e,r,i,...t){if(!i)throw new Error("The --spacing(\u2026) function requires an argument, but received none.");if(t.length>0)throw new Error(`The --spacing(\u2026) function only accepts a single argument, but received ${t.length+1}.`);let n=e.theme.resolve(null,["--spacing"]);if(!n)throw new Error("The --spacing(\u2026) function requires that the `--spacing` theme variable exists, but it was not found.");return`calc(${n} * ${i})`}function vn(e,r,i,...t){if(!i.startsWith("--"))throw new Error("The
|
||
|
|
`,`
|
||
|
|
`);let r=[],i=[],t=null,n="",s;for(let a=0;a<e.length;a++){let p=e.charCodeAt(a);switch(p){case Gr:case qr:case Zr:case Xr:case Qr:case ei:case ti:{if(n.length>0){let c=be(n);t?t.nodes.push(c):r.push(c),n=""}let u=a,f=a+1;for(;f<e.length&&(s=e.charCodeAt(f),!(s!==Gr&&s!==qr&&s!==Zr&&s!==Xr&&s!==Qr&&s!==ei&&s!==ti));f++);a=f-1;let m=e.slice(u,f),d=m.trim()===","?En(m):Vn(m);t?t.nodes.push(d):r.push(d);break}case Jr:{let u=Nn(n,[]);if(n="",u.value!==":not"&&u.value!==":where"&&u.value!==":has"&&u.value!==":is"){let f=a+1,m=0;for(let c=a+1;c<e.length;c++){if(s=e.charCodeAt(c),s===Jr){m++;continue}if(s===Yr){if(m===0){a=c;break}m--}}let d=a;u.nodes.push(Rn(e.slice(f,d))),n="",a=d,t?t.nodes.push(u):r.push(u);break}t?t.nodes.push(u):r.push(u),i.push(u),t=u;break}case Yr:{let u=i.pop();if(n.length>0){let f=be(n);u.nodes.push(f),n=""}i.length>0?t=i[i.length-1]:t=null;break}case _n:case Pn:case Dn:{if(n.length>0){let u=be(n);t?t.nodes.push(u):r.push(u)}n=e[a];break}case Hr:{if(n.length>0){let m=be(n);t?t.nodes.push(m):r.push(m)}n="";let u=a,f=0;for(let m=a+1;m<e.length;m++){if(s=e.charCodeAt(m),s===Hr){f++;continue}if(s===On){if(f===0){a=m;break}f--}}n+=e.slice(u,a+1);break}case Kn:case In:{let u=a;for(let f=a+1;f<e.length;f++)if(s=e.charCodeAt(f),s===Br)f+=1;else if(s===p){a=f;break}n+=e.slice(u,a+1);break}case Un:case Ln:{if(n.length>0){let u=be(n);t?t.nodes.push(u):r.push(u),n=""}t?t.nodes.push(be(e[a])):r.push(be(e[a]));break}case Br:{n+=e[a]+e[a+1],a+=1;break}default:n+=e[a]}}return n.length>0&&r.push(be(n)),r}function se(e,r){for(let i in e)delete e[i];return Object.assign(e,r)}function Re(e){let r=[];for(let i of L(e,".")){if(!i.includes("[")){r.push(i);continue}let t=0;for(;;){let n=i.indexOf("[",t),s=i.indexOf("]",n);if(n===-1||s===-1)break;n>t&&r.push(i.slice(t,n)),r.push(i.slice(n+1,s)),t=s+1}t<=i.length-1&&r.push(i.slice(t))}return r}function Dt(e){let r=e;return r.storage[ai]??=jn(),r.storage[oi]??=zn(r),r.storage[li]??=Bn(),r.storage[si]??=Gn(),r.storage[ui]??=Zn(),r.storage[Ut]??=ea(r),r.storage[fi]??=ia(r),r.storage[pe]??=ga(r),r.storage[Lt]??=va(),r.storage[dt]??=wa(r),r.storage[jt]??=ya(r),r.storage[gt]??=ka(r),r.storage[di]??=ba(r),r}var ai=Symbol();function jn(){return new K(e=>new K(r=>({rem:e,features:r})))}function Mn(e,r){let i=0;return r?.collapse&&(i|=1),r?.logicalToPhysical&&(i|=2),Dt(e).storage[ai].get(r?.rem??null).get(i)}var oi=Symbol();function zn(e){return new K(r=>new K(i=>({features:i,designSystem:e,signatureOptions:r})))}function Fn(e,r,i){let t=0;return i?.collapse&&(t|=1),Dt(e).storage[oi].get(r).get(t)}function Kt(e,r,i){let t=Mn(e,i),n=Fn(e,t,i),s=Dt(e),a=new Set,p=s.storage[li].get(n);for(let u of r)a.add(p.get(u));return a.size<=1||!(n.features&1)?Array.from(a):Wn(n,Array.from(a))}function Wn(e,r){if(r.length<=1)return r;let i=e.designSystem,t=new K(p=>new K(u=>new Set)),n=e.designSystem.theme.prefix?`${e.designSystem.theme.prefix}:`:"";for(let p of r){let u=L(p,":"),f=u.pop(),m=f.endsWith("!");m&&(f=f.slice(0,-1));let d=u.length>0?`${u.join(":")}:`:"",c=m?"!":"";t.get(d).get(c).add(`${n}${f}`)}let s=new Set;for(let[p,u]of t.entries())for(let[f,m]of u.entries())for(let d of a(Array.from(m)))n&&d.startsWith(n)&&(d=d.slice(n.length)),s.add(`${p}${d}${f}`);return Array.from(s);function a(p){let u=e.signatureOptions,f=i.storage[dt].get(u),m=i.storage[Lt].get(u),c=p.map(A=>f.get(A)).map(A=>{let k=null;for(let[U,E]of A)for(let O of E){let j=m.get(U).get(O);if(k===null?k=new Set(j):k=ni(k,j),k.size===0)return k}return k}),w=new K(A=>new Set([A])),h=Array.from(c);for(let A=0;A<h.length;A++){let k=h[A];for(let U=A+1;U<h.length;U++){let E=h[U];for(let O of k)if(E.has(O)){w.get(A).add(U),w.get(U).add(A);break}}}if(w.size===0)return p;let y=new K(A=>A.split(",").map(Number));for(let A of w.values()){let k=Array.from(A).sort((U,E)=>U-E);y.get(k.join(","))}let x=new Set(p),V=new Set;for(let A of y.values())for(let k of Aa(A)){if(k.some(O=>V.has(p[O])))continue;let U=k.flatMap(O=>c[O]).reduce(ni),E=i.storage[pe].get(u).get(k.map(O=>p[O]).sort((O,j)=>O.localeCompare(j)).join(" "));for(let O of U)if(i.sto
|
||
|
|
`),s=!0;return I(B(t),a=>{if(a.kind==="function"&&a.value==="var"){let p=a.nodes[0].value;if(!new RegExp(`var\\(${p}[,)]\\s*`,"g").test(n)||n.includes(`${p}:`))return s=!1,R.Stop}}),s}function oa(e,r){if(e.kind!=="functional"||e.value?.kind!=="named")return e;let i=r.designSystem,t=i.storage[jt].get(r.signatureOptions),n=i.storage[pe].get(r.signatureOptions),s=i.printCandidate(e),a=n.get(s);if(typeof a!="string")return e;for(let u of p(a,e)){let f=i.printCandidate(u);if(n.get(f)===a)return u}return e;function*p(u,f){let m=t.get(u);if(!(m.length>1)){if(m.length===0&&f.modifier){let d={...f,modifier:null},c=n.get(i.printCandidate(d));if(typeof c=="string")for(let w of p(c,d))yield Object.assign({},w,{modifier:f.modifier})}if(m.length===1)for(let d of ve(i,m[0]))yield d}}}var la=new Map([["order-none","order-0"],["break-words","wrap-break-word"]]);function sa(e,r){let i=r.designSystem,t=i.storage[pe].get(r.signatureOptions),n=ra(i,e),s=la.get(n)??null;if(s===null)return e;let a=t.get(n);if(typeof a!="string")return e;let p=t.get(s);if(typeof p!="string"||a!==p)return e;let[u]=ve(i,s);return u}function ua(e,r){let i=r.designSystem,t=i.storage[gt],n=i.storage[di],s=mt(e);for(let[a]of s){if(a.kind==="compound")continue;let p=i.printVariant(a),u=t.get(p);if(typeof u!="string")continue;let f=n.get(u);if(f.length!==1)continue;let m=f[0],d=i.parseVariant(m);d!==null&&se(a,d)}return e}function fa(e,r){let i=r.designSystem,t=i.storage[pe].get(r.signatureOptions);if(e.kind==="functional"&&e.value?.kind==="arbitrary"&&e.value.dataType!==null){let n=i.printCandidate({...e,value:{...e.value,dataType:null}});t.get(i.printCandidate(e))===t.get(n)&&(e.value.dataType=null)}return e}function ca(e,r){if(e.kind!=="functional"||e.value?.kind!=="arbitrary")return e;let i=r.designSystem,t=i.storage[pe].get(r.signatureOptions),n=t.get(i.printCandidate(e));if(n===null)return e;for(let s of ci(e))if(t.get(i.printCandidate({...e,value:s}))===n)return e.value=s,e;return e}function pa(e){let r=mt(e);for(let[i]of r)if(i.kind==="functional"&&i.root==="data"&&i.value?.kind==="arbitrary"&&!i.value.value.includes("="))i.value={kind:"named",value:i.value.value};else if(i.kind==="functional"&&i.root==="aria"&&i.value?.kind==="arbitrary"&&(i.value.value.endsWith("=true")||i.value.value.endsWith('="true"')||i.value.value.endsWith("='true'"))){let[t,n]=L(i.value.value,"=");if(t[t.length-1]==="~"||t[t.length-1]==="|"||t[t.length-1]==="^"||t[t.length-1]==="$"||t[t.length-1]==="*")continue;i.value={kind:"named",value:i.value.value.slice(0,i.value.value.indexOf("="))}}else i.kind==="functional"&&i.root==="supports"&&i.value?.kind==="arbitrary"&&/^[a-z-][a-z0-9-]*$/i.test(i.value.value)&&(i.value={kind:"named",value:i.value.value});return e}function*ci(e,r=e.value?.value??"",i=new Set){if(i.has(r))return;if(i.add(r),yield{kind:"named",value:r,fraction:null},r.endsWith("%")&&oe(r.slice(0,-1))&&(yield{kind:"named",value:r.slice(0,-1),fraction:null}),r.includes("/")){let[s,a]=r.split("/");P(s)&&P(a)&&(yield{kind:"named",value:s,fraction:`${s}/${a}`})}let t=new Set;for(let s of r.matchAll(/(\d+\/\d+)|(\d+\.?\d+)/g))t.add(s[0].trim());let n=Array.from(t).sort((s,a)=>s.length-a.length);for(let s of n)yield*ci(e,s,i)}function ii(e){return!e.some(r=>r.kind==="separator"&&r.value.trim()===",")}function pt(e){let r=e.value.trim();return e.kind==="selector"&&r[0]==="["&&r[r.length-1]==="]"}function da(e,r){let i=[e],t=r.designSystem,n=t.storage[gt],s=mt(e);for(let[a,p]of s)if(a.kind==="compound"&&(a.root==="has"||a.root==="not"||a.root==="in")&&a.modifier!==null&&"modifier"in a.variant&&(a.variant.modifier=a.modifier,a.modifier=null),a.kind==="arbitrary"){if(a.relative)continue;let u=Ee(a.selector.trim());if(!ii(u))continue;if(p===null&&u.length===3&&u[0].kind==="selector"&&u[0].value==="&"&&u[1].kind==="combinator"&&u[1].value.trim()===">"&&u[2].kind==="selector"&&u[2].value==="*"){se(a,t.parseVariant("*"));continue}if(p===null&&u.length===3&&u[0].kind==="selector"&&u[0].value==="&"&&u[1].kind==="combinator"&&u[1].value.trim()===""&&u[2].kind==="selector"&&u[2].value==="*"){s
|
||
|
|
|
||
|
|
${re([d])}
|
||
|
|
Relies on:
|
||
|
|
|
||
|
|
${re([w])}`)}f.add(d);for(let w of s.get(d))for(let h of a.get(w))c.push(d),m(h,c),c.pop();p.add(d),f.delete(d),u.push(d)}}for(let d of n)m(d);for(let d of u)"nodes"in d&&I(d.nodes,c=>{if(c.kind!=="at-rule"||c.name!=="@apply")return;let w=c.params.split(/(\s+)/g),h={},y=0;for(let[x,V]of w.entries())x%2===0&&(h[V]=y),y+=V.length;{let x=Object.keys(h),V=Ae(x,r,{respectImportant:!1,onInvalidCandidate:E=>{if(r.theme.prefix&&!E.startsWith(r.theme.prefix))throw new Error(`Cannot apply unprefixed utility class \`${E}\`. Did you mean \`${r.theme.prefix}:${E}\`?`);if(r.invalidCandidates.has(E))throw new Error(`Cannot apply utility class \`${E}\` because it has been explicitly disabled: https://tailwindcss.com/docs/detecting-classes-in-source-files#explicitly-excluding-classes`);let O=L(E,":");if(O.length>1){let j=O.pop();if(r.candidatesToCss([j])[0]){let _=r.candidatesToCss(O.map(Y=>`${Y}:[--tw-variant-check:1]`)),M=O.filter((Y,q)=>_[q]===null);if(M.length>0){if(M.length===1)throw new Error(`Cannot apply utility class \`${E}\` because the ${M.map(Y=>`\`${Y}\``)} variant does not exist.`);{let Y=new Intl.ListFormat("en",{style:"long",type:"conjunction"});throw new Error(`Cannot apply utility class \`${E}\` because the ${Y.format(M.map(q=>`\`${q}\``))} variants do not exist.`)}}}}throw r.theme.size===0?new Error(`Cannot apply unknown utility class \`${E}\`. Are you using CSS modules or similar and missing \`@reference\`? https://tailwindcss.com/docs/functions-and-directives#reference-directive`):new Error(`Cannot apply unknown utility class \`${E}\``)}}),A=c.src,k=V.astNodes.map(E=>{let O=V.nodeSorting.get(E)?.candidate,j=O?h[O]:void 0;if(E=ee(E),!A||!O||j===void 0)return I([E],M=>{M.src=A}),E;let _=[A[0],A[1],A[2]];return _[1]+=7+j,_[2]=_[1]+O.length,I([E],M=>{M.src=_}),E}),U=[];for(let E of k)if(E.kind==="rule")for(let O of E.nodes)U.push(O);else U.push(E);return R.Replace(U)}});return i}function*Ai(e,r){for(let i of e.params.split(/\s+/g))for(let t of r.parseCandidate(i))switch(t.kind){case"arbitrary":break;case"static":case"functional":yield t.root;break;default:}}async function Wt(e,r,i,t=0,n=!1){let s=0,a=[];return I(e,p=>{if(p.kind==="at-rule"&&(p.name==="@import"||p.name==="@reference")){let u=Na(B(p.params));if(u===null)return;p.name==="@reference"&&(u.media="reference"),s|=2;let{uri:f,layer:m,media:d,supports:c}=u;if(f.startsWith("data:")||f.startsWith("http://")||f.startsWith("https://"))return;let w=fe({},[]);return a.push((async()=>{if(t>100)throw new Error(`Exceeded maximum recursion depth while resolving \`${f}\` in \`${r}\`)`);let h=await i(f,r),y=Ce(h.content,{from:n?h.path:void 0});await Wt(y,h.base,i,t+1,n),w.nodes=Ea(p,[fe({base:h.base},y)],m,d,c)})()),R.ReplaceSkip(w)}}),a.length>0&&await Promise.all(a),s}function Na(e){let r,i=null,t=null,n=null;for(let s=0;s<e.length;s++){let a=e[s];if(a.kind!=="separator"){if(a.kind==="word"&&!r){if(!a.value||a.value[0]!=='"'&&a.value[0]!=="'")return null;r=a.value.slice(1,-1);continue}if(a.kind==="function"&&a.value.toLowerCase()==="url"||!r)return null;if((a.kind==="word"||a.kind==="function")&&a.value.toLowerCase()==="layer"){if(i)return null;if(n)throw new Error("`layer(\u2026)` in an `@import` should come before any other functions or conditions");"nodes"in a?i=Z(a.nodes):i="";continue}if(a.kind==="function"&&a.value.toLowerCase()==="supports"){if(n)return null;n=Z(a.nodes);continue}t=Z(e.slice(s));break}}return r?{uri:r,layer:i,media:t,supports:n}:null}function Ea(e,r,i,t,n){let s=r;if(i!==null){let a=F("@layer",i,s);a.src=e.src,s=[a]}if(t!==null){let a=F("@media",t,s);a.src=e.src,s=[a]}if(n!==null){let a=F("@supports",n[0]==="("?n:`(${n})`,s);a.src=e.src,s=[a]}return s}function Me(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let r=Object.getPrototypeOf(e);return r===null||Object.getPrototypeOf(r)===null}function Qe(e,r,i,t=[]){for(let n of r)if(n!=null)for(let s of Reflect.ownKeys(n)){t.push(s);let a=i(e[s],n[s],t);a!==void 0?e[s]=a:!Me(e[s])||!Me(n[s])?e[s]=n[s]:e[s]=Qe({},[e[s],n[s]],i,t),t.pop()}return e}function vt(e,r,i){return function(n
|
||
|
|
|
||
|
|
${re([x])}
|
||
|
|
|
||
|
|
\`@plugin\` options must be a flat list of declarations.`);if(x.value===void 0)continue;let V=x.value,A=L(V,",").map(k=>{if(k=k.trim(),k==="null")return null;if(k==="true")return!0;if(k==="false")return!1;if(Number.isNaN(Number(k))){if(k[0]==='"'&&k[k.length-1]==='"'||k[0]==="'"&&k[k.length-1]==="'")return k.slice(1,-1);if(k[0]==="{"&&k[k.length-1]==="}")throw new Error(`Unexpected \`@plugin\` option: Value of declaration \`${re([x]).trim()}\` is not supported.
|
||
|
|
|
||
|
|
Using an object as a plugin option is currently only supported in JavaScript configuration files.`)}else return Number(k);return k});y[x.property]=A.length===1?A[0]:A}return a.push([{id:h,base:w.context.base,reference:!!w.context.reference,src:d.src},Object.keys(y).length>0?y:null]),s|=4,R.Replace([])}if(d.name==="@config"){if(d.nodes.length>0)throw new Error("`@config` cannot have a body.");if(w.parent!==null)throw new Error("`@config` cannot be nested.");return p.push({id:d.params.slice(1,-1),base:w.context.base,reference:!!w.context.reference,src:d.src}),s|=4,R.Replace([])}}),Pi(e);let u=e.resolveThemeValue;if(e.resolveThemeValue=function(c,w){return c.startsWith("--")?u(c,w):(s|=Di({designSystem:e,base:r,ast:i,sources:n,configs:[],pluginDetails:[]}),e.resolveThemeValue(c,w))},!a.length&&!p.length)return 0;let[f,m]=await Promise.all([Promise.all(p.map(async({id:d,base:c,reference:w,src:h})=>{let y=await t(d,c,"config");return{path:d,base:y.base,config:y.module,reference:w,src:h}})),Promise.all(a.map(async([{id:d,base:c,reference:w,src:h},y])=>{let x=await t(d,c,"plugin");return{path:d,base:x.base,plugin:x.module,options:y,reference:w,src:h}}))]);return s|=Di({designSystem:e,base:r,ast:i,sources:n,configs:f,pluginDetails:m}),s}function Di({designSystem:e,base:r,ast:i,sources:t,configs:n,pluginDetails:s}){let a=0,u=[...s.map(y=>{if(!y.options)return{config:{plugins:[y.plugin]},base:y.base,reference:y.reference,src:y.src};if("__isOptionsFunction"in y.plugin)return{config:{plugins:[y.plugin(y.options)]},base:y.base,reference:y.reference,src:y.src};throw new Error(`The plugin "${y.path}" does not accept options`)}),...n],{resolvedConfig:f}=Gt(e,[{config:Ei(e.theme),base:r,reference:!0,src:void 0},...u,{config:{plugins:[Oi]},base:r,reference:!0,src:void 0}]),{resolvedConfig:m,replacedThemeKeys:d}=Gt(e,u),c={designSystem:e,ast:i,resolvedConfig:f,featuresRef:{set current(y){a|=y}}},w=Bt({...c,referenceMode:!1,src:void 0}),h=e.resolveThemeValue;e.resolveThemeValue=function(x,V){if(x[0]==="-"&&x[1]==="-")return h(x,V);let A=w.theme(x,void 0);if(Array.isArray(A)&&A.length===2)return A[0];if(Array.isArray(A))return A.join(", ");if(typeof A=="object"&&A!==null&&"DEFAULT"in A)return A.DEFAULT;if(typeof A=="string")return A};for(let{handler:y,reference:x,src:V}of f.plugins){let A=Bt({...c,referenceMode:x??!1,src:V});y(A)}if(Dr(e,m,d),Ni(e,m),_i(m,e),Ii(m,e),Ri(m,e),!e.theme.prefix&&f.prefix){if(f.prefix.endsWith("-")&&(f.prefix=f.prefix.slice(0,-1),console.warn(`The prefix "${f.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only and is written as a variant before all utilities. We have fixed up the prefix for you. Remove the trailing \`-\` to silence this warning.`)),!Ua.test(f.prefix))throw new Error(`The prefix "${f.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);e.theme.prefix=f.prefix}if(!e.important&&f.important===!0&&(e.important=!0),typeof f.important=="string"){let y=f.important;I(i,(x,V)=>{if(x.kind!=="at-rule"||x.name!=="@tailwind"||x.params!=="utilities")return;let A=Ge(V);return A.parent?.kind==="rule"&&A.parent.selector===y?R.Stop:R.ReplaceStop(G(y,[x]))})}for(let y of f.blocklist)e.invalidCandidates.add(y);for(let y of f.content.files){if("raw"in y)throw new Error(`Error in the config file/plugin/preset. The \`content\` key contains a \`raw\` entry:
|
||
|
|
|
||
|
|
${JSON.stringify(y,null,2)}
|
||
|
|
|
||
|
|
This feature is not currently supported.`);let x=!1;y.pattern[0]=="!"&&(x=!0,y.pattern=y.pattern.slice(1)),t.push({...y,negated:x})}return a}function Ui(e){let r=[0];for(let n=0;n<e.length;n++)e.charCodeAt(n)===10&&r.push(n+1);function i(n){let s=0,a=r.length;for(;a>0;){let u=(a|0)>>1,f=s+u;r[f]<=n?(s=f+1,a=a-u-1):a=u}s-=1;let p=n-r[s];return{line:s+1,column:p}}function t({line:n,column:s}){n-=1,n=Math.min(Math.max(n,0),r.length-1);let a=r[n],p=r[n+1]??a;return Math.min(Math.max(a+s,0),p)}return{find:i,findOffset:t}}function Li({ast:e}){let r=new K(n=>Ui(n.code)),i=new K(n=>({url:n.file,content:n.code,ignore:!1})),t={file:null,sources:[],mappings:[]};I(e,n=>{if(!n.src||!n.dst)return;let s=i.get(n.src[0]);if(!s.content)return;let a=r.get(n.src[0]),p=r.get(n.dst[0]),u=s.content.slice(n.src[1],n.src[2]),f=0;for(let c of u.split(`
|
||
|
|
`)){if(c.trim()!==""){let w=a.find(n.src[1]+f),h=p.find(n.dst[1]);t.mappings.push({name:null,originalPosition:{source:s,...w},generatedPosition:h})}f+=c.length,f+=1}let m=a.find(n.src[2]),d=p.find(n.dst[2]);t.mappings.push({name:null,originalPosition:{source:s,...m},generatedPosition:d})});for(let n of r.keys())t.sources.push(i.get(n));return t.mappings.sort((n,s)=>n.generatedPosition.line-s.generatedPosition.line||n.generatedPosition.column-s.generatedPosition.column||(n.originalPosition?.line??0)-(s.originalPosition?.line??0)||(n.originalPosition?.column??0)-(s.originalPosition?.column??0)),t}var ji=/^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;function wt(e){let r=e.indexOf("{");if(r===-1)return[e];let i=[],t=e.slice(0,r),n=e.slice(r),s=0,a=n.lastIndexOf("}");for(let d=0;d<n.length;d++){let c=n[d];if(c==="{")s++;else if(c==="}"&&(s--,s===0)){a=d;break}}if(a===-1)throw new Error(`The pattern \`${e}\` is not balanced.`);let p=n.slice(1,a),u=n.slice(a+1),f;La(p)?f=ja(p):f=L(p,","),f=f.flatMap(d=>wt(d));let m=wt(u);for(let d of m)for(let c of f)i.push(t+c+d);return i}function La(e){return ji.test(e)}function ja(e){let r=e.match(ji);if(!r)return[e];let[,i,t,n]=r,s=n?parseInt(n,10):void 0,a=[];if(/^-?\d+$/.test(i)&&/^-?\d+$/.test(t)){let p=parseInt(i,10),u=parseInt(t,10);if(s===void 0&&(s=p<=u?1:-1),s===0)throw new Error("Step cannot be zero in sequence expansion.");let f=p<u;f&&s<0&&(s=-s),!f&&s>0&&(s=-s);for(let m=p;f?m<=u:m>=u;m+=s)a.push(m.toString())}return a}function Mi(e,r){let i=new Set,t=new Set,n=[];function s(a,p=[]){if(e.has(a)&&!i.has(a)){t.has(a)&&r.onCircularDependency?.(p,a),t.add(a);for(let u of e.get(a)??[])p.push(a),s(u,p),p.pop();i.add(a),t.delete(a),n.push(a)}}for(let a of e.keys())s(a);return n}var Ma=/^[a-z]+$/,Tt=(n=>(n[n.None=0]="None",n[n.AtProperty=1]="AtProperty",n[n.ColorMix=2]="ColorMix",n[n.All=3]="All",n))(Tt||{});function za(){throw new Error("No `loadModule` function provided to `compile`")}function Fa(){throw new Error("No `loadStylesheet` function provided to `compile`")}function Wa(e){let r=0,i=null;for(let t of L(e," "))t==="reference"?r|=2:t==="inline"?r|=1:t==="default"?r|=4:t==="static"?r|=8:t.startsWith("prefix(")&&t.endsWith(")")&&(i=t.slice(7,-1));return[r,i]}var De=(u=>(u[u.None=0]="None",u[u.AtApply=1]="AtApply",u[u.AtImport=2]="AtImport",u[u.JsPluginCompat=4]="JsPluginCompat",u[u.ThemeFunction=8]="ThemeFunction",u[u.Utilities=16]="Utilities",u[u.Variants=32]="Variants",u[u.AtTheme=64]="AtTheme",u))(De||{});async function zi(e,{base:r="",from:i,loadModule:t=za,loadStylesheet:n=Fa}={}){let s=0;e=[fe({base:r},e)],s|=await Wt(e,r,n,0,i!==void 0);let a=null,p=new at,u=new Map,f=new Map,m=[],d=null,c=null,w=[],h=[],y=[],x=[],V=null;I(e,(k,U)=>{if(k.kind!=="at-rule")return;let E=Ge(U);if(k.name==="@tailwind"&&(k.params==="utilities"||k.params.startsWith("utilities"))){if(c!==null)return R.Replace([]);if(E.context.reference)return R.Replace([]);let O=L(k.params," ");for(let j of O)if(j.startsWith("source(")){let _=j.slice(7,-1);if(_==="none"){V=_;continue}if(_[0]==='"'&&_[_.length-1]!=='"'||_[0]==="'"&&_[_.length-1]!=="'"||_[0]!=="'"&&_[0]!=='"')throw new Error("`source(\u2026)` paths must be quoted.");V={base:E.context.sourceBase??E.context.base,pattern:_.slice(1,-1)}}c=k,s|=16}if(k.name==="@utility"){if(E.parent!==null)throw new Error("`@utility` cannot be nested.");if(k.nodes.length===0)throw new Error(`\`@utility ${k.params}\` is empty. Utilities should include at least one property.`);let O=Or(k);if(O===null){if(!k.params.endsWith("-*")){if(k.params.endsWith("*"))throw new Error(`\`@utility ${k.params}\` defines an invalid utility name. A functional utility must end in \`-*\`.`);if(k.params.includes("*"))throw new Error(`\`@utility ${k.params}\` defines an invalid utility name. The dynamic portion marked by \`-*\` must appear once at the end.`)}throw new Error(`\`@utility ${k.params}\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter.`)}m.push(O)}if(k.name==="@source"){if(k.nodes.length>0)throw new Error("`@source` cannot have a body.")
|
||
|
|
`).map((Y,q,ne)=>`${q===0||q>=ne.length-2?" ":">"} ${Y}`).join(`
|
||
|
|
`);throw new Error(`\`@theme\` blocks must only contain custom properties or \`@keyframes\`.
|
||
|
|
|
||
|
|
${M}`)}),d?R.ReplaceSkip([]):(d=G(":root, :host",[]),d.src=k.src,R.ReplaceSkip(d))}});let A=yi(p);if(a&&(A.important=a),x.length>0)for(let k of x)A.invalidCandidates.add(k);s|=await Ki({designSystem:A,base:r,ast:e,loadModule:t,sources:h});for(let k of u.keys())A.variants.static(k,()=>{});for(let k of Mi(f,{onCircularDependency(U,E){let O=re(U.map((j,_)=>F("@custom-variant",j,[F("@variant",U[_+1]??E,[])]))).replaceAll(";"," { \u2026 }").replace(`@custom-variant ${E} {`,`@custom-variant ${E} { /* \u2190 */`);throw new Error(`Circular dependency detected in custom variants:
|
||
|
|
|
||
|
|
${O}`)}}))u.get(k)?.(A);for(let k of m)k(A);if(d){let k=[];for(let[E,O]of A.theme.entries()){if(O.options&2)continue;let j=o(we(E),O.value);j.src=O.src,k.push(j)}let U=A.theme.getKeyframes();for(let E of U)e.push(fe({theme:!0},[W([E])]));d.nodes=[fe({theme:!0},k)]}if(s|=Je(e,A),s|=_e(e,A),s|=xe(e,A),c){let k=c;k.kind="context",k.context={}}return I(e,k=>{if(k.kind==="at-rule")return k.name==="@utility"?R.Replace([]):R.Skip}),{designSystem:A,ast:e,sources:h,root:V,utilitiesNode:c,features:s,inlineCandidates:y}}async function Ba(e,r={}){let{designSystem:i,ast:t,sources:n,root:s,utilitiesNode:a,features:p,inlineCandidates:u}=await zi(e,r);t.unshift(nt(`! tailwindcss v${Qt} | MIT License | https://tailwindcss.com `));function f(h){i.invalidCandidates.add(h)}let m=new Set,d=null,c=0,w=!1;for(let h of u)i.invalidCandidates.has(h)||(m.add(h),w=!0);return{sources:n,root:s,features:p,build(h){if(p===0)return e;if(!a)return d??=Se(t,i,r.polyfills),d;let y=w,x=!1;w=!1;let V=m.size;for(let k of h)if(!i.invalidCandidates.has(k))if(k[0]==="-"&&k[1]==="-"){let U=i.theme.markUsedVariable(k);y||=U,x||=U}else m.add(k),y||=m.size!==V;if(!y)return d??=Se(t,i,r.polyfills),d;let A=Ae(m,i,{onInvalidCandidate:f}).astNodes;return r.from&&I(A,k=>{k.src??=a.src}),!x&&c===A.length?(d??=Se(t,i,r.polyfills),d):(c=A.length,a.nodes=A,d=Se(t,i,r.polyfills),d)}}}async function Hu(e,r={}){let i=Ce(e,{from:r.from}),t=await Ba(i,r),n=i,s=e;return{...t,build(a){let p=t.build(a);return p===n||(s=re(p,!!r.from),n=p),s},buildSourceMap(){return Li({ast:n})}}}async function Ju(e,r={}){return(await zi(Ce(e),r)).designSystem}function Ya(){throw new Error("It looks like you're trying to use `tailwindcss` directly as a PostCSS plugin. The PostCSS plugin has moved to a separate package, so to continue using Tailwind CSS with PostCSS you'll need to install `@tailwindcss/postcss` and update your PostCSS configuration.")}export{Tt as a,De as b,Ba as c,Hu as d,Ju as e,Ya as f};
|