var Se=Object.create;var A=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,Ae=Object.prototype.hasOwnProperty;var Le=(r,e)=>{for(var t in e)A(r,t,{get:e[t],enumerable:!0})},se=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Te(e))!Ae.call(r,i)&&i!==t&&A(r,i,{get:()=>e[i],enumerable:!(n=Ie(e,i))||n.enumerable});return r};var h=(r,e,t)=>(t=r!=null?Se(we(r)):{},se(e||!r||!r.__esModule?A(t,"default",{value:r,enumerable:!0}):t,r)),Ce=r=>se(A({},"__esModule",{value:!0}),r);var Ge={};Le(Ge,{createInterval:()=>me,createTimeout:()=>pe,datas:()=>S,debounce:()=>C,detector:()=>fe,encrypts:()=>ce,isSSR:()=>ae,serializer:()=>l,themes:()=>ue,throttle:()=>de});module.exports=Ce(Ge);var De=()=>typeof window>"u",ae=De;var Be=(r,e,t)=>{let n=r(e,t);return()=>r===setInterval?clearInterval(n):clearTimeout(n)},x=Be;var Ee=(r,e,t)=>{if(e>=t)return r;if(e<1)return r.slice(0,1);if(e%2===0){let c=Math.ceil(e/2);return`${r.slice(0,c)}${r.slice(-c)}`}let n=e/2,i=Math.ceil(n),o=Math.floor(n);return`${r.slice(0,o)}${r.slice(-i)}`.toLowerCase()},p=Ee;var L=h(require("crypto-js")),ke=(r,e=32)=>{let t=L.default.enc.Utf8.parse(r),n=L.default.MD5(t).toString(L.default.enc.Hex);return p(n,e,32)},k=ke;var N=h(require("crypto-js")),Ne=(r,e=40)=>{let n=N.default.SHA1(r).toString(N.default.enc.Hex);return p(n,e,40)},d=Ne;var M=h(require("crypto-js")),Me=(r,e=64)=>{let n=M.default.SHA256(r).toString(M.default.enc.Hex);return p(n,e,64)},z=Me;var y=h(require("crypto-js"));var ze=(r,e)=>{if(r){let t=d(e,32),n=y.default.enc.Utf8.parse(t.slice(16)),i=y.default.enc.Utf8.parse(t.slice(0,16));return y.default.AES.encrypt(r,n,{iv:i,mode:y.default.mode.CBC,padding:y.default.pad.Pkcs7}).toString()}return""},O=ze;var g=h(require("crypto-js"));var Oe=(r,e)=>{if(r){let t=d(e,32),n=g.default.enc.Utf8.parse(t.slice(16)),i=g.default.enc.Utf8.parse(t.slice(0,16));return g.default.AES.decrypt(r,n,{iv:i,mode:g.default.mode.CBC,padding:g.default.pad.Pkcs7}).toString(g.default.enc.Utf8)}return""},V=Oe;var Ve={encrypt:O,decrypt:V},H=Ve;var He=r=>Buffer.from(r,"utf-8").toString("base64"),U=He;var Ue=r=>Buffer.from(r,"base64").toString("utf-8"),$=Ue;var $e={encode:U,decode:$},F=$e;var Fe={MD5:k,SHA1:d,SHA256:z,Aes:H,Base64:F},ce=Fe;var K=class r{static DARK_THEME_QUERY="(prefers-color-scheme: dark)";static instance=null;saveKey="ks-theme";valid;value;name;onChange;mediaQueryList;isListenerAttached;constructor(e="auto",t=["light","dark"]){this.valid=t,this.mediaQueryList=window.matchMedia(r.DARK_THEME_QUERY),this.value=this.getLocalStorageTheme(e),this.name=this.computeName(this.value),this.isListenerAttached=!1,this.onChange=()=>{},this.init()}init(){this.value==="auto"?(this.attachListener(),this.handleSystemChange()):this.apply(this.value)}apply(e){this.name=this.computeName(e),document.documentElement.setAttribute("data-theme",this.name),this.onChange(this.value,this.name)}computeName(e){return e==="auto"?this.mediaQueryList.matches?"dark":"light":(this.valid.includes(e),e)}handleSystemChange=()=>{this.value==="auto"&&this.apply(this.mediaQueryList.matches?"dark":"light")};attachListener(){this.isListenerAttached||(this.mediaQueryList.addEventListener("change",this.handleSystemChange.bind(this)),this.isListenerAttached=!0)}detachListener(){this.isListenerAttached&&(this.mediaQueryList.removeEventListener("change",this.handleSystemChange.bind(this)),this.isListenerAttached=!1)}getLocalStorageTheme(e="auto"){try{let t=S.Storage.Local.get(this.saveKey);return t&&this.valid.includes(t)?t:e}catch(t){return console.error("Failed to retrieve theme from local storage:",t),e}}static getInstance(e,t){return r.instance||(r.instance=new r(e,t)),r.instance}set(e){this.value=e,S.Storage.Local.set(this.saveKey,e),this.value==="auto"?(this.attachListener(),this.handleSystemChange()):this.apply(this.value)}add(e){(Array.isArray(e)?e:[e]).forEach(n=>{this.valid.includes(n)||this.valid.push(n)})}getValue(){return this.value}getName(){return this.name}getAvailable(){return this.valid}bindChange(e){this.onChange=e}uninstall(){this.detachListener()}},ue=K;var le=h(require("ua-parser-js")),P=class{ua;parser;browserInfo;osInfo;constructor(){this.ua=navigator.userAgent,this.parser=new le.default(this.ua),this.browserInfo=this.getBrowserInfo(),this.osInfo={name:"",version:"",platform:""},this.initializeOSInfo()}getBrowserInfo=()=>{let e=this.parser.getBrowser();return{name:e.name||"",fullVersion:e.version||"",majorVersion:e.major||""}};initializeOSInfo=()=>{let e=this.parser.getOS(),t=this.parser.getCPU(),n=e.name||"",i=e.version||"";navigator.userAgentData&&navigator.userAgentData.getHighEntropyValues?navigator.userAgentData.getHighEntropyValues(["platformVersion"]).then(o=>{navigator.userAgentData.platform==="Windows"&&parseInt(o.platformVersion.split(".")[0])>=13&&(n="Windows 11",i=o.platformVersion),this.osInfo={name:n,version:i,platform:t.architecture||""}}):this.osInfo={name:n,version:i,platform:t.architecture||""}};compare=(e,t,n)=>{if(!["<",">","=","<=",">="].includes(t))return!1;let i=n.split(".").map(Number),o=e.split(".").map(Number),c=Math.min(i.length,o.length);for(let s=0;si[s])return t===">"||t===">="}return t==="="||t==="<="||t===">="};isBrowserName=e=>this.browserInfo.name.toLowerCase()===e.toLowerCase();compareBrowserVersion(e,t){return this.compare(e,t,this.browserInfo.fullVersion)}isOSName=e=>this.osInfo.name.toLowerCase()===e.toLowerCase();compareOSVersion(e,t){return this.compare(e,t,this.osInfo.version)}isMobile=()=>/Mobile|Android|iP(hone|od)/.test(this.ua);isTablet=()=>/iPad|Tablet/.test(this.ua)},fe=P;var Ke=(r,e)=>x(setInterval,r,e),me=Ke;var Pe=(r,e)=>x(setTimeout,r,e),pe=Pe;var Re=(r,e,t={})=>{let n,i,o,c,s,f,b=0,te=!1,v=!1,B=!0,re=!e&&e!==0&&typeof requestAnimationFrame=="function";if(typeof r!="function")throw new TypeError("Expected a function");e=+e||0,typeof t=="object"&&(te=!!t.leading,v="maxWait"in t,o=v?Math.max(+t.maxWait||0,e):o,B="trailing"in t?!!t.trailing:B);let E=a=>{let u=n,m=i;return n=i=void 0,b=a,c=r.apply(m,u),c},I=(a,u)=>re?(cancelAnimationFrame(s),requestAnimationFrame(a)):setTimeout(a,u),ge=a=>{if(re){cancelAnimationFrame(a);return}clearTimeout(a)},he=a=>(b=a,s=I(T,e),te?E(a):c),ye=a=>{let u=a-(f||0),m=a-b,oe=e-u;return v?Math.min(oe,o-m):oe},ne=a=>{let u=a-(f||0),m=a-b;return f===void 0||u>=e||u<0||v&&m>=o},T=()=>{let a=Date.now();if(ne(a))return ie(a);s=I(T,ye(a))},ie=a=>(s=void 0,B&&n?E(a):(n=i=void 0,c)),be=()=>{s!==void 0&&ge(s),b=0,n=f=i=s=void 0},ve=()=>s===void 0?c:ie(Date.now()),xe=()=>s!==void 0,w=(...a)=>{let u=Date.now(),m=ne(u);if(n=a,i=void 0,f=u,m){if(s===void 0)return he(f);if(v)return s=I(T,e),E(f)}return s===void 0&&(s=I(T,e)),c};return w.cancel=be,w.flush=ve,w.pending=xe,w},C=Re;var We=(r,e,t={})=>{let n=!0,i=!0;return typeof t=="object"&&(n="leading"in t?!!t.leading:n,i="trailing"in t?!!t.trailing:i),C(r,e,{leading:n,trailing:i,maxWait:e})},de=We;var Qe=r=>{if(typeof r!="string"&&typeof r!="number")return console.error("Invalid data type for deserialization:",typeof r),null;if(typeof r=="number")return r;try{return/^[\],:{}\s]*$/.test(r.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))?JSON.parse(r,(e,t)=>{if(t&&typeof t=="object"&&"type"in t)switch(t.type){case"BigInt":return BigInt(t.value);case"Symbol":return Symbol(t.value.slice(7,-1));case"Function":return new Function(`return ${t.value}`)();case"String":return t.value;case"Number":return Number(t.value);case"Boolean":return!!t.value;case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;case"Null":return null;case"Undefined":return;case"Set":return new Set(t.value);case"Map":return new Map(t.value);case"RegExp":{let n=t.value.match(/\/(.*?)\/([gimsuy]*)$/);return new RegExp(n[1],n[2])}case"Date":return new Date(t.value);default:return t}return t}):r}catch(e){return console.error("Failed to deserialize data:",e),null}},R=Qe;var je=r=>{let e=new WeakSet;return JSON.stringify(r,(t,n)=>{if(typeof n=="object"&&n!==null){if(e.has(n))return;e.add(n)}let i=typeof n;return i==="undefined"?{type:"Undefined"}:i==="function"?{type:"Function",value:n.toString()}:i==="symbol"?{type:"Symbol",value:n.toString()}:i==="bigint"?{type:"BigInt",value:n.toString()}:n instanceof Date?{type:"Date",value:n.toISOString()}:Number.isNaN(n)?{type:"NaN"}:n===1/0?{type:"Infinity"}:n===-1/0?{type:"-Infinity"}:n instanceof RegExp?{type:"RegExp",value:n.toString()}:n instanceof Set?{type:"Set",value:Array.from(n)}:n instanceof Map?{type:"Map",value:Array.from(n.entries())}:n===null?{type:"Null"}:n})},W=je;var Je={from:R,to:W},l=Je;var Q=class r{static instance;constructor(){}static getInstance(){return r.instance||(r.instance=new r),r.instance}set(e,t,n,i="/"){let o=l.to(t),c="";if(n){let s=new Date;s.setTime(s.getTime()+n),c=`; expires=${s.toUTCString()}`}document.cookie=`${e}=${o}${c}; path=${i}`}get(e){let t=`${e}=`,n=document.cookie.split(";");for(let i=0;iparseInt(i))return this.remove(e,t),null;let o=e.getItem(n);return o?this.serializer.deserialize(o):null}remove(e,t){let n=this._prefix+t;e.removeItem(n),e.removeItem(n+this._expireKeySuffix)}clear(e){e.clear()}},D=J;var Y=class r{static instance;static base;constructor(){}static getInstance(){return r.instance||(r.base=new D,r.instance=new r),r.instance}set=(e,t,n)=>r.base.set(localStorage,e,t,n);get=e=>r.base.get(localStorage,e);remove=e=>r.base.remove(localStorage,e);clear=()=>r.base.clear(localStorage)},q=Y.getInstance();var G=class r{static instance;static base;constructor(){}static getInstance(){return r.instance||(r.base=new D,r.instance=new r),r.instance}set=(e,t,n)=>r.base.set(sessionStorage,e,t,n);get=e=>r.base.get(sessionStorage,e);remove=e=>r.base.remove(sessionStorage,e);clear=()=>r.base.clear(sessionStorage)},X=G.getInstance();var Ye={Local:q,Session:X},Z=Ye;var _=class r{static seconds=e=>e*1e3;static milliseconds=e=>e;static minutes=e=>r.seconds(e*60);static hours=e=>r.minutes(e*60);static days=e=>r.hours(e*24);static months(e){let t=new Date,n=new Date(t);return n.setMonth(t.getMonth()+e),n.getTime()-t.getTime()}static years(e){let t=new Date,n=new Date(t);return n.setFullYear(t.getFullYear()+e),n.getTime()-t.getTime()}},ee=_;var qe={Cookie:j,Storage:Z,Expire:ee},S=qe;0&&(module.exports={createInterval,createTimeout,datas,debounce,detector,encrypts,isSSR,serializer,themes,throttle});