shweet 0.0.27 → 0.0.29
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 +14 -6
- package/dist/index.js +7 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -116,6 +116,7 @@ declare class __ {
|
|
|
116
116
|
};
|
|
117
117
|
static get is(): typeof is;
|
|
118
118
|
static get return(): typeof returner;
|
|
119
|
+
static isHREF(pt: string, hpt: string): boolean;
|
|
119
120
|
static sleep: (ms?: number) => Promise<unknown>;
|
|
120
121
|
static get screen(): "xs" | "sm" | "smd" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
121
122
|
bytes(bytes: number): string;
|
|
@@ -145,6 +146,7 @@ declare class _Var {
|
|
|
145
146
|
new(val: CSSValue, fallback?: CSSValue): _Var;
|
|
146
147
|
}
|
|
147
148
|
declare const Var: (vr: obj<CSSValue | media>, fallback?: CSSValue) => _Var;
|
|
149
|
+
declare const Vars: <T extends Record<string, CSSValue | media>>(vr: T) => { [K in keyof T]: _Var; };
|
|
148
150
|
|
|
149
151
|
type CSSValue = V | _Var | undefined | CSSValue[];
|
|
150
152
|
type VarType = _Var;
|
|
@@ -174,7 +176,7 @@ type CSSinR = {
|
|
|
174
176
|
[p: string]: CSSValue | media;
|
|
175
177
|
} | CSSinR[];
|
|
176
178
|
type atCSS = string;
|
|
177
|
-
type CSS = Record<string, CSSinR
|
|
179
|
+
type CSS = Record<string, CSSinR | Record<string, CSSinR>>;
|
|
178
180
|
type KFX = CSSinR | Medyas<any, {}>;
|
|
179
181
|
type KFCSS = obj<{
|
|
180
182
|
from?: KFX;
|
|
@@ -272,6 +274,7 @@ declare class Base<T = Record<string, any>> {
|
|
|
272
274
|
set(target: any, prop: string, val: any): boolean;
|
|
273
275
|
get css(): T;
|
|
274
276
|
load(css: Base): this;
|
|
277
|
+
__(f: CSS): void;
|
|
275
278
|
}
|
|
276
279
|
declare class FontFace extends Base<obj<fontFace>> {
|
|
277
280
|
constructor(prefix?: string);
|
|
@@ -725,6 +728,9 @@ interface shweetCFG {
|
|
|
725
728
|
webkitKeyframes?: boolean;
|
|
726
729
|
unit?: "rem" | "em" | "px" | "pt" | "pc";
|
|
727
730
|
}
|
|
731
|
+
type __CSS = CSS & {
|
|
732
|
+
__: (a: CSS) => void;
|
|
733
|
+
};
|
|
728
734
|
declare class Shweet {
|
|
729
735
|
[k: string]: any;
|
|
730
736
|
path: string;
|
|
@@ -732,10 +738,12 @@ declare class Shweet {
|
|
|
732
738
|
prefix: string;
|
|
733
739
|
exportMap?: boolean;
|
|
734
740
|
protected _imported: Set<string>;
|
|
735
|
-
d:
|
|
736
|
-
i:
|
|
737
|
-
c:
|
|
738
|
-
kf: KFCSS
|
|
741
|
+
d: __CSS;
|
|
742
|
+
i: __CSS;
|
|
743
|
+
c: __CSS;
|
|
744
|
+
kf: KFCSS & {
|
|
745
|
+
__: (a: KFCSS) => void;
|
|
746
|
+
};
|
|
739
747
|
at: {
|
|
740
748
|
import: atCSS;
|
|
741
749
|
charset: atCSS;
|
|
@@ -748,5 +756,5 @@ declare class Shweet {
|
|
|
748
756
|
}
|
|
749
757
|
declare function fileName(path: string): string;
|
|
750
758
|
|
|
751
|
-
export { Medyas, Shweet, Value, Var, __, f, fileName, log, med, media, ps, supports, v };
|
|
759
|
+
export { Medyas, Shweet, Value, Var, Vars, __, f, fileName, log, med, media, ps, supports, v };
|
|
752
760
|
export type { CSS, CSSValue, CSSinR, KFCSS, VarType, atCSS, fontFace };
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var An=Object.defineProperty;var Pn=(n,C)=>{for(var f in C)An(n,f,{get:C[f],enumerable:!0,configurable:!0,set:($)=>C[f]=()=>$})};var En={};Pn(En,{isWindow:()=>mn,isUndefined:()=>Tn,isStr:()=>g,isPromise:()=>zn,isPlainObject:()=>_n,isObject:()=>un,isObj:()=>y,isNumber:()=>_,isNum:()=>$n,isNull:()=>v,isNotWindow:()=>Sn,isNotNull:()=>dn,isModule:()=>yn,isInt:()=>Zn,isFN:()=>k,isDefined:()=>b,isClassOrId:()=>fn,isBool:()=>Rn,isAsync:()=>on,isArraybuff:()=>cn,isArr:()=>R});var k=(n)=>typeof n==="function",on=(n)=>n.constructor.name==="AsyncFunction",zn=(n)=>!!n&&typeof n.then==="function",_=(n)=>{return!isNaN(parseFloat(n))&&isFinite(n)},un=(n)=>{return n&&typeof n==="object"&&!Array.isArray(n)},_n=(n)=>{return typeof n==="object"&&n!==null&&Object.getPrototypeOf(n)===Object.prototype&&!Array.isArray(n)},yn=(n)=>{return n&&typeof n==="object"&&n[Symbol.toStringTag]==="Module"},cn=(n)=>{return n instanceof Uint8Array||n instanceof ArrayBuffer||typeof n==="string"},fn=(n)=>{return n.startsWith(".")||n.startsWith("#")},Rn=(n)=>typeof n==="boolean",g=(n)=>typeof n==="string",R=(n)=>Array.isArray(n),y=(n)=>typeof n==="object",$n=(n)=>typeof n==="number",v=(n)=>n===null,dn=(n)=>n===null,Tn=(n)=>typeof n==="undefined",b=(n)=>typeof n!=="undefined",Zn=(n)=>{return Number.isInteger(Number(n))},mn=typeof window!=="undefined",Sn=typeof window==="undefined";var Qn=(n)=>{return R(n)?n:[n]};class c{static set i(n){console.info(...Qn(n))}static set e(n){console.error(...Qn(n))}static set w(n){console.warn(...Qn(n))}}var ln=(n)=>Array.from({length:n},(C,f)=>f),Dn="ABCDEFGHIJKLMNOPQRSTUVWXYZ",On="abcdefghijklmnopqrstuvwxyz";var p=(n)=>JSON.stringify(n),Jn=(n)=>{return JSON.parse(n)},Bn=(n)=>{return n.replace(/-([a-z])/g,(C,f)=>f.toUpperCase())},K=(n)=>{if(n.startsWith("webkit"))n="-"+n;return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},x=(n)=>{let C=Dn+On,f=ln(10).join("");return Array.from({length:n},($,T)=>C+(T?f:"")).reduce(($,T)=>{return $+=T.charAt(Math.floor(Math.random()*T.length))},"")},rn=(n=6,C)=>{if(!C)return Math.floor(Math.random()*n);return Math.round(Math.random()*(C-n)+n)},Hn=()=>{let n=[...Dn,...On],C=rn(0,n.length);return n[C]};class D extends Map{obj(n){n&&G(n).forEach(([C,f])=>this.set(C,f))}map(n){n.forEach((C,f)=>{if(C instanceof D)this.set(f,C);else if(R(C)){if(this.lacks(f))this.set(f,[]);this.get(f).push(...C)}else if(y(C))this.ass(f,C);else this.set(f,C)})}ass(n,C){if(!this.has(n))this.set(n,{});X(this.get(n),C)}lacks(n){return!this.has(n)}init(n,C){return this.has(n)?this.get(n):this.set(n,C).get(n)}}var{values:V,keys:w,entries:G}=Object;var X=Object.assign,Nn=(n,C)=>Object.hasOwn(n,C),Fn=(n)=>{return Object.keys(n).length};class qn{static rand(n=6,C){if(C)return Math.floor(Math.random()*(C-n+1)+n);return Math.floor(Math.random()*n)+1-1}static fill(n,C=null){return Array(n).fill(C)}static new({dom:n,id:C,inner:f}){let $=document.createElement(n);if(C)$.id=C;if(f)$.innerHTML=f;return $}static randFrom(n){if(Array.isArray(n)){let C=n.length,f=this.rand(0,C-1);return n[f]}else if(typeof n=="object"){let C=w(n),f=C.length,$=this.rand(0,f-1);return C[$]}}static randArray(n=[],C=1,f=!1){let $=[],T=f?new Set:null;while((f?T.size:$.length)<C){let E=n[qn.rand(0,n.length-1)];f?T.add(E):$.push(E)}return f?[...T]:$}static randomAZ=Hn;static makeID=x;static class(n,...C){let f=C;if(n?.class)f.push(...R(n.class)?n.class:[n.class]);n.class=C}static get O(){return{vals:V,keys:w,items:G,has:Nn,ass:X,len:(n={})=>w(n).length}}static get is(){return En}static get return(){return Xn}static sleep=(n=1000)=>new Promise((C)=>setTimeout(C,n));static get screen(){let{innerWidth:n}=window,C={xs:n<=480,sm:n>=480,smd:n>=624,md:n>=768,lg:n>=1024,xl:n>=1280,xxl:n>=1536},f=G(C).reverse();for(let $=0;$<f.length;$++){let[T,E]=f[$];if(E)return T}return}bytes(n){if(n===0)return"0 Bytes";let C=1024,f=["Bytes","KB","MB","GB"],$=Math.floor(Math.log(n)/Math.log(C));return parseFloat((n/Math.pow(C,$)).toFixed(2))+" "+f[$]}static format(n){return new Yn(n)}}class Xn{static arr(n){return n?R(n)?n:[n]:[]}static num(n,C=0){let f=parseFloat(n);return isNaN(f)?C:f}static str(n){return String(n)}static arr2obj(n,C=!1){return n.reduce((f,$,T)=>{if(C)f[$]=T;else f[T]=$;return f},{})}}class Yn{val;constructor(n){this.val=n}get px(){return`${this.val}px`}get rem(){return`${this.val}rem`}get pr(){return`${this.val}%`}}var bn={xs:"480px",sm:"480px",smd:"624px",md:"768px",lg:"1024px",xl:"1280px",xxl:"1536px"};class F{static default="xs";static prop=G(bn).reduce((n,[C,f],$)=>{return n[C]=`(${$==0?"max-width":"min-width"}: ${f})`,n},{});static extra={no_hover:"(pointer: coarse)",mobile:"(pointer: coarse)",print:"print",screen:"screen",dark:"(prefers-color-scheme: dark)"};constructor(n,C={}){let f=F.default,$={};if(n!==void 0)P($,f,n,f);G(C).forEach(([T,E])=>{P($,T,E,f)}),X(this,$)}static get breakpoints(){return Jn(p(bn))}}var P=(n,C,f,$)=>{if(f!==void 0)if(f instanceof F)G(f).forEach(([T,E])=>{if($!==C)if(C!==T)if($===T)P(n,C,E,$);else P(n,`${C}-${T}`,E,$);else P(n,T,E,$);else P(n,T,E,$)});else n[C]=f};function j(n,C){if(C)return new F(n,C);return new F(void 0,n)}function pn(n){if(this._prefix)return j({[this._prefix]:n});else return j({xs:n})}function Y(n){return new this.constructor({prefix:n,values:this._values,data:this.data})}class a{_prefix;data;_values;constructor({prefix:n,data:C,values:f}={data:{},values:{}}){this._prefix=n,this._values=f,G(f).forEach(([$,T])=>{if(!this._values[$])this._values[$]=j({});X(this._values[$],T)}),this.data=C}get XS(){return Y.call(this,"xs")}get SM(){return Y.call(this,"sm")}get SMD(){return Y.call(this,"smd")}get MD(){return Y.call(this,"md")}get LG(){return Y.call(this,"lg")}get XL(){return Y.call(this,"xl")}get XXL(){return Y.call(this,"xxl")}get NO_HOVER(){return Y.call(this,"no_hover")}get MOBILE(){return Y.call(this,"no_hover")}get PRINT(){return Y.call(this,"print")}get SCREEN(){return Y.call(this,"screen")}get DARK(){return Y.call(this,"dark")}set _value(n){G(n).forEach(([C,f])=>{if(!this._values[C])this._values[C]=j({});X(this._values[C],pn.call(this,f))})}get _value(){return this._values}}class I{k="";fallback;var="";value;constructor(n={},C){if(Fn(n)){let[f,$]=G(n)[0];this.k=f,this.var="--"+K(f),this.value=$ instanceof F?$:j($,{}),this.fallback=C}else this.value=j({})}__(n){if(n)this.fallback=n;let C=this.fallback;if(C)return`var(${this.var}, ${Q(C)})`;else return`var(${this.var})`}new(n,C){return new I({[this.k]:n instanceof F?n:Q(n)},C)}}var an=(n,C)=>{return new I(n,C)};var Q=(n,C={unit:"rem"})=>{let{rem:f,second:$,quote:T,degree:E,percent:J,delimeter:t,unit:W,delimeter_arr:L}=C;if(Tn(n)||v(n)||!T&&n==="")return"";let q=R(n)?n:[n];if(!q.length)return"";return q.filter((U)=>b(U)).map((U)=>{if(R(U))return t=L||", ",Q(U,{...C,delimeter:" "});if(U instanceof I)return U.__();if(T)U=String(U);if($n(U))if(f)return`${U}${W?W:"rem"}`;else if(E)return`${U}deg`;else if(J)return`${U}%`;else if($)return`${U}s`;else return String(U);if(g(U))if(U.includes("("))return U;else if(T)return`'${U}'`;else return U;return""}).filter((U)=>b(U)&&U!=="").join(t||" ")};var jn=new Set(["transitionDuration","transitionDelay","animationDelay","animationDuration"]),sn=new Set([...jn,"zIndex","opacity","aspectRatio","order","flexShrink","flexGrow","flex","fillOpacity","lineClamp","order","scale","webkitLineClamp","animationIterationCount","animationTimingFunction","transitionTimingFunction","columnCount","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd"]),en=new Set(["content"]),nC=new Set(["transitionProperty"]),i=(n,C,f="rem")=>{let $=Q(C,{rem:!sn.has(n),second:jn.has(n),quote:en.has(n),delimeter:nC.has(n)?", ":" ",unit:f});return`${K(n)}: ${$};`};class s{value;__;constructor(n){if(this.value=new D,g(n))this.value.set(n,[]);else G(n).forEach(([C,f])=>{this.value.set(`${C}:${f}`,[])});this.__=(...C)=>{return this.value.forEach((f)=>{f.push(...C)}),this}}}function CC(n){return new s(n).__}var o=(n)=>{if(k(n))return o(n());if(n instanceof F)return n;if(n instanceof I)return j(n.__(),{});return j(n,{})};function fC(n){let C={};return n.split(";").map((f)=>f.trim()).filter((f)=>f!=="").forEach((f)=>{let[$,T]=f.split(":").map((J)=>J.trim()),E=Bn($);if(!isNaN(Number(T))&&isFinite(Number(T)))C[E]=Number(T);else C[E]=T}),C}var $C=(n)=>{n.value.forEach((C,f)=>{n.value.set(f,C.map(($)=>{let T={};return G($).forEach(([E,J])=>{if(b(J))T[E]=o(J)}),T}))})},Gn=(n,C=[])=>{let f=[];if(R(n))return Gn(n[0],f);if(n instanceof I)return Gn(V(n.value),f);return f.push(String(n)),f};class Un{base;constructor(n){this.base=n}props(n,C,f){let $=["animation","animationName"].includes(C);return G(f).forEach(([T,E])=>{if($)f[T]=this.addPrefixToAnimation(n,E);else f[T]=E}),f}addPrefixToAnimation(n,C){if(C instanceof I)this.saveAnim(n,C);else if(R(C))return C[0]=this.addPrefixToAnimation(n,C[0]),C;else if(g(C)&&!C.includes("("))return C.split(", ").map((T)=>{let E=T.split(" "),J=E[0],t=E.slice(1).join(" "),W=`${this.base.PREFIX}${J}`;return this.base.ANIM.init(W,new Set).add(n),`${this.base.PREFIX}${J} ${t}`.trim()}).join(", ");return C}saveAnim(n,C){Gn(C).forEach((f)=>{this.base.ANIM.init(`${this.base.PREFIX}${f}`,new Set).add(n)})}process(n,C,f,$,T){if(f instanceof I)this.saveAnim(n,f),$.ass(C,this.props(n,f.var,o(f)));else if(C.startsWith(":")||C.startsWith(",")||C.startsWith("[")){if(C.startsWith("::before")||C.startsWith("::after")){if(R(f)){if(!f.some((J)=>("content"in J)))f.push({content:""})}}this.set(n+C,f,T)}else if(C.startsWith(" ")){let J=C.match(/^.*?\w/gm)?.[0].slice(0,-1),t=C.replaceAll(/, /gm,`, ${n}${J}`);this.set(n+t,f,T)}else if(fn(C))this.set(n+C,f,T);else $.set(C,this.props(n,C,o(f)))}set(n,C,f){if(!y(C)&&!g(C))return;let $=new D;if(C instanceof I)this.saveAnim(n,C),$.ass(C.var,this.props(n,C.var,o(C.value)));else if(C instanceof a)G(C._value).forEach(([E,J])=>{if(b(J))$.set(E,this.props(n,E,o(J)))});else if(C instanceof s)$C(C),$.init("supports",[]).push(C);else if(R(C))C.forEach((E)=>{this.set(n,E,f)});else if(g(C)){let E=fC(C);this.set(n,E,f)}else G(C).forEach(([E,J])=>{return this.process(n,E,J,$,f)});let T=f.init(n,new D);$.forEach((E,J)=>{if(J==="supports")f.init(n,new D).init(J,[])?.push(...E);else T.set(J,E)})}}class d{PRE;EXPORT;UNIT;PS;PREFIX;ARR=new D;CID=new D;DATA=new D;ANIM=new D;IMPORTED=[];constructor(n="",C="",f,$){this.PRE=n;this.EXPORT=f;this.UNIT=$;this.PREFIX=C?C+"_":C,this.PS=new Un(this)}get(n,C,f){let $=n.PRE+C;if(n.DATA.has($))return $;else if(C in n)return n[C];else return n.PRE+C}set(n,C,f){return!1}get css(){return new Proxy(this,this)}load(n){return this.IMPORTED.push(n),this}}class A extends d{set(n,C,f){let $=n.PRE+C;return n.PS.set($,f,n.DATA),!0}}class m extends d{webkit;constructor(n="",C=!0,f){super("",n,!1,f);this.webkit=C}set(n,C,f){let $=n.PREFIX+C,T=R(f)?f:[f],E=new D;if(T.forEach((J)=>{G(J).forEach(([t,W])=>{let L=_(t)?`${t}%`:t;n.PS.set(L,W,E)})}),n.ANIM.init($,new Set),n.DATA.set(`@keyframes ${$}`,E),this.webkit)n.DATA.set(`@-webkit-keyframes ${$}`,E);return!0}}class l extends d{constructor(n=""){super("@",n)}set(n,C,f){return n.ARR.init(n.PRE+C,new Set).add(f),n}}class r extends d{constructor(n=""){super("@font-face",n);this.ARR.set(this.PRE,new Set)}set(n,C,f){let $=G({fontFamily:C,...f}).map(([T,E])=>{return i(T,E,this.UNIT)});return n.ARR.get(n.PRE)?.add($.join(`
|
|
3
|
-
`)),!0}}var
|
|
4
|
-
`));else{let
|
|
2
|
+
var An=Object.defineProperty;var Pn=(n,C)=>{for(var f in C)An(n,f,{get:C[f],enumerable:!0,configurable:!0,set:($)=>C[f]=()=>$})};var Sn={};Pn(Sn,{isWindow:()=>rn,isUndefined:()=>Tn,isStr:()=>M,isPromise:()=>un,isPlainObject:()=>_n,isObject:()=>zn,isObj:()=>y,isNumber:()=>_,isNum:()=>$n,isNull:()=>v,isNotWindow:()=>tn,isNotNull:()=>dn,isModule:()=>yn,isInt:()=>Zn,isFN:()=>k,isDefined:()=>g,isClassOrId:()=>fn,isBool:()=>Ln,isAsync:()=>on,isArraybuff:()=>cn,isArr:()=>L});var k=(n)=>typeof n==="function",on=(n)=>n.constructor.name==="AsyncFunction",un=(n)=>!!n&&typeof n.then==="function",_=(n)=>{return!isNaN(parseFloat(n))&&isFinite(n)},zn=(n)=>{return n&&typeof n==="object"&&!Array.isArray(n)},_n=(n)=>{return typeof n==="object"&&n!==null&&Object.getPrototypeOf(n)===Object.prototype&&!Array.isArray(n)},yn=(n)=>{return n&&typeof n==="object"&&n[Symbol.toStringTag]==="Module"},cn=(n)=>{return n instanceof Uint8Array||n instanceof ArrayBuffer||typeof n==="string"},fn=(n)=>{return n.startsWith(".")||n.startsWith("#")},Ln=(n)=>typeof n==="boolean",M=(n)=>typeof n==="string",L=(n)=>Array.isArray(n),y=(n)=>typeof n==="object",$n=(n)=>typeof n==="number",v=(n)=>n===null,dn=(n)=>n===null,Tn=(n)=>typeof n==="undefined",g=(n)=>typeof n!=="undefined",Zn=(n)=>{return Number.isInteger(Number(n))},rn=typeof window!=="undefined",tn=typeof window==="undefined";var En=(n)=>{return L(n)?n:[n]};class c{static set i(n){console.info(...En(n))}static set e(n){console.error(...En(n))}static set w(n){console.warn(...En(n))}}var ln=(n)=>Array.from({length:n},(C,f)=>f),Bn="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Dn="abcdefghijklmnopqrstuvwxyz";var p=(n)=>JSON.stringify(n),Qn=(n)=>{return JSON.parse(n)},On=(n)=>{return n.replace(/-([a-z])/g,(C,f)=>f.toUpperCase())},K=(n)=>{if(n.startsWith("webkit"))n="-"+n;return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},x=(n)=>{let C=Bn+Dn,f=ln(10).join("");return Array.from({length:n},($,T)=>C+(T?f:"")).reduce(($,T)=>{return $+=T.charAt(Math.floor(Math.random()*T.length))},"")},mn=(n=6,C)=>{if(!C)return Math.floor(Math.random()*n);return Math.round(Math.random()*(C-n)+n)},Hn=()=>{let n=[...Bn,...Dn],C=mn(0,n.length);return n[C]};class B extends Map{obj(n){n&&q(n).forEach(([C,f])=>this.set(C,f))}map(n){n.forEach((C,f)=>{if(C instanceof B)this.set(f,C);else if(L(C)){if(this.lacks(f))this.set(f,[]);this.get(f).push(...C)}else if(y(C))this.ass(f,C);else this.set(f,C)})}ass(n,C){if(!this.has(n))this.set(n,{});X(this.get(n),C)}lacks(n){return!this.has(n)}init(n,C){return this.has(n)?this.get(n):this.set(n,C).get(n)}}var{values:V,keys:w,entries:q}=Object;var X=Object.assign,Fn=(n,C)=>Object.hasOwn(n,C),Nn=(n)=>{return Object.keys(n).length};class Jn{static rand(n=6,C){if(C)return Math.floor(Math.random()*(C-n+1)+n);return Math.floor(Math.random()*n)+1-1}static fill(n,C=null){return Array(n).fill(C)}static new({dom:n,id:C,inner:f}){let $=document.createElement(n);if(C)$.id=C;if(f)$.innerHTML=f;return $}static randFrom(n){if(Array.isArray(n)){let C=n.length,f=this.rand(0,C-1);return n[f]}else if(typeof n=="object"){let C=w(n),f=C.length,$=this.rand(0,f-1);return C[$]}}static randArray(n=[],C=1,f=!1){let $=[],T=f?new Set:null;while((f?T.size:$.length)<C){let S=n[Jn.rand(0,n.length-1)];f?T.add(S):$.push(S)}return f?[...T]:$}static randomAZ=Hn;static makeID=x;static class(n,...C){let f=C.filter(Boolean);if(n?.class)f.push(...L(n.class)?n.class:[n.class]);if(f.length)n.class=C}static get O(){return{vals:V,keys:w,items:q,has:Fn,ass:X,len:(n={})=>w(n).length}}static get is(){return Sn}static get return(){return Xn}static isHREF(n,C){return n===C?!0:n.startsWith(C)&&C!=="/"?!0:!1}static sleep=(n=1000)=>new Promise((C)=>setTimeout(C,n));static get screen(){let{innerWidth:n}=window,C={xs:n<=480,sm:n>=480,smd:n>=624,md:n>=768,lg:n>=1024,xl:n>=1280,xxl:n>=1536},f=q(C).reverse();for(let $=0;$<f.length;$++){let[T,S]=f[$];if(S)return T}return}bytes(n){if(n===0)return"0 Bytes";let C=1024,f=["Bytes","KB","MB","GB"],$=Math.floor(Math.log(n)/Math.log(C));return parseFloat((n/Math.pow(C,$)).toFixed(2))+" "+f[$]}static format(n){return new Yn(n)}}class Xn{static arr(n){return n?L(n)?n:[n]:[]}static num(n,C=0){let f=parseFloat(n);return isNaN(f)?C:f}static str(n){return String(n)}static arr2obj(n,C=!1){return n.reduce((f,$,T)=>{if(C)f[$]=T;else f[T]=$;return f},{})}}class Yn{val;constructor(n){this.val=n}get px(){return`${this.val}px`}get rem(){return`${this.val}rem`}get pr(){return`${this.val}%`}}var bn={xs:"480px",sm:"480px",smd:"624px",md:"768px",lg:"1024px",xl:"1280px",xxl:"1536px"};class N{static default="xs";static prop=q(bn).reduce((n,[C,f],$)=>{return n[C]=`(${$==0?"max-width":"min-width"}: ${f})`,n},{});static extra={no_hover:"(pointer: coarse)",mobile:"(pointer: coarse)",print:"print",screen:"screen",dark:"(prefers-color-scheme: dark)"};constructor(n,C={}){let f=N.default,$={};if(n!==void 0)A($,f,n,f);q(C).forEach(([T,S])=>{A($,T,S,f)}),X(this,$)}static get breakpoints(){return Qn(p(bn))}}var A=(n,C,f,$)=>{if(f!==void 0)if(f instanceof N)q(f).forEach(([T,S])=>{if($!==C)if(C!==T)if($===T)A(n,C,S,$);else A(n,`${C}-${T}`,S,$);else A(n,T,S,$);else A(n,T,S,$)});else n[C]=f};function j(n,C){if(C)return new N(n,C);return new N(void 0,n)}function pn(n){if(this._prefix)return j({[this._prefix]:n});else return j({xs:n})}function Y(n){return new this.constructor({prefix:n,values:this._values,data:this.data})}class a{_prefix;data;_values;constructor({prefix:n,data:C,values:f}={data:{},values:{}}){this._prefix=n,this._values=f,q(f).forEach(([$,T])=>{if(!this._values[$])this._values[$]=j({});X(this._values[$],T)}),this.data=C}get XS(){return Y.call(this,"xs")}get SM(){return Y.call(this,"sm")}get SMD(){return Y.call(this,"smd")}get MD(){return Y.call(this,"md")}get LG(){return Y.call(this,"lg")}get XL(){return Y.call(this,"xl")}get XXL(){return Y.call(this,"xxl")}get NO_HOVER(){return Y.call(this,"no_hover")}get MOBILE(){return Y.call(this,"no_hover")}get PRINT(){return Y.call(this,"print")}get SCREEN(){return Y.call(this,"screen")}get DARK(){return Y.call(this,"dark")}set _value(n){q(n).forEach(([C,f])=>{if(!this._values[C])this._values[C]=j({});X(this._values[C],pn.call(this,f))})}get _value(){return this._values}}class b{k="";fallback;var="";value;constructor(n={},C){if(Nn(n)){let[f,$]=q(n)[0];this.k=f,this.var="--"+K(f),this.value=$ instanceof N?$:j($,{}),this.fallback=C}else this.value=j({})}__(n){if(n)this.fallback=n;let C=this.fallback;if(C)return`var(${this.var}, ${E(C)})`;else return`var(${this.var})`}new(n,C){return new b({[this.k]:n instanceof N?n:E(n)},C)}}var an=(n,C)=>{return new b(n,C)},sn=(n)=>{let C={};for(let f in n)C[f]=new b({[f]:n[f]});return C};var E=(n,C={unit:"rem"})=>{let{rem:f,second:$,quote:T,degree:S,percent:Q,delimeter:U,unit:R,delimeter_arr:W}=C;if(Tn(n)||v(n)||!T&&n==="")return"";let J=L(n)?n:[n];if(!J.length)return"";return J.filter((G)=>g(G)).map((G)=>{if(L(G))return U=W||", ",E(G,{...C,delimeter:" "});if(G instanceof b)return G.__();if(T)G=String(G);if($n(G))if(f)return`${G}${R?R:"rem"}`;else if(S)return`${G}deg`;else if(Q)return`${G}%`;else if($)return`${G}s`;else return String(G);if(M(G))if(G.includes("("))return G;else if(T)return`'${G}'`;else return G;return""}).filter((G)=>g(G)&&G!=="").join(U||" ")};var gn=new Set(["transitionDuration","transitionDelay","animationDelay","animationDuration"]),en=new Set([...gn,"zIndex","opacity","aspectRatio","order","flexShrink","flexGrow","flex","fillOpacity","lineClamp","order","scale","webkitLineClamp","animationIterationCount","animationTimingFunction","transitionTimingFunction","columnCount","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd"]),nC=new Set(["content"]),CC=new Set(["transitionProperty"]),P=(n,C,f="rem")=>{let $=E(C,{rem:!en.has(n),second:gn.has(n),quote:nC.has(n),delimeter:CC.has(n)?", ":" ",unit:f});return`${K(n)}: ${$};`};class s{value;__;constructor(n){if(this.value=new B,M(n))this.value.set(n,[]);else q(n).forEach(([C,f])=>{this.value.set(`${C}:${f}`,[])});this.__=(...C)=>{return this.value.forEach((f)=>{f.push(...C)}),this}}}function fC(n){return new s(n).__}var o=(n)=>{if(k(n))return o(n());if(n instanceof N)return n;if(n instanceof b)return j(n.__(),{});return j(n,{})};function $C(n){let C={};return n.split(";").map((f)=>f.trim()).filter((f)=>f!=="").forEach((f)=>{let[$,T]=f.split(":").map((Q)=>Q.trim()),S=On($);if(!isNaN(Number(T))&&isFinite(Number(T)))C[S]=Number(T);else C[S]=T}),C}var TC=(n)=>{n.value.forEach((C,f)=>{n.value.set(f,C.map(($)=>{let T={};return q($).forEach(([S,Q])=>{if(g(Q))T[S]=o(Q)}),T}))})},qn=(n,C=[])=>{let f=[];if(L(n))return qn(n[0],f);if(n instanceof b)return qn(V(n.value),f);return f.push(String(n)),f};class Gn{base;constructor(n){this.base=n}props(n,C,f){let $=["animation","animationName"].includes(C);return q(f).forEach(([T,S])=>{if($)f[T]=this.addPrefixToAnimation(n,S);else f[T]=S}),f}addPrefixToAnimation(n,C){if(C instanceof b)this.saveAnim(n,C);else if(L(C))return C[0]=this.addPrefixToAnimation(n,C[0]),C;else if(M(C)&&!C.includes("("))return C.split(", ").map((T)=>{let S=T.split(" "),Q=S[0],U=S.slice(1).join(" "),R=`${this.base.PREFIX}${Q}`;return this.base.ANIM.init(R,new Set).add(n),`${this.base.PREFIX}${Q} ${U}`.trim()}).join(", ");return C}saveAnim(n,C){qn(C).forEach((f)=>{this.base.ANIM.init(`${this.base.PREFIX}${f}`,new Set).add(n)})}process(n,C,f,$,T){if(f instanceof b)this.saveAnim(n,f),$.ass(C,this.props(n,f.var,o(f)));else if(C.startsWith(":")||C.startsWith(",")||C.startsWith("[")){if(C.startsWith("::before")||C.startsWith("::after")){if(L(f)){if(!f.some((Q)=>("content"in Q)))f.push({content:""})}}this.set(n+C,f,T)}else if(C.startsWith(" ")){let Q=C.match(/^.*?\w/gm)?.[0].slice(0,-1),U=C.replaceAll(/, /gm,`, ${n}${Q}`);this.set(n+U,f,T)}else if(fn(C))this.set(n+C,f,T);else $.set(C,this.props(n,C,o(f)))}set(n,C,f){if(!y(C)&&!M(C))return;let $=new B;if(C instanceof b)this.saveAnim(n,C),$.ass(C.var,this.props(n,C.var,o(C.value)));else if(C instanceof a)q(C._value).forEach(([S,Q])=>{if(g(Q))$.set(S,this.props(n,S,o(Q)))});else if(C instanceof s)TC(C),$.init("supports",[]).push(C);else if(L(C))C.forEach((S)=>{this.set(n,S,f)});else if(M(C)){let S=$C(C);this.set(n,S,f)}else q(C).forEach(([S,Q])=>{return this.process(n,S,Q,$,f)});let T=f.init(n,new B);$.forEach((S,Q)=>{if(Q==="supports")f.init(n,new B).init(Q,[])?.push(...S);else T.set(Q,S)})}}class d{PRE;EXPORT;UNIT;PS;PREFIX;ARR=new B;CID=new B;DATA=new B;ANIM=new B;IMPORTED=[];constructor(n="",C="",f,$){this.PRE=n;this.EXPORT=f;this.UNIT=$;this.PREFIX=C?C+"_":C,this.PS=new Gn(this)}get(n,C,f){let $=n.PRE+C;if(n.DATA.has($))return $;else if(C in n)return n[C];else return n.PRE+C}set(n,C,f){return!1}get css(){return new Proxy(this,this)}load(n){return this.IMPORTED.push(n),this}__(n){Object.entries(n).forEach(([C,f])=>{this.set(this,C,f)})}}class i extends d{set(n,C,f){let $=n.PRE+C;return n.PS.set($,f,n.DATA),!0}}class r extends d{webkit;constructor(n="",C=!0,f){super("",n,!1,f);this.webkit=C}set(n,C,f){let $=n.PREFIX+C,T=L(f)?f:[f],S=new B;if(T.forEach((Q)=>{q(Q).forEach(([U,R])=>{let W=_(U)?`${U}%`:U;n.PS.set(W,R,S)})}),n.ANIM.init($,new Set),n.DATA.set(`@keyframes ${$}`,S),this.webkit)n.DATA.set(`@-webkit-keyframes ${$}`,S);return!0}}class l extends d{constructor(n=""){super("@",n)}set(n,C,f){return n.ARR.init(n.PRE+C,new Set).add(f),n}}class m extends d{constructor(n=""){super("@font-face",n);this.ARR.set(this.PRE,new Set)}set(n,C,f){let $=q({fontFamily:C,...f}).map(([T,S])=>{return P(T,S,this.UNIT)});return n.ARR.get(n.PRE)?.add($.join(`
|
|
3
|
+
`)),!0}}var jn=Array.from;class Rn{shweet;shaker;include;CID=new B;css="";constructor(n,C=[],f=[]){this.shweet=n;this.shaker=C;this.include=f}load(n){let C=N.default,f=N.prop;X(f,N.extra);let $=new B,T={},S={},Q={},U=new Set,R={},W={};w(f).forEach((J)=>{R[J]={}});for(let J of V(this.shweet))if(J instanceof i)this.ClassID(J,T,S,n),J.ANIM.forEach((G,Z)=>{G.forEach((O)=>{$.init(Z,new Set).add(O)})});else if(J instanceof r)this.KF(J,Q,$);else if(J instanceof l)this.AT(J,U);else if(J instanceof m)this.FONT(J,U);return q(T).forEach(([J,G])=>{if(!R[J])R[J]={};q(G).forEach(([Z,O])=>{let D=O.join(", ");if(!R[J][D])R[J][D]=[];R[J][D].push(Z)})}),q(S).forEach(([J,G])=>{q(G).forEach(([Z,O])=>{if(!W[Z])W[Z]={};q(O).forEach(([D,H])=>{let F=`@supports(${J})`;if(!W[Z][F])W[Z][F]={};let I=H.join(", ");if(!W[Z][F][I])W[Z][F][I]=new Set;W[Z][F][I].add(D)})})}),q(R).forEach(([J,G])=>{let Z=[],O=[];if(q(G).forEach(([D,H])=>{if(H.some((I)=>{return I.startsWith("animation")||I.startsWith("transition")}))O.push(u(D,H));else Z.push(u(D,H))}),O.length)Z.unshift(...O);if(Q[J])q(Q[J]).forEach(([D,H])=>{Z.push(u(D,H))});if(W[J])q(W[J]).forEach(([D,H])=>{let F=q(H).map(([I,Cn])=>{return u(I,[...Cn])});Z.push(u(D,F))});if(Z.length)if(U.add(`/* -------------- ${J+(J===C?" ( default )":"")} */`),J===C)U.add(Z.join(`
|
|
4
|
+
`));else{let D=J.split("-").map((H)=>f[H]).join(" and ");U.add(`@media ${D} {
|
|
5
5
|
${Z.join(`
|
|
6
6
|
`)}
|
|
7
|
-
}`)}}),this.css=[...
|
|
8
|
-
`),this}ClassID(n,C,f,$){let T=(
|
|
7
|
+
}`)}}),this.css=[...U].join(`
|
|
8
|
+
`),this}ClassID(n,C,f,$){let T=(S,Q,U,R,W)=>{q(Q).forEach(([J,G])=>{this.push(W,U,J,R,P(S,G,n.UNIT))})};n.DATA.forEach((S,Q)=>{let U=SC(Q,n.PREFIX),R=this.getCID(Q,n.PREFIX,$);S.forEach((W,J)=>{if(J==="supports"){if(L(W))W.forEach((G)=>{G.value.forEach((Z,O)=>{if(!(O in f))f[O]={};Z.forEach((D)=>{q(D).forEach(([H,F])=>{T(H,F,U,R,f[O])})})})})}else T(J,W,U,R,C)})}),n.IMPORTED.forEach((S)=>{this.ClassID(S,C,f,S.EXPORT)})}KF(n,C,f){let $=(T,S,Q)=>{In(C,T,S),C[T][S].push(Q)};n.DATA.forEach((T,S)=>{T.forEach((Q,U)=>{let R={};Q.forEach((W,J)=>{if(J==="supports")c.e=["@supports not supported in @keyframes",{error:"support in keyframes"}];else q(W).forEach(([G,Z])=>{if(this.shaker.length){let O=S.split(" ")[1];if(f.has(O)){if([...f.get(O)].some((F)=>{return this.getCID(F,"",!1,!1)})){if(!(G in R))R[G]=[];R[G].push(P(J,Z,n.UNIT))}}}else{if(!(G in R))R[G]=[];R[G].push(P(J,Z,n.UNIT))}})}),q(R).forEach(([W,J])=>{$(W,S,u(U,J))})})}),n.IMPORTED.forEach((T)=>{this.KF(T,C,f)})}AT(n,C){for(let[f,$]of n.ARR)$.forEach((T)=>{let S=T.includes("(")?T:`"${T}"`;C.add(`${f} ${S.trim()};`)});n.IMPORTED.forEach((f)=>{this.AT(f,C)})}FONT(n,C){(n.ARR.get("@font-face")??new Set).forEach((T)=>{C.add(`@font-face {
|
|
9
9
|
${T}
|
|
10
|
-
}`)}),n.IMPORTED.forEach((T)=>{this.FONT(T,C)})}getCID(n,C,f,$=!0){let T=/\.(?![0-9])([a-zA-Z0-9_-]+)(?![^{]*})/g,
|
|
10
|
+
}`)}),n.IMPORTED.forEach((T)=>{this.FONT(T,C)})}getCID(n,C,f,$=!0){let T=/\.(?![0-9])([a-zA-Z0-9_-]+)(?![^{]*})/g,S=/#(?![0-9])([a-zA-Z0-9_-]+)(?![^{]*})/g,Q=/\b([a-zA-Z][a-zA-Z0-9]*)\b(?![^{}]*})/g,U=[...new Set(Un(n,T)),...new Set(Un(n,S))];if($&&g(f)&&f)U.forEach((R)=>{this.CID.init(R.replaceAll("-","_"),new Set).add(C+R)});return U.push(...new Set(Un(n,Q))),U.some((R)=>this.shaker.includes(R)||this.include.includes(R))}push(n,C,f,$,T){if(!(this.shaker.length&&C.startsWith(".")||this.shaker.length&&C.startsWith("#"))||$)In(n,f,T),tC(n,f,T,C)}}var u=(n,C)=>{return`${n} {
|
|
11
11
|
${C.join(`
|
|
12
12
|
`)}
|
|
13
|
-
}`},tn=(n,C)=>{return In(n.matchAll(C),(f)=>f[1])},Mn=(n,C,f)=>{try{if(!n[C])n[C]={},n[C][f]=[];if(!n[C][f])n[C][f]=[]}catch($){c.e=[`property "${C}" not found!`,{error:"@ensurePropsInitialized"}]}},TC=(n,C,f,$)=>{if(!n[C])n[C]={[f]:$.split(",").map((T)=>T.trim())};else n[C][f].push(...$.split(",").map((T)=>T.trim()))},SC=(n,C)=>{if(C)return n.replaceAll(/\.|\#/g,(f)=>f+C);return n};import{mkdirSync as EC,writeFileSync as QC,existsSync as gn}from"fs";var e=(n,C="")=>{if(gn(n))return!0;return QC(n,C,{flag:"wx"}),!0},nn=(n)=>{if(gn(n))return!0;return EC(n,{recursive:!0}),!0};import{writeFileSync as Vn}from"fs";function S(n){return function(...C){return{[n]:C}}}class wn{static attr(n){let[C,f]=G(n)[0];return S(`[${C}="${f}"]`)}static after(n=""){return S("::after"+n)}static before(n=""){return S("::before"+n)}static backdrop(n=""){return S("::backdrop"+n)}static cue(n=""){return S("::cue"+n)}static cueRegion(n=""){return S("::cue-region"+n)}static firstLetter(n=""){return S("::first-letter"+n)}static firstLine(n=""){return S("::first-line"+n)}static marker(n=""){return S("::marker"+n)}static part(n=""){return S("::part"+n)}static placeholder(n=""){return S("::placeholder"+n)}static selection(n=""){return S("::selection"+n)}static slotted(n=""){return S("::slotted"+n)}static spellingError(n=""){return S("::spelling-error"+n)}static targetText(n=""){return S("::target-text"+n)}static viewTransition(n=""){return S("::view-transition"+n)}static viewTransitionGroup(n=""){return S("::view-transition-group"+n)}static viewTransitionImagePair(n=""){return S("::view-transition-image-pair"+n)}static viewTransitionNew(n=""){return S("::view-transition-new"+n)}static viewTransitionOld(n=""){return S("::view-transition-old"+n)}static scrollbar(n=""){return S("::-webkit-scrollbar"+n)}static scrollbarThumb(n=""){return S("::-webkit-scrollbar-thumb"+n)}static scrollbarTrack(n=""){return S("::-webkit-scrollbar-track"+n)}static scrollbarCorner(n=""){return S("::-webkit-scrollbar-corner"+n)}static active(n=""){return S(":active"+n)}static anyLink(n=""){return S(":any-link"+n)}static autofill(n=""){return S(":autofill"+n)}static blank(n=""){return S(":blank"+n)}static checked(n=""){return S(":checked"+n)}static current(n=""){return S(":current"+n)}static default(n=""){return S(":default"+n)}static defined(n=""){return S(":defined"+n)}static disabled(n=""){return S(":disabled"+n)}static empty(n=""){return S(":empty"+n)}static enabled(n=""){return S(":enabled"+n)}static first(n=""){return S(":first"+n)}static firstChild(n=""){return S(":first-child"+n)}static firstOfType(n=""){return S(":first-of-type"+n)}static fullscreen(n=""){return S(":fullscreen"+n)}static future(n=""){return S(":future"+n)}static focus(n=""){return S(":focus"+n)}static focusVisible(n=""){return S(":focus-visible"+n)}static focusWithin(n=""){return S(":focus-within"+n)}static host(n=""){return S(":host"+n)}static hover(n=""){return S(":hover"+n)}static indeterminate(n=""){return S(":indeterminate"+n)}static inRange(n=""){return S(":in-range"+n)}static invalid(n=""){return S(":invalid"+n)}static lastChild(n=""){return S(":last-child"+n)}static lastOfType(n=""){return S(":last-of-type"+n)}static left(n=""){return S(":left"+n)}static link(n=""){return S(":link"+n)}static localLink(n=""){return S(":local-link"+n)}static modal(n=""){return S(":modal"+n)}static onlyChild(n=""){return S(":only-child"+n)}static onlyOfType(n=""){return S(":only-of-type"+n)}static optional(n=""){return S(":optional"+n)}static outOfRange(n=""){return S(":out-of-range"+n)}static past(n=""){return S(":past"+n)}static pictureInPicture(n=""){return S(":picture-in-picture"+n)}static placeholderShown(n=""){return S(":placeholder-shown"+n)}static paused(n=""){return S(":paused"+n)}static playing(n=""){return S(":playing"+n)}static readOnly(n=""){return S(":read-only"+n)}static readWrite(n=""){return S(":read-write"+n)}static required(n=""){return S(":required"+n)}static right(n=""){return S(":right"+n)}static root(n=""){return S(":root"+n)}static scope(n=""){return S(":scope"+n)}static target(n=""){return S(":target"+n)}static targetWithin(n=""){return S(":target-within"+n)}static userInvalid(n=""){return S(":user-invalid"+n)}static valid(n=""){return S(":valid"+n)}static visited(n=""){return S(":visited"+n)}static dir(n){return S(`:dir(${n})`)}static has(n){return S(`:has(${n})`)}static host_(n){return S(`:host(${n})`)}static hostContext(n){return S(`:host-context(${n})`)}static is(n){return S(`:is(${n})`)}static lang(n){return S(`:lang(${n})`)}static not(n){return S(`:not(${n})`)}static nthChild(n){return S(`:nth-child(${n})`)}static nthCol(n){return S(`:nth-col(${n})`)}static nthLastChild(n){return S(`:nth-last-child(${n})`)}static nthLastCol(n){return S(`:nth-last-col(${n})`)}static nthLastOfType(n){return S(`:nth-last-of-type(${n})`)}static nthOfType(n){return S(`:nth-of-type(${n})`)}static state(n){return S(`:state(${n})`)}static where(n){return S(`:where(${n})`)}static and(n){return S(", "+n)}static child(n){return S(" > "+n)}static desc(n){return S(" "+n)}static next(n){return S(" + "+n)}static general(n){return S(" ~ "+n)}static withClass(n){if(!n.startsWith("."))throw Error("should start with . or # - class / id");return S(n)}}class Kn{static minmax(n,C){return`minmax(${Q([n,C],{rem:!0,delimeter:", "})})`}static fitContent(n){return`fit-content(${Q([n],{rem:!0})})`}static repeat(n,...C){return`repeat(${Q([n,Q([C],{rem:!0})],{delimeter:", "})})`}}class hn extends Kn{static attr(n,C,f){return`attr(${Q([n,C,f])})`}static blur(n){return`blur(${Q([n],{rem:!0})})`}static brightness(n){return`brightness(${Q([n])})`}static calc(...n){return`calc(${Q(n,{rem:!0})})`}static circle(n,C){return`circle(${Q([n,C],{rem:!0})})`}static clamp(n,C,f){return`clamp(${Q([n,C,f],{rem:!0,delimeter:", "})})`}static colorMix(n,C,f){return`color-mix(${Q([n,Q(R(C)?C:[C]),Q(R(f)?f:[f])],{delimeter:", "})})`}static conicGradient(...n){return`conic-gradient(${Q(n,{delimeter:", "})})`}static contrast(n){return`contrast(${Q([n])})`}static cubicBezier(n,C,f,$){return`cubic-bezier(${Q([n,C,f,$],{delimeter:", "})})`}static dropShadow(...n){return`drop-shadow(${Q(n,{rem:!0})})`}static grayscale(n){return`grayscale(${Q([n])})`}static hsl(n,C,f){return`hsl(${Q([n,C,f])})`}static hsla(n,C,f,$){return`hsl(${Q([n,C,f,$?["/",$]:$])})`}static hueRotate(n){return`hue-rotate(${Q([n],{degree:!0})})`}static inset(...n){return`inset(${Q(n,{rem:!0})})`}static invert(n){return`invert(${Q([n])})`}static linearGradient(...n){return`linear-gradient(${Q(n,{delimeter:", "})})`}static matrix(n,C,f,$,T,E){return`matrix(${Q([n,C,f,$,T,E],{delimeter:", "})})`}static matrix3d(n,C,f,$){return`matrix3d(${Q([n,C,f,$],{delimeter:", "})})`}static max(...n){return`max(${Q(n,{rem:!0,delimeter:", "})})`}static min(...n){return`min(${Q(n,{rem:!0,delimeter:", "})})`}static opacity(n){return`opacity(${Q([n])})`}static path(n){return`path(${Q([n],{quote:!0})})`}static clipPath(n,C){return`path(${Q([n,Q([C],{quote:!0})],{delimeter:", "})})`}static perspective(n){return`perspective(${Q([n])})`}static polygon(...n){return`polygon(${Q(n,{percent:!0,delimeter:", "})})`}static ray(...n){return`ray(${Q(n,{degree:!0})})`}static radialGradient(...n){return`radial-gradient(${Q(n,{delimeter_arr:", ",percent:!0,delimeter:", "})})`}static repeatingConicGradient(...n){return`repeating-conic-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static repeatingLinearGradient(...n){return`repeating-linear-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static repeatingRadialGradient(...n){return`repeating-radial-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static rgb(n,C,f){return`rgb(${Q([n,C,f])})`}static rgba(n,C,f,$){return`rgba(${Q([n,C,f,$?["/",$]:void 0],{delimeter_arr:" "})})`}static rotate(n){return`rotate(${Q([n],{degree:!0})})`}static rotate3d(n,C,f,$){return`rotate3d(${Q([Q([n,C,f],{delimeter:", "}),$],{degree:!0,delimeter:", "})})`}static rotateX(n){return`rotateX(${Q([n],{degree:!0})})`}static rotateY(n){return`rotateY(${Q([n],{degree:!0})})`}static rotateZ(n){return`rotateZ(${Q([n],{degree:!0})})`}static saturate(...n){return`saturate(${Q(n)})`}static scale(n,C){return`scale(${Q([n,C],{delimeter:", "})})`}static scale3d(n,C,f){return`scale3d(${Q([n,C,f],{delimeter:", "})})`}static scaleX(n){return`scaleX(${Q([n])})`}static scaleY(n){return`scaleY(${Q([n])})`}static scaleZ(n){return`scaleZ(${Q([n])})`}static sepia(n){return`sepia(${Q([n])})`}static skew(...n){return`skew(${Q(n,{degree:!0,delimeter:", "})})`}static skewX(n){return`skewX(${Q([n],{degree:!0})})`}static skewY(n){return`skewY(${Q([n],{degree:!0})})`}static steps(n,C){return`steps(${Q([n,C],{delimeter:", "})})`}static translate(...n){return`translate(${Q(n,{rem:!0,delimeter:", "})})`}static translate3d(...n){return`translate3d(${Q(n,{rem:!0,delimeter:", "})})`}static translateX(n){return`translateX(${Q([n],{rem:!0})})`}static translateY(n){return`translateY(${Q([n],{rem:!0})})`}static translateZ(...n){return`translateZ(${Q(n,{rem:!0,delimeter:", "})})`}static url(n){return`url(${Q([n],{quote:!0})})`}static var(n,C=""){n="--"+K(n);let f=C?", "+Q([C],{rem:!0,delimeter:", "}):"";return`var(${Q([n],{rem:!0})}${f})`}}var JC={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 qC{path;name;prefix;exportMap;_imported=new Set;save;constructor({__filename:n,name:C,prefix:f,shweets:$=[],exportMap:T,webkitKeyframes:E,unit:J="rem"}){this.path=n,this.name=C||WC(n),this.prefix=f??"",this.exportMap=T;let t=R($)?$:[$];tC.call(this,this.prefix,t,E,T,J);let W=this;Object.assign(this,{get shweet(){return W}}),this.save=({dir:L,mapDir:q,mapName:U="index",minify:Z=!0,shaker:B=[],include:O=[]})=>{let H=b(T)?T:!!q,N=new Wn(this,B,O).load(H),M=R(L)?L:[L],Cn=Z?GC(N.css):N.css;if(M.forEach((h)=>{if(!h)return;let u=h.endsWith("/")?"":"/",Ln=h+u+this.name+".css";nn(h+u),e(Ln),Vn(Ln,Cn||"/* --------------*/")}),q){let h=q.endsWith("/")?"":"/",u=q+h+U+".js";nn(q+h),e(u),UC(u,N.CID)}return this}}get imported(){return[...this._imported]}}var GC=(n)=>{return n.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s*([{}:;,])\s*/g,"$1").replace(/\s*([>~+])\s*/g,"$1").trim()},UC=(n,C)=>{let f={};C.forEach((T)=>{G(T).forEach(([E,J])=>{if(!f[E])f[E]=[J];else f[E].push(J)})});let $=[...C.entries()].map(([T,E])=>{return`${T}="${[...E].join(" ")}"`}).sort((T,E)=>T.localeCompare(E,void 0,{numeric:!0}));Vn(n,$.length?`export const ${$.join()};`:"export {}");return};function tC(n,C,f=!1,$,T){let E={d:new A("",n,$,T),i:new A("#",n,$,T),c:new A(".",n,$,T),kf:new m(n,f,T),at:new l,font:new r};C.forEach((J)=>{this._imported.add(J.path),J._imported.forEach((t)=>{this._imported.add(t)}),w(E).forEach((t)=>{E[t].load(J[t])})}),w(E).forEach((J)=>{E[J]=E[J].css}),X(this,E)}function WC(n){return n.split("/").slice(-1)[0].split(".")[0]}export{JC as v,CC as supports,wn as ps,F as media,j as med,c as log,WC as fileName,hn as f,qn as __,an as Var,Q as Value,qC as Shweet,a as Medyas};
|
|
13
|
+
}`},Un=(n,C)=>{return jn(n.matchAll(C),(f)=>f[1])},In=(n,C,f)=>{try{if(!n[C])n[C]={},n[C][f]=[];if(!n[C][f])n[C][f]=[]}catch($){c.e=[`property "${C}" not found!`,{error:"@ensurePropsInitialized"}]}},tC=(n,C,f,$)=>{if(!n[C])n[C]={[f]:$.split(",").map((T)=>T.trim())};else n[C][f].push(...$.split(",").map((T)=>T.trim()))},SC=(n,C)=>{if(C)return n.replaceAll(/\.|\#/g,(f)=>f+C);return n};import{mkdirSync as EC,writeFileSync as QC,existsSync as Mn}from"fs";var e=(n,C="")=>{if(Mn(n))return!0;return QC(n,C,{flag:"wx"}),!0},nn=(n)=>{if(Mn(n))return!0;return EC(n,{recursive:!0}),!0};import{writeFileSync as Vn}from"fs";function t(n){return function(...C){return{[n]:C}}}class wn{static attr(n){let[C,f]=q(n)[0];return t(`[${C}="${f}"]`)}static after(n=""){return t("::after"+n)}static before(n=""){return t("::before"+n)}static backdrop(n=""){return t("::backdrop"+n)}static cue(n=""){return t("::cue"+n)}static cueRegion(n=""){return t("::cue-region"+n)}static firstLetter(n=""){return t("::first-letter"+n)}static firstLine(n=""){return t("::first-line"+n)}static marker(n=""){return t("::marker"+n)}static part(n=""){return t("::part"+n)}static placeholder(n=""){return t("::placeholder"+n)}static selection(n=""){return t("::selection"+n)}static slotted(n=""){return t("::slotted"+n)}static spellingError(n=""){return t("::spelling-error"+n)}static targetText(n=""){return t("::target-text"+n)}static viewTransition(n=""){return t("::view-transition"+n)}static viewTransitionGroup(n=""){return t("::view-transition-group"+n)}static viewTransitionImagePair(n=""){return t("::view-transition-image-pair"+n)}static viewTransitionNew(n=""){return t("::view-transition-new"+n)}static viewTransitionOld(n=""){return t("::view-transition-old"+n)}static scrollbar(n=""){return t("::-webkit-scrollbar"+n)}static scrollbarThumb(n=""){return t("::-webkit-scrollbar-thumb"+n)}static scrollbarTrack(n=""){return t("::-webkit-scrollbar-track"+n)}static scrollbarCorner(n=""){return t("::-webkit-scrollbar-corner"+n)}static active(n=""){return t(":active"+n)}static anyLink(n=""){return t(":any-link"+n)}static autofill(n=""){return t(":autofill"+n)}static blank(n=""){return t(":blank"+n)}static checked(n=""){return t(":checked"+n)}static current(n=""){return t(":current"+n)}static default(n=""){return t(":default"+n)}static defined(n=""){return t(":defined"+n)}static disabled(n=""){return t(":disabled"+n)}static empty(n=""){return t(":empty"+n)}static enabled(n=""){return t(":enabled"+n)}static first(n=""){return t(":first"+n)}static firstChild(n=""){return t(":first-child"+n)}static firstOfType(n=""){return t(":first-of-type"+n)}static fullscreen(n=""){return t(":fullscreen"+n)}static future(n=""){return t(":future"+n)}static focus(n=""){return t(":focus"+n)}static focusVisible(n=""){return t(":focus-visible"+n)}static focusWithin(n=""){return t(":focus-within"+n)}static host(n=""){return t(":host"+n)}static hover(n=""){return t(":hover"+n)}static indeterminate(n=""){return t(":indeterminate"+n)}static inRange(n=""){return t(":in-range"+n)}static invalid(n=""){return t(":invalid"+n)}static lastChild(n=""){return t(":last-child"+n)}static lastOfType(n=""){return t(":last-of-type"+n)}static left(n=""){return t(":left"+n)}static link(n=""){return t(":link"+n)}static localLink(n=""){return t(":local-link"+n)}static modal(n=""){return t(":modal"+n)}static onlyChild(n=""){return t(":only-child"+n)}static onlyOfType(n=""){return t(":only-of-type"+n)}static optional(n=""){return t(":optional"+n)}static outOfRange(n=""){return t(":out-of-range"+n)}static past(n=""){return t(":past"+n)}static pictureInPicture(n=""){return t(":picture-in-picture"+n)}static placeholderShown(n=""){return t(":placeholder-shown"+n)}static paused(n=""){return t(":paused"+n)}static playing(n=""){return t(":playing"+n)}static readOnly(n=""){return t(":read-only"+n)}static readWrite(n=""){return t(":read-write"+n)}static required(n=""){return t(":required"+n)}static right(n=""){return t(":right"+n)}static root(n=""){return t(":root"+n)}static scope(n=""){return t(":scope"+n)}static target(n=""){return t(":target"+n)}static targetWithin(n=""){return t(":target-within"+n)}static userInvalid(n=""){return t(":user-invalid"+n)}static valid(n=""){return t(":valid"+n)}static visited(n=""){return t(":visited"+n)}static dir(n){return t(`:dir(${n})`)}static has(n){return t(`:has(${n})`)}static host_(n){return t(`:host(${n})`)}static hostContext(n){return t(`:host-context(${n})`)}static is(n){return t(`:is(${n})`)}static lang(n){return t(`:lang(${n})`)}static not(n){return t(`:not(${n})`)}static nthChild(n){return t(`:nth-child(${n})`)}static nthCol(n){return t(`:nth-col(${n})`)}static nthLastChild(n){return t(`:nth-last-child(${n})`)}static nthLastCol(n){return t(`:nth-last-col(${n})`)}static nthLastOfType(n){return t(`:nth-last-of-type(${n})`)}static nthOfType(n){return t(`:nth-of-type(${n})`)}static state(n){return t(`:state(${n})`)}static where(n){return t(`:where(${n})`)}static and(n){return t(", "+n)}static child(n){return t(" > "+n)}static desc(n){return t(" "+n)}static next(n){return t(" + "+n)}static general(n){return t(" ~ "+n)}static withClass(n){if(!n.startsWith("."))throw Error("should start with . or # - class / id");return t(n)}}class Kn{static minmax(n,C){return`minmax(${E([n,C],{rem:!0,delimeter:", "})})`}static fitContent(n){return`fit-content(${E([n],{rem:!0})})`}static repeat(n,...C){return`repeat(${E([n,E([C],{rem:!0})],{delimeter:", "})})`}}class hn extends Kn{static attr(n,C,f){return`attr(${E([n,C,f])})`}static blur(n){return`blur(${E([n],{rem:!0})})`}static brightness(n){return`brightness(${E([n])})`}static calc(...n){return`calc(${E(n,{rem:!0})})`}static circle(n,C){return`circle(${E([n,C],{rem:!0})})`}static clamp(n,C,f){return`clamp(${E([n,C,f],{rem:!0,delimeter:", "})})`}static colorMix(n,C,f){return`color-mix(${E([n,E(L(C)?C:[C]),E(L(f)?f:[f])],{delimeter:", "})})`}static conicGradient(...n){return`conic-gradient(${E(n,{delimeter:", "})})`}static contrast(n){return`contrast(${E([n])})`}static cubicBezier(n,C,f,$){return`cubic-bezier(${E([n,C,f,$],{delimeter:", "})})`}static dropShadow(...n){return`drop-shadow(${E(n,{rem:!0})})`}static grayscale(n){return`grayscale(${E([n])})`}static hsl(n,C,f){return`hsl(${E([n,C,f])})`}static hsla(n,C,f,$){return`hsl(${E([n,C,f,$?["/",$]:$])})`}static hueRotate(n){return`hue-rotate(${E([n],{degree:!0})})`}static inset(...n){return`inset(${E(n,{rem:!0})})`}static invert(n){return`invert(${E([n])})`}static linearGradient(...n){return`linear-gradient(${E(n,{delimeter:", "})})`}static matrix(n,C,f,$,T,S){return`matrix(${E([n,C,f,$,T,S],{delimeter:", "})})`}static matrix3d(n,C,f,$){return`matrix3d(${E([n,C,f,$],{delimeter:", "})})`}static max(...n){return`max(${E(n,{rem:!0,delimeter:", "})})`}static min(...n){return`min(${E(n,{rem:!0,delimeter:", "})})`}static opacity(n){return`opacity(${E([n])})`}static path(n){return`path(${E([n],{quote:!0})})`}static clipPath(n,C){return`path(${E([n,E([C],{quote:!0})],{delimeter:", "})})`}static perspective(n){return`perspective(${E([n])})`}static polygon(...n){return`polygon(${E(n,{percent:!0,delimeter:", "})})`}static ray(...n){return`ray(${E(n,{degree:!0})})`}static radialGradient(...n){return`radial-gradient(${E(n,{delimeter_arr:", ",percent:!0,delimeter:", "})})`}static repeatingConicGradient(...n){return`repeating-conic-gradient(${E(n,{degree:!0,delimeter:", "})})`}static repeatingLinearGradient(...n){return`repeating-linear-gradient(${E(n,{degree:!0,delimeter:", "})})`}static repeatingRadialGradient(...n){return`repeating-radial-gradient(${E(n,{degree:!0,delimeter:", "})})`}static rgb(n,C,f){return`rgb(${E([n,C,f])})`}static rgba(n,C,f,$){return`rgba(${E([n,C,f,$?["/",$]:void 0],{delimeter_arr:" "})})`}static rotate(n){return`rotate(${E([n],{degree:!0})})`}static rotate3d(n,C,f,$){return`rotate3d(${E([E([n,C,f],{delimeter:", "}),$],{degree:!0,delimeter:", "})})`}static rotateX(n){return`rotateX(${E([n],{degree:!0})})`}static rotateY(n){return`rotateY(${E([n],{degree:!0})})`}static rotateZ(n){return`rotateZ(${E([n],{degree:!0})})`}static saturate(...n){return`saturate(${E(n)})`}static scale(n,C){return`scale(${E([n,C],{delimeter:", "})})`}static scale3d(n,C,f){return`scale3d(${E([n,C,f],{delimeter:", "})})`}static scaleX(n){return`scaleX(${E([n])})`}static scaleY(n){return`scaleY(${E([n])})`}static scaleZ(n){return`scaleZ(${E([n])})`}static sepia(n){return`sepia(${E([n])})`}static skew(...n){return`skew(${E(n,{degree:!0,delimeter:", "})})`}static skewX(n){return`skewX(${E([n],{degree:!0})})`}static skewY(n){return`skewY(${E([n],{degree:!0})})`}static steps(n,C){return`steps(${E([n,C],{delimeter:", "})})`}static translate(...n){return`translate(${E(n,{rem:!0,delimeter:", "})})`}static translate3d(...n){return`translate3d(${E(n,{rem:!0,delimeter:", "})})`}static translateX(n){return`translateX(${E([n],{rem:!0})})`}static translateY(n){return`translateY(${E([n],{rem:!0})})`}static translateZ(...n){return`translateZ(${E(n,{rem:!0,delimeter:", "})})`}static url(n){return`url(${E([n],{quote:!0})})`}static var(n,C=""){n="--"+K(n);let f=C?", "+E([C],{rem:!0,delimeter:", "}):"";return`var(${E([n],{rem:!0})}${f})`}}var JC={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 qC{path;name;prefix;exportMap;_imported=new Set;save;constructor({__filename:n,name:C,prefix:f,shweets:$=[],exportMap:T,webkitKeyframes:S,unit:Q="rem"}){this.path=n,this.name=C||WC(n),this.prefix=f??"",this.exportMap=T;let U=L($)?$:[$];RC.call(this,this.prefix,U,S,T,Q);let R=this;Object.assign(this,{get shweet(){return R}}),this.save=({dir:W,mapDir:J,mapName:G="index",minify:Z=!0,shaker:O=[],include:D=[]})=>{let H=g(T)?T:!!J,F=new Rn(this,O,D).load(H),I=L(W)?W:[W],Cn=Z?GC(F.css):F.css;if(I.forEach((h)=>{if(!h)return;let z=h.endsWith("/")?"":"/",Wn=h+z+this.name+".css";nn(h+z),e(Wn),Vn(Wn,Cn||"/* --------------*/")}),J){let h=J.endsWith("/")?"":"/",z=J+h+G+".js";nn(J+h),e(z),UC(z,F.CID)}return this}}get imported(){return[...this._imported]}}var GC=(n)=>{return n.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s*([{}:;,])\s*/g,"$1").replace(/\s*([>~+])\s*/g,"$1").trim()},UC=(n,C)=>{let f={};C.forEach((T)=>{q(T).forEach(([S,Q])=>{if(!f[S])f[S]=[Q];else f[S].push(Q)})});let $=[...C.entries()].map(([T,S])=>{return`${T}="${[...S].join(" ")}"`}).sort((T,S)=>T.localeCompare(S,void 0,{numeric:!0}));Vn(n,$.length?`export const ${$.join()};`:"export {}");return};function RC(n,C,f=!1,$,T){let S={d:new i("",n,$,T),i:new i("#",n,$,T),c:new i(".",n,$,T),kf:new r(n,f,T),at:new l,font:new m};C.forEach((Q)=>{this._imported.add(Q.path),Q._imported.forEach((U)=>{this._imported.add(U)}),w(S).forEach((U)=>{S[U].load(Q[U])})}),w(S).forEach((Q)=>{S[Q]=S[Q].css}),X(this,S)}function WC(n){return n.split("/").slice(-1)[0].split(".")[0]}export{JC as v,fC as supports,wn as ps,N as media,j as med,c as log,WC as fileName,hn as f,Jn as __,sn as Vars,an as Var,E as Value,qC as Shweet,a as Medyas};
|