@fwkui/x-css 1.0.19 → 1.0.20

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.mjs CHANGED
@@ -1,14 +1,19 @@
1
- var we=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var je=e=>(e=e||new Map,{all:e,on(t,n){let s=e.get(t);s?s.push(n):e.set(t,[n])},off(t,n){let s=e.get(t);s&&(n?s.splice(s.indexOf(n)>>>0,1):e.set(t,[]))},emit(t,n){let s=e.get(t);s&&s.slice().forEach(d=>{d(n)});let o=e.get("*");o&&o.slice().forEach(d=>{d(t,n)})}});function st(e,t,n){let s=0;for(let o=t;o<n;o++){let d=e.charCodeAt(o);if(d===91){s++;continue}if(d===93){s>0&&s--;continue}if(d===58&&s===0)return o}return-1}function ot(e,t,n){let s=0;for(let o=n-1;o>=t;o--){let d=e.charCodeAt(o);if(d===93){s++;continue}if(d===91){s>0&&s--;continue}if(d===64&&s===0)return o}return-1}function it(e,t,n){let s=0;for(let o=t;o<n;o++){let d=e.charCodeAt(o);if(d===91){s++;continue}if(d===93){if(s===0)return!1;s--}}return s===0}function at(e){return e>=97&&e<=122}function ie(e){if(!e||e.length<2||!it(e,0,e.length))return null;let t=0,n=e.length,s="",o=ot(e,t,n);o>t&&(s=e.substring(o+1,n),n=o);let d="",m="",u=st(e,t,n);if(u>0&&u<n){let O=e.substring(t,u);t=u+1,d=O}let k=t;for(;k<n;){let O=e.charCodeAt(k);if(O>=48&&O<=57)k++;else break}if(k>t&&(m=e.substring(t,k),t=k),t>=n||e.charCodeAt(t)===38)return null;if(e.charCodeAt(t)===91){let O=e.indexOf("]",t);if(O>t)return{mq:d,layer:m,prop:e.substring(t,O+1),val:"",selector:s}}let D=t;for(;D<n;){let O=e.charCodeAt(D);if(O===45||O===46){if(D+1<n){let b=e.charCodeAt(D+1);if(O===45&&b===45&&D>t||b>=48&&b<=57)break}D++;continue}if(!at(O))break;D++}if(D===t)return null;let K=e.substring(t,D),P=e.substring(D,n);return{mq:d,layer:m,prop:K,val:P,selector:s}}var He=e=>{let t=typeof e?.styleId=="string"&&e.styleId.trim()?e.styleId.trim():"fwkui",n=typeof e?.version=="string"&&e.version.trim()?e.version.trim():"v1",s=e?.compression??!0,o=typeof e?.debounceMs=="number"&&e.debounceMs>=0?e.debounceMs:1e3;return{styleId:t,version:n,compression:s,debounceMs:o}},lt=e=>`${e.styleId}_cache_${e.version}`,Ke=e=>{if(!e||typeof e!="object")return!1;let t=e;return t.__xcss_cache_v===2&&t.compressed===!0&&typeof t.payload=="string"},ve=e=>{if(!e||typeof e!="object")return!1;let t=e;return t.__xcss_cache_v===3&&t.compressed===!0&&t.algorithm==="deflate-raw"&&t.encoding==="base64"&&typeof t.payload=="string"},We=()=>typeof CompressionStream<"u"&&typeof Blob<"u"&&typeof Response<"u",Ue=()=>typeof DecompressionStream<"u"&&typeof Blob<"u"&&typeof Response<"u",ct=e=>{if(typeof btoa=="function"){let n="";for(let o=0;o<e.length;o+=32768){let d=e.subarray(o,o+32768);for(let m=0;m<d.length;m++)n+=String.fromCharCode(d[m])}return btoa(n)}let t=globalThis.Buffer;if(typeof t<"u")return t.from(e).toString("base64");throw new Error("XCSS: base64 encoding is not supported in this runtime")},dt=e=>{if(typeof atob=="function"){let n=atob(e),s=new Uint8Array(n.length);for(let o=0;o<n.length;o++)s[o]=n.charCodeAt(o);return s}let t=globalThis.Buffer;if(typeof t<"u")return new Uint8Array(t.from(e,"base64"));throw new Error("XCSS: base64 decoding is not supported in this runtime")},ft=async e=>{if(!We())throw new Error("XCSS: CompressionStream is not supported");let t=new Blob([e]).stream().pipeThrough(new CompressionStream("deflate-raw")),n=await new Response(t).arrayBuffer();return ct(new Uint8Array(n))},ut=async e=>{if(!Ue())throw new Error("XCSS: DecompressionStream is not supported");let t=dt(e),n=new Uint8Array(t.length);n.set(t);let s=new Blob([n.buffer]).stream().pipeThrough(new DecompressionStream("deflate-raw"));return await new Response(s).text()},pt=e=>{try{let t=JSON.parse(e);return ve(t)}catch{return!1}},yt=e=>{if(!e)return"";let t=new Map,n=[],s=256;for(let d=0;d<256;d++)t.set(String.fromCharCode(d),d);let o=e[0];for(let d=1;d<e.length;d++){let m=e[d],u=o+m;t.has(u)?o=u:(n.push(t.get(o)),t.set(u,s++),o=m)}return n.push(t.get(o)),n.map(d=>String.fromCharCode(d)).join("")},Ve=e=>{if(!e)return"";let t=new Map,n=256,s="";for(let u=0;u<256;u++)t.set(u,String.fromCharCode(u));let o=e.split("").map(u=>u.charCodeAt(0)),d=o[0],m=t.get(d)||"";s=m;for(let u=1;u<o.length;u++){let k=o[u],D=t.get(k);D||(D=k===n?m+m[0]:""),s+=D,t.set(n++,m+D[0]),m=D}return s},Ee=e=>{if(!e||typeof e!="object")return null;let t=e,n=t.default&&typeof t.default=="object"?t.default:t,s=n.SHORT_PROPERTIES,o=n.COMMON_VALUES,d=n.SPECIFIC_VALUES;return!s||!o||!d||typeof s!="object"||typeof o!="object"||typeof d!="object"?null:{SHORT_PROPERTIES:s,COMMON_VALUES:o,SPECIFIC_VALUES:d}},St=async e=>{let t=await import(e),n=Ee(t);if(!n)throw new Error(Ne);return n},Ne="XCSS: dictionary module must export SHORT_PROPERTIES, COMMON_VALUES and SPECIFIC_VALUES",ze=()=>{let e=typeof we=="function"?we:null;if(!e)return null;for(let t of["./dictionary.js","./dictionary"])try{let n=e(t),s=Ee(n);if(s)return s}catch{}return null},gt=async()=>{let e=ze();if(e)return e;let t=["./dictionary.mjs","./dictionary.js","./dictionary"],n=null;for(let s of t)try{let o=await import(s),d=Ee(o);if(d)return d}catch(o){n=o}throw n||new Error(Ne)},ht=(e,t)=>{if(!e||typeof document>"u")return;t=t||"fwkui";let n=Array.from({length:24},(s,o)=>"l"+o);if(!e.querySelector('style[id="'+t+'"]')){let s=document.createElement("style");if(s.id=t,!(e instanceof ShadowRoot))document.head.append(s);else try{e.prepend(s)}catch{e.appendChild(s)}let o=`@layer ${n.join(", ")};`,d=setInterval(()=>{if(s.sheet){clearInterval(d);try{s.sheet.insertRule(o,s.sheet.cssRules.length)}catch{}}},10)}},mt=e=>{let t=Array.isArray(e.excludes)?e.excludes:[],n=He(e.cache),s=JSON.stringify({base:e.base||"",aliases:e.aliases||{},breakpoints:e.breakpoints||[],theme:e.theme||{},prefix:e.prefix||"",excludes:t,excludePrefixes:e.excludePrefixes||[],dictionaryImport:e.dictionaryImport??!0,cache:n}),o=0;if(s.length===0)return o.toString();for(let d=0;d<s.length;d++){let m=s.charCodeAt(d);o=(o<<5)-o+m,o|=0}return o.toString()},xe=e=>{if(!e)return null;try{let t=JSON.parse(e);if(Ke(t)){let n=Ve(t.payload);return n?JSON.parse(n):null}return ve(t)?null:t}catch{return null}},Ct=async e=>{if(!e)return null;try{let t=JSON.parse(e);if(Ke(t)){let n=Ve(t.payload);return n?JSON.parse(n):null}if(ve(t)){let n=await ut(t.payload);return n?JSON.parse(n):null}return t}catch{return null}},Be=(e,t)=>{if(e==="root")return t;let n=/@media[^{]+\{\n?([\s\S]+)\n?\}/.exec(t);return n&&n[1]?n[1].trim():t},Re=(e={base:"",aliases:{},excludes:[],excludePrefixes:[],breakpoints:[],theme:{},prefix:"",dictionaryImport:!0,cache:{styleId:"fwkui",version:"v1",compression:!0,debounceMs:1e3}})=>{let{base:t=null,breakpoints:n=[],aliases:s={},theme:o={},excludes:d=[],excludePrefixes:m=[],prefix:u="",dictionaryImport:k=!0,cache:D={}}=e||{};Array.isArray(n)||(n=[]),Array.isArray(d)||(d=[]),Array.isArray(m)||(m=[]),(!s||typeof s!="object")&&(s={}),(!o||typeof o!="object")&&(o={});let K=He(D),P=lt(K),O=d,b=m.filter(r=>typeof r=="string").map(r=>r.trim()).filter(r=>r.length>0),X=r=>{let i=r.replace(/[.+?^${}()|[\]\\]/g,"\\$&");return new RegExp("^"+i.replace(/\*/g,".*")+"$")},J=O.filter(r=>typeof r=="string").map(r=>r.trim()).filter(r=>r.length>0).map(r=>{if(r.includes("*")){let i=X(r);return c=>i.test(c)}return i=>i===r}),ae=r=>b.some(i=>r.startsWith(i))?!0:J.some(i=>i(r)),le=r=>!(ae(r)||u&&!r.startsWith(u)),qe=["default","xs","sm","md","lg","xl","2xl","sma","mda","lga","xla"],Fe=n.filter(r=>!!r&&typeof r=="object"&&!Array.isArray(r)).map(r=>Object.keys(r)[0]).filter(r=>typeof r=="string"&&r.length>0),Ze=new Set([...qe,...Fe]),ce=r=>!r||Ze.has(r),Je=k!==!1,Ge=new Set(["mx","my","px","py","bdx","bdy"]),de=new Set,fe=r=>r?!Je||!N||Object.keys(N).length===0?!0:!!N[r]||Ge.has(r)||de.has(r):!1,N={},te={},ue={},pe={},_e=()=>{pe={...ue,...o}},q=r=>{if(!r){N={},te={},ue={},de=new Set,_e();return}N=r.SHORT_PROPERTIES,te=r.SPECIFIC_VALUES,ue=r.COMMON_VALUES,de=new Set(Object.values(N)),_e()},F=!0,re=Promise.resolve();if(k===!1)q(null);else if(typeof k=="string")F=!1,q(null),re=St(k).then(r=>{q(r)}).catch(r=>{console.warn("XCSS: Failed to import dictionary from URL",r)}).finally(()=>{F=!0});else{let r=ze();r?q(r):(F=!1,q(null),re=gt().then(i=>{q(i)}).catch(i=>{console.warn("XCSS: Failed to load built-in dictionary module",i)}).finally(()=>{F=!0}))}let G=null,Ye=(r=typeof document<"u"?document:void 0)=>{let i=typeof window<"u"&&typeof document<"u",c=null,S=Array.isArray(t)?t.length>0:!!t;r&&(c="getRootNode"in r?r.getRootNode():r);let p=new Map,v=new Set,T=1e3;i&&c&&ht(c,K.styleId);let y=je(),g=[{default:""},{xs:"screen and (max-width: 575px)"},{sm:"screen and (min-width: 576px)"},{md:"screen and (min-width: 768px)"},{lg:"screen and (min-width: 992px)"},{xl:"screen and (min-width: 1200px)"},{"2xl":"screen and (min-width: 1400px)"},{sma:"screen and (max-width: 768px)"},{mda:"screen and (max-width: 992px)"},{lga:"screen and (max-width: 1200px)"},{xla:"screen and (max-width: 1400px)"},...n],h=g.filter((a,l)=>g.findLastIndex(f=>Object.keys(f)[0]==Object.keys(a)[0])==l),$=h.map(a=>Object.keys(a)[0]),x={},E={},R={root:""},ne={root:[]},Y={root:!1},I=mt(e),j=null,W=0,U=!1,B=null,M=null,Q=a=>{try{window.localStorage.setItem(P,a)}catch(l){console.warn("XCSS: Failed to save cache",l)}},z=a=>{!i||!window.localStorage||typeof a=="string"&&window.localStorage.getItem(P)!==a||window.localStorage.removeItem(P)},ge=a=>{if(!i||!window.localStorage)return;G=a;let l=++W;try{let f=JSON.stringify(a),w=()=>{let C={__xcss_cache_v:2,compressed:!0,payload:yt(f)};Q(JSON.stringify(C))};if(!K.compression){Q(f);return}if(We()&&Ue()){ft(f).then(C=>{if(l!==W)return;Q(JSON.stringify({__xcss_cache_v:3,compressed:!0,algorithm:"deflate-raw",encoding:"base64",payload:C}))}).catch(()=>{l===W&&w()});return}w()}catch(f){console.warn("XCSS: Failed to save cache",f)}},A=()=>{i&&(j&&clearTimeout(j),j=setTimeout(()=>{let a={};for(let w in x)a[w]=Array.from(x[w]);let l={};Object.keys(R).forEach(w=>{if(w==="root")l[w]=R[w];else{let C=g.find(L=>Object.keys(L)[0]===w)?.[w];C&&R[w]?l[w]=`@media ${C} {
2
- ${R[w]}
3
- }`:l[w]=R[w]||""}});let f={configHash:I,cssText:l,rulesSet:a,keys:Array.from(p.entries()),sizeLast:T};ge(f)},K.debounceMs))};if(i&&window.localStorage)try{let a=window.localStorage.getItem(P);if(a){let l=xe(a);if(!l)pt(a)?M={raw:a}:window.localStorage.removeItem(P);else if(l.configHash!==I)window.localStorage.removeItem(P);else{if(B=l,U=!0,l.keys&&l.keys.forEach(([f,w])=>{p.set(f,w),v.add(w)}),typeof l.sizeLast=="number"&&(T=l.sizeLast),l.cssText)for(let f in l.cssText)R[f]=Be(f,l.cssText[f]);G=l}}}catch(a){console.error(a)}i&&(E.root=new CSSStyleSheet),$.forEach(a=>{if(x[a]=new Set,i){let l=h.find(f=>Object.keys(f)[0]==a)?.[a]||"";E[a]=new CSSStyleSheet({media:l})}U||(R[a]=""),ne[a]=[],Y[a]=!1});let he=()=>{if(!c)return;let a=c.querySelector(`style[id="${K.styleId}"]`);a&&a.remove()},se=a=>{if(a.keys&&a.keys.forEach(([l,f])=>{p.set(l,f),v.add(f)}),typeof a.sizeLast=="number"&&(T=a.sizeLast),a.cssText)for(let l in a.cssText){if(l==="root"&&S)continue;let f=Be(l,a.cssText[l]);R[l]=f,i&&E[l]&&E[l].replaceSync(f)}if(a.rulesSet)for(let l in a.rulesSet)x[l]||(x[l]=new Set),a.rulesSet[l].forEach(f=>x[l].add(f));G=a,he()};U&&B&&se(B),t&&Array.isArray(t)?(R.root=t.join(`
4
- `),i&&E.root&&E.root.replaceSync(R.root)):(R.root=t||"",i&&E.root&&E.root.replaceSync(R.root)),i&&c&&["root",...$].forEach(a=>{E[a]&&c?.adoptedStyleSheets&&(c.adoptedStyleSheets.includes(E[a])||(c.adoptedStyleSheets=[...c.adoptedStyleSheets,E[a]]))}),i&&window.localStorage&&M&&!U&&(async()=>{let a=await Ct(M.raw);if(!a){z(M.raw);return}if(a.configHash!==I){z(M.raw);return}U=!0,B=a,se(a)})(),i&&window.addEventListener&&window.addEventListener("storage",a=>{if(a.key===P&&a.newValue)try{let l=xe(a.newValue);l&&l.configHash===I&&(typeof l.sizeLast=="number"&&l.sizeLast>T&&(T=l.sizeLast),l.keys&&l.keys.forEach(([f,w])=>{p.has(f)||(p.set(f,w),v.add(w))}))}catch{}});let me=(a,l)=>{let{media:f,property:w,selector:C,layer:L,className:_}=l,V=R,H=ne,Ce=Y;L=Number(L)||0;let Pe=p.get(a),nt=Pe?`.${Pe}${C}`:`.${_}${C}`;var be=`@layer l${L}{${nt}{${w}}}`;x[f]||(x[f]=new Set);let $e=x[f];if(!$e.has(be))if($e.add(be),H[f]||(H[f]=[]),H[f].push(be),i)Ce[f]||(Ce[f]=!0,queueMicrotask(()=>{let ee=H[f],Me=E[f];ee.length>0&&(V[f]+=(V[f]?`
5
- `:"")+ee.join(`
6
- `),Me&&Me.replaceSync(V[f]),H[f]=[],A()),Ce[f]=!1}));else{let ee=H[f];ee.length>0&&(V[f]+=(V[f]?`
7
- `:"")+ee.join(`
8
- `),H[f]=[])}},oe=a=>{a.forEach(l=>{let f=Xe(l);f&&me(l,f)})},Le=a=>{if(a.length===0)return;let l=()=>oe(a);F?l():re.then(l)};return y.on("observeDom",Le),{clsx:(...a)=>{let l=a.map(C=>Array.isArray(C)?C:[C]).flat(1/0).map(C=>typeof C=="string"?C.split(/(\s|\t)+/g):[]).flat(1/0);l=l.filter(C=>typeof C=="string"&&C.trim()),l=[...new Set(l)];let f=C=>{if(!le(C))return!1;if(F)return!!Xe(C);let L=u?C.slice(u.length):C,_=ie(L);if(!_||!ce(_.mq))return!1;let V=(_.selector||"").replace(/(';|;)/g,H=>H=="';"?";":" ");return V&&!ye(V)?!1:_.prop.startsWith("[")?!!ke(_.prop+_.val):fe(_.prop)?(_.prop==="&",_.val.length>0):!1},w=l.map(C=>{let L=C;if(p.has(C))L=p.get(C);else if(f(C)){let _;do _="D"+(T++).toString(32).toUpperCase();while(v.has(_));p.set(C,_),v.add(_),L=_,A()}return L});return i?queueMicrotask(()=>y.emit("observeDom",l)):y.emit("observeDom",l),w.join(" ")},observe:()=>{!i||!c||rt(c,a=>{Le(a)})},getCssString:()=>Object.entries(R).map(([a,l])=>{if(!l)return"";if(a==="root"||a==="default")return l;let f=g.find(w=>Object.keys(w)[0]===a)?.[a];return f?`@media ${f} {
9
- ${l}
10
- }`:l}).join(`
11
- `)}};function ke(r){let i=new RegExp("^(\\[(?<p>[a-zA-Z]+)\\])$"),{p:c=""}=i.exec(r)?.groups??{};if(c&&s[c]&&Array.isArray(s[c])){let S=s[c],p=[],v=!0,T=y=>{let g=y.trim();if(!g)return null;let h=g.endsWith(";")?g.slice(0,-1).trim():g,$=h.indexOf(":");if($<=0||$>=h.length-1)return null;let x=h.slice(0,$).trim(),E=h.slice($+1).trim();return!x||!E||!/^(?:--[a-zA-Z0-9-_]+|-?[a-zA-Z][a-zA-Z0-9-]*)$/.test(x)?null:`${x}:${E}`};for(let y of S){if(typeof y!="string"){v=!1;break}let g=T(y);if(g){if(typeof CSS<"u"&&!CSS.supports(g)){v=!1;break}p.push(g);continue}v=!1;break}if(p.length>0&&v)return p.join(";")}return null}function Oe(r,i){let c=ke(r+i);if(c)return c;if(!r||i===void 0)return null;let S=N[r],p=S||r,v=i[0],T=!1,y=i;if(v==="!"&&(T=!0,y=y.substring(1),v=y[0]),y.startsWith("--"))y="var("+y+")";else if(v==="["&&y.endsWith("]"))y=y.substring(1,y.length-1);else if(y.length>0){let x=y[0].toLowerCase()+y.substring(1),E=te[r]?.[x]||pe[x];if(!E){let R=y.toLowerCase();E=te[r]?.[R]||pe[R]}y=E||y}if(y=y.replace(/(';|;)/g,x=>x=="';"?";":" "),!y)return null;let g=y+(T?" !important":""),h=[p+":"+g];switch(p){case"mx":h=[`margin-left:${g}`,`margin-right:${g}`];break;case"my":h=[`margin-top:${g}`,`margin-bottom:${g}`];break;case"px":h=[`padding-left:${g}`,`padding-right:${g}`];break;case"py":h=[`padding-top:${g}`,`padding-bottom:${g}`];break;case"bdx":h=[`border-left:${g}`,`border-right:${g}`];break;case"bdy":h=[`border-top:${g}`,`border-bottom:${g}`];break}return!(typeof CSS<"u")||h.every(x=>CSS.supports(x))?h.join(";"):null}let Qe=r=>{let i=0;for(let c=r.length-1;c>=0;c--){let S=r[c];if(S==="]"){i++;continue}if(S==="["){i>0&&i--;continue}if(S==="@"&&i===0)return{body:r.slice(0,c),selector:r.slice(c+1)}}return{body:r,selector:""}},et=r=>{let i=[],c=0,S=0;for(let p=0;p<r.length;p++){let v=r[p];if(v==="["){S++;continue}if(v==="]"){S>0&&S--;continue}v==="&"&&S===0&&(i.push(r.slice(c,p)),c=p+1)}return i.push(r.slice(c)),i},ye=r=>{if(!r)return!0;let i=r.trim();if(!i)return!0;if(/[{}]/.test(i)||i==="#"||i==="("||i===")"||i===","||i===">"||i==="+"||i==="~"||i.startsWith("(")||i.startsWith(")"))return!1;let c=0;for(let S=0;S<i.length;S++){let p=i[S];if(p==="("){c++;continue}if(p===")"){if(c===0)return!1;c--}}return c===0};function Xe(r){if(!le(r))return null;let i=u?r.slice(u.length):r,c=typeof CSS<"u"?CSS.escape(r):tt(r);if(i.includes("&")&&!i.startsWith("&")){let{body:R,selector:ne}=Qe(i),Y=et(R).map(I=>I.trim()).filter(I=>I.length>0).map(I=>u&&I.startsWith(u)?I.slice(u.length):I);if(Y.length>1){let I="",j="",W=ne,U=!1,B=[];for(let z of Y){let ge=W?`${z}@${W}`:z,A=ie(ge);if(!A||!ce(A.mq)||!A.prop.startsWith("[")&&!fe(A.prop))return null;U?(!A.mq&&I&&(A.mq=I),!A.layer&&j&&(A.layer=j)):(I=A.mq||"",j=A.layer||"",U=!0);let he=A.mq||"",se=A.layer||"",me=A.selector||"";if(he!==I||se!==j||me!==W)return null;let oe=Oe(A.prop,A.val);if(!oe)return null;B.push(oe)}if(B.length===0)return null;let M=W.replace(/(';|;)/g,z=>z=="';"?";":" "),Q=`selector(${c}${M})`;if(M){if(typeof CSS<"u"){if(!CSS.supports(Q))return null}else if(!ye(M))return null}return{media:I||"default",layer:j||"0",className:c,property:B.join(";"),selector:M,cssRules:`.${c}${M}{${B.join(";")}}`}}}let S=ie(i);if(!S||!ce(S.mq)||!S.prop.startsWith("[")&&!fe(S.prop))return null;let{mq:p="default",layer:v="0",prop:T,val:y,selector:g=""}=S,h=[],$=Oe(T,y);if($&&h.push($),h.length===0)return null;let x=g.replace(/(';|;)/g,R=>R=="';"?";":" "),E=`selector(${c}${x})`;if(x){if(typeof CSS<"u"){if(!CSS.supports(E))return null}else if(!ye(x))return null}return{media:p||"default",layer:v||"0",className:c,property:h.join(";"),selector:x,cssRules:`.${c}${x}{${h.join(";")}}`}}let tt=r=>r.replace(/([^\w-])/g,"\\$1"),Se=r=>{var i=[...r?.classList||[]].filter(c=>{if(c){let S=c.charCodeAt(0)==45?c.charCodeAt(1):c.charCodeAt(0);return S>=97&&S<=122||S>=48&&S<=57}return!1});return r?.children?.length>0&&Array.from(r?.children).forEach(c=>{i.push(...Se(c))}),i.flat(1/0)},rt=(r,i)=>{if(typeof i!="function")throw new Error("Callback is not a function");if(!r)return;let c;"documentElement"in r?c=r.documentElement:(r instanceof Element||"tagName"in r||"host"in r)&&(c=r),c&&(c instanceof Element&&i(Se(c)),typeof MutationObserver<"u"&&new MutationObserver(S=>{for(let p of S)if(p.type=="attributes"&&p.attributeName=="class"){if(p.target.nodeType==1){let v=String(p.target?.className??""),T=String(p?.oldValue??"");if(v||T){let y=v.split(" ").map(h=>h.trim()).filter(h=>h),g=T.split(" ").map(h=>h.trim()).filter(h=>h);y=y.filter(h=>!g.includes(h)),typeof i=="function"&&i([...new Set(y)])}}}else if(p.type=="childList"&&p.addedNodes.length>0){let v=[...p.addedNodes].filter(T=>T.nodeType==1).map(T=>Se(T)).flat(1/0);typeof i=="function"&&i([...new Set(v)])}}).observe(c,{attributes:!0,attributeOldValue:!0,attributeFilter:["class"],childList:!0,subtree:!0}))};return{buildCss:Ye,exportCache:()=>typeof window>"u"||!window.localStorage?G:xe(window.localStorage.getItem(P))||G,ready:re}},bt=(e,t)=>{Re(t).buildCss(e).observe()},wt=(e,t)=>Re(t).buildCss(e).clsx,Te={css:Re,cssObserve:bt,clsx:wt};var xt=(e,t)=>(e=e||"fwkui",t=t||"v1",`${e}_cache_${t}`),vt=(e="fwkui",t="v1",n)=>{let s=String(e||"").trim()||"fwkui",o=xt(s,t),d=JSON.stringify(s),m=JSON.stringify(o),u=`
1
+ var qe=e=>(e=e||new Map,{all:e,on(t,r){let s=e.get(t);s?s.push(r):e.set(t,[r])},off(t,r){let s=e.get(t);s&&(r?s.splice(s.indexOf(r)>>>0,1):e.set(t,[]))},emit(t,r){let s=e.get(t);s&&s.slice().forEach(l=>{l(r)});let n=e.get("*");n&&n.slice().forEach(l=>{l(t,r)})}});function xt(e,t,r){let s=0;for(let n=t;n<r;n++){let l=e.charCodeAt(n);if(l===91){s++;continue}if(l===93){s>0&&s--;continue}if(l===58&&s===0)return n}return-1}function vt(e,t,r){let s=0;for(let n=r-1;n>=t;n--){let l=e.charCodeAt(n);if(l===93){s++;continue}if(l===91){s>0&&s--;continue}if(l===64&&s===0)return n}return-1}function kt(e,t,r){let s=0;for(let n=t;n<r;n++){let l=e.charCodeAt(n);if(l===91){s++;continue}if(l===93){if(s===0)return!1;s--}}return s===0}function Et(e){return e>=97&&e<=122}function pe(e){if(!e||e.length<2||!kt(e,0,e.length))return null;let t=0,r=e.length,s="",n=vt(e,t,r);n>t&&(s=e.substring(n+1,r),r=n);let l="",f="",u=xt(e,t,r);if(u>0&&u<r){let _=e.substring(t,u);t=u+1,l=_}let y=t;for(;y<r;){let _=e.charCodeAt(y);if(_>=48&&_<=57)y++;else break}if(y>t&&(f=e.substring(t,y),t=y),t>=r||e.charCodeAt(t)===38)return null;if(e.charCodeAt(t)===91){let _=e.indexOf("]",t);if(_>t)return{mq:l,layer:f,prop:e.substring(t,_+1),val:"",selector:s}}let v=t;for(;v<r;){let _=e.charCodeAt(v);if(_===45||_===46){if(v+1<r){let C=e.charCodeAt(v+1);if(_===45&&C===45&&v>t||C>=48&&C<=57)break}v++;continue}if(!Et(_))break;v++}if(v===t)return null;let X=e.substring(t,v),N=e.substring(v,r);return{mq:l,layer:f,prop:X,val:N,selector:s}}var Ze={a:"all",ac:"align-content",acc:"accent-color",ai:"align-items",ani:"animation",anic:"animation-composition",anide:"animation-delay",anidi:"animation-direction",anidu:"animation-duration",anifm:"animation-fill-mode",aniic:"animation-iteration-count",anin:"animation-name",anips:"animation-play-state",anitf:"animation-timing-function",ap:"appearance",ar:"aspect-ratio",as:"align-self",b:"bottom",bd:"border",bda:"border-radius",bdb:"border-bottom",bdbc:"border-bottom-color",bdblc:"border-block-color",bdble:"border-block-end",bdblec:"border-block-end-color",bdbles:"border-block-end-style",bdblew:"border-block-end-width",bdblk:"border-block",bdblr:"border-bottom-left-radius",bdbls:"border-block-start",bdblsc:"border-block-start-color",bdblss:"border-block-start-style",bdblst:"border-block-style",bdblsw:"border-block-start-width",bdblwi:"border-block-width",bdbr:"box-decoration-break",bdbrr:"border-bottom-right-radius",bdbst:"border-bottom-style",bdbw:"border-bottom-width",bdc:"border-color",bdcl:"border-collapse",bdeer:"border-end-end-radius",bdesr:"border-end-start-radius",bdi:"border-inline",bdic:"border-inline-color",bdie:"border-inline-end",bdiec:"border-inline-end-color",bdies:"border-inline-end-style",bdiew:"border-inline-end-width",bdimg:"border-image",bdinw:"border-inline-width",bdio:"border-image-outset",bdir:"border-image-repeat",bdis:"border-image-slice",bdisc:"border-inline-start-color",bdisrc:"border-image-source",bdiss:"border-inline-start-style",bdista:"border-inline-start",bdistl:"border-inline-style",bdisw:"border-inline-start-width",bdiw:"border-image-width",bdl:"border-left",bdlc:"border-left-color",bdls:"border-left-style",bdlw:"border-left-width",bdr:"border-right",bdra:"border-radius",bdrc:"border-right-color",bdrs:"border-right-style",bdrw:"border-right-width",bds:"border-style",bdser:"border-start-end-radius",bdsp:"border-spacing",bdssr:"border-start-start-radius",bdt:"border-top",bdtc:"border-top-color",bdtlr:"border-top-left-radius",bdtrr:"border-top-right-radius",bdts:"border-top-style",bdtw:"border-top-width",bdw:"border-width",bg:"background",bga:"background-attachment",bgbm:"background-blend-mode",bgc:"background-color",bgcl:"background-clip",bgi:"background-image",bgo:"background-origin",bgp:"background-position",bgpx:"background-position-x",bgpy:"background-position-y",bgr:"background-repeat",bgs:"background-size",bkdf:"backdrop-filter",bkfv:"backface-visibility",blks:"block-size",brka:"break-after",brkb:"break-before",brki:"break-inside",bxsh:"box-shadow",bxshd:"box-shadow",bxsz:"box-sizing",c:"color",caps:"caption-side",cip:"color-interpolation",ciw:"contain-intrinsic-width",clpp:"clip-path",clr:"clear",cnt:"contain",cntibs:"contain-intrinsic-block-size",cntih:"contain-intrinsic-height",cntiis:"contain-intrinsic-inline-size",cntis:"contain-intrinsic-size",cntri:"counter-increment",cntrr:"counter-reset",cntrs:"counter-set",col:"columns",colc:"column-count",colf:"column-fill",colg:"column-gap",colr:"column-rule",colrc:"column-rule-color",colrs:"column-rule-style",colrw:"column-rule-width",cols:"column-span",colw:"column-width",cr:"cursor",crtc:"caret-color",csch:"color-scheme",ctr:"container",ctrn:"container-name",ctrt:"container-type",ctt:"content",d:"display",dir:"direction",empc:"empty-cells",fca:"forced-color-adjust",ff:"font-family",fl:"float",flt:"filter",fn:"font",fnf:"font-family",fnfs:"font-feature-settings",fnk:"font-kerning",fnlo:"font-language-override",fnos:"font-optical-sizing",fnp:"font-palette",fns:"font-size",fnsa:"font-size-adjust",fnsp:"font-synthesis-position",fnss:"font-synthesis-style",fnssc:"font-synthesis-small-caps",fnstr:"font-stretch",fnsty:"font-style",fnsw:"font-synthesis-weight",fnsyn:"font-synthesis",fnv:"font-variant",fnva:"font-variant-alternates",fnvc:"font-variant-caps",fnve:"font-variant-emoji",fnvea:"font-variant-east-asian",fnvl:"font-variant-ligatures",fnvn:"font-variant-numeric",fnvp:"font-variant-position",fnvs:"font-variation-settings",fnw:"font-weight",fw:"font-weight",fx:"flex",fxb:"flex-basis",fxd:"flex-direction",fxf:"flex-flow",fxg:"flex-grow",fxs:"flex-shrink",fxw:"flex-wrap",g:"grid",ga:"grid-area",gac:"grid-auto-columns",gaf:"grid-auto-flow",gap:"gap",gar:"grid-auto-rows",gc:"grid-column",gce:"grid-column-end",gcs:"grid-column-start",gr:"grid-row",gre:"grid-row-end",grs:"grid-row-start",gt:"grid-template",gta:"grid-template-areas",gtc:"grid-template-columns",gtr:"grid-template-rows",h:"height",hc:"hyphenate-character",hlc:"hyphenate-limit-chars",hp:"hanging-punctuation",hyp:"hyphens",i:"inset",ibe:"inset-block-end",iblk:"inset-block",ibsta:"inset-block-start",ii:"inset-inline",iie:"inset-inline-end",iis:"inset-inline-start",imgo:"image-orientation",imgr:"image-rendering",ins:"inline-size",is:"isolation",jc:"justify-content",ji:"justify-items",js:"justify-self",l:"left",lbrk:"line-break",lh:"line-height",lisp:"list-style-position",ls:"list-style",lsi:"list-style-image",lst:"list-style-type",lts:"letter-spacing",m:"margin",mb:"margin-bottom",mbd:"mix-blend-mode",mbe:"margin-block-end",mblk:"margin-block",mbs:"max-block-size",mbsta:"margin-block-start",mh:"max-height",mibs:"min-block-size",mie:"margin-inline-end",mih:"min-height",min:"margin-inline",mis:"max-inline-size",mista:"margin-inline-start",misz:"min-inline-size",miw:"min-width",ml:"margin-left",mr:"margin-right",msk:"mask",mskb:"mask-border",mskbm:"mask-border-mode",mskbo:"mask-border-outset",mskbr:"mask-border-repeat",mskbs:"mask-border-slice",mskbsrc:"mask-border-source",mskbw:"mask-border-width",mskc:"mask-clip",mskcp:"mask-composite",mski:"mask-image",mskm:"mask-mode",msko:"mask-origin",mskp:"mask-position",mskr:"mask-repeat",msks:"mask-size",mskt:"mask-type",mt:"margin-top",mtd:"math-depth",mts:"math-style",mw:"max-width",mxw:"max-width",of:"object-fit",ofa:"offset-anchor",ofd:"offset-distance",ofl:"overflow",ofla:"overflow-anchor",oflb:"overflow-block",oflcm:"overflow-clip-margin",ofli:"overflow-inline",oflw:"overflow-wrap",oflx:"overflow-x",ofly:"overflow-y",ofp:"offset-path",ofpo:"offset-position",ofr:"offset-rotate",ofs:"offset",olc:"outline-color",oli:"outline",olo:"outline-offset",ols:"outline-style",olw:"outline-width",op:"object-position",opc:"opacity",ord:"order",orp:"orphans",orsby:"overscroll-behavior-y",osrbb:"overscroll-behavior-block",osrbh:"overscroll-behavior",osrbi:"overscroll-behavior-inline",osrbx:"overscroll-behavior-x",p:"padding",pb:"padding-bottom",pbe:"padding-block-end",pblk:"padding-block",pbs:"padding-block-start",pe:"pointer-events",pg:"page",pgba:"page-break-after",pgbb:"page-break-before",pgbi:"page-break-inside",pi:"padding-inline",pie:"padding-inline-end",pis:"padding-inline-start",pl:"padding-left",plc:"place-content",pli:"place-items",pls:"place-self",pos:"position",pr:"padding-right",prca:"print-color-adjust",pso:"perspective-origin",psp:"perspective",pt:"padding-top",pto:"paint-order",qts:"quotes",r:"right",rbp:"ruby-position",rgap:"row-gap",rot:"rotate",rsz:"resize",s:"scale",sbc:"scrollbar-color",sbg:"scrollbar-gutter",sbw:"scrollbar-width",scrb:"scroll-behavior",scrm:"scroll-margin",scrmb:"scroll-margin-bottom",scrmbe:"scroll-margin-block-end",scrmblk:"scroll-margin-block",scrmbs:"scroll-margin-block-start",scrmi:"scroll-margin-inline",scrmie:"scroll-margin-inline-end",scrmis:"scroll-margin-inline-start",scrml:"scroll-margin-left",scrmr:"scroll-margin-right",scrmt:"scroll-margin-top",scrp:"scroll-padding",scrpb:"scroll-padding-bottom",scrpblk:"scroll-padding-block",scrpbs:"scroll-padding-block-start",scrpi:"scroll-padding-inline",scrpie:"scroll-padding-inline-end",scrpis:"scroll-padding-inline-start",scrpl:"scroll-padding-left",scrpr:"scroll-padding-right",scrpt:"scroll-padding-top",scrsa:"scroll-snap-align",scrss:"scroll-snap-stop",scrst:"scroll-snap-type",shit:"shape-image-threshold",shm:"shape-margin",sho:"shape-outside",srcpbe:"scroll-padding-block-end",t:"top",ta:"text-align",tal:"text-align-last",tbl:"table-layout",tbs:"tab-size",tcu:"text-combine-upright",td:"text-decoration",tdc:"text-decoration-color",tdl:"text-decoration-line",tds:"text-decoration-style",tdsi:"text-decoration-skip-ink",tdt:"text-decoration-thickness",tec:"text-emphasis-color",tep:"text-emphasis-position",teph:"text-emphasis",tes:"text-emphasis-style",ti:"text-indent",tj:"text-justify",toa:"touch-action",tol:"text-overflow",tor:"text-orientation",tra:"transform",trab:"transform-box",tran:"transition",tranb:"transition-behavior",trand:"transition-delay",trandur:"transition-duration",tranp:"transition-property",trantf:"transition-timing-function",trao:"transform-origin",tras:"transform-style",trd:"text-rendering",trl:"translate",tsh:"text-shadow",ttr:"text-transform",tuo:"text-underline-offset",tup:"text-underline-position",tw:"text-wrap",unib:"unicode-bidi",us:"user-select",v:"visibility",va:"vertical-align",w:"width",wc:"will-change",wd:"widows",wlc:"-webkit-line-clamp",wrb:"word-break",wrs:"word-spacing",wrtm:"writing-mode",ws:"white-space",wsc:"white-space-collapse",wtfc:"-webkit-text-fill-color",wts:"-webkit-text-stroke",wtsc:"-webkit-text-stroke-color",wtsw:"-webkit-text-stroke-width",z:"z-index",zo:"zoom"},Je={in:"inherit",ini:"initial",un:"unset",rv:"revert",n:"none",a:"auto",t:"top",b:"bottom",l:"left",r:"right",c:"center",m:"middle",j:"justify",s:"start",e:"end",tr:"transparent",cc:"currentColor",minc:"min-content",maxc:"max-content",fitc:"fit-content",sol:"solid",das:"dashed",dot:"dotted",dub:"double",vis:"visible",h:"hidden",col:"collapse"},M={ac:{s:"start",e:"end",fs:"flex-start",fe:"flex-end",n:"normal",b:"baseline",fb:"first baseline",lb:"last baseline",sp:"space-between",sa:"space-around",se:"space-evenly",st:"stretch",sc:"safe center",uc:"unsafe center"},acc:{u:"unset"},ai:{n:"normal",c:"center",s:"start",e:"end",fs:"flex-start",fe:"flex-end",ss:"self-start",se:"self-end",b:"baseline",fb:"first baseline",lb:"last baseline",sc:"safe center",uc:"unsafe center"},anic:{r:"replace",a:"add",ac:"accumulate",ra:"replace, add",aac:"add, accumulate",raac:"replace, add, accumulate"},anidi:{r:"reverse",a:"alternate",ar:"alternate-reverse",nr:"normal, reverse",arn:"alternate, reverse, normal"},anifm:{f:"forwards",b:"backwards",nb:"none, backwards",fbn:"both, forwards, none"},anin:{s:"slide"},anips:{p:"paused",r:"running"},anitf:{ei:"ease-in",eo:"ease-out",eio:"ease-in-out",l:"linear",ss:"step-start",se:"step-end"},ap:{mb:"menulist-button",tf:"textfield",b:"button",c:"checkbox"},ar:{s:"1 / 1",v:"16 / 9"},as:{n:"normal",c:"center",s:"start",e:"end",ss:"self-start",se:"self-end",fs:"flex-start",fe:"flex-end",b:"baseline",fb:"first baseline",lb:"last baseline",st:"stretch",sc:"safe center",uc:"unsafe center"},bd:{d:"dotted",ds:"dashed",db:"double",g:"groove",r:"ridge",i:"inset",o:"outset"},bdbles:{d:"dotted",ds:"dashed",db:"double",g:"groove",r:"ridge",i:"inset",o:"outset"},bdblss:{d:"dotted",ds:"dashed",db:"double",g:"groove",r:"ridge",i:"inset",o:"outset"},bdblst:{d:"dotted",ds:"dashed",db:"double",g:"groove",r:"ridge",i:"inset",o:"outset"},bdbr:{c:"clone",s:"slice"},bdbst:{d:"dotted",ds:"dashed",db:"double",g:"groove",r:"ridge",i:"inset",o:"outset"},bdbw:{t:"thin",m:"medium",th:"thick"},bdcl:{s:"separate",c:"collapse"},bdir:{st:"stretch",r:"repeat",rn:"round",s:"space"},bdlw:{t:"thin",m:"medium",th:"thick"},bdrs:{dt:"dotted",ds:"dashed",s:"solid",db:"double",g:"groove",r:"ridge",in:"inset",out:"outset"},bdrw:{t:"thin",m:"medium",th:"thick"},bds:{dt:"dotted",ds:"dashed",s:"solid",db:"double",g:"groove",r:"ridge",in:"inset",out:"outset"},bdts:{dt:"dotted",ds:"dashed",s:"solid",db:"double",g:"groove",r:"ridge",in:"inset",out:"outset"},bdtw:{t:"thin",m:"medium",th:"thick"},bdw:{t:"thin",m:"medium",th:"thick"},bga:{s:"scroll",f:"fixed",l:"local"},bgbm:{n:"normal",m:"multiply",s:"screen",o:"overlay",d:"darken",l:"lighten",cd:"color-dodge",i:"color-burn",hl:"hard-light",sl:"soft-light",di:"difference",e:"exclusion",h:"hue",sa:"saturation",c:"color",lu:"luminosity"},bgc:{t:"transparent",c:"currentcolor"},bgcl:{bb:"border-box",pb:"padding-box",cb:"content-box",t:"text"},bgo:{bb:"border-box",pb:"padding-box",cb:"content-box"},bgp:{t:"top",b:"bottom",l:"left",r:"right",c:"center",lt:"left top",ct:"center top",rt:"right top",lc:"left center",cc:"center center",rc:"right center",lb:"left bottom",cb:"center bottom",rb:"right bottom"},bgpx:{l:"left",r:"right",c:"center"},bgpy:{t:"top",b:"bottom",c:"center"},bgr:{r:"repeat",x:"repeat-x",y:"repeat-y",s:"space",rn:"round",n:"no-repeat",rs:"repeat space",rr:"repeat repeat",nr:"no-repeat round"},bgs:{c:"contain"},c:{i:"inherit",t:"transparent"},cr:{p:"pointer",d:"default",cm:"context-menu",h:"help",pg:"progress",w:"wait",c:"cell",t:"text",vt:"vertical-text",al:"alias",cp:"copy",mo:"move",nd:"no-drop",na:"not-allowed",gr:"grab",gb:"grabbing",as:"all-scroll",colr:"col-resize",rr:"row-resize",nr:"n-resize",er:"e-resize",sr:"s-resize",wr:"w-resize",ner:"ne-resize",ser:"se-resize",swr:"sw-resize",ewr:"ew-resize",nsr:"ns-resize",nesw:"nesw-resize",nwse:"nwse-resize",zi:"zoom-in",zo:"zoom-out"},d:{b:"block",ib:"inline-block",i:"inline",f:"flex",if:"inline-flex",t:"table",it:"inline-table",tcp:"table-caption",tcell:"table-cell",tcol:"table-column",tcolg:"table-column-group",tfg:"table-footer-group",thg:"table-header-group",trg:"table-row-group",tr:"table-row",fr:"flow-root",g:"grid",ig:"inline-grid",c:"contents",li:"list-item"},ff:{a:"ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",s:"ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif",m:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace"},fl:{is:"inline-start",ie:"inline-end",r:"right",l:"left"},fx:{i:"0 1 auto",a:"1 1 auto"},fxd:{r:"row",rr:"row-reverse",c:"column",cr:"column-reverse"},fxw:{w:"wrap",wr:"wrap-reverse",n:"nowrap"},gac:{mic:"min-content",mac:"max-content",mm:"minmax(0, 1fr)"},gaf:{r:"row",c:"column",d:"dense",rd:"row dense",cd:"column dense"},gar:{mic:"min-content",mac:"max-content",mm:"minmax(0, 1fr)"},gc:{f:"1 / -1"},gr:{f:"1 / -1"},gtc:{s:"subgrid"},gtr:{s:"subgrid"},h:{mic:"min-content",mac:"max-content",fc:"fit-content"},hyp:{m:"manual"},is:{i:"isolate"},jc:{c:"center",s:"start",e:"end",fs:"flex-start",fe:"flex-end",l:"left",r:"right",n:"normal",sp:"space-between",sa:"space-around",se:"space-evenly",st:"stretch",sc:"safe center",uc:"unsafe center"},ji:{n:"normal",st:"stretch",c:"center",s:"start",e:"end",fs:"flex-start",fe:"flex-end",ss:"self-start",se:"self-end",l:"left",r:"right",b:"baseline",fb:"first baseline",lb:"last baseline",lr:"legacy right",ll:"legacy left",lc:"legacy center",sc:"safe center",uc:"unsafe center"},js:{n:"normal",st:"stretch",c:"center",s:"start",e:"end",fs:"flex-start",fe:"flex-end",ss:"self-start",se:"self-end",l:"left",r:"right",b:"baseline",sc:"safe center",uc:"unsafe center"},lisp:{i:"inside",o:"outside"},ls:{i:"inside",di:"disc",c:"circle",s:"square",de:"decimal",g:"georgian",tci:"trad-chinese-informal",k:"kannada"},lst:{di:"disc",c:"circle",s:"square",de:"decimal",g:"georgian",tci:"trad-chinese-informal",k:"kannada"},lts:{n:"normal"},mbd:{n:"normal",m:"multiply",s:"screen",o:"overlay",d:"darken",l:"lighten",cd:"color-dodge",i:"color-burn",hl:"hard-light",sl:"soft-light",di:"difference",e:"exclusion",h:"hue",sa:"saturation",c:"color",lu:"luminosity"},mih:{f:"100%",mic:"min-content",mac:"max-content",fc:"fit-content"},miw:{f:"100%",mic:"min-content",mac:"max-content",fc:"fit-content"},of:{c:"contain",cv:"cover",f:"fill",sd:"scale-down"},oflw:{c:"clip",s:"scroll"},oflx:{c:"clip",s:"scroll"},ofly:{c:"clip",s:"scroll"},olc:{i:"inherit",c:"currentColor",t:"transparent"},ols:{dt:"dotted",ds:"dashed",s:"solid",db:"double",g:"groove",r:"ridge",in:"inset",out:"outset"},olw:{t:"thin",m:"medium",th:"thick"},op:{b:"bottom",c:"center",l:"left",r:"right",t:"top",lb:"left bottom",lt:"left top",rb:"right bottom",rt:"right top"},orsby:{c:"contain"},osrbb:{c:"contain"},osrbh:{c:"contain"},osrbi:{c:"contain"},osrbx:{c:"contain"},pi:{s:"start",c:"center",e:"end",b:"baseline",st:"stretch"},pos:{s:"static",f:"fixed",a:"absolute",r:"relative",st:"sticky"},rsz:{b:"both",h:"horizontal",v:"vertical"},ta:{s:"start",e:"end",l:"left",r:"right",c:"center",j:"justify",mp:"match-parent",mc:"-moz-center",wc:"-webkit-center"},tal:{s:"start",e:"end",l:"left",r:"right",c:"center",j:"justify"},td:{u:"underline"},tdl:{u:"underline",o:"overline",lt:"line-through",b:"blink"},tds:{db:"double",dt:"dotted",ds:"dashed",w:"wavy"},tdt:{ff:"from-font"},tep:{or:"over right",ol:"over left",ur:"under right",ul:"under left",lo:"left over",ru:"right under",lu:"left under"},tj:{iw:"inter-word",ic:"inter-character",d:"distribute"},toa:{p:"pan-x",py:"pan-y",pm:"pan-x pan-y",pi:"pinch-zoom"},tol:{c:"clip",e:"ellipsis"},tor:{m:"mixed",u:"upright",sr:"sideways-right",sl:"sideways-left",s:"sideways",ugo:"use-glyph-orientation"},trd:{op:"optimizeSpeed",ol:"optimizeLegibility",g:"geometricPrecision"},ttr:{c:"capitalize",u:"uppercase",l:"lowercase",fw:"full-width",fsk:"full-size-kana"},tup:{u:"under",l:"left",r:"right",ul:"under left",ru:"right under"},tw:{w:"wrap",n:"nowrap",b:"balance",p:"pretty"},us:{t:"text",all:"all",c:"contain"},v:{c:"collapse"},va:{bl:"baseline",t:"top",m:"middle",b:"bottom",tt:"text-top",tb:"text-bottom",sb:"sub",sp:"super"},w:{mic:"min-content",mac:"max-content",fc:"fit-content",f:"100%"},wc:{sp:"scroll-position",c:"contents",t:"transform"},wtsw:{m:"medium",t:"thick"}};M.ji=M.jc;M.js=M.jc;M.pc=M.jc;M.pi=M.jc;M.ps=M.jc;var Rt={SHORT_PROPERTIES:Ze,COMMON_VALUES:Je,SPECIFIC_VALUES:M},rt=e=>{let t=typeof e?.styleId=="string"&&e.styleId.trim()?e.styleId.trim():"fwkui",r=typeof e?.version=="string"&&e.version.trim()?e.version.trim():"v1",s=e?.compression??!0,n=typeof e?.debounceMs=="number"&&e.debounceMs>=0?e.debounceMs:1e3,l=typeof e?.sizeLast=="number"&&Number.isFinite(e.sizeLast)&&e.sizeLast>=0?Math.floor(e.sizeLast):1e3;return{styleId:t,version:r,compression:s,debounceMs:n,sizeLast:l}},It=e=>`${e.styleId}_cache_${e.version}`,Tt=e=>`${e.styleId}_ks_${e.version}`,_t=e=>`${e.styleId}_bc_${e.version}`,nt=e=>{if(!e||typeof e!="object")return!1;let t=e;return t.__xcss_cache_v===2&&t.compressed===!0&&typeof t.payload=="string"},Te=e=>{if(!e||typeof e!="object")return!1;let t=e;return t.__xcss_cache_v===3&&t.compressed===!0&&t.algorithm==="deflate-raw"&&t.encoding==="base64"&&typeof t.payload=="string"},st=()=>typeof CompressionStream<"u"&&typeof Blob<"u"&&typeof Response<"u",ot=()=>typeof DecompressionStream<"u"&&typeof Blob<"u"&&typeof Response<"u",At=e=>{if(typeof btoa=="function"){let r="";for(let n=0;n<e.length;n+=32768){let l=e.subarray(n,n+32768);for(let f=0;f<l.length;f++)r+=String.fromCharCode(l[f])}return btoa(r)}let t=globalThis.Buffer;if(typeof t<"u")return t.from(e).toString("base64");throw new Error("XCSS: base64 encoding is not supported in this runtime")},Ot=e=>{if(typeof atob=="function"){let r=atob(e),s=new Uint8Array(r.length);for(let n=0;n<r.length;n++)s[n]=r.charCodeAt(n);return s}let t=globalThis.Buffer;if(typeof t<"u")return new Uint8Array(t.from(e,"base64"));throw new Error("XCSS: base64 decoding is not supported in this runtime")},Lt=async e=>{if(!st())throw new Error("XCSS: CompressionStream is not supported");let t=new Blob([e]).stream().pipeThrough(new CompressionStream("deflate-raw")),r=await new Response(t).arrayBuffer();return At(new Uint8Array(r))},Pt=async e=>{if(!ot())throw new Error("XCSS: DecompressionStream is not supported");let t=Ot(e),r=new Uint8Array(t.length);r.set(t);let s=new Blob([r.buffer]).stream().pipeThrough(new DecompressionStream("deflate-raw"));return await new Response(s).text()},Dt=e=>{try{let t=JSON.parse(e);return Te(t)}catch{return!1}},jt=e=>{if(!e)return"";let t=new Map,r=[],s=256;for(let l=0;l<256;l++)t.set(String.fromCharCode(l),l);let n=e[0];for(let l=1;l<e.length;l++){let f=e[l],u=n+f;t.has(u)?n=u:(r.push(t.get(n)),t.set(u,s++),n=f)}return r.push(t.get(n)),r.map(l=>String.fromCharCode(l)).join("")},it=e=>{if(!e)return"";let t=new Map,r=256,s="";for(let u=0;u<256;u++)t.set(u,String.fromCharCode(u));let n=e.split("").map(u=>u.charCodeAt(0)),l=n[0],f=t.get(l)||"";s=f;for(let u=1;u<n.length;u++){let y=n[u],v=t.get(y);v||(v=y===r?f+f[0]:""),s+=v,t.set(r++,f+v[0]),f=v}return s},Ge=e=>{if(!e||typeof e!="object")return null;let t=e,r=t.default&&typeof t.default=="object"?t.default:t,s=r.SHORT_PROPERTIES,n=r.COMMON_VALUES,l=r.SPECIFIC_VALUES;return!s||!n||!l||typeof s!="object"||typeof n!="object"||typeof l!="object"?null:{SHORT_PROPERTIES:s,COMMON_VALUES:n,SPECIFIC_VALUES:l}},Ye=e=>{if(!e||typeof e!="object")return null;let t=e,r=Array.isArray(t.entries)?t.entries:Array.isArray(t.k)?t.k:null;if(!r)return null;let s=r.filter(l=>Array.isArray(l)&&l.length===2&&typeof l[0]=="string"&&typeof l[1]=="string"),n=typeof t.sizeLast=="number"?t.sizeLast:typeof t.s=="number"?t.s:null;return n===null?null:{source:typeof t.source=="string"?t.source:"",sizeLast:n,entries:s}},zt=(e,t)=>{let r=t;for(;r<e.length&&/\s/.test(e[r]);)r++;return r},Mt=(e,t)=>{let r=0,s=null,n=!1,l=!1,f=!1;for(let u=t;u<e.length;u++){let y=e[u],v=e[u+1];if(l){y===`
2
+ `&&(l=!1);continue}if(f){y==="*"&&v==="/"&&(f=!1,u++);continue}if(s){if(n){n=!1;continue}if(y==="\\"){n=!0;continue}y===s&&(s=null);continue}if(y==="/"&&v==="/"){l=!0,u++;continue}if(y==="/"&&v==="*"){f=!0,u++;continue}if(y==='"'||y==="'"||y==="`"){s=y;continue}if(y==="{"){r++;continue}if(y==="}"&&(r--,r===0))return u}return-1},be=(e,t)=>{let r=e.indexOf(t);if(r===-1)return null;let s=zt(e,r+t.length);if(e[s]!=="{")return null;let n=Mt(e,s);return n===-1?null:e.slice(s,n+1)},Y=(e,t)=>{let r=t;for(;r<e.length;){let s=e[r],n=e[r+1];if(/\s/.test(s)){r++;continue}if(s==="/"&&n==="/"){for(r+=2;r<e.length&&e[r]!==`
3
+ `;)r++;continue}if(s==="/"&&n==="*"){for(r+=2;r<e.length;){if(e[r]==="*"&&e[r+1]==="/"){r+=2;break}r++}continue}break}return r},Qe=(e,t)=>{let r=e[t];if(r!=='"'&&r!=="'")return null;let s="",n=t+1;for(;n<e.length;){let l=e[n];if(l==="\\"){if(n++,n>=e.length)return null;let f=e[n];s+={n:`
4
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v","\\":"\\",'"':'"',"'":"'"}[f]??f,n++;continue}if(l===r)return{value:s,end:n+1};s+=l,n++}return null},Xt=(e,t)=>{let r=e[t];if(!r||!/[A-Za-z_$]/.test(r))return null;let s=t+1;for(;s<e.length&&/[A-Za-z0-9_$]/.test(e[s]);)s++;return{value:e.slice(t,s),end:s}},ge=e=>{let t=(n,l)=>{let f=Y(n,l);return n[f]==="{"?r(n,f):Qe(n,f)},r=(n,l)=>{let f=Y(n,l);if(n[f]!=="{")return null;f++;let u={};for(;f<n.length;){if(f=Y(n,f),n[f]==="}")return{value:u,end:f+1};let y=Qe(n,f)||Xt(n,f);if(!y||(f=Y(n,y.end),n[f]!==":"))return null;f++;let v=t(n,f);if(!v)return null;if(u[y.value]=v.value,f=Y(n,v.end),n[f]===","){f++;continue}return n[f]==="}"?{value:u,end:f+1}:null}return null},s=r(e,0);return s&&Y(e,s.end)===e.length?s.value:null},$t=e=>{let t=be(e,"export const SHORT_PROPERTIES ="),r=be(e,"export const COMMON_VALUES ="),s=be(e,"export const SPECIFIC_VALUES =");if(t&&r&&s)return Ge({SHORT_PROPERTIES:ge(t),COMMON_VALUES:ge(r),SPECIFIC_VALUES:ge(s)});let n=be(e,"export default");return n?Ge(ge(n)):null},Bt=async e=>{let t=typeof process<"u"?process:null;if(!t||typeof t.getBuiltinModule!="function")return null;let r=e.startsWith("file:"),s=e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||/^[A-Za-z]:[\\/]/.test(e);if(!r&&!s)return null;let n=t.getBuiltinModule("node:fs/promises");return n?.readFile?n.readFile(r?new URL(e):e,"utf8"):null},Kt=async e=>{let t=await Bt(e);if(typeof t=="string")return t;if(typeof fetch=="function"){let r=await fetch(e);if(!r.ok)throw new Error(`XCSS: Failed to fetch dictionary module: ${r.status}`);return r.text()}throw new Error("XCSS: fetch is not supported in this runtime")},Ut=async e=>{let t=await Kt(e),r=$t(t);if(!r)throw new Error(Nt);return r},Nt="XCSS: dictionary module must export plain-object SHORT_PROPERTIES, COMMON_VALUES and SPECIFIC_VALUES",Vt=(e,t)=>{if(!e||typeof document>"u")return;t=t||"fwkui";let r=Array.from({length:24},(s,n)=>"l"+n);if(!e.querySelector('style[id="'+t+'"]')){let s=document.createElement("style");s.id=t;let n=`@layer ${r.join(", ")};`;if(s.textContent=n,!(e instanceof ShadowRoot))document.head.append(s);else try{e.prepend(s)}catch{e.appendChild(s)}}},Ht=e=>{let t=Array.isArray(e.excludes)?e.excludes:[],r=rt(e.cache),s=JSON.stringify({base:e.base||"",aliases:e.aliases||{},breakpoints:e.breakpoints||[],theme:e.theme||{},prefix:e.prefix||"",excludes:t,excludePrefixes:e.excludePrefixes||[],dictionaryImport:e.dictionaryImport??!0,cache:r}),n=0;if(s.length===0)return n.toString();for(let l=0;l<s.length;l++){let f=s.charCodeAt(l);n=(n<<5)-n+f,n|=0}return n.toString()},et=e=>{if(!e)return null;try{let t=JSON.parse(e);if(nt(t)){let r=it(t.payload);return r?JSON.parse(r):null}return Te(t)?null:t}catch{return null}},Wt=async e=>{if(!e)return null;try{let t=JSON.parse(e);if(nt(t)){let r=it(t.payload);return r?JSON.parse(r):null}if(Te(t)){let r=await Pt(t.payload);return r?JSON.parse(r):null}return t}catch{return null}},tt=(e,t)=>{if(e==="root")return t;let r=/@media[^{]+\{\n?([\s\S]+)\n?\}/.exec(t);return r&&r[1]?r[1].trim():t},_e=(e={base:"",aliases:{},excludes:[],excludePrefixes:[],breakpoints:[],theme:{},prefix:"",dictionaryImport:!0,cache:{styleId:"fwkui",version:"v1",compression:!0,debounceMs:1e3,sizeLast:1e3}})=>{let{base:t=null,breakpoints:r=[],aliases:s={},theme:n={},excludes:l=[],excludePrefixes:f=[],prefix:u="",dictionaryImport:y=!0,cache:v={}}=e||{};Array.isArray(r)||(r=[]),Array.isArray(l)||(l=[]),Array.isArray(f)||(f=[]),(!s||typeof s!="object")&&(s={}),(!n||typeof n!="object")&&(n={});let X=rt(v),N=It(X),_=Tt(X),C=_t(X),P=l,ee=f.filter(o=>typeof o=="string").map(o=>o.trim()).filter(o=>o.length>0),me=o=>{let a=o.replace(/[.+?^${}()|[\]\\]/g,"\\$&");return new RegExp("^"+a.replace(/\*/g,".*")+"$")},De=P.filter(o=>typeof o=="string").map(o=>o.trim()).filter(o=>o.length>0).map(o=>{if(o.includes("*")){let a=me(o);return p=>a.test(p)}return a=>a===o}),at=o=>ee.some(a=>o.startsWith(a))?!0:De.some(a=>a(o)),je=o=>!(at(o)||u&&!o.startsWith(u)),lt=["default","xs","sm","md","lg","xl","2xl","sma","mda","lga","xla"],ct=r.filter(o=>!!o&&typeof o=="object"&&!Array.isArray(o)).map(o=>Object.keys(o)[0]).filter(o=>typeof o=="string"&&o.length>0),dt=new Set([...lt,...ct]),he=o=>!o||dt.has(o),ft=y!==!1,ut=new Set(["mx","my","px","py","bdx","bdy"]),ye=new Set,Se=o=>o?!ft||!F||Object.keys(F).length===0?!0:!!F[o]||ut.has(o)||ye.has(o):!1,F={},le={},we={},Ce={},ze=()=>{Ce={...we,...n}},ce=o=>{if(!o){F={},le={},we={},ye=new Set,ze();return}F=o.SHORT_PROPERTIES,le=o.SPECIFIC_VALUES,we=o.COMMON_VALUES,ye=new Set(Object.values(F)),ze()},de=!0,xe=Promise.resolve();y===!1?ce(null):typeof y=="string"?(de=!1,ce(null),xe=Ut(y).then(o=>{ce(o)}).catch(o=>{console.warn("XCSS: Failed to import dictionary from URL",o)}).finally(()=>{de=!0})):ce(Rt);let te=null,pt=(o=typeof document<"u"?document:void 0)=>{let a=typeof window<"u"&&typeof document<"u",p=a?window:null,b=p?.localStorage||null,m=null,E=Array.isArray(t)?t.length>0:!!t;o&&(m="getRootNode"in o?o.getRootNode():o);let k=new Map,g=new Set,S=X.sizeLast,h=!0,$=`xcss_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`,R=[],j=!1,D=null,re=i=>{typeof i=="number"&&Number.isFinite(i)&&i>S&&(S=i)},ne=i=>{i&&(i.source&&i.source===$||(re(i.sizeLast),i.entries.forEach(([d,c])=>{let x=k.get(d);x!==c&&(x||g.has(c)||(k.set(d,c),g.add(c)))})))},L=()=>{if(j=!1,!a||R.length===0)return;let i={source:$,sizeLast:S,entries:R.splice(0,R.length)};if(D)try{D.postMessage(i);return}catch{D=null}if(b)try{b.setItem(_,JSON.stringify(i))}catch{}},q=i=>{a&&(R.push(i),!j&&(j=!0,queueMicrotask(L)))};if(a&&m&&Vt(m,X.styleId),a&&typeof BroadcastChannel<"u")try{D=new BroadcastChannel(C),D.addEventListener("message",i=>{ne(Ye(i.data))})}catch{D=null}let V=qe(),Z=[{default:""},{xs:"screen and (max-width: 575px)"},{sm:"screen and (min-width: 576px)"},{md:"screen and (min-width: 768px)"},{lg:"screen and (min-width: 992px)"},{xl:"screen and (min-width: 1200px)"},{"2xl":"screen and (min-width: 1400px)"},{sma:"screen and (max-width: 768px)"},{mda:"screen and (max-width: 992px)"},{lga:"screen and (max-width: 1200px)"},{xla:"screen and (max-width: 1400px)"},...r],J=Z.filter((i,d)=>Z.findLastIndex(c=>Object.keys(c)[0]==Object.keys(i)[0])==d),H=J.map(i=>Object.keys(i)[0]),B={},A={},O={root:""},T={root:[]},fe={root:!1},se=Ht(e),oe=null,G=0,ie=!1,ue=null,ae=null,Ee=i=>{try{b?.setItem(N,i)}catch(d){console.warn("XCSS: Failed to save cache",d)}},Be=i=>{!a||!b||typeof i=="string"&&b.getItem(N)!==i||(b.removeItem(N),b.removeItem(_))},yt=i=>{if(!a||!b)return;te=i;let d=++G;try{let c=JSON.stringify(i),x=()=>{let w={__xcss_cache_v:2,compressed:!0,payload:jt(c)};Ee(JSON.stringify(w))};if(!X.compression){Ee(c);return}if(st()&&ot()){Lt(c).then(w=>{if(d!==G)return;Ee(JSON.stringify({__xcss_cache_v:3,compressed:!0,algorithm:"deflate-raw",encoding:"base64",payload:w}))}).catch(()=>{d===G&&x()});return}x()}catch(c){console.warn("XCSS: Failed to save cache",c)}},Ke=()=>{a&&(oe&&clearTimeout(oe),oe=setTimeout(()=>{let i={};for(let x in B)i[x]=Array.from(B[x]);let d={};Object.keys(O).forEach(x=>{if(x==="root")d[x]=O[x];else{let w=Z.find(z=>Object.keys(z)[0]===x)?.[x];w&&O[x]?d[x]=`@media ${w} {
5
+ ${O[x]}
6
+ }`:d[x]=O[x]||""}});let c={configHash:se,cssText:d,rulesSet:i,keys:Array.from(k.entries()),sizeLast:S};yt(c)},X.debounceMs))};if(a&&b)try{let i=b.getItem(N);if(i){let d=et(i);if(!d)Dt(i)?ae={raw:i}:b.removeItem(N);else if(d.configHash!==se)b.removeItem(N);else{if(ue=d,ie=!0,d.keys&&d.keys.forEach(([c,x])=>{k.set(c,x),g.add(x)}),re(d.sizeLast),d.cssText)for(let c in d.cssText)O[c]=tt(c,d.cssText[c]);te=d}}}catch(i){console.error(i)}a&&(A.root=new CSSStyleSheet),H.forEach(i=>{if(B[i]=new Set,a){let d=J.find(c=>Object.keys(c)[0]==i)?.[i]||"";A[i]=new CSSStyleSheet({media:d})}ie||(O[i]=""),T[i]=[],fe[i]=!1});let St=()=>{if(!m)return;let i=m.querySelector(`style[id="${X.styleId}"]`);i&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{i.remove()})})},Ue=i=>{if(i.keys&&i.keys.forEach(([d,c])=>{k.set(d,c),g.add(c)}),re(i.sizeLast),i.cssText)for(let d in i.cssText){if(d==="root"&&E)continue;let c=tt(d,i.cssText[d]);O[d]=c,a&&A[d]&&A[d].replaceSync(c)}if(i.rulesSet)for(let d in i.rulesSet)B[d]||(B[d]=new Set),i.rulesSet[d].forEach(c=>B[d].add(c));te=i,St()};if(ie&&ue&&Ue(ue),t&&Array.isArray(t)?(O.root=t.join(`
7
+ `),a&&A.root&&A.root.replaceSync(O.root)):(O.root=t||"",a&&A.root&&A.root.replaceSync(O.root)),a&&m?.adoptedStyleSheets){let i=m.adoptedStyleSheets,d=["root",...H].map(c=>A[c]).filter(c=>c&&!i.includes(c));d.length>0&&(m.adoptedStyleSheets=[...i,...d])}a&&b&&ae&&!ie&&(async()=>{let i=await Wt(ae.raw);if(!i){Be(ae.raw);return}if(i.configHash!==se){Be(ae.raw);return}ie=!0,ue=i,Ue(i)})(),a&&p?.addEventListener&&p.addEventListener("storage",i=>{if(i.key===_&&i.newValue)try{ne(Ye(JSON.parse(i.newValue)))}catch{}});let wt=(i,d)=>{let{media:c,property:x,selector:w,layer:z,className:I}=d,K=O,U=T,Re=fe;z=Number(z)||0;let He=k.get(i),Ct=He?`.${He}${w}`:`.${I}${w}`;var Ie=`@layer l${z}{${Ct}{${x}}}`;B[c]||(B[c]=new Set);let We=B[c];if(!We.has(Ie))if(We.add(Ie),U[c]||(U[c]=[]),U[c].push(Ie),a)if(h){let W=U[c];W.length>0&&(K[c]+=(K[c]?`
8
+ `:"")+W.join(`
9
+ `),A[c]&&A[c].replaceSync(K[c]),U[c]=[])}else Re[c]||(Re[c]=!0,queueMicrotask(()=>{let W=U[c],Fe=A[c];W.length>0&&(K[c]+=(K[c]?`
10
+ `:"")+W.join(`
11
+ `),Fe&&Fe.replaceSync(K[c]),U[c]=[],Ke()),Re[c]=!1}));else{let W=U[c];W.length>0&&(K[c]+=(K[c]?`
12
+ `:"")+W.join(`
13
+ `),U[c]=[])}},Ne=i=>{i.forEach(d=>{let c=$e(d);c&&wt(d,c)})},Ve=i=>{if(i.length===0)return;let d=()=>Ne(i);de?d():xe.then(d)};return V.on("observeDom",Ve),{clsx:(...i)=>{let d=i.map(w=>Array.isArray(w)?w:[w]).flat(1/0).map(w=>typeof w=="string"?w.split(/(\s|\t)+/g):[]).flat(1/0);d=d.filter(w=>typeof w=="string"&&w.trim()),d=[...new Set(d)];let c=w=>{if(!je(w))return!1;if(de)return!!$e(w);let z=u?w.slice(u.length):w,I=pe(z);if(!I||!he(I.mq))return!1;let K=(I.selector||"").replace(/(';|;)/g,U=>U=="';"?";":" ");return K&&!ve(K)?!1:I.prop.startsWith("[")?!!Me(I.prop+I.val):Se(I.prop)?(I.prop==="&",I.val.length>0):!1},x=d.map(w=>{let z=w;if(k.has(w))z=k.get(w);else if(c(w)){let I;do I="D"+(S++).toString(32).toUpperCase();while(g.has(I));k.set(w,I),g.add(I),q([w,I]),z=I,Ke()}return z});return!a||h?V.emit("observeDom",d):queueMicrotask(()=>V.emit("observeDom",d)),x.join(" ")},observe:()=>{!a||!m||(ht(m,i=>{h?Ne(i):Ve(i)}),h=!1)},getCssString:()=>Object.entries(O).map(([i,d])=>{if(!d)return"";if(i==="root"||i==="default")return d;let c=Z.find(x=>Object.keys(x)[0]===i)?.[i];return c?`@media ${c} {
14
+ ${d}
15
+ }`:d}).join(`
16
+ `)}};function Me(o){let a=new RegExp("^(\\[(?<p>[a-zA-Z]+)\\])$"),{p=""}=a.exec(o)?.groups??{};if(p&&s[p]&&Array.isArray(s[p])){let b=s[p],m=[],E=!0,k=g=>{let S=g.trim();if(!S)return null;let h=S.endsWith(";")?S.slice(0,-1).trim():S,$=h.indexOf(":");if($<=0||$>=h.length-1)return null;let R=h.slice(0,$).trim(),j=h.slice($+1).trim();return!R||!j||!/^(?:--[a-zA-Z0-9-_]+|-?[a-zA-Z][a-zA-Z0-9-]*)$/.test(R)?null:`${R}:${j}`};for(let g of b){if(typeof g!="string"){E=!1;break}let S=k(g);if(S){if(typeof CSS<"u"&&!CSS.supports(S)){E=!1;break}m.push(S);continue}E=!1;break}if(m.length>0&&E)return m.join(";")}return null}function Xe(o,a){let p=Me(o+a);if(p)return p;if(!o||a===void 0)return null;let b=F[o],m=b||o,E=a[0],k=!1,g=a;if(E==="!"&&(k=!0,g=g.substring(1),E=g[0]),g.startsWith("--"))g="var("+g+")";else if(E==="["&&g.endsWith("]"))g=g.substring(1,g.length-1);else if(g.length>0){let R=g[0].toLowerCase()+g.substring(1),j=le[o]?.[R]||Ce[R];if(!j){let D=g.toLowerCase();j=le[o]?.[D]||Ce[D]}g=j||g}if(g=g.replace(/(';|;)/g,R=>R=="';"?";":" "),!g)return null;let S=g+(k?" !important":""),h=[m+":"+S];switch(m){case"mx":h=[`margin-left:${S}`,`margin-right:${S}`];break;case"my":h=[`margin-top:${S}`,`margin-bottom:${S}`];break;case"px":h=[`padding-left:${S}`,`padding-right:${S}`];break;case"py":h=[`padding-top:${S}`,`padding-bottom:${S}`];break;case"bdx":h=[`border-left:${S}`,`border-right:${S}`];break;case"bdy":h=[`border-top:${S}`,`border-bottom:${S}`];break}return!(typeof CSS<"u")||h.every(R=>CSS.supports(R))?h.join(";"):null}let bt=o=>{let a=0;for(let p=o.length-1;p>=0;p--){let b=o[p];if(b==="]"){a++;continue}if(b==="["){a>0&&a--;continue}if(b==="@"&&a===0)return{body:o.slice(0,p),selector:o.slice(p+1)}}return{body:o,selector:""}},gt=o=>{let a=[],p=0,b=0;for(let m=0;m<o.length;m++){let E=o[m];if(E==="["){b++;continue}if(E==="]"){b>0&&b--;continue}E==="&"&&b===0&&(a.push(o.slice(p,m)),p=m+1)}return a.push(o.slice(p)),a},ve=o=>{if(!o)return!0;let a=o.trim();if(!a)return!0;if(/[{}]/.test(a)||a==="#"||a==="("||a===")"||a===","||a===">"||a==="+"||a==="~"||a.startsWith("(")||a.startsWith(")"))return!1;let p=0;for(let b=0;b<a.length;b++){let m=a[b];if(m==="("){p++;continue}if(m===")"){if(p===0)return!1;p--}}return p===0};function $e(o){if(!je(o))return null;let a=u?o.slice(u.length):o,p=typeof CSS<"u"?CSS.escape(o):mt(o);if(a.includes("&")&&!a.startsWith("&")){let{body:D,selector:re}=bt(a),ne=gt(D).map(L=>L.trim()).filter(L=>L.length>0).map(L=>u&&L.startsWith(u)?L.slice(u.length):L);if(ne.length>1){let L="",q="",V=re,Z=!1,J=[];for(let A of ne){let O=V?`${A}@${V}`:A,T=pe(O);if(!T||!he(T.mq)||!T.prop.startsWith("[")&&!Se(T.prop))return null;Z?(!T.mq&&L&&(T.mq=L),!T.layer&&q&&(T.layer=q)):(L=T.mq||"",q=T.layer||"",Z=!0);let fe=T.mq||"",se=T.layer||"",oe=T.selector||"";if(fe!==L||se!==q||oe!==V)return null;let G=Xe(T.prop,T.val);if(!G)return null;J.push(G)}if(J.length===0)return null;let H=V.replace(/(';|;)/g,A=>A=="';"?";":" "),B=`selector(${p}${H})`;if(H){if(typeof CSS<"u"){if(!CSS.supports(B))return null}else if(!ve(H))return null}return{media:L||"default",layer:q||"0",className:p,property:J.join(";"),selector:H,cssRules:`.${p}${H}{${J.join(";")}}`}}}let b=pe(a);if(!b||!he(b.mq)||!b.prop.startsWith("[")&&!Se(b.prop))return null;let{mq:m="default",layer:E="0",prop:k,val:g,selector:S=""}=b,h=[],$=Xe(k,g);if($&&h.push($),h.length===0)return null;let R=S.replace(/(';|;)/g,D=>D=="';"?";":" "),j=`selector(${p}${R})`;if(R){if(typeof CSS<"u"){if(!CSS.supports(j))return null}else if(!ve(R))return null}return{media:m||"default",layer:E||"0",className:p,property:h.join(";"),selector:R,cssRules:`.${p}${R}{${h.join(";")}}`}}let mt=o=>o.replace(/([^\w-])/g,"\\$1"),ke=o=>{var a=[...o?.classList||[]].filter(p=>{if(p){let b=p.charCodeAt(0)==45?p.charCodeAt(1):p.charCodeAt(0);return b>=97&&b<=122||b>=48&&b<=57}return!1});return o?.children?.length>0&&Array.from(o?.children).forEach(p=>{a.push(...ke(p))}),a.flat(1/0)},ht=(o,a)=>{if(typeof a!="function")throw new Error("Callback is not a function");if(!o)return;let p;"documentElement"in o?p=o.documentElement:(o instanceof Element||"tagName"in o||"host"in o)&&(p=o),p&&(p instanceof Element&&a(ke(p)),typeof MutationObserver<"u"&&new MutationObserver(b=>{for(let m of b)if(m.type=="attributes"&&m.attributeName=="class"){if(m.target.nodeType==1){let E=String(m.target?.className??""),k=String(m?.oldValue??"");if(E||k){let g=E.split(" ").map(h=>h.trim()).filter(h=>h),S=k.split(" ").map(h=>h.trim()).filter(h=>h);g=g.filter(h=>!S.includes(h)),typeof a=="function"&&a([...new Set(g)])}}}else if(m.type=="childList"&&m.addedNodes.length>0){let E=[...m.addedNodes].filter(k=>k.nodeType==1).map(k=>ke(k)).flat(1/0);typeof a=="function"&&a([...new Set(E)])}}).observe(p,{attributes:!0,attributeOldValue:!0,attributeFilter:["class"],childList:!0,subtree:!0}))};return{buildCss:pt,exportCache:()=>typeof window>"u"||!window.localStorage?te:et(window.localStorage.getItem(N))||te,ready:xe}},Ft=(e,t)=>{_e(t).buildCss(e).observe()},qt=(e,t)=>_e(t).buildCss(e).clsx,Ae={css:_e,cssObserve:Ft,clsx:qt};var Zt=(e,t)=>(e=e||"fwkui",t=t||"v1",`${e}_cache_${t}`),Jt=(e="fwkui",t="v1",r)=>{let s=String(e||"").trim()||"fwkui",n=Zt(s,t),l=JSON.stringify(s),f=JSON.stringify(n),u=`
12
17
  (async function () {
13
18
  function decompressLZW(compressed) {
14
19
  if (!compressed) return '';
@@ -93,8 +98,8 @@ ${l}
93
98
  try {
94
99
  if (typeof window === 'undefined' || !window.localStorage) return;
95
100
 
96
- var styleId = ${d};
97
- var key = ${m};
101
+ var styleId = ${l};
102
+ var key = ${f};
98
103
  var raw = localStorage.getItem(key);
99
104
  if (!raw) return;
100
105
  var payload=await parseCache(raw);
@@ -118,5 +123,5 @@ ${l}
118
123
  styleEl.textContent = css;
119
124
  } catch (_error) {}
120
125
  })();
121
- `.trim();return n?.compact?u.replace(/\s+/g," ").trim():u};var De="__FWXCSS_SHARED__",Et={base:"html,body{font-size:16px;padding:0;margin:0;}"},Rt=e=>{if(!e)return!1;let t=typeof Document<"u",n=typeof ShadowRoot<"u",s=t&&e instanceof Document,o=n&&e instanceof ShadowRoot;return s||o},Tt=e=>{let t=[],n=s=>{if(s){if(typeof s=="string"||typeof s=="number"){t.push(String(s));return}if(Array.isArray(s)){s.forEach(n);return}typeof s=="object"&&Object.keys(s).forEach(o=>{s[o]&&t.push(o)})}};return e.forEach(n),t},Ae=e=>{let t=new WeakMap,n=null,s=e??Et,o=typeof document<"u"?document:null,d=b=>{let X=Te.css(s);return{...X.buildCss(b??void 0),ready:X.ready}},m=()=>(n||(n=d(null)),n),u=b=>{if(!b)return m();let X=t.get(b);return X||(X=d(b),t.set(b,X)),X};return{clsx:(...b)=>{let X,J=b[b.length-1];Rt(J)&&(X=J,b=b.slice(0,-1));let ae=Tt(b);return u(X||o).clsx(ae.join(" "))},observe:b=>{u(b||o).observe()},setClsxRoot:b=>{o=b||(typeof document<"u"?document:null)},getCss:b=>b?u(b).getCssString():o?u(o).getCssString():m().getCssString(),ready:b=>b?u(b).ready:o?u(o).ready:m().ready}},Kt=e=>Ae(e),Wt=e=>Ae(e),Ie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:global,Z=Ie[De]||Ae();Ie[De]||(Ie[De]=Z);var Ut=Z.clsx,Vt=Z.observe,Nt=Z.setClsxRoot,zt=Z.getCss,qt=Z.ready;var Ft=Te;export{Ut as clsx,Wt as createSharedClsx,Kt as createSharedInstance,Ft as default,vt as getBootloaderScript,zt as getCss,Vt as observe,qt as ready,Nt as setClsxRoot};
126
+ `.trim();return r?.compact?u.replace(/\s+/g," ").trim():u};var Oe="__FWXCSS_SHARED__",Gt={base:"html,body{font-size:16px;padding:0;margin:0;}"},Yt=e=>{if(!e)return!1;let t=typeof Document<"u",r=typeof ShadowRoot<"u",s=t&&e instanceof Document,n=r&&e instanceof ShadowRoot;return s||n},Qt=e=>{let t=[],r=s=>{if(s){if(typeof s=="string"||typeof s=="number"){t.push(String(s));return}if(Array.isArray(s)){s.forEach(r);return}typeof s=="object"&&Object.keys(s).forEach(n=>{s[n]&&t.push(n)})}};return e.forEach(r),t},Pe=e=>{let t=new WeakMap,r=null,s=e??Gt,n=typeof document<"u"?document:null,l=C=>{let P=Ae.css(s);return{...P.buildCss(C??void 0),ready:P.ready}},f=()=>(r||(r=l(null)),r),u=C=>{if(!C)return f();let P=t.get(C);return P||(P=l(C),t.set(C,P)),P};return{clsx:(...C)=>{let P,ee=C[C.length-1];Yt(ee)&&(P=ee,C=C.slice(0,-1));let me=Qt(C);return u(P||n).clsx(me.join(" "))},observe:C=>{u(C||n).observe()},setClsxRoot:C=>{n=C||(typeof document<"u"?document:null)},getCss:C=>C?u(C).getCssString():n?u(n).getCssString():f().getCssString(),ready:C=>C?u(C).ready:n?u(n).ready:f().ready}},br=e=>Pe(e),gr=e=>Pe(e),Le=typeof globalThis<"u"?globalThis:typeof window<"u"?window:global,Q=Le[Oe]||Pe();Le[Oe]||(Le[Oe]=Q);var mr=Q.clsx,hr=Q.observe,yr=Q.setClsxRoot,Sr=Q.getCss,wr=Q.ready;var Cr=Ae;export{mr as clsx,gr as createSharedClsx,br as createSharedInstance,Cr as default,Jt as getBootloaderScript,Sr as getCss,hr as observe,wr as ready,yr as setClsxRoot};
122
127
  //# sourceMappingURL=index.mjs.map