Files
daywork/intern-log/dist/assets/index-B3bd8iWX.js
T

28 lines
337 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
* @vue/shared v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Gi(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const mt={},Ms=[],Pn=()=>{},qu=()=>!1,ca=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),da=e=>e.startsWith("onUpdate:"),Pt=Object.assign,Yi=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},uf=Object.prototype.hasOwnProperty,dt=(e,t)=>uf.call(e,t),He=Array.isArray,is=e=>Gr(e)==="[object Map]",Ls=e=>Gr(e)==="[object Set]",Xl=e=>Gr(e)==="[object Date]",Ye=e=>typeof e=="function",$t=e=>typeof e=="string",On=e=>typeof e=="symbol",ft=e=>e!==null&&typeof e=="object",Hu=e=>(ft(e)||Ye(e))&&Ye(e.then)&&Ye(e.catch),zu=Object.prototype.toString,Gr=e=>zu.call(e),cf=e=>Gr(e).slice(8,-1),Wu=e=>Gr(e)==="[object Object]",Ji=e=>$t(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Sr=Gi(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),fa=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},df=/-\w/g,gn=fa(e=>e.replace(df,t=>t.slice(1).toUpperCase())),ff=/\B([A-Z])/g,ms=fa(e=>e.replace(ff,"-$1").toLowerCase()),Gu=fa(e=>e.charAt(0).toUpperCase()+e.slice(1)),oi=fa(e=>e?`on${Gu(e)}`:""),An=(e,t)=>!Object.is(e,t),Io=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Yu=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},pa=e=>{const t=parseFloat(e);return isNaN(t)?e:t},pf=e=>{const t=$t(e)?Number(e):NaN;return isNaN(t)?e:t};let Ql;const va=()=>Ql||(Ql=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function qn(e){if(He(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=$t(r)?yf(r):qn(r);if(o)for(const i in o)t[i]=o[i]}return t}else if($t(e)||ft(e))return e}const vf=/;(?![^(]*\))/g,mf=/:([^]+)/,hf=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function yf(e){const t={};return e.replace(hf,n=>n.startsWith("/*")?"":n).split(vf).forEach(n=>{if(n){const r=n.split(mf);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function Xe(e){let t="";if($t(e))t=e;else if(He(e))for(let n=0;n<e.length;n++){const r=Xe(e[n]);r&&(t+=r+" ")}else if(ft(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const gf="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",bf=Gi(gf);function Ju(e){return!!e||e===""}function wf(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let o=0;r&&o<e.length;o++)r=us(e[o],t[o],n);return r}function Zl(e,t,n){if(e.size!==t.size)return!1;const r=Array.from(t),o=new Uint8Array(r.length);for(const i of e){let c=-1;for(let f=0;f<r.length;f++)if(!o[f]&&us(i,r[f],n)){c=f;break}if(c<0)return!1;o[c]=1}return!0}function _f(e,t,n){let r=is(e),o=is(t);if(r||o||(r=Ls(e),o=Ls(t),r||o))return r&&o?Zl(e,t,n):!1;const i=Object.keys(e).length,c=Object.keys(t).length;if(i!==c)return!1;for(const f in e){const v=e.hasOwnProperty(f),b=t.hasOwnProperty(f);if(v&&!b||!v&&b||!us(e[f],t[f],n))return!1}return String(e)===String(t)}function eu(e,t,n,r){n||(n=[new Map,new Map]);const[o,i]=n;if(o.has(e)||i.has(t))return o.get(e)===t&&i.get(t)===e;o.set(e,t),i.set(t,e);const c=r(e,t,n);return o.delete(e),i.delete(t),c}function us(e,t,n){if(e===t)return!0;let r=Xl(e),o=Xl(t);return r||o?r&&o?e.getTime()===t.getTime():!1:(r=On(e),o=On(t),r||o?e===t:(r=He(e),o=He(t),r||o?r&&o?eu(e,t,n,wf):!1:(r=ft(e),o=ft(t),r||o?!r||!o?!1:eu(e,t,n,_f):String(e)===String(t))))}function kf(e,t){return e.findIndex(n=>us(n,t))}const Xu=e=>!!(e&&e.__v_isRef===!0),z=e=>$t(e)?e:e==null?"":He(e)||ft(e)&&(e.toString===zu||!Ye(e.toString))?Xu(e)?z(e.value):JSON.stringify(e,Qu,2):String(e),Qu=(e,t)=>Xu(t)?Qu(e,t.value):is(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o],i)=>(n[ai(r,i)+" =>"]=o,n),{})}:Ls(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ai(n))}:On(t)?ai(t):ft(t)&&!He(t)&&!Wu(t)?String(t):t,ai=(e,t="")=>{var n;return On(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
* @vue/reactivity v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Ft;class xf{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Ft&&(Ft.active?(this.parent=Ft,this.index=(Ft.scopes||(Ft.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const o=this.scopes.slice();for(t=0,n=o.length;t<n;t++)o[t].resume()}const r=this.effects.slice();for(t=0,n=r.length;t<n;t++)r[t].resume()}}run(t){if(this._active){const n=Ft;try{return Ft=this,t()}finally{Ft=n}}}on(){++this._on===1&&(this.prevScope=Ft,Ft=this)}off(){if(this._on>0&&--this._on===0){if(Ft===this)Ft=this.prevScope;else{let t=Ft;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,r=o.length;n<r;n++)o[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function Cf(){return Ft}let gt;const ii=new WeakSet;class Zu{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ft&&(Ft.active?Ft.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ii.has(this)&&(ii.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||tc(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,tu(this),nc(this);const t=gt,n=bn;gt=this,bn=!0;try{return this.fn()}finally{sc(this),gt=t,bn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Zi(t);this.deps=this.depsTail=void 0,tu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ii.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ki(this)&&this.run()}get dirty(){return ki(this)}}let ec=0,Er,Tr;function tc(e,t=!1){if(e.flags|=8,t){e.next=Tr,Tr=e;return}e.next=Er,Er=e}function Xi(){ec++}function Qi(){if(--ec>0)return;if(Tr){let t=Tr;for(Tr=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Er;){let t=Er;for(Er=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function nc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function sc(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),Zi(r),$f(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function ki(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(rc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function rc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===jr)||(e.globalVersion=jr,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ki(e))))return;e.flags|=2;const t=e.dep,n=gt,r=bn;gt=e,bn=!0;try{nc(e);const o=e.fn(e._value);(t.version===0||An(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{gt=n,bn=r,sc(e),e.flags&=-3}}function Zi(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Zi(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function $f(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let bn=!0;const oc=[];function Mn(){oc.push(bn),bn=!1}function In(){const e=oc.pop();bn=e===void 0?!0:e}function tu(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=gt;gt=void 0;try{t()}finally{gt=n}}}let jr=0;class Sf{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class el{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!gt||!bn||gt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==gt)n=this.activeLink=new Sf(gt,this),gt.deps?(n.prevDep=gt.depsTail,gt.depsTail.nextDep=n,gt.depsTail=n):gt.deps=gt.depsTail=n,ac(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=gt.depsTail,n.nextDep=void 0,gt.depsTail.nextDep=n,gt.depsTail=n,gt.deps===n&&(gt.deps=r)}return n}trigger(t){this.version++,jr++,this.notify(t)}notify(t){Xi();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Qi()}}}function ac(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)ac(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const xi=new WeakMap,js=Symbol(""),Ci=Symbol(""),Dr=Symbol("");function zt(e,t,n){if(bn&&gt){let r=xi.get(e);r||xi.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new el),o.map=r,o.key=n),o.track()}}function Bn(e,t,n,r,o,i){const c=xi.get(e);if(!c){jr++;return}const f=v=>{v&&v.trigger()};if(Xi(),t==="clear")c.forEach(f);else{const v=He(e),b=v&&Ji(n);if(v&&n==="length"){const y=Number(r);c.forEach((_,S)=>{(S==="length"||S===Dr||!On(S)&&S>=y)&&f(_)})}else switch((n!==void 0||c.has(void 0))&&f(c.get(n)),b&&f(c.get(Dr)),t){case"add":v?b&&f(c.get("length")):(f(c.get(js)),is(e)&&f(c.get(Ci)));break;case"delete":v||(f(c.get(js)),is(e)&&f(c.get(Ci)));break;case"set":is(e)&&f(c.get(js));break}}Qi()}function Ys(e){const t=ut(e);return t===e||(zt(t,"iterate",Dr),fn(e))?t:jn(e)?ls(e)?t.map(n=>cs(vn(n))):t.map(cs):t.map(vn)}function ma(e){return zt(e=ut(e),"iterate",Dr),e}function Sn(e,t){return jn(e)?cs(ls(e)?vn(t):t):vn(t)}const Ef={__proto__:null,[Symbol.iterator](){return li(this,Symbol.iterator,e=>Sn(this,e))},concat(...e){return Ys(this).concat(...e.map(t=>He(t)?Ys(t):t))},entries(){return li(this,"entries",e=>(e[1]=Sn(this,e[1]),e))},every(e,t){return Fn(this,"every",e,t,void 0,arguments)},filter(e,t){return Fn(this,"filter",e,t,n=>n.map(r=>Sn(this,r)),arguments)},find(e,t){return Fn(this,"find",e,t,n=>Sn(this,n),arguments)},findIndex(e,t){return Fn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Fn(this,"findLast",e,t,n=>Sn(this,n),arguments)},findLastIndex(e,t){return Fn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Fn(this,"forEach",e,t,void 0,arguments)},includes(...e){return ui(this,"includes",e)},indexOf(...e){return ui(this,"indexOf",e)},join(e){return Ys(this).join(e)},lastIndexOf(...e){return ui(this,"lastIndexOf",e)},map(e,t){return Fn(this,"map",e,t,void 0,arguments)},pop(){return wr(this,"pop")},push(...e){return wr(this,"push",e)},reduce(e,...t){return su(this,"reduce",e,t)},reduceRight(e,...t){return su(this,"reduceRight",e,t)},shift(){return wr(this,"shift")},some(e,t){return Fn(this,"some",e,t,void 0,arguments)},splice(...e){return wr(this,"splice",e)},toReversed(){return Ys(this).toReversed()},toSorted(e){return Ys(this).toSorted(e)},toSpliced(...e){return Ys(this).toSpliced(...e)},unshift(...e){return wr(this,"unshift",e)},values(){return li(this,"values",e=>Sn(this,e))}};function li(e,t,n){const r=ma(e),o=r[t],i=o.call(r);if(r!==e&&!fn(e)){if(i[Symbol.toStringTag]==="Array Iterator"){const c=Object.create(Object.getPrototypeOf(i));return c.next=()=>nu(i.next(),n),o!==ic[t]&&Object.defineProperties(c,{return:{get(){const f=i.return;return typeof f=="function"?f.bind(i):f}},throw:{get(){const f=i.throw;return typeof f=="function"?f.bind(i):f}}}),c}i._next=i.next,i.next=()=>nu(i._next(),n)}return i}function nu(e,t){return e.done||(e.value=t(e.value)),e}const ic=Array.prototype;function Fn(e,t,n,r,o,i){const c=ma(e),f=c!==e&&!fn(e),v=c[t];if(v!==ic[t]){const _=v.apply(e,i);return f?vn(_):_}let b=n;c!==e&&(f?b=function(_,S){return n.call(this,Sn(e,_),S,e)}:n.length>2&&(b=function(_,S){return n.call(this,_,S,e)}));const y=v.call(c,b,r);return f&&o?o(y):y}function su(e,t,n,r){const o=ma(e),i=o!==e&&!fn(e);let c=n,f=!1;o!==e&&(i?(f=r.length===0,c=function(b,y,_){return f&&(f=!1,b=Sn(e,b)),n.call(this,b,Sn(e,y),_,e)}):n.length>3&&(c=function(b,y,_){return n.call(this,b,y,_,e)}));const v=o[t](c,...r);return f?Sn(e,v):v}function ui(e,t,n){const r=ut(e);zt(r,"iterate",Dr);const o=r[t](...n);return(o===-1||o===!1)&&rl(n[0])?(n[0]=ut(n[0]),r[t](...n)):o}function wr(e,t,n=[]){Mn(),Xi();const r=ut(e)[t].apply(e,n);return Qi(),In(),r}const Tf=Gi("__proto__,__v_isRef,__isVue"),lc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(On));function Af(e){On(e)||(e=String(e));const t=ut(this);return zt(t,"has",e),t.hasOwnProperty(e)}class uc{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return r===(o?i?Ff:pc:i?fc:dc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const c=He(t);if(!o){let v;if(c&&(v=Ef[n]))return v;if(n==="hasOwnProperty")return Af}const f=Reflect.get(t,n,Gt(t)?t:r);if((On(n)?lc.has(n):Tf(n))||(o||zt(t,"get",n),i))return f;if(Gt(f)){const v=c&&Ji(n)?f:f.value;return o&&ft(v)?Si(v):v}return ft(f)?o?Si(f):nl(f):f}}class cc extends uc{constructor(t=!1){super(!1,t)}set(t,n,r,o){let i=t[n];const c=He(t)&&Ji(n);if(!this._isShallow){const b=jn(i);if(!fn(r)&&!jn(r)&&(i=ut(i),r=ut(r)),!c&&Gt(i)&&!Gt(r))return b||(i.value=r),!0}const f=c?Number(n)<t.length:dt(t,n),v=Reflect.set(t,n,r,Gt(t)?t:o);return t===ut(o)&&v&&(f?An(r,i)&&Bn(t,"set",n,r):Bn(t,"add",n,r)),v}deleteProperty(t,n){const r=dt(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&r&&Bn(t,"delete",n,void 0),o}has(t,n){const r=Reflect.has(t,n);return(!On(n)||!lc.has(n))&&zt(t,"has",n),r}ownKeys(t){return zt(t,"iterate",He(t)?"length":js),Reflect.ownKeys(t)}}class Pf extends uc{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Of=new cc,Mf=new Pf,If=new cc(!0);const $i=e=>e,So=e=>Reflect.getPrototypeOf(e);function jf(e,t,n){return function(...r){const o=this.__v_raw,i=ut(o),c=is(i),f=e==="entries"||e===Symbol.iterator&&c,v=e==="keys"&&c,b=o[e](...r),y=n?$i:t?cs:vn;return!t&&zt(i,"iterate",v?Ci:js),Pt(Object.create(b),{next(){const{value:_,done:S}=b.next();return S?{value:_,done:S}:{value:f?[y(_[0]),y(_[1])]:y(_),done:S}}})}}function Eo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Df(e,t){const n={get(o){const i=this.__v_raw,c=ut(i),f=ut(o);e||(An(o,f)&&zt(c,"get",o),zt(c,"get",f));const{has:v}=So(c),b=t?$i:e?cs:vn;if(v.call(c,o))return b(i.get(o));if(v.call(c,f))return b(i.get(f));i!==c&&i.get(o)},get size(){const o=this.__v_raw;return!e&&zt(ut(o),"iterate",js),o.size},has(o){const i=this.__v_raw,c=ut(i),f=ut(o);return e||(An(o,f)&&zt(c,"has",o),zt(c,"has",f)),o===f?i.has(o):i.has(o)||i.has(f)},forEach(o,i){const c=this,f=c.__v_raw,v=ut(f),b=t?$i:e?cs:vn;return!e&&zt(v,"iterate",js),f.forEach((y,_)=>o.call(i,b(y),b(_),c))}};return Pt(n,e?{add:Eo("add"),set:Eo("set"),delete:Eo("delete"),clear:Eo("clear")}:{add(o){const i=ut(this),c=So(i),f=ut(o),v=!t&&!fn(o)&&!jn(o)?f:o;return c.has.call(i,v)||An(o,v)&&c.has.call(i,o)||An(f,v)&&c.has.call(i,f)||(i.add(v),Bn(i,"add",v,v)),this},set(o,i){!t&&!fn(i)&&!jn(i)&&(i=ut(i));const c=ut(this),{has:f,get:v}=So(c);let b=f.call(c,o);b||(o=ut(o),b=f.call(c,o));const y=v.call(c,o);return c.set(o,i),b?An(i,y)&&Bn(c,"set",o,i):Bn(c,"add",o,i),this},delete(o){const i=ut(this),{has:c,get:f}=So(i);let v=c.call(i,o);v||(o=ut(o),v=c.call(i,o)),f&&f.call(i,o);const b=i.delete(o);return v&&Bn(i,"delete",o,void 0),b},clear(){const o=ut(this),i=o.size!==0,c=o.clear();return i&&Bn(o,"clear",void 0,void 0),c}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=jf(o,e,t)}),n}function tl(e,t){const n=Df(e,t);return(r,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_isShallow"?t:o==="__v_raw"?r:Reflect.get(dt(n,o)&&o in r?n:r,o,i)}const Lf={get:tl(!1,!1)},Kf={get:tl(!1,!0)},Rf={get:tl(!0,!1)};const dc=new WeakMap,fc=new WeakMap,pc=new WeakMap,Ff=new WeakMap;function Nf(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function nl(e){return jn(e)?e:sl(e,!1,Of,Lf,dc)}function Vf(e){return sl(e,!1,If,Kf,fc)}function Si(e){return sl(e,!0,Mf,Rf,pc)}function sl(e,t,n,r,o){if(!ft(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const c=Nf(cf(e));if(c===0)return e;const f=new Proxy(e,c===2?r:n);return o.set(e,f),f}function ls(e){return jn(e)?ls(e.__v_raw):!!(e&&e.__v_isReactive)}function jn(e){return!!(e&&e.__v_isReadonly)}function fn(e){return!!(e&&e.__v_isShallow)}function rl(e){return e?!!e.__v_raw:!1}function ut(e){const t=e&&e.__v_raw;return t?ut(t):e}function Bf(e){return!dt(e,"__v_skip")&&Object.isExtensible(e)&&Yu(e,"__v_skip",!0),e}const vn=e=>ft(e)?nl(e):e,cs=e=>ft(e)?Si(e):e;function Gt(e){return e?e.__v_isRef===!0:!1}function M(e){return Uf(e,!1)}function Uf(e,t){return Gt(e)?e:new qf(e,t)}class qf{constructor(t,n){this.dep=new el,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ut(t),this._value=n?t:vn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||fn(t)||jn(t);t=r?t:ut(t),An(t,n)&&(this._rawValue=t,this._value=r?t:vn(t),this.dep.trigger())}}function on(e){return Gt(e)?e.value:e}const Hf={get:(e,t,n)=>t==="__v_raw"?e:on(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Gt(o)&&!Gt(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function vc(e){return ls(e)?e:new Proxy(e,Hf)}class zf{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new el(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=jr-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&gt!==this)return tc(this,!0),!0}get value(){const t=this.dep.track();return rc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Wf(e,t,n=!1){let r,o;return Ye(e)?r=e:(r=e.get,o=e.set),new zf(r,o,n)}const To={},Uo=new WeakMap;let Es;function Gf(e,t=!1,n=Es){if(n){let r=Uo.get(n);r||Uo.set(n,r=[]),r.push(e)}}function Yf(e,t,n=mt){const{immediate:r,deep:o,once:i,scheduler:c,augmentJob:f,call:v}=n,b=A=>o?A:fn(A)||o===!1||o===0?Un(A,1):Un(A);let y,_,S,C,I=!1,Y=!1;if(Gt(e)?(_=()=>e.value,I=fn(e)):ls(e)?(_=()=>b(e),I=!0):He(e)?(Y=!0,I=e.some(A=>ls(A)||fn(A)),_=()=>e.map(A=>{if(Gt(A))return A.value;if(ls(A))return b(A);if(Ye(A))return v?v(A,2):A()})):Ye(e)?t?_=v?()=>v(e,2):e:_=()=>{if(S){Mn();try{S()}finally{In()}}const A=Es;Es=y;try{return v?v(e,3,[C]):e(C)}finally{Es=A}}:_=Pn,t&&o){const A=_,L=o===!0?1/0:o;_=()=>Un(A(),L)}const le=Cf(),ce=()=>{y.stop(),le&&le.active&&Yi(le.effects,y)};if(i&&t){const A=t;t=(...L)=>{try{return A(...L)}finally{ce()}}}let ue=Y?new Array(e.length).fill(To):To;const W=A=>{if(!(!(y.flags&1)||!y.dirty&&!A))if(t){const L=y.run();if(A||o||I||(Y?L.some((Z,G)=>An(Z,ue[G])):An(L,ue))){const Z=Es;Mn();try{S&&S(),Es=y;const G=[L,ue===To?void 0:Y&&ue[0]===To?[]:ue,C];ue=L,v?v(t,3,G):t(...G)}finally{Es=Z,In()}}}else y.run()};return f&&f(W),y=new Zu(_),y.scheduler=c?()=>c(W,!1):W,C=A=>Gf(A,!1,y),S=y.onStop=()=>{const A=Uo.get(y);if(A){if(v)v(A,4);else for(const L of A)L();Uo.delete(y)}},t?r?W(!0):ue=y.run():c?c(W.bind(null,!0),!0):y.run(),ce.pause=y.pause.bind(y),ce.resume=y.resume.bind(y),ce.stop=ce,ce}function Un(e,t=1/0,n){if(t<=0||!ft(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Gt(e))Un(e.value,t,n);else if(He(e))for(let r=0;r<e.length;r++)Un(e[r],t,n);else if(Ls(e)||is(e))e.forEach(r=>{Un(r,t,n)});else if(Wu(e)){for(const r in e)Un(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Un(e[r],t,n)}return e}/**
* @vue/runtime-core v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Yr(e,t,n,r){try{return r?e(...r):e()}catch(o){ha(o,t,n)}}function mn(e,t,n,r){if(Ye(e)){const o=Yr(e,t,n,r);return o&&Hu(o)&&o.catch(i=>{ha(i,t,n)}),o}if(He(e)){const o=[];for(let i=0;i<e.length;i++)o.push(mn(e[i],t,n,r));return o}}function ha(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:c}=t&&t.appContext.config||mt;if(t){let f=t.parent;const v=t.proxy,b=`https://vuejs.org/error-reference/#runtime-${n}`;for(;f;){const y=f.ec;if(y){for(let _=0;_<y.length;_++)if(y[_](e,v,b)===!1)return}f=f.parent}if(i){Mn(),Yr(i,null,10,[e,v,b]),In();return}}Jf(e,n,o,r,c)}function Jf(e,t,n,r=!0,o=!1){if(o)throw e;console.error(e)}const Zt=[];let yn=-1;const En=[];let os=null,Js=0;const mc=Promise.resolve();let qo=null;function lr(e){const t=qo||mc;return e?t.then(this?e.bind(this):e):t}function Xf(e){let t=yn+1,n=Zt.length;for(;t<n;){const r=t+n>>>1,o=Zt[r],i=Lr(o);i<e||i===e&&o.flags&2?t=r+1:n=r}return t}function ol(e){if(!(e.flags&1)){const t=Lr(e),n=Zt[Zt.length-1];!n||!(e.flags&2)&&t>=Lr(n)?Zt.push(e):Zt.splice(Xf(t),0,e),e.flags|=1,hc()}}function hc(){qo||(qo=mc.then(bc))}function Qf(e){if(!He(e))os&&e.id===-1?os.splice(Js+1,0,e):e.flags&1||(En.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)En.push(e[t]);hc()}function yc(e,t,n,r=yn+1){for(;r<Zt.length;r++){const o=Zt[r];if(o&&o.flags&2){if(e&&o.id!==e.uid||t!==void 0&&!(o.id>=t))continue;Zt.splice(r,1),r=e?r-1:yn,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function gc(e,t,n=0){if(En.length){let r=En,o=0;if(t){r=[];for(let c=0;c<En.length;c++){const f=En[c];(f.i!==void 0?!f.i||f.i.uid<n:t.has(f))?En[o++]=f:r.push(f)}}const i=[...new Set(r)].sort((c,f)=>Lr(c)-Lr(f));if(En.length=o,os){for(let c=0;c<i.length;c++)os.push(i[c]);return}for(os=i,Js=0;Js<os.length;Js++){const c=os[Js];c.flags&4&&(c.flags&=-2),c.flags&8||c(),c.flags&=-2}os=null,Js=0}}let ci=!1;function Zf(e,t){if(ci){e();return}const n=t===void 0?void 0:new Set(En);e(),ci=!0;try{yc(void 0,t),gc(void 0,n,t)}finally{ci=!1}}const Lr=e=>e.id==null?e.flags&2?-1:1/0:e.id;function bc(e){try{for(yn=0;yn<Zt.length;yn++){const t=Zt[yn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Yr(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;yn<Zt.length;yn++){const t=Zt[yn];t&&(t.flags&=-2)}yn=-1,Zt.length=0,gc(),qo=null,(Zt.length||En.length)&&bc()}}let dn=null,wc=null;function Ho(e){const t=dn;return dn=e,wc=e&&e.type.__scopeId||null,t}function Wn(e,t=dn,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&Yo(-1);const i=Ho(t),c=Ds.length;let f;try{f=e(...o)}finally{for(let v=Ds.length;v>c;v--)Gc();Ho(i),r._d&&Yo(1)}return f};return r._n=!0,r._c=!0,r._d=!0,r}function Oe(e,t){if(dn===null)return e;const n=ka(dn),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,c,f,v=mt]=t[o];i&&(Ye(i)&&(i={mounted:i,updated:i}),i.deep&&Un(c),r.push({dir:i,instance:n,value:c,oldValue:void 0,arg:f,modifiers:v}))}return e}function Cs(e,t,n,r){const o=e.dirs,i=t&&t.dirs;for(let c=0;c<o.length;c++){const f=o[c];i&&(f.oldValue=i[c].value);let v=f.dir[r];v&&(Mn(),mn(v,n,8,[e.el,f,e,t]),In())}}function ep(e,t){if(en){let n=en.provides;const r=en.parent&&en.parent.provides;r===n&&(n=en.provides=Object.create(r)),n[e]=t}}function jo(e,t,n=!1){const r=cl();if(r||Qs){let o=Qs?Qs._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&Ye(t)?t.call(r&&r.proxy):t}}const tp=Symbol.for("v-scx"),np=()=>jo(tp);function pt(e,t,n){return _c(e,t,n)}function _c(e,t,n=mt){const{immediate:r,deep:o,flush:i,once:c}=n,f=Pt({},n),v=t&&r||!t&&i!=="post";let b;if(Br){if(i==="sync"){const C=np();b=C.__watcherHandles||(C.__watcherHandles=[])}else if(!v){const C=()=>{};return C.stop=Pn,C.resume=Pn,C.pause=Pn,C}}const y=en;f.call=(C,I,Y)=>mn(C,y,I,Y);let _=!1;i==="post"?f.scheduler=C=>{C.i=y,Qt(C,y&&y.suspense)}:i!=="sync"&&(_=!0,f.scheduler=(C,I)=>{I?C():ol(C)}),f.augmentJob=C=>{t&&(C.flags|=4),_&&(C.flags|=2,y&&(C.id=y.uid,C.i=y))};const S=Yf(e,t,f);return Br&&(b?b.push(S):v&&S()),S}function sp(e,t,n){const r=this.proxy,o=$t(e)?e.includes(".")?kc(r,e):()=>r[e]:e.bind(r,r);let i;Ye(t)?i=t:(i=t.handler,n=t);const c=Jr(this),f=_c(o,i.bind(r),n);return c(),f}function kc(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}const ss=new WeakMap,xc=Symbol("_vte"),ya=e=>e.__isTeleport,As=e=>e&&(e.disabled||e.disabled===""),rp=e=>e&&(e.defer||e.defer===""),ru=e=>typeof SVGElement<"u"&&e instanceof SVGElement,ou=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ei=(e,t)=>{const n=e&&e.to;return $t(n)?t?t(n):null:n},op={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,i,c,f,v,b){const{mc:y,pc:_,pbc:S,o:{insert:C,querySelector:I,createText:Y,createComment:le,parentNode:ce}}=b,ue=As(t.props);let{dynamicChildren:W}=t;const A=(G,te,P)=>{G.shapeFlag&16&&y(G.children,te,P,o,i,c,f,v)},L=(G=t)=>{const te=As(G.props),P=G.target=Ei(G.props,I),E=Ti(P,G,Y,C);P&&(c!=="svg"&&ru(P)?c="svg":c!=="mathml"&&ou(P)&&(c="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(P),te||(A(G,P,E),xr(G,!1)))},Z=G=>{const te=()=>{if(ss.get(G)===te){if(ss.delete(G),As(G.props)){const P=ce(G.el)||n;A(G,P,G.anchor),xr(G,!0)}L(G)}};ss.set(G,te),Qt(te,i)};if(e==null){const G=t.el=Y(""),te=t.anchor=Y("");if(C(G,n,r),C(te,n,r),rp(t.props)||i&&i.pendingBranch){Z(t);return}ue&&(A(t,n,te),xr(t,!0)),L()}else{t.el=e.el;const G=t.anchor=e.anchor,te=ss.get(e);if(te){te.flags|=8,ss.delete(e),Z(t);return}t.targetStart=e.targetStart;const P=t.target=e.target,E=t.targetAnchor=e.targetAnchor,j=As(e.props),ne=j?n:P,Me=j?G:E;if(c==="svg"||ru(P)?c="svg":(c==="mathml"||ou(P))&&(c="mathml"),W?(S(e.dynamicChildren,W,ne,o,i,c,f),ul(e,t,!0)):v||_(e,t,ne,Me,o,i,c,f,!1),ue)j?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Ao(t,n,G,b,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Ee=Ei(t.props,I);Ee&&(t.target=Ee,Ao(t,Ee,null,b,0))}else j&&Ao(t,P,E,b,1);xr(t,ue)}},remove(e,t,n,{um:r,o:{remove:o}},i){const{shapeFlag:c,children:f,anchor:v,targetStart:b,targetAnchor:y,target:_,props:S}=e,C=As(S),I=i||!C,Y=ss.get(e);if(Y&&(Y.flags|=8,ss.delete(e)),_&&(o(b),o(y)),i&&o(v),!Y&&(C||_)&&c&16)for(let le=0;le<f.length;le++){const ce=f[le];r(ce,t,n,I,!!ce.dynamicChildren)}},move:Ao,hydrate:ap};function Ao(e,t,n,{o:{insert:r},m:o},i=2){i===0&&(e.targetStart&&r(e.targetStart,t,n),r(e.targetAnchor,t,n),n=e.targetAnchor);const{el:c,anchor:f,shapeFlag:v,children:b,props:y}=e,_=i===2;if(_&&r(c,t,n),!ss.has(e)&&(!_||As(y))&&v&16)for(let S=0;S<b.length;S++)o(b[S],t,n,2);_&&r(f,t,n)}function ap(e,t,n,r,o,i,{o:{nextSibling:c,parentNode:f,querySelector:v,insert:b,createText:y}},_){function S(le,ce){let ue=ce;for(;ue;){if(ue&&ue.nodeType===8){if(ue.data==="teleport start anchor")t.targetStart=ue;else if(ue.data==="teleport anchor"){t.targetAnchor=ue,le._lpa=t.targetAnchor&&c(t.targetAnchor);break}}ue=c(ue)}}function C(le,ce){ce.anchor=_(c(le),ce,f(le),n,r,o,i)}const I=t.target=Ei(t.props,v),Y=As(t.props);if(I){const le=I._lpa||I.firstChild;t.shapeFlag&16&&(Y?(C(e,t),S(I,le),t.targetAnchor||Ti(I,t,y,b,f(e)===I?e:null)):(t.anchor=c(e),S(I,le),t.targetAnchor||Ti(I,t,y,b),_(le&&c(le),t,I,n,r,o,i))),xr(t,Y)}else Y&&t.shapeFlag&16&&(C(e,t),t.targetStart=e,t.targetAnchor=c(e));return t.anchor&&c(t.anchor)}const zn=op;function xr(e,t){const n=e.ctx;if(n&&n.ut){let r,o;for(t?(r=e.el,o=e.anchor):(r=e.targetStart,o=e.targetAnchor);r&&r!==o;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Ti(e,t,n,r,o=null){const i=t.targetStart=n(""),c=t.targetAnchor=n("");return i[xc]=c,e&&(r(i,e,o),r(c,e,o)),c}const cn=Symbol("_leaveCb"),_r=Symbol("_enterCb");function Cc(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ln(()=>{e.isMounted=!0}),Oc(()=>{e.isUnmounting=!0}),e}const un=[Function,Array],$c={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:un,onEnter:un,onAfterEnter:un,onEnterCancelled:un,onBeforeLeave:un,onLeave:un,onAfterLeave:un,onLeaveCancelled:un,onBeforeAppear:un,onAppear:un,onAfterAppear:un,onAppearCancelled:un},ip={name:"BaseTransition",props:$c,setup(e,{slots:t}){const n=cl(),r=Cc();return()=>{const o=t.default&&al(t.default(),!0),i=o&&o.length?Sc(o):n.subTree?he():void 0;if(!i)return;const c=ut(e),{mode:f}=c;if(r.isLeaving)return di(i);const v=zo(i);if(!v)return di(i);let b=Kr(v,c,r,n,_=>b=_);v.type!==Wt&&ds(v,b);let y=n.subTree&&zo(n.subTree);if(y&&y.type!==Wt&&!Ps(y,v)&&Rr(n.subTree)){let _=Kr(y,c,r,n);if(ds(y,_),f==="out-in"&&v.type!==Wt)return r.isLeaving=!0,_.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete _.afterLeave,y=void 0},di(i);f==="in-out"&&v.type!==Wt?_.delayLeave=(S,C,I)=>{const Y=Ec(r,y);Y[String(y.key)]=y,S[cn]=()=>{C(),S[cn]=void 0,delete b.delayedLeave,y=void 0},b.delayedLeave=()=>{I(),delete b.delayedLeave,y=void 0}}:y=void 0}else y&&(y=void 0);return i}}};function Sc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Wt){t=n;break}}return t}const lp=ip;function Ec(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Kr(e,t,n,r,o){const{appear:i,mode:c,persisted:f=!1,onBeforeEnter:v,onEnter:b,onAfterEnter:y,onEnterCancelled:_,onBeforeLeave:S,onLeave:C,onAfterLeave:I,onLeaveCancelled:Y,onBeforeAppear:le,onAppear:ce,onAfterAppear:ue,onAppearCancelled:W}=t,A=String(e.key),L=Ec(n,e),Z=(P,E)=>{P&&mn(P,r,9,E)},G=(P,E)=>{const j=E[1];Z(P,E),He(P)?P.every(ne=>ne.length<=1)&&j():P.length<=1&&j()},te={mode:c,persisted:f,beforeEnter(P){let E=v;if(!n.isMounted)if(i)E=le||v;else return;P[cn]&&P[cn](!0);const j=L[A];if(j&&Ps(e,j)){let ne=j.el[cn];if(!ne){const Me=Rr(j);ne=Me&&Me.el[cn]}ne&&ne()}Z(E,[P])},enter(P){if(L[A]===e)return;let E=b,j=y,ne=_;if(!n.isMounted)if(i)E=ce||b,j=ue||y,ne=W||_;else return;let Me=!1;P[_r]=ye=>{Me||(Me=!0,ye?Z(ne,[P]):Z(j,[P]),te.delayedLeave&&te.delayedLeave(),P[_r]=void 0)};const Ee=P[_r].bind(null,!1);E?G(E,[P,Ee]):Ee()},leave(P,E){const j=String(e.key);if(P[_r]&&P[_r](!0),n.isUnmounting)return E();Z(S,[P]);let ne=!1;P[cn]=Ee=>{ne||(ne=!0,E(),Ee?Z(Y,[P]):Z(I,[P]),P[cn]=void 0,L[j]===e&&delete L[j])};const Me=P[cn].bind(null,!1);L[j]=e,C?G(C,[P,Me]):Me()},clone(P){const E=Kr(P,t,n,r,o);return o&&o(E),E}};return te}function di(e){if(ga(e))return e=fs(e),e.children=null,e}function zo(e){if(!ga(e))return ya(e.type)&&e.children?Sc(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Ye(n.default))return n.default()}}function ds(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;ds(ya(n.type)&&zo(n)||n,t)}else if(e.shapeFlag&128)e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback);else if(e.transition=t,e.type===je&&He(e.children)){const n=Lc(e.children,!1);n&&ds(n,t)}}function al(e,t=!1,n){let r=[],o=0;for(let i=0;i<e.length;i++){let c=e[i];const f=n==null?c.key:String(n)+String(c.key!=null?c.key:i);c.type===je?(c.patchFlag&128&&o++,r=r.concat(al(c.children,t,f))):(t||c.type!==Wt)&&r.push(f!=null?fs(c,{key:f}):c)}if(o>1)for(let i=0;i<r.length;i++)r[i].patchFlag=-2;return r}function Rr(e){if(e.component)return Rr(e.component.subTree);if(e.type===je){const t=He(e.children)&&Lc(e.children,!1);return t?Rr(t):void 0}if(e.type!==Wt)return e}function jt(e,t){return Ye(e)?Pt({name:e.name},t,{setup:e}):e}function Tc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function au(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Wo=new WeakMap;function Ar(e,t,n,r,o=!1){if(He(e)){e.forEach((Y,le)=>Ar(Y,t&&(He(t)?t[le]:t),n,r,o));return}if(Pr(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Ar(e,t,n,r.component.subTree);return}const i=r.shapeFlag&4?ka(r.component):r.el,c=o?null:i,{i:f,r:v}=e,b=t&&t.r,y=f.refs===mt?f.refs={}:f.refs,_=f.setupState,S=ut(_),C=_===mt?qu:Y=>au(y,Y)?!1:dt(S,Y),I=(Y,le)=>!(le&&au(y,le));if(b!=null&&b!==v){if(iu(t),$t(b))y[b]=null,C(b)&&(_[b]=null);else if(Gt(b)){const Y=t;I(b,Y.k)&&(b.value=null),Y.k&&(y[Y.k]=null)}}if(Ye(v))Yr(v,f,12,[c,y]);else{const Y=$t(v),le=Gt(v);if(Y||le){const ce=()=>{if(e.f){const ue=Y?C(v)?_[v]:y[v]:I()||!e.k?v.value:y[e.k];if(o)He(ue)&&Yi(ue,i);else if(He(ue))ue.includes(i)||ue.push(i);else if(Y)y[v]=[i],C(v)&&(_[v]=y[v]);else{const W=[i];I(v,e.k)&&(v.value=W),e.k&&(y[e.k]=W)}}else Y?(y[v]=c,C(v)&&(_[v]=c)):le&&(I(v,e.k)&&(v.value=c),e.k&&(y[e.k]=c))};if(c){const ue=()=>{ce(),Wo.delete(e)};ue.id=-1,Wo.set(e,ue),Qt(ue,n)}else iu(e),ce()}}}function iu(e){const t=Wo.get(e);t&&(t.flags|=8,Wo.delete(e))}va().requestIdleCallback;va().cancelIdleCallback;const Pr=e=>!!e.type.__asyncLoader,ga=e=>e.type.__isKeepAlive;function up(e,t){Ac(e,"a",t)}function cp(e,t){Ac(e,"da",t)}function Ac(e,t,n=en){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(ba(t,r,n),n){let o=n.parent;for(;o&&o.parent;)ga(o.parent.vnode)&&dp(r,t,n,o),o=o.parent}}function dp(e,t,n,r){const o=ba(t,e,r,!0);Ln(()=>{Yi(r[t],o)},n)}function ba(e,t,n=en,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...c)=>{Mn();const f=Jr(n),v=mn(t,n,e,c);return f(),In(),v});return r?o.unshift(i):o.push(i),i}}const Gn=e=>(t,n=en)=>{(!Br||e==="sp")&&ba(e,(...r)=>t(...r),n)},fp=Gn("bm"),ln=Gn("m"),pp=Gn("bu"),Pc=Gn("u"),Oc=Gn("bum"),Ln=Gn("um"),vp=Gn("sp"),mp=Gn("rtg"),hp=Gn("rtc");function yp(e,t=en){ba("ec",e,t)}const gp=Symbol.for("v-ndc");function et(e,t,n,r){let o;const i=n,c=He(e);if(c||$t(e)){const f=c&&ls(e);let v=!1,b=!1;f&&(v=!fn(e),b=jn(e),e=ma(e)),o=new Array(e.length);for(let y=0,_=e.length;y<_;y++)o[y]=t(v?b?cs(vn(e[y])):vn(e[y]):e[y],y,void 0,i)}else if(typeof e=="number")if(!Number.isInteger(e)||e<0)o=[];else{o=new Array(e);for(let f=0;f<e;f++)o[f]=t(f+1,f,void 0,i)}else if(ft(e))if(e[Symbol.iterator])o=Array.from(e,(f,v)=>t(f,v,void 0,i));else{const f=Object.keys(e);o=new Array(f.length);for(let v=0,b=f.length;v<b;v++){const y=f[v];o[v]=t(e[y],y,v,i)}}else o=[];return o}const Ai=e=>e?Qc(e)?ka(e):Ai(e.parent):null,Or=Pt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Ai(e.parent),$root:e=>Ai(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ic(e),$forceUpdate:e=>e.f||(e.f=()=>{ol(e.update)}),$nextTick:e=>e.n||(e.n=lr.bind(e.proxy)),$watch:e=>sp.bind(e)}),fi=(e,t)=>e!==mt&&!e.__isScriptSetup&&dt(e,t),bp={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:o,props:i,accessCache:c,type:f,appContext:v}=e;if(t[0]!=="$"){const S=c[t];if(S!==void 0)switch(S){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(fi(r,t))return c[t]=1,r[t];if(o!==mt&&dt(o,t))return c[t]=2,o[t];if(dt(i,t))return c[t]=3,i[t];if(n!==mt&&dt(n,t))return c[t]=4,n[t];Pi&&(c[t]=0)}}const b=Or[t];let y,_;if(b)return t==="$attrs"&&zt(e.attrs,"get",""),b(e);if((y=f.__cssModules)&&(y=y[t]))return y;if(n!==mt&&dt(n,t))return c[t]=4,n[t];if(_=v.config.globalProperties,dt(_,t))return _[t]},set({_:e},t,n){const{data:r,setupState:o,ctx:i}=e;return fi(o,t)?(o[t]=n,!0):r!==mt&&dt(r,t)?(r[t]=n,!0):dt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,props:i,type:c}},f){let v;return!!(n[f]||e!==mt&&f[0]!=="$"&&dt(e,f)||fi(t,f)||dt(i,f)||dt(r,f)||dt(Or,f)||dt(o.config.globalProperties,f)||(v=c.__cssModules)&&v[f])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:dt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function lu(e){return He(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Pi=!0;function wp(e){const t=Ic(e),n=e.proxy,r=e.ctx;Pi=!1,t.beforeCreate&&uu(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:c,watch:f,provide:v,inject:b,created:y,beforeMount:_,mounted:S,beforeUpdate:C,updated:I,activated:Y,deactivated:le,beforeDestroy:ce,beforeUnmount:ue,destroyed:W,unmounted:A,render:L,renderTracked:Z,renderTriggered:G,errorCaptured:te,serverPrefetch:P,expose:E,inheritAttrs:j,components:ne,directives:Me,filters:Ee}=t;if(b&&_p(b,r,null),c)for(const Ue in c){const de=c[Ue];Ye(de)&&(r[Ue]=de.bind(n))}if(o){const Ue=o.call(n,n);ft(Ue)&&(e.data=nl(Ue))}if(Pi=!0,i)for(const Ue in i){const de=i[Ue],ke=Ye(de)?de.bind(n,n):Ye(de.get)?de.get.bind(n,n):Pn,Se=!Ye(de)&&Ye(de.set)?de.set.bind(n):Pn,De=st({get:ke,set:Se});Object.defineProperty(r,Ue,{enumerable:!0,configurable:!0,get:()=>De.value,set:$e=>De.value=$e})}if(f)for(const Ue in f)Mc(f[Ue],r,n,Ue);if(v){const Ue=Ye(v)?v.call(n):v;Reflect.ownKeys(Ue).forEach(de=>{ep(de,Ue[de])})}y&&uu(y,e,"c");function Ae(Ue,de){He(de)?de.forEach(ke=>Ue(ke.bind(n))):de&&Ue(de.bind(n))}if(Ae(fp,_),Ae(ln,S),Ae(pp,C),Ae(Pc,I),Ae(up,Y),Ae(cp,le),Ae(yp,te),Ae(hp,Z),Ae(mp,G),Ae(Oc,ue),Ae(Ln,A),Ae(vp,P),He(E))if(E.length){const Ue=e.exposed||(e.exposed={});E.forEach(de=>{Object.defineProperty(Ue,de,{get:()=>n[de],set:ke=>n[de]=ke,enumerable:!0})})}else e.exposed||(e.exposed={});L&&e.render===Pn&&(e.render=L),j!=null&&(e.inheritAttrs=j),ne&&(e.components=ne),Me&&(e.directives=Me),P&&Tc(e)}function _p(e,t,n=Pn){He(e)&&(e=Oi(e));for(const r in e){const o=e[r];let i;ft(o)?"default"in o?i=jo(o.from||r,o.default,!0):i=jo(o.from||r):i=jo(o),Gt(i)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:c=>i.value=c}):t[r]=i}}function uu(e,t,n){mn(He(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Mc(e,t,n,r){let o=r.includes(".")?kc(n,r):()=>n[r];if($t(e)){const i=t[e];Ye(i)&&pt(o,i)}else if(Ye(e))pt(o,e.bind(n));else if(ft(e))if(He(e))e.forEach(i=>Mc(i,t,n,r));else{const i=Ye(e.handler)?e.handler.bind(n):t[e.handler];Ye(i)&&pt(o,i,e)}}function Ic(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:c}}=e.appContext,f=i.get(t);let v;return f?v=f:!o.length&&!n&&!r?v=t:(v={},o.length&&o.forEach(b=>Go(v,b,c,!0)),Go(v,t,c)),ft(t)&&i.set(t,v),v}function Go(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&Go(e,i,n,!0),o&&o.forEach(c=>Go(e,c,n,!0));for(const c in t)if(!(r&&c==="expose")){const f=kp[c]||n&&n[c];e[c]=f?f(e[c],t[c]):t[c]}return e}const kp={data:cu,props:du,emits:du,methods:Cr,computed:Cr,beforeCreate:Xt,created:Xt,beforeMount:Xt,mounted:Xt,beforeUpdate:Xt,updated:Xt,beforeDestroy:Xt,beforeUnmount:Xt,destroyed:Xt,unmounted:Xt,activated:Xt,deactivated:Xt,errorCaptured:Xt,serverPrefetch:Xt,components:Cr,directives:Cr,watch:Cp,provide:cu,inject:xp};function cu(e,t){return t?e?function(){return Pt(Ye(e)?e.call(this,this):e,Ye(t)?t.call(this,this):t)}:t:e}function xp(e,t){return Cr(Oi(e),Oi(t))}function Oi(e){if(He(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Xt(e,t){return e?[...new Set([].concat(e,t))]:t}function Cr(e,t){return e?Pt(Object.create(null),e,t):t}function du(e,t){return e?He(e)&&He(t)?[...new Set([...e,...t])]:Pt(Object.create(null),lu(e),lu(t??{})):t}function Cp(e,t){if(!e)return t;if(!t)return e;const n=Pt(Object.create(null),e);for(const r in t)n[r]=Xt(e[r],t[r]);return n}function jc(){return{app:null,config:{isNativeTag:qu,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let $p=0;function Sp(e,t){return function(r,o=null){Ye(r)||(r=Pt({},r)),o!=null&&!ft(o)&&(o=null);const i=jc(),c=new WeakSet,f=[];let v=!1;const b=i.app={_uid:$p++,_component:r,_props:o,_container:null,_context:i,_instance:null,version:rv,get config(){return i.config},set config(y){},use(y,..._){return c.has(y)||(y&&Ye(y.install)?(c.add(y),y.install(b,..._)):Ye(y)&&(c.add(y),y(b,..._))),b},mixin(y){return i.mixins.includes(y)||i.mixins.push(y),b},component(y,_){return _?(i.components[y]=_,b):i.components[y]},directive(y,_){return _?(i.directives[y]=_,b):i.directives[y]},mount(y,_,S){if(!v){const C=b._ceVNode||we(r,o);return C.appContext=i,S===!0?S="svg":S===!1&&(S=void 0),e(C,y,S),v=!0,b._container=y,y.__vue_app__=b,ka(C.component)}},onUnmount(y){f.push(y)},unmount(){v&&(mn(f,b._instance,16),e(null,b._container),delete b._container.__vue_app__)},provide(y,_){return i.provides[y]=_,b},runWithContext(y){const _=Qs;Qs=b;try{return y()}finally{Qs=_}}};return b}}let Qs=null;const Ep=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${gn(t)}Modifiers`]||e[`${ms(t)}Modifiers`];function Tp(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||mt;let o=n;const i=t.startsWith("update:"),c=i&&Ep(r,t.slice(7));c&&(c.trim&&(o=n.map(y=>$t(y)?y.trim():y)),c.number&&(o=o.map(pa)));let f,v=r[f=oi(t)]||r[f=oi(gn(t))];!v&&i&&(v=r[f=oi(ms(t))]),v&&mn(v,e,6,o);const b=r[f+"Once"];if(b){if(!e.emitted)e.emitted={};else if(e.emitted[f])return;e.emitted[f]=!0,mn(b,e,6,o)}}const Ap=new WeakMap;function Dc(e,t,n=!1){const r=n?Ap:t.emitsCache,o=r.get(e);if(o!==void 0)return o;const i=e.emits;let c={},f=!1;if(!Ye(e)){const v=b=>{const y=Dc(b,t,!0);y&&(f=!0,Pt(c,y))};!n&&t.mixins.length&&t.mixins.forEach(v),e.extends&&v(e.extends),e.mixins&&e.mixins.forEach(v)}return!i&&!f?(ft(e)&&r.set(e,null),null):(He(i)?i.forEach(v=>c[v]=null):Pt(c,i),ft(e)&&r.set(e,c),c)}function wa(e,t){return!e||!ca(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),dt(e,t[0].toLowerCase()+t.slice(1))||dt(e,ms(t))||dt(e,t))}function fu(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[i],slots:c,attrs:f,emit:v,render:b,renderCache:y,props:_,data:S,setupState:C,ctx:I,inheritAttrs:Y}=e,le=Ho(e);let ce,ue;try{if(n.shapeFlag&4){const A=o||r,L=A;ce=Tn(b.call(L,A,y,_,C,S,I)),ue=f}else{const A=t;ce=Tn(A.length>1?A(_,{attrs:f,slots:c,emit:v}):A(_,null)),ue=t.props?f:Pp(f)}}catch(A){Ds.length=0,ha(A,e,1),ce=we(Wt)}let W=ce;if(ue&&Y!==!1){const A=Object.keys(ue),{shapeFlag:L}=W;A.length&&L&7&&(i&&A.some(da)&&(ue=Op(ue,i)),W=fs(W,ue,!1,!0))}if(n.dirs&&(W=fs(W,null,!1,!0),W.dirs=W.dirs?W.dirs.concat(n.dirs):n.dirs),n.transition){const A=ya(W.type)&&zo(W)||W;ds(A,n.transition)}return ce=W,Ho(le),ce}function Lc(e,t=!0){let n;for(let r=0;r<e.length;r++){const o=e[r];if(Nr(o)){if(o.type!==Wt||o.children==="v-if"){if(n)return;n=o}}else return}return n}const Pp=e=>{let t;for(const n in e)(n==="class"||n==="style"||ca(n))&&((t||(t={}))[n]=e[n]);return t},Op=(e,t)=>{const n={};for(const r in e)(!da(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Mp(e,t,n){const{props:r,children:o,component:i}=e,{props:c,children:f,patchFlag:v}=t,b=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&v>=0){if(v&1024)return!0;if(v&16)return r?pu(r,c,b):!!c;if(v&8){const y=t.dynamicProps;for(let _=0;_<y.length;_++){const S=y[_];if(Kc(c,r,S)&&!wa(b,S))return!0}}}else return(o||f)&&(!f||!f.$stable)?!0:r===c?!1:r?c?pu(r,c,b):!0:!!c;return!1}function pu(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o<r.length;o++){const i=r[o];if(!dt(e,i)||Kc(t,e,i)&&!wa(n,i))return!0}return!1}function Kc(e,t,n){const r=e[n],o=t[n];return n==="style"&&ft(r)&&ft(o)?!us(r,o):r!==o}function Ip({vnode:e,parent:t,suspense:n},r){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=r,e=o),o===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const Rc={},Fc=()=>Object.create(Rc),Nc=e=>Object.getPrototypeOf(e)===Rc;function jp(e,t,n,r=!1){const o={},i=Fc();e.propsDefaults=Object.create(null),Vc(e,t,o,i);for(const c in e.propsOptions[0])c in o||(o[c]=void 0);n?e.props=r?o:Vf(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function Dp(e,t,n,r){const{props:o,attrs:i,vnode:{patchFlag:c}}=e,f=ut(o),[v]=e.propsOptions;let b=!1;if((r||c>0)&&!(c&16)){if(c&8){const y=e.vnode.dynamicProps;for(let _=0;_<y.length;_++){let S=y[_];if(wa(e.emitsOptions,S))continue;const C=t[S];if(v)if(dt(i,S))C!==i[S]&&(i[S]=C,b=!0);else{const I=gn(S);o[I]=Mi(v,f,I,C,e,!1)}else C!==i[S]&&(i[S]=C,b=!0)}}}else{Vc(e,t,o,i)&&(b=!0);let y;for(const _ in f)(!t||!dt(t,_)&&((y=ms(_))===_||!dt(t,y)))&&(v?n&&(n[_]!==void 0||n[y]!==void 0)&&(o[_]=Mi(v,f,_,void 0,e,!0)):delete o[_]);if(i!==f)for(const _ in i)(!t||!dt(t,_))&&(delete i[_],b=!0)}b&&Bn(e.attrs,"set","")}function Vc(e,t,n,r){const[o,i]=e.propsOptions;let c=!1,f;if(t)for(let v in t){if(Sr(v))continue;const b=t[v];let y;o&&dt(o,y=gn(v))?!i||!i.includes(y)?n[y]=b:(f||(f={}))[y]=b:wa(e.emitsOptions,v)||(!(v in r)||b!==r[v])&&(r[v]=b,c=!0)}if(i){const v=ut(n),b=f||mt;for(let y=0;y<i.length;y++){const _=i[y];n[_]=Mi(o,v,_,b[_],e,!dt(b,_))}}return c}function Mi(e,t,n,r,o,i){const c=e[n];if(c!=null){const f=dt(c,"default");if(f&&r===void 0){const v=c.default;if(c.type!==Function&&!c.skipFactory&&Ye(v)){const{propsDefaults:b}=o;if(n in b)r=b[n];else{const y=Jr(o);r=b[n]=v.call(null,t),y()}}else r=v;o.ce&&o.ce._setProp(n,r)}c[0]&&(i&&!f?r=!1:c[1]&&(r===""||r===ms(n))&&(r=!0))}return r}const Lp=new WeakMap;function Bc(e,t,n=!1){const r=n?Lp:t.propsCache,o=r.get(e);if(o)return o;const i=e.props,c={},f=[];let v=!1;if(!Ye(e)){const y=_=>{v=!0;const[S,C]=Bc(_,t,!0);Pt(c,S),C&&f.push(...C)};!n&&t.mixins.length&&t.mixins.forEach(y),e.extends&&y(e.extends),e.mixins&&e.mixins.forEach(y)}if(!i&&!v)return ft(e)&&r.set(e,Ms),Ms;if(He(i))for(let y=0;y<i.length;y++){const _=gn(i[y]);vu(_)&&(c[_]=mt)}else if(i)for(const y in i){const _=gn(y);if(vu(_)){const S=i[y],C=c[_]=He(S)||Ye(S)?{type:S}:Pt({},S),I=C.type;let Y=!1,le=!0;if(He(I))for(let ce=0;ce<I.length;++ce){const ue=I[ce],W=Ye(ue)&&ue.name;if(W==="Boolean"){Y=!0;break}else W==="String"&&(le=!1)}else Y=Ye(I)&&I.name==="Boolean";C[0]=Y,C[1]=le,(Y||dt(C,"default"))&&f.push(_)}}const b=[c,f];return ft(e)&&r.set(e,b),b}function vu(e){return e[0]!=="$"&&!Sr(e)}const il=e=>e==="_"||e==="_ctx"||e==="$stable",ll=e=>He(e)?e.map(Tn):[Tn(e)],Kp=(e,t,n)=>{if(t._n)return t;const r=Wn((...o)=>ll(t(...o)),n);return r._c=!1,r},Uc=(e,t,n)=>{const r=e._ctx;for(const o in e){if(il(o))continue;const i=e[o];if(Ye(i))t[o]=Kp(o,i,r);else if(i!=null){const c=ll(i);t[o]=()=>c}}},qc=(e,t)=>{const n=ll(t);e.slots.default=()=>n},Hc=(e,t,n)=>{for(const r in t)(n||!il(r))&&(e[r]=t[r])},Rp=(e,t,n)=>{const r=e.slots=Fc();if(e.vnode.shapeFlag&32){const o=t._;o?(Hc(r,t,n),n&&Yu(r,"_",o,!0)):Uc(t,r)}else t&&qc(e,t)},Fp=(e,t,n)=>{const{vnode:r,slots:o}=e;let i=!0,c=mt;if(r.shapeFlag&32){const f=t._;f?n&&f===1?i=!1:Hc(o,t,n):(i=!t.$stable,Uc(t,o)),c=t}else t&&(qc(e,t),c={default:1});if(i)for(const f in o)!il(f)&&c[f]==null&&delete o[f]},Qt=qp;function Np(e){return Vp(e)}function Vp(e,t){const n=va();n.__VUE__=!0;const{insert:r,remove:o,patchProp:i,createElement:c,createText:f,createComment:v,setText:b,setElementText:y,parentNode:_,nextSibling:S,setScopeId:C=Pn,insertStaticContent:I}=e,Y=(g,m,x,D=null,ae=null,H=null,ee=void 0,T=null,X=!!m.dynamicChildren)=>{if(g===m)return;g&&!Ps(g,m)&&(D=_t(g),$e(g,ae,H,!0),g=null),m.patchFlag===-2&&(X=!1,m.dynamicChildren=null),m.dynamicChildren&&g&&g.dynamicChildren&&g.dynamicChildren.hasOnce&&(m.dynamicChildren===Ms&&(m.dynamicChildren=[]),m.dynamicChildren.hasOnce=!0);const{type:se,ref:Ce,shapeFlag:be}=m;switch(se){case _a:le(g,m,x,D);break;case Wt:ce(g,m,x,D);break;case Do:g==null&&ue(m,x,D,ee);break;case je:ne(g,m,x,D,ae,H,ee,T,X);break;default:be&1?L(g,m,x,D,ae,H,ee,T,X):be&6?Me(g,m,x,D,ae,H,ee,T,X):(be&64||be&128)&&se.process(g,m,x,D,ae,H,ee,T,X,vt)}Ce!=null&&ae?Ar(Ce,g&&g.ref,H,m||g,!m):Ce==null&&g&&g.ref!=null&&Ar(g.ref,null,H,g,!0)},le=(g,m,x,D)=>{if(g==null)r(m.el=f(m.children),x,D);else{const ae=m.el=g.el;m.children!==g.children&&b(ae,m.children)}},ce=(g,m,x,D)=>{g==null?r(m.el=v(m.children||""),x,D):m.el=g.el},ue=(g,m,x,D)=>{[g.el,g.anchor]=I(g.children,m,x,D,g.el,g.anchor)},W=({el:g,anchor:m},x,D)=>{let ae;for(;g&&g!==m;)ae=S(g),r(g,x,D),g=ae;r(m,x,D)},A=({el:g,anchor:m})=>{let x;for(;g&&g!==m;)x=S(g),o(g),g=x;o(m)},L=(g,m,x,D,ae,H,ee,T,X)=>{if(m.type==="svg"?ee="svg":m.type==="math"&&(ee="mathml"),g==null)Z(m,x,D,ae,H,ee,T,X);else{const se=g.el&&g.el._isVueCE?g.el:null;try{se&&se._beginPatch(),P(g,m,ae,H,ee,T,X)}finally{se&&se._endPatch()}}},Z=(g,m,x,D,ae,H,ee,T)=>{let X,se;const{props:Ce,shapeFlag:be,transition:Le,dirs:Te}=g;if(X=g.el=c(g.type,H,Ce&&Ce.is,Ce),be&8?y(X,g.children):be&16&&te(g.children,X,null,D,ae,pi(g,H),ee,T),Te&&Cs(g,null,D,"created"),G(X,g,g.scopeId,ee,D),Ce){for(const Ze in Ce)Ze!=="value"&&!Sr(Ze)&&i(X,Ze,null,Ce[Ze],H,D);"value"in Ce&&i(X,"value",null,Ce.value,H),(se=Ce.onVnodeBeforeMount)&&xn(se,D,g)}Te&&Cs(g,null,D,"beforeMount");const Qe=Bp(ae,Le);Qe&&Le.beforeEnter(X),r(X,m,x),((se=Ce&&Ce.onVnodeMounted)||Qe||Te)&&Qt(()=>{try{se&&xn(se,D,g),Qe&&Le.enter(X),Te&&Cs(g,null,D,"mounted")}finally{}},ae)},G=(g,m,x,D,ae)=>{if(x&&C(g,x),D)for(let H=0;H<D.length;H++)C(g,D[H]);if(ae){let H=ae.subTree;if(m===H||Wc(H.type)&&(H.ssContent===m||H.ssFallback===m)){const ee=ae.vnode;G(g,ee,ee.scopeId,ee.slotScopeIds,ae.parent)}}},te=(g,m,x,D,ae,H,ee,T,X=0)=>{for(let se=X;se<g.length;se++){const Ce=g[se]=T?Vn(g[se]):Tn(g[se]);Y(null,Ce,m,x,D,ae,H,ee,T)}},P=(g,m,x,D,ae,H,ee)=>{const T=m.el=g.el;let{patchFlag:X,dynamicChildren:se,dirs:Ce}=m;X|=g.patchFlag&16;const be=g.props||mt,Le=m.props||mt;let Te;if(x&&$s(x,!1),(Te=Le.onVnodeBeforeUpdate)&&xn(Te,x,m,g),Ce&&Cs(m,g,x,"beforeUpdate"),x&&$s(x,!0),se&&(!g.dynamicChildren||g.dynamicChildren.length!==se.length)&&(X=0,ee=!1,se=null),(be.innerHTML&&Le.innerHTML==null||be.textContent&&Le.textContent==null)&&y(T,""),se?E(g.dynamicChildren,se,T,x,D,pi(m,ae),H):ee||de(g,m,T,null,x,D,pi(m,ae),H,!1),X>0){if(X&16)j(T,be,Le,x,ae);else if(X&2&&be.class!==Le.class&&i(T,"class",null,Le.class,ae),X&4&&i(T,"style",be.style,Le.style,ae),X&8){const Qe=m.dynamicProps;for(let Ze=0;Ze<Qe.length;Ze++){const tt=Qe[Ze],kt=be[tt],St=Le[tt];(St!==kt||tt==="value")&&i(T,tt,kt,St,ae,x)}}X&1&&g.children!==m.children&&y(T,m.children)}else!ee&&se==null&&j(T,be,Le,x,ae);((Te=Le.onVnodeUpdated)||Ce)&&Qt(()=>{Te&&xn(Te,x,m,g),Ce&&Cs(m,g,x,"updated")},D)},E=(g,m,x,D,ae,H,ee)=>{for(let T=0;T<m.length;T++){const X=g[T],se=m[T],Ce=X.el||Ii(X),be=Ce&&(X.type===je||!Ps(X,se)||X.shapeFlag&198)?_(Ce):x;Y(X,se,be,null,D,ae,H,ee,!0)}},j=(g,m,x,D,ae)=>{if(m!==x){if(m!==mt)for(const H in m)!Sr(H)&&!(H in x)&&i(g,H,m[H],null,ae,D);for(const H in x){if(Sr(H))continue;const ee=x[H],T=m[H];ee!==T&&H!=="value"&&i(g,H,T,ee,ae,D)}"value"in x&&i(g,"value",m.value,x.value,ae)}},ne=(g,m,x,D,ae,H,ee,T,X)=>{const se=m.el=g?g.el:f(""),Ce=m.anchor=g?g.anchor:f("");let{patchFlag:be,dynamicChildren:Le,slotScopeIds:Te}=m;Te&&(T=T?T.concat(Te):Te),g==null?(r(se,x,D),r(Ce,x,D),te(m.children||[],x,Ce,ae,H,ee,T,X)):be>0&&be&64&&Le&&g.dynamicChildren&&g.dynamicChildren.length===Le.length?(E(g.dynamicChildren,Le,x,ae,H,ee,T),(m.key!=null||ae&&m===ae.subTree)&&ul(g,m,!0)):de(g,m,x,Ce,ae,H,ee,T,X)},Me=(g,m,x,D,ae,H,ee,T,X)=>{m.slotScopeIds=T,g==null?m.shapeFlag&512?ae.ctx.activate(m,x,D,ee,X):Ee(m,x,D,ae,H,ee,X):ye(g,m,X)},Ee=(g,m,x,D,ae,H,ee)=>{const T=g.component=Xp(g,D,ae);if(ga(g)&&(T.ctx.renderer=vt),Qp(T,!1,ee),T.asyncDep){if(ae&&ae.registerDep(T,Ae,ee,H),!g.el){const X=T.subTree=we(Wt);ce(null,X,m,x),g.placeholder=X.el}}else Ae(T,g,m,x,ae,H,ee)},ye=(g,m,x)=>{const D=m.component=g.component;if(Mp(g,m,x))if(D.asyncDep&&!D.asyncResolved){m.el=g.el,m.placeholder=g.placeholder,Ue(D,m,x);return}else D.next=m,D.update();else m.el=g.el,m.placeholder=g.placeholder,D.vnode=m},Ae=(g,m,x,D,ae,H,ee)=>{const T=()=>{if(g.isMounted){let{next:be,bu:Le,u:Te,parent:Qe,vnode:Ze}=g;{const Yt=zc(g);if(Yt){be&&(be.el=Ze.el,Ue(g,be,ee)),Yt.asyncDep.then(()=>{Qt(()=>{g.isUnmounted||se()},ae)});return}}let tt=be,kt;$s(g,!1),be?(be.el=Ze.el,Ue(g,be,ee)):be=Ze,Le&&Io(Le),(kt=be.props&&be.props.onVnodeBeforeUpdate)&&xn(kt,Qe,be,Ze),$s(g,!0);const St=fu(g),tn=g.subTree;g.subTree=St,Y(tn,St,_(tn.el),_t(tn),g,ae,H),be.el=St.el,tt===null&&Ip(g,St.el),Te&&Qt(Te,ae),(kt=be.props&&be.props.onVnodeUpdated)&&Qt(()=>xn(kt,Qe,be,Ze),ae)}else{let be;const{el:Le,props:Te}=m,{bm:Qe,m:Ze,parent:tt,root:kt,type:St}=g,tn=Pr(m);$s(g,!1),Qe&&Io(Qe),!tn&&(be=Te&&Te.onVnodeBeforeMount)&&xn(be,tt,m),$s(g,!0);{kt.ce&&kt.ce._hasShadowRoot()&&kt.ce._injectChildStyle(St,g.parent?g.parent.type:void 0);const Yt=g.subTree=fu(g);Y(null,Yt,x,D,g,ae,H),m.el=Yt.el}if(Ze&&Qt(Ze,ae),!tn&&(be=Te&&Te.onVnodeMounted)){const Yt=m;Qt(()=>xn(be,tt,Yt),ae)}(m.shapeFlag&256||tt&&Pr(tt.vnode)&&tt.vnode.shapeFlag&256)&&g.a&&Qt(g.a,ae),g.isMounted=!0,m=x=D=null}};g.scope.on();const X=g.effect=new Zu(T);g.scope.off();const se=g.update=X.run.bind(X),Ce=g.job=X.runIfDirty.bind(X);Ce.i=g,Ce.id=g.uid,X.scheduler=()=>ol(Ce),$s(g,!0),se()},Ue=(g,m,x)=>{m.component=g;const D=g.vnode.props;g.vnode=m,g.next=null,Dp(g,m.props,D,x),Fp(g,m.children,x),Mn(),yc(g),In()},de=(g,m,x,D,ae,H,ee,T,X=!1)=>{const se=g&&g.children,Ce=g?g.shapeFlag:0,be=m.children,{patchFlag:Le,shapeFlag:Te}=m;if(Le>0){if(Le&128){Se(se,be,x,D,ae,H,ee,T,X);return}else if(Le&256){ke(se,be,x,D,ae,H,ee,T,X);return}}Te&8?(Ce&16&&bt(se,ae,H),be!==se&&y(x,be)):Ce&16?Te&16?Se(se,be,x,D,ae,H,ee,T,X):bt(se,ae,H,!0):(Ce&8&&y(x,""),Te&16&&te(be,x,D,ae,H,ee,T,X))},ke=(g,m,x,D,ae,H,ee,T,X)=>{g=g||Ms,m=m||Ms;const se=g.length,Ce=m.length,be=Math.min(se,Ce);let Le;for(Le=0;Le<be;Le++){const Te=m[Le]=X?Vn(m[Le]):Tn(m[Le]);Y(g[Le],Te,x,null,ae,H,ee,T,X)}se>Ce?bt(g,ae,H,!0,!1,be):te(m,x,D,ae,H,ee,T,X,be)},Se=(g,m,x,D,ae,H,ee,T,X)=>{let se=0;const Ce=m.length;let be=g.length-1,Le=Ce-1;for(;se<=be&&se<=Le;){const Te=g[se],Qe=m[se]=X?Vn(m[se]):Tn(m[se]);if(Ps(Te,Qe))Y(Te,Qe,x,null,ae,H,ee,T,X);else break;se++}for(;se<=be&&se<=Le;){const Te=g[be],Qe=m[Le]=X?Vn(m[Le]):Tn(m[Le]);if(Ps(Te,Qe))Y(Te,Qe,x,null,ae,H,ee,T,X);else break;be--,Le--}if(se>be){if(se<=Le){const Te=Le+1,Qe=Te<Ce?m[Te].el:D;for(;se<=Le;)Y(null,m[se]=X?Vn(m[se]):Tn(m[se]),x,Qe,ae,H,ee,T,X),se++}}else if(se>Le)for(;se<=be;)$e(g[se],ae,H,!0),se++;else{const Te=se,Qe=se,Ze=new Map;for(se=Qe;se<=Le;se++){const Rt=m[se]=X?Vn(m[se]):Tn(m[se]);Rt.key!=null&&Ze.set(Rt.key,se)}let tt,kt=0;const St=Le-Qe+1;let tn=!1,Yt=0;const nn=new Array(St);for(se=0;se<St;se++)nn[se]=0;for(se=Te;se<=be;se++){const Rt=g[se];if(kt>=St){$e(Rt,ae,H,!0);continue}let Ot;if(Rt.key!=null)Ot=Ze.get(Rt.key);else for(tt=Qe;tt<=Le;tt++)if(nn[tt-Qe]===0&&Ps(Rt,m[tt])){Ot=tt;break}Ot===void 0?$e(Rt,ae,H,!0):(nn[Ot-Qe]=se+1,Ot>=Yt?Yt=Ot:tn=!0,Y(Rt,m[Ot],x,null,ae,H,ee,T,X),kt++)}const hs=tn?Up(nn):Ms;for(tt=hs.length-1,se=St-1;se>=0;se--){const Rt=Qe+se,Ot=m[Rt],Be=m[Rt+1],Yn=Rt+1<Ce?Be.el||Ii(Be):D;nn[se]===0?Y(null,Ot,x,Yn,ae,H,ee,T,X):tn&&(tt<0||se!==hs[tt]?De(Ot,x,Yn,2):tt--)}}},De=(g,m,x,D,ae=null)=>{const{el:H,type:ee,transition:T,children:X,shapeFlag:se}=g;if(se&6){De(g.component.subTree,m,x,D);return}if(se&128){g.suspense.move(m,x,D);return}if(se&64){ee.move(g,m,x,vt);return}if(ee===je){r(H,m,x);for(let be=0;be<X.length;be++)De(X[be],m,x,D);r(g.anchor,m,x);return}if(ee===Do){W(g,m,x);return}if(D!==2&&se&1&&T)if(D===0)T.persisted&&!H[cn]?r(H,m,x):(T.beforeEnter(H),r(H,m,x),Qt(()=>T.enter(H),ae));else{const{leave:be,delayLeave:Le,afterLeave:Te}=T,Qe=()=>{g.ctx.isUnmounted?o(H):r(H,m,x)},Ze=()=>{const tt=H._isLeaving||!!H[cn];H._isLeaving&&H[cn](!0),T.persisted&&!tt?Qe():be(H,()=>{Qe(),Te&&Te()})};Le?Le(H,Qe,Ze):Ze()}else r(H,m,x)},$e=(g,m,x,D=!1,ae=!1)=>{const{type:H,props:ee,ref:T,children:X,dynamicChildren:se,shapeFlag:Ce,patchFlag:be,dirs:Le,cacheIndex:Te,memo:Qe}=g;if((be===-2||se&&se.hasOnce)&&(ae=!1),T!=null&&(Mn(),Ar(T,null,x,g,!0),In()),Te!=null&&(!g.ctx||g.ctx===m)&&(m.renderCache[Te]=void 0),Ce&256){m.ctx.deactivate(g);return}const Ze=Ce&1&&Le,tt=!Pr(g);let kt;if(tt&&(kt=ee&&ee.onVnodeBeforeUnmount)&&xn(kt,m,g),Ce&6)ct(g.component,x,D);else{if(Ce&128){g.suspense.unmount(x,D);return}Ze&&Cs(g,null,m,"beforeUnmount"),Ce&64?g.type.remove(g,m,x,vt,D):se&&!se.hasOnce&&(H!==je||be>0&&be&64)?bt(se,m,x,!1,!0):(H===je&&be&384||!ae&&Ce&16)&&bt(X,m,x),D&&fe(g)}const St=Qe!=null&&Te==null;(tt&&(kt=ee&&ee.onVnodeUnmounted)||Ze||St)&&Qt(()=>{kt&&xn(kt,m,g),Ze&&Cs(g,null,m,"unmounted"),St&&(g.el=null)},x)},fe=g=>{const{type:m,el:x,anchor:D,transition:ae}=g,H=m===je;if(H&&!ae){Ie(x,D);return}if(m===Do){A(g),ae&&!ae.persisted&&ae.afterLeave&&ae.afterLeave();return}const ee=H?Rr(g):g,T=()=>{H?_(x)&&Ie(x,D):o(x),ae&&!ae.persisted&&ae.afterLeave&&ae.afterLeave()};if(ee&&ee.shapeFlag&1&&ae&&!ae.persisted){const{leave:X,delayLeave:se}=ae,Ce=ee.el,be=()=>X(Ce,T);se?se(Ce,T,be):be()}else T()},Ie=(g,m)=>{let x;for(;g!==m;)x=S(g),o(g),g=x;o(m)},ct=(g,m,x)=>{const{bum:D,scope:ae,job:H,subTree:ee,um:T,m:X,a:se}=g;mu(X),mu(se),D&&Io(D),ae.stop(),H?(H.flags|=8,$e(ee,g,m,x)):g.vnode.el&&ee&&(ee.transition=g.vnode.transition,$e(ee,g,m,x)),T&&Qt(T,m),Qt(()=>{g.isUnmounted=!0},m)},bt=(g,m,x,D=!1,ae=!1,H=0)=>{for(let ee=H;ee<g.length;ee++)$e(g[ee],m,x,D,ae)},_t=g=>{if(g.shapeFlag&6)return _t(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const m=S(g.anchor||g.el),x=m&&m[xc];return x?S(x):m},Bt=(g,m,x)=>{const D=g&&m._vnode?void 0:g&&g.component?g.component.uid:Jp();Zf(()=>{g==null?m._vnode&&$e(m._vnode,null,null,!0):Y(m._vnode||null,g,m,null,null,null,x),m._vnode=g},D)},vt={p:Y,um:$e,m:De,r:fe,mt:Ee,mc:te,pc:de,pbc:E,n:_t,o:e};return{render:Bt,hydrate:void 0,createApp:Sp(Bt)}}function pi({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function $s({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Bp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ul(e,t,n=!1){const r=e.children,o=t.children;if(He(r)&&He(o))for(let i=0;i<r.length;i++){const c=r[i];let f=o[i];f.shapeFlag&1&&!f.dynamicChildren&&((f.patchFlag<=0||f.patchFlag===32)&&(f=o[i]=Vn(o[i]),f.el=c.el),!n&&f.patchFlag!==-2&&ul(c,f)),f.type===_a&&(f.patchFlag===-1&&(f=o[i]=Vn(f)),f.el=c.el),f.type===Wt&&!f.el&&(f.el=c.el)}}function Up(e){const t=e.slice(),n=[0];let r,o,i,c,f;const v=e.length;for(r=0;r<v;r++){const b=e[r];if(b!==0){if(o=n[n.length-1],e[o]<b){t[r]=o,n.push(r);continue}for(i=0,c=n.length-1;i<c;)f=i+c>>1,e[n[f]]<b?i=f+1:c=f;b<e[n[i]]&&(i>0&&(t[r]=n[i-1]),n[i]=r)}}for(i=n.length,c=n[i-1];i-- >0;)n[i]=c,c=t[c];return n}function zc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:zc(t)}function mu(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Ii(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Ii(t.subTree):null}const Wc=e=>e.__isSuspense;function qp(e,t){t&&t.pendingBranch?He(e)?t.effects.push(...e):t.effects.push(e):Qf(e)}const je=Symbol.for("v-fgt"),_a=Symbol.for("v-txt"),Wt=Symbol.for("v-cmt"),Do=Symbol.for("v-stc"),Ds=[];let an=null;function $(e=!1){Ds.push(an=e?null:[])}function Gc(){Ds.pop(),an=Ds[Ds.length-1]||null}let Fr=1;function Yo(e,t=!1){Fr+=e,e<0&&an&&t&&(an.hasOnce=!0)}function Yc(e){return e.dynamicChildren=Fr>0?an||Ms:null,Gc(),Fr>0&&an&&an.push(e),e}function O(e,t,n,r,o,i){return Yc(l(e,t,n,r,o,i,!0))}function wt(e,t,n,r,o){return Yc(we(e,t,n,r,o,!0))}function Nr(e){return e?e.__v_isVNode===!0:!1}function Ps(e,t){return e.type===t.type&&e.key===t.key}const Jc=({key:e})=>e??null,Lo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?$t(e)||Gt(e)||Ye(e)?{i:dn,r:e,k:t,f:!!n}:e:null);function l(e,t=null,n=null,r=0,o=null,i=e===je?0:1,c=!1,f=!1){const v={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Jc(t),ref:t&&Lo(t),scopeId:wc,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:dn};return f?(Jo(v,n),i&128&&e.normalize(v)):n&&(v.shapeFlag|=$t(n)?8:16),Fr>0&&!c&&an&&(v.patchFlag>0||i&6)&&v.patchFlag!==32&&an.push(v),v}const we=Hp;function Hp(e,t=null,n=null,r=0,o=null,i=!1){if((!e||e===gp)&&(e=Wt),Nr(e)){const f=fs(e,t,!0);return n&&Jo(f,n),Fr>0&&!i&&an&&(f.shapeFlag&6?an[an.indexOf(e)]=f:an.push(f)),f.patchFlag=-2,f}if(nv(e)&&(e=e.__vccOpts),t){t=zp(t);let{class:f,style:v}=t;f&&!$t(f)&&(t.class=Xe(f)),ft(v)&&(rl(v)&&!He(v)&&(v=Pt({},v)),t.style=qn(v))}const c=$t(e)?1:Wc(e)?128:ya(e)?64:ft(e)?4:Ye(e)?2:0;return l(e,t,n,r,o,c,i,!0)}function zp(e){return e?rl(e)||Nc(e)?Pt({},e):e:null}function fs(e,t,n=!1,r=!1){const{props:o,ref:i,patchFlag:c,children:f,transition:v}=e,b=t?Gp(o||{},t):o,y={__v_isVNode:!0,__v_skip:!0,type:e.type,props:b,key:b&&Jc(b),ref:t&&t.ref?n&&i?He(i)?i.concat(Lo(t)):[i,Lo(t)]:Lo(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:f,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==je?c===-1?16:c|16:c,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:v,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&fs(e.ssContent),ssFallback:e.ssFallback&&fs(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return v&&r&&ds(y,v.clone(y)),y}function ht(e=" ",t=0){return we(_a,null,e,t)}function Wp(e,t){const n=we(Do,null,e);return n.staticCount=t,n}function he(e="",t=!1){return t?($(),wt(Wt,null,e)):we(Wt,null,e)}function Tn(e){return e==null||typeof e=="boolean"?we(Wt):He(e)?we(je,null,e.slice()):Nr(e)?Vn(e):we(_a,null,String(e))}function Vn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:fs(e)}function Jo(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(He(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),Jo(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Nc(t)?t._ctx=dn:o===3&&dn&&(dn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(Ye(t)){if(r&65){Jo(e,{default:t});return}t={default:t,_ctx:dn},n=32}else t=String(t),r&64?(n=16,t=[ht(t)]):n=8;e.children=t,e.shapeFlag|=n}function Gp(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=Xe([t.class,r.class]));else if(o==="style")t.style=qn([t.style,r.style]);else if(ca(o)){const i=t[o],c=r[o];c&&i!==c&&!(He(i)&&i.includes(c))?t[o]=i?[].concat(i,c):c:c==null&&i==null&&!da(o)&&(t[o]=c)}else o!==""&&(t[o]=r[o])}return t}function xn(e,t,n,r=null){mn(e,t,7,[n,r])}const Yp=jc();let Xc=0;function Jp(){return Xc}function Xp(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||Yp,i={uid:Xc++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new xf(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Bc(r,o),emitsOptions:Dc(r,o),emit:null,emitted:null,propsDefaults:mt,inheritAttrs:r.inheritAttrs,ctx:mt,data:mt,props:mt,attrs:mt,slots:mt,refs:mt,setupState:mt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=Tp.bind(null,i),e.ce&&e.ce(i),i}let en=null;const cl=()=>en||dn;let Xo,Vr;{const e=va(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),i=>{o.length>1?o.forEach(c=>c(i)):o[0](i)}};Xo=t("__VUE_INSTANCE_SETTERS__",n=>en=n),Vr=t("__VUE_SSR_SETTERS__",n=>Br=n)}const Jr=e=>{const t=en;return Xo(e),e.scope.on(),()=>{e.scope.off(),Xo(t)}},hu=()=>{en&&en.scope.off(),Xo(null)};function Qc(e){return e.vnode.shapeFlag&4}let Br=!1;function Qp(e,t=!1,n=!1){t&&Vr(t);const{props:r,children:o}=e.vnode,i=Qc(e);jp(e,r,i,t),Rp(e,o,n||t);const c=i?Zp(e,t):void 0;return t&&Vr(!1),c}function Zp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,bp);const{setup:r}=n;if(r){Mn();const o=e.setupContext=r.length>1?tv(e):null,i=Jr(e),c=Yr(r,e,0,[e.props,o]),f=Hu(c);if(In(),i(),(f||e.sp)&&!Pr(e)&&Tc(e),f){if(c.then(hu,hu),t)return c.then(v=>{Vr(!0);try{yu(e,v,t)}finally{Vr(!1)}}).catch(v=>{ha(v,e,0)});e.asyncDep=c}else yu(e,c)}else Zc(e)}function yu(e,t,n){Ye(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ft(t)&&(e.setupState=vc(t)),Zc(e)}function Zc(e,t,n){const r=e.type;e.render||(e.render=r.render||Pn);{const o=Jr(e);Mn();try{wp(e)}finally{In(),o()}}}const ev={get(e,t){return zt(e,"get",""),e[t]}};function tv(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,ev),slots:e.slots,emit:e.emit,expose:t}}function ka(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(vc(Bf(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Or)return Or[n](e)},has(t,n){return n in t||n in Or}})):e.proxy}function nv(e){return Ye(e)&&"__vccOpts"in e}const st=(e,t)=>Wf(e,t,Br);function sv(e,t,n){try{Yo(-1);const r=arguments.length;return r===2?ft(t)&&!He(t)?Nr(t)?we(e,null,[t]):we(e,t):we(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Nr(n)&&(n=[n]),we(e,t,n))}finally{Yo(1)}}const rv="3.5.44";/**
* @vue/runtime-dom v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let ji;const gu=typeof window<"u"&&window.trustedTypes;if(gu)try{ji=gu.createPolicy("vue",{createHTML:e=>e})}catch{}const ed=ji?e=>ji.createHTML(e):e=>e,ov="http://www.w3.org/2000/svg",av="http://www.w3.org/1998/Math/MathML",Nn=typeof document<"u"?document:null,bu=Nn&&Nn.createElement("template"),iv={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t==="svg"?Nn.createElementNS(ov,e):t==="mathml"?Nn.createElementNS(av,e):n?Nn.createElement(e,{is:n}):Nn.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>Nn.createTextNode(e),createComment:e=>Nn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Nn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,i){const c=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{bu.innerHTML=ed(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const f=bu.content;if(r==="svg"||r==="mathml"){const v=f.firstChild;for(;v.firstChild;)f.appendChild(v.firstChild);f.removeChild(v)}t.insertBefore(f,n)}return[c?c.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ns="transition",kr="animation",sr=Symbol("_vtc"),td={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},nd=Pt({},$c,td),lv=e=>(e.displayName="Transition",e.props=nd,e),Rs=lv((e,{slots:t})=>sv(lp,sd(e),t)),Ss=(e,t=[])=>{He(e)?e.forEach(n=>n(...t)):e&&e(...t)},wu=e=>e?He(e)?e.some(t=>t.length>1):e.length>1:!1;function sd(e){const t={};for(const ne in e)ne in td||(t[ne]=e[ne]);if(e.css===!1)return t;const{name:n="v",type:r,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:c=`${n}-enter-active`,enterToClass:f=`${n}-enter-to`,appearFromClass:v=i,appearActiveClass:b=c,appearToClass:y=f,leaveFromClass:_=`${n}-leave-from`,leaveActiveClass:S=`${n}-leave-active`,leaveToClass:C=`${n}-leave-to`}=e,I=uv(o),Y=I&&I[0],le=I&&I[1],{onBeforeEnter:ce,onEnter:ue,onEnterCancelled:W,onLeave:A,onLeaveCancelled:L,onBeforeAppear:Z=ce,onAppear:G=ue,onAppearCancelled:te=W}=t,P=(ne,Me,Ee,ye)=>{ne._enterCancelled=ye,rs(ne,Me?y:f),rs(ne,Me?b:c),Ee&&Ee()},E=(ne,Me)=>{ne._isLeaving=!1,rs(ne,_),rs(ne,C),rs(ne,S),Me&&Me()},j=ne=>(Me,Ee)=>{const ye=ne?G:ue,Ae=()=>P(Me,ne,Ee);Ss(ye,[Me,Ae]),_u(()=>{rs(Me,ne?v:i),Cn(Me,ne?y:f),wu(ye)||ku(Me,r,Y,Ae)})};return Pt(t,{onBeforeEnter(ne){Ss(ce,[ne]),Cn(ne,i),Cn(ne,c)},onBeforeAppear(ne){Ss(Z,[ne]),Cn(ne,v),Cn(ne,b)},onEnter:j(!1),onAppear:j(!0),onLeave(ne,Me){ne._isLeaving=!0;const Ee=()=>E(ne,Me);Cn(ne,_),ne._enterCancelled?(Cn(ne,S),Di(ne)):(Di(ne),Cn(ne,S)),_u(()=>{ne._isLeaving&&(rs(ne,_),Cn(ne,C),wu(A)||ku(ne,r,le,Ee))}),Ss(A,[ne,Ee])},onEnterCancelled(ne){P(ne,!1,void 0,!0),Ss(W,[ne])},onAppearCancelled(ne){P(ne,!0,void 0,!0),Ss(te,[ne])},onLeaveCancelled(ne){E(ne),Ss(L,[ne])}})}function uv(e){if(e==null)return null;if(ft(e))return[vi(e.enter),vi(e.leave)];{const t=vi(e);return[t,t]}}function vi(e){return pf(e)}function Cn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[sr]||(e[sr]=new Set)).add(t)}function rs(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[sr];n&&(n.delete(t),n.size||(e[sr]=void 0))}function _u(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let cv=0;function ku(e,t,n,r){const o=e._endId=++cv,i=()=>{o===e._endId&&r()};if(n!=null)return setTimeout(i,n);const{type:c,timeout:f,propCount:v}=rd(e,t);if(!c)return r();const b=c+"end";let y=0;const _=()=>{e.removeEventListener(b,S),i()},S=C=>{C.target===e&&++y>=v&&_()};setTimeout(()=>{y<v&&_()},f+1),e.addEventListener(b,S)}function rd(e,t){const n=window.getComputedStyle(e),r=I=>(n[I]||"").split(", "),o=r(`${ns}Delay`),i=r(`${ns}Duration`),c=xu(o,i),f=r(`${kr}Delay`),v=r(`${kr}Duration`),b=xu(f,v);let y=null,_=0,S=0;t===ns?c>0&&(y=ns,_=c,S=i.length):t===kr?b>0&&(y=kr,_=b,S=v.length):(_=Math.max(c,b),y=_>0?c>b?ns:kr:null,S=y?y===ns?i.length:v.length:0);const C=y===ns&&/\b(?:transform|all)(?:,|$)/.test(r(`${ns}Property`).toString());return{type:y,timeout:_,propCount:S,hasTransform:C}}function xu(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Cu(n)+Cu(e[r])))}function Cu(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Di(e){return(e?e.ownerDocument:document).body.offsetHeight}function dv(e,t,n){const r=e[sr];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const $u=Symbol("_vod"),od=Symbol("_vsh"),fv=Symbol(""),pv=/(?:^|;)\s*display\s*:/;function vv(e,t,n){const r=e.style,o=$t(n);let i=!1;if(n&&!o){if(t)if($t(t))for(const c of t.split(";")){const f=c.slice(0,c.indexOf(":")).trim();n[f]==null&&$r(r,f,"")}else for(const c in t)n[c]==null&&$r(r,c,"");for(const c in n){c==="display"&&(i=!0);const f=n[c];f!=null?hv(e,c,!$t(t)&&t?t[c]:void 0,f)||$r(r,c,f):$r(r,c,"")}}else if(o){if(t!==n){const c=r[fv];c&&(n+=";"+c),r.cssText=n,i=pv.test(n)}}else t&&e.removeAttribute("style");$u in e&&((!o||t!==n)&&(e[$u]=i?r.display:""),e[od]&&(r.display="none"))}const Po=/\s*!important$/;function $r(e,t,n){if(He(n))n.forEach(r=>$r(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))Po.test(n)?e.setProperty(t,n.replace(Po,""),"important"):e.setProperty(t,n);else{const r=mv(e,t);Po.test(n)?e.setProperty(ms(r),n.replace(Po,""),"important"):e[r]=n}}const Su=["Webkit","Moz","ms"],mi={};function mv(e,t){const n=mi[t];if(n)return n;let r=gn(t);if(r!=="filter"&&r in e)return mi[t]=r;r=Gu(r);for(let o=0;o<Su.length;o++){const i=Su[o]+r;if(i in e)return mi[t]=i}return t}function hv(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&$t(r)&&n===r}const Eu="http://www.w3.org/1999/xlink";function Tu(e,t,n,r,o,i=bf(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Eu,t.slice(6,t.length)):e.setAttributeNS(Eu,t,n):n==null||i&&!Ju(n)?e.removeAttribute(t):e.setAttribute(t,i?"":On(n)?String(n):n)}function Au(e,t,n,r,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ed(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const f=i==="OPTION"?e.getAttribute("value")||"":e.value,v=n==null?e.type==="checkbox"?"on":"":String(n);(f!==v||!("_value"in e))&&(e.value=v),n==null&&e.removeAttribute(t),e._value=n;return}let c=!1;if(n===""||n==null){const f=typeof e[t];f==="boolean"?n=Ju(n):n==null&&f==="string"?(n="",c=!0):f==="number"&&(n=0,c=!0)}try{e[t]=n}catch{}c&&e.removeAttribute(o||t)}function Os(e,t,n,r){e.addEventListener(t,n,r)}function yv(e,t,n,r){e.removeEventListener(t,n,r)}const Pu=Symbol("_vei");function gv(e,t,n,r,o=null){const i=e[Pu]||(e[Pu]={}),c=i[t];if(r&&c)c.value=r;else{const[f,v]=_v(t);if(r){const b=i[t]=Cv(r,o);Os(e,f,b,v)}else c&&(yv(e,f,c,v),i[t]=void 0)}}const bv=/(Once|Passive|Capture)$/,wv=/^on:?(?:Once|Passive|Capture)$/;function _v(e){let t,n;for(;(n=e.match(bv))&&!wv.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):ms(e.slice(2)),t]}let hi=0;const kv=Promise.resolve(),xv=()=>hi||(kv.then(()=>hi=0),hi=Date.now());function Cv(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;const o=n.value;if(He(o)){const i=r.stopImmediatePropagation;r.stopImmediatePropagation=()=>{i.call(r),r._stopped=!0};const c=o.slice(),f=[r];for(let v=0;v<c.length&&!r._stopped;v++){const b=c[v];b&&mn(b,t,5,f)}}else mn(o,t,5,[r])};return n.value=e,n.attached=xv(),n}const Ou=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,$v=(e,t,n,r,o,i)=>{const c=o==="svg";t==="class"?dv(e,r,c):t==="style"?vv(e,n,r):ca(t)?da(t)||gv(e,t,n,r,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Sv(e,t,r,c))?(Au(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Tu(e,t,r,c,i,t!=="value")):e._isVueCE&&(Ev(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!$t(r)))?Au(e,gn(t),r,i,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Tu(e,t,r,c))};function Sv(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ou(t)&&Ye(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Ou(t)&&$t(n)?!1:t in e}function Ev(e,t){const n=e._def.props;if(!n)return!1;const r=gn(t);return Array.isArray(n)?n.some(o=>gn(o)===r):Object.keys(n).some(o=>gn(o)===r)}const ad=new WeakMap,id=new WeakMap,Qo=Symbol("_moveCb"),Mu=Symbol("_enterCb"),Li=new WeakMap,Tv=e=>(delete e.props.mode,e),Av=Tv({name:"TransitionGroup",props:Pt({},nd,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=cl(),r=Cc();let o,i,c,f;const v=()=>(f===void 0&&(f=o.length>0&&Kv(o[0].el,n.vnode.el,Iu(e))),f);return Pc(()=>{if(Li.delete(n),!v()){o=[],c=void 0;return}const b=Iu(e);o.forEach(Ov);const y=c&&Lv(c,n.vnode.el);c=void 0,o.forEach(S=>Mv(S,y));const _=o.filter(Iv);Di(n.vnode.el),_.forEach(S=>{const C=S.el,I=C.style;Cn(C,b),I.transform=I.webkitTransform=I.transitionDuration="";const Y=C[Qo]=le=>{le&&le.target!==C||(!le||le.propertyName.endsWith("transform"))&&(C.removeEventListener("transitionend",Y),C[Qo]=null,rs(C,b))};C.addEventListener("transitionend",Y)}),o=[]}),()=>{const b=ut(e),y=sd(b);let _=b.tag||je;if(o=[],f=void 0,i)for(let S=0;S<i.length;S++){const C=i[S];C.el&&C.el instanceof Element&&!C.el[od]&&(o.push(C),ds(C,Kr(C,y,r,n)),ad.set(C,xa(C.el)))}i=t.default?al(t.default()):[];for(let S=0;S<i.length;S++){const C=i[S];C.key!=null&&ds(C,Kr(C,y,r,n))}return o.length&&(c=jv(n),Li.set(n,v)),we(_,null,i)}}}),Pv=Av;function Ov(e){const t=e.el;t[Qo]&&t[Qo](),t[Mu]&&t[Mu]()}function Iu(e){return e.moveClass||`${e.name||"v"}-move`}function Mv(e,t){id.set(e,xa(e.el,t))}function Iv(e){const t=ad.get(e),n=id.get(e),r=t.left-n.left,o=t.top-n.top;if(r||o){const i=e.el,c=i.style,f=i.getBoundingClientRect();let v=1,b=1;return i.offsetWidth&&(v=f.width/i.offsetWidth),i.offsetHeight&&(b=f.height/i.offsetHeight),(!Number.isFinite(v)||v===0)&&(v=1),(!Number.isFinite(b)||b===0)&&(b=1),Math.abs(v-1)<.01&&(v=1),Math.abs(b-1)<.01&&(b=1),c.transform=c.webkitTransform=`translate(${r/v}px,${o/b}px)`,c.transitionDuration="0s",e}}function xa(e,t){const n=e.getBoundingClientRect();return{left:n.left-(t?t.left:0),top:n.top-(t?t.top:0)}}function jv(e){let t;for(let n=e.parent;n;n=n.parent){const r=Li.get(n);if(r){const o=Dv(n.vnode.el,e.vnode.el);o&&(t||(t=[])).push(Pt(xa(o),{item:o,willMove:r}))}}return t}function Dv(e,t){const n=e.nodeType===1?e:e.parentNode;for(;t&&t.parentNode!==n;)t=t.parentNode;if(t&&t.nodeType===1)return t}function Lv(e,t){const n=e.find(r=>r.willMove()&&r.item.contains(t));return n&&xa(n.item,n)}function Kv(e,t,n){const r=e.cloneNode(),o=e[sr];o&&o.forEach(f=>{f.split(/\s+/).forEach(v=>v&&r.classList.remove(v))}),n.split(/\s+/).forEach(f=>f&&r.classList.add(f)),r.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(r);const{hasTransform:c}=rd(r);return i.removeChild(r),c}const Zo=e=>{const t=e.props["onUpdate:modelValue"]||!1;return He(t)?n=>Io(t,n):t};function Rv(e){e.target.composing=!0}function ju(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Is=Symbol("_assign"),Oo=Symbol("_initialValue");function yi(e,t,n){return t&&(e=e.trim()),n&&(e=pa(e)),e}const Re={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e.parentNode&&(e.type==="text"?e[Oo]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Oo]=e.defaultValue.replace(/\r\n?/g,`
`))),e[Is]=Zo(o);const i=r||o.props&&o.props.type==="number";Os(e,t?"change":"input",c=>{c.target.composing||e[Is](yi(e.value,n,i))}),(n||i)&&Os(e,"change",()=>{e.value=yi(e.value,n,i)}),t||(Os(e,"compositionstart",Rv),Os(e,"compositionend",ju),Os(e,"change",ju))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){const o=t??"",i=e[Oo];delete e[Oo],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[Is](yi(e.value,n,r)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:i}},c){if(e[Is]=Zo(c),e.composing)return;const f=(i||e.type==="number")&&!/^0\d/.test(e.value)?pa(e.value):e.value,v=t??"";if(f===v)return;const b=e.getRootNode();(b instanceof Document||b instanceof ShadowRoot)&&b.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===v)||(e.value=v)}},ps={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Os(e,"change",()=>{const o=Array.prototype.filter.call(e.options,v=>v.selected).map(v=>n?pa(ea(v)):ea(v)),i=e.multiple,c=i?Ls(e._modelValue)?new Set(o):o:o[0],f=e._pendingValue=[i,i?He(c)?o.slice():o:c];try{e[Is](c)}finally{lr(()=>{e._pendingValue===f&&(e._pendingValue=void 0)})}}),e[Is]=Zo(r)},mounted(e,{value:t}){Du(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Is]=Zo(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Fv(t,n[1],n[0]))&&Du(e,t)}};function Fv(e,t,n){if(!n||He(e))return us(e,t);if(Ls(e)){if(e.size!==t.length)return!1;for(const r of t)if(!e.has(r))return!1;return!0}return!1}function Du(e,t){const n=e.multiple,r=He(t);if(!(n&&!r&&!Ls(t))){for(let o=0,i=e.options.length;o<i;o++){const c=e.options[o],f=ea(c);if(n)if(r){const v=typeof f;v==="string"||v==="number"?c.selected=t.some(b=>String(b)===String(f)):c.selected=kf(t,f)>-1}else c.selected=t.has(f);else if(us(ea(c),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ea(e){return"_value"in e?e._value:e.value}const Nv=["ctrl","shift","alt","meta"],Vv={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Nv.some(n=>e[`${n}Key`]&&!t.includes(n))},Nt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(o,...i)=>{for(let c=0;c<t.length;c++){const f=Vv[t[c]];if(f&&f(o,t))return}return e(o,...i)})},Bv={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Mt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=o=>{if(!("key"in o))return;const i=ms(o.key);if(t.some(c=>c===i||Bv[c]===i))return e(o)})},Uv=Pt({patchProp:$v},iv);let Lu;function qv(){return Lu||(Lu=Np(Uv))}const Hv=(...e)=>{const t=qv().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=Wv(r);if(!o)return;const i=t._component;!Ye(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const c=n(o,!1,zv(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),c},t};function zv(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Wv(e){return $t(e)?document.querySelector(e):e}function Et(e){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">'+e+"</svg>"}const Gv={calendar:Et('<rect x="4" y="5.5" width="16" height="14" rx="2"/><path d="M8.5 3.5v3.5M15.5 3.5v3.5M4 10.5h16"/>'),clock:Et('<circle cx="12" cy="12" r="8.25"/><path d="M12 7.75V12l2.75 1.75"/>'),"check-circle":Et('<circle cx="12" cy="12" r="8.25"/><path d="M8.5 12.4l2.4 2.4 4.6-5.2"/>'),edit:Et('<path d="M4.5 19.5v-3.2L16 4.8a1.9 1.9 0 0 1 2.7 2.7L7.2 19l-2.7.5z"/>'),tag:Et('<path d="M4.5 5.5a1 1 0 0 1 1-1h5.6l8.4 8.4-6.6 6.6-8.4-8.4V5.5z"/><circle cx="8.8" cy="8.8" r="1.1"/>'),star:Et('<path d="M12 4l2.5 5.1 5.6.8-4 3.9.9 5.6-5-2.7-5 2.7.9-5.6-4-3.9 5.6-.8L12 4z"/>'),close:Et('<path d="M6.5 6.5l11 11M17.5 6.5l-11 11"/>'),flag:Et('<path d="M6.5 21V4"/><path d="M6.5 4.5h10.8l-2.6 3.7 2.6 3.7H6.5"/>'),chart:Et('<path d="M4.5 19.5h15"/><path d="M7.5 19.5V12M12 19.5V6.5M16.5 19.5V9.5"/>'),export:Et('<path d="M12 4.5V14M8.25 10.25L12 14l3.75-3.75"/><path d="M5 19.5h14"/>'),"chevron-left":Et('<path d="M14.5 6l-6 6 6 6"/>'),"chevron-right":Et('<path d="M9.5 6l6 6-6 6"/>'),"chevron-down":Et('<path d="M6 9.5l6 6 6-6"/>'),plus:Et('<path d="M12 5.5v13M5.5 12h13"/>'),search:Et('<circle cx="11" cy="11" r="6.5"/><path d="M15.8 15.8L20 20"/>'),settings:Et('<circle cx="12" cy="12" r="3"/><path d="M12 4.5v2.2M12 17.3v2.2M4.5 12h2.2M17.3 12h2.2M6.8 6.8l1.6 1.6M15.6 15.6l1.6 1.6M17.2 6.8l-1.6 1.6M8.4 15.6l-1.6 1.6"/>'),memo:Et('<path d="M6.5 3.5h7.5L18.5 8v11a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-15a1 1 0 0 1 1-1z"/><path d="M14 3.5V8h4.5M9.5 12h5M9.5 15.5h5"/>'),lock:Et('<rect x="5.5" y="10.5" width="13" height="9.5" rx="1.5"/><path d="M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5"/>'),wallet:Et('<rect x="3.5" y="6" width="17" height="12.5" rx="2"/><path d="M3.5 10h17"/><circle cx="16.4" cy="14.2" r="1.1"/>'),more:Et('<circle cx="5.4" cy="12" r="1.7"/><circle cx="12" cy="12" r="1.7"/><circle cx="18.6" cy="12" r="1.7"/>'),shield:Et('<path d="M12 3.5l7.2 2.7v5.1c0 4.7-3.1 7.8-7.2 9.4-4.1-1.6-7.2-4.7-7.2-9.4V6.2z"/><path d="M9.3 12.2l1.9 1.9 3.6-4"/>'),plan:Et('<rect x="4.5" y="4" width="15" height="16.5" rx="2"/><path d="M8.5 9.5l1.4 1.4 2.6-2.9M8.5 15l1.4 1.4 2.6-2.9M15 9.8h.01M15 15.3h.01"/>')},Yv=["innerHTML"],qe=jt({__name:"Icon",props:{name:{},size:{default:16}},setup(e){const t=e,n=st(()=>Gv[t.name]||"");return(r,o)=>($(),O("span",{class:"icon",style:qn({width:e.size+"px",height:e.size+"px"}),innerHTML:n.value},null,12,Yv))}}),Jv=["aria-label"],Xv={class:"dialog-title"},Qv={class:"dialog-msg"},Zv={class:"dialog-btns"},em=jt({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmText:{default:"确认"},cancelText:{default:"取消"},danger:{type:Boolean,default:!1}},emits:["cancel","confirm"],setup(e,{emit:t}){const n=e,r=t;function o(i){n.open&&i.key==="Escape"&&r("cancel")}return pt(()=>n.open,i=>{i?window.addEventListener("keydown",o):window.removeEventListener("keydown",o)}),Ln(()=>window.removeEventListener("keydown",o)),(i,c)=>($(),wt(zn,{to:"body"},[we(Rs,{name:"modal"},{default:Wn(()=>[e.open?($(),O("div",{key:0,class:"mask",onClick:c[2]||(c[2]=Nt(f=>r("cancel"),["self"]))},[l("div",{class:"dialog",role:"dialog","aria-label":e.title},[l("div",Xv,z(e.title),1),l("div",Qv,z(e.message),1),l("div",Zv,[l("button",{class:"btn btn-sm",onClick:c[0]||(c[0]=f=>r("cancel"))},z(e.cancelText),1),l("button",{class:Xe(["btn btn-sm",e.danger?"btn-danger-solid":"btn-primary"]),onClick:c[1]||(c[1]=f=>r("confirm"))},z(e.confirmText),3)])],8,Jv)])):he("",!0)]),_:1})]))}}),Kt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},Dn=Kt(em,[["__scopeId","data-v-2e4b0ab5"]]);var Ku=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ld={exports:{}};(function(e,t){((n,r)=>{e.exports=r()})(Ku,function(){var n=function(s,a){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(u,d){u.__proto__=d}:function(u,d){for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(u[p]=d[p])}))(s,a)},r=function(){return(r=Object.assign||function(s){for(var a,u=1,d=arguments.length;u<d;u++)for(var p in a=arguments[u])Object.prototype.hasOwnProperty.call(a,p)&&(s[p]=a[p]);return s}).apply(this,arguments)};function o(s,a,u){for(var d,p=0,h=a.length;p<h;p++)!d&&p in a||((d=d||Array.prototype.slice.call(a,0,p))[p]=a[p]);return s.concat(d||Array.prototype.slice.call(a))}var i=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Ku,c=Object.keys,f=Array.isArray;function v(s,a){return typeof a=="object"&&c(a).forEach(function(u){s[u]=a[u]}),s}typeof Promise>"u"||i.Promise||(i.Promise=Promise);var b=Object.getPrototypeOf,y={}.hasOwnProperty;function _(s,a){return y.call(s,a)}function S(s,a){typeof a=="function"&&(a=a(b(s))),(typeof Reflect>"u"?c:Reflect.ownKeys)(a).forEach(function(u){I(s,u,a[u])})}var C=Object.defineProperty;function I(s,a,u,d){C(s,a,v(u&&_(u,"get")&&typeof u.get=="function"?{get:u.get,set:u.set,configurable:!0}:{value:u,configurable:!0,writable:!0},d))}function Y(s){return{from:function(a){return s.prototype=Object.create(a.prototype),I(s.prototype,"constructor",s),{extend:S.bind(null,s.prototype)}}}}var le=Object.getOwnPropertyDescriptor,ce=[].slice;function ue(s,a,u){return ce.call(s,a,u)}function W(s,a){return a(s)}function A(s){if(!s)throw new Error("Assertion Failed")}function L(s){i.setImmediate?setImmediate(s):setTimeout(s,0)}function Z(s,a){if(typeof a=="string"&&_(s,a))return s[a];if(!a)return s;if(typeof a!="string"){for(var u=[],d=0,p=a.length;d<p;++d){var h=Z(s,a[d]);u.push(h)}return u}var w,k=a.indexOf(".");return k===-1||(w=s[a.substr(0,k)])==null?void 0:Z(w,a.substr(k+1))}function G(s,a,u){if(s&&a!==void 0&&!("isFrozen"in Object&&Object.isFrozen(s)))if(typeof a!="string"&&"length"in a){A(typeof u!="string"&&"length"in u);for(var d=0,p=a.length;d<p;++d)G(s,a[d],u[d])}else{var h=a.indexOf(".");if(h!==-1){var w=a.substr(0,h),h=a.substr(h+1);if(h==="")u===void 0?f(s)&&!isNaN(parseInt(w))?s.splice(w,1):delete s[w]:s[w]=u;else{var k=s[w];if(!k||!_(s,w)){if(u===void 0)return;k=s[w]={}}G(k,h,u)}}else u===void 0?f(s)&&!isNaN(parseInt(a))?s.splice(a,1):delete s[a]:s[a]=u}}function te(s){var a,u={};for(a in s)_(s,a)&&(u[a]=s[a]);return u}var P=[].concat;function E(s){return P.apply([],s)}var $e="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(E([8,16,32,64].map(function(s){return["Int","Uint","Float"].map(function(a){return a+s+"Array"})}))).filter(function(s){return i[s]}),j=new Set($e.map(function(s){return i[s]})),ne=null;function Me(s){return ne=new WeakMap,s=function a(u){if(!u||typeof u!="object")return u;var d=ne.get(u);if(d)return d;if(f(u)){d=[],ne.set(u,d);for(var p=0,h=u.length;p<h;++p)d.push(a(u[p]))}else if(j.has(u.constructor))d=u;else{var w,k=b(u);for(w in d=k===Object.prototype?{}:Object.create(k),ne.set(u,d),u)_(u,w)&&(d[w]=a(u[w]))}return d}(s),ne=null,s}var Ee={}.toString;function ye(s){return Ee.call(s).slice(8,-1)}var Ae=typeof Symbol<"u"?Symbol.iterator:"@@iterator",Ue=typeof Ae=="symbol"?function(s){var a;return s!=null&&(a=s[Ae])&&a.apply(s)}:function(){return null};function de(s,a){a=s.indexOf(a),0<=a&&s.splice(a,1)}var ke={};function Se(s){var a,u,d,p;if(arguments.length===1){if(f(s))return s.slice();if(this===ke&&typeof s=="string")return[s];if(p=Ue(s))for(u=[];!(d=p.next()).done;)u.push(d.value);else{if(s==null)return[s];if(typeof(a=s.length)!="number")return[s];for(u=new Array(a);a--;)u[a]=s[a]}}else for(a=arguments.length,u=new Array(a);a--;)u[a]=arguments[a];return u}var De=typeof Symbol<"u"?function(s){return s[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},$e=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Ze=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat($e),fe={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function Ie(s,a){this.name=s,this.message=a}function ct(s,a){return s+". Errors: "+Object.keys(a).map(function(u){return a[u].toString()}).filter(function(u,d,p){return p.indexOf(u)===d}).join(`
`)}function bt(s,a,u,d){this.failures=a,this.failedKeys=d,this.successCount=u,this.message=ct(s,a)}function _t(s,a){this.name="BulkError",this.failures=Object.keys(a).map(function(u){return a[u]}),this.failuresByPos=a,this.message=ct(s,this.failures)}Y(Ie).from(Error).extend({toString:function(){return this.name+": "+this.message}}),Y(bt).from(Ie),Y(_t).from(Ie);var Bt=Ze.reduce(function(s,a){return s[a]=a+"Error",s},{}),vt=Ie,Ne=Ze.reduce(function(s,a){var u=a+"Error";function d(p,h){this.name=u,p?typeof p=="string"?(this.message="".concat(p).concat(h?`
`+h:""),this.inner=h||null):typeof p=="object"&&(this.message="".concat(p.name," ").concat(p.message),this.inner=p):(this.message=fe[a]||u,this.inner=null)}return Y(d).from(vt),s[a]=d,s},{}),g=(Ne.Syntax=SyntaxError,Ne.Type=TypeError,Ne.Range=RangeError,$e.reduce(function(s,a){return s[a+"Error"]=Ne[a],s},{}));$e=Ze.reduce(function(s,a){return["Syntax","Type","Range"].indexOf(a)===-1&&(s[a+"Error"]=Ne[a]),s},{});function m(){}function x(s){return s}function D(s,a){return s==null||s===x?a:function(u){return a(s(u))}}function ae(s,a){return function(){s.apply(this,arguments),a.apply(this,arguments)}}function H(s,a){return s===m?a:function(){var u=s.apply(this,arguments),d=(u!==void 0&&(arguments[0]=u),this.onsuccess),p=this.onerror,h=(this.onsuccess=null,this.onerror=null,a.apply(this,arguments));return d&&(this.onsuccess=this.onsuccess?ae(d,this.onsuccess):d),p&&(this.onerror=this.onerror?ae(p,this.onerror):p),h!==void 0?h:u}}function ee(s,a){return s===m?a:function(){s.apply(this,arguments);var u=this.onsuccess,d=this.onerror;this.onsuccess=this.onerror=null,a.apply(this,arguments),u&&(this.onsuccess=this.onsuccess?ae(u,this.onsuccess):u),d&&(this.onerror=this.onerror?ae(d,this.onerror):d)}}function T(s,a){return s===m?a:function(){var u=s.apply(this,arguments),d=(v(arguments[0],u),this.onsuccess),p=this.onerror,h=(this.onsuccess=null,this.onerror=null,a.apply(this,arguments));return d&&(this.onsuccess=this.onsuccess?ae(d,this.onsuccess):d),p&&(this.onerror=this.onerror?ae(p,this.onerror):p),u===void 0?h===void 0?void 0:h:v(u,h)}}function X(s,a){return s===m?a:function(){return a.apply(this,arguments)!==!1&&s.apply(this,arguments)}}function se(s,a){return s===m?a:function(){var u=s.apply(this,arguments);if(u&&typeof u.then=="function"){for(var d=this,p=arguments.length,h=new Array(p);p--;)h[p]=arguments[p];return u.then(function(){return a.apply(d,h)})}return a.apply(this,arguments)}}$e.ModifyError=bt,$e.DexieError=Ie,$e.BulkError=_t;var Ce=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function be(s){Ce=s}var Le={},Te=100,Qe=typeof Promise>"u"?[]:(Ze=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[Qe=crypto.subtle.digest("SHA-512",new Uint8Array([0])),b(Qe),Ze]:[Ze,b(Ze),Ze]),Ze=Qe[0],Ws=Qe[1],Ws=Ws&&Ws.then,tt=Ze&&Ze.constructor,kt=!!Qe[2],St=function(s,a){Yn.push([s,a]),Yt&&(queueMicrotask(Rd),Yt=!1)},tn=!0,Yt=!0,nn=[],hs=[],Rt=x,Ot={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:m,pgp:!1,env:{},finalize:m},Be=Ot,Yn=[],ys=0,eo=[];function Pe(s){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var a=this._PSD=Be;if(typeof s!="function"){if(s!==Le)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Aa(this,this._value)}else this._state=null,this._value=null,++a.ref,function u(d,p){try{p(function(h){if(d._state===null){if(h===d)throw new TypeError("A promise cannot be resolved with itself.");var w=d._lib&&Vs();h&&typeof h.then=="function"?u(d,function(k,R){h instanceof Pe?h._then(k,R):h.then(k,R)}):(d._state=!0,d._value=h,bl(d)),w&&Bs()}},Aa.bind(null,d))}catch(h){Aa(d,h)}}(this,s)}var Ta={get:function(){var s=Be,a=ro;function u(d,p){var h=this,w=!s.global&&(s!==Be||a!==ro),k=w&&!Xn(),R=new Pe(function(J,N){Pa(h,new gl(_l(d,s,w,k),_l(p,s,w,k),J,N,s))});return this._consoleTask&&(R._consoleTask=this._consoleTask),R}return u.prototype=Le,u},set:function(s){I(this,"then",s&&s.prototype===Le?Ta:{get:function(){return s},set:Ta.set})}};function gl(s,a,u,d,p){this.onFulfilled=typeof s=="function"?s:null,this.onRejected=typeof a=="function"?a:null,this.resolve=u,this.reject=d,this.psd=p}function Aa(s,a){var u,d;hs.push(a),s._state===null&&(u=s._lib&&Vs(),a=Rt(a),s._state=!1,s._value=a,d=s,nn.some(function(p){return p._value===d._value})||nn.push(d),bl(s),u)&&Bs()}function bl(s){var a=s._listeners;s._listeners=[];for(var u=0,d=a.length;u<d;++u)Pa(s,a[u]);var p=s._PSD;--p.ref||p.finalize(),ys===0&&(++ys,St(function(){--ys==0&&Oa()},[]))}function Pa(s,a){if(s._state===null)s._listeners.push(a);else{var u=s._state?a.onFulfilled:a.onRejected;if(u===null)return(s._state?a.resolve:a.reject)(s._value);++a.psd.ref,++ys,St(Kd,[u,s,a])}}function Kd(s,a,u){try{var d,p=a._value;!a._state&&hs.length&&(hs=[]),d=Ce&&a._consoleTask?a._consoleTask.run(function(){return s(p)}):s(p),a._state||hs.indexOf(p)!==-1||(h=>{for(var w=nn.length;w;)if(nn[--w]._value===h._value)return nn.splice(w,1)})(a),u.resolve(d)}catch(h){u.reject(h)}finally{--ys==0&&Oa(),--u.psd.ref||u.psd.finalize()}}function Rd(){gs(Ot,function(){Vs()&&Bs()})}function Vs(){var s=tn;return Yt=tn=!1,s}function Bs(){var s,a,u;do for(;0<Yn.length;)for(s=Yn,Yn=[],u=s.length,a=0;a<u;++a){var d=s[a];d[0].apply(null,d[1])}while(0<Yn.length);Yt=tn=!0}function Oa(){for(var s=nn,a=(nn=[],s.forEach(function(d){d._PSD.onunhandled.call(null,d._value,d)}),eo.slice(0)),u=a.length;u;)a[--u]()}function to(s){return new Pe(Le,!1,s)}function xt(s,a){var u=Be;return function(){var d=Vs(),p=Be;try{return Qn(u,!0),s.apply(this,arguments)}catch(h){a&&a(h)}finally{Qn(p,!1),d&&Bs()}}}S(Pe.prototype,{then:Ta,_then:function(s,a){Pa(this,new gl(null,null,s,a,Be))},catch:function(s){var a,u;return arguments.length===1?this.then(null,s):(a=s,u=arguments[1],typeof a=="function"?this.then(null,function(d){return(d instanceof a?u:to)(d)}):this.then(null,function(d){return(d&&d.name===a?u:to)(d)}))},finally:function(s){return this.then(function(a){return Pe.resolve(s()).then(function(){return a})},function(a){return Pe.resolve(s()).then(function(){return to(a)})})},timeout:function(s,a){var u=this;return s<1/0?new Pe(function(d,p){var h=setTimeout(function(){return p(new Ne.Timeout(a))},s);u.then(d,p).finally(clearTimeout.bind(null,h))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&I(Pe.prototype,Symbol.toStringTag,"Dexie.Promise"),Ot.env=wl(),S(Pe,{all:function(){var s=Se.apply(null,arguments).map(oo);return new Pe(function(a,u){s.length===0&&a([]);var d=s.length;s.forEach(function(p,h){return Pe.resolve(p).then(function(w){s[h]=w,--d||a(s)},u)})})},resolve:function(s){return s instanceof Pe?s:s&&typeof s.then=="function"?new Pe(function(a,u){s.then(a,u)}):new Pe(Le,!0,s)},reject:to,race:function(){var s=Se.apply(null,arguments).map(oo);return new Pe(function(a,u){s.map(function(d){return Pe.resolve(d).then(a,u)})})},PSD:{get:function(){return Be},set:function(s){return Be=s}},totalEchoes:{get:function(){return ro}},newPSD:Jn,usePSD:gs,scheduler:{get:function(){return St},set:function(s){St=s}},rejectionMapper:{get:function(){return Rt},set:function(s){Rt=s}},follow:function(s,a){return new Pe(function(u,d){return Jn(function(p,h){var w=Be;w.unhandleds=[],w.onunhandled=h,w.finalize=ae(function(){var k,R=this;k=function(){R.unhandleds.length===0?p():h(R.unhandleds[0])},eo.push(function J(){k(),eo.splice(eo.indexOf(J),1)}),++ys,St(function(){--ys==0&&Oa()},[])},w.finalize),s()},a,u,d)})}}),tt&&(tt.allSettled&&I(Pe,"allSettled",function(){var s=Se.apply(null,arguments).map(oo);return new Pe(function(a){s.length===0&&a([]);var u=s.length,d=new Array(u);s.forEach(function(p,h){return Pe.resolve(p).then(function(w){return d[h]={status:"fulfilled",value:w}},function(w){return d[h]={status:"rejected",reason:w}}).then(function(){return--u||a(d)})})})}),tt.any&&typeof AggregateError<"u"&&I(Pe,"any",function(){var s=Se.apply(null,arguments).map(oo);return new Pe(function(a,u){s.length===0&&u(new AggregateError([]));var d=s.length,p=new Array(d);s.forEach(function(h,w){return Pe.resolve(h).then(function(k){return a(k)},function(k){p[w]=k,--d||u(new AggregateError(p))})})})}),tt.withResolvers)&&(Pe.withResolvers=tt.withResolvers);var Dt={awaits:0,echoes:0,id:0},Fd=0,no=[],so=0,ro=0,Nd=0;function Jn(s,w,u,d){var p=Be,h=Object.create(p),w=(h.parent=p,h.ref=0,h.global=!1,h.id=++Nd,Ot.env,h.env=kt?{Promise:Pe,PromiseProp:{value:Pe,configurable:!0,writable:!0},all:Pe.all,race:Pe.race,allSettled:Pe.allSettled,any:Pe.any,resolve:Pe.resolve,reject:Pe.reject}:{},w&&v(h,w),++p.ref,h.finalize=function(){--this.parent.ref||this.parent.finalize()},gs(h,s,u,d));return h.ref===0&&h.finalize(),w}function Us(){return Dt.id||(Dt.id=++Fd),++Dt.awaits,Dt.echoes+=Te,Dt.id}function Xn(){return!!Dt.awaits&&(--Dt.awaits==0&&(Dt.id=0),Dt.echoes=Dt.awaits*Te,!0)}function oo(s){return Dt.echoes&&s&&s.constructor===tt?(Us(),s.then(function(a){return Xn(),a},function(a){return Xn(),Tt(a)})):s}function Vd(){var s=no[no.length-1];no.pop(),Qn(s,!1)}function Qn(s,a){var u,d,p=Be;(a?!Dt.echoes||so++&&s===Be:!so||--so&&s===Be)||queueMicrotask(a?(function(h){++ro,Dt.echoes&&--Dt.echoes!=0||(Dt.echoes=Dt.awaits=Dt.id=0),no.push(Be),Qn(h,!0)}).bind(null,s):Vd),s!==Be&&(Be=s,p===Ot&&(Ot.env=wl()),kt)&&(u=Ot.env.Promise,d=s.env,p.global||s.global)&&(Object.defineProperty(i,"Promise",d.PromiseProp),u.all=d.all,u.race=d.race,u.resolve=d.resolve,u.reject=d.reject,d.allSettled&&(u.allSettled=d.allSettled),d.any)&&(u.any=d.any)}function wl(){var s=i.Promise;return kt?{Promise:s,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:s.all,race:s.race,allSettled:s.allSettled,any:s.any,resolve:s.resolve,reject:s.reject}:{}}function gs(s,a,u,d,p){var h=Be;try{return Qn(s,!0),a(u,d,p)}finally{Qn(h,!1)}}function _l(s,a,u,d){return typeof s!="function"?s:function(){var p=Be;u&&Us(),Qn(a,!0);try{return s.apply(this,arguments)}finally{Qn(p,!1),d&&queueMicrotask(Xn)}}}function Ma(s){Promise===tt&&Dt.echoes===0?so===0?s():enqueueNativeMicroTask(s):setTimeout(s,0)}(""+Ws).indexOf("[native code]")===-1&&(Us=Xn=m);var Tt=Pe.reject,bs="￿",Kn="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",kl="String expected.",ao="__dbnames",Ia="readonly",ja="readwrite";function ws(s,a){return s?a?function(){return s.apply(this,arguments)&&a.apply(this,arguments)}:s:a}var xl={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function io(s){return typeof s!="string"||/\./.test(s)?function(a){return a}:function(a){return a[s]===void 0&&s in a&&delete(a=Me(a))[s],a}}function Cl(){throw Ne.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function rt(s,a){try{var u=$l(s),d=$l(a);if(u!==d)return u==="Array"?1:d==="Array"?-1:u==="binary"?1:d==="binary"?-1:u==="string"?1:d==="string"?-1:u==="Date"?1:d!=="Date"?NaN:-1;switch(u){case"number":case"Date":case"string":return a<s?1:s<a?-1:0;case"binary":for(var p=Sl(s),h=Sl(a),w=p.length,k=h.length,R=w<k?w:k,J=0;J<R;++J)if(p[J]!==h[J])return p[J]<h[J]?-1:1;return w===k?0:w<k?-1:1;case"Array":for(var N=s,K=a,F=N.length,q=K.length,B=F<q?F:q,V=0;V<B;++V){var U=rt(N[V],K[V]);if(U!==0)return U}return F===q?0:F<q?-1:1}}catch{}return NaN}function $l(s){var a=typeof s;return a=="object"&&(ArrayBuffer.isView(s)||(a=ye(s))==="ArrayBuffer")?"binary":a}function Sl(s){return s instanceof Uint8Array?s:ArrayBuffer.isView(s)?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s)}function lo(s,a,u){var d=s.schema.yProps;return d?(a&&0<u.numFailures&&(a=a.filter(function(p,h){return!u.failures[h]})),Promise.all(d.map(function(p){return p=p.updatesTable,a?s.db.table(p).where("k").anyOf(a).delete():s.db.table(p).clear()})).then(function(){return u})):u}El.prototype.execute=function(s){var a=this["@@propmod"];if(a.add!==void 0){var u=a.add;if(f(u))return o(o([],f(s)?s:[],!0),u).sort();if(typeof u=="number")return(Number(s)||0)+u;if(typeof u=="bigint")try{return BigInt(s)+u}catch{return BigInt(0)+u}throw new TypeError("Invalid term ".concat(u))}if(a.remove!==void 0){var d=a.remove;if(f(d))return f(s)?s.filter(function(p){return!d.includes(p)}).sort():[];if(typeof d=="number")return Number(s)-d;if(typeof d=="bigint")try{return BigInt(s)-d}catch{return BigInt(0)-d}throw new TypeError("Invalid subtrahend ".concat(d))}return u=(u=a.replacePrefix)==null?void 0:u[0],u&&typeof s=="string"&&s.startsWith(u)?a.replacePrefix[1]+s.substring(u.length):s};var dr=El;function El(s){this["@@propmod"]=s}function Tl(s,a){for(var u=c(a),d=u.length,p=!1,h=0;h<d;++h){var w=u[h],k=a[w],R=Z(s,w);k instanceof dr?(G(s,w,k.execute(R)),p=!0):R!==k&&(G(s,w,k),p=!0)}return p}yt.prototype._trans=function(s,a,u){var d=this._tx||Be.trans,p=this.name,h=Ce&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(s==="readonly"?"read":"write"," ").concat(this.name));function w(J,N,K){if(K.schema[p])return a(K.idbtrans,K);throw new Ne.NotFound("Table "+p+" not part of transaction")}var k=Vs();try{var R=d&&d.db._novip===this.db._novip?d===Be.trans?d._promise(s,w,u):Jn(function(){return d._promise(s,w,u)},{trans:d,transless:Be.transless||Be}):function J(N,K,F,q){if(N.idbdb&&(N._state.openComplete||Be.letThrough||N._vip)){var B=N._createTransaction(K,F,N._dbSchema);try{B.create(),N._state.PR1398_maxLoop=3}catch(V){return V.name===Bt.InvalidState&&N.isOpen()&&0<--N._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),N.close({disableAutoOpen:!1}),N.open().then(function(){return J(N,K,F,q)})):Tt(V)}return B._promise(K,function(V,U){return Jn(function(){return Be.trans=B,q(V,U,B)})}).then(function(V){if(K==="readwrite")try{B.idbtrans.commit()}catch{}return K==="readonly"?V:B._completion.then(function(){return V})})}if(N._state.openComplete)return Tt(new Ne.DatabaseClosed(N._state.dbOpenError));if(!N._state.isBeingOpened){if(!N._state.autoOpen)return Tt(new Ne.DatabaseClosed);N.open().catch(m)}return N._state.dbReadyPromise.then(function(){return J(N,K,F,q)})}(this.db,s,[this.name],w);return h&&(R._consoleTask=h,R=R.catch(function(J){return console.trace(J),Tt(J)})),R}finally{k&&Bs()}},yt.prototype.get=function(s,a){var u=this;return s&&s.constructor===Object?this.where(s).first(a):s==null?Tt(new Ne.Type("Invalid argument to Table.get()")):this._trans("readonly",function(d){return u.core.get({trans:d,key:s}).then(function(p){return u.hook.reading.fire(p)})}).then(a)},yt.prototype.where=function(s){if(typeof s=="string")return new this.db.WhereClause(this,s);if(f(s))return new this.db.WhereClause(this,"[".concat(s.join("+"),"]"));var a=c(s);if(a.length===1)return this.where(a[0]).equals(s[a[0]]);var u=this.schema.indexes.concat(this.schema.primKey).filter(function(k){if(k.compound&&a.every(function(J){return 0<=k.keyPath.indexOf(J)})){for(var R=0;R<a.length;++R)if(a.indexOf(k.keyPath[R])===-1)return!1;return!0}return!1}).sort(function(k,R){return k.keyPath.length-R.keyPath.length})[0];if(u&&this.db._maxKey!==bs)return w=u.keyPath.slice(0,a.length),this.where(w).equals(w.map(function(k){return s[k]}));!u&&Ce&&console.warn("The query ".concat(JSON.stringify(s)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(a.join("+"),"]"));var d=this.schema.idxByName;function p(k,R){return rt(k,R)===0}var w=a.reduce(function(N,R){var J=N[0],N=N[1],K=d[R],F=s[R];return[J||K,J||!K?ws(N,K&&K.multi?function(q){return q=Z(q,R),f(q)&&q.some(function(B){return p(F,B)})}:function(q){return p(F,Z(q,R))}):N]},[null,null]),h=w[0],w=w[1];return h?this.where(h.name).equals(s[h.keyPath]).filter(w):u?this.filter(w):this.where(a).equals("")},yt.prototype.filter=function(s){return this.toCollection().and(s)},yt.prototype.count=function(s){return this.toCollection().count(s)},yt.prototype.offset=function(s){return this.toCollection().offset(s)},yt.prototype.limit=function(s){return this.toCollection().limit(s)},yt.prototype.each=function(s){return this.toCollection().each(s)},yt.prototype.toArray=function(s){return this.toCollection().toArray(s)},yt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},yt.prototype.orderBy=function(s){return new this.db.Collection(new this.db.WhereClause(this,f(s)?"[".concat(s.join("+"),"]"):s))},yt.prototype.reverse=function(){return this.toCollection().reverse()},yt.prototype.mapToClass=function(s){for(var a=this.db,u=this.name,d=((this.schema.mappedClass=s).prototype instanceof Cl&&(s=(w=>{var k=N,R=w;if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");function J(){this.constructor=k}function N(){return w!==null&&w.apply(this,arguments)||this}return n(k,R),k.prototype=R===null?Object.create(R):(J.prototype=R.prototype,new J),Object.defineProperty(N.prototype,"db",{get:function(){return a},enumerable:!1,configurable:!0}),N.prototype.table=function(){return u},N})(s)),new Set),p=s.prototype;p;p=b(p))Object.getOwnPropertyNames(p).forEach(function(w){return d.add(w)});function h(w){if(!w)return w;var k,R=Object.create(s.prototype);for(k in w)if(!d.has(k))try{R[k]=w[k]}catch{}return R}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=h,this.hook("reading",h),s},yt.prototype.defineClass=function(){return this.mapToClass(function(s){v(this,s)})},yt.prototype.add=function(s,a){var u=this,d=this.schema.primKey,p=d.auto,h=d.keyPath,w=s;return h&&p&&(w=io(h)(s)),this._trans("readwrite",function(k){return u.core.mutate({trans:k,type:"add",keys:a!=null?[a]:null,values:[w]})}).then(function(k){return k.numFailures?Pe.reject(k.failures[0]):k.lastResult}).then(function(k){if(h)try{G(s,h,k)}catch{}return k})},yt.prototype.upsert=function(s,a){var u=this,d=this.schema.primKey.keyPath;return this._trans("readwrite",function(p){return u.core.get({trans:p,key:s}).then(function(h){var w=h??{};return Tl(w,a),d&&G(w,d,s),u.core.mutate({trans:p,type:"put",values:[w],keys:[s],upsert:!0,updates:{keys:[s],changeSpecs:[a]}}).then(function(k){return k.numFailures?Pe.reject(k.failures[0]):!!h})})})},yt.prototype.update=function(s,a){return typeof s!="object"||f(s)?this.where(":id").equals(s).modify(a):(s=Z(s,this.schema.primKey.keyPath))===void 0?Tt(new Ne.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(s).modify(a)},yt.prototype.put=function(s,a){var u=this,d=this.schema.primKey,p=d.auto,h=d.keyPath,w=s;return h&&p&&(w=io(h)(s)),this._trans("readwrite",function(k){return u.core.mutate({trans:k,type:"put",values:[w],keys:a!=null?[a]:null})}).then(function(k){return k.numFailures?Pe.reject(k.failures[0]):k.lastResult}).then(function(k){if(h)try{G(s,h,k)}catch{}return k})},yt.prototype.delete=function(s){var a=this;return this._trans("readwrite",function(u){return a.core.mutate({trans:u,type:"delete",keys:[s]}).then(function(d){return lo(a,[s],d)}).then(function(d){return d.numFailures?Pe.reject(d.failures[0]):void 0})})},yt.prototype.clear=function(){var s=this;return this._trans("readwrite",function(a){return s.core.mutate({trans:a,type:"deleteRange",range:xl}).then(function(u){return lo(s,null,u)})}).then(function(a){return a.numFailures?Pe.reject(a.failures[0]):void 0})},yt.prototype.bulkGet=function(s){var a=this;return this._trans("readonly",function(u){return a.core.getMany({keys:s,trans:u}).then(function(d){return d.map(function(p){return a.hook.reading.fire(p)})})})},yt.prototype.bulkAdd=function(s,a,u){var d=this,p=Array.isArray(a)?a:void 0,h=(u=u||(p?void 0:a))?u.allKeys:void 0;return this._trans("readwrite",function(w){var k=d.schema.primKey,J=k.auto,k=k.keyPath;if(k&&p)throw new Ne.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(p&&p.length!==s.length)throw new Ne.InvalidArgument("Arguments objects and keys must have the same length");var R=s.length,J=k&&J?s.map(io(k)):s;return d.core.mutate({trans:w,type:"add",keys:p,values:J,wantResults:h}).then(function(N){var K=N.numFailures,F=N.failures;if(K===0)return h?N.results:N.lastResult;throw new _t("".concat(d.name,".bulkAdd(): ").concat(K," of ").concat(R," operations failed"),F)})})},yt.prototype.bulkPut=function(s,a,u){var d=this,p=Array.isArray(a)?a:void 0,h=(u=u||(p?void 0:a))?u.allKeys:void 0;return this._trans("readwrite",function(w){var k=d.schema.primKey,J=k.auto,k=k.keyPath;if(k&&p)throw new Ne.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(p&&p.length!==s.length)throw new Ne.InvalidArgument("Arguments objects and keys must have the same length");var R=s.length,J=k&&J?s.map(io(k)):s;return d.core.mutate({trans:w,type:"put",keys:p,values:J,wantResults:h}).then(function(N){var K=N.numFailures,F=N.failures;if(K===0)return h?N.results:N.lastResult;throw new _t("".concat(d.name,".bulkPut(): ").concat(K," of ").concat(R," operations failed"),F)})})},yt.prototype.bulkUpdate=function(s){var a=this,u=this.core,d=s.map(function(w){return w.key}),p=s.map(function(w){return w.changes}),h=[];return this._trans("readwrite",function(w){return u.getMany({trans:w,keys:d,cache:"clone"}).then(function(k){var R=[],J=[],N=(s.forEach(function(K,F){var q=K.key,B=K.changes,V=k[F];if(V){for(var U=0,re=Object.keys(B);U<re.length;U++){var Q=re[U],ie=B[Q];if(Q===a.schema.primKey.keyPath){if(rt(ie,q)!==0)throw new Ne.Constraint("Cannot update primary key in bulkUpdate()")}else G(V,Q,ie)}h.push(F),R.push(q),J.push(V)}}),R.length);return u.mutate({trans:w,type:"put",keys:R,values:J,updates:{keys:d,changeSpecs:p}}).then(function(K){var F=K.numFailures,q=K.failures;if(F===0)return N;for(var B=0,V=Object.keys(q);B<V.length;B++){var U,re=V[B],Q=h[Number(re)];Q!=null&&(U=q[re],delete q[re],q[Q]=U)}throw new _t("".concat(a.name,".bulkUpdate(): ").concat(F," of ").concat(N," operations failed"),q)})})})},yt.prototype.bulkDelete=function(s){var a=this,u=s.length;return this._trans("readwrite",function(d){return a.core.mutate({trans:d,type:"delete",keys:s}).then(function(p){return lo(a,s,p)})}).then(function(d){var p=d.numFailures,h=d.failures;if(p===0)return d.lastResult;throw new _t("".concat(a.name,".bulkDelete(): ").concat(p," of ").concat(u," operations failed"),h)})};var Al=yt;function yt(){}function fr(s){function a(w,k){if(k){for(var R=arguments.length,J=new Array(R-1);--R;)J[R-1]=arguments[R];return u[w].subscribe.apply(null,J),s}if(typeof w=="string")return u[w]}var u={};a.addEventType=h;for(var d=1,p=arguments.length;d<p;++d)h(arguments[d]);return a;function h(w,k,R){var J,N;if(typeof w!="object")return k=k||X,N={subscribers:[],fire:R=R||m,subscribe:function(K){N.subscribers.indexOf(K)===-1&&(N.subscribers.push(K),N.fire=k(N.fire,K))},unsubscribe:function(K){N.subscribers=N.subscribers.filter(function(F){return F!==K}),N.fire=N.subscribers.reduce(k,R)}},u[w]=a[w]=N;c(J=w).forEach(function(K){var F=J[K];if(f(F))h(K,J[K][0],J[K][1]);else{if(F!=="asap")throw new Ne.InvalidArgument("Invalid event config");var q=h(K,x,function(){for(var B=arguments.length,V=new Array(B);B--;)V[B]=arguments[B];q.subscribers.forEach(function(U){L(function(){U.apply(null,V)})})})}})}}function pr(s,a){return Y(a).from({prototype:s}),a}function qs(s,a){return!(s.filter||s.algorithm||s.or)&&(a?s.justLimit:!s.replayFilter)}function Da(s,a){s.filter=ws(s.filter,a)}function La(s,a,u){var d=s.replayFilter;s.replayFilter=d?function(){return ws(d(),a())}:a,s.justLimit=u&&!d}function uo(s,a){if(s.isPrimKey)return a.primaryKey;var u=a.getIndexByKeyPath(s.index);if(u)return u;throw new Ne.Schema("KeyPath "+s.index+" on object store "+a.name+" is not indexed")}function Pl(s,a,u){var d=uo(s,a.schema);return a.openCursor({trans:u,values:!s.keysOnly,reverse:s.dir==="prev",unique:!!s.unique,query:{index:d,range:s.range}})}function co(s,a,u,d){var p,h,w=s.replayFilter?ws(s.filter,s.replayFilter()):s.filter;return s.or?(p={},h=function(k,R,J){var N,K;w&&!w(R,J,function(F){return R.stop(F)},function(F){return R.fail(F)})||((K=""+(N=R.primaryKey))=="[object ArrayBuffer]"&&(K=""+new Uint8Array(N)),_(p,K))||(p[K]=!0,a(k,R,J))},Promise.all([s.or._iterate(h,u),Ol(Pl(s,d,u),s.algorithm,h,!s.keysOnly&&s.valueMapper)])):Ol(Pl(s,d,u),ws(s.algorithm,w),a,!s.keysOnly&&s.valueMapper)}function Ol(s,a,u,d){var p=xt(d?function(h,w,k){return u(d(h),w,k)}:u);return s.then(function(h){if(h)return h.start(function(){var w=function(){return h.continue()};a&&!a(h,function(k){return w=k},function(k){h.stop(k),w=m},function(k){h.fail(k),w=m})||p(h.value,h,function(k){return w=k}),w()})})}lt.prototype._read=function(s,a){var u=this._ctx;return u.error?u.table._trans(null,Tt.bind(null,u.error)):u.table._trans("readonly",s).then(a)},lt.prototype._write=function(s){var a=this._ctx;return a.error?a.table._trans(null,Tt.bind(null,a.error)):a.table._trans("readwrite",s,"locked")},lt.prototype._addAlgorithm=function(s){var a=this._ctx;a.algorithm=ws(a.algorithm,s)},lt.prototype._iterate=function(s,a){return co(this._ctx,s,a,this._ctx.table.core)},lt.prototype.clone=function(s){var a=Object.create(this.constructor.prototype),u=Object.create(this._ctx);return s&&v(u,s),a._ctx=u,a},lt.prototype.raw=function(){return this._ctx.valueMapper=null,this},lt.prototype.each=function(s){var a=this._ctx;return this._read(function(u){return co(a,s,u,a.table.core)})},lt.prototype.count=function(s){var a=this;return this._read(function(u){var d,p=a._ctx,h=p.table.core;return qs(p,!0)?h.count({trans:u,query:{index:uo(p,h.schema),range:p.range}}).then(function(w){return Math.min(w,p.limit)}):(d=0,co(p,function(){return++d,!1},u,h).then(function(){return d}))}).then(s)},lt.prototype.sortBy=function(s,a){var u=s.split(".").reverse(),d=u[0],p=u.length-1;function h(R,J){return J?h(R[u[J]],J-1):R[d]}var w=this._ctx.dir==="next"?1:-1;function k(R,J){return rt(h(R,p),h(J,p))*w}return this.toArray(function(R){return R.slice().sort(k)}).then(a)},lt.prototype.toArray=function(s){var a=this;return this._read(function(u){var d,p,h,w=a._ctx;return qs(w,!0)&&0<w.limit?(d=w.valueMapper,p=uo(w,w.table.core.schema),w.table.core.query({trans:u,limit:w.limit,values:!0,direction:w.dir==="prev"?"prev":void 0,query:{index:p,range:w.range}}).then(function(k){return k=k.result,d?k.map(d):k})):(h=[],co(w,function(k){return h.push(k)},u,w.table.core).then(function(){return h}))},s)},lt.prototype.offset=function(s){var a=this._ctx;return s<=0||(a.offset+=s,qs(a)?La(a,function(){var u=s;return function(d,p){return u===0||(u===1?--u:p(function(){d.advance(u),u=0}),!1)}}):La(a,function(){var u=s;return function(){return--u<0}})),this},lt.prototype.limit=function(s){return this._ctx.limit=Math.min(this._ctx.limit,s),La(this._ctx,function(){var a=s;return function(u,d,p){return--a<=0&&d(p),0<=a}},!0),this},lt.prototype.until=function(s,a){return Da(this._ctx,function(u,d,p){return!s(u.value)||(d(p),a)}),this},lt.prototype.first=function(s){return this.limit(1).toArray(function(a){return a[0]}).then(s)},lt.prototype.last=function(s){return this.reverse().first(s)},lt.prototype.filter=function(s){var a;return Da(this._ctx,function(u){return s(u.value)}),(a=this._ctx).isMatch=ws(a.isMatch,s),this},lt.prototype.and=function(s){return this.filter(s)},lt.prototype.or=function(s){return new this.db.WhereClause(this._ctx.table,s,this)},lt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},lt.prototype.desc=function(){return this.reverse()},lt.prototype.eachKey=function(s){var a=this._ctx;return a.keysOnly=!a.isMatch,this.each(function(u,d){s(d.key,d)})},lt.prototype.eachUniqueKey=function(s){return this._ctx.unique="unique",this.eachKey(s)},lt.prototype.eachPrimaryKey=function(s){var a=this._ctx;return a.keysOnly=!a.isMatch,this.each(function(u,d){s(d.primaryKey,d)})},lt.prototype.keys=function(s){var a=this._ctx,u=(a.keysOnly=!a.isMatch,[]);return this.each(function(d,p){u.push(p.key)}).then(function(){return u}).then(s)},lt.prototype.primaryKeys=function(s){var a=this._ctx;if(qs(a,!0)&&0<a.limit)return this._read(function(d){var p=uo(a,a.table.core.schema);return a.table.core.query({trans:d,values:!1,limit:a.limit,direction:a.dir==="prev"?"prev":void 0,query:{index:p,range:a.range}})}).then(function(d){return d.result}).then(s);a.keysOnly=!a.isMatch;var u=[];return this.each(function(d,p){u.push(p.primaryKey)}).then(function(){return u}).then(s)},lt.prototype.uniqueKeys=function(s){return this._ctx.unique="unique",this.keys(s)},lt.prototype.firstKey=function(s){return this.limit(1).keys(function(a){return a[0]}).then(s)},lt.prototype.lastKey=function(s){return this.reverse().firstKey(s)},lt.prototype.distinct=function(){var s,a=this._ctx,a=a.index&&a.table.schema.idxByName[a.index];return a&&a.multi&&(s={},Da(this._ctx,function(d){var d=d.primaryKey.toString(),p=_(s,d);return s[d]=!0,!p})),this},lt.prototype.modify=function(s){var a=this,u=this._ctx;return this._write(function(d){function p(V,U){var re=U.failures;F+=V-U.numFailures;for(var Q=0,ie=c(re);Q<ie.length;Q++){var pe=ie[Q];K.push(re[pe])}}var h=typeof s=="function"?s:function(V){return Tl(V,s)},w=u.table.core,N=w.schema.primaryKey,k=N.outbound,R=N.extractKey,J=200,N=a.db._options.modifyChunkSize,K=(N&&(J=typeof N=="object"?N[w.name]||N["*"]||200:N),[]),F=0,q=[],B=s===Ml;return a.clone().primaryKeys().then(function(V){function U(Q){var ie=Math.min(J,V.length-Q),pe=V.slice(Q,Q+ie);return(B?Promise.resolve([]):w.getMany({trans:d,keys:pe,cache:"immutable"})).then(function(me){var xe=[],ge=[],Ke=k?[]:null,_e=B?pe:[];if(!B)for(var Ve=0;Ve<ie;++Ve){var ve=me[Ve],ze={value:Me(ve),primKey:V[Q+Ve]};h.call(ze,ze.value,ze)!==!1&&(ze.value==null?_e.push(V[Q+Ve]):k||rt(R(ve),R(ze.value))===0?(ge.push(ze.value),k&&Ke.push(V[Q+Ve])):(_e.push(V[Q+Ve]),xe.push(ze.value)))}return Promise.resolve(0<xe.length&&w.mutate({trans:d,type:"add",values:xe}).then(function(We){for(var Je in We.failures)_e.splice(parseInt(Je),1);p(xe.length,We)})).then(function(){return(0<ge.length||re&&typeof s=="object")&&w.mutate({trans:d,type:"put",keys:Ke,values:ge,criteria:re,changeSpec:typeof s!="function"&&s,isAdditionalChunk:0<Q}).then(function(We){return p(ge.length,We)})}).then(function(){return(0<_e.length||re&&B)&&w.mutate({trans:d,type:"delete",keys:_e,criteria:re,isAdditionalChunk:0<Q}).then(function(We){return lo(u.table,_e,We)}).then(function(We){return p(_e.length,We)})}).then(function(){return V.length>Q+ie&&U(Q+J)})})}var re=qs(u)&&u.limit===1/0&&(typeof s!="function"||B)&&{index:u.index,range:u.range};return U(0).then(function(){if(0<K.length)throw new bt("Error modifying one or more objects",K,F,q);return V.length})})})},lt.prototype.delete=function(){var s=this._ctx,a=s.range;return!qs(s)||s.table.schema.yProps||!s.isPrimKey&&a.type!==3?this.modify(Ml):this._write(function(u){var d=s.table.core.schema.primaryKey,p=a;return s.table.core.count({trans:u,query:{index:d,range:p}}).then(function(h){return s.table.core.mutate({trans:u,type:"deleteRange",range:p}).then(function(R){var k=R.failures,R=R.numFailures;if(R)throw new bt("Could not delete some values",Object.keys(k).map(function(J){return k[J]}),h-R);return h-R})})})};var Bd=lt;function lt(){}var Ml=function(s,a){return a.value=null};function Ud(s,a){return s<a?-1:s===a?0:1}function qd(s,a){return a<s?-1:s===a?0:1}function sn(s,a,u){return s=s instanceof jl?new s.Collection(s):s,s._ctx.error=new(u||TypeError)(a),s}function Hs(s){return new s.Collection(s,function(){return Il("")}).limit(0)}function fo(q,a,u,d){var p,h,w,k,R,J,N,K=u.length;if(!u.every(function(V){return typeof V=="string"}))return sn(q,kl);function F(V){p=V==="next"?function(re){return re.toUpperCase()}:function(re){return re.toLowerCase()},h=V==="next"?function(re){return re.toLowerCase()}:function(re){return re.toUpperCase()},w=V==="next"?Ud:qd;var U=u.map(function(re){return{lower:h(re),upper:p(re)}}).sort(function(re,Q){return w(re.lower,Q.lower)});k=U.map(function(re){return re.upper}),R=U.map(function(re){return re.lower}),N=(J=V)==="next"?"":d}F("next");var q=new q.Collection(q,function(){return Zn(k[0],R[K-1]+d)}),B=(q._ondirectionchange=function(V){F(V)},0);return q._addAlgorithm(function(V,U,re){var Q=V.key;if(typeof Q=="string"){var ie=h(Q);if(a(ie,R,B))return!0;for(var pe=null,me=B;me<K;++me){var xe=((ge,Ke,_e,Ve,ve,ze)=>{for(var We=Math.min(ge.length,Ve.length),Je=-1,nt=0;nt<We;++nt){var rn=Ke[nt];if(rn!==Ve[nt])return ve(ge[nt],_e[nt])<0?ge.substr(0,nt)+_e[nt]+_e.substr(nt+1):ve(ge[nt],Ve[nt])<0?ge.substr(0,nt)+Ve[nt]+_e.substr(nt+1):0<=Je?ge.substr(0,Je)+Ke[Je]+_e.substr(Je+1):null;ve(ge[nt],rn)<0&&(Je=nt)}return We<Ve.length&&ze==="next"?ge+_e.substr(ge.length):We<ge.length&&ze==="prev"?ge.substr(0,_e.length):Je<0?null:ge.substr(0,Je)+Ve[Je]+_e.substr(Je+1)})(Q,ie,k[me],R[me],w,J);xe===null&&pe===null?B=me+1:(pe===null||0<w(pe,xe))&&(pe=xe)}U(pe!==null?function(){V.continue(pe+N)}:re)}return!1}),q}function Zn(s,a,u,d){return{type:2,lower:s,upper:a,lowerOpen:u,upperOpen:d}}function Il(s){return{type:1,lower:s,upper:s}}Object.defineProperty(Lt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Lt.prototype.between=function(s,a,u,d){u=u!==!1,d=d===!0;try{return 0<this._cmp(s,a)||this._cmp(s,a)===0&&(u||d)&&(!u||!d)?Hs(this):new this.Collection(this,function(){return Zn(s,a,!u,!d)})}catch{return sn(this,Kn)}},Lt.prototype.equals=function(s){return s==null?sn(this,Kn):new this.Collection(this,function(){return Il(s)})},Lt.prototype.above=function(s){return s==null?sn(this,Kn):new this.Collection(this,function(){return Zn(s,void 0,!0)})},Lt.prototype.aboveOrEqual=function(s){return s==null?sn(this,Kn):new this.Collection(this,function(){return Zn(s,void 0,!1)})},Lt.prototype.below=function(s){return s==null?sn(this,Kn):new this.Collection(this,function(){return Zn(void 0,s,!1,!0)})},Lt.prototype.belowOrEqual=function(s){return s==null?sn(this,Kn):new this.Collection(this,function(){return Zn(void 0,s)})},Lt.prototype.startsWith=function(s){return typeof s!="string"?sn(this,kl):this.between(s,s+bs,!0,!0)},Lt.prototype.startsWithIgnoreCase=function(s){return s===""?this.startsWith(s):fo(this,function(a,u){return a.indexOf(u[0])===0},[s],bs)},Lt.prototype.equalsIgnoreCase=function(s){return fo(this,function(a,u){return a===u[0]},[s],"")},Lt.prototype.anyOfIgnoreCase=function(){var s=Se.apply(ke,arguments);return s.length===0?Hs(this):fo(this,function(a,u){return u.indexOf(a)!==-1},s,"")},Lt.prototype.startsWithAnyOfIgnoreCase=function(){var s=Se.apply(ke,arguments);return s.length===0?Hs(this):fo(this,function(a,u){return u.some(function(d){return a.indexOf(d)===0})},s,bs)},Lt.prototype.anyOf=function(){var s,a,u=this,d=Se.apply(ke,arguments),p=this._cmp;try{d.sort(p)}catch{return sn(this,Kn)}return d.length===0?Hs(this):((s=new this.Collection(this,function(){return Zn(d[0],d[d.length-1])}))._ondirectionchange=function(h){p=h==="next"?u._ascending:u._descending,d.sort(p)},a=0,s._addAlgorithm(function(h,w,k){for(var R=h.key;0<p(R,d[a]);)if(++a===d.length)return w(k),!1;return p(R,d[a])===0||(w(function(){h.continue(d[a])}),!1)}),s)},Lt.prototype.notEqual=function(s){return this.inAnyRange([[-1/0,s],[s,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Lt.prototype.noneOf=function(){var s=Se.apply(ke,arguments);if(s.length===0)return new this.Collection(this);try{s.sort(this._ascending)}catch{return sn(this,Kn)}var a=s.reduce(function(u,d){return u?u.concat([[u[u.length-1][1],d]]):[[-1/0,d]]},null);return a.push([s[s.length-1],this.db._maxKey]),this.inAnyRange(a,{includeLowers:!1,includeUppers:!1})},Lt.prototype.inAnyRange=function(s,re){var u=this,d=this._cmp,p=this._ascending,h=this._descending,w=this._min,k=this._max;if(s.length===0)return Hs(this);if(!s.every(function(Q){return Q[0]!==void 0&&Q[1]!==void 0&&p(Q[0],Q[1])<=0}))return sn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Ne.InvalidArgument);var R=!re||re.includeLowers!==!1,J=re&&re.includeUppers===!0,N,K=p;function F(Q,ie){return K(Q[0],ie[0])}try{(N=s.reduce(function(Q,ie){for(var pe=0,me=Q.length;pe<me;++pe){var xe=Q[pe];if(d(ie[0],xe[1])<0&&0<d(ie[1],xe[0])){xe[0]=w(xe[0],ie[0]),xe[1]=k(xe[1],ie[1]);break}}return pe===me&&Q.push(ie),Q},[])).sort(F)}catch{return sn(this,Kn)}var q=0,B=J?function(Q){return 0<p(Q,N[q][1])}:function(Q){return 0<=p(Q,N[q][1])},V=R?function(Q){return 0<h(Q,N[q][0])}:function(Q){return 0<=h(Q,N[q][0])},U=B,re=new this.Collection(this,function(){return Zn(N[0][0],N[N.length-1][1],!R,!J)});return re._ondirectionchange=function(Q){K=Q==="next"?(U=B,p):(U=V,h),N.sort(F)},re._addAlgorithm(function(Q,ie,pe){for(var me,xe=Q.key;U(xe);)if(++q===N.length)return ie(pe),!1;return!B(me=xe)&&!V(me)||(u._cmp(xe,N[q][1])===0||u._cmp(xe,N[q][0])===0||ie(function(){K===p?Q.continue(N[q][0]):Q.continue(N[q][1])}),!1)}),re},Lt.prototype.startsWithAnyOf=function(){var s=Se.apply(ke,arguments);return s.every(function(a){return typeof a=="string"})?s.length===0?Hs(this):this.inAnyRange(s.map(function(a){return[a,a+bs]})):sn(this,"startsWithAnyOf() only works with strings")};var jl=Lt;function Lt(){}function hn(s){return xt(function(a){return vr(a),s(a.target.error),!1})}function vr(s){s.stopPropagation&&s.stopPropagation(),s.preventDefault&&s.preventDefault()}var po="storagemutated",Ka="x-storagemutated-1",es=fr(null,po),Hd=(kn.prototype._lock=function(){return A(!Be.global),++this._reculock,this._reculock!==1||Be.global||(Be.lockOwnerFor=this),this},kn.prototype._unlock=function(){if(A(!Be.global),--this._reculock==0)for(Be.global||(Be.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var s=this._blockedFuncs.shift();try{gs(s[1],s[0])}catch{}}return this},kn.prototype._locked=function(){return this._reculock&&Be.lockOwnerFor!==this},kn.prototype.create=function(s){var a=this;if(this.mode){var u=this.db.idbdb,d=this.db._state.dbOpenError;if(A(!this.idbtrans),!s&&!u)switch(d&&d.name){case"DatabaseClosedError":throw new Ne.DatabaseClosed(d);case"MissingAPIError":throw new Ne.MissingAPI(d.message,d);default:throw new Ne.OpenFailed(d)}if(!this.active)throw new Ne.TransactionInactive;A(this._completion._state===null),(s=this.idbtrans=s||(this.db.core||u).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=xt(function(p){vr(p),a._reject(s.error)}),s.onabort=xt(function(p){vr(p),a.active&&a._reject(new Ne.Abort(s.error)),a.active=!1,a.on("abort").fire(p)}),s.oncomplete=xt(function(){a.active=!1,a._resolve(),"mutatedParts"in s&&es.storagemutated.fire(s.mutatedParts)})}return this},kn.prototype._promise=function(s,a,u){var d,p=this;return s==="readwrite"&&this.mode!=="readwrite"?Tt(new Ne.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Pe(function(h,w){p._blockedFuncs.push([function(){p._promise(s,a,u).then(h,w)},Be])}):u?Jn(function(){var h=new Pe(function(w,k){p._lock();var R=a(w,k,p);R&&R.then&&R.then(w,k)});return h.finally(function(){return p._unlock()}),h._lib=!0,h}):((d=new Pe(function(h,w){var k=a(h,w,p);k&&k.then&&k.then(h,w)}))._lib=!0,d):Tt(new Ne.TransactionInactive)},kn.prototype._root=function(){return this.parent?this.parent._root():this},kn.prototype.waitFor=function(s){var a,u=this._root(),d=Pe.resolve(s),p=(u._waitingFor?u._waitingFor=u._waitingFor.then(function(){return d}):(u._waitingFor=d,u._waitingQueue=[],a=u.idbtrans.objectStore(u.storeNames[0]),function h(){for(++u._spinCount;u._waitingQueue.length;)u._waitingQueue.shift()();u._waitingFor&&(a.get(-1/0).onsuccess=h)}()),u._waitingFor);return new Pe(function(h,w){d.then(function(k){return u._waitingQueue.push(xt(h.bind(null,k)))},function(k){return u._waitingQueue.push(xt(w.bind(null,k)))}).finally(function(){u._waitingFor===p&&(u._waitingFor=null)})})},kn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Ne.Abort))},kn.prototype.table=function(s){var a=this._memoizedTables||(this._memoizedTables={});if(_(a,s))return a[s];var u=this.schema[s];if(u)return(u=new this.db.Table(s,u,this)).core=this.db.core.table(s),a[s]=u;throw new Ne.NotFound("Table "+s+" not part of transaction")},kn);function kn(){}function Ra(s,a,u,d,p,h,w,k){return{name:s,keyPath:a,unique:u,multi:d,auto:p,compound:h,src:(u&&!w?"&":"")+(d?"*":"")+(p?"++":"")+Dl(a),type:k}}function Dl(s){return typeof s=="string"?s:s?"["+[].join.call(s,"+")+"]":""}function Fa(s,a,u){return{name:s,primKey:a,indexes:u,mappedClass:null,idxByName:(d=function(p){return[p.name,p]},u.reduce(function(p,h,w){return h=d(h,w),h&&(p[h[0]]=h[1]),p},{}))};var d}var mr=function(s){try{return s.only([[]]),mr=function(){return[[]]},[[]]}catch{return mr=function(){return bs},bs}};function Na(s){return s==null?function(){}:typeof s=="string"?(a=s).split(".").length===1?function(u){return u[a]}:function(u){return Z(u,a)}:function(u){return Z(u,s)};var a}function Ll(s){return[].slice.call(s)}var zd=0;function hr(s){return s==null?":id":typeof s=="string"?s:"[".concat(s.join("+"),"]")}function Wd(s,a,w){function d(U){if(U.type===3)return null;if(U.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var q=U.lower,B=U.upper,V=U.lowerOpen,U=U.upperOpen;return q===void 0?B===void 0?null:a.upperBound(B,!!U):B===void 0?a.lowerBound(q,!!V):a.bound(q,B,!!V,!!U)}function p(F){var q,B,V=F.name;return{name:V,schema:F,mutate:function(U){var re=U.trans,Q=U.type,ie=U.keys,pe=U.values,me=U.range;return new Promise(function(xe,ge){xe=xt(xe);var Ke=re.objectStore(V),_e=Ke.keyPath==null,Ve=Q==="put"||Q==="add";if(!Ve&&Q!=="delete"&&Q!=="deleteRange")throw new Error("Invalid operation type: "+Q);var ve,ze=(ie||pe||{length:1}).length;if(ie&&pe&&ie.length!==pe.length)throw new Error("Given keys array must have same length as given values array.");if(ze===0)return xe({numFailures:0,failures:{},results:[],lastResult:void 0});function We(Jt){++rn,vr(Jt)}var Je=[],nt=[],rn=0;if(Q==="deleteRange"){if(me.type===4)return xe({numFailures:rn,failures:nt,results:[],lastResult:void 0});me.type===3?Je.push(ve=Ke.clear()):Je.push(ve=Ke.delete(d(me)))}else{var _e=Ve?_e?[pe,ie]:[pe,null]:[ie,null],Ge=_e[0],qt=_e[1];if(Ve)for(var Ht=0;Ht<ze;++Ht)Je.push(ve=qt&&qt[Ht]!==void 0?Ke[Q](Ge[Ht],qt[Ht]):Ke[Q](Ge[Ht])),ve.onerror=We;else for(Ht=0;Ht<ze;++Ht)Je.push(ve=Ke[Q](Ge[Ht])),ve.onerror=We}function $o(Jt){Jt=Jt.target.result,Je.forEach(function(xs,ri){return xs.error!=null&&(nt[ri]=xs.error)}),xe({numFailures:rn,failures:nt,results:Q==="delete"?ie:Je.map(function(xs){return xs.result}),lastResult:Jt})}ve.onerror=function(Jt){We(Jt),$o(Jt)},ve.onsuccess=$o})},getMany:function(U){var re=U.trans,Q=U.keys;return new Promise(function(ie,pe){ie=xt(ie);for(var me,xe=re.objectStore(V),ge=Q.length,Ke=new Array(ge),_e=0,Ve=0,ve=function(Je){Je=Je.target,Ke[Je._pos]=Je.result,++Ve===_e&&ie(Ke)},ze=hn(pe),We=0;We<ge;++We)Q[We]!=null&&((me=xe.get(Q[We]))._pos=We,me.onsuccess=ve,me.onerror=ze,++_e);_e===0&&ie(Ke)})},get:function(U){var re=U.trans,Q=U.key;return new Promise(function(ie,pe){ie=xt(ie);var me=re.objectStore(V).get(Q);me.onsuccess=function(xe){return ie(xe.target.result)},me.onerror=hn(pe)})},query:(q=R,B=J,function(U){return new Promise(function(re,Q){re=xt(re);var ie,pe,me,xe,ze=U.trans,ge=U.values,Ke=U.limit,ve=U.query,_e=(_e=U.direction)!=null?_e:"next",Ve=Ke===1/0?void 0:Ke,We=ve.index,ve=ve.range,ze=ze.objectStore(V),ze=We.isPrimaryKey?ze:ze.index(We.name),We=d(ve);if(Ke===0)return re({result:[]});B?(ve={query:We,count:Ve,direction:_e},(ie=ge?ze.getAll(ve):ze.getAllKeys(ve)).onsuccess=function(Je){return re({result:Je.target.result})},ie.onerror=hn(Q)):q&&_e==="next"?((ie=ge?ze.getAll(We,Ve):ze.getAllKeys(We,Ve)).onsuccess=function(Je){return re({result:Je.target.result})},ie.onerror=hn(Q)):(pe=0,me=!ge&&"openKeyCursor"in ze?ze.openKeyCursor(We,_e):ze.openCursor(We,_e),xe=[],me.onsuccess=function(){var Je=me.result;return!Je||(xe.push(ge?Je.value:Je.primaryKey),++pe===Ke)?re({result:xe}):void Je.continue()},me.onerror=hn(Q))})}),openCursor:function(U){var re=U.trans,Q=U.values,ie=U.query,pe=U.reverse,me=U.unique;return new Promise(function(xe,ge){xe=xt(xe);var Ve=ie.index,Ke=ie.range,_e=re.objectStore(V),_e=Ve.isPrimaryKey?_e:_e.index(Ve.name),Ve=pe?me?"prevunique":"prev":me?"nextunique":"next",ve=!Q&&"openKeyCursor"in _e?_e.openKeyCursor(d(Ke),Ve):_e.openCursor(d(Ke),Ve);ve.onerror=hn(ge),ve.onsuccess=xt(function(ze){var We,Je,nt,rn,Ge=ve.result;Ge?(Ge.___id=++zd,Ge.done=!1,We=Ge.continue.bind(Ge),Je=(Je=Ge.continuePrimaryKey)&&Je.bind(Ge),nt=Ge.advance.bind(Ge),rn=function(){throw new Error("Cursor not stopped")},Ge.trans=re,Ge.stop=Ge.continue=Ge.continuePrimaryKey=Ge.advance=function(){throw new Error("Cursor not started")},Ge.fail=xt(ge),Ge.next=function(){var qt=this,Ht=1;return this.start(function(){return Ht--?qt.continue():qt.stop()}).then(function(){return qt})},Ge.start=function(qt){function Ht(){if(ve.result)try{qt()}catch(Jt){Ge.fail(Jt)}else Ge.done=!0,Ge.start=function(){throw new Error("Cursor behind last entry")},Ge.stop()}var $o=new Promise(function(Jt,xs){Jt=xt(Jt),ve.onerror=hn(xs),Ge.fail=xs,Ge.stop=function(ri){Ge.stop=Ge.continue=Ge.continuePrimaryKey=Ge.advance=rn,Jt(ri)}});return ve.onsuccess=xt(function(Jt){ve.onsuccess=Ht,Ht()}),Ge.continue=We,Ge.continuePrimaryKey=Je,Ge.advance=nt,Ht(),$o},xe(Ge)):xe(null)},ge)})},count:function(U){var re=U.query,Q=U.trans,ie=re.index,pe=re.range;return new Promise(function(me,xe){var ge=Q.objectStore(V),ge=ie.isPrimaryKey?ge:ge.index(ie.name),Ke=d(pe),Ke=Ke?ge.count(Ke):ge.count();Ke.onsuccess=xt(function(_e){return me(_e.target.result)}),Ke.onerror=hn(xe)})}}}h=w,k=Ll((w=s).objectStoreNames),N=0<k.length?h.objectStore(k[0]):{};var h,w={schema:{name:w.name,tables:k.map(function(F){return h.objectStore(F)}).map(function(F){var q=F.keyPath,B=F.autoIncrement,U=f(q),V={},U={name:F.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:q==null,compound:U,keyPath:q,autoIncrement:B,unique:!0,extractKey:Na(q)},indexes:Ll(F.indexNames).map(function(re){return F.index(re)}).map(function(pe){var me=pe.name,Q=pe.unique,ie=pe.multiEntry,pe=pe.keyPath,me={name:me,compound:f(pe),keyPath:pe,unique:Q,multiEntry:ie,extractKey:Na(pe)};return V[hr(pe)]=me}),getIndexByKeyPath:function(re){return V[hr(re)]}};return V[":id"]=U.primaryKey,q!=null&&(V[hr(q)]=U.primaryKey),U})},hasGetAll:0<k.length&&"getAll"in N&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in N},k=w.schema,R=w.hasGetAll,J=w.hasIdb3Features,N=k.tables.map(p),K={};return N.forEach(function(F){return K[F.name]=F}),{stack:"dbcore",transaction:s.transaction.bind(s),table:function(F){if(K[F])return K[F];throw new Error("Table '".concat(F,"' not found"))},MIN_KEY:-1/0,MAX_KEY:mr(a),schema:k}}function Gd(s,a,u,d){return u=u.IDBKeyRange,a=Wd(a,u,d),{dbcore:s.dbcore.reduce(function(p,h){return h=h.create,r(r({},p),h(p))},a)}}function vo(s,a){var u=a.db,u=Gd(s._middlewares,u,s._deps,a);s.core=u.dbcore,s.tables.forEach(function(d){var p=d.name;s.core.schema.tables.some(function(h){return h.name===p})&&(d.core=s.core.table(p),s[p]instanceof s.Table)&&(s[p].core=d.core)})}function mo(s,a,u,d){u.forEach(function(p){var h=d[p];a.forEach(function(w){var k=function R(J,N){return le(J,N)||(J=b(J))&&R(J,N)}(w,p);(!k||"value"in k&&k.value===void 0)&&(w===s.Transaction.prototype||w instanceof s.Transaction?I(w,p,{get:function(){return this.table(p)},set:function(R){C(this,p,{value:R,writable:!0,configurable:!0,enumerable:!0})}}):w[p]=new s.Table(p,h))})})}function Va(s,a){a.forEach(function(u){for(var d in u)u[d]instanceof s.Table&&delete u[d]})}function Yd(s,a){return s._cfg.version-a._cfg.version}function Jd(s,a,u,d){var p=s._dbSchema,h=(u.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=Fa("$meta",Rl("")[0],[]),s._storeNames.push("$meta")),s._createTransaction("readwrite",s._storeNames,p)),w=(h.create(u),h._completion.catch(d),h._reject.bind(h)),k=Be.transless||Be;Jn(function(){if(Be.trans=h,Be.transless=k,a!==0)return vo(s,u),J=a,((R=h).storeNames.includes("$meta")?R.table("$meta").get("version").then(function(N){return N??J}):Pe.resolve(J)).then(function(U){var K=s,F=U,q=h,B=u,V=[],U=K._versions,re=K._dbSchema=yo(0,K.idbdb,B);return(U=U.filter(function(Q){return Q._cfg.version>=F})).length===0?Pe.resolve():(U.forEach(function(Q){V.push(function(){var ie,pe,me,xe=re,ge=Q._cfg.dbschema,Ke=(go(K,xe,B),go(K,ge,B),re=K._dbSchema=ge,Ba(xe,ge)),_e=(Ke.add.forEach(function(Ve){Ua(B,Ve[0],Ve[1].primKey,Ve[1].indexes)}),Ke.change.forEach(function(Ve){if(Ve.recreate)throw new Ne.Upgrade("Not yet support for changing primary key");var ve=B.objectStore(Ve.name);Ve.add.forEach(function(ze){return ho(ve,ze)}),Ve.change.forEach(function(ze){ve.deleteIndex(ze.name),ho(ve,ze)}),Ve.del.forEach(function(ze){return ve.deleteIndex(ze)})}),Q._cfg.contentUpgrade);if(_e&&Q._cfg.version>F)return vo(K,B),q._memoizedTables={},ie=te(ge),Ke.del.forEach(function(Ve){ie[Ve]=xe[Ve]}),Va(K,[K.Transaction.prototype]),mo(K,[K.Transaction.prototype],c(ie),ie),q.schema=ie,(pe=De(_e))&&Us(),ge=Pe.follow(function(){var Ve;(me=_e(q))&&pe&&(Ve=Xn.bind(null,null),me.then(Ve,Ve))}),me&&typeof me.then=="function"?Pe.resolve(me):ge.then(function(){return me})}),V.push(function(ie){var pe,me,xe=Q._cfg.dbschema;pe=xe,me=ie,[].slice.call(me.db.objectStoreNames).forEach(function(ge){return pe[ge]==null&&me.db.deleteObjectStore(ge)}),Va(K,[K.Transaction.prototype]),mo(K,[K.Transaction.prototype],K._storeNames,K._dbSchema),q.schema=K._dbSchema}),V.push(function(ie){K.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(K.idbdb.version/10)===Q._cfg.version?(K.idbdb.deleteObjectStore("$meta"),delete K._dbSchema.$meta,K._storeNames=K._storeNames.filter(function(pe){return pe!=="$meta"})):ie.objectStore("$meta").put(Q._cfg.version,"version"))})}),function Q(){return V.length?Pe.resolve(V.shift()(q.idbtrans)).then(Q):Pe.resolve()}().then(function(){Kl(re,B)}))}).catch(w);var R,J;c(p).forEach(function(N){Ua(u,N,p[N].primKey,p[N].indexes)}),vo(s,u),Pe.follow(function(){return s.on.populate.fire(h)}).catch(w)})}function Xd(s,a){Kl(s._dbSchema,a),a.db.version%10!=0||a.objectStoreNames.contains("$meta")||a.db.createObjectStore("$meta").add(Math.ceil(a.db.version/10-1),"version");var u=yo(0,s.idbdb,a);go(s,s._dbSchema,a);for(var d=0,p=Ba(u,s._dbSchema).change;d<p.length;d++){var h=(w=>{if(w.change.length||w.recreate)return console.warn("Unable to patch indexes of table ".concat(w.name," because it has changes on the type of index or primary key.")),{value:void 0};var k=a.objectStore(w.name);w.add.forEach(function(R){Ce&&console.debug("Dexie upgrade patch: Creating missing index ".concat(w.name,".").concat(R.src)),ho(k,R)})})(p[d]);if(typeof h=="object")return h.value}}function Ba(s,a){var u,d={del:[],add:[],change:[]};for(u in s)a[u]||d.del.push(u);for(u in a){var p=s[u],h=a[u];if(p){var w={name:u,def:h,recreate:!1,del:[],add:[],change:[]};if(""+(p.primKey.keyPath||"")!=""+(h.primKey.keyPath||"")||p.primKey.auto!==h.primKey.auto)w.recreate=!0,d.change.push(w);else{var k=p.idxByName,R=h.idxByName,J=void 0;for(J in k)R[J]||w.del.push(J);for(J in R){var N=k[J],K=R[J];N?N.src!==K.src&&w.change.push(K):w.add.push(K)}(0<w.del.length||0<w.add.length||0<w.change.length)&&d.change.push(w)}}else d.add.push([u,h])}return d}function Ua(s,a,u,d){var p=s.db.createObjectStore(a,u.keyPath?{keyPath:u.keyPath,autoIncrement:u.auto}:{autoIncrement:u.auto});d.forEach(function(h){return ho(p,h)})}function Kl(s,a){c(s).forEach(function(u){a.db.objectStoreNames.contains(u)||(Ce&&console.debug("Dexie: Creating missing table",u),Ua(a,u,s[u].primKey,s[u].indexes))})}function ho(s,a){s.createIndex(a.name,a.keyPath,{unique:a.unique,multiEntry:a.multi})}function yo(s,a,u){var d={};return ue(a.objectStoreNames,0).forEach(function(p){for(var h=u.objectStore(p),w=Ra(Dl(J=h.keyPath),J||"",!0,!1,!!h.autoIncrement,J&&typeof J!="string",!0),k=[],R=0;R<h.indexNames.length;++R){var N=h.index(h.indexNames[R]),J=N.keyPath,N=Ra(N.name,J,!!N.unique,!!N.multiEntry,!1,J&&typeof J!="string",!1);k.push(N)}d[p]=Fa(p,w,k)}),d}function go(s,a,u){for(var d=u.db.objectStoreNames,p=0;p<d.length;++p){var h=d[p],w=u.objectStore(h);s._hasGetAll="getAll"in w;for(var k=0;k<w.indexNames.length;++k){var R,J=w.indexNames[k],N=w.index(J).keyPath,N=typeof N=="string"?N:"["+ue(N).join("+")+"]";a[h]&&(R=a[h].idxByName[N])&&(R.name=J,delete a[h].idxByName[N],a[h].idxByName[J]=R)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(s._hasGetAll=!1)}function Rl(s){return s.split(",").map(function(a,u){var p=a.split(":"),d=(d=p[1])==null?void 0:d.trim(),p=(a=p[0].trim()).replace(/([&*]|\+\+)/g,""),h=/^\[/.test(p)?p.match(/^\[(.*)\]$/)[1].split("+"):p;return Ra(p,h||null,/\&/.test(a),/\*/.test(a),/\+\+/.test(a),f(h),u===0,d)})}zs.prototype._createTableSchema=Fa,zs.prototype._parseIndexSyntax=Rl,zs.prototype._parseStoresSpec=function(s,a){var u=this;c(s).forEach(function(d){if(s[d]!==null){var p=u._parseIndexSyntax(s[d]),h=p.shift();if(!h)throw new Ne.Schema("Invalid schema for table "+d+": "+s[d]);if(h.unique=!0,h.multi)throw new Ne.Schema("Primary key cannot be multiEntry*");p.forEach(function(w){if(w.auto)throw new Ne.Schema("Only primary key can be marked as autoIncrement (++)");if(!w.keyPath)throw new Ne.Schema("Index must have a name and cannot be an empty string")}),h=u._createTableSchema(d,h,p),a[d]=h}})},zs.prototype.stores=function(u){var a=this.db,u=(this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,u):u,a._versions),d={},p={};return u.forEach(function(h){v(d,h._cfg.storesSource),p=h._cfg.dbschema={},h._parseStoresSpec(d,p)}),a._dbSchema=p,Va(a,[a._allTables,a,a.Transaction.prototype]),mo(a,[a._allTables,a,a.Transaction.prototype,this._cfg.tables],c(p),p),a._storeNames=c(p),this},zs.prototype.upgrade=function(s){return this._cfg.contentUpgrade=se(this._cfg.contentUpgrade||m,s),this};var Qd=zs;function zs(){}var yr=(()=>{var s,a,u;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(s=new Set,a=new FinalizationRegistry(function(d){s.delete(d)}),{toArray:function(){return Array.from(s).map(function(d){return d.deref()}).filter(function(d){return d!==void 0})},add:function(d){var p=new WeakRef(d._novip);s.add(p),a.register(d._novip,p,p),s.size>d._options.maxConnections&&(p=s.values().next().value,s.delete(p),a.unregister(p))},remove:function(d){if(d)for(var p=s.values(),h=p.next();!h.done;){var w=h.value;if(w.deref()===d._novip)return s.delete(w),void a.unregister(w);h=p.next()}}}):(u=[],{toArray:function(){return u},add:function(d){u.push(d._novip)},remove:function(d){d&&(d=u.indexOf(d._novip))!==-1&&u.splice(d,1)}})})();function qa(s,a){var u=s._dbNamesDB;return u||(u=s._dbNamesDB=new Rn(ao,{addons:[],indexedDB:s,IDBKeyRange:a})).version(1).stores({dbnames:"name"}),u.table("dbnames")}function Ha(s){return s&&typeof s.databases=="function"}function za(s){return Jn(function(){return Be.letThrough=!0,s()})}function Wa(s){return!("from"in s)}var Ut=function(s,a){var u;if(!this)return u=new Ut,s&&"d"in s&&v(u,s),u;v(this,arguments.length?{d:1,from:s,to:1<arguments.length?a:s}:{d:0})};function gr(s,a,u){var d=rt(a,u);if(!isNaN(d)){if(0<d)throw RangeError();if(Wa(s))return v(s,{from:a,to:u,d:1});var d=s.l,p=s.r;if(rt(u,s.from)<0)return d?gr(d,a,u):s.l={from:a,to:u,d:1,l:null,r:null},Nl(s);if(0<rt(a,s.to))return p?gr(p,a,u):s.r={from:a,to:u,d:1,l:null,r:null},Nl(s);rt(a,s.from)<0&&(s.from=a,s.l=null,s.d=p?p.d+1:1),0<rt(u,s.to)&&(s.to=u,s.r=null,s.d=s.l?s.l.d+1:1),a=!s.r,d&&!s.l&&br(s,d),p&&a&&br(s,p)}}function br(s,a){Wa(a)||function u(d,p){var h=p.from,w=p.l,k=p.r;gr(d,h,p.to),w&&u(d,w),k&&u(d,k)}(s,a)}function Fl(s,a){var u=bo(a),d=u.next();if(!d.done)for(var p=d.value,h=bo(s),w=h.next(p.from),k=w.value;!d.done&&!w.done;){if(rt(k.from,p.to)<=0&&0<=rt(k.to,p.from))return!0;rt(p.from,k.from)<0?p=(d=u.next(k.from)).value:k=(w=h.next(p.from)).value}return!1}function bo(s){var a=Wa(s)?null:{s:0,n:s};return{next:function(u){for(var d=0<arguments.length;a;)switch(a.s){case 0:if(a.s=1,d)for(;a.n.l&&rt(u,a.n.from)<0;)a={up:a,n:a.n.l,s:1};else for(;a.n.l;)a={up:a,n:a.n.l,s:1};case 1:if(a.s=2,!d||rt(u,a.n.to)<=0)return{value:a.n,done:!1};case 2:if(a.n.r){a.s=3,a={up:a,n:a.n.r,s:0};continue}case 3:a=a.up}return{done:!0}}}}function Nl(s){var a,u,d,p=(((p=s.r)==null?void 0:p.d)||0)-(((p=s.l)==null?void 0:p.d)||0),p=1<p?"r":p<-1?"l":"";p&&(a=p=="r"?"l":"r",u=r({},s),d=s[p],s.from=d.from,s.to=d.to,s[p]=d[p],u[p]=d[a],(s[a]=u).d=Vl(u)),s.d=Vl(s)}function Vl(u){var a=u.r,u=u.l;return(a?u?Math.max(a.d,u.d):a.d:u?u.d:0)+1}function wo(s,a){return c(a).forEach(function(u){s[u]?br(s[u],a[u]):s[u]=function d(p){var h,w,k={};for(h in p)_(p,h)&&(w=p[h],k[h]=!w||typeof w!="object"||j.has(w.constructor)?w:d(w));return k}(a[u])}),s}function Ga(s,a){return s.all||a.all||Object.keys(s).some(function(u){return a[u]&&Fl(a[u],s[u])})}S(Ut.prototype,((Ze={add:function(s){return br(this,s),this},addKey:function(s){return gr(this,s,s),this},addKeys:function(s){var a=this;return s.forEach(function(u){return gr(a,u,u)}),this},hasKey:function(s){var a=bo(this).next(s).value;return a&&rt(a.from,s)<=0&&0<=rt(a.to,s)}})[Ae]=function(){return bo(this)},Ze));var _s={},Ya={},Ja=!1;function _o(s){wo(Ya,s),Ja||(Ja=!0,setTimeout(function(){Ja=!1,Xa(Ya,!(Ya={}))},0))}function Xa(s,a){a===void 0&&(a=!1);var u=new Set;if(s.all)for(var d=0,p=Object.values(_s);d<p.length;d++)Bl(k=p[d],s,u,a);else for(var h in s){var w,k,h=/^idb\:\/\/(.*)\/(.*)\//.exec(h);h&&(w=h[1],h=h[2],k=_s["idb://".concat(w,"/").concat(h)])&&Bl(k,s,u,a)}u.forEach(function(R){return R()})}function Bl(s,a,u,d){for(var p=[],h=0,w=Object.entries(s.queries.query);h<w.length;h++){for(var k=w[h],R=k[0],J=[],N=0,K=k[1];N<K.length;N++){var F=K[N];Ga(a,F.obsSet)?F.subscribers.forEach(function(U){return u.add(U)}):d&&J.push(F)}d&&p.push([R,J])}if(d)for(var q=0,B=p;q<B.length;q++){var V=B[q],R=V[0],J=V[1];s.queries.query[R]=J}}function Zd(s){var a=s._state,u=s._deps.indexedDB;if(a.isBeingOpened||s.idbdb)return a.dbReadyPromise.then(function(){return a.dbOpenError?Tt(a.dbOpenError):s});a.isBeingOpened=!0,a.dbOpenError=null,a.openComplete=!1;var d=a.openCanceller,p=Math.round(10*s.verno),h=!1;function w(){if(a.openCanceller!==d)throw new Ne.DatabaseClosed("db.open() was cancelled")}function k(){return new Pe(function(F,q){if(w(),!u)throw new Ne.MissingAPI;var B=s.name,V=a.autoSchema||!p?u.open(B):u.open(B,p);if(!V)throw new Ne.MissingAPI;V.onerror=hn(q),V.onblocked=xt(s._fireOnBlocked),V.onupgradeneeded=xt(function(U){var re;N=V.transaction,a.autoSchema&&!s._options.allowEmptyDB?(V.onerror=vr,N.abort(),V.result.close(),(re=u.deleteDatabase(B)).onsuccess=re.onerror=xt(function(){q(new Ne.NoSuchDatabase("Database ".concat(B," doesnt exist")))})):(N.onerror=hn(q),re=U.oldVersion>Math.pow(2,62)?0:U.oldVersion,K=re<1,s.idbdb=V.result,h&&Xd(s,N),Jd(s,re/10,N,q))},q),V.onsuccess=xt(function(){N=null;var U,re,Q,ie,pe,me,xe=s.idbdb=V.result,ge=ue(xe.objectStoreNames);if(0<ge.length)try{var Ke=xe.transaction((pe=ge).length===1?pe[0]:pe,"readonly");if(a.autoSchema)me=xe,ie=Ke,(Q=s).verno=me.version/10,ie=Q._dbSchema=yo(0,me,ie),Q._storeNames=ue(me.objectStoreNames,0),mo(Q,[Q._allTables],c(ie),ie);else if(go(s,s._dbSchema,Ke),re=Ke,((re=Ba(yo(0,(U=s).idbdb,re),U._dbSchema)).add.length||re.change.some(function(_e){return _e.add.length||_e.change.length}))&&!h)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),xe.close(),p=xe.version+1,h=!0,F(k());vo(s,Ke)}catch{}yr.add(s),xe.onversionchange=xt(function(_e){a.vcFired=!0,s.on("versionchange").fire(_e)}),xe.onclose=xt(function(){s.close({disableAutoOpen:!1})}),K&&(ge=s._deps,pe=B,Ha(me=ge.indexedDB)||pe===ao||qa(me,ge.IDBKeyRange).put({name:pe}).catch(m)),F()},q)}).catch(function(F){switch(F==null?void 0:F.name){case"UnknownError":if(0<a.PR1398_maxLoop)return a.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),k();break;case"VersionError":if(0<p)return p=0,k()}return Pe.reject(F)})}var R,J=a.dbReadyResolve,N=null,K=!1;return Pe.race([d,(typeof navigator>"u"?Pe.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(F){function q(){return indexedDB.databases().finally(F)}R=setInterval(q,100),q()}).finally(function(){return clearInterval(R)}):Promise.resolve()).then(k)]).then(function(){return w(),a.onReadyBeingFired=[],Pe.resolve(za(function(){return s.on.ready.fire(s.vip)})).then(function F(){var q;if(0<a.onReadyBeingFired.length)return q=a.onReadyBeingFired.reduce(se,m),a.onReadyBeingFired=[],Pe.resolve(za(function(){return q(s.vip)})).then(F)})}).finally(function(){a.openCanceller===d&&(a.onReadyBeingFired=null,a.isBeingOpened=!1)}).catch(function(F){a.dbOpenError=F;try{N&&N.abort()}catch{}return d===a.openCanceller&&s._close(),Tt(F)}).finally(function(){a.openComplete=!0,J()}).then(function(){var F;return K&&(F={},s.tables.forEach(function(q){q.schema.indexes.forEach(function(B){B.name&&(F["idb://".concat(s.name,"/").concat(q.name,"/").concat(B.name)]=new Ut(-1/0,[[[]]]))}),F["idb://".concat(s.name,"/").concat(q.name,"/")]=F["idb://".concat(s.name,"/").concat(q.name,"/:dels")]=new Ut(-1/0,[[[]]])}),es(po).fire(F),Xa(F,!0)),s})}function Qa(s){function a(h){return s.next(h)}var u=p(a),d=p(function(h){return s.throw(h)});function p(h){return function(k){var k=h(k),R=k.value;return k.done?R:R&&typeof R.then=="function"?R.then(u,d):f(R)?Promise.all(R).then(u,d):u(R)}}return p(a)()}function ko(s,a,u){for(var d=f(s)?s.slice():[s],p=0;p<u;++p)d.push(a);return d}var ef={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(s){return r(r({},s),{table:function(d){var u=s.table(d),d=u.schema,p=Object.create(null),h=[];function w(F,q,B){var Q=hr(F),V=p[Q]=p[Q]||[],U=F==null?0:typeof F=="string"?1:F.length,re=0<q,Q=r(r({},B),{name:re?"".concat(Q,"(virtual-from:").concat(B.name,")"):B.name,lowLevelIndex:B,isVirtual:re,keyTail:q,keyLength:U,extractKey:Na(F),unique:!re&&B.unique});return V.push(Q),Q.isPrimaryKey||h.push(Q),1<U&&w(U===2?F[0]:F.slice(0,U-1),q+1,B),V.sort(function(ie,pe){return ie.keyTail-pe.keyTail}),Q}var k=w(d.primaryKey.keyPath,0,d.primaryKey);p[":id"]=[k];for(var R=0,J=d.indexes;R<J.length;R++){var N=J[R];w(N.keyPath,0,N)}function K(F){var q,B=F.query.index;return B.isVirtual?r(r({},F),{query:{index:B.lowLevelIndex,range:(q=F.query.range,B=B.keyTail,{type:q.type===1?2:q.type,lower:ko(q.lower,q.lowerOpen?s.MAX_KEY:s.MIN_KEY,B),lowerOpen:!0,upper:ko(q.upper,q.upperOpen?s.MIN_KEY:s.MAX_KEY,B),upperOpen:!0})}}):F}return r(r({},u),{schema:r(r({},d),{primaryKey:k,indexes:h,getIndexByKeyPath:function(F){return(F=p[hr(F)])&&F[0]}}),count:function(F){return u.count(K(F))},query:function(F){return u.query(K(F))},openCursor:function(F){var q=F.query.index,B=q.keyTail,V=q.keyLength;return q.isVirtual?u.openCursor(K(F)).then(function(re){return re&&U(re)}):u.openCursor(F);function U(re){return Object.create(re,{continue:{value:function(Q){Q!=null?re.continue(ko(Q,F.reverse?s.MAX_KEY:s.MIN_KEY,B)):F.unique?re.continue(re.key.slice(0,V).concat(F.reverse?s.MIN_KEY:s.MAX_KEY,B)):re.continue()}},continuePrimaryKey:{value:function(Q,ie){re.continuePrimaryKey(ko(Q,s.MAX_KEY,B),ie)}},primaryKey:{get:function(){return re.primaryKey}},key:{get:function(){var Q=re.key;return V===1?Q[0]:Q.slice(0,V)}},value:{get:function(){return re.value}}})}}})}})}};function Za(s,a,u,d){return u=u||{},d=d||"",c(s).forEach(function(p){var h,w,k;_(a,p)?(h=s[p],w=a[p],typeof h=="object"&&typeof w=="object"&&h&&w?(k=ye(h))!==ye(w)?u[d+p]=a[p]:k==="Object"?Za(h,w,u,d+p+"."):h!==w&&(u[d+p]=a[p]):h!==w&&(u[d+p]=a[p])):u[d+p]=void 0}),c(a).forEach(function(p){_(s,p)||(u[d+p]=a[p])}),u}function ei(s,a){return a.type==="delete"?a.keys:a.keys||a.values.map(s.extractKey)}var tf={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(s){return r(r({},s),{table:function(a){var u=s.table(a),d=u.schema.primaryKey;return r(r({},u),{mutate:function(p){var h=Be.trans,w=h.table(a).hook,k=w.deleting,R=w.creating,J=w.updating;switch(p.type){case"add":if(R.fire===m)break;return h._promise("readwrite",function(){return N(p)},!0);case"put":if(R.fire===m&&J.fire===m)break;return h._promise("readwrite",function(){return N(p)},!0);case"delete":if(k.fire===m)break;return h._promise("readwrite",function(){return N(p)},!0);case"deleteRange":if(k.fire===m)break;return h._promise("readwrite",function(){return function K(F,q,B){return u.query({trans:F,values:!1,query:{index:d,range:q},limit:B}).then(function(V){var U=V.result;return N({type:"delete",keys:U,trans:F}).then(function(re){return 0<re.numFailures?Promise.reject(re.failures[0]):U.length<B?{failures:[],numFailures:0,lastResult:void 0}:K(F,r(r({},q),{lower:U[U.length-1],lowerOpen:!0}),B)})})}(p.trans,p.range,1e4)},!0)}return u.mutate(p);function N(K){var F,q,B,V=Be.trans,U=K.keys||ei(d,K);if(U)return(K=K.type==="add"||K.type==="put"?r(r({},K),{keys:U}):r({},K)).type!=="delete"&&(K.values=o([],K.values)),K.keys&&(K.keys=o([],K.keys)),F=u,B=U,((q=K).type==="add"?Promise.resolve([]):F.getMany({trans:q.trans,keys:B,cache:"immutable"})).then(function(re){var Q=U.map(function(ie,pe){var me,xe,ge,Ke=re[pe],_e={onerror:null,onsuccess:null};return K.type==="delete"?k.fire.call(_e,ie,Ke,V):K.type==="add"||Ke===void 0?(me=R.fire.call(_e,ie,K.values[pe],V),ie==null&&me!=null&&(K.keys[pe]=ie=me,d.outbound||G(K.values[pe],d.keyPath,ie))):(me=Za(Ke,K.values[pe]),(xe=J.fire.call(_e,me,ie,Ke,V))&&(ge=K.values[pe],Object.keys(xe).forEach(function(Ve){_(ge,Ve)?ge[Ve]=xe[Ve]:G(ge,Ve,xe[Ve])}))),_e});return u.mutate(K).then(function(ie){for(var pe=ie.failures,me=ie.results,xe=ie.numFailures,ie=ie.lastResult,ge=0;ge<U.length;++ge){var Ke=(me||U)[ge],_e=Q[ge];Ke==null?_e.onerror&&_e.onerror(pe[ge]):_e.onsuccess&&_e.onsuccess(K.type==="put"&&re[ge]?K.values[ge]:Ke)}return{failures:pe,results:me,numFailures:xe,lastResult:ie}}).catch(function(ie){return Q.forEach(function(pe){return pe.onerror&&pe.onerror(ie)}),Promise.reject(ie)})});throw new Error("Keys missing")}}})}})}};function Ul(s,a,u){try{if(!a||a.keys.length<s.length)return null;for(var d=[],p=0,h=0;p<a.keys.length&&h<s.length;++p)rt(a.keys[p],s[h])===0&&(d.push(u?Me(a.values[p]):a.values[p]),++h);return d.length===s.length?d:null}catch{return null}}var nf={stack:"dbcore",level:-1,create:function(s){return{table:function(a){var u=s.table(a);return r(r({},u),{getMany:function(d){var p;return d.cache?(p=Ul(d.keys,d.trans._cache,d.cache==="clone"))?Pe.resolve(p):u.getMany(d).then(function(h){return d.trans._cache={keys:d.keys,values:d.cache==="clone"?Me(h):h},h}):u.getMany(d)},mutate:function(d){return d.type!=="add"&&(d.trans._cache=null),u.mutate(d)}})}}}};function ql(s,a){return s.trans.mode==="readonly"&&!!s.subscr&&!s.trans.explicit&&s.trans.db._options.cache!=="disabled"&&!a.schema.primaryKey.outbound}function Hl(s,a){switch(s){case"query":return a.values&&!a.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var sf={stack:"dbcore",level:0,name:"Observability",create:function(s){var a=s.schema.name,u=new Ut(s.MIN_KEY,s.MAX_KEY);return r(r({},s),{transaction:function(d,p,h){if(Be.subscr&&p!=="readonly")throw new Ne.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Be.querier));return s.transaction(d,p,h)},table:function(d){function p(U){var V,U=U.query;return[V=U.index,new Ut((V=(U=U.range).lower)!=null?V:s.MIN_KEY,(V=U.upper)!=null?V:s.MAX_KEY)]}var h=s.table(d),w=h.schema,k=w.primaryKey,R=w.indexes,J=k.extractKey,N=k.outbound,K=k.autoIncrement&&R.filter(function(B){return B.compound&&B.keyPath.includes(k.keyPath)}),F=r(r({},h),{mutate:function(B){function V(ve){return ve="idb://".concat(a,"/").concat(d,"/").concat(ve),pe[ve]||(pe[ve]=new Ut)}var U,re,Q,ie=B.trans,pe=B.mutatedParts||(B.mutatedParts={}),me=V(""),xe=V(":dels"),ge=B.type,_e=B.type==="deleteRange"?[B.range]:B.type==="delete"?[B.keys]:B.values.length<50?[ei(k,B).filter(function(ve){return ve}),B.values]:[],Ke=_e[0],_e=_e[1],Ve=B.trans._cache;return f(Ke)?(me.addKeys(Ke),(ge=ge==="delete"||Ke.length===_e.length?Ul(Ke,Ve):null)||xe.addKeys(Ke),(ge||_e)&&(U=V,re=ge,Q=_e,w.indexes.forEach(function(ve){var ze=U(ve.name||"");function We(nt){return nt!=null?ve.extractKey(nt):null}function Je(nt){ve.multiEntry&&f(nt)?nt.forEach(function(rn){return ze.addKey(rn)}):ze.addKey(nt)}(re||Q).forEach(function(nt,qt){var Ge=re&&We(re[qt]),qt=Q&&We(Q[qt]);rt(Ge,qt)!==0&&(Ge!=null&&Je(Ge),qt!=null)&&Je(qt)})}))):Ke?(_e={from:(Ve=Ke.lower)!=null?Ve:s.MIN_KEY,to:(ge=Ke.upper)!=null?ge:s.MAX_KEY},xe.add(_e),me.add(_e)):(me.add(u),xe.add(u),w.indexes.forEach(function(ve){return V(ve.name).add(u)})),h.mutate(B).then(function(ve){return!Ke||B.type!=="add"&&B.type!=="put"||(me.addKeys(ve.results),K&&K.forEach(function(ze){for(var We=B.values.map(function(Ge){return ze.extractKey(Ge)}),Je=ze.keyPath.findIndex(function(Ge){return Ge===k.keyPath}),nt=0,rn=ve.results.length;nt<rn;++nt)We[nt][Je]=ve.results[nt];V(ze.name).addKeys(We)})),ie.mutatedParts=wo(ie.mutatedParts||{},pe),ve})}}),q={get:function(B){return[k,new Ut(B.key)]},getMany:function(B){return[k,new Ut().addKeys(B.keys)]},count:p,query:p,openCursor:p};return c(q).forEach(function(B){F[B]=function(V){var U=Be.subscr,re=!!U,Q=ql(Be,h)&&Hl(B,V)?V.obsSet={}:U;if(re){var ie,U=function(_e){return _e="idb://".concat(a,"/").concat(d,"/").concat(_e),Q[_e]||(Q[_e]=new Ut)},pe=U(""),me=U(":dels"),re=q[B](V),xe=re[0],re=re[1];if((B==="query"&&xe.isPrimaryKey&&!V.values?me:U(xe.name||"")).add(re),!xe.isPrimaryKey){if(B!=="count")return ie=B==="query"&&N&&V.values&&h.query(r(r({},V),{values:!1})),h[B].apply(this,arguments).then(function(_e){if(B==="query"){if(N&&V.values)return ie.then(function(We){return We=We.result,pe.addKeys(We),_e});var Ve=V.values?_e.result.map(J):_e.result;(V.values?pe:me).addKeys(Ve)}else{var ve,ze;if(B==="openCursor")return ze=V.values,(ve=_e)&&Object.create(ve,{key:{get:function(){return me.addKey(ve.primaryKey),ve.key}},primaryKey:{get:function(){var We=ve.primaryKey;return me.addKey(We),We}},value:{get:function(){return ze&&pe.addKey(ve.primaryKey),ve.value}}})}return _e});me.add(u)}}return h[B].apply(this,arguments)}}),F}})}};function zl(s,a,u){var d;return u.numFailures===0?a:a.type==="deleteRange"||(d=a.keys?a.keys.length:"values"in a&&a.values?a.values.length:1,u.numFailures===d)?null:(d=r({},a),f(d.keys)&&(d.keys=d.keys.filter(function(p,h){return!(h in u.failures)})),"values"in d&&f(d.values)&&(d.values=d.values.filter(function(p,h){return!(h in u.failures)})),d)}function ti(s,a){return u=s,((d=a).lower===void 0||(d.lowerOpen?0<rt(u,d.lower):0<=rt(u,d.lower)))&&(u=s,(d=a).upper===void 0||(d.upperOpen?rt(u,d.upper)<0:rt(u,d.upper)<=0));var u,d}function Wl(s,a,u,d,p,h){var w,k,R,J,N,K,F;return!u||u.length===0||(w=a.query.index,k=w.multiEntry,R=a.query.range,J=d.schema.primaryKey.extractKey,N=w.extractKey,K=(w.lowLevelIndex||w).extractKey,(d=u.reduce(function(q,B){var V=q,U=[];if(B.type==="add"||B.type==="put")for(var re=new Ut,Q=B.values.length-1;0<=Q;--Q){var ie,pe=B.values[Q],me=J(pe);!re.hasKey(me)&&(ie=N(pe),k&&f(ie)?ie.some(function(Ve){return ti(Ve,R)}):ti(ie,R))&&(re.addKey(me),U.push(pe))}switch(B.type){case"add":var xe=new Ut().addKeys(a.values?q.map(function(ve){return J(ve)}):q),V=q.concat(a.values?U.filter(function(ve){return ve=J(ve),!xe.hasKey(ve)&&(xe.addKey(ve),!0)}):U.map(function(ve){return J(ve)}).filter(function(ve){return!xe.hasKey(ve)&&(xe.addKey(ve),!0)}));break;case"put":var ge=new Ut().addKeys(B.values.map(function(ve){return J(ve)}));V=q.filter(function(ve){return!ge.hasKey(a.values?J(ve):ve)}).concat(a.values?U:U.map(function(ve){return J(ve)}));break;case"delete":var Ke=new Ut().addKeys(B.keys);V=q.filter(function(ve){return!Ke.hasKey(a.values?J(ve):ve)});break;case"deleteRange":var _e=B.range;V=q.filter(function(ve){return!ti(J(ve),_e)})}return V},s))===s)?s:(F=function(q,B){return rt(K(q),K(B))||rt(J(q),J(B))},d.sort(a.direction==="prev"||a.direction==="prevunique"?function(q,B){return F(B,q)}:F),a.limit&&a.limit<1/0&&(d.length>a.limit?d.length=a.limit:s.length===a.limit&&d.length<a.limit&&(p.dirty=!0)),h?Object.freeze(d):d)}function Gl(s,a){return rt(s.lower,a.lower)===0&&rt(s.upper,a.upper)===0&&!!s.lowerOpen==!!a.lowerOpen&&!!s.upperOpen==!!a.upperOpen}function rf(s,a){return((u,d,p,h)=>{if(u===void 0)return d!==void 0?-1:0;if(d===void 0)return 1;if((u=rt(u,d))===0){if(p&&h)return 0;if(p)return 1;if(h)return-1}return u})(s.lower,a.lower,s.lowerOpen,a.lowerOpen)<=0&&0<=((u,d,p,h)=>{if(u===void 0)return d!==void 0?1:0;if(d===void 0)return-1;if((u=rt(u,d))===0){if(p&&h)return 0;if(p)return-1;if(h)return 1}return u})(s.upper,a.upper,s.upperOpen,a.upperOpen)}function of(s,a,u,d){s.subscribers.add(u),d.addEventListener("abort",function(){var p,h;s.subscribers.delete(u),s.subscribers.size===0&&(p=s,h=a,setTimeout(function(){p.subscribers.size===0&&de(h,p)},3e3))})}var af={stack:"dbcore",level:0,name:"Cache",create:function(s){var a=s.schema.name;return r(r({},s),{transaction:function(u,d,p){var h,w,k=s.transaction(u,d,p);return d==="readwrite"&&(p=(h=new AbortController).signal,k.addEventListener("abort",(w=function(R){return function(){if(h.abort(),d==="readwrite"){for(var J=new Set,N=0,K=u;N<K.length;N++){var F=K[N],q=_s["idb://".concat(a,"/").concat(F)];if(q){var B=s.table(F),V=q.optimisticOps.filter(function(ve){return ve.trans===k});if(k._explicit&&R&&k.mutatedParts)for(var U=0,re=Object.values(q.queries.query);U<re.length;U++)for(var Q=0,ie=(xe=re[U]).slice();Q<ie.length;Q++)Ga((ge=ie[Q]).obsSet,k.mutatedParts)&&(de(xe,ge),ge.subscribers.forEach(function(ve){return J.add(ve)}));else if(0<V.length){q.optimisticOps=q.optimisticOps.filter(function(ve){return ve.trans!==k});for(var pe=0,me=Object.values(q.queries.query);pe<me.length;pe++)for(var xe,ge,Ke,_e=0,Ve=(xe=me[pe]).slice();_e<Ve.length;_e++)(ge=Ve[_e]).res!=null&&k.mutatedParts&&(R&&!ge.dirty?(Ke=Object.isFrozen(ge.res),Ke=Wl(ge.res,ge.req,V,B,ge,Ke),ge.dirty?(de(xe,ge),ge.subscribers.forEach(function(ve){return J.add(ve)})):Ke!==ge.res&&(ge.res=Ke,ge.promise=Pe.resolve({result:Ke}))):(ge.dirty&&de(xe,ge),ge.subscribers.forEach(function(ve){return J.add(ve)})))}}}J.forEach(function(ve){return ve()})}}})(!1),{signal:p}),k.addEventListener("error",w(!1),{signal:p}),k.addEventListener("complete",w(!0),{signal:p})),k},table:function(u){var d=s.table(u),p=d.schema.primaryKey;return r(r({},d),{mutate:function(h){var w,k=Be.trans;return!p.outbound&&k.db._options.cache!=="disabled"&&!k.explicit&&k.idbtrans.mode==="readwrite"&&(w=_s["idb://".concat(a,"/").concat(u)])?(k=d.mutate(h),h.type!=="add"&&h.type!=="put"||!(50<=h.values.length||ei(p,h).some(function(R){return R==null}))?(w.optimisticOps.push(h),h.mutatedParts&&_o(h.mutatedParts),k.then(function(R){0<R.numFailures&&(de(w.optimisticOps,h),(R=zl(0,h,R))&&w.optimisticOps.push(R),h.mutatedParts)&&_o(h.mutatedParts)}),k.catch(function(){de(w.optimisticOps,h),h.mutatedParts&&_o(h.mutatedParts)})):k.then(function(R){var J=zl(0,r(r({},h),{values:h.values.map(function(N,K){var F;return R.failures[K]?N:(G(F=(F=p.keyPath)!=null&&F.includes(".")?Me(N):r({},N),p.keyPath,R.results[K]),F)})}),R);w.optimisticOps.push(J),queueMicrotask(function(){return h.mutatedParts&&_o(h.mutatedParts)})}),k):d.mutate(h)},query:function(h){var w,k,R,J,N,K,F;return ql(Be,d)&&Hl("query",h)?(w=((R=Be.trans)==null?void 0:R.db._options.cache)==="immutable",k=(R=Be).requery,R=R.signal,K=((q,B,V,U)=>{var re=_s["idb://".concat(q,"/").concat(B)];if(!re)return[];if(!(q=re.queries[V]))return[null,!1,re,null];var Q=q[(U.query?U.query.index.name:null)||""];if(!Q)return[null,!1,re,null];switch(V){case"query":var ie=(pe=U.direction)!=null?pe:"next",pe=Q.find(function(me){var xe;return me.req.limit===U.limit&&me.req.values===U.values&&((xe=me.req.direction)!=null?xe:"next")===ie&&Gl(me.req.query.range,U.query.range)});return pe?[pe,!0,re,Q]:[Q.find(function(me){var xe;return("limit"in me.req?me.req.limit:1/0)>=U.limit&&((xe=me.req.direction)!=null?xe:"next")===ie&&(!U.values||me.req.values)&&rf(me.req.query.range,U.query.range)}),!1,re,Q];case"count":return pe=Q.find(function(me){return Gl(me.req.query.range,U.query.range)}),[pe,!!pe,re,Q]}})(a,u,"query",h),F=K[0],J=K[2],N=K[3],F&&K[1]?F.obsSet=h.obsSet:(K=d.query(h).then(function(q){var B=q.result;if(F&&(F.res=B),w){for(var V=0,U=B.length;V<U;++V)Object.freeze(B[V]);Object.freeze(B)}return q}).catch(function(q){return N&&F&&de(N,F),Promise.reject(q)}),F={obsSet:h.obsSet,promise:K,subscribers:new Set,type:"query",req:h,dirty:!1},N?N.push(F):(N=[F],(J=J||(_s["idb://".concat(a,"/").concat(u)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[h.query.index.name||""]=N)),of(F,N,k,R),F.promise.then(function(q){return q=Wl(q.result,h,J==null?void 0:J.optimisticOps,d,F,w),{result:w?q:Me(q)}})):d.query(h)}})}})}};function xo(s,a){return new Proxy(s,{get:function(u,d,p){return d==="db"?a:Reflect.get(u,d,p)}})}At.prototype.version=function(s){if(isNaN(s)||s<.1)throw new Ne.Type("Given version is not a positive number");if(s=Math.round(10*s)/10,this.idbdb||this._state.isBeingOpened)throw new Ne.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,s);var a=this._versions,u=a.filter(function(d){return d._cfg.version===s})[0];return u||(u=new this.Version(s),a.push(u),a.sort(Yd),u.stores({}),this._state.autoSchema=!1),u},At.prototype._whenReady=function(s){var a=this;return this.idbdb&&(this._state.openComplete||Be.letThrough||this._vip)?s():new Pe(function(u,d){if(a._state.openComplete)return d(new Ne.DatabaseClosed(a._state.dbOpenError));if(!a._state.isBeingOpened){if(!a._state.autoOpen)return void d(new Ne.DatabaseClosed);a.open().catch(m)}a._state.dbReadyPromise.then(u,d)}).then(s)},At.prototype.use=function(p){var a=p.stack,u=p.create,d=p.level,p=p.name,h=(p&&this.unuse({stack:a,name:p}),this._middlewares[a]||(this._middlewares[a]=[]));return h.push({stack:a,create:u,level:d??10,name:p}),h.sort(function(w,k){return w.level-k.level}),this},At.prototype.unuse=function(s){var a=s.stack,u=s.name,d=s.create;return a&&this._middlewares[a]&&(this._middlewares[a]=this._middlewares[a].filter(function(p){return d?p.create!==d:!!u&&p.name!==u})),this},At.prototype.open=function(){var s=this;return gs(Ot,function(){return Zd(s)})},At.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var s=this._state;if(yr.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}s.isBeingOpened||(s.dbReadyPromise=new Pe(function(a){s.dbReadyResolve=a}),s.openCanceller=new Pe(function(a,u){s.cancelOpen=u}))},At.prototype.close=function(a){var a=(a===void 0?{disableAutoOpen:!0}:a).disableAutoOpen,u=this._state;a?(u.isBeingOpened&&u.cancelOpen(new Ne.DatabaseClosed),this._close(),u.autoOpen=!1,u.dbOpenError=new Ne.DatabaseClosed):(this._close(),u.autoOpen=this._options.autoOpen||u.isBeingOpened,u.openComplete=!1,u.dbOpenError=null)},At.prototype.delete=function(s){var a=this,u=(s===void 0&&(s={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),d=this._state;return new Pe(function(p,h){function w(){a.close(s);var k=a._deps.indexedDB.deleteDatabase(a.name);k.onsuccess=xt(function(){var R,J,N;R=a._deps,J=a.name,Ha(N=R.indexedDB)||J===ao||qa(N,R.IDBKeyRange).delete(J).catch(m),p()}),k.onerror=hn(h),k.onblocked=a._fireOnBlocked}if(u)throw new Ne.InvalidArgument("Invalid closeOptions argument to db.delete()");d.isBeingOpened?d.dbReadyPromise.then(w):w()})},At.prototype.backendDB=function(){return this.idbdb},At.prototype.isOpen=function(){return this.idbdb!==null},At.prototype.hasBeenClosed=function(){var s=this._state.dbOpenError;return s&&s.name==="DatabaseClosed"},At.prototype.hasFailed=function(){return this._state.dbOpenError!==null},At.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(At.prototype,"tables",{get:function(){var s=this;return c(this._allTables).map(function(a){return s._allTables[a]})},enumerable:!1,configurable:!0}),At.prototype.transaction=function(){var s=(function(a,u,d){var p=arguments.length;if(p<2)throw new Ne.InvalidArgument("Too few arguments");for(var h=new Array(p-1);--p;)h[p-1]=arguments[p];return d=h.pop(),[a,E(h),d]}).apply(this,arguments);return this._transaction.apply(this,s)},At.prototype._transaction=function(s,a,u){var d,p,h=this,w=Be.trans,k=(w&&w.db===this&&s.indexOf("!")===-1||(w=null),s.indexOf("?")!==-1);s=s.replace("!","").replace("?","");try{if(p=a.map(function(J){if(J=J instanceof h.Table?J.name:J,typeof J!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return J}),s=="r"||s===Ia)d=Ia;else{if(s!="rw"&&s!=ja)throw new Ne.InvalidArgument("Invalid transaction mode: "+s);d=ja}if(w){if(w.mode===Ia&&d===ja){if(!k)throw new Ne.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");w=null}w&&p.forEach(function(J){if(w&&w.storeNames.indexOf(J)===-1){if(!k)throw new Ne.SubTransaction("Table "+J+" not included in parent transaction.");w=null}}),k&&w&&!w.active&&(w=null)}}catch(J){return w?w._promise(null,function(N,K){K(J)}):Tt(J)}var R=(function J(N,K,F,q,B){return Pe.resolve().then(function(){var Q=Be.transless||Be,V=N._createTransaction(K,F,N._dbSchema,q),Q=(V.explicit=!0,{trans:V,transless:Q});if(q)V.idbtrans=q.idbtrans;else try{V.create(),V.idbtrans._explicit=!0,N._state.PR1398_maxLoop=3}catch(ie){return ie.name===Bt.InvalidState&&N.isOpen()&&0<--N._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),N.close({disableAutoOpen:!1}),N.open().then(function(){return J(N,K,F,null,B)})):Tt(ie)}var U,re=De(B),Q=(re&&Us(),Pe.follow(function(){var ie;(U=B.call(V,V))&&(re?(ie=Xn.bind(null,null),U.then(ie,ie)):typeof U.next=="function"&&typeof U.throw=="function"&&(U=Qa(U)))},Q));return(U&&typeof U.then=="function"?Pe.resolve(U).then(function(ie){return V.active?ie:Tt(new Ne.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):Q.then(function(){return U})).then(function(ie){return q&&V._resolve(),V._completion.then(function(){return ie})}).catch(function(ie){return V._reject(ie),Tt(ie)})})}).bind(null,this,d,p,w,u);return w?w._promise(d,R,"lock"):Be.trans?gs(Be.transless,function(){return h._whenReady(R)}):this._whenReady(R)},At.prototype.table=function(s){if(_(this._allTables,s))return this._allTables[s];throw new Ne.InvalidTable("Table ".concat(s," does not exist"))};var Rn=At;function At(s,a){var u,d,p,h,w,k=this,R=(this._middlewares={},this.verno=0,At.dependencies),R=(this._options=a=r({addons:At.addons,autoOpen:!0,indexedDB:R.indexedDB,IDBKeyRange:R.IDBKeyRange,cache:"cloned",maxConnections:1e3},a),this._deps={indexedDB:a.indexedDB,IDBKeyRange:a.IDBKeyRange},a.addons),J=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:m,dbReadyPromise:null,cancelOpen:m,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:a.autoOpen}),N=(J.dbReadyPromise=new Pe(function(K){J.dbReadyResolve=K}),J.openCanceller=new Pe(function(K,F){J.cancelOpen=F}),this._state=J,this.name=s,this.on=fr(this,"populate","blocked","versionchange","close",{ready:[se,m]}),this.once=function(K,F){var q=function(){for(var B=[],V=0;V<arguments.length;V++)B[V]=arguments[V];k.on(K).unsubscribe(q),F.apply(k,B)};return k.on(K,q)},this.on.ready.subscribe=W(this.on.ready.subscribe,function(K){return function(F,q){At.vip(function(){var B,V=k._state;V.openComplete?(V.dbOpenError||Pe.resolve().then(F),q&&K(F)):V.onReadyBeingFired?(V.onReadyBeingFired.push(F),q&&K(F)):(K(F),B=k,q||K(function U(){B.on.ready.unsubscribe(F),B.on.ready.unsubscribe(U)}))})}}),this.Collection=(u=this,pr(Bd.prototype,function(U,V){this.db=u;var q=xl,B=null;if(V)try{q=V()}catch(Q){B=Q}var V=U._ctx,U=V.table,re=U.hook.reading.fire;this._ctx={table:U,index:V.index,isPrimKey:!V.index||U.schema.primKey.keyPath&&V.index===U.schema.primKey.name,range:q,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:B,or:V.or,valueMapper:re!==x?re:null}})),this.Table=(d=this,pr(Al.prototype,function(K,F,q){this.db=d,this._tx=q,this.name=K,this.schema=F,this.hook=d._allTables[K]?d._allTables[K].hook:fr(null,{creating:[H,m],reading:[D,x],updating:[T,m],deleting:[ee,m]})})),this.Transaction=(p=this,pr(Hd.prototype,function(K,F,q,B,V){var U=this;K!=="readonly"&&F.forEach(function(re){re=(re=q[re])==null?void 0:re.yProps,re&&(F=F.concat(re.map(function(Q){return Q.updatesTable})))}),this.db=p,this.mode=K,this.storeNames=F,this.schema=q,this.chromeTransactionDurability=B,this.idbtrans=null,this.on=fr(this,"complete","error","abort"),this.parent=V||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Pe(function(re,Q){U._resolve=re,U._reject=Q}),this._completion.then(function(){U.active=!1,U.on.complete.fire()},function(re){var Q=U.active;return U.active=!1,U.on.error.fire(re),U.parent?U.parent._reject(re):Q&&U.idbtrans&&U.idbtrans.abort(),Tt(re)})})),this.Version=(h=this,pr(Qd.prototype,function(K){this.db=h,this._cfg={version:K,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(w=this,pr(jl.prototype,function(K,F,q){if(this.db=w,this._ctx={table:K,index:F===":id"?null:F,or:q},this._cmp=this._ascending=rt,this._descending=function(B,V){return rt(V,B)},this._max=function(B,V){return 0<rt(B,V)?B:V},this._min=function(B,V){return rt(B,V)<0?B:V},this._IDBKeyRange=w._deps.IDBKeyRange,!this._IDBKeyRange)throw new Ne.MissingAPI})),this.on("versionchange",function(K){0<K.newVersion?console.warn("Another connection wants to upgrade database '".concat(k.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(k.name,"'. Closing db now to resume the delete request.")),k.close({disableAutoOpen:!1})}),this.on("blocked",function(K){!K.newVersion||K.newVersion<K.oldVersion?console.warn("Dexie.delete('".concat(k.name,"') was blocked")):console.warn("Upgrade '".concat(k.name,"' blocked by other connection holding version ").concat(K.oldVersion/10))}),this._maxKey=mr(a.IDBKeyRange),this._createTransaction=function(K,F,q,B){return new k.Transaction(K,F,q,k._options.chromeTransactionDurability,B)},this._fireOnBlocked=function(K){k.on("blocked").fire(K),yr.toArray().filter(function(F){return F.name===k.name&&F!==k&&!F._state.vcFired}).map(function(F){return F.on("versionchange").fire(K)})},this.use(nf),this.use(af),this.use(sf),this.use(ef),this.use(tf),new Proxy(this,{get:function(K,F,q){var B;return F==="_vip"||(F==="table"?function(V){return xo(k.table(V),N)}:(B=Reflect.get(K,F,q))instanceof Al?xo(B,N):F==="tables"?B.map(function(V){return xo(V,N)}):F==="_createTransaction"?function(){return xo(B.apply(this,arguments),N)}:B)}}));this.vip=N,R.forEach(function(K){return K(k)})}var Co,Ws=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",lf=(ni.prototype.subscribe=function(s,a,u){return this._subscribe(s&&typeof s!="function"?s:{next:s,error:a,complete:u})},ni.prototype[Ws]=function(){return this},ni);function ni(s){this._subscribe=s}try{Co={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch{Co={indexedDB:null,IDBKeyRange:null}}function Yl(s){var a,u=!1,d=new lf(function(p){var h=De(s),w,k=!1,R={},J={},N={get closed(){return k},unsubscribe:function(){k||(k=!0,w&&w.abort(),K&&es.storagemutated.unsubscribe(B))}},K=(p.start&&p.start(N),!1),F=function(){return Ma(V)};function q(){return Ga(J,R)}var B=function(U){wo(R,U),q()&&F()},V=function(){var U,re,Q;!k&&Co.indexedDB&&(R={},U={},w&&w.abort(),w=new AbortController,Q=(ie=>{var pe=Vs();try{h&&Us();var me=Jn(s,ie);return me=h?me.finally(Xn):me}finally{pe&&Bs()}})(re={subscr:U,signal:w.signal,requery:F,querier:s,trans:null}),K||(es.storagemutated.subscribe(B),K=!0),Promise.resolve(Q).then(function(ie){u=!0,a=ie,k||re.signal.aborted||(q()||(J=U,q())?F():(R={},Ma(function(){return!k&&p.next&&p.next(ie)})))},function(ie){u=!1,["DatabaseClosedError","AbortError"].includes(ie==null?void 0:ie.name)||k||Ma(function(){k||p.error&&p.error(ie)})}))};return setTimeout(F,0),N});return d.hasValue=function(){return u},d.getValue=function(){return a},d}var ks=Rn;function si(s){var a=ts;try{ts=!0,es.storagemutated.fire(s),Xa(s,!0)}finally{ts=a}}S(ks,r(r({},$e),{delete:function(s){return new ks(s,{addons:[]}).delete()},exists:function(s){return new ks(s,{addons:[]}).open().then(function(a){return a.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(s){try{return a=ks.dependencies,u=a.indexedDB,a=a.IDBKeyRange,(Ha(u)?Promise.resolve(u.databases()).then(function(d){return d.map(function(p){return p.name}).filter(function(p){return p!==ao})}):qa(u,a).toCollection().primaryKeys()).then(s)}catch{return Tt(new Ne.MissingAPI)}var a,u},defineClass:function(){return function(s){v(this,s)}},ignoreTransaction:function(s){return Be.trans?gs(Be.transless||Ot,s):s()},vip:za,async:function(s){return function(){try{var a=Qa(s.apply(this,arguments));return a&&typeof a.then=="function"?a:Pe.resolve(a)}catch(u){return Tt(u)}}},spawn:function(s,a,u){try{var d=Qa(s.apply(u,a||[]));return d&&typeof d.then=="function"?d:Pe.resolve(d)}catch(p){return Tt(p)}},currentTransaction:{get:function(){return Be.trans||null}},waitFor:function(s,a){return s=Pe.resolve(typeof s=="function"?ks.ignoreTransaction(s):s).timeout(a||6e4),Be.trans?Be.trans.waitFor(s):s},Promise:Pe,debug:{get:function(){return Ce},set:function(s){be(s)}},derive:Y,extend:v,props:S,override:W,Events:fr,on:es,liveQuery:Yl,extendObservabilitySet:wo,getByKeyPath:Z,setByKeyPath:G,delByKeyPath:function(s,a){typeof a=="string"?G(s,a,void 0):"length"in a&&[].map.call(a,function(u){G(s,u,void 0)})},shallowClone:te,deepClone:Me,getObjectDiff:Za,cmp:rt,asap:L,minKey:-1/0,addons:[],connections:{get:yr.toArray},errnames:Bt,dependencies:Co,cache:_s,semVer:"4.4.6",version:"4.4.6".split(".").map(function(s){return parseInt(s)}).reduce(function(s,a,u){return s+a/Math.pow(10,2*u)})})),ks.maxKey=mr(ks.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(es(po,function(s){ts||(s=new CustomEvent(Ka,{detail:s}),ts=!0,dispatchEvent(s),ts=!1)}),addEventListener(Ka,function(s){s=s.detail,ts||si(s)}));var Gs,ts=!1,Jl=function(){};return typeof BroadcastChannel<"u"&&((Jl=function(){(Gs=new BroadcastChannel(Ka)).onmessage=function(s){return s.data&&si(s.data)}})(),typeof Gs.unref=="function"&&Gs.unref(),es(po,function(s){ts||Gs.postMessage(s)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(s){if(!Rn.disableBfCache&&s.persisted){Ce&&console.debug("Dexie: handling persisted pagehide"),Gs!=null&&Gs.close();for(var a=0,u=yr.toArray();a<u.length;a++)u[a].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(s){!Rn.disableBfCache&&s.persisted&&(Ce&&console.debug("Dexie: handling persisted pageshow"),Jl(),si({all:new Ut(-1/0,[[]])}))})),Pe.rejectionMapper=function(s,a){return!s||s instanceof Ie||s instanceof TypeError||s instanceof SyntaxError||!s.name||!g[s.name]?s:(a=new g[s.name](a||s.message,s),"stack"in s&&I(a,"stack",{get:function(){return this.inner.stack}}),a)},be(Ce),r(Rn,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Rn,Entity:Cl,PropModification:dr,RangeSet:Ut,add:function(s){return new dr({add:s})},cmp:rt,default:Rn,liveQuery:Yl,mergeRanges:br,rangesOverlap:Fl,remove:function(s){return new dr({remove:s})},replacePrefix:function(s,a){return new dr({replacePrefix:[s,a]})}}),{default:Rn}),Rn})})(ld);var nm=ld.exports;const Ki=tm(nm),Ru=Symbol.for("Dexie"),ta=globalThis[Ru]||(globalThis[Ru]=Ki);if(Ki.semVer!==ta.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Ki.semVer} and ${ta.semVer}`);const{liveQuery:sm,mergeRanges:RC,rangesOverlap:FC,RangeSet:NC,cmp:VC,Entity:BC,PropModification:UC,replacePrefix:qC,add:HC,remove:zC,DexieYProvider:WC}=ta;class rm extends ta{constructor(t="intern_worklog"){super(t),this.version(1).stores({project:"++id, &name, archived",work_log:"++id, &date",log_item:"++id, work_log_id, project_id, category",attendance:"++id, &date",weekly_note:"++id, &week_start",setting:"key"}),this.version(2).stores({memo:"++id, updated_at",credential:"++id, system, updated_at"}),this.version(3).stores({transaction:"++id, date, type, category"}),this.version(4).stores({sync_mirror:"++id, table, uuid",tombstone:"++id, table, uuid, deleted_at"}),this.version(5).stores({plan:"++id, date, status"}).upgrade(async n=>{const r={dev:"项目实操",test:"项目实操",bugfix:"售后服务",learning:"产品学习",meeting:"打杂",doc:"打杂",other:"打杂"};await n.table("log_item").toCollection().modify(o=>{o.category&&r[o.category]&&(o.category=r[o.category])})}),this.version(6).stores({plan:"++id, date, status, goal_id",goal:"++id, start_date"})}}let oe;function om(e){oe=e}function dl(){oe&&oe.close(),oe=void 0}const am=6,Fu=["公司","客户现场","出差","居家办公"],im={dev:"项目实操",test:"项目实操",bugfix:"售后服务",learning:"产品学习",meeting:"打杂",doc:"打杂",other:"打杂"};function Ur(e){return im[e]||e}function Mr(e){return e<10?"0"+e:String(e)}function Hn(e){return e.getFullYear()+"-"+Mr(e.getMonth()+1)+"-"+Mr(e.getDate())}function ot(){return Hn(new Date)}function at(){const e=new Date;return Hn(e)+"T"+Mr(e.getHours())+":"+Mr(e.getMinutes())+":"+Mr(e.getSeconds())}function wn(e){if(!e)return"--:--";const t=e.indexOf("T");return t>=0?e.slice(t+1,t+6):e.slice(0,5)}function Fs(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}function Vt(e,t){const n=Fs(e);return n.setDate(n.getDate()+t),Hn(n)}function na(e,t){const n=Fs(e),r=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);const o=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(r,o)),Hn(n)}function Zs(e){const t=Fs(e),n=(t.getDay()+6)%7;return t.setDate(t.getDate()-n),Hn(t)}function lm(e){const t=Fs(e).getDay();return t===0||t===6}function um(e,t){return Math.round((new Date(t).getTime()-new Date(e).getTime())/6e4)}function ud(e){const t=Fs(e),n=["周日","周一","周二","周三","周四","周五","周六"];return t.getFullYear()+" 年 "+(t.getMonth()+1)+" 月 "+t.getDate()+" 日 "+n[t.getDay()]}const cm=15e4;function Ri(e){const t=new Uint8Array(e);let n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n)}function Fi(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function dm(){return Ri(crypto.getRandomValues(new Uint8Array(16)).buffer)}async function sa(e,t){const n=new TextEncoder,r=await crypto.subtle.importKey("raw",n.encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:Fi(t),iterations:cm,hash:"SHA-256"},r,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function ra(e,t){const n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,new TextEncoder().encode(t));return Ri(n.buffer)+":"+Ri(r)}async function Ca(e,t){const n=t.split(":");if(n.length!==2)throw new Error("密文格式错误");const r=await crypto.subtle.decrypt({name:"AES-GCM",iv:Fi(n[0])},e,Fi(n[1]));return new TextDecoder().decode(r)}async function fl(){await wd()}const cd="intern-log-vault-verify",rr="enc:v1:";let Ks=null;function fm(){return Ks!==null}function oa(){Ks=null}async function dd(){return await Ct("pwd_salt","")!==""}async function pm(e){if(e.length<6)throw new Error("主密码至少 6 位");if(await dd())throw new Error("主密码已设置");const t=dm(),n=await sa(e,t),r=await ra(n,cd);await It("pwd_salt",t),await It("pwd_verifier",r),Ks=n}async function vm(e){const t=await Ct("pwd_salt","");if(!t)throw new Error("主密码尚未设置");const n=await sa(e,t),r=await Ct("pwd_verifier","");try{await Ca(n,r)}catch{throw new Error("主密码不正确")}Ks=n}async function fd(){if(!Ks)throw new Error("密码库未解锁");return Ks}async function mm(e){const t=await fd();return rr+await ra(t,e)}async function hm(e){if(!e)return"";if(!e.startsWith(rr))return e;const t=await fd();return Ca(t,e.slice(rr.length))}async function ym(){return oe.credential.orderBy("system").toArray()}async function gm(e,t){const n=await mm(e.password),r={system:e.system.trim(),account:e.account.trim(),password:n,remark:e.remark.trim()};t?await oe.credential.update(t,{...r,updated_at:at()}):await oe.credential.add({...r,created_at:at(),updated_at:at()}),await fl()}async function bm(e){await oe.credential.delete(e),await fl()}async function gi(e){const t=await oe.credential.get(e);if(!t)throw new Error("记录不存在");return hm(t.password)}async function wm(e,t){if(!e)throw new Error("请输入旧主密码");if(t.length<6)throw new Error("新主密码至少 6 位");if(t===e)throw new Error("新主密码不能与旧主密码相同");const n=await Ct("pwd_salt","");if(!n)throw new Error("密码库尚未初始化");const r=await sa(e,n),o=await Ct("pwd_verifier","");try{await Ca(r,o)}catch{throw new Error("旧主密码不正确")}const i=await sa(t,n),c=await oe.credential.toArray();let f=0;for(const v of c){if(v.id==null)continue;const b=await _m(v.password,r),y=rr+await ra(i,b);await oe.credential.update(v.id,{password:y}),f++}return await It("pwd_verifier",await ra(i,cd)),Ks=i,await fl(),f}async function _m(e,t){return e?e.startsWith(rr)?Ca(t,e.slice(rr.length)):e:""}const km="https://daywk.linyux.cn",xm="dsh_sync_base",Ni="dsh_sync_token";function pd(e){try{return localStorage.getItem(e)||""}catch{return""}}function Cm(e,t){try{localStorage.setItem(e,t)}catch{}}function $m(e){try{localStorage.removeItem(e)}catch{}}async function Ns(){return pd(xm)||km}function $a(){const e=pd(Ni);if(!e)return"";try{return e}catch{return""}}function qr(e){e?Cm(Ni,e):$m(Ni)}const Sm="intern_worklog",pl="dsh_session_user";function Hr(){try{const e=localStorage.getItem(pl);if(!e)return null;const t=JSON.parse(e);if(t&&t.userId&&t.username)return t}catch{}return null}function Em(e){localStorage.setItem(pl,JSON.stringify(e))}function vd(){localStorage.removeItem(pl)}const vl="dsh_cloud_creds";function md(e,t){localStorage.setItem(vl,JSON.stringify({username:e,password:t}))}function pn(){try{const e=localStorage.getItem(vl);if(!e)return null;const t=JSON.parse(e);if(t&&t.username&&t.password)return t}catch{}return null}function Tm(){localStorage.removeItem(vl)}let aa=null;function ia(e){aa===e&&oe||(oe&&dl(),om(new rm(Sm+"_"+e)),aa=e)}async function Am(e,t,n){const r=await Ns();let o;try{o=await fetch(r+"/api/auth/"+e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t.trim(),password:n})})}catch{throw new Error("无法连接同步服务器:请检查网络后重试")}const i=await o.json().catch(()=>({}));if(!o.ok){const c=i&&i.error||"服务返回 "+o.status;throw e==="register"&&o.status===409?new Error("云端已有同名账号且密码一致,直接登录即可"):new Error(String(c))}if(!i.userId||!i.username)throw new Error("登录响应异常");return{userId:String(i.userId),username:String(i.username)}}async function ml(e,t,n){const r=await Am(n,e,t);ia(r.userId);const o={userId:r.userId,username:r.username};return Em(o),md(r.username,t),o}async function Pm(e,t){const n=(e||"").trim();if(!n||!t)throw new Error("请输入用户名与密码");return ml(n,t,"login")}async function Om(e,t,n){const r=(e||"").trim();if(r.length<2||r.length>20)throw new Error("用户名需 2 到 20 个字符");if(t.length<6)throw new Error("登录密码至少 6 位");return ml(r,t,"register")}async function Mm(){const e=pn();if(!e)return null;try{return await ml(e.username,e.password,"login")}catch{return null}}async function Im(){oa(),dl(),aa=null,vd()}function jm(){oa(),dl(),aa=null,vd(),Tm()}async function Dm(e,t){if(!Hr())throw new Error("未登录");if(t.length<6)throw new Error("新密码至少 6 位");const r=pn();if(!r||r.password!==e)throw new Error("旧密码不正确");const o=await Ns();let i;try{i=await fetch(o+"/api/auth/password",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+hd()},body:JSON.stringify({oldPassword:e,newPassword:t})})}catch{throw new Error("无法连接同步服务器")}if(!i.ok){const c=await i.json().catch(()=>({}));throw new Error(c&&c.error||"修改失败 "+i.status)}md(r.username,t)}async function Lm(){if(!Hr())throw new Error("未登录");const t=await Ns();let n;try{n=await fetch(t+"/api/auth/delete",{method:"POST",headers:{Authorization:"Bearer "+hd()}})}catch{throw new Error("无法连接同步服务器")}if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r&&r.error||"删除失败 "+n.status)}jm()}function hd(){return $a()}const Vi=M(null),Bi=M(null),ur=M(0);function as(){ur.value++}const yd=M(0);function Km(){yd.value++}const er=M(""),zr=["project","work_log","log_item","attendance","weekly_note","setting","memo","credential","goal","transaction","plan"],Xs=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);function Ko(e){return JSON.stringify(e)}async function Rm(e){return oe.table(e).toArray()}function Ro(e,t){return e==="setting"?t.key:t.id}async function Fm(){for(const e of zr){const t=oe.table(e),n=await t.toArray();for(const r of n){if(e==="setting"&&Xs.has(r.key))continue;const o={};r.uuid||(o.uuid=Nm()),!r.updated_at&&r.created_at&&(o.updated_at=r.created_at),Object.keys(o).length&&await t.update(Ro(e,r),o)}}}function Nm(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"u"+Date.now().toString(36)+Math.random().toString(36).slice(2,10)}async function Vm(){return pn()!=null}async function Bm(){try{return localStorage.getItem("dsh_last_sync")||""}catch{return""}}async function Um(e){try{localStorage.setItem("dsh_last_sync",e)}catch{}}async function gd(e,t){const n=await fetch(e+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t.username.trim(),password:t.password})});if(!n.ok)throw new Error("云端账号或密码不正确");const r=await n.json();if(!r||!r.token)throw new Error("云端登录异常");return String(r.token)}async function qm(e,t){let n=$a();return n||(n=await gd(e,t),qr(n),n)}async function bd(){const e=pn();if(!e)throw new Error("未登录");const t=await Ns(),n=await fetch(t+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e.username,password:e.password})});if(!n.ok)throw new Error("云端账号校验失败:"+n.status)}async function Ui(){const e=pn();if(!e)throw new Error("未登录,无法同步");return xd({baseUrl:await Ns(),username:e.username,password:e.password})}async function wd(){try{await Ui()}catch(e){er.value=e instanceof Error?e.message:String(e);try{await Ui()}catch{}throw e}}function _d(e,t,n){const r={};for(const o of Object.keys(t))o!=="id"&&(r[o]=t[o]);if(e==="log_item"){delete r.work_log_id,delete r.project_id;const o=t.work_log_id?n.workLog.get(t.work_log_id):null;o&&o.uuid&&(r.wuuid=o.uuid);const i=t.project_id?n.project.get(t.project_id):null;i&&i.uuid&&(r.puuid=i.uuid)}if(e==="plan"){delete r.goal_id;const o=t.goal_id?n.goal.get(t.goal_id):null;o&&o.uuid&&(r.guuid=o.uuid)}return r}async function kd(){const e=await oe.work_log.toArray(),t=await oe.project.toArray(),n=await oe.goal.toArray();return{workLog:new Map(e.map(r=>[r.id,r])),project:new Map(t.map(r=>[r.id,r])),goal:new Map(n.map(r=>[r.id,r]))}}let Ir=!1,Fo=!1,qi=!1,tr=null,$n=null,Hi="",zi=!1,No=null;async function nr(){if(Ir){Fo=!0;return}try{if(!await Vm())return;await xd(await Hm()),er.value=""}catch(e){er.value=e instanceof Error?e.message:String(e)}}async function Hm(){const e=pn();if(!e)throw new Error("未登录,无法同步");return{baseUrl:await Ns(),username:e.username,password:e.password}}function zm(){if(zi)return;zi=!0,No=sm(async()=>{const t={};for(const n of zr)t[n]=await oe.table(n).count();return t}).subscribe({next:()=>{qi||Ir||(tr&&globalThis.clearTimeout(tr),tr=globalThis.setTimeout(()=>{nr()},3e3))},error:()=>{}})}function Wm(){No&&(No.unsubscribe(),No=null),$n&&($n.close(),$n=null,Hi=""),tr&&(globalThis.clearTimeout(tr),tr=null),zi=!1}function Gm(e,t){const n=e+"|"+t;if(!($n&&Hi===n)){$n&&($n.close(),$n=null);try{$n=new EventSource(e+"/api/events?token="+encodeURIComponent(t)),Hi=n,$n.onmessage=()=>{nr()}}catch{$n=null}}}async function xd(e){if(Ir)return Fo=!0,{pushed:0,pulled:0,removed:0,errors:0,at:""};Ir=!0,qi=!0;try{const t=await Cd(e);return Fo&&(Fo=!1,globalThis.setTimeout(()=>{nr()},800)),t}finally{Ir=!1,qi=!1}}async function Cd(e,t=!1){var A;const n=e.baseUrl.trim().replace(/\/+$/,"");if(!n)throw new Error("请先配置同步服务地址");await Fm();const r=await kd(),o=await oe.sync_mirror.toArray(),i=new Map;for(const L of o)i.set(L.table+"|"+L.uuid,L);const c={},f=[];let v=0;for(const L of zr){let Z=await Rm(L);L==="setting"&&(Z=Z.filter(te=>!Xs.has(te.key)));const G=new Map;for(const te of Z)G.set(te.uuid,te);for(const[te,P]of G){const E=_d(L,P,r),j=Ko(E),ne=i.get(L+"|"+te);(!ne||ne.hash!==j)&&(c[L]=c[L]||[],c[L].push(E),v++)}for(const[te,P]of i)te.startsWith(L+"|")&&!G.has(P.uuid)&&f.push({table:L,uuid:P.uuid,deleted_at:at()});c[L]=c[L]||[]}f.push(...Zm());const b=await qm(n,e),y=L=>fetch(n+"/api/sync",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+L},body:JSON.stringify({device:"client",tables:c,tombstones:f})});let _=await y(b);if(_.status===401){qr("");const L=await gd(n,e);qr(L),_=await y(L)}if(!_.ok)throw new Error("同步服务返回 "+_.status);const S=await _.json(),C=String(S.dataEpoch||""),I="dsh_sync_epoch_"+(((A=pn())==null?void 0:A.username)||"anon"),Y=C?localStorage.getItem(I):null;if(!t&&Y&&C&&Y!==C)return await oe.sync_mirror.clear(),localStorage.setItem(I,C),Cd(e,!0);const le=S.tables||{},ce=S.tombstones||[],ue=await Xm(le,ce);Gm(n,$a()||b);const W=at();return await Um(W),C&&localStorage.setItem(I,C),(ue.changed>0||ue.removed>0||v>0)&&as(),{pushed:v,pulled:ue.changed,removed:ue.removed,errors:0,at:W}}function $d(){var t;return"dsh_idmap_"+(((t=pn())==null?void 0:t.username)||"anon")}function Ym(){try{const e=localStorage.getItem($d());if(e)return JSON.parse(e)}catch{}return{}}function Jm(e){try{localStorage.setItem($d(),JSON.stringify(e))}catch{}}async function Xm(e,t){const n=Ym(),r=new Set(t.map(C=>C.table+"|"+C.uuid)),o=new Map;for(const C of await oe.sync_mirror.toArray())o.set(C.table+"|"+C.uuid,C);const i=new Set(Array.from(o.keys()).map(C=>C.split("|")[1]));let c=0,f=0;const v={},b={},y={};for(const C of zr){const I=oe.table(C),Y=await I.toArray(),le=new Map(Y.map(E=>[Ro(C,E),E])),ce=new Map(Y.filter(E=>E.uuid).map(E=>[E.uuid,E])),ue=(e[C]||[]).filter(E=>!r.has(C+"|"+E.uuid)),W=ue.filter(E=>!(C==="setting"&&Xs.has(E.key))),A=ue.filter(E=>C==="setting"&&Xs.has(E.key));for(const E of A)Qm(C,E.uuid);const L=C==="setting"?[]:Y.filter(E=>E.uuid&&!i.has(E.uuid)&&!r.has(C+"|"+E.uuid)),Z={v:Math.max(0,...Y.map(E=>Number(E.id)||0))};W.length;const G=[];for(const E of W){const j={...E};if(C==="log_item"){const Ee=j.wuuid?v[j.wuuid]:void 0;if(!Ee)continue;j.work_log_id=Ee,delete j.wuuid,j.project_id=j.puuid?b[j.puuid]??null:null,delete j.puuid}if(C==="plan")if(j.guuid){const Ee=y[j.guuid];j.goal_id=Ee??null,delete j.guuid}else j.goal_id=null;let ne=Ro(C,E);if(C==="setting")ne=E.key;else{const Ee=n[C]&&n[C][E.uuid],ye=ce.get(E.uuid);ye&&ye.id!=null?ne=ye.id:typeof Ee=="number"?ne=Ee:ne=++Z.v}const Me={...j,id:ne};C==="setting"&&Xs.has(Me.key)||(G.push(Me),C==="work_log"&&(v[E.uuid]=ne),C==="project"&&(b[E.uuid]=ne),C==="goal"&&(y[E.uuid]=ne))}const te=G.concat(L);for(const E of te){const j=le.get(Ro(C,E));(!j||Ko(j)!==Ko(E))&&c++}f+=Y.filter(E=>E.uuid&&!G.some(j=>j.uuid===E.uuid)&&!r.has(C+"|"+E.uuid)).length,await I.clear(),te.length&&await I.bulkPut(te);const P={};for(const E of te)E.uuid&&(P[E.uuid]=E.id);n[C]=P}Jm(n);const _=await kd(),S=[];for(const C of zr){const I=await oe.table(C).toArray();for(const Y of I)C==="setting"&&Xs.has(Y.key)||Y.uuid&&S.push({table:C,uuid:Y.uuid,hash:Ko(_d(C,Y,_))})}return await oe.sync_mirror.clear(),S.length&&await oe.sync_mirror.bulkAdd(S.map(C=>({...C}))),await oe.tombstone.clear(),{changed:c,removed:f+la.length}}const la=[];function Qm(e,t){la.some(n=>n.table===e&&n.uuid===t)||la.push({table:e,uuid:t,deleted_at:at()})}function Zm(){return la.splice(0)}const eh=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);async function it(){await wd()}async function Ct(e,t){const n=await oe.setting.get(e);return n?n.value:t}async function It(e,t){await oe.setting.put({key:e,value:t}),eh.has(e)||await it()}async function vs(){const e=await Promise.all([Ct("work_start","09:00"),Ct("work_end","18:00"),Ct("grace_minutes","10"),Ct("lunch_minutes","60"),Ct("remind_weekly","friday")]);return{work_start:e[0],work_end:e[1],grace_minutes:Number(e[2])||0,lunch_minutes:Number(e[3])||0,remind_weekly:e[4]}}async function th(){return Ct("last_location","")}async function nh(e,t){const n=t.trim();await It("last_location",n),n&&await ua(n);let r=!1;const o=await _n(e);o&&o.id?(o.location||"")!==n&&(await oe.attendance.update(o.id,{location:n||null}),r=!0):n&&(await oe.attendance.add({date:e,clock_in_at:null,clock_out_at:null,kind:"normal",note:null,location:n,created_at:at()}),r=!0),r&&await it()}async function hl(){const e=await Ct("location_presets","");if(!e)return Fu.slice();try{const t=JSON.parse(e);if(Array.isArray(t))return t.filter(n=>typeof n=="string"&&n.trim()).map(n=>n.trim())}catch{}return Fu.slice()}async function Sd(e){const t=Array.from(new Set(e.map(n=>n.trim()).filter(Boolean)));await It("location_presets",JSON.stringify(t))}async function ua(e){const t=e.trim();if(!t)return;const n=await hl();n.includes(t)||await Sd([...n,t])}async function or(e=!1){const t=await oe.project.orderBy("name").toArray();return e?t:t.filter(n=>n.archived!==1)}async function sh(e){await oe.project.add({name:e.trim(),archived:0,created_at:at()}),await it()}async function rh(e,t){await oe.project.update(e,{name:t.trim()}),await it()}async function oh(e,t){await oe.project.update(e,{archived:t?1:0}),await it()}async function _n(e){return oe.attendance.where("date").equals(e).first()}async function Ed(e,t){const n=((t===void 0?await Ct("last_location",""):t)||"").trim();let r=!1;const o=await _n(e);if(o&&o.id){if(!o.clock_in_at){const i={clock_in_at:at()};n&&(i.location=n),await oe.attendance.update(o.id,i),r=!0}n&&(await Ct("last_location","")!==n&&await It("last_location",n),await ua(n)),r&&await it();return}await oe.attendance.add({date:e,clock_in_at:at(),clock_out_at:null,kind:"normal",note:null,location:n||null,created_at:at()}),n&&(await It("last_location",n),await ua(n)),await it()}async function ah(e){const t=await _n(e);t&&t.id&&t.clock_in_at&&!t.clock_out_at&&(await oe.attendance.update(t.id,{clock_out_at:at()}),await it())}async function ih(){const e=new Date,t=Hn(e);let n="";if(e.getHours()<4){const r=await _n(Vt(t,-1));r&&r.id&&r.clock_in_at&&!r.clock_out_at&&(await oe.attendance.update(r.id,{clock_out_at:at()}),n=r.date)}if(!n){const r=await _n(t);r&&r.id&&r.clock_in_at&&!r.clock_out_at&&(await oe.attendance.update(r.id,{clock_out_at:at()}),n=r.date)}if(!n)throw new Error("没有进行中的打卡");return await it(),n}async function lh(e,t,n,r,o){(o||"").trim()&&await ua(o);const i=await _n(e),c={date:e,clock_in_at:t,clock_out_at:n,kind:"makeup",note:r||null,location:(o||"").trim()||null,created_at:at()};i&&i.id?await oe.attendance.update(i.id,c):await oe.attendance.add(c),await it()}async function uh(e,t,n){const r=(n||"").trim();if(!r)return;const o=await _n(e);o&&o.id&&(await oe.attendance.update(o.id,{[t]:e+"T"+r+":00"}),await it())}async function Xr(e,t){return oe.attendance.where("date").between(e,t,!0,!0).toArray()}async function ch(e,t){const n=await _n(e);if(t){const r={date:e,kind:"leave",clock_in_at:null,clock_out_at:null,created_at:at()};n&&n.id?await oe.attendance.update(n.id,r):await oe.attendance.add({...r,note:null,location:null})}else n&&n.id&&await oe.attendance.update(n.id,{kind:"normal"});await it()}async function dh(e){const t=await oe.work_log.where("date").equals(e).first();return t||{id:await oe.work_log.add({date:e,created_at:at()}),date:e,created_at:at()}}async function fh(e){return oe.work_log.where("date").equals(e).first()}async function ph(e){const t=await fh(e);return!t||!t.id?[]:(await oe.log_item.where("work_log_id").equals(t.id).toArray()).sort((r,o)=>o.id-r.id)}async function vh(e,t){const n=await oe.work_log.where("date").equals(e).first();let r;n&&n.id?r=n:r=await dh(e),await oe.table("log_item").add({work_log_id:r.id,content:t.content,project_id:t.project_id,category:t.category,minutes:t.minutes,is_milestone:0,needs_followup:0,takeaway:t.takeaway,remark:t.remark,sort_order:0,created_at:at()});const o=t.project_id?String(t.project_id):"";await Ct("last_project","")!==o&&await It("last_project",o),await Ct("last_category","")!==t.category&&await It("last_category",t.category),await it()}async function bi(e,t){await oe.table("log_item").update(e,t),await it()}async function mh(e){await oe.table("log_item").delete(e),await it()}async function Qr(e,t){const n=await oe.work_log.where("date").between(e,t,!0,!0).toArray();if(!n.length)return[];const r=new Map(n.map(i=>[i.id,i.date]));return(await oe.table("log_item").where("work_log_id").anyOf(n.map(i=>i.id)).toArray()).map(i=>({...i,date:r.get(i.work_log_id)||""})).sort((i,c)=>i.date===c.date?i.id-c.id:i.date<c.date?-1:1)}async function yl(e){return oe.weekly_note.where("week_start").equals(e).first()}async function hh(e,t){const n=await yl(e);n&&n.id?await oe.weekly_note.update(n.id,t):await oe.weekly_note.add({week_start:e,highlights:t.highlights??null,challenges:t.challenges??null,plan_next:t.plan_next??null,created_at:at()}),await it()}async function yh(e,t){return oe.weekly_note.where("week_start").between(e,t,!0,!0).toArray()}async function gh(e){return(await oe.plan.where("date").equals(e).toArray()).sort((n,r)=>n.start_time<r.start_time?-1:1)}async function bh(){const e=await oe.plan.filter(t=>!!t.timer_started_at).toArray();return e.length?e[0]:null}async function wh(e){const t=at();await oe.plan.add({date:e.date,start_time:e.start_time,end_time:e.end_time,title:e.title.trim(),kind:e.kind.trim()||"其他",note:e.note||null,status:"todo",actual_minutes:0,timer_started_at:null,uuid:"",created_at:t,updated_at:t}),await it()}async function _h(e,t){await oe.plan.update(e,{...t,updated_at:at()}),await it()}async function kh(e){await oe.plan.delete(e),await it()}async function xh(e,t){const n=await oe.plan.get(e);n&&(t!=="todo"&&n.timer_started_at&&await Sa(e),await oe.plan.update(e,{status:t,updated_at:at()}),await it())}async function Ch(e){const t=await oe.plan.filter(n=>!!n.timer_started_at).toArray();for(const n of t)n.id!==e&&await Sa(n.id);await oe.plan.update(e,{timer_started_at:at(),updated_at:at()}),await it()}async function Sa(e){const t=await oe.plan.get(e);if(!t||!t.timer_started_at)return;const n=Math.max(0,Math.round((Date.now()-new Date(t.timer_started_at).getTime())/6e4));await oe.plan.update(e,{actual_minutes:(t.actual_minutes||0)+n,timer_started_at:null,updated_at:at()}),await it()}const $h=366;function Sh(e,t){const n=[];let r=e,o=0;for(;r<=t&&o<$h;)n.push(r),r=Vt(r,1),o++;return n}async function Eh(){const e=await oe.goal.toArray(),t=[];for(const n of e){const r=await oe.plan.where("goal_id").equals(n.id).toArray();t.push({goalId:n.id,done:r.filter(o=>o.status==="done").length,total:r.length})}return t}async function Th(){return(await oe.goal.toArray()).sort((t,n)=>t.start_date<n.start_date?-1:1)}async function Ah(e){const t=at(),n=await oe.goal.add({title:e.title.trim(),kind:e.kind.trim()||"其他",start_date:e.start_date,end_date:e.end_date,note:e.note||null,uuid:"",created_at:t,updated_at:t});await oe.goal.get(n);const r=Sh(e.start_date,e.end_date);for(const o of r)await oe.plan.add({date:o,start_time:"08:00",end_time:"09:00",title:e.title.trim(),kind:e.kind.trim()||"其他",note:e.note||null,status:"todo",actual_minutes:0,timer_started_at:null,goal_id:n,uuid:"",created_at:t,updated_at:t});await it()}async function Ph(e,t){if(!await oe.goal.get(e))return;const r={...t,updated_at:at()};await oe.goal.update(e,r);const o=await oe.plan.where("goal_id").equals(e).toArray();for(const i of o)i.status!=="done"&&await oe.plan.update(i.id,{...t.title!==void 0?{title:t.title.trim()}:{},...t.kind!==void 0?{kind:t.kind}:{},...t.note!==void 0?{note:t.note||null}:{},updated_at:at()});await it()}async function Oh(e){const t=await oe.plan.where("goal_id").equals(e).toArray();for(const n of t)await oe.plan.delete(n.id);await oe.goal.delete(e),await it()}async function Mh(){return(await oe.memo.toArray()).sort((t,n)=>t.updated_at<n.updated_at?1:-1)}async function Ih(e,t){const n=at(),r=await oe.memo.add({title:e.trim(),content:t,created_at:n,updated_at:n});return await it(),{id:r,title:e.trim(),content:t,created_at:n,updated_at:n}}async function jh(e,t,n){await oe.memo.update(e,{title:t.trim(),content:n,updated_at:at()}),await it()}async function Dh(e){await oe.memo.delete(e),await it()}async function Lh(e,t=8){const n=e.trim().toLowerCase();if(!n)return[];const r=await oe.work_log.toArray(),o=new Map(r.map(c=>[c.id,c.date]));return(await oe.table("log_item").toArray()).filter(c=>((c.content||"")+" "+(c.takeaway||"")+" "+(c.remark||"")).toLowerCase().includes(n)).sort((c,f)=>f.id-c.id).slice(0,t).map(c=>({...c,date:o.get(c.work_log_id)||""}))}async function Kh(e,t=4){const n=e.trim().toLowerCase();return n?(await oe.memo.toArray()).filter(o=>((o.title||"")+" "+(o.content||"")).toLowerCase().includes(n)).sort((o,i)=>o.updated_at<i.updated_at?1:-1).slice(0,t):[]}async function Rh(e,t){return oe.table("transaction").where("date").between(e,t,!0,!0).toArray()}async function Fh(e){await oe.table("transaction").add({...e,created_at:at()}),await it()}async function Nh(e,t){await oe.table("transaction").update(e,{...t}),await it()}async function Vh(e){await oe.table("transaction").delete(e),await it()}async function Bh(e,t){await oe.table("transaction").update(e,{reimbursed:1}),await it()}async function Uh(){const e=await Promise.all([oe.project.toArray(),oe.work_log.toArray(),oe.table("log_item").toArray(),oe.attendance.toArray(),oe.weekly_note.toArray(),oe.setting.toArray(),oe.memo.toArray(),oe.credential.toArray(),oe.table("transaction").toArray(),oe.plan.toArray(),oe.goal.toArray()]);return JSON.stringify({schema_version:am,exported_at:at(),data:{project:e[0],work_log:e[1],log_item:e[2],attendance:e[3],weekly_note:e[4],setting:e[5],memo:e[6],credential:e[7],transaction:e[8],plan:e[9],goal:e[10]}},null,2)}async function qh(e){let t=null;try{t=JSON.parse(e)}catch{throw new Error("不是有效的 JSON 文件")}if(!t||t.schema_version!==1&&t.schema_version!==2&&t.schema_version!==3&&t.schema_version!==4&&t.schema_version!==5||!t.data)throw new Error("文件格式或 schema 版本不匹配");const n=t.data,r=oe.table("log_item"),o=oe.table("transaction"),i=oe.plan,c=oe.goal;await oe.transaction("rw",[oe.project,oe.work_log,r,oe.attendance,oe.weekly_note,oe.setting,oe.memo,oe.credential,o,c,i],async()=>{await Promise.all([oe.project.clear(),oe.work_log.clear(),r.clear(),oe.attendance.clear(),oe.weekly_note.clear(),oe.setting.clear(),oe.memo.clear(),oe.credential.clear(),o.clear(),c.clear(),i.clear()]),n.project&&n.project.length&&await oe.project.bulkAdd(n.project),n.work_log&&n.work_log.length&&await oe.work_log.bulkAdd(n.work_log),n.log_item&&n.log_item.length&&await r.bulkAdd(n.log_item),n.attendance&&n.attendance.length&&await oe.attendance.bulkAdd(n.attendance),n.weekly_note&&n.weekly_note.length&&await oe.weekly_note.bulkAdd(n.weekly_note),n.setting&&n.setting.length&&await oe.setting.bulkAdd(n.setting),n.memo&&n.memo.length&&await oe.memo.bulkAdd(n.memo),n.credential&&n.credential.length&&await oe.credential.bulkAdd(n.credential),n.transaction&&n.transaction.length&&await o.bulkAdd(n.transaction),n.goal&&n.goal.length&&await c.bulkAdd(n.goal),n.plan&&n.plan.length&&await i.bulkAdd(n.plan)}),await it()}const Hh=["制度学习","产品学习","打杂","项目实操","售后服务"],zh=["餐饮","交通","住房","通讯","学习","娱乐","其他"],Wh=["工资","报销","其他"],Td="log_categories",Ad="ledger_expense_categories",Pd="ledger_income_categories";function Od(e,t){if(!e)return t.slice();try{const n=JSON.parse(e);if(Array.isArray(n)){const r=n.filter(o=>typeof o=="string"&&o.trim()).map(o=>o.trim());if(r.length)return Array.from(new Set(r))}}catch{}return t.slice()}async function Zr(){return Od(await Ct(Td,""),Hh)}async function wi(e){await It(Td,JSON.stringify(e))}async function Wr(e){return Od(await Ct(e==="expense"?Ad:Pd,""),e==="expense"?zh:Wh)}async function Ts(e,t){await It(e==="expense"?Ad:Pd,JSON.stringify(t))}const Gh={class:"dialog",role:"dialog","aria-label":"编辑工作记录"},Yh={class:"dialog-head"},Jh={class:"dialog-title"},Xh={key:0,class:"muted dialog-sub"},Qh={class:"dialog-body"},Zh={class:"form-grid"},ey={class:"field span2"},ty={key:0,class:"form-error"},ny={class:"field"},sy=["value"],ry={class:"field"},oy=["value"],ay={class:"field"},iy={class:"field"},ly={class:"field span2"},uy={class:"field"},cy={class:"field"},dy={class:"dialog-btns"},fy=jt({__name:"EditLogDialog",props:{open:{type:Boolean},item:{},projects:{},date:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=M([]);Zr().then(ue=>{n.value=ue});const r=e,o=t,i=M(""),c=M(null),f=M("dev"),v=M(null),b=M(""),y=M(""),_=M(0),S=M(0),C=M(""),I=M(null),Y=st(()=>{var A;const ue=r.projects.filter(L=>L.archived!==1),W=(A=r.item)==null?void 0:A.project_id;if(W&&!ue.some(L=>L.id===W)){const L=r.projects.find(G=>G.id===W),Z=ue.slice();return L&&Z.unshift({...L,name:L.name+"(已归档)"}),Z}return ue});function le(ue){r.open&&ue.key==="Escape"&&o("cancel")}pt(()=>r.open,async ue=>{var W;if(ue){const A=r.item;i.value=(A==null?void 0:A.content)??"",c.value=(A==null?void 0:A.project_id)??null,f.value=(A==null?void 0:A.category)??"dev",v.value=(A==null?void 0:A.minutes)??null,b.value=(A==null?void 0:A.takeaway)??"",y.value=(A==null?void 0:A.remark)??"",_.value=(A==null?void 0:A.is_milestone)??0,S.value=(A==null?void 0:A.needs_followup)??0,C.value="",window.addEventListener("keydown",le),await lr(),(W=I.value)==null||W.focus()}else window.removeEventListener("keydown",le)}),Ln(()=>window.removeEventListener("keydown",le)),pt(i,()=>{C.value&&(C.value="")});function ce(){const ue=i.value.trim();if(!ue){C.value="请填写工作内容";return}if(!r.item||!r.item.id){o("save",{id:0,content:ue,project_id:c.value,category:f.value,minutes:v.value&&v.value>0?v.value:null,takeaway:b.value.trim()||null,remark:y.value.trim()||null,is_milestone:_.value,needs_followup:S.value});return}o("save",{id:r.item.id,content:ue,project_id:c.value,category:f.value,minutes:v.value&&v.value>0?v.value:null,takeaway:b.value.trim()||null,remark:y.value.trim()||null,is_milestone:_.value?1:0,needs_followup:S.value?1:0})}return(ue,W)=>($(),wt(zn,{to:"body"},[we(Rs,{name:"modal"},{default:Wn(()=>[e.open?($(),O("div",{key:0,class:"mask",onClick:W[10]||(W[10]=Nt(A=>o("cancel"),["self"]))},[l("div",Gh,[l("div",Yh,[l("div",null,[l("div",Jh,z(e.item?"编辑工作记录":"添加工作记录"),1),e.date?($(),O("div",Xh,z(e.date),1)):he("",!0)]),l("button",{class:"icon-btn",title:"关闭",onClick:W[0]||(W[0]=A=>o("cancel"))},[we(qe,{name:"close",size:16})])]),l("div",Qh,[l("div",Zh,[l("div",ey,[W[11]||(W[11]=l("label",null,"工作内容(必填)",-1)),Oe(l("input",{ref_key:"contentInput",ref:I,class:Xe(["input",{invalid:C.value}]),"onUpdate:modelValue":W[1]||(W[1]=A=>i.value=A),onKeydown:Mt(ce,["enter"])},null,34),[[Re,i.value]]),C.value?($(),O("div",ty,z(C.value),1)):he("",!0)]),l("div",ny,[W[13]||(W[13]=l("label",null,"所属项目",-1)),Oe(l("select",{class:"select","onUpdate:modelValue":W[2]||(W[2]=A=>c.value=A)},[W[12]||(W[12]=l("option",{value:null},"无项目",-1)),($(!0),O(je,null,et(Y.value,A=>($(),O("option",{key:A.id,value:A.id},z(A.name),9,sy))),128))],512),[[ps,c.value]])]),l("div",ry,[W[14]||(W[14]=l("label",null,"工作分类",-1)),Oe(l("select",{class:"select","onUpdate:modelValue":W[3]||(W[3]=A=>f.value=A)},[($(!0),O(je,null,et(n.value,A=>($(),O("option",{key:A,value:A},z(A),9,oy))),128))],512),[[ps,f.value]])]),l("div",ay,[W[15]||(W[15]=l("label",null,"耗时(分钟)",-1)),Oe(l("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":W[4]||(W[4]=A=>v.value=A),placeholder:"选填"},null,512),[[Re,v.value,void 0,{number:!0}]])]),l("div",iy,[W[16]||(W[16]=l("label",null,"主要收获",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":W[5]||(W[5]=A=>b.value=A),placeholder:"一句话:学到了什么"},null,512),[[Re,b.value]])]),l("div",ly,[W[17]||(W[17]=l("label",null,"备注",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":W[6]||(W[6]=A=>y.value=A),placeholder:"背景、链接、未决事项(选填)"},null,512),[[Re,y.value]])]),l("div",uy,[W[18]||(W[18]=l("label",null,"成果标记",-1)),l("button",{class:Xe(["toggle-btn",{on:_.value===1}]),onClick:W[7]||(W[7]=A=>_.value=_.value===1?0:1)},z(_.value===1?"已标记为成果":"未标记"),3)]),l("div",cy,[W[19]||(W[19]=l("label",null,"待跟进",-1)),l("button",{class:Xe(["toggle-btn",{onwarn:S.value===1}]),onClick:W[8]||(W[8]=A=>S.value=S.value===1?0:1)},z(S.value===1?"需要跟进":"无需跟进"),3)])])]),l("div",dy,[l("button",{class:"btn btn-sm",onClick:W[9]||(W[9]=A=>o("cancel"))},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:ce},z(e.item?"保存修改":"添加"),1)])])])):he("",!0)]),_:1})]))}}),py=Kt(fy,[["__scopeId","data-v-f3b19176"]]);function Mo(e){const t=e.split(":");return Number(t[0])*60+Number(t[1])}function cr(e,t,n,r){if(e&&e.kind==="leave")return{status:"leave",label:"请假",makeup:!1,workedMinutes:null};if(lm(t))return{status:"rest",label:"休息日",makeup:!1,workedMinutes:null};if(!e||!e.clock_in_at)return r?{status:"none",label:"未打卡",makeup:!1,workedMinutes:null}:{status:"absent",label:"缺勤",makeup:!!(e&&e.kind==="makeup"),workedMinutes:null};const o=e.kind==="makeup";if(!e.clock_out_at)return{status:"incomplete",label:r?"进行中":"未完成",makeup:o,workedMinutes:null};const i=Mo(wn(e.clock_in_at)),c=Mo(wn(e.clock_out_at)),f=Mo(n.work_start),v=Mo(n.work_end);let b="normal";!o&&i>f+n.grace_minutes?b="late":!o&&c<v&&(b="early");const y=um(e.clock_in_at,e.clock_out_at),_=Math.max(0,y-n.lunch_minutes);return{status:b,label:o?"补卡":b==="late"?"迟到":b==="early"?"早退":"正常",makeup:o,workedMinutes:_}}const Vo=M([]);let vy=0;function Fe(e){const t=++vy;Vo.value.push({id:t,text:e}),setTimeout(()=>{Vo.value=Vo.value.filter(n=>n.id!==t)},2e3)}function my(){return Vo}const hy={class:"day-panel"},yy={class:"dp-head"},gy={class:"dp-date"},by={class:"card sec"},wy={class:"att-grid"},_y={class:"att-cell"},ky={key:0,class:"edit-row"},xy={key:1,class:"att-val"},Cy={class:"att-cell"},$y={key:0,class:"edit-row"},Sy={key:1,class:"att-val"},Ey={class:"att-cell"},Ty=["list"],Ay=["id"],Py=["value"],Oy={class:"att-cell"},My={class:"att-val status-val"},Iy={key:0,class:"tag"},jy={key:1,class:"muted"},Dy={key:0,class:"att-note muted"},Ly={class:"att-actions"},Ky=["disabled"],Ry=["disabled"],Fy=["disabled"],Ny=["disabled"],Vy={key:0,class:"card sec makeup"},By={class:"form-grid"},Uy={class:"field"},qy={class:"field"},Hy={class:"field span2"},zy=["list"],Wy={class:"field span2"},Gy={key:0,class:"form-error"},Yy={class:"form-footer"},Jy={class:"list-sec"},Xy={class:"sec-head"},Qy={class:"sec-title"},Zy={key:0,class:"empty muted"},eg={class:"item-main"},tg={class:"tag"},ng=["onClick"],sg={key:0,class:"muted item-meta"},rg={key:1,class:"muted num item-meta"},og=["onClick"],ag=["onClick"],ig=["onClick"],lg=["onClick"],ug={key:0,class:"item-sub"},cg={key:0,class:"muted2"},dg={key:1,class:"muted"},fg={key:1,class:"dp-foot muted num"},pg=jt({__name:"DayPanel",props:{date:{}},setup(e){const t=M([]);Zr().then(g=>{t.value=g});const n=e,r=M(!0),o=M(null),i=M(void 0),c=M([]),f=M([]),v=M(""),b=M([]),y=st(()=>"loc-list-"+n.date),_=st(()=>n.date===ot());async function S(){r.value=!0,o.value=await vs(),i.value=await _n(n.date),c.value=await ph(n.date),f.value=await or(!0),b.value=await hl(),v.value=i.value&&i.value.location||await th(),r.value=!1}ln(S),pt(()=>n.date,S),pt(ur,()=>{S()});function C(g){if(!g)return"";const m=f.value.find(x=>x.id===g);return m?m.name:"已删除项目"}const I=st(()=>o.value?cr(i.value,n.date,o.value,_.value):null),Y=st(()=>c.value.reduce((g,m)=>g+(m.minutes||0),0)),le=M(!1);async function ce(){le.value||(le.value=!0,await Ed(n.date,v.value),await S(),as(),Fe("上班打卡成功"),le.value=!1)}async function ue(){le.value||(le.value=!0,await ah(n.date),await S(),as(),Fe("下班打卡成功"),le.value=!1)}async function W(){await nh(n.date,v.value),as(),Fe("地点已更新")}const A=M(!1),L=st(()=>{var g;return((g=i.value)==null?void 0:g.kind)==="leave"});function Z(){if(i.value&&i.value.clock_in_at){A.value=!0;return}G(!0)}async function G(g){A.value=!1,await ch(n.date,g),await S(),as(),Fe(g?"已标记为休假":"已取消休假")}const te=M(null),P=M(""),E=M(null);pt(te,async g=>{var m;g&&(await lr(),(m=E.value)==null||m.focus())});function j(g){var x,D;const m=g==="in"?(x=i.value)==null?void 0:x.clock_in_at:(D=i.value)==null?void 0:D.clock_out_at;te.value=g,P.value=m?wn(m):g==="in"?"09:00":"18:00"}function ne(){te.value=null}async function Me(){const g=te.value;g&&(te.value=null,P.value&&(await uh(n.date,g==="in"?"clock_in_at":"clock_out_at",P.value),await S(),as(),Fe("打卡时间已修改")))}const Ee=M(!1),ye=M("09:00"),Ae=M("18:00"),Ue=M(""),de=M(""),ke=M("");function Se(){de.value=v.value,ke.value="",Ee.value=!Ee.value}async function De(){if(!ye.value||!Ae.value){ke.value="请填写上班与下班时间";return}await lh(n.date,n.date+"T"+ye.value+":00",n.date+"T"+Ae.value+":00",Ue.value.trim(),de.value),Ee.value=!1,Ue.value="",ke.value="",await S(),as(),Fe("补卡已保存")}const $e=M(null),fe=M(!1);function Ie(g){$e.value=g,fe.value=!0}function ct(){$e.value=null,fe.value=!0}async function bt(g){g.id?(await bi(g.id,{content:g.content,project_id:g.project_id,category:g.category,minutes:g.minutes,takeaway:g.takeaway,remark:g.remark,is_milestone:g.is_milestone,needs_followup:g.needs_followup}),Fe("记录已更新")):(await vh(n.date,{content:g.content,project_id:g.project_id,category:g.category,minutes:g.minutes,takeaway:g.takeaway,remark:g.remark}),Fe("记录已添加")),$e.value=null,fe.value=!1,await S()}async function _t(g){await bi(g.id,{is_milestone:g.is_milestone?0:1}),await S()}async function Bt(g){await bi(g.id,{needs_followup:g.needs_followup?0:1}),await S()}const vt=M(null);async function Ne(){vt.value&&vt.value.id&&await mh(vt.value.id),vt.value=null,await S(),Fe("记录已删除")}return(g,m)=>($(),O("div",hy,[l("div",yy,[l("div",gy,z(on(ud)(e.date)),1)]),l("div",by,[m[19]||(m[19]=l("div",{class:"sec-title"},"出勤信息",-1)),l("div",wy,[l("div",_y,[m[15]||(m[15]=l("label",null,"上班时间",-1)),te.value==="in"?($(),O("div",ky,[Oe(l("input",{ref_key:"timeInput",ref:E,type:"time",class:"input time-input","onUpdate:modelValue":m[0]||(m[0]=x=>P.value=x),onKeydown:[Mt(Me,["enter"]),Mt(ne,["esc"])]},null,544),[[Re,P.value]]),l("button",{class:"btn btn-primary btn-sm",onClick:Me},"确认"),l("button",{class:"btn btn-sm",onClick:ne},"取消")])):($(),O("div",xy,[l("span",{class:Xe(["num",{"val-empty":!(i.value&&i.value.clock_in_at)}])},z(i.value&&i.value.clock_in_at?on(wn)(i.value.clock_in_at):"未打卡"),3),i.value&&i.value.id?($(),O("button",{key:0,class:"icon-btn",title:"修改上班时间",onClick:m[1]||(m[1]=x=>j("in"))},[we(qe,{name:"edit",size:13})])):he("",!0)]))]),l("div",Cy,[m[16]||(m[16]=l("label",null,"下班时间",-1)),te.value==="out"?($(),O("div",$y,[Oe(l("input",{ref_key:"timeInput",ref:E,type:"time",class:"input time-input","onUpdate:modelValue":m[2]||(m[2]=x=>P.value=x),onKeydown:[Mt(Me,["enter"]),Mt(ne,["esc"])]},null,544),[[Re,P.value]]),l("button",{class:"btn btn-primary btn-sm",onClick:Me},"确认"),l("button",{class:"btn btn-sm",onClick:ne},"取消")])):($(),O("div",Sy,[l("span",{class:Xe(["num",{"val-empty":!(i.value&&i.value.clock_out_at)}])},z(i.value&&i.value.clock_out_at?on(wn)(i.value.clock_out_at):"未打卡"),3),i.value&&i.value.id?($(),O("button",{key:0,class:"icon-btn",title:"修改下班时间",onClick:m[3]||(m[3]=x=>j("out"))},[we(qe,{name:"edit",size:13})])):he("",!0)]))]),l("div",Ey,[m[17]||(m[17]=l("label",null,"上班地点",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":m[4]||(m[4]=x=>v.value=x),list:y.value,placeholder:"可直接输入",title:"上班地点,可自由输入",onChange:W},null,40,Ty),[[Re,v.value]]),l("datalist",{id:y.value},[($(!0),O(je,null,et(b.value,x=>($(),O("option",{key:x,value:x},null,8,Py))),128))],8,Ay)]),l("div",Oy,[m[18]||(m[18]=l("label",null,"考勤状态",-1)),l("div",My,[I.value?($(),O(je,{key:0},[l("span",{class:Xe(["dot",I.value.status])},null,2),l("span",null,z(I.value.label),1),i.value&&i.value.kind==="makeup"?($(),O("span",Iy,"补卡")):he("",!0)],64)):($(),O("span",jy,"--"))])])]),i.value&&i.value.note?($(),O("div",Dy,"补卡说明:"+z(i.value.note),1)):he("",!0),l("div",Ly,[_.value&&(!i.value||!i.value.clock_in_at)?($(),O("button",{key:0,class:"btn btn-primary btn-sm",disabled:le.value,onClick:ce},"上班打卡",8,Ky)):_.value&&i.value&&i.value.clock_in_at&&!i.value.clock_out_at?($(),O("button",{key:1,class:"btn btn-primary btn-sm",disabled:le.value,onClick:ue},"下班打卡",8,Ry)):he("",!0),!_.value&&(!i.value||!i.value.clock_in_at)?($(),O("button",{key:2,class:"btn btn-sm",onClick:Se},"补卡")):he("",!0),L.value?($(),O("button",{key:4,class:"btn btn-sm",disabled:le.value,onClick:m[5]||(m[5]=x=>G(!1))},"取消休假",8,Ny)):($(),O("button",{key:3,class:"btn btn-sm",disabled:le.value,onClick:Z},"标记休假",8,Fy))])]),Ee.value?($(),O("div",Vy,[m[24]||(m[24]=l("div",{class:"sec-title"},"补卡登记",-1)),l("div",By,[l("div",Uy,[m[20]||(m[20]=l("label",null,"上班时间",-1)),Oe(l("input",{type:"time",class:"input","onUpdate:modelValue":m[6]||(m[6]=x=>ye.value=x)},null,512),[[Re,ye.value]])]),l("div",qy,[m[21]||(m[21]=l("label",null,"下班时间",-1)),Oe(l("input",{type:"time",class:"input","onUpdate:modelValue":m[7]||(m[7]=x=>Ae.value=x)},null,512),[[Re,Ae.value]])]),l("div",Hy,[m[22]||(m[22]=l("label",null,"上班地点",-1)),Oe(l("input",{class:"input",list:y.value,"onUpdate:modelValue":m[8]||(m[8]=x=>de.value=x),placeholder:"可直接输入"},null,8,zy),[[Re,de.value]])]),l("div",Wy,[m[23]||(m[23]=l("label",null,"补卡原因",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":m[9]||(m[9]=x=>Ue.value=x),placeholder:"如:外出拜访客户忘记打卡"},null,512),[[Re,Ue.value]])])]),ke.value?($(),O("div",Gy,z(ke.value),1)):he("",!0),l("div",Yy,[l("button",{class:"btn btn-sm",onClick:m[10]||(m[10]=x=>Ee.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:De},"保存补卡")])])):he("",!0),l("div",Jy,[l("div",Xy,[l("span",Qy,"工作记录("+z(c.value.length)+")",1),l("button",{class:"btn btn-primary btn-sm",onClick:ct},[we(qe,{name:"plus",size:14}),m[25]||(m[25]=ht(" 添加记录",-1))])]),!c.value.length&&!r.value?($(),O("div",Zy,"暂无记录")):he("",!0),($(!0),O(je,null,et(c.value,x=>($(),O("div",{key:x.id,class:"item"},[l("div",eg,[l("span",tg,z(on(Ur)(x.category)),1),l("span",{class:"item-content",title:"点击编辑",onClick:D=>Ie(x)},z(x.content),9,ng),x.project_id?($(),O("span",sg,z(C(x.project_id)),1)):he("",!0),x.minutes?($(),O("span",rg,z(x.minutes)+" 分钟",1)):he("",!0),m[26]||(m[26]=l("span",{class:"flex1"},null,-1)),l("button",{class:"icon-btn",title:"编辑完整信息",onClick:D=>Ie(x)},[we(qe,{name:"edit",size:14})],8,og),l("button",{class:Xe(["icon-btn",{active:x.is_milestone===1}]),title:"成果标记",onClick:D=>_t(x)},[we(qe,{name:"star",size:14})],10,ag),l("button",{class:Xe(["icon-btn",{"active-warn":x.needs_followup===1}]),title:"待跟进",onClick:D=>Bt(x)},[we(qe,{name:"flag",size:14})],10,ig),l("button",{class:"icon-btn",title:"删除",onClick:D=>vt.value=x},[we(qe,{name:"close",size:14})],8,lg)]),x.takeaway||x.remark?($(),O("div",ug,[x.takeaway?($(),O("div",cg,"收获:"+z(x.takeaway),1)):he("",!0),x.remark?($(),O("div",dg,"备注:"+z(x.remark),1)):he("",!0)])):he("",!0)]))),128)),c.value.length?($(),O("div",fg,[ht(" 共 "+z(c.value.length)+" 条事项 ",1),Y.value?($(),O(je,{key:0},[ht(" · "+z((Y.value/60).toFixed(1))+" 小时",1)],64)):he("",!0)])):he("",!0)]),we(Dn,{open:!!vt.value,title:"删除确认",message:vt.value?"将删除工作记录「"+vt.value.content+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:m[11]||(m[11]=x=>vt.value=null),onConfirm:Ne},null,8,["open","message"]),we(Dn,{open:A.value,title:"标记休假确认",message:"该日已有打卡记录,标记休假将清空上下班时间。是否继续?","confirm-text":"标记休假",danger:"",onCancel:m[12]||(m[12]=x=>A.value=!1),onConfirm:m[13]||(m[13]=x=>G(!0))},null,8,["open"]),we(py,{open:fe.value,item:$e.value,projects:f.value,date:e.date,onCancel:m[14]||(m[14]=x=>fe.value=!1),onSave:bt},null,8,["open","item","projects","date"])]))}}),Md=Kt(pg,[["__scopeId","data-v-b7bec4fa"]]),vg={class:"cal-page"},mg={class:"cal-toolbar"},hg={class:"cal-title num"},yg=["disabled"],gg={class:"card cal-card"},bg={class:"cal-head"},wg={class:"cal-grid"},_g=["title","onClick"],kg={class:"cal-marks"},xg={key:0,class:"drawer"},Cg={class:"drawer-head"},$g={class:"drawer-body"},Sg=jt({__name:"CalendarView",setup(e){const t=M(ot()),n=st(()=>Number(t.value.slice(0,4))),r=st(()=>Number(t.value.slice(5,7))-1),o=st(()=>n.value+" 年 "+(r.value+1)+" 月"),i=["一","二","三","四","五","六","日"],c=st(()=>{const A=(new Date(n.value,r.value,1).getDay()+6)%7,L=new Date(n.value,r.value+1,0).getDate(),Z=[];for(let G=0;G<A;G++)Z.push({date:"",inMonth:!1,weekend:!1});for(let G=1;G<=L;G++){const te=new Date(n.value,r.value,G),P=te.getDay();Z.push({date:Hn(te),inMonth:!0,weekend:P===0||P===6})}return Z}),f=M(new Map),v=ot();async function b(){var E;const W=Hn(new Date(n.value,r.value,1)),A=Hn(new Date(n.value,r.value+1,0)),L=await Promise.all([vs(),Xr(W,A),Qr(W,A)]),Z=L[0],G=new Map(L[1].map(j=>[j.date,j])),te=L[2],P=new Map;for(const j of c.value){if(!j.inMonth)continue;const ne=cr(G.get(j.date),j.date,Z,j.date===v),Me=te.filter(Ee=>Ee.date===j.date);P.set(j.date,{status:ne.status,label:ne.label,location:((E=G.get(j.date))==null?void 0:E.location)||"",hasLog:Me.length>0,hasMilestone:Me.some(Ee=>Ee.is_milestone===1)})}f.value=P}pt([n,r],b,{immediate:!0}),pt(ur,()=>{b()});function y(W){var A;return((A=f.value.get(W))==null?void 0:A.status)??""}function _(W){const A=f.value.get(W);return A?W+" · "+A.label+(A.location?" · "+A.location:""):W}function S(W){var A;return!!((A=f.value.get(W))!=null&&A.hasLog)}function C(W){var A;return!!((A=f.value.get(W))!=null&&A.hasMilestone)}function I(){t.value=na(t.value,-1)}function Y(){t.value=na(t.value,1)}function le(){t.value=ot()}const ce=M(null);function ue(W,A){A&&(ce.value=W)}return pt(Vi,W=>{W&&(t.value=W,ce.value=W,Vi.value=null)},{immediate:!0}),(W,A)=>($(),O("div",vg,[l("div",mg,[l("button",{class:"icon-btn",title:"上一月",onClick:I},[we(qe,{name:"chevron-left",size:16})]),l("span",hg,z(o.value),1),l("button",{class:"icon-btn",title:"下一月",onClick:Y},[we(qe,{name:"chevron-right",size:16})]),l("button",{class:"btn btn-sm",disabled:t.value===on(v),onClick:le},"回到本月",8,yg)]),l("div",gg,[l("div",bg,[($(),O(je,null,et(i,L=>l("span",{key:L,class:"cal-week"},z(L),1)),64))]),l("div",wg,[($(!0),O(je,null,et(c.value,(L,Z)=>($(),O("button",{key:Z,class:Xe(["cal-cell",{blank:!L.inMonth,weekend:L.weekend,selected:ce.value===L.date}]),title:L.inMonth?_(L.date):void 0,onClick:G=>ue(L.date,L.inMonth)},[L.inMonth?($(),O(je,{key:0},[l("span",{class:Xe(["daynum num",{today:L.date===on(v)}])},z(Number(L.date.slice(8,10))),3),l("span",kg,[y(L.date)?($(),O("span",{key:0,class:Xe(["dot",y(L.date)])},null,2)):he("",!0),S(L.date)?($(),wt(qe,{key:1,name:"check-circle",size:12,class:"mark-log"})):he("",!0),C(L.date)?($(),wt(qe,{key:2,name:"star",size:12,class:"mark-star"})):he("",!0)])],64)):he("",!0)],10,_g))),128))])]),we(Rs,{name:"drawer"},{default:Wn(()=>[ce.value?($(),O("aside",xg,[l("div",Cg,[A[1]||(A[1]=l("span",{class:"drawer-title"},"当日详情",-1)),l("button",{class:"icon-btn",onClick:A[0]||(A[0]=L=>ce.value=null)},[we(qe,{name:"close",size:16})])]),l("div",$g,[we(Md,{date:ce.value},null,8,["date"])])])):he("",!0)]),_:1})]))}}),Eg=Kt(Sg,[["__scopeId","data-v-8a3b0422"]]),Tg="modulepreload",Ag=function(e,t){return new URL(e,t).href},Nu={},Id=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),v=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));o=Promise.allSettled(n.map(b=>{if(b=Ag(b,r),b in Nu)return;Nu[b]=!0;const y=b.endsWith(".css"),_=y?'[rel="stylesheet"]':"";if(!!r)for(let I=c.length-1;I>=0;I--){const Y=c[I];if(Y.href===b&&(!y||Y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${_}`))return;const C=document.createElement("link");if(C.rel=y?"stylesheet":Tg,y||(C.as="script"),C.crossOrigin="",C.href=b,v&&C.setAttribute("nonce",v),document.head.appendChild(C),y)return new Promise((I,Y)=>{C.addEventListener("load",I),C.addEventListener("error",()=>Y(new Error(`Unable to preload CSS for ${b}`)))})}))}function i(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return o.then(c=>{for(const f of c||[])f.status==="rejected"&&i(f.reason);return t().catch(i)})};/*! Capacitor: https://capacitorjs.com/ - MIT License */const Pg=e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t},r=(i,c)=>{n.platforms.set(i,c)},o=i=>{n.platforms.has(i)&&(n.currentPlatform=n.platforms.get(i))};return n.addPlatform=r,n.setPlatform=o,n},Og=e=>e.CapacitorPlatforms=Pg(e),jd=Og(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});jd.addPlatform;jd.setPlatform;var ar;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(ar||(ar={}));class _i extends Error{constructor(t,n,r){super(t),this.message=t,this.code=n,this.data=r}}const Mg=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},Ig=e=>{var t,n,r,o,i;const c=e.CapacitorCustomPlatform||null,f=e.Capacitor||{},v=f.Plugins=f.Plugins||{},b=e.CapacitorPlatforms,y=()=>c!==null?c.name:Mg(e),_=((t=b==null?void 0:b.currentPlatform)===null||t===void 0?void 0:t.getPlatform)||y,S=()=>_()!=="web",C=((n=b==null?void 0:b.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||S,I=G=>{const te=A.get(G);return!!(te!=null&&te.platforms.has(_())||ce(G))},Y=((r=b==null?void 0:b.currentPlatform)===null||r===void 0?void 0:r.isPluginAvailable)||I,le=G=>{var te;return(te=f.PluginHeaders)===null||te===void 0?void 0:te.find(P=>P.name===G)},ce=((o=b==null?void 0:b.currentPlatform)===null||o===void 0?void 0:o.getPluginHeader)||le,ue=G=>e.console.error(G),W=(G,te,P)=>Promise.reject(`${P} does not have an implementation of "${te}".`),A=new Map,L=(G,te={})=>{const P=A.get(G);if(P)return console.warn(`Capacitor plugin "${G}" already registered. Cannot register plugins twice.`),P.proxy;const E=_(),j=ce(G);let ne;const Me=async()=>(!ne&&E in te?ne=typeof te[E]=="function"?ne=await te[E]():ne=te[E]:c!==null&&!ne&&"web"in te&&(ne=typeof te.web=="function"?ne=await te.web():ne=te.web),ne),Ee=(Se,De)=>{var $e,fe;if(j){const Ie=j==null?void 0:j.methods.find(ct=>De===ct.name);if(Ie)return Ie.rtype==="promise"?ct=>f.nativePromise(G,De.toString(),ct):(ct,bt)=>f.nativeCallback(G,De.toString(),ct,bt);if(Se)return($e=Se[De])===null||$e===void 0?void 0:$e.bind(Se)}else{if(Se)return(fe=Se[De])===null||fe===void 0?void 0:fe.bind(Se);throw new _i(`"${G}" plugin is not implemented on ${E}`,ar.Unimplemented)}},ye=Se=>{let De;const $e=(...fe)=>{const Ie=Me().then(ct=>{const bt=Ee(ct,Se);if(bt){const _t=bt(...fe);return De=_t==null?void 0:_t.remove,_t}else throw new _i(`"${G}.${Se}()" is not implemented on ${E}`,ar.Unimplemented)});return Se==="addListener"&&(Ie.remove=async()=>De()),Ie};return $e.toString=()=>`${Se.toString()}() { [capacitor code] }`,Object.defineProperty($e,"name",{value:Se,writable:!1,configurable:!1}),$e},Ae=ye("addListener"),Ue=ye("removeListener"),de=(Se,De)=>{const $e=Ae({eventName:Se},De),fe=async()=>{const ct=await $e;Ue({eventName:Se,callbackId:ct},De)},Ie=new Promise(ct=>$e.then(()=>ct({remove:fe})));return Ie.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await fe()},Ie},ke=new Proxy({},{get(Se,De){switch(De){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return j?de:Ae;case"removeListener":return Ue;default:return ye(De)}}});return v[G]=ke,A.set(G,{name:G,proxy:ke,platforms:new Set([...Object.keys(te),...j?[E]:[]])}),ke},Z=((i=b==null?void 0:b.currentPlatform)===null||i===void 0?void 0:i.registerPlugin)||L;return f.convertFileSrc||(f.convertFileSrc=G=>G),f.getPlatform=_,f.handleError=ue,f.isNativePlatform=C,f.isPluginAvailable=Y,f.pluginMethodNoop=W,f.registerPlugin=Z,f.Exception=_i,f.DEBUG=!!f.DEBUG,f.isLoggingEnabled=!!f.isLoggingEnabled,f.platform=f.getPlatform(),f.isNative=f.isNativePlatform(),f},jg=e=>e.Capacitor=Ig(e),ir=jg(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Dd=ir.registerPlugin;ir.Plugins;class Ld{constructor(t){this.listeners={},this.retainedEventArguments={},this.windowListeners={},t&&(console.warn(`Capacitor WebPlugin "${t.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=t)}addListener(t,n){let r=!1;this.listeners[t]||(this.listeners[t]=[],r=!0),this.listeners[t].push(n);const i=this.windowListeners[t];i&&!i.registered&&this.addWindowListener(i),r&&this.sendRetainedArgumentsForEvent(t);const c=async()=>this.removeListener(t,n);return Promise.resolve({remove:c})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,r){const o=this.listeners[t];if(!o){if(r){let i=this.retainedEventArguments[t];i||(i=[]),i.push(n),this.retainedEventArguments[t]=i}return}o.forEach(i=>i(n))}hasListeners(t){return!!this.listeners[t].length}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:r=>{this.notifyListeners(n,r)}}}unimplemented(t="not implemented"){return new ir.Exception(t,ar.Unimplemented)}unavailable(t="not available"){return new ir.Exception(t,ar.Unavailable)}async removeListener(t,n){const r=this.listeners[t];if(!r)return;const o=r.indexOf(n);this.listeners[t].splice(o,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(r=>{this.notifyListeners(t,r)}))}}const Vu=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Bu=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Dg extends Ld{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(r=>{if(r.length<=0)return;let[o,i]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=Bu(o).trim(),i=Bu(i).trim(),n[o]=i}),n}async setCookie(t){try{const n=Vu(t.key),r=Vu(t.value),o=`; expires=${(t.expires||"").replace("expires=","")}`,i=(t.path||"/").replace("path=",""),c=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${r||""}${o}; path=${i}; ${c};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}Dd("CapacitorCookies",{web:()=>new Dg});const Lg=async e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const o=r.result;t(o.indexOf(",")>=0?o.split(",")[1]:o)},r.onerror=o=>n(o),r.readAsDataURL(e)}),Kg=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,i,c)=>(o[i]=e[t[c]],o),{})},Rg=(e,t=!0)=>e?Object.entries(e).reduce((r,o)=>{const[i,c]=o;let f,v;return Array.isArray(c)?(v="",c.forEach(b=>{f=t?encodeURIComponent(b):b,v+=`${i}=${f}&`}),v.slice(0,-1)):(f=t?encodeURIComponent(c):c,v=`${i}=${f}`),`${r}&${v}`},"").substr(1):null,Fg=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),o=Kg(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const i=new URLSearchParams;for(const[c,f]of Object.entries(e.data||{}))i.set(c,f);n.body=i.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const i=new FormData;if(e.data instanceof FormData)e.data.forEach((f,v)=>{i.append(v,f)});else for(const f of Object.keys(e.data))i.append(f,e.data[f]);n.body=i;const c=new Headers(n.headers);c.delete("content-type"),n.headers=c}else(o.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class Ng extends Ld{async request(t){const n=Fg(t,t.webFetchExtra),r=Rg(t.params,t.shouldEncodeUrlParams),o=r?`${t.url}?${r}`:t.url,i=await fetch(o,n),c=i.headers.get("content-type")||"";let{responseType:f="text"}=i.ok?t:{};c.includes("application/json")&&(f="json");let v,b;switch(f){case"arraybuffer":case"blob":b=await i.blob(),v=await Lg(b);break;case"json":v=await i.json();break;case"document":case"text":default:v=await i.text()}const y={};return i.headers.forEach((_,S)=>{y[S]=_}),{data:v,headers:y,status:i.status,url:i.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}Dd("CapacitorHttp",{web:()=>new Ng});async function Ea(e,t){const n=window;if(n.electronAPI&&n.electronAPI.saveFile){const c=await n.electronAPI.saveFile(e,t);return c&&c.saved?c.path:""}if(ir.isNativePlatform()){const{Filesystem:c,Directory:f,Encoding:v}=await Id(async()=>{const{Filesystem:b,Directory:y,Encoding:_}=await import("./index-BgET7HfO.js");return{Filesystem:b,Directory:y,Encoding:_}},[],import.meta.url);try{return(await c.writeFile({path:e,data:t,directory:f.Documents,encoding:v.UTF8,recursive:!0})).uri}catch{return(await c.writeFile({path:e,data:t,directory:f.Cache,encoding:v.UTF8,recursive:!0})).uri}}const r=new Blob([t],{type:"text/plain;charset=utf-8"}),o=URL.createObjectURL(r),i=document.createElement("a");return i.href=o,i.download=e,i.click(),window.setTimeout(()=>URL.revokeObjectURL(o),1e4),""}const Vg=Object.freeze(Object.defineProperty({__proto__:null,downloadText:Ea},Symbol.toStringTag,{value:"Module"})),Bg={class:"detail-page"},Ug={class:"card toolbar"},qg={class:"nav-row"},Hg=["value"],zg=["disabled"],Wg={class:"exp-row"},Gg={class:"seg"},Yg=["disabled"],Jg=jt({__name:"TodayView",setup(e){const t=M(ot()),n=st(()=>t.value===ot());function r(){t.value=Vt(t.value,-1)}function o(){t.value=Vt(t.value,1)}function i(){t.value=ot()}const c=M("day"),f=M(ot()),v=M(ot()),b=M(!1);function y(){if(c.value==="day")return{start:t.value,end:t.value,label:t.value};if(c.value==="week"){const C=Zs(f.value);return{start:C,end:Vt(C,6),label:C+"_"+Vt(C,6)}}if(c.value==="month"){const C=f.value.slice(0,4),I=f.value.slice(5,7),Y=new Date(Number(C),Number(I),0).getDate();return{start:C+"-"+I+"-01",end:C+"-"+I+"-"+Y,label:C+"-"+I}}return{start:f.value,end:v.value,label:f.value+"_"+v.value}}async function _(){if(!b.value){b.value=!0;try{const{start:C,end:I,label:Y}=y(),[le,ce,ue,W]=await Promise.all([vs(),Xr(C,I),Qr(C,I),or(!0)]),A=new Map(W.map(P=>[P.id,P.name])),L=["# 工作详情 "+Y,""],Z=["周日","周一","周二","周三","周四","周五","周六"];let G=C,te=0;for(;G<=I&&te<400;){const P=ue.filter(j=>j.date===G),E=ce.find(j=>j.date===G);if(E||P.length){if(L.push("## "+G+" "+Z[new Date(G+"T00:00:00").getDay()],""),E&&(E.clock_in_at||E.kind==="makeup")){const j=cr(E,G,le,G===ot()),ne=[wn(E.clock_in_at),"–",wn(E.clock_out_at),"·",j.label];E.location&&ne.push("· 地点:"+E.location),L.push("考勤:"+ne.join(" "),"")}for(const j of P){const ne=j.project_id&&A.get(j.project_id)||"",Me="- 【"+Ur(j.category)+"】"+j.content+(j.minutes?"("+j.minutes+" 分钟)":"")+(ne?" @"+ne:"");L.push(Me),j.takeaway&&L.push(" - 收获:"+j.takeaway),j.needs_followup===1&&j.remark?L.push(" - 待跟进:"+j.remark):j.remark&&L.push(" - 备注:"+j.remark)}L.push("")}G=Vt(G,1),te++}await Ea("工作详情_"+Y+".md",L.join(`
`)),Fe("已导出 Markdown")}finally{b.value=!1}}}function S(C){const I=C.target.value;I&&(t.value=I)}return pt(t,C=>{f.value=C,c.value==="custom"&&(v.value=C)}),(C,I)=>($(),O("div",Bg,[l("div",Ug,[l("div",qg,[l("button",{class:"icon-btn",title:"前一天",onClick:r},[we(qe,{name:"chevron-left",size:16})]),l("span",{class:Xe(["date-title num",{"is-today":n.value}])},z(on(ud)(t.value)),3),l("button",{class:"icon-btn",title:"后一天",onClick:o},[we(qe,{name:"chevron-right",size:16})]),l("input",{type:"date",class:"input w-date",value:t.value,onChange:S},null,40,Hg),l("button",{class:"btn btn-sm",disabled:n.value,onClick:i},"回到今天",8,zg)]),I[7]||(I[7]=l("div",{class:"tool-sep"},null,-1)),l("div",Wg,[I[6]||(I[6]=l("span",{class:"muted exp-label"},"导出",-1)),l("div",Gg,[l("button",{class:Xe(["seg-btn",{active:c.value==="day"}]),onClick:I[0]||(I[0]=Y=>c.value="day")},"指定日",2),l("button",{class:Xe(["seg-btn",{active:c.value==="week"}]),onClick:I[1]||(I[1]=Y=>c.value="week")},"当周",2),l("button",{class:Xe(["seg-btn",{active:c.value==="month"}]),onClick:I[2]||(I[2]=Y=>c.value="month")},"当月",2),l("button",{class:Xe(["seg-btn",{active:c.value==="custom"}]),onClick:I[3]||(I[3]=Y=>c.value="custom")},"自定义",2)]),c.value!=="day"?Oe(($(),O("input",{key:0,class:"input w-exp",type:"date","onUpdate:modelValue":I[4]||(I[4]=Y=>f.value=Y)},null,512)),[[Re,f.value]]):he("",!0),c.value==="custom"?Oe(($(),O("input",{key:1,class:"input w-exp",type:"date","onUpdate:modelValue":I[5]||(I[5]=Y=>v.value=Y)},null,512)),[[Re,v.value]]):he("",!0),l("button",{class:"btn btn-sm",disabled:b.value,onClick:_},"导出 Markdown",8,Yg)])]),we(Md,{date:t.value},null,8,["date"])]))}}),Xg=Kt(Jg,[["__scopeId","data-v-e7b2d2f8"]]),Qg={class:"plan-page"},Zg={class:"blk-head"},eb={key:0,class:"card empty muted"},tb={class:"goal-main"},nb={class:"goal-line"},sb={class:"tag"},rb={class:"goal-name"},ob={class:"muted num goal-range"},ab={class:"goal-bar"},ib={class:"muted num goal-meta"},lb={class:"goal-ops"},ub=["onClick"],cb=["onClick"],db={class:"blk-head day-head"},fb={class:"blk-head-text"},pb={class:"muted blk-sub num"},vb={class:"day-ops"},mb={class:"card list-card"},hb={key:0,class:"empty muted"},yb={class:"pi-time num"},gb={class:"muted"},bb={class:"pi-main"},wb={class:"pi-title"},_b={class:"tag"},kb={key:0,class:"tag tag-goal"},xb={key:1,class:"state-done"},Cb={key:2,class:"state-skip"},$b={key:0,class:"muted pi-note"},Sb={class:"muted pi-meta num"},Eb={key:0,class:"timer-live"},Tb={class:"pi-ops"},Ab=["onClick"],Pb=["onClick"],Ob=["onClick"],Mb=["onClick"],Ib=["onClick"],jb=["onClick"],Db={class:"dialog",role:"dialog","aria-label":"计划"},Lb={class:"dialog-head"},Kb={class:"dialog-title"},Rb={class:"dialog-body"},Fb={class:"form-row"},Nb={class:"form-row"},Vb=["value"],Bb={class:"form-row two"},Ub={class:"form-row"},qb={key:0,class:"form-error"},Hb={class:"dialog-btns"},zb={class:"dialog",role:"dialog","aria-label":"长期计划"},Wb={class:"dialog-head"},Gb={class:"dialog-title"},Yb={class:"dialog-body"},Jb={class:"form-row"},Xb={class:"form-row"},Qb=["value"],Zb={class:"form-row two"},ew={class:"form-row"},tw={key:0,class:"form-error"},nw={class:"dialog-btns"},sw=jt({__name:"PlanView",setup(e){const t=M([]),n=M({}),r=M(!1),o=M(null),i=M(""),c=M("学习"),f=M(ot()),v=M(Vt(ot(),6)),b=M(""),y=M(""),_=M(null);function S(){o.value=null,i.value="",c.value="学习",f.value=ot(),v.value=Vt(ot(),6),b.value="",y.value="",r.value=!0}function C(m){o.value=m,i.value=m.title,c.value=m.kind,f.value=m.start_date,v.value=m.end_date,b.value=m.note||"",y.value="",r.value=!0}async function I(){if(!i.value.trim()){y.value="请填写计划名称";return}if(v.value<f.value){y.value="结束日期不能早于开始日期";return}o.value?(await Ph(o.value.id,{title:i.value.trim(),kind:c.value,note:b.value}),Fe("长期计划已更新")):(await Ah({title:i.value,kind:c.value,start_date:f.value,end_date:v.value,note:b.value}),Fe("长期计划已创建,已生成每日任务")),r.value=!1,await Z()}async function Y(){_.value&&(await Oh(_.value.id),Fe("已删除长期计划及其每日任务"),_.value=null,await Z())}const le=M(ot()),ce=M([]),ue=M(!0),W=M(Date.now());let A=null;const L=st(()=>le.value===ot());async function Z(){ue.value=!0;const[m,x,D]=await Promise.all([gh(le.value),Th(),Eh()]);ce.value=m,t.value=x;const ae={};for(const H of D)ae[String(H.goalId)]={done:H.done,total:H.total};n.value=ae,ue.value=!1}pt(le,Z),pt(ur,Z),ln(()=>{Z(),A=window.setInterval(()=>{W.value=Date.now()},3e4)}),Ln(()=>{A&&window.clearInterval(A)});function G(){le.value=Vt(le.value,-1)}function te(){le.value=Vt(le.value,1)}function P(){le.value=ot()}const E=st(()=>{const m=ce.value.length,x=ce.value.filter(T=>T.status==="done").length,D=ce.value.reduce((T,X)=>T+j(X),0),ae=ce.value.reduce((T,X)=>T+(X.actual_minutes||0),0);let H=0;const ee=Me.value;if(ee){const T=ce.value.find(X=>X.id===ee);T&&(H=Ee(T))}return{total:m,done:x,plannedMin:D,actualMin:ae+H}});function j(m){const[x,D]=m.start_time.split(":").map(Number),[ae,H]=m.end_time.split(":").map(Number);return Math.max(0,ae*60+H-(x*60+D))}function ne(m){return m<60?m+" 分钟":Math.floor(m/60)+" 小时 "+m%60+" 分"}const Me=st(()=>{const m=ce.value.find(x=>!!x.timer_started_at);return m?m.id:null});function Ee(m){if(!m.timer_started_at)return m.actual_minutes||0;const x=Math.max(0,Math.round((W.value-new Date(m.timer_started_at).getTime())/6e4));return(m.actual_minutes||0)+x}async function ye(m){m.timer_started_at?(await Sa(m.id),Fe("已停止计时:"+m.title)):(await Ch(m.id),Fe("开始计时:"+m.title)),Km(),await Z()}async function Ae(m,x){await xh(m.id,x),await Z()}const Ue=M(!1),de=M(null),ke=M(""),Se=M("学习"),De=M("09:00"),$e=M("10:00"),fe=M(""),Ie=M(""),ct=["学习","健身","自律","工作","阅读","其他"];function bt(){de.value=null,ke.value="",Se.value="学习",De.value="09:00",$e.value="10:00",fe.value="",Ie.value="",Ue.value=!0}function _t(m){de.value=m.id,ke.value=m.title,Se.value=m.kind,De.value=m.start_time,$e.value=m.end_time,fe.value=m.note||"",Ie.value="",Ue.value=!0}async function Bt(){if(!ke.value.trim()){Ie.value="请填写计划内容";return}if($e.value<=De.value){Ie.value="结束时间需晚于开始时间";return}de.value?(await _h(de.value,{title:ke.value.trim(),kind:Se.value,start_time:De.value,end_time:$e.value,note:fe.value}),Fe("计划已更新")):(await wh({date:le.value,start_time:De.value,end_time:$e.value,title:ke.value,kind:Se.value,note:fe.value}),Fe("计划已添加")),Ue.value=!1,await Z()}async function vt(m){await kh(m.id),Fe("已删除"),await Z()}const Ne=["周日","周一","周二","周三","周四","周五","周六"];function g(m){return Ne[Fs(m).getDay()]}return(m,x)=>($(),O("div",Qg,[l("div",Zg,[x[18]||(x[18]=l("div",{class:"blk-head-text"},[l("div",{class:"blk-title"},"长期计划"),l("div",{class:"muted blk-sub"},"跨越多天的目标,自动落实到每一天")],-1)),l("button",{class:"btn btn-sm",onClick:S},[we(qe,{name:"plus",size:14}),x[17]||(x[17]=ht(" 新建长期计划",-1))])]),t.value.length?he("",!0):($(),O("div",eb," 暂无长期计划。创建一个跨越多天的目标(如「产品文档学习」),系统会自动生成每天的打卡任务。 ")),($(!0),O(je,null,et(t.value,D=>($(),O("div",{key:D.id,class:"card goal-card"},[l("div",tb,[l("div",nb,[l("span",sb,z(D.kind),1),l("span",rb,z(D.title),1),l("span",ob,z(D.start_date.slice(5))+" ~ "+z(D.end_date.slice(5)),1)]),l("div",ab,[l("span",{class:"goal-bar-fill",style:qn({width:(n.value[String(D.id)]?Math.round(n.value[String(D.id)].done/Math.max(1,n.value[String(D.id)].total)*100):0)+"%"})},null,4)]),l("div",ib,[ht(z(n.value[String(D.id)]?n.value[String(D.id)].done+"/"+n.value[String(D.id)].total+" 天已完成":"0/"+(n.value[String(D.id)]?n.value[String(D.id)].total:0)+" 天")+" ",1),D.note?($(),O(je,{key:0},[ht(" · "+z(D.note),1)],64)):he("",!0)])]),l("div",lb,[l("button",{class:"icon-btn",title:"编辑",onClick:ae=>C(D)},[we(qe,{name:"edit",size:14})],8,ub),l("button",{class:"icon-btn",title:"删除",onClick:ae=>_.value=D},[we(qe,{name:"close",size:14})],8,cb)])]))),128)),l("div",db,[l("div",fb,[x[21]||(x[21]=l("div",{class:"blk-title"},"每日安排",-1)),l("div",pb,[ht(" 共 "+z(E.value.total)+" 项 · 完成 "+z(E.value.done)+" 项 · 计划 "+z(ne(E.value.plannedMin))+" · 实际投入 "+z(ne(E.value.actualMin))+" ",1),Me.value?($(),O(je,{key:0},[x[19]||(x[19]=ht(" · ",-1)),x[20]||(x[20]=l("span",{class:"timer-live"},"计时中",-1))],64)):he("",!0)])]),l("div",vb,[l("button",{class:"icon-btn",title:"前一天",onClick:G},[we(qe,{name:"chevron-left",size:16})]),l("span",{class:Xe(["date-chip num",{today:L.value}])},z(le.value.slice(5))+" "+z(g(le.value)),3),l("button",{class:"icon-btn",title:"后一天",onClick:te},[we(qe,{name:"chevron-right",size:16})]),l("button",{class:Xe(["btn btn-sm",{"btn-primary":!L.value}]),onClick:P},"今天",2),l("button",{class:"btn btn-primary btn-sm",onClick:bt},[we(qe,{name:"plus",size:14}),x[22]||(x[22]=ht(" 添加计划",-1))])])]),l("div",mb,[!ue.value&&!ce.value.length?($(),O("div",hb,"今天还没有计划,点「添加计划」开始规划。")):he("",!0),($(!0),O(je,null,et(ce.value,D=>($(),O("div",{key:D.id,class:Xe(["plan-item",{done:D.status==="done",skip:D.status==="skip",running:!!D.timer_started_at}])},[l("div",yb,[ht(z(D.start_time),1),l("span",gb," - "+z(D.end_time),1)]),l("div",bb,[l("div",wb,[l("span",_b,z(D.kind),1),D.goal_id?($(),O("span",kb,"长期")):he("",!0),l("span",{class:Xe(["pi-text",{strike:D.status==="done"}])},z(D.title),3),D.status==="done"?($(),O("span",xb,"已完成")):D.status==="skip"?($(),O("span",Cb,"已跳过")):he("",!0)]),D.note?($(),O("div",$b,z(D.note),1)):he("",!0),l("div",Sb,[D.timer_started_at?($(),O("span",Eb,"计时中 · 已 "+z(Ee(D))+" 分钟",1)):D.actual_minutes>0?($(),O(je,{key:1},[ht("实际投入 "+z(D.actual_minutes)+" 分钟",1)],64)):he("",!0)])]),l("div",Tb,[D.status!=="done"?($(),O("button",{key:0,class:Xe(["btn btn-xs",{"timer-on":!!D.timer_started_at}]),onClick:ae=>ye(D)},z(D.timer_started_at?"停止计时":"计时"),11,Ab)):he("",!0),D.status!=="done"?($(),O("button",{key:1,class:"btn btn-xs",onClick:ae=>Ae(D,"done")},"完成",8,Pb)):he("",!0),D.status==="todo"?($(),O("button",{key:2,class:"btn btn-xs",onClick:ae=>Ae(D,"skip")},"跳过",8,Ob)):he("",!0),D.status!=="todo"?($(),O("button",{key:3,class:"btn btn-xs",onClick:ae=>Ae(D,"todo")},"恢复",8,Mb)):he("",!0),l("button",{class:"icon-btn",title:"编辑",onClick:ae=>_t(D)},[we(qe,{name:"edit",size:14})],8,Ib),l("button",{class:"icon-btn",title:"删除",onClick:ae=>vt(D)},[we(qe,{name:"close",size:14})],8,jb)])],2))),128))]),($(),wt(zn,{to:"body"},[Ue.value?($(),O("div",{key:0,class:"mask",onClick:x[7]||(x[7]=Nt(D=>Ue.value=!1,["self"]))},[l("div",Db,[l("div",Lb,[l("span",Kb,z(de.value?"编辑计划":"添加计划"),1),l("button",{class:"icon-btn",onClick:x[0]||(x[0]=D=>Ue.value=!1)},[we(qe,{name:"close",size:16})])]),l("div",Rb,[l("div",Fb,[x[23]||(x[23]=l("label",null,"计划内容(学什么、做什么)",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":x[1]||(x[1]=D=>ke.value=D),placeholder:"如:产品文档第三章 / 晨跑 5 公里",onKeydown:Mt(Bt,["enter"])},null,544),[[Re,ke.value]])]),l("div",Nb,[x[24]||(x[24]=l("label",null,"类别",-1)),Oe(l("select",{class:"select","onUpdate:modelValue":x[2]||(x[2]=D=>Se.value=D)},[($(),O(je,null,et(ct,D=>l("option",{key:D,value:D},z(D),9,Vb)),64))],512),[[ps,Se.value]])]),l("div",Bb,[l("div",null,[x[25]||(x[25]=l("label",null,"开始时间",-1)),Oe(l("input",{class:"input",type:"time","onUpdate:modelValue":x[3]||(x[3]=D=>De.value=D)},null,512),[[Re,De.value]])]),l("div",null,[x[26]||(x[26]=l("label",null,"结束时间",-1)),Oe(l("input",{class:"input",type:"time","onUpdate:modelValue":x[4]||(x[4]=D=>$e.value=D)},null,512),[[Re,$e.value]])])]),l("div",Ub,[x[27]||(x[27]=l("label",null,"备注(选填)",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":x[5]||(x[5]=D=>fe.value=D),placeholder:"目标、资料、提醒等",onKeydown:Mt(Bt,["enter"])},null,544),[[Re,fe.value]])]),Ie.value?($(),O("div",qb,z(Ie.value),1)):he("",!0)]),l("div",Hb,[l("button",{class:"btn btn-sm",onClick:x[6]||(x[6]=D=>Ue.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:Bt},z(de.value?"保存":"添加"),1)])])])):he("",!0)])),($(),wt(zn,{to:"body"},[r.value?($(),O("div",{key:0,class:"mask",onClick:x[15]||(x[15]=Nt(D=>r.value=!1,["self"]))},[l("div",zb,[l("div",Wb,[l("span",Gb,z(o.value?"编辑长期计划":"新建长期计划"),1),l("button",{class:"icon-btn",onClick:x[8]||(x[8]=D=>r.value=!1)},[we(qe,{name:"close",size:16})])]),l("div",Yb,[l("div",Jb,[x[28]||(x[28]=l("label",null,"计划名称(落实为每天一条任务)",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":x[9]||(x[9]=D=>i.value=D),placeholder:"如:产品文档学习 / 健身月计划"},null,512),[[Re,i.value]])]),l("div",Xb,[x[29]||(x[29]=l("label",null,"类别",-1)),Oe(l("select",{class:"select","onUpdate:modelValue":x[10]||(x[10]=D=>c.value=D)},[($(),O(je,null,et(ct,D=>l("option",{key:D,value:D},z(D),9,Qb)),64))],512),[[ps,c.value]])]),l("div",Zb,[l("div",null,[x[30]||(x[30]=l("label",null,"开始日期",-1)),Oe(l("input",{class:"input",type:"date","onUpdate:modelValue":x[11]||(x[11]=D=>f.value=D)},null,512),[[Re,f.value]])]),l("div",null,[x[31]||(x[31]=l("label",null,"结束日期",-1)),Oe(l("input",{class:"input",type:"date","onUpdate:modelValue":x[12]||(x[12]=D=>v.value=D)},null,512),[[Re,v.value]])])]),l("div",ew,[x[32]||(x[32]=l("label",null,"备注(选填)",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":x[13]||(x[13]=D=>b.value=D)},null,512),[[Re,b.value]])]),y.value?($(),O("div",tw,z(y.value),1)):he("",!0),x[33]||(x[33]=l("div",{class:"muted goal-hint"},"创建后区间内每一天都会生成一条任务,可在每日安排中逐日打卡与计时。",-1))]),l("div",nw,[l("button",{class:"btn btn-sm",onClick:x[14]||(x[14]=D=>r.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:I},z(o.value?"保存":"创建"),1)])])])):he("",!0)])),we(Dn,{open:!!_.value,title:"删除长期计划",message:_.value?"将删除「"+_.value.title+"」及其全部每日任务(含已完成记录),不可恢复。":"","confirm-text":"删除",danger:"",onCancel:x[16]||(x[16]=D=>_.value=null),onConfirm:Y},null,8,["open","message"])]))}}),rw=Kt(sw,[["__scopeId","data-v-23113490"]]),ow={class:"stats"},aw={class:"cards"},iw={class:"card stat-card"},lw={class:"stat-num num"},uw={class:"card stat-card"},cw={class:"stat-num num"},dw={class:"card stat-card"},fw={class:"stat-num num"},pw={class:"card stat-card"},vw={class:"stat-num num"},mw={class:"card section"},hw={class:"heat"},yw=["title"],gw={class:"two-col"},bw={class:"card section"},ww={class:"bar-label"},_w={class:"bar-track"},kw={class:"muted num bar-num"},xw={key:0,class:"muted"},Cw={class:"card section"},$w={class:"bar-label"},Sw={class:"bar-track"},Ew={class:"muted num bar-num"},Tw={key:0,class:"muted"},Aw={class:"card section"},Pw={class:"bar-label loc-label"},Ow={class:"bar-track"},Mw={class:"muted num bar-num"},Iw={key:0,class:"muted"},jw=jt({__name:"StatsView",setup(e){const t=M({attendDays:0,totalHours:"0",itemCount:0,streak:0}),n=M([]),r=M([]),o=M([]),i=M([]);async function c(){const b=ot(),y="2000-01-01",_=await Promise.all([vs(),Xr(y,b),Qr(y,b),or(!0)]),S=_[0],C=_[1],I=_[2],Y=_[3],le=C.filter(ye=>ye.clock_in_at||ye.kind==="makeup");let ce=0;for(const ye of le){const Ae=cr(ye,ye.date,S,ye.date===b);ce+=Ae.workedMinutes??0}const ue=new Set(I.map(ye=>ye.date));let W=0,A=b;for(ue.has(A)||(A=Vt(b,-1));ue.has(A);)W++,A=Vt(A,-1);t.value={attendDays:le.length,totalHours:(ce/60).toFixed(1),itemCount:I.length,streak:W};const L=new Map;for(const ye of le){const Ae=ye.location||"未记录";L.set(Ae,(L.get(Ae)||0)+1)}i.value=Array.from(L.entries()).map(ye=>({name:ye[0],count:ye[1],percent:Math.round(ye[1]/(le.length||1)*100)})).sort((ye,Ae)=>Ae.count-ye.count);const Z=I.length||1,G=await Zr(),te=new Map;for(const ye of I)te.set(ye.category,(te.get(ye.category)||0)+1);const P=new Set(G);for(const ye of te.keys())P.has(ye)||G.push(ye);r.value=G.map(ye=>{const Ae=te.get(ye)||0;return{key:ye,label:ye,count:Ae,percent:Math.round(Ae/Z*100)}}).filter(ye=>ye.count>0).sort((ye,Ae)=>Ae.count-ye.count);const E=new Map(Y.map(ye=>[ye.id,ye.name])),j=new Map;for(const ye of I){const Ae=ye.project_id?E.get(ye.project_id)||"已删除项目":"无项目";j.set(Ae,(j.get(Ae)||0)+1)}o.value=Array.from(j.entries()).map(ye=>({name:ye[0],count:ye[1],percent:Math.round(ye[1]/Z*100)})).sort((ye,Ae)=>Ae.count-ye.count);const ne=new Map;for(const ye of I)ne.set(ye.date,(ne.get(ye.date)||0)+1);const Me=Zs(b),Ee=[];for(let ye=11;ye>=0;ye--){const Ae=Vt(Me,-7*ye),Ue=[];for(let de=0;de<7;de++){const ke=Vt(Ae,de);Ue.push({date:ke,count:ne.get(ke)||0})}Ee.push(Ue)}n.value=Ee}ln(async()=>{await c()}),pt(ur,()=>{c()});function f(b){return b===0?0:b===1?1:b<=3?2:b<=5?3:4}function v(b,y){return b+" · "+(y?y+" 条":"无记录")}return(b,y)=>($(),O("div",ow,[l("div",aw,[l("div",iw,[y[0]||(y[0]=l("div",{class:"muted"},"出勤天数",-1)),l("div",lw,z(t.value.attendDays),1)]),l("div",uw,[y[1]||(y[1]=l("div",{class:"muted"},"累计工时(小时)",-1)),l("div",cw,z(t.value.totalHours),1)]),l("div",dw,[y[2]||(y[2]=l("div",{class:"muted"},"记录条数",-1)),l("div",fw,z(t.value.itemCount),1)]),l("div",pw,[y[3]||(y[3]=l("div",{class:"muted"},"连续记录(天)",-1)),l("div",vw,z(t.value.streak),1)])]),l("div",mw,[y[4]||(y[4]=l("div",{class:"section-title"},"记录热力图(近 12 周)",-1)),l("div",hw,[($(!0),O(je,null,et(n.value,(_,S)=>($(),O("div",{key:S,class:"heat-col"},[($(!0),O(je,null,et(_,C=>($(),O("span",{key:C.date,class:Xe(["heat-cell","lv"+f(C.count)]),title:v(C.date,C.count)},null,10,yw))),128))]))),128))]),y[5]||(y[5]=Wp('<div class="heat-legend muted" data-v-5469ae68><span data-v-5469ae68>少</span><span class="heat-cell lv0" data-v-5469ae68></span><span class="heat-cell lv1" data-v-5469ae68></span><span class="heat-cell lv2" data-v-5469ae68></span><span class="heat-cell lv3" data-v-5469ae68></span><span class="heat-cell lv4" data-v-5469ae68></span><span data-v-5469ae68>多</span></div>',1))]),l("div",gw,[l("div",bw,[y[6]||(y[6]=l("div",{class:"section-title"},"分类分布",-1)),($(!0),O(je,null,et(r.value,_=>($(),O("div",{key:_.key,class:"bar-row"},[l("span",ww,z(_.label),1),l("span",_w,[l("span",{class:"bar-fill",style:qn({width:_.percent+"%"})},null,4)]),l("span",kw,z(_.count)+" 条 · "+z(_.percent)+"%",1)]))),128)),r.value.length?he("",!0):($(),O("div",xw,"暂无数据"))]),l("div",Cw,[y[7]||(y[7]=l("div",{class:"section-title"},"项目投入",-1)),($(!0),O(je,null,et(o.value,_=>($(),O("div",{key:_.name,class:"bar-row"},[l("span",$w,z(_.name),1),l("span",Sw,[l("span",{class:"bar-fill",style:qn({width:_.percent+"%"})},null,4)]),l("span",Ew,z(_.count)+" 条 · "+z(_.percent)+"%",1)]))),128)),o.value.length?he("",!0):($(),O("div",Tw,"暂无数据"))])]),l("div",Aw,[y[8]||(y[8]=l("div",{class:"section-title"},"地点分布(按出勤天)",-1)),($(!0),O(je,null,et(i.value,_=>($(),O("div",{key:_.name,class:"bar-row"},[l("span",Pw,z(_.name),1),l("span",Ow,[l("span",{class:"bar-fill",style:qn({width:_.percent+"%"})},null,4)]),l("span",Mw,z(_.count)+" 天 · "+z(_.percent)+"%",1)]))),128)),i.value.length?he("",!0):($(),O("div",Iw,"暂无数据"))])]))}}),Dw=Kt(jw,[["__scopeId","data-v-5469ae68"]]);async function Lw(e,t,n){const r=ot(),o=await Promise.all([vs(),Xr(e,t),Qr(e,t),or(!0),yh(e,t),Zr()]),i=o[0],c=o[1],f=o[2],v=o[3],b=o[4],y=o[5];let _=0,S=0,C=0;for(const j of c){(j.clock_in_at||j.kind==="makeup")&&_++,j.kind==="makeup"&&C++;const ne=cr(j,j.date,i,j.date===r);S+=ne.workedMinutes??0}const I=new Map;for(const j of c){if(!(j.clock_in_at||j.kind==="makeup"))continue;const ne=j.location||"未记录";I.set(ne,(I.get(ne)||0)+1)}const Y=Array.from(I.entries()).map(j=>({name:j[0],count:j[1]})).sort((j,ne)=>ne.count-j.count),le=f.length||1,ce=new Map;for(const j of f)ce.set(j.category,(ce.get(j.category)||0)+1);const ue=new Set(y);for(const j of ce.keys())ue.has(j)||y.push(j);const W=y.map(j=>{const ne=ce.get(j)||0;return{key:j,label:j,count:ne,percent:Math.round(ne/le*100)}}).filter(j=>j.count>0).sort((j,ne)=>ne.count-j.count),A=new Map(v.map(j=>[j.id,j.name])),L=new Map;for(const j of f){const ne=j.project_id?A.get(j.project_id)||"已删除项目":"无项目";L.set(ne,(L.get(ne)||0)+1)}const Z=Array.from(L.entries()).map(j=>({name:j[0],count:j[1]})).sort((j,ne)=>ne.count-j.count),G=f.filter(j=>j.is_milestone===1).map(j=>({date:j.date,content:j.content})),te=f.filter(j=>j.needs_followup===1).map(j=>({date:j.date,content:j.content,remark:j.remark||""})),P=f.filter(j=>!!j.takeaway).map(j=>({date:j.date,text:j.takeaway})),E=b.map(j=>({weekStart:j.week_start,highlights:j.highlights||"",challenges:j.challenges||"",plan_next:j.plan_next||""}));return{range:{start:e,end:t,label:n},attendDays:_,totalHours:(S/60).toFixed(1),makeupCount:C,leaveCount:c.filter(j=>j.kind==="leave").length,itemCount:f.length,categoryStats:W,projectStats:Z,locationStats:Y,milestones:G,followups:te,takeaways:P,weekNotes:E}}function Kw(e){const t=[];t.push("# 实习工作总结("+e.range.start+" ~ "+e.range.end+")"),t.push(""),t.push("## 一、考勤概况"),t.push(""),t.push("出勤 "+e.attendDays+" 天,累计工时 "+e.totalHours+" 小时,补卡 "+e.makeupCount+" 次"+(e.leaveCount?",请假 "+e.leaveCount+" 天":""));const n=e.locationStats.filter(r=>r.name!=="未记录");n.length&&t.push("其中:"+n.map(r=>r.name+" "+r.count+" 天").join(",")),t.push(""),t.push("## 二、工作内容分布"),t.push(""),t.push(e.categoryStats.length?e.categoryStats.map(r=>r.label+" "+r.percent+"%("+r.count+" 条)").join(","):"(无记录)"),t.push(""),t.push("## 三、项目投入"),t.push(""),t.push(e.projectStats.length?e.projectStats.map(r=>r.name+" "+r.count+" 条").join(","):"(无记录)"),t.push(""),t.push("## 四、主要成果"),t.push(""),e.milestones.length?e.milestones.forEach((r,o)=>t.push(o+1+". 【成果】"+r.content+"("+r.date+")")):t.push("(无)"),t.push(""),t.push("## 五、待跟进事项"),t.push(""),e.followups.length?e.followups.forEach(r=>t.push("- 【待跟进】"+r.content+(r.remark?"("+r.date+" 备注:"+r.remark+")":"("+r.date+")"))):t.push("(无)"),t.push(""),t.push("## 六、学习与成长"),t.push(""),e.takeaways.length?e.takeaways.forEach(r=>t.push("- "+r.text+"("+r.date+")")):t.push("(无)");for(const r of e.weekNotes)t.push(""),t.push("### 周记("+r.weekStart+" 起)"),t.push(""),t.push("- 本周亮点:"+(r.highlights||"(无)")),t.push("- 踩的坑:"+(r.challenges||"(无)")),t.push("- 下周计划:"+(r.plan_next||"(无)"));return t.push(""),t.join(`
`)}async function Wi(e){try{await navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}}async function Rw(e){const t=await Promise.all([Ct("ai_base_url",""),Ct("ai_api_key",""),Ct("ai_model","")]),n=t[0].trim().replace(/\/+$/,""),r=t[1].trim(),o=t[2].trim();if(!n||!o)throw new Error("请先在设置页配置 AI 接口地址与模型名称");const i=n+"/chat/completions",c={"Content-Type":"application/json"};r&&(c.Authorization="Bearer "+r);const v=JSON.stringify({model:o,messages:[{role:"system",content:"你是一名严谨的中文助理。请将用户提供的工作总结 Markdown 草稿润色为通顺、专业、简洁的工作总结。要求:保留原有章节结构与全部事实数据(数字、日期、条目),不得虚构或遗漏内容,只输出 Markdown 正文。"},{role:"user",content:e}],temperature:.3});let b;try{b=await fetch(i,{method:"POST",headers:c,body:v})}catch{throw new Error("无法访问 AI 接口:请检查地址是否正确、服务端是否允许浏览器跨域访问")}if(!b.ok){let S="接口返回 "+b.status;try{const C=await b.json();C&&C.error&&C.error.message&&(S+=":"+C.error.message)}catch{}throw new Error(S)}const y=await b.json(),_=y&&y.choices&&y.choices[0]&&y.choices[0].message&&y.choices[0].message.content;if(!_)throw new Error("接口未返回内容");return String(_)}const Fw={class:"report"},Nw={class:"report-toolbar"},Vw={class:"seg"},Bw=["onClick"],Uw=["disabled"],qw=["disabled"],Hw={key:0,class:"ai-error"},zw={class:"report-grid"},Ww={class:"report-left"},Gw={class:"card section"},Yw={class:"section-title"},Jw={class:"muted note-saved"},Xw={class:"card section"},Qw={class:"report-right"},Zw={key:0,class:"card section"},e_={class:"sum-row"},t_={class:"num"},n_={class:"sum-row"},s_={class:"num"},r_={class:"sum-row"},o_={class:"num"},a_={class:"sum-row"},i_={class:"num"},l_={class:"sum-row"},u_={class:"num"},c_={class:"muted"},d_={class:"num"},f_={key:0,class:"muted sum-empty"},p_={class:"muted"},v_={key:1,class:"muted sum-empty"},m_={class:"muted"},h_={key:2,class:"muted sum-empty"},y_={class:"muted"},g_={key:3,class:"muted sum-empty"},b_=jt({__name:"ReportView",setup(e){const t=[{key:"week",label:"本周"},{key:"month",label:"本月"},{key:"all",label:"全部"},{key:"custom",label:"自定义"}],n=M("week"),r=M(Zs(ot())),o=M(ot()),i=M(null),c=M(""),f=M(!1),v=M(!1),b=M(null),y=M(""),_=M(Zs(ot())),S=M(""),C=M(""),I=M(""),Y=M(!1);async function le(){const te=await yl(_.value);S.value=(te==null?void 0:te.highlights)||"",C.value=(te==null?void 0:te.challenges)||"",I.value=(te==null?void 0:te.plan_next)||"",Y.value=!1}async function ce(){await hh(_.value,{highlights:S.value.trim()||null,challenges:C.value.trim()||null,plan_next:I.value.trim()||null}),Y.value=!0,await W()}function ue(te){const P=ot();if(te==="week"){const E=Zs(P);return{start:E,end:Vt(E,6),label:"本周"}}if(te==="month"){const E=P.slice(0,7);return{start:E+"-01",end:P,label:E+" 本月"}}return te==="all"?{start:"2000-01-01",end:P,label:"全部实习期"}:{start:r.value,end:o.value,label:r.value+" ~ "+o.value}}async function W(){f.value=!0;const te=ue(n.value),P=await Lw(te.start,te.end,te.label);i.value=P,c.value=Kw(P),f.value=!1}pt(n,W),pt([r,o],()=>{n.value==="custom"&&W()}),ln(async()=>{await le(),await W()});async function A(){const te=ot().replace(/-/g,""),P=await Ea("实习工作总结_"+te+".md",c.value);Fe(P?"总结已导出到:"+P:"总结已导出到系统下载目录")}async function L(){await Wi(c.value),Fe("总结已复制到剪贴板")}async function Z(){if(v.value)return;y.value="";const te=c.value.trim();if(!te){y.value="当前草稿为空,无法润色";return}v.value=!0;try{b.value=c.value,c.value=await Rw(te),Fe("AI 润色完成")}catch(P){b.value=null,y.value=P instanceof Error?P.message:"润色失败"}v.value=!1}function G(){b.value!==null&&(c.value=b.value),b.value=null}return(te,P)=>($(),O("div",Fw,[l("div",Nw,[l("div",Vw,[($(),O(je,null,et(t,E=>l("button",{key:E.key,class:Xe(["seg-btn",{active:n.value===E.key}]),onClick:j=>n.value=E.key},z(E.label),11,Bw)),64))]),n.value==="custom"?($(),O(je,{key:0},[Oe(l("input",{type:"date",class:"input w-date","onUpdate:modelValue":P[0]||(P[0]=E=>r.value=E)},null,512),[[Re,r.value]]),P[6]||(P[6]=l("span",{class:"muted"},"至",-1)),Oe(l("input",{type:"date",class:"input w-date","onUpdate:modelValue":P[1]||(P[1]=E=>o.value=E)},null,512),[[Re,o.value]])],64)):he("",!0),P[10]||(P[10]=l("span",{class:"flex1"},null,-1)),l("button",{class:"btn btn-sm",disabled:v.value,onClick:Z},[we(qe,{name:"edit",size:14}),P[7]||(P[7]=ht("AI 润色 ",-1))],8,Uw),b.value!==null?($(),O("button",{key:1,class:"btn btn-sm",onClick:G},"还原润色前")):he("",!0),l("button",{class:"btn btn-sm",disabled:f.value,onClick:W},[we(qe,{name:"edit",size:14}),P[8]||(P[8]=ht("重新生成 ",-1))],8,qw),l("button",{class:"btn btn-sm",onClick:L},"复制"),l("button",{class:"btn btn-primary btn-sm",onClick:A},[we(qe,{name:"export",size:14}),P[9]||(P[9]=ht("导出 Markdown ",-1))])]),y.value?($(),O("div",Hw,z(y.value),1)):he("",!0),l("div",zw,[l("div",Ww,[l("div",Gw,[l("div",Yw,"本周周记("+z(_.value)+" 起)",1),P[11]||(P[11]=l("label",{class:"note-label muted"},"本周亮点",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":P[2]||(P[2]=E=>S.value=E),placeholder:"本周最有价值的一件事",onBlur:ce},null,544),[[Re,S.value]]),P[12]||(P[12]=l("label",{class:"note-label muted"},"踩的坑",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":P[3]||(P[3]=E=>C.value=E),placeholder:"遇到的问题与教训",onBlur:ce},null,544),[[Re,C.value]]),P[13]||(P[13]=l("label",{class:"note-label muted"},"下周计划",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":P[4]||(P[4]=E=>I.value=E),placeholder:"下周准备做什么",onBlur:ce},null,544),[[Re,I.value]]),l("div",Jw,z(Y.value?"已保存":"失焦自动保存"),1)]),l("div",Xw,[P[14]||(P[14]=l("div",{class:"section-title"},"总结草稿(可编辑)",-1)),Oe(l("textarea",{class:"textarea md-editor","onUpdate:modelValue":P[5]||(P[5]=E=>c.value=E),spellcheck:"false"},null,512),[[Re,c.value]])])]),l("div",Qw,[i.value?($(),O("div",Zw,[P[20]||(P[20]=l("div",{class:"section-title"},"数据摘要",-1)),l("div",e_,[P[15]||(P[15]=l("span",{class:"muted"},"出勤",-1)),l("span",t_,z(i.value.attendDays)+" 天",1)]),l("div",n_,[P[16]||(P[16]=l("span",{class:"muted"},"工时",-1)),l("span",s_,z(i.value.totalHours)+" 小时",1)]),l("div",r_,[P[17]||(P[17]=l("span",{class:"muted"},"补卡",-1)),l("span",o_,z(i.value.makeupCount)+" 次",1)]),l("div",a_,[P[18]||(P[18]=l("span",{class:"muted"},"请假",-1)),l("span",i_,z(i.value.leaveCount)+" 天",1)]),l("div",l_,[P[19]||(P[19]=l("span",{class:"muted"},"记录",-1)),l("span",u_,z(i.value.itemCount)+" 条",1)]),P[21]||(P[21]=l("div",{class:"section-sub"},"分类分布",-1)),($(!0),O(je,null,et(i.value.categoryStats,E=>($(),O("div",{key:E.key,class:"sum-row"},[l("span",c_,z(E.label),1),l("span",d_,z(E.count)+" 条 · "+z(E.percent)+"%",1)]))),128)),i.value.categoryStats.length?he("",!0):($(),O("div",f_,"(无)")),P[22]||(P[22]=l("div",{class:"section-sub"},"主要成果",-1)),($(!0),O(je,null,et(i.value.milestones,(E,j)=>($(),O("div",{key:"m"+j,class:"sum-item"},[ht(z(E.content),1),l("span",p_,"("+z(E.date)+")",1)]))),128)),i.value.milestones.length?he("",!0):($(),O("div",v_,"(无)")),P[23]||(P[23]=l("div",{class:"section-sub"},"待跟进",-1)),($(!0),O(je,null,et(i.value.followups,(E,j)=>($(),O("div",{key:"f"+j,class:"sum-item"},[ht(z(E.content),1),l("span",m_,"("+z(E.date)+")",1)]))),128)),i.value.followups.length?he("",!0):($(),O("div",h_,"(无)")),P[24]||(P[24]=l("div",{class:"section-sub"},"学习与成长",-1)),($(!0),O(je,null,et(i.value.takeaways,(E,j)=>($(),O("div",{key:"t"+j,class:"sum-item"},[ht(z(E.text),1),l("span",y_,"("+z(E.date)+")",1)]))),128)),i.value.takeaways.length?he("",!0):($(),O("div",g_,"(无)"))])):he("",!0)])])]))}}),w_=Kt(b_,[["__scopeId","data-v-36db413b"]]),__=["aria-label"],k_={class:"dialog-head"},x_={class:"dialog-title"},C_={class:"dialog-body"},$_={class:"form-grid"},S_={class:"field span2"},E_={class:"seg"},T_={class:"field"},A_={class:"field"},P_={class:"field"},O_=["value"],M_={class:"add-cat"},I_=["onKeydown"],j_={key:0,class:"field"},D_={class:"seg"},L_={class:"field span2"},K_={key:0,class:"form-error"},R_={class:"dialog-btns"},F_=jt({__name:"TransactionDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,r=t,o=M("expense"),i=M(""),c=M(""),f=M(""),v=M(""),b=M(!1),y=M(!1),_=M(""),S=M(null);function C(A){n.open&&A.key==="Escape"&&r("cancel")}pt(()=>n.open,async A=>{var L;A?(await Y(),o.value=n.initial.type==="income"?"income":"expense",i.value=n.initial.category,c.value=n.initial.amountYuan,f.value=n.initial.date,v.value=n.initial.note,b.value=n.initial.reimbursable===1,y.value=n.initial.reimbursed===1,_.value="",window.addEventListener("keydown",C),await lr(),(L=S.value)==null||L.focus()):window.removeEventListener("keydown",C)}),Ln(()=>window.removeEventListener("keydown",C)),pt(o,async()=>{await Y(),i.value=I.value[0]||""});const I=M([]);async function Y(){I.value=await Wr(o.value)}const le=M("");async function ce(){const A=le.value.trim();if(A){if(I.value.includes(A)){le.value="";return}I.value.push(A),await Ts(o.value,I.value),i.value=A,le.value=""}}function ue(){return i.value&&I.value.includes(i.value)?i.value:I.value[0]}function W(){const A=String(c.value??"").trim(),L=Number(A);if(!A||!isFinite(L)||L<=0){_.value="请填写大于 0 的金额";return}if(!f.value){_.value="请选择日期";return}const Z=o.value==="expense"&&b.value?1:0;r("save",{type:o.value,category:ue(),amount:Math.round(L*100),date:f.value,note:String(v.value??"").trim(),reimbursable:Z,reimbursed:Z&&y.value?1:0})}return(A,L)=>($(),wt(zn,{to:"body"},[we(Rs,{name:"modal"},{default:Wn(()=>[e.open?($(),O("div",{key:0,class:"mask",onClick:L[12]||(L[12]=Nt(Z=>r("cancel"),["self"]))},[l("div",{class:"dialog",role:"dialog","aria-label":e.title},[l("div",k_,[l("span",x_,z(e.title),1),l("button",{class:"icon-btn",title:"关闭",onClick:L[0]||(L[0]=Z=>r("cancel"))},[we(qe,{name:"close",size:16})])]),l("div",C_,[l("div",$_,[l("div",S_,[L[13]||(L[13]=l("label",null,"类型",-1)),l("div",E_,[l("button",{class:Xe(["seg-btn",{active:o.value==="expense"}]),onClick:L[1]||(L[1]=Z=>o.value="expense")},"支出",2),l("button",{class:Xe(["seg-btn",{active:o.value==="income"}]),onClick:L[2]||(L[2]=Z=>o.value="income")},"收入",2)])]),l("div",T_,[L[14]||(L[14]=l("label",null,"金额(元,必填)",-1)),Oe(l("input",{ref_key:"amountInput",ref:S,class:Xe(["input",{invalid:_.value}]),"onUpdate:modelValue":L[3]||(L[3]=Z=>c.value=Z),type:"number",min:"0",step:"0.01",placeholder:"0.00"},null,2),[[Re,c.value]])]),l("div",A_,[L[15]||(L[15]=l("label",null,"日期(必填)",-1)),Oe(l("input",{class:"input",type:"date","onUpdate:modelValue":L[4]||(L[4]=Z=>f.value=Z)},null,512),[[Re,f.value]])]),l("div",P_,[L[16]||(L[16]=l("label",null,"分类(可直接新增)",-1)),Oe(l("select",{class:"select","onUpdate:modelValue":L[5]||(L[5]=Z=>i.value=Z)},[($(!0),O(je,null,et(I.value,Z=>($(),O("option",{key:Z,value:Z},z(Z),9,O_))),128))],512),[[ps,i.value]]),l("div",M_,[Oe(l("input",{class:"input add-cat-input","onUpdate:modelValue":L[6]||(L[6]=Z=>le.value=Z),placeholder:"新增分类名",onKeydown:Mt(Nt(ce,["prevent"]),["enter"])},null,40,I_),[[Re,le.value]]),l("button",{class:"btn btn-xs",type:"button",onClick:ce},"添加")])]),o.value==="expense"?($(),O("div",j_,[L[17]||(L[17]=l("label",null,"报销状态",-1)),l("div",D_,[l("button",{class:Xe(["seg-btn",{active:!b.value}]),onClick:L[7]||(L[7]=Z=>{b.value=!1,y.value=!1})},"无需报销",2),l("button",{class:Xe(["seg-btn",{active:b.value&&!y.value}]),onClick:L[8]||(L[8]=Z=>{b.value=!0,y.value=!1})},"待报销",2),l("button",{class:Xe(["seg-btn",{active:b.value&&y.value}]),onClick:L[9]||(L[9]=Z=>{b.value=!0,y.value=!0})},"已报销",2)])])):he("",!0),l("div",L_,[L[18]||(L[18]=l("label",null,"备注",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":L[10]||(L[10]=Z=>v.value=Z),placeholder:"选填"},null,512),[[Re,v.value]])])]),_.value?($(),O("div",K_,z(_.value),1)):he("",!0)]),l("div",R_,[l("button",{class:"btn btn-sm",onClick:L[11]||(L[11]=Z=>r("cancel"))},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:W},"保存")])],8,__)])):he("",!0)]),_:1})]))}}),N_=Kt(F_,[["__scopeId","data-v-a4b3a7d0"]]),V_={class:"ledger-page"},B_={class:"ledger-toolbar"},U_={class:"month-title num"},q_={class:"cards"},H_={class:"card stat-card"},z_={class:"stat-num num amt-income"},W_={class:"card stat-card"},G_={class:"stat-num num"},Y_={class:"card stat-card"},J_={class:"card stat-card"},X_={class:"stat-num num amt-warn"},Q_={key:0,class:"card sec"},Z_={class:"bar-label"},e1={class:"bar-track"},t1={class:"muted num bar-num"},n1={key:1,class:"card section"},s1={class:"form-error"},r1={class:"card table-card"},o1={class:"tx-table"},a1={class:"num","data-label":"日期"},i1={"data-label":"分类"},l1={class:"tag"},u1={class:"td-note","data-label":"备注"},c1={"data-label":"报销"},d1={key:0,class:"muted"},f1={key:1,class:"tx-done"},p1={key:2,class:"tx-pending"},v1={class:"ops-cell"},m1={class:"ops"},h1=["onClick"],y1=["onClick"],g1=["onClick"],b1={key:0},w1={class:"muted table-note num"},_1=jt({__name:"LedgerView",setup(e){const t=M(ot()),n=M([]),r=M(!0),o=M("");ot();const i=M(""),c=M(""),f=M(!1),v=M(null),b=M({type:"expense",category:"",amountYuan:"",date:ot(),note:"",reimbursable:0,reimbursed:0}),y=M(null),_=st(()=>t.value.slice(0,7)+"-01"),S=st(()=>{const de=Number(t.value.slice(0,4)),ke=Number(t.value.slice(5,7))-1,Se=new Date(de,ke+1,0).getDate();return t.value.slice(0,7)+"-"+(Se<10?"0"+Se:String(Se))}),C=st(()=>Number(t.value.slice(0,4))+" 年 "+Number(t.value.slice(5,7))+" 月");async function I(){r.value=!0;try{n.value=await Rh(_.value,S.value),c.value=""}catch(de){c.value="账目加载失败:"+(de instanceof Error?de.stack||de.message:String(de)),Fe("账目加载失败")}r.value=!1}ln(I),pt(t,I);const Y=M([]),le=M([]);async function ce(){Y.value=await Wr("expense"),le.value=await Wr("income")}ce();const ue=st(()=>n.value.slice().sort((de,ke)=>de.date===ke.date?ke.id-de.id:de.date<ke.date?1:-1)),W=st(()=>{let de=0,ke=0,Se=0;for(const De of n.value)De.type==="income"?de+=De.amount:(ke+=De.amount,De.reimbursable===1&&De.reimbursed!==1&&(Se+=De.amount));return{income:de,expense:ke,pending:Se,balance:de-ke}}),A=M("all"),L=M("all"),Z=st(()=>ue.value.filter(de=>!(A.value!=="all"&&de.type!==A.value||L.value==="pending"&&!(de.type==="expense"&&de.reimbursable===1&&de.reimbursed!==1)||L.value==="done"&&!(de.reimbursable===1&&de.reimbursed===1)))),G=st(()=>{const de=new Map;let ke=0;for(const De of n.value)De.type==="expense"&&(de.set(De.category,(de.get(De.category)||0)+De.amount),ke+=De.amount);const Se=ke||1;return Array.from(de.entries()).map(De=>({name:De[0],amount:De[1],percent:Math.round(De[1]/Se*100)})).sort((De,$e)=>$e.amount-De.amount)});function te(de){return(de/100).toFixed(2)}function P(de){return(de.type==="income"?"+":"-")+te(de.amount)}function E(){t.value=na(t.value,-1)}function j(){t.value=na(t.value,1)}function ne(){t.value=ot()}pt(o,()=>{i.value&&(i.value="")});async function Me(de){await Bh(de.id),await I(),Fe("已标记为已报销")}function Ee(de){v.value=de.id,b.value={type:de.type,category:de.category,amountYuan:te(de.amount),date:de.date,note:de.note||"",reimbursable:de.reimbursable,reimbursed:de.reimbursed},f.value=!0}function ye(){v.value=null,b.value={type:"expense",category:Y.value[0]||"",amountYuan:"",date:ot(),note:"",reimbursable:0,reimbursed:0},f.value=!0}async function Ae(de){if(v.value){await Nh(v.value,de),f.value=!1,await I(),Fe("账目已更新");return}await Fh({type:de.type,category:de.category,amount:de.amount,date:de.date,note:de.note,reimbursable:de.reimbursable,reimbursed:de.reimbursed}),f.value=!1,await I(),Fe("已记一笔")}async function Ue(){y.value&&y.value.id&&await Vh(y.value.id),y.value=null,await I(),Fe("账目已删除")}return(de,ke)=>($(),O("div",V_,[l("div",B_,[l("button",{class:"icon-btn",onClick:E},[we(qe,{name:"chevron-left",size:16})]),l("span",U_,z(C.value),1),l("button",{class:"icon-btn",onClick:j},[we(qe,{name:"chevron-right",size:16})]),l("button",{class:"btn btn-sm",onClick:ne},"回到本月"),ke[7]||(ke[7]=l("span",{class:"flex1"},null,-1)),Oe(l("select",{class:"select w-filter","onUpdate:modelValue":ke[0]||(ke[0]=Se=>A.value=Se)},[...ke[4]||(ke[4]=[l("option",{value:"all"},"全部类型",-1),l("option",{value:"expense"},"仅支出",-1),l("option",{value:"income"},"仅收入",-1)])],512),[[ps,A.value]]),Oe(l("select",{class:"select w-filter","onUpdate:modelValue":ke[1]||(ke[1]=Se=>L.value=Se)},[...ke[5]||(ke[5]=[l("option",{value:"all"},"全部报销",-1),l("option",{value:"pending"},"待报销",-1),l("option",{value:"done"},"已报销",-1)])],512),[[ps,L.value]]),l("button",{class:"btn btn-primary btn-sm",onClick:ye},[we(qe,{name:"plus",size:14}),ke[6]||(ke[6]=ht(" 记一笔",-1))])]),l("div",q_,[l("div",H_,[ke[8]||(ke[8]=l("div",{class:"muted"},"本月收入(元)",-1)),l("div",z_,z(te(W.value.income)),1)]),l("div",W_,[ke[9]||(ke[9]=l("div",{class:"muted"},"本月支出(元)",-1)),l("div",G_,z(te(W.value.expense)),1)]),l("div",Y_,[ke[10]||(ke[10]=l("div",{class:"muted"},"本月结余(元)",-1)),l("div",{class:Xe(["stat-num num",{"amt-income":W.value.balance>=0,"amt-expense":W.value.balance<0}])},z(te(W.value.balance)),3)]),l("div",J_,[ke[11]||(ke[11]=l("div",{class:"muted"},"待报销(元)",-1)),l("div",X_,z(te(W.value.pending)),1)])]),G.value.length?($(),O("div",Q_,[ke[12]||(ke[12]=l("div",{class:"sec-title"},"本月支出分类",-1)),($(!0),O(je,null,et(G.value,Se=>($(),O("div",{key:Se.name,class:"bar-row"},[l("span",Z_,z(Se.name),1),l("span",e1,[l("span",{class:"bar-fill",style:qn({width:Se.percent+"%"})},null,4)]),l("span",t1,z(te(Se.amount))+" 元 · "+z(Se.percent)+"%",1)]))),128))])):he("",!0),c.value?($(),O("div",n1,[l("div",s1,z(c.value),1),ke[13]||(ke[13]=l("div",{class:"muted loc-note"},"请将上方完整错误文字发送给开发者",-1))])):he("",!0),l("div",r1,[l("table",o1,[ke[15]||(ke[15]=l("thead",null,[l("tr",null,[l("th",null,"日期"),l("th",null,"分类"),l("th",null,"金额(元)"),l("th",null,"备注"),l("th",null,"报销"),l("th",{class:"th-ops"},"操作")])],-1)),l("tbody",null,[($(!0),O(je,null,et(Z.value,Se=>($(),O("tr",{key:Se.id},[l("td",a1,z(Se.date),1),l("td",i1,[l("span",l1,z(Se.category),1)]),l("td",{class:Xe(["num",Se.type==="income"?"amt-income":"amt-expense"]),"data-label":"金额"},z(P(Se)),3),l("td",u1,z(Se.note||"--"),1),l("td",c1,[Se.type!=="expense"||Se.reimbursable!==1?($(),O("span",d1,"--")):Se.reimbursed===1?($(),O("span",f1,"已报销")):($(),O("span",p1,"待报销"))]),l("td",v1,[l("div",m1,[Se.type==="expense"&&Se.reimbursable===1&&Se.reimbursed!==1?($(),O("button",{key:0,class:"btn btn-xs",onClick:De=>Me(Se)},"标记已报销",8,h1)):he("",!0),l("button",{class:"btn btn-xs",onClick:De=>Ee(Se)},"编辑",8,y1),l("button",{class:"btn btn-xs",onClick:De=>y.value=Se},"删除",8,g1)])])]))),128)),!Z.value.length&&!r.value?($(),O("tr",b1,[...ke[14]||(ke[14]=[l("td",{colspan:"6",class:"empty muted"},"本月暂无账目",-1)])])):he("",!0)])])]),l("div",w1,"本月 "+z(n.value.length)+" 条 · 当前筛选 "+z(Z.value.length)+" 条",1),we(N_,{open:f.value,title:v.value?"编辑账目":"记一笔",initial:b.value,onCancel:ke[2]||(ke[2]=Se=>f.value=!1),onSave:Ae},null,8,["open","title","initial"]),we(Dn,{open:!!y.value,title:"删除确认",message:y.value?"将删除 "+y.value.date+" 的账目("+y.value.category+" "+te(y.value.amount)+" 元)。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:ke[3]||(ke[3]=Se=>y.value=null),onConfirm:Ue},null,8,["open","message"])]))}}),k1=Kt(_1,[["__scopeId","data-v-1d69492f"]]),x1={class:"memo-page"},C1={class:"card memo-list"},$1={class:"pane-head"},S1={class:"pane-title"},E1={class:"memo-scroll"},T1=["onClick"],A1={class:"memo-item-title"},P1={class:"muted memo-item-sub"},O1={class:"muted num memo-item-time"},M1={key:0,class:"muted empty"},I1={class:"card memo-editor"},j1={class:"editor-foot"},D1={class:"muted foot-info"},L1=["disabled"],K1=["disabled"],R1={key:1,class:"empty muted editor-empty"},F1=jt({__name:"MemoView",setup(e){const t=M([]),n=M(null),r=M(!1),o=M(""),i=M(""),c=M(null),f=M(null);async function v(){if(t.value=await Mh(),n.value&&n.value.id){const Z=t.value.find(G=>G.id===n.value.id);Z&&(n.value=Z)}}ln(async()=>{await v(),t.value.length&&_(t.value[0]),window.addEventListener("keydown",b)}),Ln(()=>window.removeEventListener("keydown",b)),pt(Bi,async Z=>{if(!Z)return;t.value.length||await v();const G=t.value.find(te=>te.id===Z);Bi.value=null,G&&S(G)},{immediate:!0});function b(Z){(Z.ctrlKey||Z.metaKey)&&Z.key.toLowerCase()==="s"&&r.value&&y.value&&(Z.preventDefault(),le())}const y=st(()=>{if(!r.value)return!1;const Z=n.value?n.value.title:"",G=n.value?n.value.content:"";return o.value!==Z||i.value!==G});function _(Z){n.value=Z,r.value=!0,o.value=Z.title,i.value=Z.content}function S(Z){if(!(r.value&&n.value&&n.value.id===Z.id)){if(y.value){f.value={type:"select",memo:Z};return}_(Z)}}function C(){if(y.value){f.value={type:"new"};return}I()}function I(){n.value=null,r.value=!0,o.value="",i.value=""}function Y(){n.value?_(n.value):I()}async function le(){if(!o.value.trim()&&!i.value.trim()){Fe("标题与内容不能都为空");return}if(n.value&&n.value.id)await jh(n.value.id,o.value,i.value),Fe("备忘已保存");else{const Z=await Ih(o.value,i.value);n.value=Z,o.value=Z.title,i.value=Z.content,Fe("备忘已创建")}await v()}function ce(){n.value&&n.value.id&&(c.value=n.value)}async function ue(){c.value&&c.value.id&&(await Dh(c.value.id),Fe("备忘已删除")),c.value=null,await v(),I()}function W(){const Z=f.value;f.value=null,Z&&(Z.type==="select"?_(Z.memo):I())}function A(Z){return(Z.content||"").replace(/\s+/g," ").slice(0,30)}function L(Z){return Z.replace("T"," ").slice(0,16)}return(Z,G)=>($(),O("div",x1,[l("aside",C1,[l("div",$1,[l("span",S1,"备忘录("+z(t.value.length)+")",1),l("button",{class:"btn btn-primary btn-sm",onClick:C},"新建")]),l("div",E1,[($(!0),O(je,null,et(t.value,te=>($(),O("div",{key:te.id,class:Xe(["memo-item",{active:r.value&&n.value&&n.value.id===te.id}]),onClick:P=>S(te)},[l("div",A1,z(te.title||"无标题"),1),l("div",P1,z(A(te)||"空"),1),l("div",O1,z(L(te.updated_at)),1)],10,T1))),128)),t.value.length?he("",!0):($(),O("div",M1,"暂无备忘"))])]),l("section",I1,[r.value?($(),O(je,{key:0},[Oe(l("input",{class:"input title-input","onUpdate:modelValue":G[0]||(G[0]=te=>o.value=te),placeholder:"标题"},null,512),[[Re,o.value]]),Oe(l("textarea",{class:"textarea content-textarea","onUpdate:modelValue":G[1]||(G[1]=te=>i.value=te),placeholder:"内容"},null,512),[[Re,i.value]]),l("div",j1,[l("span",D1,[y.value?($(),O(je,{key:0},[ht("有未保存修改")],64)):n.value&&n.value.id?($(),O(je,{key:1},[ht("更新于 "+z(L(n.value.updated_at)),1)],64)):($(),O(je,{key:2},[ht("新备忘")],64))]),G[4]||(G[4]=l("span",{class:"flex1"},null,-1)),n.value&&n.value.id?($(),O("button",{key:0,class:"btn btn-sm",onClick:ce},"删除")):he("",!0),l("button",{class:"btn btn-sm",disabled:!y.value,onClick:Y},"放弃修改",8,L1),l("button",{class:"btn btn-primary btn-sm",disabled:!y.value,onClick:le},"保存",8,K1)])],64)):($(),O("div",R1,"选择左侧备忘,或点击右上角新建"))]),we(Dn,{open:!!c.value,title:"删除确认",message:c.value?"将删除备忘「"+(c.value.title||"无标题")+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:G[2]||(G[2]=te=>c.value=null),onConfirm:ue},null,8,["open","message"]),we(Dn,{open:!!f.value,title:"未保存提示",message:"当前备忘有未保存的修改,继续操作将丢失这些修改。","confirm-text":"放弃修改并继续",onCancel:G[3]||(G[3]=te=>f.value=null),onConfirm:W},null,8,["open"])]))}}),N1=Kt(F1,[["__scopeId","data-v-123c0b8c"]]),V1=["aria-label"],B1={class:"dialog-head"},U1={class:"dialog-title"},q1={class:"dialog-body"},H1={class:"form-grid"},z1={class:"field span2"},W1={class:"field span2"},G1={class:"field span2"},Y1={class:"pwd-row"},J1={class:"field span2"},X1={key:0,class:"form-error"},Q1={class:"dialog-btns"},Z1=jt({__name:"CredentialDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,r=t,o=M(""),i=M(""),c=M(""),f=M(""),v=M(""),b=M(null);function y(C){n.open&&C.key==="Escape"&&r("cancel")}pt(()=>n.open,async C=>{var I;C?(o.value=n.initial.system,i.value=n.initial.account,c.value=n.initial.password,f.value=n.initial.remark,v.value="",window.addEventListener("keydown",y),await lr(),(I=b.value)==null||I.focus()):window.removeEventListener("keydown",y)}),Ln(()=>window.removeEventListener("keydown",y));function _(){const C="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789",I="!@#$%^&*",Y=crypto.getRandomValues(new Uint8Array(14));let le="";for(let ce=0;ce<Y.length;ce++)le+=C[Y[ce]%C.length];le+=I[crypto.getRandomValues(new Uint8Array(1))[0]%I.length],c.value=le,v.value=""}function S(){if(!o.value.trim()||!i.value.trim()||!c.value){v.value="系统名称、账号、密码为必填项";return}r("save",{system:o.value.trim(),account:i.value.trim(),password:c.value,remark:f.value.trim()})}return(C,I)=>($(),wt(zn,{to:"body"},[we(Rs,{name:"modal"},{default:Wn(()=>[e.open?($(),O("div",{key:0,class:"mask",onClick:I[6]||(I[6]=Nt(Y=>r("cancel"),["self"]))},[l("div",{class:"dialog",role:"dialog","aria-label":e.title},[l("div",B1,[l("span",U1,z(e.title),1),l("button",{class:"icon-btn",title:"关闭",onClick:I[0]||(I[0]=Y=>r("cancel"))},[we(qe,{name:"close",size:16})])]),l("div",q1,[l("div",H1,[l("div",z1,[I[7]||(I[7]=l("label",null,"系统名称(必填)",-1)),Oe(l("input",{ref_key:"systemInput",ref:b,class:"input","onUpdate:modelValue":I[1]||(I[1]=Y=>o.value=Y),placeholder:"如:企业邮箱 / OA / VPN"},null,512),[[Re,o.value]])]),l("div",W1,[I[8]||(I[8]=l("label",null,"账号(必填)",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":I[2]||(I[2]=Y=>i.value=Y),placeholder:"用户名、工号或邮箱"},null,512),[[Re,i.value]])]),l("div",G1,[I[9]||(I[9]=l("label",null,"密码(必填)",-1)),l("div",Y1,[Oe(l("input",{class:"input","onUpdate:modelValue":I[3]||(I[3]=Y=>c.value=Y),placeholder:"输入或点击生成"},null,512),[[Re,c.value]]),l("button",{class:"btn btn-sm",onClick:_},"生成")])]),l("div",J1,[I[10]||(I[10]=l("label",null,"备注",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":I[4]||(I[4]=Y=>f.value=Y),placeholder:"用途、到期时间、负责人等(选填)"},null,512),[[Re,f.value]])])]),v.value?($(),O("div",X1,z(v.value),1)):he("",!0)]),l("div",Q1,[l("button",{class:"btn btn-sm",onClick:I[5]||(I[5]=Y=>r("cancel"))},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:S},"保存")])],8,V1)])):he("",!0)]),_:1})]))}}),e0=Kt(Z1,[["__scopeId","data-v-2eafe20e"]]),t0={class:"vault-page"},n0={key:0,class:"empty muted"},s0={key:1,class:"card lock-card"},r0={class:"lock-badge"},o0={key:0,class:"form-error"},a0=["disabled"],i0={key:0,class:"form-error"},l0=["disabled"],u0={class:"vault-toolbar"},c0={class:"search-wrap"},d0={class:"card table-card"},f0={class:"cred-table"},p0={class:"td-system"},v0=["onClick"],m0={class:"pwd-cell"},h0={class:"num pwd-text"},y0=["onClick"],g0=["onClick"],b0={class:"td-remark"},w0={class:"td-ops"},_0={class:"ops"},k0=["onClick"],x0=["onClick"],C0={key:0},$0={class:"muted table-note num"},S0={class:"dialog pwd-dialog"},E0={class:"dialog-head"},T0={class:"dialog-body"},A0={class:"vp-field"},P0={class:"vp-field"},O0={class:"vp-field"},M0={key:0,class:"form-error"},I0={class:"dialog-btns"},j0=5*60*1e3,D0=jt({__name:"VaultView",setup(e){const t=M(null),n=M(fm()),r=M(!1),o=M(""),i=M(""),c=M(""),f=M(""),v=M(""),b=M([]),y=M(""),_=M({}),S=M(!1),C=M(null),I=M({system:"",account:"",password:"",remark:""}),Y=M(null),le=M(!1),ce=M(""),ue=M(""),W=M(""),A=M("");async function L(){b.value=await ym(),_.value={}}let Z=null;function G(){Z!==null&&window.clearTimeout(Z),Z=window.setTimeout(()=>{n.value&&(oa(),n.value=!1,b.value=[],_.value={},Fe("长时间未操作,密码库已自动锁定"))},j0)}function te(){n.value&&G()}ln(async()=>{t.value=await dd(),window.addEventListener("click",te),window.addEventListener("keydown",te),n.value&&G()}),Ln(()=>{window.removeEventListener("click",te),window.removeEventListener("keydown",te),Z!==null&&window.clearTimeout(Z)});const P=st(()=>{const $e=y.value.trim().toLowerCase();return $e?b.value.filter(fe=>(fe.system+" "+fe.account+" "+(fe.remark||"")).toLowerCase().includes($e)):b.value});async function E(){if(!r.value){if(c.value="",!o.value){c.value="请输入主密码";return}if(o.value.length<6){c.value="主密码至少 6 位";return}if(o.value!==i.value){c.value="两次输入的主密码不一致";return}r.value=!0;try{await pm(o.value),o.value="",i.value="",n.value=!0,G(),await L(),Fe("主密码已设置,密码库已解锁")}catch($e){c.value=$e instanceof Error?$e.message:"设置失败"}r.value=!1}}async function j(){if(!r.value){if(v.value="",!f.value){v.value="请输入主密码";return}r.value=!0;try{await vm(f.value),f.value="",n.value=!0,G(),await L()}catch($e){v.value=$e instanceof Error?$e.message:"解锁失败"}r.value=!1}}function ne(){oa(),n.value=!1,b.value=[],_.value={},Z!==null&&window.clearTimeout(Z),Fe("密码库已锁定")}async function Me($e){const fe=$e.id;if(_.value[fe]){_.value[fe]=!1;return}try{$e.passwordPlain=await gi(fe),_.value[fe]=!0}catch(Ie){Fe(Ie instanceof Error?Ie.message:"解密失败")}}async function Ee($e){try{const fe=await gi($e.id);await Wi(fe),Fe("密码已复制")}catch(fe){Fe(fe instanceof Error?fe.message:"复制失败")}}async function ye($e){await Wi($e.account),Fe("账号已复制")}function Ae(){C.value=null,I.value={system:"",account:"",password:"",remark:""},S.value=!0}async function Ue($e){try{const fe=await gi($e.id);C.value=$e.id,I.value={system:$e.system,account:$e.account,password:fe,remark:$e.remark||""},S.value=!0}catch(fe){Fe(fe instanceof Error?fe.message:"解密失败")}}async function de($e){const fe=C.value??void 0;await gm($e,fe),S.value=!1,await L(),Fe(fe?"账号已更新":"账号已添加")}async function ke(){Y.value&&Y.value.id&&(await bm(Y.value.id),Fe("账号已删除")),Y.value=null,await L()}function Se(){ce.value="",ue.value="",W.value="",A.value="",le.value=!0}async function De(){A.value="";try{const $e=await wm(ce.value,ue.value);le.value=!1,ce.value="",ue.value="",W.value="",Fe("主密码已修改,"+$e+" 条账号密码已重新加密")}catch($e){A.value=$e instanceof Error?$e.message:"修改失败"}}return($e,fe)=>($(),O("div",t0,[t.value===null?($(),O("div",n0,"加载中")):n.value?($(),O(je,{key:2},[l("div",u0,[l("div",c0,[we(qe,{name:"search",size:14,class:"search-icon"}),Oe(l("input",{class:"input","onUpdate:modelValue":fe[3]||(fe[3]=Ie=>y.value=Ie),placeholder:"搜索系统名称、账号或备注"},null,512),[[Re,y.value]])]),fe[16]||(fe[16]=l("span",{class:"flex1"},null,-1)),l("button",{class:"btn btn-sm",onClick:Se},"修改主密码"),l("button",{class:"btn btn-sm",onClick:ne},"锁定"),l("button",{class:"btn btn-primary btn-sm",onClick:Ae},"新增账号")]),l("div",d0,[l("table",f0,[fe[18]||(fe[18]=l("thead",null,[l("tr",null,[l("th",null,"系统名称"),l("th",null,"账号"),l("th",null,"密码"),l("th",null,"备注"),l("th",{class:"th-ops"},"操作")])],-1)),l("tbody",null,[($(!0),O(je,null,et(P.value,Ie=>($(),O("tr",{key:Ie.id},[l("td",p0,z(Ie.system),1),l("td",null,[l("span",{class:"copyable",title:"点击复制账号",onClick:ct=>ye(Ie)},z(Ie.account),9,v0)]),l("td",null,[l("div",m0,[l("span",h0,z(_.value[Ie.id]?Ie.passwordPlain:"........"),1),l("button",{class:"btn btn-xs",onClick:ct=>Me(Ie)},z(_.value[Ie.id]?"隐藏":"显示"),9,y0),l("button",{class:"btn btn-xs",onClick:ct=>Ee(Ie)},"复制",8,g0)])]),l("td",b0,z(Ie.remark||"--"),1),l("td",w0,[l("div",_0,[l("button",{class:"btn btn-xs",onClick:ct=>Ue(Ie)},"编辑",8,k0),l("button",{class:"btn btn-xs",onClick:ct=>Y.value=Ie},"删除",8,x0)])])]))),128)),P.value.length?he("",!0):($(),O("tr",C0,[...fe[17]||(fe[17]=[l("td",{colspan:"5",class:"empty muted"},"暂无账号,点击右上角新增",-1)])]))])])]),l("div",$0,"共 "+z(b.value.length)+" 条账号记录 · 密码以 AES-256-GCM 加密,服务器仅存密文",1)],64)):($(),O("div",s0,[l("div",r0,[we(qe,{name:"lock",size:26})]),t.value===!1?($(),O(je,{key:0},[fe[12]||(fe[12]=l("div",{class:"lock-title"},"设置主密码",-1)),fe[13]||(fe[13]=l("div",{class:"muted lock-tip"},"主密码用于加密保存在本机的账号密码,遗忘后无法找回,请务必牢记",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":fe[0]||(fe[0]=Ie=>o.value=Ie),placeholder:"设置主密码(至少 6 位)",onKeydown:Mt(E,["enter"])},null,544),[[Re,o.value]]),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":fe[1]||(fe[1]=Ie=>i.value=Ie),placeholder:"再次输入主密码",onKeydown:Mt(E,["enter"])},null,544),[[Re,i.value]]),c.value?($(),O("div",o0,z(c.value),1)):he("",!0),l("button",{class:"btn btn-primary lock-btn",disabled:r.value,onClick:E},"完成设置并解锁",8,a0)],64)):($(),O(je,{key:1},[fe[14]||(fe[14]=l("div",{class:"lock-title"},"密码库已锁定",-1)),fe[15]||(fe[15]=l("div",{class:"muted lock-tip"},"输入主密码解锁后查看与复制密码",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":fe[2]||(fe[2]=Ie=>f.value=Ie),placeholder:"主密码",onKeydown:Mt(j,["enter"])},null,544),[[Re,f.value]]),v.value?($(),O("div",i0,z(v.value),1)):he("",!0),l("button",{class:"btn btn-primary lock-btn",disabled:r.value,onClick:j},"解锁",8,l0)],64))])),we(e0,{open:S.value,title:C.value?"编辑账号":"新增账号",initial:I.value,onCancel:fe[4]||(fe[4]=Ie=>S.value=!1),onSave:de},null,8,["open","title","initial"]),we(Dn,{open:!!Y.value,title:"删除确认",message:Y.value?"将删除系统「"+Y.value.system+"」的账号记录。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:fe[5]||(fe[5]=Ie=>Y.value=null),onConfirm:ke},null,8,["open","message"]),($(),wt(zn,{to:"body"},[we(Rs,{name:"modal"},{default:Wn(()=>[le.value?($(),O("div",{key:0,class:"mask",onClick:fe[11]||(fe[11]=Nt(Ie=>le.value=!1,["self"]))},[l("div",S0,[l("div",E0,[fe[19]||(fe[19]=l("span",{class:"dialog-title"},"修改主密码",-1)),l("button",{class:"icon-btn",title:"关闭",onClick:fe[6]||(fe[6]=Ie=>le.value=!1)},[we(qe,{name:"close",size:16})])]),l("div",T0,[l("div",A0,[fe[20]||(fe[20]=l("label",null,"旧主密码",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":fe[7]||(fe[7]=Ie=>ce.value=Ie)},null,512),[[Re,ce.value]])]),l("div",P0,[fe[21]||(fe[21]=l("label",null,"新主密码(至少 6 位)",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":fe[8]||(fe[8]=Ie=>ue.value=Ie)},null,512),[[Re,ue.value]])]),l("div",O0,[fe[22]||(fe[22]=l("label",null,"确认新主密码",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":fe[9]||(fe[9]=Ie=>W.value=Ie)},null,512),[[Re,W.value]])]),A.value?($(),O("div",M0,z(A.value),1)):he("",!0),fe[23]||(fe[23]=l("div",{class:"muted vp-tip"},"确认后所有账号密码将使用新主密码重新加密",-1))]),l("div",I0,[l("button",{class:"btn btn-sm",onClick:fe[10]||(fe[10]=Ie=>le.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:De},"确认修改")])])])):he("",!0)]),_:1})]))]))}}),L0=Kt(D0,[["__scopeId","data-v-a96af9e5"]]);function K0(e){return'"'+(e==null?"":String(e)).replace(/"/g,'""')+'"'}async function Uu(e,t){const r="\uFEFF"+t.map(f=>f.map(K0).join(",")).join(`\r
`);if(ir.isNativePlatform()){const{downloadText:f}=await Id(async()=>{const{downloadText:v}=await Promise.resolve().then(()=>Vg);return{downloadText:v}},void 0,import.meta.url);return f(e,r)}const o=new Blob([r],{type:"text/csv;charset=utf-8"}),i=URL.createObjectURL(o),c=document.createElement("a");return c.href=i,c.download=e,c.click(),window.setTimeout(()=>URL.revokeObjectURL(i),1e4),""}const R0={class:"settings"},F0={class:"card section"},N0={class:"muted acc-line"},V0={class:"ai-grid"},B0={class:"rule-item"},U0={class:"rule-item"},q0={class:"rule-item"},H0={key:0,class:"form-error"},z0={class:"rule-save"},W0={class:"card section"},G0={class:"rule-grid"},Y0={class:"rule-item"},J0={class:"rule-item"},X0={class:"rule-item"},Q0={class:"rule-item"},Z0={class:"rule-item"},ek={class:"card section"},tk={class:"proj-add"},nk={key:0,class:"muted proj-tip"},sk=["onKeydown"],rk=["onClick"],ok=["onClick"],ak=["onClick"],ik={key:1,class:"muted"},lk={class:"card section"},uk={class:"card section"},ck={class:"muted acc-line"},dk={class:"rule-save"},fk=["disabled"],pk={key:0,class:"muted acc-line"},vk={key:1,class:"form-error"},mk={key:2,class:"form-error"},hk={class:"card section"},yk={class:"ai-grid"},gk={class:"rule-item"},bk={class:"rule-item"},wk={class:"rule-item"},_k={class:"card section"},kk={class:"cat-block"},xk={class:"cat-head"},Ck={class:"cat-chips"},$k=["onClick"],Sk=["onClick"],Ek={class:"cat-block"},Tk={class:"cat-head"},Ak={class:"cat-chips"},Pk=["onClick"],Ok=["onClick"],Mk={class:"cat-block"},Ik={class:"cat-head"},jk={class:"cat-chips"},Dk=["onClick"],Lk=["onClick"],Kk={class:"card section"},Rk={class:"backup-row"},Fk={key:0,class:"import-error"},Nk=jt({__name:"SettingsView",setup(e){var H;const t=M({work_start:"09:00",work_end:"18:00",grace_minutes:10,lunch_minutes:60,remind_weekly:"friday"}),n=M([]),r=M(""),o=M(""),i=M(""),c=M(""),f=M(""),v=M(""),b=M(null),y=M(""),_=M([]),S=M([]),C=M([]);async function I(){_.value=await Zr(),S.value=await Wr("expense"),C.value=await Wr("income")}async function Y(ee){const T=window.prompt("新分类名称");if(!T||!T.trim())return;const X=ee==="log"?_.value:ee==="expense"?S.value:C.value,se=T.trim();if(X.includes(se)){Fe("分类已存在");return}const Ce=[...X,se];ee==="log"?(_.value=Ce,await wi(Ce)):ee==="expense"?(S.value=Ce,await Ts("expense",Ce)):(C.value=Ce,await Ts("income",Ce)),Fe("分类已添加")}async function le(ee,T,X){const se=window.prompt("修改分类名称",X);if(!se||!se.trim()||se.trim()===X)return;const be=(ee==="log"?_.value:ee==="expense"?S.value:C.value).map((Le,Te)=>Te===T?se.trim():Le);ee==="log"?(_.value=be,await wi(be)):ee==="expense"?(S.value=be,await Ts("expense",be)):(C.value=be,await Ts("income",be)),Fe("分类已更新(历史记录自动跟随显示)")}async function ce(ee,T){const X=ee==="log"?_.value:ee==="expense"?S.value:C.value;if(X.length<=1){Fe("至少保留一个分类");return}if(!window.confirm("删除分类「"+X[T]+"」?历史记录不受影响。"))return;const se=X.filter((Ce,be)=>be!==T);ee==="log"?(_.value=se,await wi(se)):ee==="expense"?(S.value=se,await Ts("expense",se)):(C.value=se,await Ts("income",se)),Fe("分类已删除")}const ue=M(null),W=M(null),A=M(""),L=M(((H=Hr())==null?void 0:H.username)||""),Z=M(""),G=M(""),te=M(""),P=M(""),E=M(!1),j="0.6.1",ne=M(""),Me=M(""),Ee=M(""),ye=M(""),Ae=M(!1),Ue=M("");async function de(){var ee;ne.value=((ee=pn())==null?void 0:ee.username)||"",Ue.value=await Bm(),ye.value=er.value}pt(er,ee=>{ye.value=ee});async function ke(){Ee.value="";try{await bd(),Fe("云端绑定已重建")}catch(ee){Ee.value=ee instanceof Error?ee.message:"绑定失败"}}async function Se(){if(!Ae.value){Ee.value="",ye.value=er.value,Ae.value=!0;try{const ee=await Ui();Ue.value=ee.at,Me.value="推送 "+ee.pushed+" 条 · 拉取 "+ee.pulled+" 条 · 删除 "+ee.removed+" 条",ye.value="",Fe("同步完成")}catch(ee){Ee.value=ee instanceof Error?ee.message:"同步失败"}Ae.value=!1}}async function De(){if(P.value="",G.value!==te.value){P.value="两次输入的新密码不一致";return}try{await Dm(Z.value,G.value),Z.value="",G.value="",te.value="",Fe("登录密码已修改")}catch(ee){P.value=ee instanceof Error?ee.message:"修改失败"}}async function $e(){await Lm(),window.location.reload()}async function fe(){t.value=await vs(),n.value=await or(!0),i.value=(await hl()).join(`
`),c.value=await Ct("ai_base_url",""),f.value=await Ct("ai_api_key",""),v.value=await Ct("ai_model",""),await de(),await I()}async function Ie(){await It("ai_base_url",c.value.trim()),await It("ai_api_key",f.value.trim()),await It("ai_model",v.value.trim()),Fe("AI 配置已保存")}async function ct(){const ee=ot(),T=await Promise.all([Qr("2000-01-01",ee),or(!0)]),X=T[0],se=T[1],Ce=new Map(se.map(Te=>[Te.id,Te.name])),be=[["日期","分类","项目","内容","耗时(分钟)","成果","待跟进","收获","备注"]];for(const Te of X)be.push([Te.date,Ur(Te.category),Te.project_id&&Ce.get(Te.project_id)||"",Te.content,Te.minutes==null?"":Te.minutes,Te.is_milestone?"是":"",Te.needs_followup?"是":"",Te.takeaway||"",Te.remark||""]);const Le=await Uu("工作记录_"+ee.replace(/-/g,"")+".csv",be);Fe(Le?"CSV 已导出到:"+Le:"CSV 已导出到系统下载目录")}async function bt(){const ee=ot(),T=await Promise.all([vs(),Xr("2000-01-01",ee)]),X=T[0],se=T[1],Ce=["周日","周一","周二","周三","周四","周五","周六"],be=[["日期","星期","状态","上班时间","下班时间","地点","类型","说明"]];for(const Te of se){const Qe=cr(Te,Te.date,X,Te.date===ee);be.push([Te.date,Ce[Fs(Te.date).getDay()],Qe.label,Te.clock_in_at?wn(Te.clock_in_at):"",Te.clock_out_at?wn(Te.clock_out_at):"",Te.location||"",Te.kind==="makeup"?"补卡":Te.kind==="leave"?"休假":"正常",Te.note||""])}const Le=await Uu("考勤记录_"+ee.replace(/-/g,"")+".csv",be);Fe(Le?"CSV 已导出到:"+Le:"CSV 已导出到系统下载目录")}ln(fe);async function _t(){await It("work_start",t.value.work_start),await It("work_end",t.value.work_end),await It("grace_minutes",String(t.value.grace_minutes)),await It("lunch_minutes",String(t.value.lunch_minutes)),await It("remind_weekly",t.value.remind_weekly),Fe("打卡规则已保存")}async function Bt(){await Sd(i.value.split(`
`)),Fe("常用地点已保存")}async function vt(){const ee=r.value.trim();if(ee){try{await sh(ee),o.value="",r.value=""}catch{o.value="项目名已存在"}await fe()}}function Ne(ee){b.value=ee.id,y.value=ee.name}async function g(ee){const T=y.value.trim();if(T)try{await rh(ee.id,T),o.value=""}catch{o.value="项目名已存在"}b.value=null,await fe()}async function m(ee){await oh(ee.id,ee.archived!==1),await fe()}async function x(){try{const ee=await Uh(),T=await Ea("实习日志备份_"+ot().replace(/-/g,"")+".json",ee);Fe(T?"备份已导出到:"+T:"备份已导出到系统下载目录")}catch(ee){Fe("导出失败:"+(ee instanceof Error?ee.message:String(ee)))}}function D(ee){const T=ee.target,X=T.files&&T.files[0];if(A.value="",!X)return;const se=X.name;X.text().then(Ce=>{W.value={name:se,text:Ce}}),T.value=""}async function ae(){if(W.value)try{await qh(W.value.text),W.value=null,A.value="",await fe(),Fe("数据导入完成")}catch(ee){W.value=null,A.value=ee instanceof Error?ee.message:"导入失败"}}return(ee,T)=>($(),O("div",R0,[l("div",F0,[T[25]||(T[25]=l("div",{class:"section-title"},"账号与隐私",-1)),l("div",N0,"v"+z(on(j))+" · 当前账号 "+z(L.value)+" · 登录密码仅存 PBKDF2 哈希",1),l("div",V0,[l("div",B0,[T[22]||(T[22]=l("label",null,"旧登录密码",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":T[0]||(T[0]=X=>Z.value=X)},null,512),[[Re,Z.value]])]),l("div",U0,[T[23]||(T[23]=l("label",null,"新登录密码(至少 6 位)",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":T[1]||(T[1]=X=>G.value=X)},null,512),[[Re,G.value]])]),l("div",q0,[T[24]||(T[24]=l("label",null,"确认新登录密码",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":T[2]||(T[2]=X=>te.value=X)},null,512),[[Re,te.value]])])]),P.value?($(),O("div",H0,z(P.value),1)):he("",!0),l("div",z0,[l("button",{class:"btn btn-primary btn-sm",onClick:De},"修改登录密码"),l("button",{class:"btn btn-sm btn-danger",onClick:T[3]||(T[3]=X=>E.value=!0)},"删除此用户及全部数据")])]),l("div",W0,[T[32]||(T[32]=l("div",{class:"section-title"},"打卡规则",-1)),l("div",G0,[l("div",Y0,[T[26]||(T[26]=l("label",null,"上班时间",-1)),Oe(l("input",{type:"time",class:"input","onUpdate:modelValue":T[4]||(T[4]=X=>t.value.work_start=X)},null,512),[[Re,t.value.work_start]])]),l("div",J0,[T[27]||(T[27]=l("label",null,"下班时间",-1)),Oe(l("input",{type:"time",class:"input","onUpdate:modelValue":T[5]||(T[5]=X=>t.value.work_end=X)},null,512),[[Re,t.value.work_end]])]),l("div",X0,[T[28]||(T[28]=l("label",null,"迟到宽限(分钟)",-1)),Oe(l("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":T[6]||(T[6]=X=>t.value.grace_minutes=X)},null,512),[[Re,t.value.grace_minutes,void 0,{number:!0}]])]),l("div",Q0,[T[29]||(T[29]=l("label",null,"午休扣除(分钟)",-1)),Oe(l("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":T[7]||(T[7]=X=>t.value.lunch_minutes=X)},null,512),[[Re,t.value.lunch_minutes,void 0,{number:!0}]])]),l("div",Z0,[T[31]||(T[31]=l("label",null,"周记提醒",-1)),Oe(l("select",{class:"select","onUpdate:modelValue":T[8]||(T[8]=X=>t.value.remind_weekly=X)},[...T[30]||(T[30]=[l("option",{value:"friday"},"每周五提醒",-1),l("option",{value:"off"},"关闭",-1)])],512),[[ps,t.value.remind_weekly]])])]),l("div",{class:"rule-save"},[l("button",{class:"btn btn-primary btn-sm",onClick:_t},"保存规则")])]),l("div",ek,[T[33]||(T[33]=l("div",{class:"section-title"},"项目管理",-1)),l("div",tk,[Oe(l("input",{class:"input","onUpdate:modelValue":T[9]||(T[9]=X=>r.value=X),placeholder:"新项目名称",onKeydown:Mt(vt,["enter"])},null,544),[[Re,r.value]]),l("button",{class:"btn btn-sm",onClick:vt},"添加")]),o.value?($(),O("div",nk,z(o.value),1)):he("",!0),($(!0),O(je,null,et(n.value,X=>($(),O("div",{key:X.id,class:"proj-row"},[b.value===X.id?($(),O(je,{key:0},[Oe(l("input",{class:"input","onUpdate:modelValue":T[10]||(T[10]=se=>y.value=se),onKeydown:Mt(se=>g(X),["enter"])},null,40,sk),[[Re,y.value]]),l("button",{class:"btn btn-sm",onClick:se=>g(X)},"保存",8,rk),l("button",{class:"btn btn-sm",onClick:T[11]||(T[11]=se=>b.value=null)},"取消")],64)):($(),O(je,{key:1},[l("span",{class:Xe(["proj-name",{archived:X.archived===1}])},z(X.name),3),l("button",{class:"icon-btn",title:"重命名",onClick:se=>Ne(X)},[we(qe,{name:"edit",size:14})],8,ok),l("button",{class:"btn btn-sm",onClick:se=>m(X)},z(X.archived===1?"恢复":"归档"),9,ak)],64))]))),128)),n.value.length?he("",!0):($(),O("div",ik,"暂无项目,先添加一个"))]),l("div",lk,[T[35]||(T[35]=l("div",{class:"section-title"},"常用地点",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":T[12]||(T[12]=X=>i.value=X),placeholder:"每行一个地点,如:公司、客户现场、出差、居家办公"},null,512),[[Re,i.value]]),l("div",{class:"rule-save"},[l("button",{class:"btn btn-primary btn-sm",onClick:Bt},"保存地点"),T[34]||(T[34]=l("span",{class:"muted loc-note"},"打卡时可直接输入新地点,保存后自动加入列表",-1))])]),l("div",uk,[T[36]||(T[36]=l("div",{class:"section-title"},"多端数据同步",-1)),l("div",ck,"云端账号:"+z(ne.value||"未绑定")+" · 数据存于服务器,其他端变更秒级自动刷新",1),l("div",dk,[l("button",{class:"btn btn-primary btn-sm",disabled:Ae.value,onClick:Se},z(Ae.value?"同步中":"立即同步"),9,fk),l("button",{class:"btn btn-sm",onClick:ke},"重新校验连接")]),Me.value?($(),O("div",pk,"上次同步:"+z(Ue.value||"--")+" · "+z(Me.value),1)):he("",!0),Ee.value?($(),O("div",vk,z(Ee.value),1)):he("",!0),ye.value?($(),O("div",mk,"最近自动同步失败:"+z(ye.value)+"(可点「立即同步」重试)",1)):he("",!0)]),l("div",hk,[T[41]||(T[41]=l("div",{class:"section-title"},"AI 润色配置(可选)",-1)),l("div",yk,[l("div",gk,[T[37]||(T[37]=l("label",null,"接口地址(OpenAI 兼容,到 /v1 为止)",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":T[13]||(T[13]=X=>c.value=X),placeholder:"https://api.example.com/v1"},null,512),[[Re,c.value]])]),l("div",bk,[T[38]||(T[38]=l("label",null,"API Key",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":T[14]||(T[14]=X=>f.value=X),placeholder:"sk-..."},null,512),[[Re,f.value]])]),l("div",wk,[T[39]||(T[39]=l("label",null,"模型名称",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":T[15]||(T[15]=X=>v.value=X),placeholder:"如:deepseek-chat"},null,512),[[Re,v.value]])])]),l("div",{class:"rule-save"},[l("button",{class:"btn btn-primary btn-sm",onClick:Ie},"保存 AI 配置"),T[40]||(T[40]=l("span",{class:"muted loc-note"},"配置仅保存在本机;总结页「AI 润色」需此处先配置",-1))])]),l("div",_k,[T[45]||(T[45]=l("div",{class:"section-title"},"工作分类",-1)),l("div",kk,[l("div",xk,[T[42]||(T[42]=l("span",{class:"muted"},"工作记录分类",-1)),l("button",{class:"btn btn-xs",onClick:T[16]||(T[16]=X=>Y("log"))},"添加")]),l("div",Ck,[($(!0),O(je,null,et(_.value,(X,se)=>($(),O("span",{key:X+se,class:"cat-chip"},[ht(z(X)+" ",1),l("button",{class:"chip-btn",title:"修改",onClick:Ce=>le("log",se,X)},"改",8,$k),l("button",{class:"chip-btn",title:"删除",onClick:Ce=>ce("log",se)},"删",8,Sk)]))),128))])]),l("div",Ek,[l("div",Tk,[T[43]||(T[43]=l("span",{class:"muted"},"记账支出分类",-1)),l("button",{class:"btn btn-xs",onClick:T[17]||(T[17]=X=>Y("expense"))},"添加")]),l("div",Ak,[($(!0),O(je,null,et(S.value,(X,se)=>($(),O("span",{key:X+se,class:"cat-chip"},[ht(z(X)+" ",1),l("button",{class:"chip-btn",title:"修改",onClick:Ce=>le("expense",se,X)},"改",8,Pk),l("button",{class:"chip-btn",title:"删除",onClick:Ce=>ce("expense",se)},"删",8,Ok)]))),128))])]),l("div",Mk,[l("div",Ik,[T[44]||(T[44]=l("span",{class:"muted"},"记账收入分类",-1)),l("button",{class:"btn btn-xs",onClick:T[18]||(T[18]=X=>Y("income"))},"添加")]),l("div",jk,[($(!0),O(je,null,et(C.value,(X,se)=>($(),O("span",{key:X+se,class:"cat-chip"},[ht(z(X)+" ",1),l("button",{class:"chip-btn",title:"修改",onClick:Ce=>le("income",se,X)},"改",8,Dk),l("button",{class:"chip-btn",title:"删除",onClick:Ce=>ce("income",se)},"删",8,Lk)]))),128))])])]),l("div",Kk,[T[46]||(T[46]=l("div",{class:"section-title"},"数据备份",-1)),l("div",Rk,[l("button",{class:"btn btn-sm",onClick:x},"导出 JSON 备份"),l("button",{class:"btn btn-sm",onClick:T[19]||(T[19]=X=>{var se;return(se=ue.value)==null?void 0:se.click()})},"导入 JSON 备份"),l("button",{class:"btn btn-sm",onClick:ct},"导出工作记录 CSV"),l("button",{class:"btn btn-sm",onClick:bt},"导出考勤 CSV"),l("input",{ref_key:"fileInput",ref:ue,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:D},null,544)]),A.value?($(),O("div",Fk,z(A.value),1)):he("",!0),T[47]||(T[47]=l("div",{class:"muted backup-note"},"数据保存在云端服务器;导出的 JSON 备份用于跨设备迁移或灾后恢复。",-1))]),we(Dn,{open:!!W.value,title:"导入确认",message:W.value?"将从文件「"+W.value.name+"」导入备份。现有全部数据将被覆盖,且不可恢复,请先确认已导出当前备份。":"","confirm-text":"覆盖导入",danger:"",onCancel:T[20]||(T[20]=X=>W.value=null),onConfirm:ae},null,8,["open","message"]),we(Dn,{open:E.value,title:"删除用户确认",message:"将永久删除云端账号「"+L.value+"」及其服务器上的全部数据:工作日志、考勤、备忘录、账号密码库都将被清除,任何设备都无法再取回,且不可恢复。请确认。","confirm-text":"永久删除",danger:"",onCancel:T[21]||(T[21]=X=>E.value=!1),onConfirm:$e},null,8,["open","message"])]))}}),Vk=Kt(Nk,[["__scopeId","data-v-aad752b5"]]),Bk={class:"tp-main"},Uk={class:"tp-title"},qk={class:"tp-meta"},Hk={class:"tp-time num"},zk=jt({__name:"TimerPanel",setup(e){const t=M(null),n=M(Date.now());let r=null,o=null;async function i(){try{t.value=await bh()}catch{}}const c=st(()=>{const y=t.value;if(!y||!y.timer_started_at)return 0;const _=(y.actual_minutes||0)*60,S=Math.max(0,Math.floor((n.value-new Date(y.timer_started_at).getTime())/1e3));return _+S}),f=st(()=>{const y=c.value,_=Math.floor(y/3600),S=Math.floor(y%3600/60),C=y%60,I=Y=>String(Y).padStart(2,"0");return _>0?_+":"+I(S)+":"+I(C):S+":"+I(C)});async function v(){const y=t.value;y&&(await Sa(y.id),Fe("已停止计时:"+y.title),await i())}function b(){location.hash="#/plan"}return pt(yd,()=>{i()}),ln(()=>{i(),r=window.setInterval(()=>{i()},15e3),o=window.setInterval(()=>{n.value=Date.now()},1e3),window.addEventListener("focus",i)}),Ln(()=>{r!==null&&window.clearInterval(r),o!==null&&window.clearInterval(o),window.removeEventListener("focus",i)}),(y,_)=>($(),wt(Rs,{name:"tp"},{default:Wn(()=>[t.value&&t.value.timer_started_at?($(),O("div",{key:0,class:"tp",onClick:b,title:"点击查看计划页"},[_[0]||(_[0]=l("span",{class:"tp-pulse"},null,-1)),l("span",Bk,[l("span",Uk,z(t.value.title),1),l("span",qk,z(t.value.kind)+" · 计时中",1)]),l("span",Hk,z(f.value),1),l("span",{class:"tp-stop",role:"button",title:"停止计时",onClick:Nt(v,["stop"])},"停止")])):he("",!0)]),_:1}))}}),Wk=Kt(zk,[["__scopeId","data-v-1aa90651"]]),Gk={class:"admin-page"},Yk={class:"card table-card"},Jk={class:"toolbar"},Xk={key:0,class:"form-error tb-error"},Qk={class:"admin-table"},Zk={class:"td-name","data-label":"用户名"},ex={"data-label":"角色"},tx={key:0,class:"role-badge"},nx={key:1,class:"muted"},sx={class:"muted num","data-label":"创建时间"},rx={class:"muted num","data-label":"数据量"},ox={class:"td-ops"},ax={class:"ops"},ix=["onClick"],lx=["disabled","onClick"],ux={key:0},cx={key:1,class:"muted load-line"},dx={class:"dialog",role:"dialog","aria-label":"新增用户"},fx={class:"dialog-head"},px={class:"dialog-body"},vx={class:"form-row"},mx={class:"form-row"},hx={class:"form-row"},yx={key:0,class:"form-error"},gx={class:"dialog-btns"},bx=["disabled"],wx={class:"dialog",role:"dialog","aria-label":"重置密码"},_x={class:"dialog-head"},kx={class:"dialog-title"},xx={class:"dialog-body"},Cx={class:"form-row"},$x={key:0,class:"form-error"},Sx={class:"dialog-btns"},Ex=["disabled"],Tx=jt({__name:"UserAdminView",setup(e){const t=M([]),n=M(""),r=M(!0),o=M("");async function i(P,E){const j=await Ns();let ne=$a();if(!ne){const Ee=pn(),ye=await fetch(j+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:Ee==null?void 0:Ee.username,password:Ee==null?void 0:Ee.password})});if(ye.ok){const Ae=await ye.json();ne=String(Ae.token||""),qr(ne)}}const Me=await fetch(j+P,{method:E?"POST":"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+ne},body:E?JSON.stringify(E):void 0});if(Me.status===401&&pn()){const Ee=pn(),ye=await fetch(j+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:Ee==null?void 0:Ee.username,password:Ee==null?void 0:Ee.password})});if(ye.ok){const Ae=await ye.json();ne=String(Ae.token||""),qr(ne);const Ue=await fetch(j+P,{method:E?"POST":"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+ne},body:E?JSON.stringify(E):void 0});return{ok:Ue.ok,status:Ue.status,data:await Ue.json().catch(()=>({}))}}}return{ok:Me.ok,status:Me.status,data:await Me.json().catch(()=>({}))}}async function c(){r.value=!0,o.value="";const P=await i("/api/admin/users");if(!P.ok){r.value=!1,o.value=P.data&&P.data.error||"加载失败 "+P.status;return}t.value=P.data.users||[],n.value=P.data.me||"",r.value=!1}function f(P){return P<=0?"--":P<1024?P+" B":P<1024*1024?(P/1024).toFixed(1)+" KB":(P/1024/1024).toFixed(2)+" MB"}function v(P){return(P||"").slice(0,10)}const b=M(!1),y=M(""),_=M(""),S=M(""),C=M(""),I=M(!1);function Y(){b.value=!0,C.value="",y.value="",_.value="",S.value=""}async function le(){const P=y.value.trim();if(_.value!==S.value){C.value="两次输入的密码不一致";return}if(_.value.length<6){C.value="密码至少 6 位";return}I.value=!0;const E=await i("/api/admin/users/create",{username:P,password:_.value});if(I.value=!1,!E.ok){C.value=E.data&&E.data.error||"创建失败 "+E.status;return}Fe("用户「"+P+"」已创建"),b.value=!1,await c()}const ce=M(null),ue=M(""),W=M(""),A=M(!1);function L(P){ce.value=P,ue.value="",W.value=""}async function Z(){if(!ce.value)return;if(ue.value.length<6){W.value="密码至少 6 位";return}A.value=!0;const P=await i("/api/admin/users/password",{userId:ce.value.id,newPassword:ue.value});if(A.value=!1,!P.ok){W.value=P.data&&P.data.error||"重置失败 "+P.status;return}Fe("已重置「"+ce.value.username+"」的登录密码"),ce.value=null}const G=M(null);async function te(){if(!G.value)return;const P=await i("/api/admin/users/delete",{userId:G.value.id});if(!P.ok){G.value=null,Fe(P.data&&P.data.error||"删除失败");return}Fe("已删除账号「"+G.value.username+"」及其全部云端数据"),G.value=null,await c()}return ln(c),(P,E)=>($(),O("div",Gk,[l("div",Yk,[l("div",Jk,[E[12]||(E[12]=l("div",{class:"head-wrap"},[l("div",{class:"tb-title"},"用户管理"),l("div",{class:"muted tb-sub"},"云端账号统一管理 · 管理员:xionglin")],-1)),l("button",{class:"btn btn-primary btn-sm",onClick:Y},[we(qe,{name:"plus",size:14}),E[11]||(E[11]=ht(" 新增用户 ",-1))])]),o.value?($(),O("div",Xk,z(o.value),1)):he("",!0),l("table",Qk,[E[14]||(E[14]=l("thead",null,[l("tr",null,[l("th",null,"用户名"),l("th",null,"角色"),l("th",null,"创建时间"),l("th",null,"数据量"),l("th",{class:"th-ops"},"操作")])],-1)),l("tbody",null,[($(!0),O(je,null,et(t.value,j=>($(),O("tr",{key:j.id},[l("td",Zk,z(j.username),1),l("td",ex,[j.role==="admin"?($(),O("span",tx,"管理员")):($(),O("span",nx,"普通用户"))]),l("td",sx,z(v(j.created_at)),1),l("td",rx,z(f(j.data_bytes)),1),l("td",ox,[l("div",ax,[l("button",{class:"btn btn-xs",onClick:ne=>L(j)},"重置密码",8,ix),l("button",{class:"btn btn-xs btn-danger",disabled:j.id===n.value,onClick:ne=>G.value=j},"删除",8,lx)])])]))),128)),!r.value&&!t.value.length?($(),O("tr",ux,[...E[13]||(E[13]=[l("td",{colspan:"5",class:"empty muted"},"加载结果为空",-1)])])):he("",!0)])]),r.value?($(),O("div",cx,"加载中")):he("",!0)]),E[20]||(E[20]=l("div",{class:"muted admin-note"},"重置密码立即生效;删除账号将移除其全部云端数据,不可恢复。自己的账号不能删除。",-1)),($(),wt(zn,{to:"body"},[b.value?($(),O("div",{key:0,class:"mask",onClick:E[5]||(E[5]=Nt(j=>b.value=!1,["self"]))},[l("div",dx,[l("div",fx,[E[15]||(E[15]=l("span",{class:"dialog-title"},"新增用户",-1)),l("button",{class:"icon-btn",onClick:E[0]||(E[0]=j=>b.value=!1)},[we(qe,{name:"close",size:16})])]),l("div",px,[l("div",vx,[E[16]||(E[16]=l("label",null,"用户名(2 到 20 个字符)",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":E[1]||(E[1]=j=>y.value=j),placeholder:"如:xiaowang"},null,512),[[Re,y.value]])]),l("div",mx,[E[17]||(E[17]=l("label",null,"初始登录密码(至少 6 位)",-1)),Oe(l("input",{class:"input",type:"password","onUpdate:modelValue":E[2]||(E[2]=j=>_.value=j),placeholder:"转发给使用者,登录后可自行修改"},null,512),[[Re,_.value]])]),l("div",hx,[E[18]||(E[18]=l("label",null,"确认密码",-1)),Oe(l("input",{class:"input",type:"password","onUpdate:modelValue":E[3]||(E[3]=j=>S.value=j),onKeydown:Mt(le,["enter"])},null,544),[[Re,S.value]])]),C.value?($(),O("div",yx,z(C.value),1)):he("",!0)]),l("div",gx,[l("button",{class:"btn btn-sm",onClick:E[4]||(E[4]=j=>b.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",disabled:I.value||!y.value.trim(),onClick:le},z(I.value?"创建中":"创建"),9,bx)])])])):he("",!0)])),($(),wt(zn,{to:"body"},[ce.value?($(),O("div",{key:0,class:"mask",onClick:E[9]||(E[9]=Nt(j=>ce.value=null,["self"]))},[l("div",wx,[l("div",_x,[l("span",kx,"重置「"+z(ce.value.username)+"」的登录密码",1),l("button",{class:"icon-btn",onClick:E[6]||(E[6]=j=>ce.value=null)},[we(qe,{name:"close",size:16})])]),l("div",xx,[l("div",Cx,[E[19]||(E[19]=l("label",null,"新登录密码(至少 6 位)",-1)),Oe(l("input",{class:"input",type:"password","onUpdate:modelValue":E[7]||(E[7]=j=>ue.value=j),onKeydown:Mt(Z,["enter"])},null,544),[[Re,ue.value]])]),W.value?($(),O("div",$x,z(W.value),1)):he("",!0)]),l("div",Sx,[l("button",{class:"btn btn-sm",onClick:E[8]||(E[8]=j=>ce.value=null)},"取消"),l("button",{class:"btn btn-primary btn-sm",disabled:A.value,onClick:Z},z(A.value?"提交中":"重置"),9,Ex)])])])):he("",!0)])),we(Dn,{open:!!G.value,title:"删除用户确认",message:G.value?"将永久删除云端账号「"+G.value.username+"」及其服务器上的全部数据,不可恢复。请确认。":"","confirm-text":"永久删除",danger:"",onCancel:E[10]||(E[10]=j=>G.value=null),onConfirm:te},null,8,["open","message"])]))}}),Ax=Kt(Tx,[["__scopeId","data-v-2d48d2c9"]]),Px={class:"login-page"},Ox={class:"card login-card"},Mx={class:"login-brand"},Ix={class:"brand-icon"},jx={class:"seg"},Dx=["placeholder"],Lx={key:1,class:"form-error"},Kx=["disabled"],Rx=jt({__name:"LoginView",emits:["login"],setup(e,{emit:t}){const n=t,r=M("login"),o=M(""),i=M(""),c=M(""),f=M(""),v=M(!1);function b(_){r.value=_,f.value="",c.value=""}async function y(){if(!v.value){f.value="",v.value=!0;try{let _;if(r.value==="login")_=await Pm(o.value,i.value);else{if(i.value.length<6){f.value="登录密码至少 6 位",v.value=!1;return}if(i.value!==c.value){f.value="两次输入的密码不一致",v.value=!1;return}_=await Om(o.value,i.value)}n("login",_)}catch(_){f.value=_ instanceof Error?_.message:"操作失败"}v.value=!1}}return(_,S)=>($(),O("div",Px,[l("div",Ox,[l("div",Mx,[l("div",Ix,[we(qe,{name:"calendar",size:22})]),S[5]||(S[5]=l("div",{class:"login-title"},"实习工作日志",-1)),S[6]||(S[6]=l("div",{class:"muted login-sub"},"打卡 · 记录 · 总结 · 备忘录 · 密码库",-1)),S[7]||(S[7]=l("div",{class:"muted login-sub"},"数据保存在云端服务器,所有设备登录同一账号即可实时同步",-1))]),l("div",jx,[l("button",{class:Xe(["seg-btn",{active:r.value==="login"}]),onClick:S[0]||(S[0]=C=>b("login"))},"登录",2),l("button",{class:Xe(["seg-btn",{active:r.value==="create"}]),onClick:S[1]||(S[1]=C=>b("create"))},"创建用户",2)]),Oe(l("input",{class:"input","onUpdate:modelValue":S[2]||(S[2]=C=>o.value=C),placeholder:"用户名(2 到 20 个字符)",onKeydown:Mt(y,["enter"])},null,544),[[Re,o.value]]),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":S[3]||(S[3]=C=>i.value=C),placeholder:r.value==="login"?"登录密码":"设置登录密码(至少 6 位)",onKeydown:Mt(y,["enter"])},null,40,Dx),[[Re,i.value]]),r.value==="create"?Oe(($(),O("input",{key:0,type:"password",class:"input","onUpdate:modelValue":S[4]||(S[4]=C=>c.value=C),placeholder:"再次输入密码",onKeydown:Mt(y,["enter"])},null,544)),[[Re,c.value]]):he("",!0),f.value?($(),O("div",Lx,z(f.value),1)):he("",!0),l("button",{class:"btn btn-primary login-btn",disabled:v.value,onClick:y},z(r.value==="login"?"登录":"创建并进入"),9,Kx),S[8]||(S[8]=l("div",{class:"muted login-note"}," 登录密码仅服务器保存哈希;本机保存加密的自动登录凭据,登录后无需重复输入 ",-1))])]))}}),Fx=Kt(Rx,[["__scopeId","data-v-089817d7"]]),Nx={key:1,class:"app"},Vx={class:"side"},Bx={class:"brand-mark"},Ux={class:"side-nav"},qx={key:0,class:"nav-group"},Hx=["data-tip","onClick"],zx={class:"nav-label"},Wx={class:"side-foot"},Gx={class:"avatar"},Yx={class:"foot-name"},Jx={class:"main"},Xx={class:"topbar"},Qx={class:"title"},Zx={class:"gsearch"},eC={key:0,class:"gs-panel"},tC={key:0,class:"gs-group muted"},nC=["onMousedown"],sC={class:"tag"},rC={class:"gs-text"},oC={class:"muted num gs-date"},aC={key:1,class:"gs-group muted"},iC=["onMousedown"],lC={class:"gs-text"},uC={class:"muted gs-sub"},cC={key:1,class:"gs-empty muted"},dC={class:"topbar-actions"},fC=["disabled"],pC={class:"num"},vC={class:"content"},mC={class:"content-inner"},hC={class:"tabbar"},yC=["onClick"],gC={class:"sheet-user num"},bC=["onClick"],wC={class:"sheet-name"},_C={class:"msw"},kC={class:"msw-bar"},xC={class:"msw-results"},CC={key:0,class:"gs-group muted"},$C=["onMousedown"],SC={class:"tag"},EC={class:"gs-text"},TC={class:"muted num gs-date"},AC={key:1,class:"gs-group muted"},PC=["onMousedown"],OC={class:"gs-text"},MC={class:"muted gs-sub"},IC={key:1,class:"gs-empty muted"},jC={class:"toast-wrap"},DC=jt({__name:"App",setup(e){const t=my(),n=M(Hr());async function r(g){n.value=g,ia(g.userId),location.hash="#/calendar",L.value="calendar",await Ie(),await Ne(),c();try{await bd(),await nr()}catch{}Fe("欢迎,"+g.username);const m=sessionStorage.getItem("dsh_migrate_toast");m&&(sessionStorage.removeItem("dsh_migrate_toast"),Fe("已迁移原有数据 "+m+" 条"))}async function o(){Ae.value=!1,Ee.value=!1,Wm(),i!==null&&(window.clearInterval(i),i=null),await Im(),n.value=null,L.value="calendar",location.hash="#/calendar",Fe("已退出登录")}let i=null;function c(){zm(),i!==null&&window.clearInterval(i),i=window.setInterval(()=>{nr()},60*1e3),nr()}const f=M(null),v=M(""),b=M(!1),y=M({logs:[],memos:[]});let _=null;const S=st(()=>!!(y.value.logs.length||y.value.memos.length));function C(){_&&window.clearTimeout(_);const g=v.value;_=window.setTimeout(async()=>{const m=g.trim();if(!m){y.value={logs:[],memos:[]};return}const x=await Promise.all([Lh(m,8),Kh(m,4)]);y.value={logs:x[0],memos:x[1]}},200)}function I(){v.value="",y.value={logs:[],memos:[]},b.value=!1}function Y(g){Vi.value=g.date,Z("calendar"),I()}function le(g){Bi.value=g.id,Z("memo"),I()}function ce(){window.setTimeout(()=>{b.value=!1},150)}function ue(g){var m;(g.ctrlKey||g.metaKey)&&g.key.toLowerCase()==="k"&&(g.preventDefault(),(m=f.value)==null||m.focus())}const W=[{key:"calendar",name:"日历",icon:"calendar",group:"记录"},{key:"today",name:"详情",icon:"edit",group:"记录"},{key:"plan",name:"计划",icon:"plan",group:"记录"},{key:"ledger",name:"记账",icon:"wallet",group:"工具"},{key:"memo",name:"备忘录",icon:"memo",group:"工具"},{key:"stats",name:"统计",icon:"chart",group:"分析"},{key:"report",name:"总结",icon:"export",group:"分析"},{key:"vault",name:"密码库",icon:"lock",group:"系统"},{key:"settings",name:"设置",icon:"settings",group:"系统"},{key:"admin",name:"用户管理",icon:"shield",group:"系统"}];function A(){var m;const g=(location.hash||"").replace("#/","");return!W.some(x=>x.key===g)||g==="admin"&&(((m=Hr())==null?void 0:m.username)||"")!=="xionglin"?"calendar":g}const L=M(A());window.addEventListener("hashchange",()=>{L.value=A()});function Z(g){location.hash="#/"+g}const G=st(()=>W.find(g=>g.key===L.value)||W[0]),te=st(()=>{var g;return(((g=n.value)==null?void 0:g.username)||"")==="xionglin"}),P=st(()=>te.value?W:W.filter(g=>g.key!=="admin")),E=st(()=>{const g=W.filter(m=>!ne.includes(m.key));return te.value?g:g.filter(m=>m.key!=="admin")}),j=st(()=>E.value.some(g=>g.key===L.value));pt([te,L],()=>{L.value==="admin"&&!te.value&&Z("calendar")},{immediate:!0});const ne=["calendar","today","plan","ledger"],Me=W.filter(g=>ne.includes(g.key)),Ee=M(!1);function ye(g){Ee.value=!1,Z(g)}const Ae=M(!1),Ue=M(null);function de(){Ae.value=!0,window.setTimeout(()=>{var g;return(g=Ue.value)==null?void 0:g.focus()},60)}function ke(g){Y(g),Ae.value=!1}function Se(g){le(g),Ae.value=!1}const De=M(ot()),$e=M(void 0),fe=M(!1);async function Ie(){if($e.value=await _n(De.value),fe.value=!1,new Date().getHours()<4){const m=await _n(Vt(De.value,-1));fe.value=!!(m&&m.clock_in_at&&!m.clock_out_at)}}const ct=st(()=>{const g=$e.value;return g&&g.clock_in_at&&!g.clock_out_at?!0:fe.value&&!(g&&g.clock_in_at)}),bt=st(()=>{const g=$e.value;return!!(g&&g.clock_in_at&&g.clock_out_at)}),_t=st(()=>{const g=$e.value;return ct.value?"下班打卡":bt.value?"已打卡 "+wn(g==null?void 0:g.clock_in_at)+" - "+wn(g==null?void 0:g.clock_out_at):"上班打卡"});async function Bt(){if(ct.value)try{await ih()}catch{}else await Ed(De.value);await Ie(),as()}pt(ur,()=>{n.value&&Ie()});const vt=M(!1);async function Ne(){if((await vs()).remind_weekly==="off"){vt.value=!1;return}const m=new Date().getDay();if(m===5||m===6||m===0){const x=await yl(Zs(De.value));vt.value=!x||!x.highlights&&!x.challenges&&!x.plan_next}else vt.value=!1}return ln(async()=>{window.addEventListener("keydown",ue),n.value&&(ia(n.value.userId),await Ie(),await Ne(),c())}),(g,m)=>{var x,D,ae;return n.value?($(),O("div",Nx,[l("nav",Vx,[l("div",{class:"brand",onClick:m[0]||(m[0]=H=>Z("calendar"))},[l("span",Bx,[we(qe,{name:"calendar",size:15})]),m[12]||(m[12]=l("span",{class:"brand-name"},"实习工作日志",-1))]),l("div",Ux,[($(!0),O(je,null,et(P.value,(H,ee)=>($(),O(je,{key:H.key},[ee===0||H.group!==P.value[ee-1].group?($(),O("div",qx,z(H.group),1)):he("",!0),l("button",{class:Xe(["nav-btn",{active:L.value===H.key}]),"data-tip":H.name,onClick:T=>Z(H.key)},[we(qe,{name:H.icon,size:17},null,8,["name"]),l("span",zx,z(H.name),1)],10,Hx)],64))),128))]),l("div",Wx,[l("span",Gx,z((((x=n.value)==null?void 0:x.username)||"用户").slice(0,1).toUpperCase()),1),l("span",Yx,z((D=n.value)==null?void 0:D.username),1),l("button",{class:"icon-btn",title:"退出登录",onClick:o},[we(qe,{name:"export",size:15})])])]),l("div",Jx,[l("header",Xx,[l("span",Qx,z(G.value.name),1),l("button",{class:"mob-search-btn",title:"搜索",onClick:de},[we(qe,{name:"search",size:16})]),l("div",Zx,[we(qe,{name:"search",size:14,class:"gs-icon"}),Oe(l("input",{ref_key:"gsInput",ref:f,class:"input gs-input","onUpdate:modelValue":m[1]||(m[1]=H=>v.value=H),placeholder:"搜索工作记录与备忘录(Ctrl+K)",onInput:C,onFocus:m[2]||(m[2]=H=>b.value=!0),onBlur:ce,onKeydown:Mt(I,["esc"])},null,544),[[Re,v.value]]),b.value&&v.value.trim()?($(),O("div",eC,[S.value?($(),O(je,{key:0},[y.value.logs.length?($(),O("div",tC,"工作记录")):he("",!0),($(!0),O(je,null,et(y.value.logs,H=>($(),O("div",{key:"l"+H.id,class:"gs-item",onMousedown:Nt(ee=>Y(H),["prevent"])},[l("span",sC,z(on(Ur)(H.category)),1),l("span",rC,z(H.content),1),l("span",oC,z(H.date),1)],40,nC))),128)),y.value.memos.length?($(),O("div",aC,"备忘录")):he("",!0),($(!0),O(je,null,et(y.value.memos,H=>($(),O("div",{key:"m"+H.id,class:"gs-item",onMousedown:Nt(ee=>le(H),["prevent"])},[l("span",lC,z(H.title||"无标题"),1),l("span",uC,z(H.content),1)],40,iC))),128))],64)):($(),O("div",cC,"无匹配结果"))])):he("",!0)]),m[14]||(m[14]=l("span",{class:"flex1"},null,-1)),l("div",dC,[vt.value?($(),O("button",{key:0,class:"week-tip",onClick:m[3]||(m[3]=H=>Z("report"))},[...m[13]||(m[13]=[l("span",{class:"dot",style:{background:"var(--warn)"}},null,-1),ht(" 填写本周周记 ",-1)])])):he("",!0),l("button",{class:"btn btn-primary",disabled:bt.value,onClick:Bt},[we(qe,{name:bt.value?"check-circle":"clock",size:14},null,8,["name"]),l("span",pC,z(_t.value),1)],8,fC)])]),l("main",vC,[l("div",mC,[L.value==="calendar"?($(),wt(Eg,{key:0})):L.value==="today"?($(),wt(Xg,{key:1})):L.value==="plan"?($(),wt(rw,{key:2})):L.value==="stats"?($(),wt(Dw,{key:3})):L.value==="report"?($(),wt(w_,{key:4})):L.value==="ledger"?($(),wt(k1,{key:5})):L.value==="memo"?($(),wt(N1,{key:6})):L.value==="vault"?($(),wt(L0,{key:7})):L.value==="admin"?($(),wt(Ax,{key:8})):($(),wt(Vk,{key:9}))])]),l("nav",hC,[($(!0),O(je,null,et(on(Me),H=>($(),O("button",{key:H.key,class:Xe(["tab-btn",{active:L.value===H.key}]),onClick:ee=>Z(H.key)},[we(qe,{name:H.icon,size:20},null,8,["name"]),l("span",null,z(H.name),1)],10,yC))),128)),l("button",{class:Xe(["tab-btn",{active:j.value}]),onClick:m[4]||(m[4]=H=>Ee.value=!0)},[we(qe,{name:"more",size:20}),m[15]||(m[15]=l("span",null,"更多",-1))],2)]),Ee.value?($(),O("div",{key:0,class:"sheet-mask",onClick:m[7]||(m[7]=H=>Ee.value=!1)},[l("div",{class:"more-sheet",onClick:m[6]||(m[6]=Nt(()=>{},["stop"]))},[l("div",gC,z((ae=n.value)==null?void 0:ae.username),1),($(!0),O(je,null,et(E.value,H=>($(),O("button",{key:H.key,class:"sheet-row",onClick:ee=>ye(H.key)},[we(qe,{name:H.icon,size:18},null,8,["name"]),l("span",wC,z(H.name),1),we(qe,{name:"chevron-right",size:14,class:"sheet-go"})],8,bC))),128)),m[17]||(m[17]=l("div",{class:"sheet-divider"},null,-1)),l("button",{class:"sheet-row sheet-danger",onClick:m[5]||(m[5]=H=>{Ee.value=!1,o()})},[we(qe,{name:"close",size:18}),m[16]||(m[16]=l("span",{class:"sheet-name"},"退出登录",-1))])])])):he("",!0),Ae.value?($(),O("div",{key:1,class:"msw-mask",onClick:m[11]||(m[11]=Nt(H=>Ae.value=!1,["self"]))},[l("div",_C,[l("div",kC,[we(qe,{name:"search",size:16,class:"msw-icon"}),Oe(l("input",{ref_key:"msInput",ref:Ue,class:"msw-input","onUpdate:modelValue":m[8]||(m[8]=H=>v.value=H),placeholder:"搜索工作记录与备忘录",onInput:C,onKeydown:m[9]||(m[9]=Mt(H=>Ae.value=!1,["esc"]))},null,544),[[Re,v.value]]),l("button",{class:"icon-btn",onClick:m[10]||(m[10]=H=>{I(),Ae.value=!1})},[we(qe,{name:"close",size:16})])]),l("div",xC,[S.value?($(),O(je,{key:0},[y.value.logs.length?($(),O("div",CC,"工作记录")):he("",!0),($(!0),O(je,null,et(y.value.logs,H=>($(),O("div",{key:"l"+H.id,class:"msw-item",onMousedown:Nt(ee=>ke(H),["prevent"])},[l("span",SC,z(on(Ur)(H.category)),1),l("span",EC,z(H.content),1),l("span",TC,z(H.date),1)],40,$C))),128)),y.value.memos.length?($(),O("div",AC,"备忘录")):he("",!0),($(!0),O(je,null,et(y.value.memos,H=>($(),O("div",{key:"m"+H.id,class:"msw-item",onMousedown:Nt(ee=>Se(H),["prevent"])},[l("span",OC,z(H.title||"无标题"),1),l("span",MC,z(H.content),1)],40,PC))),128))],64)):v.value.trim()?($(),O("div",IC,"无匹配结果")):he("",!0)])])])):he("",!0)]),n.value?($(),wt(Wk,{key:0})):he("",!0),l("div",jC,[we(Pv,{name:"toast"},{default:Wn(()=>[($(!0),O(je,null,et(on(t),H=>($(),O("div",{key:H.id,class:"toast"},z(H.text),1))),128))]),_:1})])])):($(),wt(Fx,{key:0,onLogin:r}))}}}),LC=Kt(DC,[["__scopeId","data-v-3da62c79"]]);function Bo(e,t){try{let n=document.getElementById("fatal-overlay");n||(n=document.createElement("div"),n.id="fatal-overlay",n.style.cssText="position:fixed;inset:0;z-index:99999;background:#FFFFFF;color:#1D2129;padding:20px;overflow:auto;font:13px/1.7 -apple-system,PingFang SC,Microsoft YaHei,sans-serif;",n.addEventListener("click",i=>{i.target===n&&n.parentElement&&n.parentElement.removeChild(n)}),document.body.appendChild(n));const r=document.createElement("div");r.style.cssText="border:1px solid #E5484D;border-radius:8px;padding:12px;margin-bottom:12px;word-break:break-all;white-space:pre-wrap;",r.textContent=e+`
`+t;const o=document.createElement("button");o.textContent="重新加载",o.style.cssText="margin:-4px 0 12px;padding:6px 16px;border:1px solid #E5484D;border-radius:6px;background:#FFFFFF;color:#E5484D;font-size:13px;cursor:pointer;",o.addEventListener("click",()=>{try{location.reload()}catch{}}),n.appendChild(r),n.appendChild(o)}catch{}}async function KC(){const e=await Mm();e&&ia(e.userId);const t=Hv(LC);t.config.errorHandler=(n,r,o)=>{const i=n;Bo("应用内部错误(点击空白处关闭,请将以下内容发送给开发者)",i&&(i.stack||i.message)||String(n)+`
触发位置: `+o)},window.addEventListener("unhandledrejection",n=>{const r=n.reason;Bo("未处理的异步错误(点击空白处关闭)",r&&(r.stack||r.message)||String(n.reason))}),window.addEventListener("error",n=>{n.message&&n.message!=="ResizeObserver loop limit exceeded"&&Bo("运行错误(点击空白处关闭)",n.message)}),t.mount("#app"),"serviceWorker"in navigator&&location.protocol.startsWith("http")&&window.addEventListener("load",()=>{navigator.serviceWorker.register("sw.js").catch(()=>{})})}KC().catch(e=>{Bo("无法启动:连接同步服务器失败",e&&(e.stack||e.message)||String(e))});export{Ld as W,Id as _,Fg as b,Dd as r};