@fwkui/x-css 1.0.19 → 1.0.21
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/README.md +15 -3
- package/dist/index-auto.js +19 -14
- package/dist/index-auto.js.map +1 -1
- package/dist/index-auto.mjs +19 -14
- package/dist/index-auto.mjs.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +19 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/dictionary.d.mts +0 -5
- package/dist/dictionary.d.ts +0 -5
- package/dist/dictionary.js +0 -2
- package/dist/dictionary.js.map +0 -1
- package/dist/dictionary.mjs +0 -2
- package/dist/dictionary.mjs.map +0 -1
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`)
|
|
1
|
+
var Ze=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 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){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 Et(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 Rt(e){return e>=97&&e<=122}function ge(e){if(!e||e.length<2||!Et(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=kt(e,t,r);if(u>0&&u<r){let A=e.substring(t,u);t=u+1,l=A}let y=t;for(;y<r;){let A=e.charCodeAt(y);if(A>=48&&A<=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 A=e.indexOf("]",t);if(A>t)return{mq:l,layer:f,prop:e.substring(t,A+1),val:"",selector:s}}let k=t;for(;k<r;){let A=e.charCodeAt(k);if(A===45||A===46){if(k+1<r){let x=e.charCodeAt(k+1);if(A===45&&x===45&&k>t||x>=48&&x<=57)break}k++;continue}if(!Rt(A))break;k++}if(k===t)return null;let X=e.substring(t,k),N=e.substring(k,r);return{mq:l,layer:f,prop:X,val:N,selector:s}}var Je={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"},Ge={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 It={SHORT_PROPERTIES:Je,COMMON_VALUES:Ge,SPECIFIC_VALUES:M},nt=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}},Tt=e=>`${e.styleId}_cache_${e.version}`,At=e=>`${e.styleId}_ks_${e.version}`,_t=e=>`${e.styleId}_bc_${e.version}`,st=e=>{if(!e||typeof e!="object")return!1;let t=e;return t.__xcss_cache_v===2&&t.compressed===!0&&typeof t.payload=="string"},_e=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"},ot=()=>typeof CompressionStream<"u"&&typeof Blob<"u"&&typeof Response<"u",it=()=>typeof DecompressionStream<"u"&&typeof Blob<"u"&&typeof Response<"u",Ot=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")},Lt=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")},Pt=async e=>{if(!ot())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 Ot(new Uint8Array(r))},jt=async e=>{if(!it())throw new Error("XCSS: DecompressionStream is not supported");let t=Lt(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()},zt=e=>{try{let t=JSON.parse(e);return _e(t)}catch{return!1}},Dt=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("")},at=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],k=t.get(y);k||(k=y===r?f+f[0]:""),s+=k,t.set(r++,f+k[0]),f=k}return s},Ye=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}},Qe=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}},Mt=(e,t)=>{let r=t;for(;r<e.length&&/\s/.test(e[r]);)r++;return r},Xt=(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],k=e[u+1];if(l){y===`
|
|
2
|
+
`&&(l=!1);continue}if(f){y==="*"&&k==="/"&&(f=!1,u++);continue}if(s){if(n){n=!1;continue}if(y==="\\"){n=!0;continue}y===s&&(s=null);continue}if(y==="/"&&k==="/"){l=!0,u++;continue}if(y==="/"&&k==="*"){f=!0,u++;continue}if(y==='"'||y==="'"||y==="`"){s=y;continue}if(y==="{"){r++;continue}if(y==="}"&&(r--,r===0))return u}return-1},me=(e,t)=>{let r=e.indexOf(t);if(r===-1)return null;let s=Mt(e,r+t.length);if(e[s]!=="{")return null;let n=Xt(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},et=(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},$t=(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}},he=e=>{let t=(n,l)=>{let f=Y(n,l);return n[f]==="{"?r(n,f):et(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=et(n,f)||$t(n,f);if(!y||(f=Y(n,y.end),n[f]!==":"))return null;f++;let k=t(n,f);if(!k)return null;if(u[y.value]=k.value,f=Y(n,k.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},Bt=e=>{let t=me(e,"export const SHORT_PROPERTIES ="),r=me(e,"export const COMMON_VALUES ="),s=me(e,"export const SPECIFIC_VALUES =");if(t&&r&&s)return Ye({SHORT_PROPERTIES:he(t),COMMON_VALUES:he(r),SPECIFIC_VALUES:he(s)});let n=me(e,"export default");return n?Ye(he(n)):null},Kt=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},Ut=async e=>{let t=await Kt(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")},Nt=async e=>{let t=await Ut(e),r=Bt(t);if(!r)throw new Error(Ht);return r},Ht="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)}}},Wt=e=>{let t=Array.isArray(e.excludes)?e.excludes:[],r=nt(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()},le=e=>{if(!e||typeof e!="object")return null;let t=e;return typeof t.configHash!="string"||!t.cssText||typeof t.cssText!="object"||Array.isArray(t.cssText)||!t.rulesSet||typeof t.rulesSet!="object"||Array.isArray(t.rulesSet)||!Array.isArray(t.keys)||typeof t.sizeLast!="number"||!Number.isFinite(t.sizeLast)||t.sizeLast<0?null:{configHash:t.configHash,cssText:t.cssText,rulesSet:t.rulesSet,keys:t.keys,sizeLast:t.sizeLast}},tt=e=>{if(!e)return null;try{let t=JSON.parse(e);if(st(t)){let r=at(t.payload);return r?le(JSON.parse(r)):null}return _e(t)?null:le(t)}catch{return null}},Ft=async e=>{if(!e)return null;try{let t=JSON.parse(e);if(st(t)){let r=at(t.payload);return r?le(JSON.parse(r)):null}if(_e(t)){let r=await jt(t.payload);return r?le(JSON.parse(r)):null}return le(t)}catch{return null}},rt=(e,t)=>{if(e==="root")return t;let r=/@media[^{]+\{\n?([\s\S]+)\n?\}/.exec(t);return r&&r[1]?r[1].trim():t},Oe=(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:k={}}=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=nt(k),N=Tt(X),A=At(X),x=_t(X),P=l,ee=f.filter(o=>typeof o=="string").map(o=>o.trim()).filter(o=>o.length>0),ye=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=ye(o);return p=>a.test(p)}return a=>a===o}),lt=o=>ee.some(a=>o.startsWith(a))?!0:De.some(a=>a(o)),Me=o=>!(lt(o)||u&&!o.startsWith(u)),ct=["default","xs","sm","md","lg","xl","2xl","sma","mda","lga","xla"],dt=r.filter(o=>!!o&&typeof o=="object"&&!Array.isArray(o)).map(o=>Object.keys(o)[0]).filter(o=>typeof o=="string"&&o.length>0),ft=new Set([...ct,...dt]),Se=o=>!o||ft.has(o),ut=y!==!1,pt=new Set(["mx","my","px","py","bdx","bdy"]),we=new Set,xe=o=>o?!ut||!F||Object.keys(F).length===0?!0:!!F[o]||pt.has(o)||we.has(o):!1,F={},ce={},Ce={},ke={},Xe=()=>{ke={...Ce,...n}},de=o=>{if(!o){F={},ce={},Ce={},we=new Set,Xe();return}F=o.SHORT_PROPERTIES,ce=o.SPECIFIC_VALUES,Ce=o.COMMON_VALUES,we=new Set(Object.values(F)),Xe()},fe=!0,ve=Promise.resolve();y===!1?de(null):typeof y=="string"?(fe=!1,de(null),ve=Nt(y).then(o=>{de(o)}).catch(o=>{console.warn("XCSS: Failed to import dictionary from URL",o)}).finally(()=>{fe=!0})):de(It);let te=null,bt=(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 v=new Map,g=new Set,S=X.sizeLast,h=!0,$=`xcss_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`,R=[],z=!1,j=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 C=v.get(d);C!==c&&(C||g.has(c)||(v.set(d,c),g.add(c)))})))},L=()=>{if(z=!1,!a||R.length===0)return;let i={source:$,sizeLast:S,entries:R.splice(0,R.length)};if(j)try{j.postMessage(i);return}catch{j=null}if(b)try{b.setItem(A,JSON.stringify(i))}catch{}},q=i=>{a&&(R.push(i),!z&&(z=!0,queueMicrotask(L)))};if(a&&m&&Vt(m,X.styleId),a&&typeof BroadcastChannel<"u")try{j=new BroadcastChannel(x),j.addEventListener("message",i=>{ne(Qe(i.data))})}catch{j=null}let H=Ze(),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),V=J.map(i=>Object.keys(i)[0]),B={},_={},O={root:""},T={root:[]},ue={root:!1},se=Wt(e),oe=null,G=0,ie=!1,pe=null,ae=null,Ie=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(A))},St=i=>{if(!a||!b)return;te=i;let d=++G;try{let c=JSON.stringify(i),C=()=>{let w={__xcss_cache_v:2,compressed:!0,payload:Dt(c)};Ie(JSON.stringify(w))};if(!X.compression){Ie(c);return}if(ot()&&it()){Pt(c).then(w=>{if(d!==G)return;Ie(JSON.stringify({__xcss_cache_v:3,compressed:!0,algorithm:"deflate-raw",encoding:"base64",payload:w}))}).catch(()=>{d===G&&C()});return}C()}catch(c){console.warn("XCSS: Failed to save cache",c)}},Ue=()=>{a&&(oe&&clearTimeout(oe),oe=setTimeout(()=>{let i={};for(let C in B)i[C]=Array.from(B[C]);let d={};Object.keys(O).forEach(C=>{if(C==="root")d[C]=O[C];else{let w=Z.find(D=>Object.keys(D)[0]===C)?.[C];w&&O[C]?d[C]=`@media ${w} {
|
|
5
|
+
${O[C]}
|
|
6
|
+
}`:d[C]=O[C]||""}});let c={configHash:se,cssText:d,rulesSet:i,keys:Array.from(v.entries()),sizeLast:S};St(c)},X.debounceMs))};if(a&&b)try{let i=b.getItem(N);if(i){let d=tt(i);if(!d)zt(i)?ae={raw:i}:be(i);else if(d.configHash!==se)be(i);else{if(pe=d,ie=!0,d.keys&&d.keys.forEach(([c,C])=>{v.set(c,C),g.add(C)}),re(d.sizeLast),d.cssText)for(let c in d.cssText)O[c]=rt(c,d.cssText[c]);te=d}}}catch(i){console.error(i)}a&&(_.root=new CSSStyleSheet),V.forEach(i=>{if(B[i]=new Set,a){let d=J.find(c=>Object.keys(c)[0]==i)?.[i]||"";_[i]=new CSSStyleSheet({media:d})}ie||(O[i]=""),T[i]=[],ue[i]=!1});let wt=()=>{if(!m)return;let i=m.querySelector(`style[id="${X.styleId}"]`);i&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{i.remove()})})},Ne=i=>{if(i.keys&&i.keys.forEach(([d,c])=>{v.set(d,c),g.add(c)}),re(i.sizeLast),i.cssText)for(let d in i.cssText){if(d==="root"&&E)continue;let c=rt(d,i.cssText[d]);O[d]=c,a&&_[d]&&_[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,wt()};if(ie&&pe&&Ne(pe),t&&Array.isArray(t)?(O.root=t.join(`
|
|
7
|
+
`),a&&_.root&&_.root.replaceSync(O.root)):(O.root=t||"",a&&_.root&&_.root.replaceSync(O.root)),a&&m?.adoptedStyleSheets){let i=m.adoptedStyleSheets,d=["root",...V].map(c=>_[c]).filter(c=>c&&!i.includes(c));d.length>0&&(m.adoptedStyleSheets=[...i,...d])}a&&b&&ae&&!ie&&(async()=>{let i=await Ft(ae.raw);if(!i){be(ae.raw);return}if(i.configHash!==se){be(ae.raw);return}ie=!0,pe=i,Ne(i)})(),a&&p?.addEventListener&&p.addEventListener("storage",i=>{if(i.key===A&&i.newValue)try{ne(Qe(JSON.parse(i.newValue)))}catch{}});let xt=(i,d)=>{let{media:c,property:C,selector:w,layer:D,className:I}=d,K=O,U=T,Te=ue;D=Number(D)||0;let We=v.get(i),Ct=We?`.${We}${w}`:`.${I}${w}`;var Ae=`@layer l${D}{${Ct}{${C}}}`;B[c]||(B[c]=new Set);let Fe=B[c];if(!Fe.has(Ae))if(Fe.add(Ae),U[c]||(U[c]=[]),U[c].push(Ae),a)if(h){let W=U[c];W.length>0&&(K[c]+=(K[c]?`
|
|
8
|
+
`:"")+W.join(`
|
|
9
|
+
`),_[c]&&_[c].replaceSync(K[c]),U[c]=[])}else Te[c]||(Te[c]=!0,queueMicrotask(()=>{let W=U[c],qe=_[c];W.length>0&&(K[c]+=(K[c]?`
|
|
10
|
+
`:"")+W.join(`
|
|
11
|
+
`),qe&&qe.replaceSync(K[c]),U[c]=[],Ue()),Te[c]=!1}));else{let W=U[c];W.length>0&&(K[c]+=(K[c]?`
|
|
12
|
+
`:"")+W.join(`
|
|
13
|
+
`),U[c]=[])}},He=i=>{i.forEach(d=>{let c=Ke(d);c&&xt(d,c)})},Ve=i=>{if(i.length===0)return;let d=()=>He(i);fe?d():ve.then(d)};return H.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(!Me(w))return!1;if(fe)return!!Ke(w);let D=u?w.slice(u.length):w,I=ge(D);if(!I||!Se(I.mq))return!1;let K=(I.selector||"").replace(/(';|;)/g,U=>U=="';"?";":" ");return K&&!Ee(K)?!1:I.prop.startsWith("[")?!!$e(I.prop+I.val):xe(I.prop)?(I.prop==="&",I.val.length>0):!1},C=d.map(w=>{let D=w;if(v.has(w))D=v.get(w);else if(c(w)){let I;do I="D"+(S++).toString(32).toUpperCase();while(g.has(I));v.set(w,I),g.add(I),q([w,I]),D=I,Ue()}return D});return!a||h?H.emit("observeDom",d):queueMicrotask(()=>H.emit("observeDom",d)),C.join(" ")},observe:()=>{!a||!m||(yt(m,i=>{h?He(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(C=>Object.keys(C)[0]===i)?.[i];return c?`@media ${c} {
|
|
14
|
+
${d}
|
|
15
|
+
}`:d}).join(`
|
|
16
|
+
`)}};function $e(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,v=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(),z=h.slice($+1).trim();return!R||!z||!/^(?:--[a-zA-Z0-9-_]+|-?[a-zA-Z][a-zA-Z0-9-]*)$/.test(R)?null:`${R}:${z}`};for(let g of b){if(typeof g!="string"){E=!1;break}let S=v(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 Be(o,a){let p=$e(o+a);if(p)return p;if(!o||a===void 0)return null;let b=F[o],m=b||o,E=a[0],v=!1,g=a;if(E==="!"&&(v=!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),z=ce[o]?.[R]||ke[R];if(!z){let j=g.toLowerCase();z=ce[o]?.[j]||ke[j]}g=z||g}if(g=g.replace(/(';|;)/g,R=>R=="';"?";":" "),!g)return null;let S=g+(v?" !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 gt=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:""}},mt=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},Ee=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 Ke(o){if(!Me(o))return null;let a=u?o.slice(u.length):o,p=typeof CSS<"u"?CSS.escape(o):ht(o);if(a.includes("&")&&!a.startsWith("&")){let{body:j,selector:re}=gt(a),ne=mt(j).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="",H=re,Z=!1,J=[];for(let _ of ne){let O=H?`${_}@${H}`:_,T=ge(O);if(!T||!Se(T.mq)||!T.prop.startsWith("[")&&!xe(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 ue=T.mq||"",se=T.layer||"",oe=T.selector||"";if(ue!==L||se!==q||oe!==H)return null;let G=Be(T.prop,T.val);if(!G)return null;J.push(G)}if(J.length===0)return null;let V=H.replace(/(';|;)/g,_=>_=="';"?";":" "),B=`selector(${p}${V})`;if(V){if(typeof CSS<"u"){if(!CSS.supports(B))return null}else if(!Ee(V))return null}return{media:L||"default",layer:q||"0",className:p,property:J.join(";"),selector:V,cssRules:`.${p}${V}{${J.join(";")}}`}}}let b=ge(a);if(!b||!Se(b.mq)||!b.prop.startsWith("[")&&!xe(b.prop))return null;let{mq:m="default",layer:E="0",prop:v,val:g,selector:S=""}=b,h=[],$=Be(v,g);if($&&h.push($),h.length===0)return null;let R=S.replace(/(';|;)/g,j=>j=="';"?";":" "),z=`selector(${p}${R})`;if(R){if(typeof CSS<"u"){if(!CSS.supports(z))return null}else if(!Ee(R))return null}return{media:m||"default",layer:E||"0",className:p,property:h.join(";"),selector:R,cssRules:`.${p}${R}{${h.join(";")}}`}}let ht=o=>o.replace(/([^\w-])/g,"\\$1"),Re=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(...Re(p))}),a.flat(1/0)},yt=(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(Re(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??""),v=String(m?.oldValue??"");if(E||v){let g=E.split(" ").map(h=>h.trim()).filter(h=>h),S=v.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(v=>v.nodeType==1).map(v=>Re(v)).flat(1/0);typeof a=="function"&&a([...new Set(E)])}}).observe(p,{attributes:!0,attributeOldValue:!0,attributeFilter:["class"],childList:!0,subtree:!0}))};return{buildCss:bt,exportCache:()=>typeof window>"u"||!window.localStorage?te:tt(window.localStorage.getItem(N))||te,ready:ve}},qt=(e,t)=>{Oe(t).buildCss(e).observe()},Zt=(e,t)=>Oe(t).buildCss(e).clsx,Le={css:Oe,cssObserve:qt,clsx:Zt};var Jt=(e,t)=>(e=e||"fwkui",t=t||"v1",`${e}_cache_${t}`),Gt=(e="fwkui",t="v1",r)=>{let s=String(e||"").trim()||"fwkui",n=Jt(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 = ${
|
|
97
|
-
var key = ${
|
|
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
|
|
126
|
+
`.trim();return r?.compact?u.replace(/\s+/g," ").trim():u};var Pe="__FWXCSS_SHARED__",Yt={base:"html,body{font-size:16px;padding:0;margin:0;}"},Qt=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},er=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},ze=e=>{let t=new WeakMap,r=null,s=e??Yt,n=typeof document<"u"?document:null,l=x=>{let P=Le.css(s);return{...P.buildCss(x??void 0),ready:P.ready}},f=()=>(r||(r=l(null)),r),u=x=>{if(!x)return f();let P=t.get(x);return P||(P=l(x),t.set(x,P)),P};return{clsx:(...x)=>{let P,ee=x[x.length-1];Qt(ee)&&(P=ee,x=x.slice(0,-1));let ye=er(x);return u(P||n).clsx(ye.join(" "))},observe:x=>{u(x||n).observe()},setClsxRoot:x=>{n=x||(typeof document<"u"?document:null)},getCss:x=>x?u(x).getCssString():n?u(n).getCssString():f().getCssString(),ready:x=>x?u(x).ready:n?u(n).ready:f().ready}},gr=e=>ze(e),mr=e=>ze(e),je=typeof globalThis<"u"?globalThis:typeof window<"u"?window:global,Q=je[Pe]||ze();je[Pe]||(je[Pe]=Q);var hr=Q.clsx,yr=Q.observe,Sr=Q.setClsxRoot,wr=Q.getCss,xr=Q.ready;var Cr=Le;export{hr as clsx,mr as createSharedClsx,gr as createSharedInstance,Cr as default,Gt as getBootloaderScript,wr as getCss,yr as observe,xr as ready,Sr as setClsxRoot};
|
|
122
127
|
//# sourceMappingURL=index.mjs.map
|