shweet 0.0.38 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +28 -1
- package/dist/index.js +10 -11
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -785,6 +785,13 @@ declare class Shweet<T extends exmed = exmed> {
|
|
|
785
785
|
font: FontFace["css"];
|
|
786
786
|
shweet: this;
|
|
787
787
|
save: (x?: SaveOptions) => this;
|
|
788
|
+
/**
|
|
789
|
+
* Return a clone of this instance with the given custom-property (var) values
|
|
790
|
+
* overridden. Custom-property names stay stable; only values change. A flat
|
|
791
|
+
* value applies to both light and dark modes, while `{ light, dark }` sets the
|
|
792
|
+
* explicit pair.
|
|
793
|
+
*/
|
|
794
|
+
override(overrides?: OverrideMap): this;
|
|
788
795
|
constructor({ __filename, name, prefix, shweets, exportMap, webkitKeyframes, mediaFeature, unit, onDiagnostic, }: ShweetOptions<T>);
|
|
789
796
|
get imported(): string[];
|
|
790
797
|
med(g: mtype & T): media;
|
|
@@ -834,7 +841,27 @@ interface SaveOptions {
|
|
|
834
841
|
include?: string[];
|
|
835
842
|
includeAnimation?: string[];
|
|
836
843
|
name?: string;
|
|
844
|
+
/**
|
|
845
|
+
* Folds the same-selector `:root` blocks emitted in one save into one block
|
|
846
|
+
* per media bucket, preserving declaration order. Defaults to `false`, which
|
|
847
|
+
* keeps the current output byte-identical.
|
|
848
|
+
*/
|
|
849
|
+
mergeRoot?: boolean;
|
|
837
850
|
}
|
|
851
|
+
/** One explicit color-scheme value pair accepted by `Shweet.override`. */
|
|
852
|
+
interface OverrideModePair {
|
|
853
|
+
/** Value used inside the light color scheme. */
|
|
854
|
+
light?: CSSValue;
|
|
855
|
+
/** Value used inside the dark color scheme. */
|
|
856
|
+
dark?: CSSValue;
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Replacement value for one `Shweet.override` target. A flat value applies to
|
|
860
|
+
* both color schemes; an explicit pair sets each scheme independently.
|
|
861
|
+
*/
|
|
862
|
+
type OverrideValue = CSSValue | OverrideModePair;
|
|
863
|
+
/** Token value replacements keyed by camel-cased custom-property name. */
|
|
864
|
+
type OverrideMap = Record<string, OverrideValue>;
|
|
838
865
|
interface ShweetOptions<T extends exmed> {
|
|
839
866
|
__filename: string;
|
|
840
867
|
name?: string;
|
|
@@ -866,4 +893,4 @@ declare const XX: (a: Record<string, CSSF>) => XZ;
|
|
|
866
893
|
declare const XY: (a: Record<string, CSSF>) => XZ;
|
|
867
894
|
|
|
868
895
|
export { Medyas, Shweet, Value, Var, Vars, X, XX, XY, Z, __, f, fileName, med, media, ps, supports, v };
|
|
869
|
-
export type { CSS, CSSF, CSSValue, CSSinR, CompileDiagnostic, DiagnosticHandler, DiagnosticSeverity, KFCSS, MedyasOptions, VarType, atCSS, fontFace };
|
|
896
|
+
export type { CSS, CSSF, CSSValue, CSSinR, CompileDiagnostic, DiagnosticHandler, DiagnosticSeverity, KFCSS, MedyasOptions, OverrideMap, OverrideModePair, OverrideValue, VarType, atCSS, fontFace };
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var Ht=Object.create;var oe=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var Ee=(e,t)=>(Object.defineProperty(e,"name",{value:t,enumerable:!1,configurable:!0}),e),Ut=(e)=>e;function zt(e,t){this[e]=Ut.bind(null,t)}var Wt=(e,t)=>{for(var r in t)oe(e,r,{get:t[r],enumerable:!0,configurable:!0,set:zt.bind(t,r)})};var _e=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Y=(e)=>{throw TypeError(e)},qt=(e,t,r)=>(t in e)?oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ue=(e,t,r)=>t.has(e)||Y("Cannot "+r),Yt=(e,t)=>Object(t)!==t?Y('Cannot use the "in" operator on this value'):e.has(t),De=(e,t,r)=>(ue(e,t,"read from private field"),r?r.call(e):t.get(e));var Be=(e,t,r,n)=>(ue(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Gt=(e,t,r)=>(ue(e,t,"access private method"),r),Pe=(e)=>[,,,Ht(e?.[_e("metadata")]??null)],Ie=["class","method","getter","setter","accessor","field","value","get","set"],q=(e)=>e!==void 0&&typeof e!=="function"?Y("Function expected"):e,Xt=(e,t,r,n,i)=>({kind:Ie[e],name:t,metadata:n,addInitializer:(s)=>r._?Y("Already initialized"):i.push(q(s||null))}),le=(e,t)=>qt(t,_e("metadata"),e[3]),Fe=(e,t,r,n)=>{for(var i=0,s=e[t>>1],a=s&&s.length;i<a;i++)t&1?s[i].call(r):n=s[i].call(r,n);return n},Le=(e,t,r,n,i,s)=>{var a,o,f,h,S,l=t&7,p=!!(t&8),m=!!(t&16),d=l>3?e.length+1:l?p?1:2:0,g=Ie[l+5],y=l>3&&(e[d-1]=[]),C=e[d]||(e[d]=[]),M=l&&(!m&&!p&&(i=i.prototype),l<5&&(l>3||!m)&&Kt(l<4?i:{get[r](){return De(this,s)},set[r](V){Be(this,s,V)}},r));l?m&&l<4&&Ee(s,(l>2?"set ":l>1?"get ":"")+r):Ee(i,r);for(var v=n.length-1;v>=0;v--){if(h=Xt(l,r,f={},e[3],C),l){if(h.static=p,h.private=m,S=h.access={has:m?(V)=>Yt(i,V):(V)=>(r in V)},l^3)S.get=m?(V)=>(l^1?De:Gt)(V,i,l^4?s:M.get):(V)=>V[r];if(l>2)S.set=m?(V,A)=>Be(V,i,A,l^4?s:M.set):(V,A)=>V[r]=A}if(o=(0,n[v])(l?l<4?m?s:M[g]:l>4?void 0:{get:M.get,set:M.set}:i,h),f._=1,l^4||o===void 0)q(o)&&(l>4?y.unshift(o):l?m?s=o:M[g]=o:i=o);else if(typeof o!=="object"||o===null)Y("Object expected");else q(a=o.get)&&(M.get=a),q(a=o.set)&&(M.set=a),q(a=o.init)&&y.unshift(a)}return l||le(e,i),M&&oe(i,r,M),m?l^4?s:M:i};var pe={};Wt(pe,{isClassOrId:()=>de,isNumber:()=>ce,isNumeric:()=>fe});var ce=(e)=>typeof e==="number",fe=(e)=>{let t=String(e);return!Number.isNaN(parseFloat(t))&&Number.isFinite(Number(e))},de=(e)=>e.startsWith(".")||e.startsWith("#");var O=(e)=>typeof e==="string";var He=(e)=>typeof e==="function";var b=(e)=>Array.isArray(e);var E=(e)=>Zt(e)&&typeof e==="object";var B=(e)=>e===null,ge=(e)=>e===void 0,j=(e)=>!ge(e);var Zt=(e)=>e!==null;var L=(e)=>b(e)?e:[e];function me(e=3){let t=((Error().stack?.split(`
|
|
3
|
-
`)??[])[e]||"").match(/at\s+([^(]+)\s*\(/);return(t?t[1].split(".").pop()?.trim():"?")??"?"}class Ke{name;constructor(e){this.name=e}log=(...e)=>{let t=me(3);console.log(`[${this.name}.${t}]`,...e)};set i(e){let t=me(3);console.log(`[${this.name}.${t}]`,...L(e))}}class he{static logger=(e)=>new Ke(O(e)?e:e.constructor.name);static set f(e){let t=me();console.log(`[${t}]`,...L(e))}static set i(e){console.info(...L(e))}static set e(e){console.error(...L(e))}static set w(e){console.warn(...L(e))}static set d(e){let t=new Date().toLocaleTimeString();console.log(...L(e),`@ ${t}`)}static get d(){let e=new Date().toLocaleTimeString();console.log(`@ ${e}`);return}}var Ue=(e)=>JSON.stringify(e),ze=(e)=>{if(!e||typeof e!=="string")return null;try{return JSON.parse(e)}catch{return null}};class w extends Map{constructor(e){if(e&&!Array.isArray(e)&&typeof e==="object"){super();this.mergeObject(e)}else super(e)}mergeObject(e){if(e&&E(e))Object.entries(e).forEach(([t,r])=>{this.set(t,r)});return this}mergeMap(e){if(!(e instanceof Map))return this;return e.forEach((t,r)=>{let n=this.get(r);if(t instanceof w)if(n instanceof w)n.mergeMap(t);else this.set(r,t);else if(b(t)){let i=b(n)?n:[];this.set(r,[...i,...t])}else if(E(t))this.assign(r,t);else this.set(r,t)}),this}assign(e,t){let r=this.get(e),n=E(r)?r:{};return this.set(e,{...n,...t}),this}lacks(e){return!this.has(e)}init(e,t){if(this.has(e))return this.get(e);return this.set(e,t),t}mapValues(e){let t=new w;return this.forEach((r,n)=>{t.set(n,e(r,n,this))}),t}filter(e){let t=new w;return this.forEach((r,n)=>{if(e(r,n,this))t.set(n,r)}),t}toObject(){let e={};return this.forEach((t,r)=>{let n=String(r);if(t instanceof w)e[n]=t.toObject();else e[n]=t}),e}toJson(){return JSON.stringify(this.toObject())}static fromGroup(e,t){let r=new w;if(!Array.isArray(e))return r;return e.forEach((n)=>{let i=n[t];r.init(i,[]).push(n)}),r}}var Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",H=(e)=>{if(!e)return"";return e.replace(/-([a-z])/g,(t,r)=>r.toUpperCase())},K=(e)=>{if(!e)return"";let t=e;if(t.startsWith("webkit"))t="-"+t;return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()};var We=()=>{let e=Math.floor(Math.random()*Q.length);return Q[e]},qe=(e)=>{let t=Q+"0123456789",r="";for(let n=0;n<e;n++){let i=n===0?Q:t;r+=i.charAt(Math.floor(Math.random()*i.length))}return r};var ee=(e,t,r)=>{if(!e.has(t))e.set(t,{});Object.assign(e.get(t),r)},Se=(e,t)=>{let r={added:{},removed:{},modified:{}},n=e,i=t;for(let s of Object.keys(i)){let a=n[s],o=i[s];if(!Object.hasOwn(n,s))r.added[s]=o;else if(b(a)&&b(o)){if(JSON.stringify(a)!==JSON.stringify(o))r.modified[s]={old:a,new:o}}else if(E(a)&&E(o)&&!B(a)&&!B(o)){let f=Se(a,o);if(ye(f))r.modified[s]={old:a,new:o}}else if(a!==o)r.modified[s]={old:a,new:o}}for(let s of Object.keys(n))if(!Object.hasOwn(i,s))r.removed[s]=n[s];return r},ye=(e)=>Object.values(e).some((t)=>Object.keys(t).length>0);import{existsSync as Ye,mkdirSync as Jt,writeFileSync as Qt}from"fs";var be=(e)=>{if(Ye(e))return!0;return Jt(e,{recursive:!0}),!0},we=(e,t="")=>{if(Ye(e))return!0;return Qt(e,t,{flag:"wx"}),!0};function Ge(e,t){let r=t.name;t.addInitializer(function(){Object.defineProperty(this,r,{configurable:!0,enumerable:!1,get(){let n=e.bind(this);return Object.defineProperty(this,r,{configurable:!0,writable:!0,value:n}),n}})})}class Xe{static arr(e){return e?b(e)?e:[e]:[]}static num(e,t=0){let r=parseFloat(String(e));return Number.isNaN(r)?t:r}static str(e){return String(e)}static arr2obj(e,t=!1){return e.reduce((r,n,i)=>{if(t)r[String(n)]=i;else r[i]=n;return r},{})}}class Ze{val;constructor(e){this.val=e}get px(){return`${this.val}px`}get rem(){return`${this.val}rem`}get pr(){return`${this.val}%`}}class Ce{static rand(e=6,t){if(t)return Math.floor(Math.random()*(t-e+1)+e);return Math.floor(Math.random()*e)}static fill(e,t=null){return Array(e).fill(t)}static new({dom:e,id:t,inner:r}){let n=document.createElement(e);if(t)n.id=t;if(r)n.innerHTML=r;return n}static randFrom(e){if(b(e))return e[this.rand(0,e.length-1)];let t=Object.keys(e);return t[this.rand(0,t.length-1)]}static randArray(e=[],t=1,r=!1){let n=[],i=r?new Set:null;while((r?i.size:n.length)<t){let s=e[Ce.rand(0,e.length-1)];if(r)i.add(s);else n.push(s)}return r?[...i]:n}static randomAZ=We;static makeID=qe;static class(e,...t){let r=t.filter(Boolean);if(e?.class)r.push(...b(e.class)?e.class:[e.class]);if(r.length)e.class=r}static get O(){return{vals:Object.values,keys:Object.keys,items:Object.entries,has:(e,t)=>Object.hasOwn(e,t),ass:Object.assign,len:(e={})=>Object.keys(e).length}}static get is(){return pe}static get return(){return Xe}static isHREF(e,t){return e===t?!0:e.startsWith(t)&&t!=="/"?!0:!1}static sleep=(e=1000)=>new Promise((t)=>setTimeout(t,e));static get screen(){let{innerWidth:e}=window,t={xs:e<=480,sm:e>=480,smd:e>=624,md:e>=768,lg:e>=1024,xl:e>=1280,xxl:e>=1536},r=Object.entries(t).reverse();for(let[n,i]of r)if(i)return n;return}bytes(e){if(e===0)return"0 Bytes";let t=1024,r=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,n)).toFixed(2))} ${r[n]}`}static format(e){return new Ze(e)}static compareObjects=Se;static isObjectUdpated=ye}function u(e){return function(...t){return{[e]:t}}}class Je{static attr(e){let[t,r]=Object.entries(e)[0];return u(`[${t}="${r}"]`)}static after(e=""){return u("::after"+e)}static before(e=""){return u("::before"+e)}static backdrop(e=""){return u("::backdrop"+e)}static cue(e=""){return u("::cue"+e)}static cueRegion(e=""){return u("::cue-region"+e)}static firstLetter(e=""){return u("::first-letter"+e)}static firstLine(e=""){return u("::first-line"+e)}static marker(e=""){return u("::marker"+e)}static part(e=""){return u("::part"+e)}static placeholder(e=""){return u("::placeholder"+e)}static selection(e=""){return u("::selection"+e)}static slotted(e=""){return u("::slotted"+e)}static spellingError(e=""){return u("::spelling-error"+e)}static targetText(e=""){return u("::target-text"+e)}static viewTransition(e=""){return u("::view-transition"+e)}static viewTransitionGroup(e=""){return u("::view-transition-group"+e)}static viewTransitionImagePair(e=""){return u("::view-transition-image-pair"+e)}static viewTransitionNew(e=""){return u("::view-transition-new"+e)}static viewTransitionOld(e=""){return u("::view-transition-old"+e)}static scrollbar(e=""){return u("::-webkit-scrollbar"+e)}static scrollbarThumb(e=""){return u("::-webkit-scrollbar-thumb"+e)}static scrollbarTrack(e=""){return u("::-webkit-scrollbar-track"+e)}static scrollbarCorner(e=""){return u("::-webkit-scrollbar-corner"+e)}static active(e=""){return u(":active"+e)}static anyLink(e=""){return u(":any-link"+e)}static autofill(e=""){return u(":autofill"+e)}static blank(e=""){return u(":blank"+e)}static checked(e=""){return u(":checked"+e)}static current(e=""){return u(":current"+e)}static default(e=""){return u(":default"+e)}static defined(e=""){return u(":defined"+e)}static disabled(e=""){return u(":disabled"+e)}static empty(e=""){return u(":empty"+e)}static enabled(e=""){return u(":enabled"+e)}static first(e=""){return u(":first"+e)}static firstChild(e=""){return u(":first-child"+e)}static firstOfType(e=""){return u(":first-of-type"+e)}static fullscreen(e=""){return u(":fullscreen"+e)}static future(e=""){return u(":future"+e)}static focus(e=""){return u(":focus"+e)}static focusVisible(e=""){return u(":focus-visible"+e)}static focusWithin(e=""){return u(":focus-within"+e)}static host(e=""){return u(":host"+e)}static hover(e=""){return u(":hover"+e)}static indeterminate(e=""){return u(":indeterminate"+e)}static inRange(e=""){return u(":in-range"+e)}static invalid(e=""){return u(":invalid"+e)}static lastChild(e=""){return u(":last-child"+e)}static lastOfType(e=""){return u(":last-of-type"+e)}static left(e=""){return u(":left"+e)}static link(e=""){return u(":link"+e)}static localLink(e=""){return u(":local-link"+e)}static modal(e=""){return u(":modal"+e)}static onlyChild(e=""){return u(":only-child"+e)}static onlyOfType(e=""){return u(":only-of-type"+e)}static optional(e=""){return u(":optional"+e)}static outOfRange(e=""){return u(":out-of-range"+e)}static past(e=""){return u(":past"+e)}static pictureInPicture(e=""){return u(":picture-in-picture"+e)}static placeholderShown(e=""){return u(":placeholder-shown"+e)}static paused(e=""){return u(":paused"+e)}static playing(e=""){return u(":playing"+e)}static readOnly(e=""){return u(":read-only"+e)}static readWrite(e=""){return u(":read-write"+e)}static required(e=""){return u(":required"+e)}static right(e=""){return u(":right"+e)}static root(e=""){return u(":root"+e)}static scope(e=""){return u(":scope"+e)}static target(e=""){return u(":target"+e)}static targetWithin(e=""){return u(":target-within"+e)}static userInvalid(e=""){return u(":user-invalid"+e)}static valid(e=""){return u(":valid"+e)}static visited(e=""){return u(":visited"+e)}static dir(e){return u(`:dir(${e})`)}static has(e){return u(`:has(${e})`)}static host_(e){return u(`:host(${e})`)}static hostContext(e){return u(`:host-context(${e})`)}static is(e){return u(`:is(${e})`)}static lang(e){return u(`:lang(${e})`)}static not(e){return u(`:not(${e})`)}static nthChild(e){return u(`:nth-child(${e})`)}static nthCol(e){return u(`:nth-col(${e})`)}static nthLastChild(e){return u(`:nth-last-child(${e})`)}static nthLastCol(e){return u(`:nth-last-col(${e})`)}static nthLastOfType(e){return u(`:nth-last-of-type(${e})`)}static nthOfType(e){return u(`:nth-of-type(${e})`)}static state(e){return u(`:state(${e})`)}static where(e){return u(`:where(${e})`)}static webkit(e){return u(`::-webkit-${e}`)}static and(e){return u(", "+e)}static child(e){return u(" > "+e)}static desc(e){return u(" "+e)}static next(e){return u(" + "+e)}static general(e){return u(" ~ "+e)}static withClass(e){if(!e.startsWith("."))throw Error("should start with . or # - class / id");return u(e)}}var xe={xs:"480px",sm:"480px",smd:"624px",md:"768px",lg:"1024px",xl:"1280px",xxl:"1536px"};class x{static default="xs";static prop=Object.entries(xe).reduce((e,[t,r],n)=>(e[t]=`(${n==0?"max-width":"min-width"}: ${r})`,e),{});static extra={no_hover:"(pointer: coarse)",mobile:"(pointer: coarse)",print:"print",screen:"screen",dark:"(prefers-color-scheme: dark)",light:"(prefers-color-scheme: light)"};constructor(e,t={}){let r=x.default,n={};if(e!==void 0)U(n,r,e,r);Object.entries(t).forEach(([i,s])=>{U(n,i,s,r)}),Object.assign(this,n)}static get breakpoints(){return ze(Ue(xe))??xe}}var U=(e,t,r,n)=>{if(r!==void 0)if(r instanceof x)Object.entries(r).forEach(([i,s])=>{if(n!==t)if(t!==i)if(n===i)U(e,t,s,n);else U(e,`${t}-${i}`,s,n);else U(e,i,s,n);else U(e,i,s,n)});else e[t]=r};function T(e,t){if(t)return new x(e,t);if(typeof e==="object")return new x(void 0,e);return new x(e,{})}function er(e){if(this._prefix)return T({[this._prefix]:e});else return T({xs:e})}function R(e){return new this.constructor({prefix:e,values:this._values,data:this.data})}class te{_prefix;data;_values;constructor({prefix:e,data:t,values:r}={}){this._prefix=e,this._values=r??{},Object.entries(this._values).forEach(([n,i])=>{if(!this._values[n])this._values[n]=T({});Object.assign(this._values[n],i)}),this.data=t??{}}get XS(){return R.call(this,"xs")}get SM(){return R.call(this,"sm")}get SMD(){return R.call(this,"smd")}get MD(){return R.call(this,"md")}get LG(){return R.call(this,"lg")}get XL(){return R.call(this,"xl")}get XXL(){return R.call(this,"xxl")}get NO_HOVER(){return R.call(this,"no_hover")}get MOBILE(){return R.call(this,"mobile")}get PRINT(){return R.call(this,"print")}get SCREEN(){return R.call(this,"screen")}get DARK(){return R.call(this,"dark")}set _value(e){Object.entries(e).forEach(([t,r])=>{if(!this._values[t])this._values[t]=T({});Object.assign(this._values[t],er.call(this,r))})}get _value(){return this._values}}class N{k="";fallback;var="";value;constructor(e={},t){if(Object.keys(e).length){let[r,n]=Object.entries(e)[0];this.k=r,this.var="--"+K(r),this.value=n instanceof x?n:T(n,{}),this.fallback=t}else this.value=T({})}__(e){if(e)this.fallback=e;let t=this.fallback;if(t)return`var(${this.var}, ${c(t)})`;else return`var(${this.var})`}new(e,t){return new N({[this.k]:e instanceof x?e:c(e)},t)}}var tr=(e,t)=>new N(e,t),rr=(e)=>{let t={};for(let r in e)t[r]=new N({[r]:e[r]});return t};var c=(e,t={unit:"rem"})=>{let{rem:r,second:n,quote:i,degree:s,percent:a,delimeter:o,unit:f,delimeter_arr:h}=t;if(ge(e)||B(e)||!i&&e==="")return"";let S=b(e)?e:[e];if(!S.length)return"";return S.filter((l)=>j(l)).map((l)=>{if(b(l))return o=h||", ",c(l,{...t,delimeter:" "});if(l instanceof N)return l.__();if(i)l=String(l);if(ce(l))if(r)return`${l}${f?f:"rem"}`;else if(s)return`${l}deg`;else if(a)return`${l}%`;else if(n)return`${l}s`;else return String(l);if(O(l))if(l.includes("("))return l;else if(i)return`'${l}'`;else return l;return""}).filter((l)=>j(l)&&l!=="").join(o||" ")};class Qe{static minmax(e,t){return`minmax(${c([e,t],{rem:!0,delimeter:", "})})`}static fitContent(e){return`fit-content(${c([e],{rem:!0})})`}static repeat(e,...t){return`repeat(${c([e,c([t],{rem:!0})],{delimeter:", "})})`}}class et extends Qe{static attr(e,t,r){return`attr(${c([e,t,r])})`}static blur(e){return`blur(${c([e],{rem:!0})})`}static brightness(e){return`brightness(${c([e])})`}static calc(...e){return`calc(${c(e,{rem:!0})})`}static circle(e,t){return`circle(${c([e,t],{rem:!0})})`}static clamp(e,t,r){return`clamp(${c([e,t,r],{rem:!0,delimeter:", "})})`}static colorMix(e,t,r){return`color-mix(${c([e,c(b(t)?t:[t]),c(b(r)?r:[r])],{delimeter:", "})})`}static conicGradient(...e){return`conic-gradient(${c(e,{delimeter:", "})})`}static contrast(e){return`contrast(${c([e])})`}static cubicBezier(e,t,r,n){return`cubic-bezier(${c([e,t,r,n],{delimeter:", "})})`}static dropShadow(...e){return`drop-shadow(${c(e,{rem:!0})})`}static grayscale(e){return`grayscale(${c([e])})`}static hsl(e,t,r){return`hsl(${c([e,t,r])})`}static hsla(e,t,r,n){return`hsl(${c([e,t,r,n?["/",n]:n])})`}static hueRotate(e){return`hue-rotate(${c([e],{degree:!0})})`}static inset(...e){return`inset(${c(e,{rem:!0})})`}static invert(e){return`invert(${c([e])})`}static linearGradient(...e){return`linear-gradient(${c(e,{delimeter:", "})})`}static matrix(e,t,r,n,i,s){return`matrix(${c([e,t,r,n,i,s],{delimeter:", "})})`}static matrix3d(e,t,r,n){return`matrix3d(${c([e,t,r,n],{delimeter:", "})})`}static max(...e){return`max(${c(e,{rem:!0,delimeter:", "})})`}static min(...e){return`min(${c(e,{rem:!0,delimeter:", "})})`}static opacity(e){return`opacity(${c([e])})`}static path(e){return`path(${c([e],{quote:!0})})`}static clipPath(e,t){return`path(${c([e,c([t],{quote:!0})],{delimeter:", "})})`}static perspective(e){return`perspective(${c([e])})`}static polygon(...e){return`polygon(${c(e,{percent:!0,delimeter:", "})})`}static ray(...e){return`ray(${c(e,{degree:!0})})`}static radialGradient(...e){return`radial-gradient(${c(e,{delimeter_arr:", ",percent:!0,delimeter:", "})})`}static repeatingConicGradient(...e){return`repeating-conic-gradient(${c(e,{degree:!0,delimeter:", "})})`}static repeatingLinearGradient(...e){return`repeating-linear-gradient(${c(e,{degree:!0,delimeter:", "})})`}static repeatingRadialGradient(...e){return`repeating-radial-gradient(${c(e,{degree:!0,delimeter:", "})})`}static rgb(e,t,r){return`rgb(${c([e,t,r])})`}static rgba(e,t,r,n){return`rgba(${c([e,t,r,n?["/",n]:void 0],{delimeter_arr:" "})})`}static rotate(e){return`rotate(${c([e],{degree:!0})})`}static rotate3d(e,t,r,n){return`rotate3d(${c([c([e,t,r],{delimeter:", "}),n],{degree:!0,delimeter:", "})})`}static rotateX(e){return`rotateX(${c([e],{degree:!0})})`}static rotateY(e){return`rotateY(${c([e],{degree:!0})})`}static rotateZ(e){return`rotateZ(${c([e],{degree:!0})})`}static saturate(...e){return`saturate(${c(e)})`}static scale(e,t){return`scale(${c([e,t],{delimeter:", "})})`}static scale3d(e,t,r){return`scale3d(${c([e,t,r],{delimeter:", "})})`}static scaleX(e){return`scaleX(${c([e])})`}static scaleY(e){return`scaleY(${c([e])})`}static scaleZ(e){return`scaleZ(${c([e])})`}static sepia(e){return`sepia(${c([e])})`}static skew(...e){return`skew(${c(e,{degree:!0,delimeter:", "})})`}static skewX(e){return`skewX(${c([e],{degree:!0})})`}static skewY(e){return`skewY(${c([e],{degree:!0})})`}static steps(e,t){return`steps(${c([e,t],{delimeter:", "})})`}static translate(...e){return`translate(${c(e,{rem:!0,delimeter:", "})})`}static translate3d(...e){return`translate3d(${c(e,{rem:!0,delimeter:", "})})`}static translateX(e){return`translateX(${c([e],{rem:!0})})`}static translateY(e){return`translateY(${c([e],{rem:!0})})`}static translateZ(...e){return`translateZ(${c(e,{rem:!0,delimeter:", "})})`}static url(e){return`url(${c([e],{quote:!0})})`}static format(e){return`format(${c([e],{quote:!0})})`}static var(e,t=""){e="--"+K(e);let r=t?", "+c([t],{rem:!0,delimeter:", "}):"";return`var(${c([e],{rem:!0})}${r})`}}var nr={important:" !important",visible:"visible",hidden:"hidden",auto:"auto",none:"none",clip:"clip",scroll:"scroll",initial:"initial",inherit:"inherit",flex:"flex",center:"center",flex_start:"flex-start",flex_end:"flex-end",space_evenly:"space-evenly",stretch:"stretch",wrap:"wrap",column:"column",column_reverse:"column-reverse",row:"row",row_reverse:"row-reverse",space_between:"space-between",space_around:"space-around",pr100:"100%",pr50:"50%",i100vh:"100vh",i100vw:"100vw",block:"block",sticky:"sticky",fixed:"fixed",absolute:"absolute",relative:"relative",pointer:"pointer",grabbing:"grabbing",checkbox:"checkbox",solid:"solid",inset:"inset",bold:"bold",currentColor:"currentColor",forwards:"forwards",text:"text",norepeat:"no-repeat",nowrap:"nowrap",difference:"difference",preserve3d:"preserve-3d"};class re{value;__;constructor(e){if(this.value=new w,O(e))this.value.set(e,[]);else Object.entries(e).forEach(([t,r])=>{this.value.set(`${t}:${r}`,[])});this.__=(...t)=>(this.value.forEach((r)=>{r.push(...t)}),this)}}function ir(e){return new re(e).__}var D=(e)=>{if(He(e))return D(e());if(e instanceof x)return e;if(e instanceof N)return T(e.__(),{});return T(e,{})},ie=(e)=>e==='"'||e==="'",Me="([{",ve=")]}",rt=(e,t)=>{let r=[],n=0,i=null,s=0;for(let a=0;a<e.length;a++){let o=e[a];if(i){if(o==="\\")a++;else if(o===i)i=null;continue}if(o==="\\")a++;else if(ie(o))i=o;else if(Me.includes(o))s++;else if(ve.includes(o)){if(s>0)s--}else if(o===t&&s===0)r.push(e.slice(n,a)),n=a+1}return r.push(e.slice(n)),r},sr=(e,t)=>{let r=null,n=0;for(let i=0;i<e.length;i++){let s=e[i];if(r){if(s==="\\")i++;else if(s===r)r=null;continue}if(s==="\\")i++;else if(ie(s))r=s;else if(Me.includes(s))n++;else if(ve.includes(s)){if(n>0)n--}else if(s===t&&n===0)return i}return-1},Ne=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,ar=(e)=>{if(!Ne.test(e))return;let t=Number(e);return Number.isFinite(t)?t:void 0};function nt(e){let t={};return rt(e,";").forEach((r)=>{let n=r.trim();if(n==="")return;let i=sr(n,":");if(i===-1)return;let s=n.slice(0,i).trim();if(s==="")return;let a=n.slice(i+1).trim(),o=s.startsWith("--"),f=o?s:H(s);if(o){t[f]=a;return}let h=ar(a);t[f]=h===void 0?a:h}),t}var it=new Set(["initial","inherit","unset","revert","revert-layer"]),or=new Set(["linear","ease","ease-in","ease-out","ease-in-out","step-start","step-end"]),ur=new Set(["cubic-bezier","steps","linear"]),lr=new Set(["normal","reverse","alternate","alternate-reverse"]),cr=new Set(["forwards","backwards","both"]),fr=new Set(["running","paused"]),st=/^-{0,2}[A-Za-z_][A-Za-z0-9_-]*$/,at=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:s|ms)$/i,Re=(e)=>e.length>=2&&ie(e[0])&&e[e.length-1]===e[0],ot=(e)=>{let t=[],r=-1,n=null,i=0;for(let s=0;s<e.length;s++){let a=e[s];if(n){if(a==="\\")s++;else if(a===n)n=null;continue}if(a==="\\"){if(r===-1)r=s;s++;continue}if(ie(a)){if(r===-1)r=s;n=a;continue}if(Me.includes(a)){if(r===-1)r=s;i++;continue}if(ve.includes(a)){if(r===-1)r=s;if(i>0)i--;continue}if(i===0&&/\s/.test(a)){if(r!==-1)t.push(e.slice(r,s)),r=-1;continue}if(r===-1)r=s}if(r!==-1)t.push(e.slice(r));return t},dr=(e)=>{if(Re(e))return"name";let t=e.match(/^([A-Za-z][A-Za-z0-9-]*)\(/);if(t){if(e.endsWith(")")&&ur.has(t[1].toLowerCase()))return"skip";return"abort"}if(at.test(e)||Ne.test(e))return"skip";if(e.toLowerCase()==="!important")return"skip";if(!st.test(e))return"abort";let r=e.toLowerCase();if(it.has(r)||or.has(r)||lr.has(r)||cr.has(r)||fr.has(r)||r==="infinite"||r==="none")return"skip";return"name"},Ve=(e,t)=>{if(Re(e)){let r=e.slice(1,-1);if(r==="")return;let n=e[0];return{text:`${n}${t}${r}${n}`,name:r}}return{text:`${t}${e}`,name:e}},pr=(e,t)=>{let r=ot(e),n=-1,i="";for(let o=0;o<r.length;o++){let f=r[o],h=f.toLowerCase(),S=dr(f);if(S==="abort")return{value:e,names:[]};if(h==="!important"&&o!==r.length-1)return{value:e,names:[]};if(S==="skip")continue;if(n!==-1)return{value:e,names:[]};n=o,i=f}if(n===-1)return{value:e,names:[]};let s=Ve(i,t);if(!s)return{value:e,names:[]};let a=[...r];return a[n]=s.text,{value:a.join(" "),names:[s.name]}},mr=(e,t)=>{let r=ot(e.trim()),n=r.length>1&&r[r.length-1].toLowerCase()==="!important"?r.pop():void 0;if(r.length!==1)return{value:e,names:[]};let i=r[0];if(Re(i)){let a=Ve(i,t);if(!a)return{value:e,names:[]};return{value:[a.text,n].filter(Boolean).join(" "),names:[a.name]}}if(i.includes("("))return{value:e,names:[]};if(at.test(i)||Ne.test(i))return{value:e,names:[]};if(!st.test(i))return{value:e,names:[]};let s=i.toLowerCase();if(it.has(s)||s==="none")return{value:e,names:[]};return{value:[Ve(i,t).text,n].filter(Boolean).join(" "),names:[i]}},tt=(e,t,r)=>{let n=rt(e,",");if(n.some((o)=>o.trim()===""))return{value:e,names:[]};let i=[],s=!1,a=n.map((o)=>{let f=r(o,t);if(i.push(...f.names),f.value!==o)s=!0;return f.value});return{value:s?a.map((o)=>o.trim()).join(", "):e,names:i}},ut=(e,t,r="animation")=>{if(r==="animationName")return tt(e,t,mr);return tt(e,t,pr)},lt=(e)=>{e.value.forEach((t,r)=>{e.value.set(r,t.map((n)=>{let i={};return Object.entries(n).forEach(([s,a])=>{if(j(a))i[s]=D(a)}),i}))})},ne=(e,t=[])=>{if(b(e))return ne(e[0]);if(e instanceof N)return ne(Object.values(e.value));return[String(e)]};function $e(e){let t=[],r=0,n=0,i=null;for(let s=0;s<e.length;s++){let a=e[s];if(a==="\\"){s++;continue}if(i){if(a===i)i=null;continue}if(a==="/"&&e[s+1]==="*"){let o=e.indexOf("*/",s+2);s=o===-1?e.length:o+1;continue}if(a==='"'||a==="'")i=a;else if(a==="("||a==="[")n++;else if(a===")"||a==="]"){if(n>0)n--}else if(a===","&&n===0)t.push(e.slice(r,s)),r=s+1}return t.push(e.slice(r)),t}function ct(e,t){let r=$e(e);if(r.length<=1)return e+t;return r.map((n)=>`${n.trim()}${t}`).join(", ")}function gr(e,t,r){let n=$e(e);if(n.length<=1)return r.map((i)=>`${e}${t}${i.trim()}`).join(", ");return n.flatMap((i)=>r.map((s)=>`${i.trim()}${t}${s.trim()}`)).join(", ")}class Ae{base;constructor(e){this.base=e}prefixAnimationValues(e,t,r){let n=H(t);if(!(n==="animation"||n==="animationName"))return r;let s=Object.assign(new x,r);return Object.entries(s).forEach(([a,o])=>{s[a]=this.addPrefixToAnimation(e,n,o)}),s}addPrefixToAnimation(e,t,r){if(r instanceof N)this.saveAnim(e,r);else if(b(r))return r.map((n)=>this.addPrefixToAnimation(e,t,n));else if(O(r)){let n=ut(r,this.base.PREFIX,t);return n.names.forEach((i)=>{let s=`${this.base.PREFIX}${i}`;this.base.ANIM.init(s,new Set).add(e)}),n.value}return r}saveAnim(e,t){ne(t).forEach((r)=>{this.base.ANIM.init(`${this.base.PREFIX}${r}`,new Set).add(e)})}processDeclaration(e,t,r,n,i){if(r instanceof N)this.saveAnim(e,r),ee(n,t,this.prefixAnimationValues(e,r.var,D(r)));else if(t.startsWith(","))this.set(e+t,r,i);else if(t.startsWith(":")||t.startsWith("["))this.set(ct(e,t),r,i);else if(t.startsWith(" ")){let s=t.match(/^\s*(?:[>+~]\s*)?/)?.[0]??"";this.set(gr(e,s,$e(t.slice(s.length))),r,i)}else if(de(t))this.set(ct(e,t),r,i);else n.set(t,this.prefixAnimationValues(e,t,D(r)))}set(e,t,r){if(!E(t)&&!B(t)&&!O(t))return;let n=new w;if(t instanceof N)this.saveAnim(e,t),ee(n,t.var,this.prefixAnimationValues(e,t.var,D(t.value)));else if(t instanceof te)Object.entries(t._value).forEach(([s,a])=>{if(j(a))n.set(s,this.prefixAnimationValues(e,s,D(a)))});else if(t instanceof re)lt(t),n.init("supports",[]).push(t);else if(b(t))t.forEach((s)=>{this.set(e,s,r)});else if(O(t)){let s=nt(t);this.set(e,s,r)}else Object.entries(t).forEach(([s,a])=>{if(a instanceof N){this.saveAnim(e,a),ee(n,a.var,this.prefixAnimationValues(e,a.var,D(a.value)));return}return this.processDeclaration(e,s,a,n,r)});let i=r.init(e,new w);n.forEach((s,a)=>{if(a==="supports"&&b(s))r.init(e,new w).init(a,[]).push(...s);else i.set(a,s)})}}class _{PRE;EXPORT;UNIT;SOURCE;PS;PREFIX;ARR=new w;CID=new w;DATA=new w;ANIM=new w;IMPORTED=[];constructor(e="",t="",r,n,i=""){this.PRE=e;this.EXPORT=r;this.UNIT=n;this.SOURCE=i;this.PREFIX=t?t+"_":t,this.PS=new Ae(this)}get(e,t,r){let n=e.PRE+t;if(e.DATA.has(n))return n;else if(t in e)return e[t];else return e.PRE+t}set(e,t,r){return!1}get css(){return new Proxy(this,this)}load(e){return this.IMPORTED.push(e),this}__(e){Object.entries(e).forEach(([t,r])=>{this.set(this,t,r)})}}var ft=new Set(["transitionDuration","transitionDelay","animationDelay","animationDuration"]),hr=new Set([...ft,"zIndex","opacity","aspectRatio","order","flexShrink","flexGrow","flex","fillOpacity","lineClamp","order","scale","webkitLineClamp","lineHeight","fontWeight","orphans","widows","tabSize","zoom","borderImageOutset","borderImageSlice","borderImageWidth","animationIterationCount","columnCount","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd"]),Sr=new Set(["content"]),yr=new Set(["transitionProperty","animation","animationName"]),z=(e,t,r="rem")=>{let n=H(e),i=c(t,{rem:!hr.has(n),second:ft.has(n),quote:Sr.has(n),delimeter:yr.has(n)?", ":" ",unit:r});return`${K(e)}: ${i};`};class k extends _{set(e,t,r){let n=e.PRE+t;return e.PS.set(n,r,e.DATA),!0}}class P extends _{webkit;constructor(e="",t=!0,r,n=""){super("",e,!1,r,n);this.webkit=t}set(e,t,r){let n=e.PREFIX+t,i=b(r)?r:[r],s=new w;if(i.forEach((a)=>{Object.entries(a).forEach(([o,f])=>{let h=fe(o)?`${o}%`:o;e.PS.set(h,f,s)})}),e.ANIM.init(n,new Set),e.DATA.set(`@keyframes ${n}`,s),this.webkit)e.DATA.set(`@-webkit-keyframes ${n}`,s);return!0}}class I extends _{constructor(e="",t=""){super("@",e,void 0,void 0,t)}set(e,t,r){return e.ARR.init(e.PRE+t,new Set).add(r),e}}class F extends _{constructor(e="",t=""){super("@font-face",e,void 0,void 0,t);this.ARR.set(this.PRE,new Set)}set(e,t,r){let n=Object.entries({fontFamily:c([t],{quote:!0}),...r}).map(([i,s])=>z(i,s,this.UNIT));return e.ARR.get(e.PRE)?.add(n.join(`
|
|
4
|
-
`)),!0}}var dt=(e,t=!1,r,n,i="")=>({d:new k("",e,r,n,i),i:new k("#",e,r,n,i),c:new k(".",e,r,n,i),kf:new P(e,t,n,i),at:new I("",i),font:new F("",i)}),br=(e)=>{let t=new Set;return e.filter((r)=>{if(t.has(r))return!1;return t.add(r),!0})},pt=(e,t,r)=>(br(t).forEach((n)=>{r.add(n.path),n.imported.forEach((i)=>{r.add(i)}),Object.keys(e).forEach((i)=>{e[i].load(n[i])})}),e),mt=(e)=>{let t={};return Object.keys(e).forEach((r)=>{t[r]=e[r].css}),t};import{writeFileSync as Kr}from"fs";import{dirname as Dt}from"path";var G=(e,t)=>`${e} {
|
|
2
|
+
var Pt=Object.create;var te=Object.defineProperty;var Ft=Object.getOwnPropertyDescriptor;var Te=(e,t)=>(Object.defineProperty(e,"name",{value:t,enumerable:!1,configurable:!0}),e),Nt=(e)=>e;function Lt(e,t){this[e]=Nt.bind(null,t)}var Kt=(e,t)=>{for(var r in t)te(e,r,{get:t[r],enumerable:!0,configurable:!0,set:Lt.bind(t,r)})};var _e=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),N=(e)=>{throw TypeError(e)},Ht=(e,t,r)=>(t in e)?te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var re=(e,t,r)=>t.has(e)||N("Cannot "+r),zt=(e,t)=>Object(t)!==t?N('Cannot use the "in" operator on this value'):e.has(t),je=(e,t,r)=>(re(e,t,"read from private field"),r?r.call(e):t.get(e));var Ee=(e,t,r,n)=>(re(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Gt=(e,t,r)=>(re(e,t,"access private method"),r),Be=(e)=>[,,,Pt(e?.[_e("metadata")]??null)],Ae=["class","method","getter","setter","accessor","field","value","get","set"],F=(e)=>e!==void 0&&typeof e!=="function"?N("Function expected"):e,Wt=(e,t,r,n,i)=>({kind:Ae[e],name:t,metadata:n,addInitializer:(s)=>r._?N("Already initialized"):i.push(F(s||null))}),ne=(e,t)=>Ht(t,_e("metadata"),e[3]),De=(e,t,r,n)=>{for(var i=0,s=e[t>>1],o=s&&s.length;i<o;i++)t&1?s[i].call(r):n=s[i].call(r,n);return n},Ie=(e,t,r,n,i,s)=>{var o,a,l,g,y,f=t&7,p=!!(t&8),m=!!(t&16),d=f>3?e.length+1:f?p?1:2:0,S=Ae[f+5],h=f>3&&(e[d-1]=[]),C=e[d]||(e[d]=[]),x=f&&(!m&&!p&&(i=i.prototype),f<5&&(f>3||!m)&&Ft(f<4?i:{get[r](){return je(this,s)},set[r](b){Ee(this,s,b)}},r));f?m&&f<4&&Te(s,(f>2?"set ":f>1?"get ":"")+r):Te(i,r);for(var T=n.length-1;T>=0;T--){if(g=Wt(f,r,l={},e[3],C),f){if(g.static=p,g.private=m,y=g.access={has:m?(b)=>zt(i,b):(b)=>(r in b)},f^3)y.get=m?(b)=>(f^1?je:Gt)(b,i,f^4?s:x.get):(b)=>b[r];if(f>2)y.set=m?(b,M)=>Ee(b,i,M,f^4?s:x.set):(b,M)=>b[r]=M}if(a=(0,n[T])(f?f<4?m?s:x[S]:f>4?void 0:{get:x.get,set:x.set}:i,g),l._=1,f^4||a===void 0)F(a)&&(f>4?h.unshift(a):f?m?s=a:x[S]=a:i=a);else if(typeof a!=="object"||a===null)N("Object expected");else F(o=a.get)&&(x.get=o),F(o=a.set)&&(x.set=o),F(o=a.init)&&h.unshift(o)}return f||ne(e,i),x&&te(i,r,x),m?f^4?s:x:i};var ae={};Kt(ae,{isClassOrId:()=>oe,isNumber:()=>ie,isNumeric:()=>se});var ie=(e)=>typeof e==="number",se=(e)=>{let t=String(e);return!Number.isNaN(parseFloat(t))&&Number.isFinite(Number(e))},oe=(e)=>e.startsWith(".")||e.startsWith("#");import{isArray as Pe,isNull as Fe,isObject as Ne}from"@ohmyqt/u";var W=(e,t,r)=>{if(!e.has(t))e.set(t,{});Object.assign(e.get(t),r)},ce=(e,t)=>{let r={added:{},removed:{},modified:{}},n=e,i=t;for(let s of Object.keys(i)){let o=n[s],a=i[s];if(!Object.hasOwn(n,s))r.added[s]=a;else if(Pe(o)&&Pe(a)){if(JSON.stringify(o)!==JSON.stringify(a))r.modified[s]={old:o,new:a}}else if(Ne(o)&&Ne(a)&&!Fe(o)&&!Fe(a)){let l=ce(o,a);if(le(l))r.modified[s]={old:o,new:a}}else if(o!==a)r.modified[s]={old:o,new:a}}for(let s of Object.keys(n))if(!Object.hasOwn(i,s))r.removed[s]=n[s];return r},le=(e)=>Object.values(e).some((t)=>Object.keys(t).length>0);import{existsSync as Le,mkdirSync as Xt,writeFileSync as qt}from"fs";var ue=(e)=>{if(Le(e))return!0;return Xt(e,{recursive:!0}),!0},de=(e,t="")=>{if(Le(e))return!0;return qt(e,t,{flag:"wx"}),!0};function Ke(e,t){let r=t.name;t.addInitializer(function(){Object.defineProperty(this,r,{configurable:!0,enumerable:!1,get(){let n=e.bind(this);return Object.defineProperty(this,r,{configurable:!0,writable:!0,value:n}),n}})})}import{isArray as pe,makeID as Zt,randomAZ as Ut}from"@ohmyqt/u";class He{static arr(e){return e?pe(e)?e:[e]:[]}static num(e,t=0){let r=parseFloat(String(e));return Number.isNaN(r)?t:r}static str(e){return String(e)}static arr2obj(e,t=!1){return e.reduce((r,n,i)=>{if(t)r[String(n)]=i;else r[i]=n;return r},{})}}class ze{val;constructor(e){this.val=e}get px(){return`${this.val}px`}get rem(){return`${this.val}rem`}get pr(){return`${this.val}%`}}class fe{static rand(e=6,t){if(t)return Math.floor(Math.random()*(t-e+1)+e);return Math.floor(Math.random()*e)}static fill(e,t=null){return Array(e).fill(t)}static new({dom:e,id:t,inner:r}){let n=document.createElement(e);if(t)n.id=t;if(r)n.innerHTML=r;return n}static randFrom(e){if(pe(e))return e[this.rand(0,e.length-1)];let t=Object.keys(e);return t[this.rand(0,t.length-1)]}static randArray(e=[],t=1,r=!1){let n=[],i=r?new Set:null;while((r?i.size:n.length)<t){let s=e[fe.rand(0,e.length-1)];if(r)i.add(s);else n.push(s)}return r?[...i]:n}static randomAZ=Ut;static makeID=Zt;static class(e,...t){let r=t.filter(Boolean);if(e?.class)r.push(...pe(e.class)?e.class:[e.class]);if(r.length)e.class=r}static get O(){return{vals:Object.values,keys:Object.keys,items:Object.entries,has:(e,t)=>Object.hasOwn(e,t),ass:Object.assign,len:(e={})=>Object.keys(e).length}}static get is(){return ae}static get return(){return He}static isHREF(e,t){return e===t?!0:e.startsWith(t)&&t!=="/"?!0:!1}static sleep=(e=1000)=>new Promise((t)=>setTimeout(t,e));static get screen(){let{innerWidth:e}=window,t={xs:e<=480,sm:e>=480,smd:e>=624,md:e>=768,lg:e>=1024,xl:e>=1280,xxl:e>=1536},r=Object.entries(t).reverse();for(let[n,i]of r)if(i)return n;return}bytes(e){if(e===0)return"0 Bytes";let t=1024,r=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,n)).toFixed(2))} ${r[n]}`}static format(e){return new ze(e)}static compareObjects=ce;static isObjectUdpated=le}function c(e){return function(...t){return{[e]:t}}}class Ge{static attr(e){let[t,r]=Object.entries(e)[0];return c(`[${t}="${r}"]`)}static after(e=""){return c("::after"+e)}static before(e=""){return c("::before"+e)}static backdrop(e=""){return c("::backdrop"+e)}static cue(e=""){return c("::cue"+e)}static cueRegion(e=""){return c("::cue-region"+e)}static firstLetter(e=""){return c("::first-letter"+e)}static firstLine(e=""){return c("::first-line"+e)}static marker(e=""){return c("::marker"+e)}static part(e=""){return c("::part"+e)}static placeholder(e=""){return c("::placeholder"+e)}static selection(e=""){return c("::selection"+e)}static slotted(e=""){return c("::slotted"+e)}static spellingError(e=""){return c("::spelling-error"+e)}static targetText(e=""){return c("::target-text"+e)}static viewTransition(e=""){return c("::view-transition"+e)}static viewTransitionGroup(e=""){return c("::view-transition-group"+e)}static viewTransitionImagePair(e=""){return c("::view-transition-image-pair"+e)}static viewTransitionNew(e=""){return c("::view-transition-new"+e)}static viewTransitionOld(e=""){return c("::view-transition-old"+e)}static scrollbar(e=""){return c("::-webkit-scrollbar"+e)}static scrollbarThumb(e=""){return c("::-webkit-scrollbar-thumb"+e)}static scrollbarTrack(e=""){return c("::-webkit-scrollbar-track"+e)}static scrollbarCorner(e=""){return c("::-webkit-scrollbar-corner"+e)}static active(e=""){return c(":active"+e)}static anyLink(e=""){return c(":any-link"+e)}static autofill(e=""){return c(":autofill"+e)}static blank(e=""){return c(":blank"+e)}static checked(e=""){return c(":checked"+e)}static current(e=""){return c(":current"+e)}static default(e=""){return c(":default"+e)}static defined(e=""){return c(":defined"+e)}static disabled(e=""){return c(":disabled"+e)}static empty(e=""){return c(":empty"+e)}static enabled(e=""){return c(":enabled"+e)}static first(e=""){return c(":first"+e)}static firstChild(e=""){return c(":first-child"+e)}static firstOfType(e=""){return c(":first-of-type"+e)}static fullscreen(e=""){return c(":fullscreen"+e)}static future(e=""){return c(":future"+e)}static focus(e=""){return c(":focus"+e)}static focusVisible(e=""){return c(":focus-visible"+e)}static focusWithin(e=""){return c(":focus-within"+e)}static host(e=""){return c(":host"+e)}static hover(e=""){return c(":hover"+e)}static indeterminate(e=""){return c(":indeterminate"+e)}static inRange(e=""){return c(":in-range"+e)}static invalid(e=""){return c(":invalid"+e)}static lastChild(e=""){return c(":last-child"+e)}static lastOfType(e=""){return c(":last-of-type"+e)}static left(e=""){return c(":left"+e)}static link(e=""){return c(":link"+e)}static localLink(e=""){return c(":local-link"+e)}static modal(e=""){return c(":modal"+e)}static onlyChild(e=""){return c(":only-child"+e)}static onlyOfType(e=""){return c(":only-of-type"+e)}static optional(e=""){return c(":optional"+e)}static outOfRange(e=""){return c(":out-of-range"+e)}static past(e=""){return c(":past"+e)}static pictureInPicture(e=""){return c(":picture-in-picture"+e)}static placeholderShown(e=""){return c(":placeholder-shown"+e)}static paused(e=""){return c(":paused"+e)}static playing(e=""){return c(":playing"+e)}static readOnly(e=""){return c(":read-only"+e)}static readWrite(e=""){return c(":read-write"+e)}static required(e=""){return c(":required"+e)}static right(e=""){return c(":right"+e)}static root(e=""){return c(":root"+e)}static scope(e=""){return c(":scope"+e)}static target(e=""){return c(":target"+e)}static targetWithin(e=""){return c(":target-within"+e)}static userInvalid(e=""){return c(":user-invalid"+e)}static valid(e=""){return c(":valid"+e)}static visited(e=""){return c(":visited"+e)}static dir(e){return c(`:dir(${e})`)}static has(e){return c(`:has(${e})`)}static host_(e){return c(`:host(${e})`)}static hostContext(e){return c(`:host-context(${e})`)}static is(e){return c(`:is(${e})`)}static lang(e){return c(`:lang(${e})`)}static not(e){return c(`:not(${e})`)}static nthChild(e){return c(`:nth-child(${e})`)}static nthCol(e){return c(`:nth-col(${e})`)}static nthLastChild(e){return c(`:nth-last-child(${e})`)}static nthLastCol(e){return c(`:nth-last-col(${e})`)}static nthLastOfType(e){return c(`:nth-last-of-type(${e})`)}static nthOfType(e){return c(`:nth-of-type(${e})`)}static state(e){return c(`:state(${e})`)}static where(e){return c(`:where(${e})`)}static webkit(e){return c(`::-webkit-${e}`)}static and(e){return c(", "+e)}static child(e){return c(" > "+e)}static desc(e){return c(" "+e)}static next(e){return c(" + "+e)}static general(e){return c(" ~ "+e)}static withClass(e){if(!e.startsWith("."))throw Error("should start with . or # - class / id");return c(e)}}import{isArray as qe,reCamel as sr}from"@ohmyqt/u";import{isArray as We,isDefined as Xe,isNull as rr,isString as nr,isUndefined as ir}from"@ohmyqt/u";import{reCamel as er}from"@ohmyqt/u";import{ngify as Qt,sparse as Yt}from"@ohmyqt/u";var me={xs:"480px",sm:"480px",smd:"624px",md:"768px",lg:"1024px",xl:"1280px",xxl:"1536px"};class V{static default="xs";static prop=Object.entries(me).reduce((e,[t,r],n)=>(e[t]=`(${n==0?"max-width":"min-width"}: ${r})`,e),{});static extra={no_hover:"(pointer: coarse)",mobile:"(pointer: coarse)",print:"print",screen:"screen",dark:"(prefers-color-scheme: dark)",light:"(prefers-color-scheme: light)"};constructor(e,t={}){let r=V.default,n={};if(e!==void 0)D(n,r,e,r);Object.entries(t).forEach(([i,s])=>{D(n,i,s,r)}),Object.assign(this,n)}static get breakpoints(){return Yt(Qt(me))??me}}var D=(e,t,r,n)=>{if(r!==void 0)if(r instanceof V)Object.entries(r).forEach(([i,s])=>{if(n!==t)if(t!==i)if(n===i)D(e,t,s,n);else D(e,`${t}-${i}`,s,n);else D(e,i,s,n);else D(e,i,s,n)});else e[t]=r};function w(e,t){if(t)return new V(e,t);if(typeof e==="object")return new V(void 0,e);return new V(e,{})}function Jt(e){if(this._prefix)return w({[this._prefix]:e});else return w({xs:e})}function v(e){return new this.constructor({prefix:e,values:this._values,data:this.data})}class X{_prefix;data;_values;constructor({prefix:e,data:t,values:r}={}){this._prefix=e,this._values=r??{},Object.entries(this._values).forEach(([n,i])=>{if(!this._values[n])this._values[n]=w({});Object.assign(this._values[n],i)}),this.data=t??{}}get XS(){return v.call(this,"xs")}get SM(){return v.call(this,"sm")}get SMD(){return v.call(this,"smd")}get MD(){return v.call(this,"md")}get LG(){return v.call(this,"lg")}get XL(){return v.call(this,"xl")}get XXL(){return v.call(this,"xxl")}get NO_HOVER(){return v.call(this,"no_hover")}get MOBILE(){return v.call(this,"mobile")}get PRINT(){return v.call(this,"print")}get SCREEN(){return v.call(this,"screen")}get DARK(){return v.call(this,"dark")}set _value(e){Object.entries(e).forEach(([t,r])=>{if(!this._values[t])this._values[t]=w({});Object.assign(this._values[t],Jt.call(this,r))})}get _value(){return this._values}}class R{k="";fallback;var="";value;constructor(e={},t){if(Object.keys(e).length){let[r,n]=Object.entries(e)[0];this.k=r,this.var="--"+er(r),this.value=n instanceof V?n:w(n,{}),this.fallback=t}else this.value=w({})}__(e){if(e)this.fallback=e;let t=this.fallback;if(t)return`var(${this.var}, ${u(t)})`;else return`var(${this.var})`}new(e,t){return new R({[this.k]:e instanceof V?e:u(e)},t)}}var Se=(e,t)=>new R(e,t),tr=(e)=>{let t={};for(let r in e)t[r]=new R({[r]:e[r]});return t};var u=(e,t={unit:"rem"})=>{let{rem:r,second:n,quote:i,degree:s,percent:o,delimeter:a,unit:l,delimeter_arr:g}=t;if(ir(e)||rr(e)||!i&&e==="")return"";let y=We(e)?e:[e];if(!y.length)return"";return y.filter((f)=>Xe(f)).map((f)=>{if(We(f))return a=g||", ",u(f,{...t,delimeter:" "});if(f instanceof R)return f.__();if(i)f=String(f);if(ie(f))if(r)return`${f}${l?l:"rem"}`;else if(s)return`${f}deg`;else if(o)return`${f}%`;else if(n)return`${f}s`;else return String(f);if(nr(f))if(f.includes("("))return f;else if(i)return`'${f}'`;else return f;return""}).filter((f)=>Xe(f)&&f!=="").join(a||" ")};class Ze{static minmax(e,t){return`minmax(${u([e,t],{rem:!0,delimeter:", "})})`}static fitContent(e){return`fit-content(${u([e],{rem:!0})})`}static repeat(e,...t){return`repeat(${u([e,u([t],{rem:!0})],{delimeter:", "})})`}}class Ue extends Ze{static attr(e,t,r){return`attr(${u([e,t,r])})`}static blur(e){return`blur(${u([e],{rem:!0})})`}static brightness(e){return`brightness(${u([e])})`}static calc(...e){return`calc(${u(e,{rem:!0})})`}static circle(e,t){return`circle(${u([e,t],{rem:!0})})`}static clamp(e,t,r){return`clamp(${u([e,t,r],{rem:!0,delimeter:", "})})`}static colorMix(e,t,r){return`color-mix(${u([e,u(qe(t)?t:[t]),u(qe(r)?r:[r])],{delimeter:", "})})`}static conicGradient(...e){return`conic-gradient(${u(e,{delimeter:", "})})`}static contrast(e){return`contrast(${u([e])})`}static cubicBezier(e,t,r,n){return`cubic-bezier(${u([e,t,r,n],{delimeter:", "})})`}static dropShadow(...e){return`drop-shadow(${u(e,{rem:!0})})`}static grayscale(e){return`grayscale(${u([e])})`}static hsl(e,t,r){return`hsl(${u([e,t,r])})`}static hsla(e,t,r,n){return`hsl(${u([e,t,r,n?["/",n]:n])})`}static hueRotate(e){return`hue-rotate(${u([e],{degree:!0})})`}static inset(...e){return`inset(${u(e,{rem:!0})})`}static invert(e){return`invert(${u([e])})`}static linearGradient(...e){return`linear-gradient(${u(e,{delimeter:", "})})`}static matrix(e,t,r,n,i,s){return`matrix(${u([e,t,r,n,i,s],{delimeter:", "})})`}static matrix3d(e,t,r,n){return`matrix3d(${u([e,t,r,n],{delimeter:", "})})`}static max(...e){return`max(${u(e,{rem:!0,delimeter:", "})})`}static min(...e){return`min(${u(e,{rem:!0,delimeter:", "})})`}static opacity(e){return`opacity(${u([e])})`}static path(e){return`path(${u([e],{quote:!0})})`}static clipPath(e,t){return`path(${u([e,u([t],{quote:!0})],{delimeter:", "})})`}static perspective(e){return`perspective(${u([e])})`}static polygon(...e){return`polygon(${u(e,{percent:!0,delimeter:", "})})`}static ray(...e){return`ray(${u(e,{degree:!0})})`}static radialGradient(...e){return`radial-gradient(${u(e,{delimeter_arr:", ",percent:!0,delimeter:", "})})`}static repeatingConicGradient(...e){return`repeating-conic-gradient(${u(e,{degree:!0,delimeter:", "})})`}static repeatingLinearGradient(...e){return`repeating-linear-gradient(${u(e,{degree:!0,delimeter:", "})})`}static repeatingRadialGradient(...e){return`repeating-radial-gradient(${u(e,{degree:!0,delimeter:", "})})`}static rgb(e,t,r){return`rgb(${u([e,t,r])})`}static rgba(e,t,r,n){return`rgba(${u([e,t,r,n?["/",n]:void 0],{delimeter_arr:" "})})`}static rotate(e){return`rotate(${u([e],{degree:!0})})`}static rotate3d(e,t,r,n){return`rotate3d(${u([u([e,t,r],{delimeter:", "}),n],{degree:!0,delimeter:", "})})`}static rotateX(e){return`rotateX(${u([e],{degree:!0})})`}static rotateY(e){return`rotateY(${u([e],{degree:!0})})`}static rotateZ(e){return`rotateZ(${u([e],{degree:!0})})`}static saturate(...e){return`saturate(${u(e)})`}static scale(e,t){return`scale(${u([e,t],{delimeter:", "})})`}static scale3d(e,t,r){return`scale3d(${u([e,t,r],{delimeter:", "})})`}static scaleX(e){return`scaleX(${u([e])})`}static scaleY(e){return`scaleY(${u([e])})`}static scaleZ(e){return`scaleZ(${u([e])})`}static sepia(e){return`sepia(${u([e])})`}static skew(...e){return`skew(${u(e,{degree:!0,delimeter:", "})})`}static skewX(e){return`skewX(${u([e],{degree:!0})})`}static skewY(e){return`skewY(${u([e],{degree:!0})})`}static steps(e,t){return`steps(${u([e,t],{delimeter:", "})})`}static translate(...e){return`translate(${u(e,{rem:!0,delimeter:", "})})`}static translate3d(...e){return`translate3d(${u(e,{rem:!0,delimeter:", "})})`}static translateX(e){return`translateX(${u([e],{rem:!0})})`}static translateY(e){return`translateY(${u([e],{rem:!0})})`}static translateZ(...e){return`translateZ(${u(e,{rem:!0,delimeter:", "})})`}static url(e){return`url(${u([e],{quote:!0})})`}static format(e){return`format(${u([e],{quote:!0})})`}static var(e,t=""){e="--"+sr(e);let r=t?", "+u([t],{rem:!0,delimeter:", "}):"";return`var(${u([e],{rem:!0})}${r})`}}var or={important:" !important",visible:"visible",hidden:"hidden",auto:"auto",none:"none",clip:"clip",scroll:"scroll",initial:"initial",inherit:"inherit",flex:"flex",center:"center",flex_start:"flex-start",flex_end:"flex-end",space_evenly:"space-evenly",stretch:"stretch",wrap:"wrap",column:"column",column_reverse:"column-reverse",row:"row",row_reverse:"row-reverse",space_between:"space-between",space_around:"space-around",pr100:"100%",pr50:"50%",i100vh:"100vh",i100vw:"100vw",block:"block",sticky:"sticky",fixed:"fixed",absolute:"absolute",relative:"relative",pointer:"pointer",grabbing:"grabbing",checkbox:"checkbox",solid:"solid",inset:"inset",bold:"bold",currentColor:"currentColor",forwards:"forwards",text:"text",norepeat:"no-repeat",nowrap:"nowrap",difference:"difference",preserve3d:"preserve-3d"};import{isString as ar}from"@ohmyqt/u";import{Mapped as cr}from"@ohmyqt/u";class q{value;__;constructor(e){if(this.value=new cr,ar(e))this.value.set(e,[]);else Object.entries(e).forEach(([t,r])=>{this.value.set(`${t}:${r}`,[])});this.__=(...t)=>(this.value.forEach((r)=>{r.push(...t)}),this)}}function lr(e){return new q(e).__}import{isArray as Sn}from"@ohmyqt/u";import{Mapped as Q}from"@ohmyqt/u";import{camel as Rr,isArray as Ve,isDefined as $r,isNull as vr,isObject as Mr,isString as xe,Mapped as we}from"@ohmyqt/u";import{camel as ur,isArray as dr,isDefined as pr,isFunction as fr}from"@ohmyqt/u";var O=(e)=>{if(fr(e))return O(e());if(e instanceof V)return e;if(e instanceof R)return w(e.__(),{});return w(e,{})},U=(e)=>e==='"'||e==="'",he="([{",ye=")]}",Ye=(e,t)=>{let r=[],n=0,i=null,s=0;for(let o=0;o<e.length;o++){let a=e[o];if(i){if(a==="\\")o++;else if(a===i)i=null;continue}if(a==="\\")o++;else if(U(a))i=a;else if(he.includes(a))s++;else if(ye.includes(a)){if(s>0)s--}else if(a===t&&s===0)r.push(e.slice(n,o)),n=o+1}return r.push(e.slice(n)),r},mr=(e,t)=>{let r=null,n=0;for(let i=0;i<e.length;i++){let s=e[i];if(r){if(s==="\\")i++;else if(s===r)r=null;continue}if(s==="\\")i++;else if(U(s))r=s;else if(he.includes(s))n++;else if(ye.includes(s)){if(n>0)n--}else if(s===t&&n===0)return i}return-1},Ce=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,Sr=(e)=>{if(!Ce.test(e))return;let t=Number(e);return Number.isFinite(t)?t:void 0};function Je(e){let t={};return Ye(e,";").forEach((r)=>{let n=r.trim();if(n==="")return;let i=mr(n,":");if(i===-1)return;let s=n.slice(0,i).trim();if(s==="")return;let o=n.slice(i+1).trim(),a=s.startsWith("--"),l=a?s:ur(s);if(a){t[l]=o;return}let g=Sr(o);t[l]=g===void 0?o:g}),t}var et=new Set(["initial","inherit","unset","revert","revert-layer"]),gr=new Set(["linear","ease","ease-in","ease-out","ease-in-out","step-start","step-end"]),hr=new Set(["cubic-bezier","steps","linear"]),yr=new Set(["normal","reverse","alternate","alternate-reverse"]),Cr=new Set(["forwards","backwards","both"]),br=new Set(["running","paused"]),tt=/^-{0,2}[A-Za-z_][A-Za-z0-9_-]*$/,rt=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:s|ms)$/i,be=(e)=>e.length>=2&&U(e[0])&&e[e.length-1]===e[0],nt=(e)=>{let t=[],r=-1,n=null,i=0;for(let s=0;s<e.length;s++){let o=e[s];if(n){if(o==="\\")s++;else if(o===n)n=null;continue}if(o==="\\"){if(r===-1)r=s;s++;continue}if(U(o)){if(r===-1)r=s;n=o;continue}if(he.includes(o)){if(r===-1)r=s;i++;continue}if(ye.includes(o)){if(r===-1)r=s;if(i>0)i--;continue}if(i===0&&/\s/.test(o)){if(r!==-1)t.push(e.slice(r,s)),r=-1;continue}if(r===-1)r=s}if(r!==-1)t.push(e.slice(r));return t},Vr=(e)=>{if(be(e))return"name";let t=e.match(/^([A-Za-z][A-Za-z0-9-]*)\(/);if(t){if(e.endsWith(")")&&hr.has(t[1].toLowerCase()))return"skip";return"abort"}if(rt.test(e)||Ce.test(e))return"skip";if(e.toLowerCase()==="!important")return"skip";if(!tt.test(e))return"abort";let r=e.toLowerCase();if(et.has(r)||gr.has(r)||yr.has(r)||Cr.has(r)||br.has(r)||r==="infinite"||r==="none")return"skip";return"name"},ge=(e,t)=>{if(be(e)){let r=e.slice(1,-1);if(r==="")return;let n=e[0];return{text:`${n}${t}${r}${n}`,name:r}}return{text:`${t}${e}`,name:e}},xr=(e,t)=>{let r=nt(e),n=-1,i="";for(let a=0;a<r.length;a++){let l=r[a],g=l.toLowerCase(),y=Vr(l);if(y==="abort")return{value:e,names:[]};if(g==="!important"&&a!==r.length-1)return{value:e,names:[]};if(y==="skip")continue;if(n!==-1)return{value:e,names:[]};n=a,i=l}if(n===-1)return{value:e,names:[]};let s=ge(i,t);if(!s)return{value:e,names:[]};let o=[...r];return o[n]=s.text,{value:o.join(" "),names:[s.name]}},wr=(e,t)=>{let r=nt(e.trim()),n=r.length>1&&r[r.length-1].toLowerCase()==="!important"?r.pop():void 0;if(r.length!==1)return{value:e,names:[]};let i=r[0];if(be(i)){let o=ge(i,t);if(!o)return{value:e,names:[]};return{value:[o.text,n].filter(Boolean).join(" "),names:[o.name]}}if(i.includes("("))return{value:e,names:[]};if(rt.test(i)||Ce.test(i))return{value:e,names:[]};if(!tt.test(i))return{value:e,names:[]};let s=i.toLowerCase();if(et.has(s)||s==="none")return{value:e,names:[]};return{value:[ge(i,t).text,n].filter(Boolean).join(" "),names:[i]}},Qe=(e,t,r)=>{let n=Ye(e,",");if(n.some((a)=>a.trim()===""))return{value:e,names:[]};let i=[],s=!1,o=n.map((a)=>{let l=r(a,t);if(i.push(...l.names),l.value!==a)s=!0;return l.value});return{value:s?o.map((a)=>a.trim()).join(", "):e,names:i}},it=(e,t,r="animation")=>{if(r==="animationName")return Qe(e,t,wr);return Qe(e,t,xr)},st=(e)=>{e.value.forEach((t,r)=>{e.value.set(r,t.map((n)=>{let i={};return Object.entries(n).forEach(([s,o])=>{if(pr(o))i[s]=O(o)}),i}))})},Z=(e,t=[])=>{if(dr(e))return Z(e[0]);if(e instanceof R)return Z(Object.values(e.value));return[String(e)]};function Re(e){let t=[],r=0,n=0,i=null;for(let s=0;s<e.length;s++){let o=e[s];if(o==="\\"){s++;continue}if(i){if(o===i)i=null;continue}if(o==="/"&&e[s+1]==="*"){let a=e.indexOf("*/",s+2);s=a===-1?e.length:a+1;continue}if(o==='"'||o==="'")i=o;else if(o==="("||o==="[")n++;else if(o===")"||o==="]"){if(n>0)n--}else if(o===","&&n===0)t.push(e.slice(r,s)),r=s+1}return t.push(e.slice(r)),t}function ot(e,t){let r=Re(e);if(r.length<=1)return e+t;return r.map((n)=>`${n.trim()}${t}`).join(", ")}function kr(e,t,r){let n=Re(e);if(n.length<=1)return r.map((i)=>`${e}${t}${i.trim()}`).join(", ");return n.flatMap((i)=>r.map((s)=>`${i.trim()}${t}${s.trim()}`)).join(", ")}class $e{base;constructor(e){this.base=e}prefixAnimationValues(e,t,r){let n=Rr(t);if(!(n==="animation"||n==="animationName"))return r;let s=Object.assign(new V,r);return Object.entries(s).forEach(([o,a])=>{s[o]=this.addPrefixToAnimation(e,n,a)}),s}addPrefixToAnimation(e,t,r){if(r instanceof R)this.saveAnim(e,r);else if(Ve(r))return r.map((n)=>this.addPrefixToAnimation(e,t,n));else if(xe(r)){let n=it(r,this.base.PREFIX,t);return n.names.forEach((i)=>{let s=`${this.base.PREFIX}${i}`;this.base.ANIM.init(s,new Set).add(e)}),n.value}return r}saveAnim(e,t){Z(t).forEach((r)=>{this.base.ANIM.init(`${this.base.PREFIX}${r}`,new Set).add(e)})}processDeclaration(e,t,r,n,i){if(r instanceof R)this.saveAnim(e,r),W(n,t,this.prefixAnimationValues(e,r.var,O(r)));else if(t.startsWith(","))this.set(e+t,r,i);else if(t.startsWith(":")||t.startsWith("["))this.set(ot(e,t),r,i);else if(t.startsWith(" ")){let s=t.match(/^\s*(?:[>+~]\s*)?/)?.[0]??"";this.set(kr(e,s,Re(t.slice(s.length))),r,i)}else if(oe(t))this.set(ot(e,t),r,i);else n.set(t,this.prefixAnimationValues(e,t,O(r)))}set(e,t,r){if(!Mr(t)&&!vr(t)&&!xe(t))return;let n=new we;if(t instanceof R)this.saveAnim(e,t),W(n,t.var,this.prefixAnimationValues(e,t.var,O(t.value)));else if(t instanceof X)Object.entries(t._value).forEach(([s,o])=>{if($r(o))n.set(s,this.prefixAnimationValues(e,s,O(o)))});else if(t instanceof q)st(t),n.init("supports",[]).push(t);else if(Ve(t))t.forEach((s)=>{this.set(e,s,r)});else if(xe(t)){let s=Je(t);this.set(e,s,r)}else Object.entries(t).forEach(([s,o])=>{if(o instanceof R){this.saveAnim(e,o),W(n,o.var,this.prefixAnimationValues(e,o.var,O(o.value)));return}return this.processDeclaration(e,s,o,n,r)});let i=r.init(e,new we);n.forEach((s,o)=>{if(o==="supports"&&Ve(s))r.init(e,new we).init(o,[]).push(...s);else i.set(o,s)})}}class E{PRE;EXPORT;UNIT;SOURCE;PS;PREFIX;ARR=new Q;CID=new Q;DATA=new Q;ANIM=new Q;IMPORTED=[];constructor(e="",t="",r,n,i=""){this.PRE=e;this.EXPORT=r;this.UNIT=n;this.SOURCE=i;this.PREFIX=t?t+"_":t,this.PS=new $e(this)}get(e,t,r){let n=e.PRE+t;if(e.DATA.has(n))return n;else if(t in e)return e[t];else return e.PRE+t}set(e,t,r){return!1}get css(){return new Proxy(this,this)}load(e){return this.IMPORTED.push(e),this}__(e){Object.entries(e).forEach(([t,r])=>{this.set(this,t,r)})}}import{isArray as Br,Mapped as Ar}from"@ohmyqt/u";import{camel as Or,reCamel as Tr}from"@ohmyqt/u";var at=new Set(["transitionDuration","transitionDelay","animationDelay","animationDuration"]),jr=new Set([...at,"zIndex","opacity","aspectRatio","order","flexShrink","flexGrow","flex","fillOpacity","lineClamp","order","scale","webkitLineClamp","lineHeight","fontWeight","orphans","widows","tabSize","zoom","borderImageOutset","borderImageSlice","borderImageWidth","animationIterationCount","columnCount","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd"]),Er=new Set(["content"]),_r=new Set(["transitionProperty","animation","animationName"]),I=(e,t,r="rem")=>{let n=Or(e),i=u(t,{rem:!jr.has(n),second:at.has(n),quote:Er.has(n),delimeter:_r.has(n)?", ":" ",unit:r});return`${Tr(e)}: ${i};`};class k extends E{set(e,t,r){let n=e.PRE+t;return e.PS.set(n,r,e.DATA),!0}}class _ extends E{webkit;constructor(e="",t=!0,r,n=""){super("",e,!1,r,n);this.webkit=t}set(e,t,r){let n=e.PREFIX+t,i=Br(r)?r:[r],s=new Ar;if(i.forEach((o)=>{Object.entries(o).forEach(([a,l])=>{let g=se(a)?`${a}%`:a;e.PS.set(g,l,s)})}),e.ANIM.init(n,new Set),e.DATA.set(`@keyframes ${n}`,s),this.webkit)e.DATA.set(`@-webkit-keyframes ${n}`,s);return!0}}class B extends E{constructor(e="",t=""){super("@",e,void 0,void 0,t)}set(e,t,r){return e.ARR.init(e.PRE+t,new Set).add(r),e}}class A extends E{constructor(e="",t=""){super("@font-face",e,void 0,void 0,t);this.ARR.set(this.PRE,new Set)}set(e,t,r){let n=Object.entries({fontFamily:u([t],{quote:!0}),...r}).map(([i,s])=>I(i,s,this.UNIT));return e.ARR.get(e.PRE)?.add(n.join(`
|
|
3
|
+
`)),!0}}var ct=(e,t=!1,r,n,i="")=>({d:new k("",e,r,n,i),i:new k("#",e,r,n,i),c:new k(".",e,r,n,i),kf:new _(e,t,n,i),at:new B("",i),font:new A("",i)}),Dr=(e)=>{let t=new Set;return e.filter((r)=>{if(t.has(r))return!1;return t.add(r),!0})},lt=(e,t,r)=>(Dr(t).forEach((n)=>{r.add(n.path),n.imported.forEach((i)=>{r.add(i)}),Object.keys(e).forEach((i)=>{e[i].load(n[i])})}),e),ut=(e)=>{let t={};return Object.keys(e).forEach((r)=>{t[r]=e[r].css}),t};import{writeFileSync as pn}from"fs";import{dirname as Et}from"path";import{isArray as _t,isDefined as fn}from"@ohmyqt/u";import{Mapped as tn}from"@ohmyqt/u";import{isArray as St,isDefined as Lr,log as Kr,Mapped as H}from"@ohmyqt/u";var L=(e,t)=>`${e} {
|
|
5
4
|
${t.join(`
|
|
6
5
|
`)}
|
|
7
|
-
}`,
|
|
8
|
-
`));else{let
|
|
9
|
-
${
|
|
6
|
+
}`,Ir=(e)=>[...e].join(", "),Pr=(e)=>e.some((t)=>t.startsWith("animation")||t.startsWith("transition")),dt=(e,t)=>L(Ir(e),t),Fr=({selectors:e})=>e.size===1&&e.has(":root"),Nr=(e)=>{let t,r=[];return e.forEach((n)=>{if(!Fr(n)){r.push(n);return}if(t){t.declarations.push(...n.declarations);return}t={selectors:new Set(n.selectors),declarations:[...n.declarations]},r.push(t)}),r},pt=(e,t,r,n=!1)=>{let i=new Set;return e.atRules.forEach((s)=>{i.add(s)}),Object.entries(e.groupedRulesByMedia).forEach(([s,o])=>{let a=n?Nr(o):o,l=[],g=[];if(a.forEach(({selectors:p,declarations:m})=>{let d=dt(p,m);if(Pr(m))g.push(d);else l.push(d)}),g.length)l.unshift(...g);let y=e.keyframeBlocksByMedia[s];if(y)Object.entries(y).forEach(([p,m])=>{l.push(L(p,m))});let f=e.groupedSupportsByMedia[s];if(f)Object.entries(f).forEach(([p,m])=>{let d=m.map(({selectors:S,declarations:h})=>dt(S,h));l.push(L(p,d))});if(l.length)if(s===r)i.add(`/* -------------- ${s} ( default ) */`),i.add(l.join(`
|
|
7
|
+
`));else{let p=s.split("-").map((m)=>t[m]).join(" and ");if(p)i.add(`/* -------------- ${s} */`),i.add(`@media ${p} {
|
|
8
|
+
${l.join(`
|
|
10
9
|
`)}
|
|
11
|
-
}`)}}),[...
|
|
12
|
-
`)};var
|
|
13
|
-
${
|
|
14
|
-
}`)}),e.IMPORTED.forEach((
|
|
15
|
-
`)},
|
|
10
|
+
}`)}}),[...i].join(`
|
|
11
|
+
`)};var gt=(e,t,r,n)=>{let i={code:r.code,severity:r.severity,message:r.message,sourcePath:t.SOURCE||e.sourcePath||""};if(r.rule!==void 0)i.rule=r.rule;if(r.selector!==void 0)i.selector=r.selector;let s=e.onDiagnostic;if(typeof s==="function"){try{s(i)}catch{}return}n?.()},K=()=>({visited:new Set,active:new Set,stack:[]}),z=(e,t,r,n)=>{if(r.active.has(t)){let s=[...r.stack,t].map((a)=>a.SOURCE||e.sourcePath||"").join(" -> "),o=n.get(t);if(o===void 0)o=new Set,n.set(t,o);if(!o.has(s))o.add(s),gt(e,t,{code:"import.cycle",severity:"warning",message:`Circular import detected: ${s}`});return!1}if(r.visited.has(t))return!1;return r.visited.add(t),r.active.add(t),r.stack.push(t),!0},G=(e,t)=>{t.stack.pop(),t.active.delete(e)},Hr=(e,t)=>Array.from(e.matchAll(t),(r)=>r[1]).filter((r)=>r!==void 0),zr=(e)=>/[a-zA-Z0-9_-]/.test(e)||e.charCodeAt(0)>=128,Gr=(e,t)=>{let r=t,n="",i="";while(r<e.length){let s=e[r];if(s==="\\"){if(n+=s,r+=1,r>=e.length)break;let o=e[r];if(/[0-9a-fA-F]/.test(o)){let a="";while(r<e.length&&a.length<6&&/[0-9a-fA-F]/.test(e[r]))a+=e[r],r+=1;if(n+=a,r<e.length&&/\s/.test(e[r]))n+=e[r],r+=1;let l=parseInt(a,16);i+=l===0||l>1114111?"\uFFFD":String.fromCodePoint(l)}else n+=o,i+=o,r+=1;continue}if(!zr(s))break;n+=s,i+=s,r+=1}return{token:{raw:n,decoded:i},end:r}},Wr=(e)=>{let t=[],r=[],n=0,i,s=0;while(n<e.length){let o=e[n];if(o==="\\"){n+=2;continue}if(i!==void 0){if(o===i)i=void 0;n+=1;continue}if(o==='"'||o==="'"){i=o,n+=1;continue}if(o==="/"&&e[n+1]==="*"){let a=e.indexOf("*/",n+2);n=a===-1?e.length:a+2;continue}if(o==="["){s+=1,n+=1;continue}if(o==="]"){s=Math.max(0,s-1),n+=1;continue}if(s===0&&(o==="."||o==="#")&&yt(e,n+1)){let{token:a,end:l}=Gr(e,n+1);(o==="."?t:r).push(a),n=l;continue}n+=1}return{classes:t,ids:r}},Xr=(e)=>{let t=e.split(""),r=0,n,i=0;while(r<e.length){let s=e[r];if(s==="\\"){r+=2;continue}if(n!==void 0){if(t[r]=" ",s===n)n=void 0;r+=1;continue}if(s==='"'||s==="'"){t[r]=" ",n=s,r+=1;continue}if(s==="/"&&e[r+1]==="*"){let o=e.indexOf("*/",r+2),a=o===-1?e.length:o+2;for(let l=r;l<a;l+=1)t[l]=" ";r=a;continue}if(s==="["){i+=1,t[r]=" ",r+=1;continue}if(s==="]"){i=Math.max(0,i-1),t[r]=" ",r+=1;continue}if(i>0)t[r]=" ";r+=1}return t.join("")},qr=/^[\p{ID_Start}_$][\p{ID_Continue}$]*$/u,Zr=/[^\p{ID_Continue}$]/gu,Ur=(e)=>{let t=e.replaceAll("-","_").replace(Zr,"_");if(t==="")return"_";if(!qr.test(t))t=`_${t}`;return t},ht=(e,t,r,n,i=!0)=>{let s=/\b([a-zA-Z][a-zA-Z0-9]*)\b(?![^{}]*})/g,{classes:o,ids:a}=Wr(t),l=[...new Set(o.map((g)=>g.decoded)),...new Set(a.map((g)=>g.decoded))];if(i&&Lr(n)&&n){let g=(y)=>{let f=new Set;y.forEach(({raw:p,decoded:m})=>{if(f.has(p))return;f.add(p),e.cid.init(Ur(m),new Set).add(r+p)})};g(o),g(a)}return l.push(...new Set(Hr(Xr(t),s))),l.some((g)=>e.shaker.includes(g)||e.include.includes(g))},yt=(e,t)=>{let r=e[t];if(r===void 0)return!1;if(r==="\\")return!0;if(/[a-zA-Z_-]/.test(r))return!0;return r.charCodeAt(0)>=128},Qr=(e,t)=>{if(!t)return e;let r="",n=0,i,s=0;while(n<e.length){let o=e[n];if(o==="\\"){if(r+=o,n+1<e.length)r+=e[n+1];n+=2;continue}if(i!==void 0){if(r+=o,o===i)i=void 0;n+=1;continue}if(o==='"'||o==="'"){i=o,r+=o,n+=1;continue}if(o==="/"&&e[n+1]==="*"){let a=e.indexOf("*/",n+2),l=a===-1?e.length:a+2;r+=e.slice(n,l),n=l;continue}if(o==="[")s+=1;if(o==="]")s=Math.max(0,s-1);if(s===0&&(o==="."||o==="#")&&yt(e,n+1)){r+=o+t,n+=1;continue}r+=o,n+=1}return r},Yr=(e,t,r)=>!(e.shaker.length>0&&(t.startsWith(".")||t.startsWith("#")))||r,ft=(e,t,r)=>{(e[t]??=[]).push(r)},Ct=(e,t,r,n,i,s)=>{if(!z(t,e,i,s))return;e.DATA.forEach((o,a)=>{let l=Qr(a,e.PREFIX),g=ht(t,a,e.PREFIX,t.exportMap);if(!Yr(t,l,g))return;let y=new H,f=new H;o.forEach((p,m)=>{if(m==="supports"){if(St(p))p.forEach((d)=>{d.value.forEach((S,h)=>{let C=f.init(h,new H);S.forEach((x)=>{Object.entries(x).forEach(([T,b])=>{Object.entries(b).forEach(([M,j])=>{C.init(M,[]).push(I(T,j,e.UNIT))})})})})})}else Object.entries(p).forEach(([d,S])=>{y.init(d,[]).push(I(m,S,e.UNIT))})}),y.forEach((p,m)=>{ft(r,m,{selector:l,declarations:p})}),f.forEach((p,m)=>{let d=n[m]??={};p.forEach((S,h)=>{ft(d,h,{selector:l,declarations:S})})})}),e.IMPORTED.forEach((o)=>{if(o instanceof k)Ct(o,t,r,n,i,s)}),G(e,i)},Jr=(e,t)=>{t.forEach((r,n)=>{r.forEach((i)=>{e.init(n,new Set).add(i)})})},bt=(e,t,r,n,i)=>{if(!z(t,e,n,i))return;Jr(r,e.ANIM),e.IMPORTED.forEach((s)=>{if(s instanceof k)bt(s,t,r,n,i)}),G(e,n)},Vt=(e,t,r,n,i,s)=>{if(!z(t,e,i,s))return;let o=(l,g,y)=>{let f=r[l]??={};(f[g]??=[]).push(y)},a=(l)=>{if(!t.shaker.length)return!0;let g=n.get(l);return g!==void 0&&[...g].some((y)=>ht(t,y,"",!1,!1))};e.DATA.forEach((l,g)=>{let y=g.split(" ")[1],f=a(y);l.forEach((p,m)=>{if(!(p instanceof H))return;let d={};p.forEach((S,h)=>{if(h==="supports"||St(S)){gt(t,e,{code:"keyframes.supports-unsupported",severity:"error",message:"@supports is not supported in @keyframes",rule:g,selector:m},()=>{Kr.e=["@supports not supported in @keyframes",{error:"support in keyframes"}]});return}if(!f)return;Object.entries(S).forEach(([C,x])=>{(d[C]??=[]).push(I(h,x,e.UNIT))})}),Object.entries(d).forEach(([S,h])=>{o(S,g,L(m,h))})})}),e.IMPORTED.forEach((l)=>{if(l instanceof _)Vt(l,t,r,n,i,s)}),G(e,i)},xt=(e,t,r,n,i)=>{if(!z(r,e,n,i))return;for(let[s,o]of e.ARR)o.forEach((a)=>{let l=a.includes("(")?a:`"${a}"`;t.add(`${s} ${l.trim()};`)});e.IMPORTED.forEach((s)=>{if(s instanceof B)xt(s,t,r,n,i)}),G(e,n)},mt="@font-face",wt=(e,t,r,n,i)=>{if(!z(r,e,n,i))return;(e.ARR.get(mt)??new Set).forEach((o)=>{t.add(`${mt} {
|
|
12
|
+
${o}
|
|
13
|
+
}`)}),e.IMPORTED.forEach((o)=>{if(o instanceof A)wt(o,t,r,n,i)}),G(e,n)},Rt=(e,t)=>{let r={},n={},i={},s=new H,o=new Set,a=t,l=K(),g=K(),y=K(),f=K(),p=K(),m=new Map,d=Object.values(e);for(let S of d)if(S instanceof k)bt(S,a,s,l,m);for(let S of d)if(S instanceof k)Ct(S,a,r,n,g,m);else if(S instanceof _)Vt(S,a,i,s,y,m);else if(S instanceof B)xt(S,o,a,f,m);else if(S instanceof A)wt(S,o,a,p,m);return{styleRulesByMedia:r,supportsRulesByCondition:n,keyframeBlocksByMedia:i,atRules:o}};var en=(e,t)=>{if(e.length!==t.length)return!1;return e.every((r,n)=>r===t[n])},$t=(e)=>{let t=[];for(let r of e){let n=t[t.length-1];if(n&&en(n.declarations,r.declarations))n.selectors.add(r.selector);else t.push({selectors:new Set([r.selector]),declarations:[...r.declarations]})}return t},vt=(e,t)=>{let r={};return t.forEach((n)=>{r[n]??=[]}),Object.entries(e).forEach(([n,i])=>{(r[n]??=[]).push(...$t(i))}),r},Mt=(e)=>{let t={};return Object.entries(e).forEach(([r,n])=>{let i=`@supports(${r})`;Object.entries(n).forEach(([s,o])=>{let a=t[s]??={};(a[i]??=[]).push(...$t(o))})}),t};class ve{shweet;shaker;include;mergeRoot;CID=new tn;css="";onDiagnostic;constructor(e,t=[],r=[],n,i=!1){this.shweet=e;this.shaker=t;this.include=r;this.mergeRoot=i;this.onDiagnostic=n??e.onDiagnostic}load(e,t={}){let r=V.default;this.CID.clear();let n={...V.prop,...V.extra,...t},i=Rt(this.shweet,{shaker:this.shaker,include:this.include,exportMap:e,cid:this.CID,sourcePath:this.shweet.path,onDiagnostic:this.onDiagnostic}),s=vt(i.styleRulesByMedia,Object.keys(n)),o=Mt(i.supportsRulesByCondition);return this.css=pt({groupedRulesByMedia:s,groupedSupportsByMedia:o,keyframeBlocksByMedia:i.keyframeBlocksByMedia,atRules:i.atRules},n,r,this.mergeRoot),this}}import{writeFileSync as rn}from"fs";var nn=new Set("arguments await break case catch class const continue debugger default delete do else enum eval export extends false finally for function if implements import in instanceof interface let new null package private protected public return static super switch this throw true try typeof var void while with yield".split(" ")),sn=/^[$_\p{ID_Start}][$\u200c\u200d_\p{ID_Continue}]*$/u,Me=(e)=>sn.test(e)&&!nn.has(e),on=(e)=>{let t=[...e.entries()].map(([s,o])=>{let a=[...o].join(" ");return{key:s,value:a,rendered:`${s}="${a}"`}}).sort((s,o)=>s.rendered.localeCompare(o.rendered,void 0,{numeric:!0}));if(t.length===0)return"export {}";if(t.every((s)=>Me(s.key)))return`export const ${t.map((s)=>s.rendered).join()};`;let r=new Set(t.map((s)=>s.key).filter((s)=>Me(s))),n=1,i=()=>{let s;do s=`_x${n}`,n+=1;while(r.has(s));return r.add(s),s};return t.map((s)=>{if(Me(s.key))return`export const ${s.rendered};`;let o=i();return`const ${o}=${JSON.stringify(s.value)}; export { ${o} as ${JSON.stringify(s.key)} };`}).join(`
|
|
14
|
+
`)},kt=(e,t)=>{rn(e,on(t))};var ke=(e)=>e!==void 0&&/\s/.test(e),P=(e)=>e!==void 0&&(/[a-zA-Z0-9_-]/.test(e)||e.charCodeAt(0)>=128),Oe=(e)=>e!==void 0&&e>="0"&&e<="9",an=(e)=>e!==void 0&&(/[a-zA-Z_-]/.test(e)||e.charCodeAt(0)>=128),Ot=(e,t)=>{let r=t;while(r<e.length){let n=e[r];if(n==="\\"){r+=Math.min(2,e.length-r);continue}if(!P(n))break;r+=1}return r},Tt=new Set(["{","}",";",",",">","~"]),cn=/^(?:calc|min|max|clamp|hypot|round|mod|rem|abs|sign|sqrt|pow|log|exp|sin|cos|tan|asin|acos|atan|atan2)\(/i,ln=/^url\(/i,un=(e,t)=>{if(e===void 0||t===void 0)return!1;if(P(e)&&P(t))return!0;if(Oe(e)&&t===".")return!0;if(e==="."&&Oe(t))return!0;if(e==="#"&&P(t))return!0;if(e==="@"&&P(t))return!0;if(P(e)&&t==="(")return!0;if(Oe(e)&&t==="%")return!0;if(e==="/"&&t==="*")return!0;return!1},dn=(e,t,r)=>{if(r&&(e==="+"||e==="-"))return!1;if(r&&(t==="+"||t==="-"))return!1;if(t===":")return!1;if(e===":")return!0;if(t==="+")return!0;if(e==="+")return!0;return Tt.has(e)||Tt.has(t)},jt=(e)=>{let t="",r=0,n=!1,i=!1,s=0,o=[],a=0,l=(p)=>{if(!n)return;if(n=!1,t.length===0)return;let m=t[t.length-1];if(!dn(m,p,a>0))t+=" "},g=(p)=>{let m=e[p],d=p+1;while(d<e.length){let S=e[d];if(S==="\\"){d+=Math.min(2,e.length-d);continue}if(d+=1,S===m)break}return t+=e.slice(p,d),d},y=(p,m)=>{let d=m+1,S=1,h;while(d<e.length){let C=e[d];if(h!==void 0){if(C==="\\"){d+=Math.min(2,e.length-d);continue}if(d+=1,C===h)h=void 0;continue}if(C==="\\"){d+=Math.min(2,e.length-d);continue}if(C==='"'||C==="'"){h=C,d+=1;continue}if(C==="(")S+=1;else if(C===")"){if(S-=1,d+=1,S===0)break;continue}d+=1}return t+=e.slice(p,d),d},f=(p,m)=>{let d=p,S=0;while(d<e.length){let h=e[d];if(h==="\\"){d+=Math.min(2,e.length-d);continue}if(h==='"'||h==="'"){let C=h;d+=1;while(d<e.length){let x=e[d];if(x==="\\"){d+=Math.min(2,e.length-d);continue}if(d+=1,x===C)break}continue}if(h==="/"&&e[d+1]==="*"){let C=e.indexOf("*/",d+2);d=C===-1?e.length:C+2;continue}if(S===0){if(h===";"||h==="}")break;if(m&&h===")")break}if(h==="("||h==="["||h==="{")S+=1;else if(h===")"||h==="]"||h==="}")S=Math.max(0,S-1);d+=1}return d};while(r<e.length){let p=e[r];if(ke(p)){n=!0,r+=1;continue}if(p==="/"&&e[r+1]==="*"){let m=e.indexOf("*/",r+2),d=m===-1?e.length:m+2,S=e.slice(r,d);if(/^\/\*[!#@]/.test(S))l("/"),t+=S;else if(!n){let C=e[d];if(C!==void 0&&!ke(C)&&un(t[t.length-1],C))n=!0}r=d;continue}if(p==='"'||p==="'"){l(p),r=g(r),i=!1;continue}if(p==="-"&&e[r+1]==="-"&&s===0&&(i||t.endsWith("("))){let m=Ot(e,r),d=m;while(ke(e[d]))d+=1;if(e[d]===":"){let S=f(d+1,!i);n=!1,t+=e.slice(r,m)+":",t+=e.slice(d+1,S),r=S,i=!1;continue}}if(an(p)){let m=Ot(e,r),d=e.slice(r,m),S=e[m]==="(";if(S&&ln.test(d+"(")){l(d[0]),r=y(r,m),i=!1;continue}if(S&&cn.test(d+"(")){l("("),t+=d+"(",o.push(!0),a+=1,r=m+1,i=!1;continue}l(d[0]),t+=d,r=m,i=!1;continue}if(p==="{"){l(p),t+=p,i=!0,r+=1;continue}if(p==="}"){l(p),t+=p,i=!1,r+=1;continue}if(p===";"){l(p),t+=p,i=!0,r+=1;continue}if(p==="("){l(p),t+=p,o.push(!1),r+=1,i=!1;continue}if(p===")"){if(l(p),t+=p,o.pop())a-=1;r+=1,i=!1;continue}if(p==="[")s+=1;else if(p==="]")s=Math.max(0,s-1);l(p),t+=p,r+=1,i=!1}return t.trimEnd()};var mn=(e)=>{let t=Et(e),r=Et(t);if(r===t)throw Error(`save(): dir: "parent" cannot resolve for "${e}" because "${t}" is the filesystem root; pass an explicit dir instead.`);return{moduleDirectory:t,parentDirectory:r}},Bt=(e,t,r,n={})=>{let{dir:i,mapDir:s=[],mapName:o="index",minify:a=!0,shaker:l=[],include:g=[],name:y,mergeRoot:f=!1}=n,p=i==="parent"?mn(e.path):void 0,m=p&&n.mapDir===void 0?[p.moduleDirectory]:s,d=fn(r)?r:!!m,S=y??e.name,h=new ve(e,l,g,e.onDiagnostic,f).load(d,t),C=_t(i)?i:[p?p.parentDirectory:i],x=a?jt(h.css):h.css;C.forEach((b)=>{if(!b)return;let M=b.endsWith("/")?"":"/",j=`${b}${M}${S}.css`;ue(b+M),de(j),pn(j,x||"/* --------------*/")});let T=_t(m)?m:[m];for(let b of T){if(!b)continue;let M=b.endsWith("/")?"":"/",j=`${b}${M}${o}.js`;ue(b+M),de(j),kt(j,h.CID)}return e};var gn=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)&&(("light"in e)||("dark"in e)),Y,At;class J{static{Y=Be(void 0);Ie(Y,1,"med",At,this);ne(Y,this)}path=(De(Y,5,this),void 0);name;prefix;exportMap;onDiagnostic;mediaFeatures;options;_imported=new Set;save;constructor(e){this.options=e;let{__filename:t,name:r,prefix:n,shweets:i=[],exportMap:s,webkitKeyframes:o,mediaFeature:a={},unit:l="rem",onDiagnostic:g}=e;this.path=t,this.name=r||Dt(t),this.prefix=n??"",this.exportMap=s,this.onDiagnostic=g;let y=Sn(i)?i:[i];this.mediaFeatures=a;let f=ct(this.prefix,o,s,l,this.path);lt(f,y,this._imported),Object.assign(this,ut(f));let p=this;Object.assign(this,{get shweet(){return p}}),this.save=(m={})=>(Bt(this,this.mediaFeatures,s,m),this)}get imported(){return[...this._imported]}override(e={}){let t=[];for(let[n,i]of Object.entries(e)){if(i===void 0)continue;let s;if(gn(i))if(i.light!==void 0&&i.dark!==void 0)s=w({light:i.light,dark:i.dark});else if(i.light!==void 0)s=w({light:i.light});else if(i.dark!==void 0)s=w({dark:i.dark});else continue;else s=w(i,{light:i,dark:i});t.push(Se({[n]:s}))}let r=new J({__filename:this.path,prefix:this.prefix});if(t.length)r.d[":root"]=t;return new J({...this.options,shweets:[this,r]})}[(At=[Ke],"med")](e,t){if(t)return new V(e,t);if(typeof e==="object")return new V(void 0,e);return new V(e,{})}}function Dt(e){return e.split("/").slice(-1)[0].split(".")[0]}var hn=(e,t)=>{for(let[r,[n,i]]of Object.entries(t)){e[r]=n;for(let[s,o]of Object.entries(i)){let a=s.startsWith("$")?s.slice(1):`${r}_${s}`;e[a]=o}}},It=(e,t,r)=>{for(let[n,i]of Object.entries(t)){let s=Array.isArray(i)?i:[i],o=[];for(let l of s)if(l instanceof ee)l.$(n,e);else o.push(l);let a=r?`${r}_${n}`:n;e[a]=o}};class ee{__;merge;constructor(e,t=!1){this.__=e;this.merge=t}$(e,t){It(t,this.__,this.merge?e:void 0)}}var yn=(e)=>new ee(e),Cn=(e)=>new ee(e,!0);export{X as Medyas,J as Shweet,u as Value,Se as Var,tr as Vars,It as X,yn as XX,Cn as XY,hn as Z,fe as __,Ue as f,Dt as fileName,w as med,V as media,Ge as ps,lr as supports,or as v};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shweet",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.39",
|
|
4
4
|
"description": "TypeScript-first CSS authoring: Proxy-based class, id, and selector declarations compiled to CSS with prefixing, media/supports conditions, keyframes, export maps, and optional minification.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|