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

27 lines
316 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"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();/**
* @vue/shared v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Ha(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ft={},Pr=[],Tn=()=>{},Bu=()=>!1,li=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ui=e=>e.startsWith("onUpdate:"),$t=Object.assign,Wa=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},ef=Object.prototype.hasOwnProperty,ut=(e,t)=>ef.call(e,t),Re=Array.isArray,sr=e=>qs(e)==="[object Map]",Ir=e=>qs(e)==="[object Set]",Yl=e=>qs(e)==="[object Date]",We=e=>typeof e=="function",bt=e=>typeof e=="string",Pn=e=>typeof e=="symbol",ct=e=>e!==null&&typeof e=="object",Uu=e=>(ct(e)||We(e))&&We(e.then)&&We(e.catch),qu=Object.prototype.toString,qs=e=>qu.call(e),tf=e=>qs(e).slice(8,-1),Hu=e=>qs(e)==="[object Object]",za=e=>bt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ks=Ha(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ci=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},nf=/-\w/g,mn=ci(e=>e.replace(nf,t=>t.slice(1).toUpperCase())),rf=/\B([A-Z])/g,dr=ci(e=>e.replace(rf,"-$1").toLowerCase()),Wu=ci(e=>e.charAt(0).toUpperCase()+e.slice(1)),ra=ci(e=>e?`on${Wu(e)}`:""),$n=(e,t)=>!Object.is(e,t),Po=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},zu=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},di=e=>{const t=parseFloat(e);return isNaN(t)?e:t},sf=e=>{const t=bt(e)?Number(e):NaN;return isNaN(t)?e:t};let Jl;const fi=()=>Jl||(Jl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function or(e){if(Re(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=bt(s)?uf(s):or(s);if(o)for(const a in o)t[a]=o[a]}return t}else if(bt(e)||ct(e))return e}const of=/;(?![^(]*\))/g,af=/:([^]+)/,lf=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function uf(e){const t={};return e.replace(lf,n=>n.startsWith("/*")?"":n).split(of).forEach(n=>{if(n){const s=n.split(af);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function et(e){let t="";if(bt(e))t=e;else if(Re(e))for(let n=0;n<e.length;n++){const s=et(e[n]);s&&(t+=s+" ")}else if(ct(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const cf="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",df=Ha(cf);function Gu(e){return!!e||e===""}function ff(e,t,n){if(e.length!==t.length)return!1;let s=!0;for(let o=0;s&&o<e.length;o++)s=ar(e[o],t[o],n);return s}function Xl(e,t,n){if(e.size!==t.size)return!1;const s=Array.from(t),o=new Uint8Array(s.length);for(const a of e){let c=-1;for(let f=0;f<s.length;f++)if(!o[f]&&ar(a,s[f],n)){c=f;break}if(c<0)return!1;o[c]=1}return!0}function pf(e,t,n){let s=sr(e),o=sr(t);if(s||o||(s=Ir(e),o=Ir(t),s||o))return s&&o?Xl(e,t,n):!1;const a=Object.keys(e).length,c=Object.keys(t).length;if(a!==c)return!1;for(const f in e){const h=e.hasOwnProperty(f),g=t.hasOwnProperty(f);if(h&&!g||!h&&g||!ar(e[f],t[f],n))return!1}return String(e)===String(t)}function Ql(e,t,n,s){n||(n=[new Map,new Map]);const[o,a]=n;if(o.has(e)||a.has(t))return o.get(e)===t&&a.get(t)===e;o.set(e,t),a.set(t,e);const c=s(e,t,n);return o.delete(e),a.delete(t),c}function ar(e,t,n){if(e===t)return!0;let s=Yl(e),o=Yl(t);return s||o?s&&o?e.getTime()===t.getTime():!1:(s=Pn(e),o=Pn(t),s||o?e===t:(s=Re(e),o=Re(t),s||o?s&&o?Ql(e,t,n,ff):!1:(s=ct(e),o=ct(t),s||o?!s||!o?!1:Ql(e,t,n,pf):String(e)===String(t))))}function vf(e,t){return e.findIndex(n=>ar(n,t))}const Yu=e=>!!(e&&e.__v_isRef===!0),te=e=>bt(e)?e:e==null?"":Re(e)||ct(e)&&(e.toString===qu||!We(e.toString))?Yu(e)?te(e.value):JSON.stringify(e,Ju,2):String(e),Ju=(e,t)=>Yu(t)?Ju(e,t.value):sr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],a)=>(n[sa(s,a)+" =>"]=o,n),{})}:Ir(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>sa(n))}:Pn(t)?sa(t):ct(t)&&!Re(t)&&!Hu(t)?String(t):t,sa=(e,t="")=>{var n;return Pn(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 Dt;class hf{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&&Dt&&(Dt.active?(this.parent=Dt,this.index=(Dt.scopes||(Dt.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 s=this.scopes.slice();for(t=0,n=s.length;t<n;t++)s[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 s=this.effects.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}}run(t){if(this._active){const n=Dt;try{return Dt=this,t()}finally{Dt=n}}}on(){++this._on===1&&(this.prevScope=Dt,Dt=this)}off(){if(this._on>0&&--this._on===0){if(Dt===this)Dt=this.prevScope;else{let t=Dt;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,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,s=o.length;n<s;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 mf(){return Dt}let vt;const oa=new WeakSet;class Xu{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,Dt&&(Dt.active?Dt.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,oa.has(this)&&(oa.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Zu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Zl(this),ec(this);const t=vt,n=yn;vt=this,yn=!0;try{return this.fn()}finally{tc(this),vt=t,yn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ja(t);this.deps=this.depsTail=void 0,Zl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?oa.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ba(this)&&this.run()}get dirty(){return ba(this)}}let Qu=0,xs,Cs;function Zu(e,t=!1){if(e.flags|=8,t){e.next=Cs,Cs=e;return}e.next=xs,xs=e}function Ga(){Qu++}function Ya(){if(--Qu>0)return;if(Cs){let t=Cs;for(Cs=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;xs;){let t=xs;for(xs=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function ec(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function tc(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Ja(s),yf(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function ba(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(nc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function nc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Os)||(e.globalVersion=Os,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ba(e))))return;e.flags|=2;const t=e.dep,n=vt,s=yn;vt=e,yn=!0;try{ec(e);const o=e.fn(e._value);(t.version===0||$n(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{vt=n,yn=s,tc(e),e.flags&=-3}}function Ja(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let a=n.computed.deps;a;a=a.nextDep)Ja(a,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function yf(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let yn=!0;const rc=[];function An(){rc.push(yn),yn=!1}function On(){const e=rc.pop();yn=e===void 0?!0:e}function Zl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=vt;vt=void 0;try{t()}finally{vt=n}}}let Os=0;class gf{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 Xa{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(!vt||!yn||vt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==vt)n=this.activeLink=new gf(vt,this),vt.deps?(n.prevDep=vt.depsTail,vt.depsTail.nextDep=n,vt.depsTail=n):vt.deps=vt.depsTail=n,sc(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=vt.depsTail,n.nextDep=void 0,vt.depsTail.nextDep=n,vt.depsTail=n,vt.deps===n&&(vt.deps=s)}return n}trigger(t){this.version++,Os++,this.notify(t)}notify(t){Ga();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ya()}}}function sc(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)sc(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const wa=new WeakMap,Or=Symbol(""),_a=Symbol(""),Ms=Symbol("");function Bt(e,t,n){if(yn&&vt){let s=wa.get(e);s||wa.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Xa),o.map=s,o.key=n),o.track()}}function Kn(e,t,n,s,o,a){const c=wa.get(e);if(!c){Os++;return}const f=h=>{h&&h.trigger()};if(Ga(),t==="clear")c.forEach(f);else{const h=Re(e),g=h&&za(n);if(h&&n==="length"){const y=Number(s);c.forEach((_,C)=>{(C==="length"||C===Ms||!Pn(C)&&C>=y)&&f(_)})}else switch((n!==void 0||c.has(void 0))&&f(c.get(n)),g&&f(c.get(Ms)),t){case"add":h?g&&f(c.get("length")):(f(c.get(Or)),sr(e)&&f(c.get(_a)));break;case"delete":h||(f(c.get(Or)),sr(e)&&f(c.get(_a)));break;case"set":sr(e)&&f(c.get(Or));break}}Ya()}function Wr(e){const t=lt(e);return t===e||(Bt(t,"iterate",Ms),cn(e))?t:Mn(e)?ir(e)?t.map(n=>lr(dn(n))):t.map(lr):t.map(dn)}function pi(e){return Bt(e=lt(e),"iterate",Ms),e}function Cn(e,t){return Mn(e)?lr(ir(e)?dn(t):t):dn(t)}const bf={__proto__:null,[Symbol.iterator](){return ia(this,Symbol.iterator,e=>Cn(this,e))},concat(...e){return Wr(this).concat(...e.map(t=>Re(t)?Wr(t):t))},entries(){return ia(this,"entries",e=>(e[1]=Cn(this,e[1]),e))},every(e,t){return Dn(this,"every",e,t,void 0,arguments)},filter(e,t){return Dn(this,"filter",e,t,n=>n.map(s=>Cn(this,s)),arguments)},find(e,t){return Dn(this,"find",e,t,n=>Cn(this,n),arguments)},findIndex(e,t){return Dn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Dn(this,"findLast",e,t,n=>Cn(this,n),arguments)},findLastIndex(e,t){return Dn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Dn(this,"forEach",e,t,void 0,arguments)},includes(...e){return aa(this,"includes",e)},indexOf(...e){return aa(this,"indexOf",e)},join(e){return Wr(this).join(e)},lastIndexOf(...e){return aa(this,"lastIndexOf",e)},map(e,t){return Dn(this,"map",e,t,void 0,arguments)},pop(){return ms(this,"pop")},push(...e){return ms(this,"push",e)},reduce(e,...t){return tu(this,"reduce",e,t)},reduceRight(e,...t){return tu(this,"reduceRight",e,t)},shift(){return ms(this,"shift")},some(e,t){return Dn(this,"some",e,t,void 0,arguments)},splice(...e){return ms(this,"splice",e)},toReversed(){return Wr(this).toReversed()},toSorted(e){return Wr(this).toSorted(e)},toSpliced(...e){return Wr(this).toSpliced(...e)},unshift(...e){return ms(this,"unshift",e)},values(){return ia(this,"values",e=>Cn(this,e))}};function ia(e,t,n){const s=pi(e),o=s[t],a=o.call(s);if(s!==e&&!cn(e)){if(a[Symbol.toStringTag]==="Array Iterator"){const c=Object.create(Object.getPrototypeOf(a));return c.next=()=>eu(a.next(),n),o!==oc[t]&&Object.defineProperties(c,{return:{get(){const f=a.return;return typeof f=="function"?f.bind(a):f}},throw:{get(){const f=a.throw;return typeof f=="function"?f.bind(a):f}}}),c}a._next=a.next,a.next=()=>eu(a._next(),n)}return a}function eu(e,t){return e.done||(e.value=t(e.value)),e}const oc=Array.prototype;function Dn(e,t,n,s,o,a){const c=pi(e),f=c!==e&&!cn(e),h=c[t];if(h!==oc[t]){const _=h.apply(e,a);return f?dn(_):_}let g=n;c!==e&&(f?g=function(_,C){return n.call(this,Cn(e,_),C,e)}:n.length>2&&(g=function(_,C){return n.call(this,_,C,e)}));const y=h.call(c,g,s);return f&&o?o(y):y}function tu(e,t,n,s){const o=pi(e),a=o!==e&&!cn(e);let c=n,f=!1;o!==e&&(a?(f=s.length===0,c=function(g,y,_){return f&&(f=!1,g=Cn(e,g)),n.call(this,g,Cn(e,y),_,e)}):n.length>3&&(c=function(g,y,_){return n.call(this,g,y,_,e)}));const h=o[t](c,...s);return f?Cn(e,h):h}function aa(e,t,n){const s=lt(e);Bt(s,"iterate",Ms);const o=s[t](...n);return(o===-1||o===!1)&&tl(n[0])?(n[0]=lt(n[0]),s[t](...n)):o}function ms(e,t,n=[]){An(),Ga();const s=lt(e)[t].apply(e,n);return Ya(),On(),s}const wf=Ha("__proto__,__v_isRef,__isVue"),ic=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Pn));function _f(e){Pn(e)||(e=String(e));const t=lt(this);return Bt(t,"has",e),t.hasOwnProperty(e)}class ac{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,a=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return a;if(n==="__v_raw")return s===(o?a?Of:dc:a?cc:uc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const c=Re(t);if(!o){let h;if(c&&(h=bf[n]))return h;if(n==="hasOwnProperty")return _f}const f=Reflect.get(t,n,Ht(t)?t:s);if((Pn(n)?ic.has(n):wf(n))||(o||Bt(t,"get",n),a))return f;if(Ht(f)){const h=c&&za(n)?f:f.value;return o&&ct(h)?xa(h):h}return ct(f)?o?xa(f):Za(f):f}}class lc extends ac{constructor(t=!1){super(!1,t)}set(t,n,s,o){let a=t[n];const c=Re(t)&&za(n);if(!this._isShallow){const g=Mn(a);if(!cn(s)&&!Mn(s)&&(a=lt(a),s=lt(s)),!c&&Ht(a)&&!Ht(s))return g||(a.value=s),!0}const f=c?Number(n)<t.length:ut(t,n),h=Reflect.set(t,n,s,Ht(t)?t:o);return t===lt(o)&&h&&(f?$n(s,a)&&Kn(t,"set",n,s):Kn(t,"add",n,s)),h}deleteProperty(t,n){const s=ut(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Kn(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!Pn(n)||!ic.has(n))&&Bt(t,"has",n),s}ownKeys(t){return Bt(t,"iterate",Re(t)?"length":Or),Reflect.ownKeys(t)}}class kf extends ac{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const xf=new lc,Cf=new kf,Sf=new lc(!0);const ka=e=>e,ko=e=>Reflect.getPrototypeOf(e);function Ef(e,t,n){return function(...s){const o=this.__v_raw,a=lt(o),c=sr(a),f=e==="entries"||e===Symbol.iterator&&c,h=e==="keys"&&c,g=o[e](...s),y=n?ka:t?lr:dn;return!t&&Bt(a,"iterate",h?_a:Or),$t(Object.create(g),{next(){const{value:_,done:C}=g.next();return C?{value:_,done:C}:{value:f?[y(_[0]),y(_[1])]:y(_),done:C}}})}}function xo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function $f(e,t){const n={get(o){const a=this.__v_raw,c=lt(a),f=lt(o);e||($n(o,f)&&Bt(c,"get",o),Bt(c,"get",f));const{has:h}=ko(c),g=t?ka:e?lr:dn;if(h.call(c,o))return g(a.get(o));if(h.call(c,f))return g(a.get(f));a!==c&&a.get(o)},get size(){const o=this.__v_raw;return!e&&Bt(lt(o),"iterate",Or),o.size},has(o){const a=this.__v_raw,c=lt(a),f=lt(o);return e||($n(o,f)&&Bt(c,"has",o),Bt(c,"has",f)),o===f?a.has(o):a.has(o)||a.has(f)},forEach(o,a){const c=this,f=c.__v_raw,h=lt(f),g=t?ka:e?lr:dn;return!e&&Bt(h,"iterate",Or),f.forEach((y,_)=>o.call(a,g(y),g(_),c))}};return $t(n,e?{add:xo("add"),set:xo("set"),delete:xo("delete"),clear:xo("clear")}:{add(o){const a=lt(this),c=ko(a),f=lt(o),h=!t&&!cn(o)&&!Mn(o)?f:o;return c.has.call(a,h)||$n(o,h)&&c.has.call(a,o)||$n(f,h)&&c.has.call(a,f)||(a.add(h),Kn(a,"add",h,h)),this},set(o,a){!t&&!cn(a)&&!Mn(a)&&(a=lt(a));const c=lt(this),{has:f,get:h}=ko(c);let g=f.call(c,o);g||(o=lt(o),g=f.call(c,o));const y=h.call(c,o);return c.set(o,a),g?$n(a,y)&&Kn(c,"set",o,a):Kn(c,"add",o,a),this},delete(o){const a=lt(this),{has:c,get:f}=ko(a);let h=c.call(a,o);h||(o=lt(o),h=c.call(a,o)),f&&f.call(a,o);const g=a.delete(o);return h&&Kn(a,"delete",o,void 0),g},clear(){const o=lt(this),a=o.size!==0,c=o.clear();return a&&Kn(o,"clear",void 0,void 0),c}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Ef(o,e,t)}),n}function Qa(e,t){const n=$f(e,t);return(s,o,a)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_isShallow"?t:o==="__v_raw"?s:Reflect.get(ut(n,o)&&o in s?n:s,o,a)}const Tf={get:Qa(!1,!1)},Pf={get:Qa(!1,!0)},Af={get:Qa(!0,!1)};const uc=new WeakMap,cc=new WeakMap,dc=new WeakMap,Of=new WeakMap;function Mf(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Za(e){return Mn(e)?e:el(e,!1,xf,Tf,uc)}function If(e){return el(e,!1,Sf,Pf,cc)}function xa(e){return el(e,!0,Cf,Af,dc)}function el(e,t,n,s,o){if(!ct(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const a=o.get(e);if(a)return a;const c=Mf(tf(e));if(c===0)return e;const f=new Proxy(e,c===2?s:n);return o.set(e,f),f}function ir(e){return Mn(e)?ir(e.__v_raw):!!(e&&e.__v_isReactive)}function Mn(e){return!!(e&&e.__v_isReadonly)}function cn(e){return!!(e&&e.__v_isShallow)}function tl(e){return e?!!e.__v_raw:!1}function lt(e){const t=e&&e.__v_raw;return t?lt(t):e}function jf(e){return!ut(e,"__v_skip")&&Object.isExtensible(e)&&zu(e,"__v_skip",!0),e}const dn=e=>ct(e)?Za(e):e,lr=e=>ct(e)?xa(e):e;function Ht(e){return e?e.__v_isRef===!0:!1}function L(e){return Df(e,!1)}function Df(e,t){return Ht(e)?e:new Lf(e,t)}class Lf{constructor(t,n){this.dep=new Xa,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:lt(t),this._value=n?t:dn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||cn(t)||Mn(t);t=s?t:lt(t),$n(t,n)&&(this._rawValue=t,this._value=s?t:dn(t),this.dep.trigger())}}function Ut(e){return Ht(e)?e.value:e}const Rf={get:(e,t,n)=>t==="__v_raw"?e:Ut(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Ht(o)&&!Ht(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function fc(e){return ir(e)?e:new Proxy(e,Rf)}class Kf{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Xa(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Os-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&vt!==this)return Zu(this,!0),!0}get value(){const t=this.dep.track();return nc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Ff(e,t,n=!1){let s,o;return We(e)?s=e:(s=e.get,o=e.set),new Kf(s,o,n)}const Co={},Fo=new WeakMap;let Sr;function Nf(e,t=!1,n=Sr){if(n){let s=Fo.get(n);s||Fo.set(n,s=[]),s.push(e)}}function Vf(e,t,n=ft){const{immediate:s,deep:o,once:a,scheduler:c,augmentJob:f,call:h}=n,g=Q=>o?Q:cn(Q)||o===!1||o===0?Fn(Q,1):Fn(Q);let y,_,C,E,B=!1,ne=!1;if(Ht(e)?(_=()=>e.value,B=cn(e)):ir(e)?(_=()=>g(e),B=!0):Re(e)?(ne=!0,B=e.some(Q=>ir(Q)||cn(Q)),_=()=>e.map(Q=>{if(Ht(Q))return Q.value;if(ir(Q))return g(Q);if(We(Q))return h?h(Q,2):Q()})):We(e)?t?_=h?()=>h(e,2):e:_=()=>{if(C){An();try{C()}finally{On()}}const Q=Sr;Sr=y;try{return h?h(e,3,[E]):e(E)}finally{Sr=Q}}:_=Tn,t&&o){const Q=_,ce=o===!0?1/0:o;_=()=>Fn(Q(),ce)}const re=mf(),oe=()=>{y.stop(),re&&re.active&&Wa(re.effects,y)};if(a&&t){const Q=t;t=(...ce)=>{try{return Q(...ce)}finally{oe()}}}let $=ne?new Array(e.length).fill(Co):Co;const M=Q=>{if(!(!(y.flags&1)||!y.dirty&&!Q))if(t){const ce=y.run();if(Q||o||B||(ne?ce.some((ie,Y)=>$n(ie,$[Y])):$n(ce,$))){const ie=Sr;An();try{C&&C(),Sr=y;const Y=[ce,$===Co?void 0:ne&&$[0]===Co?[]:$,E];$=ce,h?h(t,3,Y):t(...Y)}finally{Sr=ie,On()}}}else y.run()};return f&&f(M),y=new Xu(_),y.scheduler=c?()=>c(M,!1):M,E=Q=>Nf(Q,!1,y),C=y.onStop=()=>{const Q=Fo.get(y);if(Q){if(h)h(Q,4);else for(const ce of Q)ce();Fo.delete(y)}},t?s?M(!0):$=y.run():c?c(M.bind(null,!0),!0):y.run(),oe.pause=y.pause.bind(y),oe.resume=y.resume.bind(y),oe.stop=oe,oe}function Fn(e,t=1/0,n){if(t<=0||!ct(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ht(e))Fn(e.value,t,n);else if(Re(e))for(let s=0;s<e.length;s++)Fn(e[s],t,n);else if(Ir(e)||sr(e))e.forEach(s=>{Fn(s,t,n)});else if(Hu(e)){for(const s in e)Fn(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Fn(e[s],t,n)}return e}/**
* @vue/runtime-core v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Hs(e,t,n,s){try{return s?e(...s):e()}catch(o){vi(o,t,n)}}function fn(e,t,n,s){if(We(e)){const o=Hs(e,t,n,s);return o&&Uu(o)&&o.catch(a=>{vi(a,t,n)}),o}if(Re(e)){const o=[];for(let a=0;a<e.length;a++)o.push(fn(e[a],t,n,s));return o}}function vi(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:c}=t&&t.appContext.config||ft;if(t){let f=t.parent;const h=t.proxy,g=`https://vuejs.org/error-reference/#runtime-${n}`;for(;f;){const y=f.ec;if(y){for(let _=0;_<y.length;_++)if(y[_](e,h,g)===!1)return}f=f.parent}if(a){An(),Hs(a,null,10,[e,h,g]),On();return}}Bf(e,n,o,s,c)}function Bf(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Xt=[];let hn=-1;const Sn=[];let nr=null,zr=0;const pc=Promise.resolve();let No=null;function ss(e){const t=No||pc;return e?t.then(this?e.bind(this):e):t}function Uf(e){let t=hn+1,n=Xt.length;for(;t<n;){const s=t+n>>>1,o=Xt[s],a=Is(o);a<e||a===e&&o.flags&2?t=s+1:n=s}return t}function nl(e){if(!(e.flags&1)){const t=Is(e),n=Xt[Xt.length-1];!n||!(e.flags&2)&&t>=Is(n)?Xt.push(e):Xt.splice(Uf(t),0,e),e.flags|=1,vc()}}function vc(){No||(No=pc.then(yc))}function qf(e){if(!Re(e))nr&&e.id===-1?nr.splice(zr+1,0,e):e.flags&1||(Sn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)Sn.push(e[t]);vc()}function hc(e,t,n,s=hn+1){for(;s<Xt.length;s++){const o=Xt[s];if(o&&o.flags&2){if(e&&o.id!==e.uid||t!==void 0&&!(o.id>=t))continue;Xt.splice(s,1),s=e?s-1:hn,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function mc(e,t,n=0){if(Sn.length){let s=Sn,o=0;if(t){s=[];for(let c=0;c<Sn.length;c++){const f=Sn[c];(f.i!==void 0?!f.i||f.i.uid<n:t.has(f))?Sn[o++]=f:s.push(f)}}const a=[...new Set(s)].sort((c,f)=>Is(c)-Is(f));if(Sn.length=o,nr){for(let c=0;c<a.length;c++)nr.push(a[c]);return}for(nr=a,zr=0;zr<nr.length;zr++){const c=nr[zr];c.flags&4&&(c.flags&=-2),c.flags&8||c(),c.flags&=-2}nr=null,zr=0}}let la=!1;function Hf(e,t){if(la){e();return}const n=t===void 0?void 0:new Set(Sn);e(),la=!0;try{hc(void 0,t),mc(void 0,n,t)}finally{la=!1}}const Is=e=>e.id==null?e.flags&2?-1:1/0:e.id;function yc(e){try{for(hn=0;hn<Xt.length;hn++){const t=Xt[hn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Hs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;hn<Xt.length;hn++){const t=Xt[hn];t&&(t.flags&=-2)}hn=-1,Xt.length=0,mc(),No=null,(Xt.length||Sn.length)&&yc()}}let un=null,gc=null;function Vo(e){const t=un;return un=e,gc=e&&e.type.__scopeId||null,t}function fr(e,t=un,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Ho(-1);const a=Vo(t),c=Mr.length;let f;try{f=e(...o)}finally{for(let h=Mr.length;h>c;h--)Wc();Vo(a),s._d&&Ho(1)}return f};return s._n=!0,s._c=!0,s._d=!0,s}function Te(e,t){if(un===null)return e;const n=wi(un),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[a,c,f,h=ft]=t[o];a&&(We(a)&&(a={mounted:a,updated:a}),a.deep&&Fn(c),s.push({dir:a,instance:n,value:c,oldValue:void 0,arg:f,modifiers:h}))}return e}function kr(e,t,n,s){const o=e.dirs,a=t&&t.dirs;for(let c=0;c<o.length;c++){const f=o[c];a&&(f.oldValue=a[c].value);let h=f.dir[s];h&&(An(),fn(h,n,8,[e.el,f,e,t]),On())}}function Wf(e,t){if(Qt){let n=Qt.provides;const s=Qt.parent&&Qt.parent.provides;s===n&&(n=Qt.provides=Object.create(s)),n[e]=t}}function Ao(e,t,n=!1){const s=al();if(s||Jr){let o=Jr?Jr._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&We(t)?t.call(s&&s.proxy):t}}const zf=Symbol.for("v-scx"),Gf=()=>Ao(zf);function ht(e,t,n){return bc(e,t,n)}function bc(e,t,n=ft){const{immediate:s,deep:o,flush:a,once:c}=n,f=$t({},n),h=t&&s||!t&&a!=="post";let g;if(Fs){if(a==="sync"){const E=Gf();g=E.__watcherHandles||(E.__watcherHandles=[])}else if(!h){const E=()=>{};return E.stop=Tn,E.resume=Tn,E.pause=Tn,E}}const y=Qt;f.call=(E,B,ne)=>fn(E,y,B,ne);let _=!1;a==="post"?f.scheduler=E=>{E.i=y,Jt(E,y&&y.suspense)}:a!=="sync"&&(_=!0,f.scheduler=(E,B)=>{B?E():nl(E)}),f.augmentJob=E=>{t&&(E.flags|=4),_&&(E.flags|=2,y&&(E.id=y.uid,E.i=y))};const C=Vf(e,t,f);return Fs&&(g?g.push(C):h&&C()),C}function Yf(e,t,n){const s=this.proxy,o=bt(e)?e.includes(".")?wc(s,e):()=>s[e]:e.bind(s,s);let a;We(t)?a=t:(a=t.handler,n=t);const c=Ws(this),f=bc(o,a.bind(s),n);return c(),f}function wc(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const er=new WeakMap,_c=Symbol("_vte"),hi=e=>e.__isTeleport,Er=e=>e&&(e.disabled||e.disabled===""),Jf=e=>e&&(e.defer||e.defer===""),nu=e=>typeof SVGElement<"u"&&e instanceof SVGElement,ru=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ca=(e,t)=>{const n=e&&e.to;return bt(n)?t?t(n):null:n},Xf={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,a,c,f,h,g){const{mc:y,pc:_,pbc:C,o:{insert:E,querySelector:B,createText:ne,createComment:re,parentNode:oe}}=g,$=Er(t.props);let{dynamicChildren:M}=t;const Q=(Y,A,x)=>{Y.shapeFlag&16&&y(Y.children,A,x,o,a,c,f,h)},ce=(Y=t)=>{const A=Er(Y.props),x=Y.target=Ca(Y.props,B),N=Sa(x,Y,ne,E);x&&(c!=="svg"&&nu(x)?c="svg":c!=="mathml"&&ru(x)&&(c="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(x),A||(Q(Y,x,N),bs(Y,!1)))},ie=Y=>{const A=()=>{if(er.get(Y)===A){if(er.delete(Y),Er(Y.props)){const x=oe(Y.el)||n;Q(Y,x,Y.anchor),bs(Y,!0)}ce(Y)}};er.set(Y,A),Jt(A,a)};if(e==null){const Y=t.el=ne(""),A=t.anchor=ne("");if(E(Y,n,s),E(A,n,s),Jf(t.props)||a&&a.pendingBranch){ie(t);return}$&&(Q(t,n,A),bs(t,!0)),ce()}else{t.el=e.el;const Y=t.anchor=e.anchor,A=er.get(e);if(A){A.flags|=8,er.delete(e),ie(t);return}t.targetStart=e.targetStart;const x=t.target=e.target,N=t.targetAnchor=e.targetAnchor,le=Er(e.props),W=le?n:x,ke=le?Y:N;if(c==="svg"||nu(x)?c="svg":(c==="mathml"||ru(x))&&(c="mathml"),M?(C(e.dynamicChildren,M,W,o,a,c,f),il(e,t,!0)):h||_(e,t,W,ke,o,a,c,f,!1),$)le?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):So(t,n,Y,g,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Pe=Ca(t.props,B);Pe&&(t.target=Pe,So(t,Pe,null,g,0))}else le&&So(t,x,N,g,1);bs(t,$)}},remove(e,t,n,{um:s,o:{remove:o}},a){const{shapeFlag:c,children:f,anchor:h,targetStart:g,targetAnchor:y,target:_,props:C}=e,E=Er(C),B=a||!E,ne=er.get(e);if(ne&&(ne.flags|=8,er.delete(e)),_&&(o(g),o(y)),a&&o(h),!ne&&(E||_)&&c&16)for(let re=0;re<f.length;re++){const oe=f[re];s(oe,t,n,B,!!oe.dynamicChildren)}},move:So,hydrate:Qf};function So(e,t,n,{o:{insert:s},m:o},a=2){a===0&&(e.targetStart&&s(e.targetStart,t,n),s(e.targetAnchor,t,n),n=e.targetAnchor);const{el:c,anchor:f,shapeFlag:h,children:g,props:y}=e,_=a===2;if(_&&s(c,t,n),!er.has(e)&&(!_||Er(y))&&h&16)for(let C=0;C<g.length;C++)o(g[C],t,n,2);_&&s(f,t,n)}function Qf(e,t,n,s,o,a,{o:{nextSibling:c,parentNode:f,querySelector:h,insert:g,createText:y}},_){function C(re,oe){let $=oe;for(;$;){if($&&$.nodeType===8){if($.data==="teleport start anchor")t.targetStart=$;else if($.data==="teleport anchor"){t.targetAnchor=$,re._lpa=t.targetAnchor&&c(t.targetAnchor);break}}$=c($)}}function E(re,oe){oe.anchor=_(c(re),oe,f(re),n,s,o,a)}const B=t.target=Ca(t.props,h),ne=Er(t.props);if(B){const re=B._lpa||B.firstChild;t.shapeFlag&16&&(ne?(E(e,t),C(B,re),t.targetAnchor||Sa(B,t,y,g,f(e)===B?e:null)):(t.anchor=c(e),C(B,re),t.targetAnchor||Sa(B,t,y,g),_(re&&c(re),t,B,n,s,o,a))),bs(t,ne)}else ne&&t.shapeFlag&16&&(E(e,t),t.targetStart=e,t.targetAnchor=c(e));return t.anchor&&c(t.anchor)}const jr=Xf;function bs(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Sa(e,t,n,s,o=null){const a=t.targetStart=n(""),c=t.targetAnchor=n("");return a[_c]=c,e&&(s(a,e,o),s(c,e,o)),c}const ln=Symbol("_leaveCb"),ys=Symbol("_enterCb");function kc(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return pn(()=>{e.isMounted=!0}),Pc(()=>{e.isUnmounting=!0}),e}const an=[Function,Array],xc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:an,onEnter:an,onAfterEnter:an,onEnterCancelled:an,onBeforeLeave:an,onLeave:an,onAfterLeave:an,onLeaveCancelled:an,onBeforeAppear:an,onAppear:an,onAfterAppear:an,onAppearCancelled:an},Zf={name:"BaseTransition",props:xc,setup(e,{slots:t}){const n=al(),s=kc();return()=>{const o=t.default&&rl(t.default(),!0),a=o&&o.length?Cc(o):n.subTree?Ce():void 0;if(!a)return;const c=lt(e),{mode:f}=c;if(s.isLeaving)return ua(a);const h=Bo(a);if(!h)return ua(a);let g=js(h,c,s,n,_=>g=_);h.type!==qt&&ur(h,g);let y=n.subTree&&Bo(n.subTree);if(y&&y.type!==qt&&!$r(y,h)&&Ds(n.subTree)){let _=js(y,c,s,n);if(ur(y,_),f==="out-in"&&h.type!==qt)return s.isLeaving=!0,_.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete _.afterLeave,y=void 0},ua(a);f==="in-out"&&h.type!==qt?_.delayLeave=(C,E,B)=>{const ne=Sc(s,y);ne[String(y.key)]=y,C[ln]=()=>{E(),C[ln]=void 0,delete g.delayedLeave,y=void 0},g.delayedLeave=()=>{B(),delete g.delayedLeave,y=void 0}}:y=void 0}else y&&(y=void 0);return a}}};function Cc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==qt){t=n;break}}return t}const ep=Zf;function Sc(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function js(e,t,n,s,o){const{appear:a,mode:c,persisted:f=!1,onBeforeEnter:h,onEnter:g,onAfterEnter:y,onEnterCancelled:_,onBeforeLeave:C,onLeave:E,onAfterLeave:B,onLeaveCancelled:ne,onBeforeAppear:re,onAppear:oe,onAfterAppear:$,onAppearCancelled:M}=t,Q=String(e.key),ce=Sc(n,e),ie=(x,N)=>{x&&fn(x,s,9,N)},Y=(x,N)=>{const le=N[1];ie(x,N),Re(x)?x.every(W=>W.length<=1)&&le():x.length<=1&&le()},A={mode:c,persisted:f,beforeEnter(x){let N=h;if(!n.isMounted)if(a)N=re||h;else return;x[ln]&&x[ln](!0);const le=ce[Q];if(le&&$r(e,le)){let W=le.el[ln];if(!W){const ke=Ds(le);W=ke&&ke.el[ln]}W&&W()}ie(N,[x])},enter(x){if(ce[Q]===e)return;let N=g,le=y,W=_;if(!n.isMounted)if(a)N=oe||g,le=$||y,W=M||_;else return;let ke=!1;x[ys]=Je=>{ke||(ke=!0,Je?ie(W,[x]):ie(le,[x]),A.delayedLeave&&A.delayedLeave(),x[ys]=void 0)};const Pe=x[ys].bind(null,!1);N?Y(N,[x,Pe]):Pe()},leave(x,N){const le=String(e.key);if(x[ys]&&x[ys](!0),n.isUnmounting)return N();ie(C,[x]);let W=!1;x[ln]=Pe=>{W||(W=!0,N(),Pe?ie(ne,[x]):ie(B,[x]),x[ln]=void 0,ce[le]===e&&delete ce[le])};const ke=x[ln].bind(null,!1);ce[le]=e,E?Y(E,[x,ke]):ke()},clone(x){const N=js(x,t,n,s,o);return o&&o(N),N}};return A}function ua(e){if(mi(e))return e=cr(e),e.children=null,e}function Bo(e){if(!mi(e))return hi(e.type)&&e.children?Cc(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&&We(n.default))return n.default()}}function ur(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;ur(hi(n.type)&&Bo(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===Ie&&Re(e.children)){const n=jc(e.children,!1);n&&ur(n,t)}}function rl(e,t=!1,n){let s=[],o=0;for(let a=0;a<e.length;a++){let c=e[a];const f=n==null?c.key:String(n)+String(c.key!=null?c.key:a);c.type===Ie?(c.patchFlag&128&&o++,s=s.concat(rl(c.children,t,f))):(t||c.type!==qt)&&s.push(f!=null?cr(c,{key:f}):c)}if(o>1)for(let a=0;a<s.length;a++)s[a].patchFlag=-2;return s}function Ds(e){if(e.component)return Ds(e.component.subTree);if(e.type===Ie){const t=Re(e.children)&&jc(e.children,!1);return t?Ds(t):void 0}if(e.type!==qt)return e}function Rt(e,t){return We(e)?$t({name:e.name},t,{setup:e}):e}function Ec(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function su(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Uo=new WeakMap;function Ss(e,t,n,s,o=!1){if(Re(e)){e.forEach((ne,re)=>Ss(ne,t&&(Re(t)?t[re]:t),n,s,o));return}if(Es(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Ss(e,t,n,s.component.subTree);return}const a=s.shapeFlag&4?wi(s.component):s.el,c=o?null:a,{i:f,r:h}=e,g=t&&t.r,y=f.refs===ft?f.refs={}:f.refs,_=f.setupState,C=lt(_),E=_===ft?Bu:ne=>su(y,ne)?!1:ut(C,ne),B=(ne,re)=>!(re&&su(y,re));if(g!=null&&g!==h){if(ou(t),bt(g))y[g]=null,E(g)&&(_[g]=null);else if(Ht(g)){const ne=t;B(g,ne.k)&&(g.value=null),ne.k&&(y[ne.k]=null)}}if(We(h))Hs(h,f,12,[c,y]);else{const ne=bt(h),re=Ht(h);if(ne||re){const oe=()=>{if(e.f){const $=ne?E(h)?_[h]:y[h]:B()||!e.k?h.value:y[e.k];if(o)Re($)&&Wa($,a);else if(Re($))$.includes(a)||$.push(a);else if(ne)y[h]=[a],E(h)&&(_[h]=y[h]);else{const M=[a];B(h,e.k)&&(h.value=M),e.k&&(y[e.k]=M)}}else ne?(y[h]=c,E(h)&&(_[h]=c)):re&&(B(h,e.k)&&(h.value=c),e.k&&(y[e.k]=c))};if(c){const $=()=>{oe(),Uo.delete(e)};$.id=-1,Uo.set(e,$),Jt($,n)}else ou(e),oe()}}}function ou(e){const t=Uo.get(e);t&&(t.flags|=8,Uo.delete(e))}fi().requestIdleCallback;fi().cancelIdleCallback;const Es=e=>!!e.type.__asyncLoader,mi=e=>e.type.__isKeepAlive;function tp(e,t){$c(e,"a",t)}function np(e,t){$c(e,"da",t)}function $c(e,t,n=Qt){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(yi(t,s,n),n){let o=n.parent;for(;o&&o.parent;)mi(o.parent.vnode)&&rp(s,t,n,o),o=o.parent}}function rp(e,t,n,s){const o=yi(t,e,s,!0);pr(()=>{Wa(s[t],o)},n)}function yi(e,t,n=Qt,s=!1){if(n){const o=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...c)=>{An();const f=Ws(n),h=fn(t,n,e,c);return f(),On(),h});return s?o.unshift(a):o.push(a),a}}const Hn=e=>(t,n=Qt)=>{(!Fs||e==="sp")&&yi(e,(...s)=>t(...s),n)},sp=Hn("bm"),pn=Hn("m"),op=Hn("bu"),Tc=Hn("u"),Pc=Hn("bum"),pr=Hn("um"),ip=Hn("sp"),ap=Hn("rtg"),lp=Hn("rtc");function up(e,t=Qt){yi("ec",e,t)}const cp=Symbol.for("v-ndc");function ot(e,t,n,s){let o;const a=n,c=Re(e);if(c||bt(e)){const f=c&&ir(e);let h=!1,g=!1;f&&(h=!cn(e),g=Mn(e),e=pi(e)),o=new Array(e.length);for(let y=0,_=e.length;y<_;y++)o[y]=t(h?g?lr(dn(e[y])):dn(e[y]):e[y],y,void 0,a)}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,a)}else if(ct(e))if(e[Symbol.iterator])o=Array.from(e,(f,h)=>t(f,h,void 0,a));else{const f=Object.keys(e);o=new Array(f.length);for(let h=0,g=f.length;h<g;h++){const y=f[h];o[h]=t(e[y],y,h,a)}}else o=[];return o}const Ea=e=>e?Jc(e)?wi(e):Ea(e.parent):null,$s=$t(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=>Ea(e.parent),$root:e=>Ea(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Oc(e),$forceUpdate:e=>e.f||(e.f=()=>{nl(e.update)}),$nextTick:e=>e.n||(e.n=ss.bind(e.proxy)),$watch:e=>Yf.bind(e)}),ca=(e,t)=>e!==ft&&!e.__isScriptSetup&&ut(e,t),dp={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:a,accessCache:c,type:f,appContext:h}=e;if(t[0]!=="$"){const C=c[t];if(C!==void 0)switch(C){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return a[t]}else{if(ca(s,t))return c[t]=1,s[t];if(o!==ft&&ut(o,t))return c[t]=2,o[t];if(ut(a,t))return c[t]=3,a[t];if(n!==ft&&ut(n,t))return c[t]=4,n[t];$a&&(c[t]=0)}}const g=$s[t];let y,_;if(g)return t==="$attrs"&&Bt(e.attrs,"get",""),g(e);if((y=f.__cssModules)&&(y=y[t]))return y;if(n!==ft&&ut(n,t))return c[t]=4,n[t];if(_=h.config.globalProperties,ut(_,t))return _[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:a}=e;return ca(o,t)?(o[t]=n,!0):s!==ft&&ut(s,t)?(s[t]=n,!0):ut(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:a,type:c}},f){let h;return!!(n[f]||e!==ft&&f[0]!=="$"&&ut(e,f)||ca(t,f)||ut(a,f)||ut(s,f)||ut($s,f)||ut(o.config.globalProperties,f)||(h=c.__cssModules)&&h[f])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ut(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function iu(e){return Re(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let $a=!0;function fp(e){const t=Oc(e),n=e.proxy,s=e.ctx;$a=!1,t.beforeCreate&&au(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:c,watch:f,provide:h,inject:g,created:y,beforeMount:_,mounted:C,beforeUpdate:E,updated:B,activated:ne,deactivated:re,beforeDestroy:oe,beforeUnmount:$,destroyed:M,unmounted:Q,render:ce,renderTracked:ie,renderTriggered:Y,errorCaptured:A,serverPrefetch:x,expose:N,inheritAttrs:le,components:W,directives:ke,filters:Pe}=t;if(g&&pp(g,s,null),c)for(const qe in c){const Ne=c[qe];We(Ne)&&(s[qe]=Ne.bind(n))}if(o){const qe=o.call(n,n);ct(qe)&&(e.data=Za(qe))}if($a=!0,a)for(const qe in a){const Ne=a[qe],it=We(Ne)?Ne.bind(n,n):We(Ne.get)?Ne.get.bind(n,n):Tn,Ge=!We(Ne)&&We(Ne.set)?Ne.set.bind(n):Tn,Qe=st({get:it,set:Ge});Object.defineProperty(s,qe,{enumerable:!0,configurable:!0,get:()=>Qe.value,set:Se=>Qe.value=Se})}if(f)for(const qe in f)Ac(f[qe],s,n,qe);if(h){const qe=We(h)?h.call(n):h;Reflect.ownKeys(qe).forEach(Ne=>{Wf(Ne,qe[Ne])})}y&&au(y,e,"c");function Le(qe,Ne){Re(Ne)?Ne.forEach(it=>qe(it.bind(n))):Ne&&qe(Ne.bind(n))}if(Le(sp,_),Le(pn,C),Le(op,E),Le(Tc,B),Le(tp,ne),Le(np,re),Le(up,A),Le(lp,ie),Le(ap,Y),Le(Pc,$),Le(pr,Q),Le(ip,x),Re(N))if(N.length){const qe=e.exposed||(e.exposed={});N.forEach(Ne=>{Object.defineProperty(qe,Ne,{get:()=>n[Ne],set:it=>n[Ne]=it,enumerable:!0})})}else e.exposed||(e.exposed={});ce&&e.render===Tn&&(e.render=ce),le!=null&&(e.inheritAttrs=le),W&&(e.components=W),ke&&(e.directives=ke),x&&Ec(e)}function pp(e,t,n=Tn){Re(e)&&(e=Ta(e));for(const s in e){const o=e[s];let a;ct(o)?"default"in o?a=Ao(o.from||s,o.default,!0):a=Ao(o.from||s):a=Ao(o),Ht(a)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>a.value,set:c=>a.value=c}):t[s]=a}}function au(e,t,n){fn(Re(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ac(e,t,n,s){let o=s.includes(".")?wc(n,s):()=>n[s];if(bt(e)){const a=t[e];We(a)&&ht(o,a)}else if(We(e))ht(o,e.bind(n));else if(ct(e))if(Re(e))e.forEach(a=>Ac(a,t,n,s));else{const a=We(e.handler)?e.handler.bind(n):t[e.handler];We(a)&&ht(o,a,e)}}function Oc(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:a,config:{optionMergeStrategies:c}}=e.appContext,f=a.get(t);let h;return f?h=f:!o.length&&!n&&!s?h=t:(h={},o.length&&o.forEach(g=>qo(h,g,c,!0)),qo(h,t,c)),ct(t)&&a.set(t,h),h}function qo(e,t,n,s=!1){const{mixins:o,extends:a}=t;a&&qo(e,a,n,!0),o&&o.forEach(c=>qo(e,c,n,!0));for(const c in t)if(!(s&&c==="expose")){const f=vp[c]||n&&n[c];e[c]=f?f(e[c],t[c]):t[c]}return e}const vp={data:lu,props:uu,emits:uu,methods:ws,computed:ws,beforeCreate:Yt,created:Yt,beforeMount:Yt,mounted:Yt,beforeUpdate:Yt,updated:Yt,beforeDestroy:Yt,beforeUnmount:Yt,destroyed:Yt,unmounted:Yt,activated:Yt,deactivated:Yt,errorCaptured:Yt,serverPrefetch:Yt,components:ws,directives:ws,watch:mp,provide:lu,inject:hp};function lu(e,t){return t?e?function(){return $t(We(e)?e.call(this,this):e,We(t)?t.call(this,this):t)}:t:e}function hp(e,t){return ws(Ta(e),Ta(t))}function Ta(e){if(Re(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Yt(e,t){return e?[...new Set([].concat(e,t))]:t}function ws(e,t){return e?$t(Object.create(null),e,t):t}function uu(e,t){return e?Re(e)&&Re(t)?[...new Set([...e,...t])]:$t(Object.create(null),iu(e),iu(t??{})):t}function mp(e,t){if(!e)return t;if(!t)return e;const n=$t(Object.create(null),e);for(const s in t)n[s]=Yt(e[s],t[s]);return n}function Mc(){return{app:null,config:{isNativeTag:Bu,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 yp=0;function gp(e,t){return function(s,o=null){We(s)||(s=$t({},s)),o!=null&&!ct(o)&&(o=null);const a=Mc(),c=new WeakSet,f=[];let h=!1;const g=a.app={_uid:yp++,_component:s,_props:o,_container:null,_context:a,_instance:null,version:Jp,get config(){return a.config},set config(y){},use(y,..._){return c.has(y)||(y&&We(y.install)?(c.add(y),y.install(g,..._)):We(y)&&(c.add(y),y(g,..._))),g},mixin(y){return a.mixins.includes(y)||a.mixins.push(y),g},component(y,_){return _?(a.components[y]=_,g):a.components[y]},directive(y,_){return _?(a.directives[y]=_,g):a.directives[y]},mount(y,_,C){if(!h){const E=g._ceVNode||$e(s,o);return E.appContext=a,C===!0?C="svg":C===!1&&(C=void 0),e(E,y,C),h=!0,g._container=y,y.__vue_app__=g,wi(E.component)}},onUnmount(y){f.push(y)},unmount(){h&&(fn(f,g._instance,16),e(null,g._container),delete g._container.__vue_app__)},provide(y,_){return a.provides[y]=_,g},runWithContext(y){const _=Jr;Jr=g;try{return y()}finally{Jr=_}}};return g}}let Jr=null;const bp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${mn(t)}Modifiers`]||e[`${dr(t)}Modifiers`];function wp(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||ft;let o=n;const a=t.startsWith("update:"),c=a&&bp(s,t.slice(7));c&&(c.trim&&(o=n.map(y=>bt(y)?y.trim():y)),c.number&&(o=o.map(di)));let f,h=s[f=ra(t)]||s[f=ra(mn(t))];!h&&a&&(h=s[f=ra(dr(t))]),h&&fn(h,e,6,o);const g=s[f+"Once"];if(g){if(!e.emitted)e.emitted={};else if(e.emitted[f])return;e.emitted[f]=!0,fn(g,e,6,o)}}const _p=new WeakMap;function Ic(e,t,n=!1){const s=n?_p:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const a=e.emits;let c={},f=!1;if(!We(e)){const h=g=>{const y=Ic(g,t,!0);y&&(f=!0,$t(c,y))};!n&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}return!a&&!f?(ct(e)&&s.set(e,null),null):(Re(a)?a.forEach(h=>c[h]=null):$t(c,a),ct(e)&&s.set(e,c),c)}function gi(e,t){return!e||!li(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),ut(e,t[0].toLowerCase()+t.slice(1))||ut(e,dr(t))||ut(e,t))}function cu(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[a],slots:c,attrs:f,emit:h,render:g,renderCache:y,props:_,data:C,setupState:E,ctx:B,inheritAttrs:ne}=e,re=Vo(e);let oe,$;try{if(n.shapeFlag&4){const Q=o||s,ce=Q;oe=En(g.call(ce,Q,y,_,E,C,B)),$=f}else{const Q=t;oe=En(Q.length>1?Q(_,{attrs:f,slots:c,emit:h}):Q(_,null)),$=t.props?f:kp(f)}}catch(Q){Mr.length=0,vi(Q,e,1),oe=$e(qt)}let M=oe;if($&&ne!==!1){const Q=Object.keys($),{shapeFlag:ce}=M;Q.length&&ce&7&&(a&&Q.some(ui)&&($=xp($,a)),M=cr(M,$,!1,!0))}if(n.dirs&&(M=cr(M,null,!1,!0),M.dirs=M.dirs?M.dirs.concat(n.dirs):n.dirs),n.transition){const Q=hi(M.type)&&Bo(M)||M;ur(Q,n.transition)}return oe=M,Vo(re),oe}function jc(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(Rs(o)){if(o.type!==qt||o.children==="v-if"){if(n)return;n=o}}else return}return n}const kp=e=>{let t;for(const n in e)(n==="class"||n==="style"||li(n))&&((t||(t={}))[n]=e[n]);return t},xp=(e,t)=>{const n={};for(const s in e)(!ui(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Cp(e,t,n){const{props:s,children:o,component:a}=e,{props:c,children:f,patchFlag:h}=t,g=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&h>=0){if(h&1024)return!0;if(h&16)return s?du(s,c,g):!!c;if(h&8){const y=t.dynamicProps;for(let _=0;_<y.length;_++){const C=y[_];if(Dc(c,s,C)&&!gi(g,C))return!0}}}else return(o||f)&&(!f||!f.$stable)?!0:s===c?!1:s?c?du(s,c,g):!0:!!c;return!1}function du(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const a=s[o];if(!ut(e,a)||Dc(t,e,a)&&!gi(n,a))return!0}return!1}function Dc(e,t,n){const s=e[n],o=t[n];return n==="style"&&ct(s)&&ct(o)?!ar(s,o):s!==o}function Sp({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const Lc={},Rc=()=>Object.create(Lc),Kc=e=>Object.getPrototypeOf(e)===Lc;function Ep(e,t,n,s=!1){const o={},a=Rc();e.propsDefaults=Object.create(null),Fc(e,t,o,a);for(const c in e.propsOptions[0])c in o||(o[c]=void 0);n?e.props=s?o:If(o):e.type.props?e.props=o:e.props=a,e.attrs=a}function $p(e,t,n,s){const{props:o,attrs:a,vnode:{patchFlag:c}}=e,f=lt(o),[h]=e.propsOptions;let g=!1;if((s||c>0)&&!(c&16)){if(c&8){const y=e.vnode.dynamicProps;for(let _=0;_<y.length;_++){let C=y[_];if(gi(e.emitsOptions,C))continue;const E=t[C];if(h)if(ut(a,C))E!==a[C]&&(a[C]=E,g=!0);else{const B=mn(C);o[B]=Pa(h,f,B,E,e,!1)}else E!==a[C]&&(a[C]=E,g=!0)}}}else{Fc(e,t,o,a)&&(g=!0);let y;for(const _ in f)(!t||!ut(t,_)&&((y=dr(_))===_||!ut(t,y)))&&(h?n&&(n[_]!==void 0||n[y]!==void 0)&&(o[_]=Pa(h,f,_,void 0,e,!0)):delete o[_]);if(a!==f)for(const _ in a)(!t||!ut(t,_))&&(delete a[_],g=!0)}g&&Kn(e.attrs,"set","")}function Fc(e,t,n,s){const[o,a]=e.propsOptions;let c=!1,f;if(t)for(let h in t){if(ks(h))continue;const g=t[h];let y;o&&ut(o,y=mn(h))?!a||!a.includes(y)?n[y]=g:(f||(f={}))[y]=g:gi(e.emitsOptions,h)||(!(h in s)||g!==s[h])&&(s[h]=g,c=!0)}if(a){const h=lt(n),g=f||ft;for(let y=0;y<a.length;y++){const _=a[y];n[_]=Pa(o,h,_,g[_],e,!ut(g,_))}}return c}function Pa(e,t,n,s,o,a){const c=e[n];if(c!=null){const f=ut(c,"default");if(f&&s===void 0){const h=c.default;if(c.type!==Function&&!c.skipFactory&&We(h)){const{propsDefaults:g}=o;if(n in g)s=g[n];else{const y=Ws(o);s=g[n]=h.call(null,t),y()}}else s=h;o.ce&&o.ce._setProp(n,s)}c[0]&&(a&&!f?s=!1:c[1]&&(s===""||s===dr(n))&&(s=!0))}return s}const Tp=new WeakMap;function Nc(e,t,n=!1){const s=n?Tp:t.propsCache,o=s.get(e);if(o)return o;const a=e.props,c={},f=[];let h=!1;if(!We(e)){const y=_=>{h=!0;const[C,E]=Nc(_,t,!0);$t(c,C),E&&f.push(...E)};!n&&t.mixins.length&&t.mixins.forEach(y),e.extends&&y(e.extends),e.mixins&&e.mixins.forEach(y)}if(!a&&!h)return ct(e)&&s.set(e,Pr),Pr;if(Re(a))for(let y=0;y<a.length;y++){const _=mn(a[y]);fu(_)&&(c[_]=ft)}else if(a)for(const y in a){const _=mn(y);if(fu(_)){const C=a[y],E=c[_]=Re(C)||We(C)?{type:C}:$t({},C),B=E.type;let ne=!1,re=!0;if(Re(B))for(let oe=0;oe<B.length;++oe){const $=B[oe],M=We($)&&$.name;if(M==="Boolean"){ne=!0;break}else M==="String"&&(re=!1)}else ne=We(B)&&B.name==="Boolean";E[0]=ne,E[1]=re,(ne||ut(E,"default"))&&f.push(_)}}const g=[c,f];return ct(e)&&s.set(e,g),g}function fu(e){return e[0]!=="$"&&!ks(e)}const sl=e=>e==="_"||e==="_ctx"||e==="$stable",ol=e=>Re(e)?e.map(En):[En(e)],Pp=(e,t,n)=>{if(t._n)return t;const s=fr((...o)=>ol(t(...o)),n);return s._c=!1,s},Vc=(e,t,n)=>{const s=e._ctx;for(const o in e){if(sl(o))continue;const a=e[o];if(We(a))t[o]=Pp(o,a,s);else if(a!=null){const c=ol(a);t[o]=()=>c}}},Bc=(e,t)=>{const n=ol(t);e.slots.default=()=>n},Uc=(e,t,n)=>{for(const s in t)(n||!sl(s))&&(e[s]=t[s])},Ap=(e,t,n)=>{const s=e.slots=Rc();if(e.vnode.shapeFlag&32){const o=t._;o?(Uc(s,t,n),n&&zu(s,"_",o,!0)):Vc(t,s)}else t&&Bc(e,t)},Op=(e,t,n)=>{const{vnode:s,slots:o}=e;let a=!0,c=ft;if(s.shapeFlag&32){const f=t._;f?n&&f===1?a=!1:Uc(o,t,n):(a=!t.$stable,Vc(t,o)),c=t}else t&&(Bc(e,t),c={default:1});if(a)for(const f in o)!sl(f)&&c[f]==null&&delete o[f]},Jt=Lp;function Mp(e){return Ip(e)}function Ip(e,t){const n=fi();n.__VUE__=!0;const{insert:s,remove:o,patchProp:a,createElement:c,createText:f,createComment:h,setText:g,setElementText:y,parentNode:_,nextSibling:C,setScopeId:E=Tn,insertStaticContent:B}=e,ne=(v,b,U,fe=null,V=null,ae=null,ue=void 0,ye=null,xe=!!b.dynamicChildren)=>{if(v===b)return;v&&!$r(v,b)&&(fe=dt(v),Se(v,V,ae,!0),v=null),b.patchFlag===-2&&(xe=!1,b.dynamicChildren=null),b.dynamicChildren&&v&&v.dynamicChildren&&v.dynamicChildren.hasOnce&&(b.dynamicChildren===Pr&&(b.dynamicChildren=[]),b.dynamicChildren.hasOnce=!0);const{type:G,ref:z,shapeFlag:X}=b;switch(G){case bi:re(v,b,U,fe);break;case qt:oe(v,b,U,fe);break;case Oo:v==null&&$(b,U,fe,ue);break;case Ie:W(v,b,U,fe,V,ae,ue,ye,xe);break;default:X&1?ce(v,b,U,fe,V,ae,ue,ye,xe):X&6?ke(v,b,U,fe,V,ae,ue,ye,xe):(X&64||X&128)&&G.process(v,b,U,fe,V,ae,ue,ye,xe,Tt)}z!=null&&V?Ss(z,v&&v.ref,ae,b||v,!b):z==null&&v&&v.ref!=null&&Ss(v.ref,null,ae,v,!0)},re=(v,b,U,fe)=>{if(v==null)s(b.el=f(b.children),U,fe);else{const V=b.el=v.el;b.children!==v.children&&g(V,b.children)}},oe=(v,b,U,fe)=>{v==null?s(b.el=h(b.children||""),U,fe):b.el=v.el},$=(v,b,U,fe)=>{[v.el,v.anchor]=B(v.children,b,U,fe,v.el,v.anchor)},M=({el:v,anchor:b},U,fe)=>{let V;for(;v&&v!==b;)V=C(v),s(v,U,fe),v=V;s(b,U,fe)},Q=({el:v,anchor:b})=>{let U;for(;v&&v!==b;)U=C(v),o(v),v=U;o(b)},ce=(v,b,U,fe,V,ae,ue,ye,xe)=>{if(b.type==="svg"?ue="svg":b.type==="math"&&(ue="mathml"),v==null)ie(b,U,fe,V,ae,ue,ye,xe);else{const G=v.el&&v.el._isVueCE?v.el:null;try{G&&G._beginPatch(),x(v,b,V,ae,ue,ye,xe)}finally{G&&G._endPatch()}}},ie=(v,b,U,fe,V,ae,ue,ye)=>{let xe,G;const{props:z,shapeFlag:X,transition:Ae,dirs:Ve}=v;if(xe=v.el=c(v.type,ae,z&&z.is,z),X&8?y(xe,v.children):X&16&&A(v.children,xe,null,fe,V,da(v,ae),ue,ye),Ve&&kr(v,null,fe,"created"),Y(xe,v,v.scopeId,ue,fe),z){for(const Ye in z)Ye!=="value"&&!ks(Ye)&&a(xe,Ye,null,z[Ye],ae,fe);"value"in z&&a(xe,"value",null,z.value,ae),(G=z.onVnodeBeforeMount)&&_n(G,fe,v)}Ve&&kr(v,null,fe,"beforeMount");const Ze=jp(V,Ae);Ze&&Ae.beforeEnter(xe),s(xe,b,U),((G=z&&z.onVnodeMounted)||Ze||Ve)&&Jt(()=>{try{G&&_n(G,fe,v),Ze&&Ae.enter(xe),Ve&&kr(v,null,fe,"mounted")}finally{}},V)},Y=(v,b,U,fe,V)=>{if(U&&E(v,U),fe)for(let ae=0;ae<fe.length;ae++)E(v,fe[ae]);if(V){let ae=V.subTree;if(b===ae||Hc(ae.type)&&(ae.ssContent===b||ae.ssFallback===b)){const ue=V.vnode;Y(v,ue,ue.scopeId,ue.slotScopeIds,V.parent)}}},A=(v,b,U,fe,V,ae,ue,ye,xe=0)=>{for(let G=xe;G<v.length;G++){const z=v[G]=ye?Rn(v[G]):En(v[G]);ne(null,z,b,U,fe,V,ae,ue,ye)}},x=(v,b,U,fe,V,ae,ue)=>{const ye=b.el=v.el;let{patchFlag:xe,dynamicChildren:G,dirs:z}=b;xe|=v.patchFlag&16;const X=v.props||ft,Ae=b.props||ft;let Ve;if(U&&xr(U,!1),(Ve=Ae.onVnodeBeforeUpdate)&&_n(Ve,U,b,v),z&&kr(b,v,U,"beforeUpdate"),U&&xr(U,!0),G&&(!v.dynamicChildren||v.dynamicChildren.length!==G.length)&&(xe=0,ue=!1,G=null),(X.innerHTML&&Ae.innerHTML==null||X.textContent&&Ae.textContent==null)&&y(ye,""),G?N(v.dynamicChildren,G,ye,U,fe,da(b,V),ae):ue||Ne(v,b,ye,null,U,fe,da(b,V),ae,!1),xe>0){if(xe&16)le(ye,X,Ae,U,V);else if(xe&2&&X.class!==Ae.class&&a(ye,"class",null,Ae.class,V),xe&4&&a(ye,"style",X.style,Ae.style,V),xe&8){const Ze=b.dynamicProps;for(let Ye=0;Ye<Ze.length;Ye++){const tt=Ze[Ye],mt=X[tt],kt=Ae[tt];(kt!==mt||tt==="value")&&a(ye,tt,mt,kt,V,U)}}xe&1&&v.children!==b.children&&y(ye,b.children)}else!ue&&G==null&&le(ye,X,Ae,U,V);((Ve=Ae.onVnodeUpdated)||z)&&Jt(()=>{Ve&&_n(Ve,U,b,v),z&&kr(b,v,U,"updated")},fe)},N=(v,b,U,fe,V,ae,ue)=>{for(let ye=0;ye<b.length;ye++){const xe=v[ye],G=b[ye],z=xe.el||Aa(xe),X=z&&(xe.type===Ie||!$r(xe,G)||xe.shapeFlag&198)?_(z):U;ne(xe,G,X,null,fe,V,ae,ue,!0)}},le=(v,b,U,fe,V)=>{if(b!==U){if(b!==ft)for(const ae in b)!ks(ae)&&!(ae in U)&&a(v,ae,b[ae],null,V,fe);for(const ae in U){if(ks(ae))continue;const ue=U[ae],ye=b[ae];ue!==ye&&ae!=="value"&&a(v,ae,ye,ue,V,fe)}"value"in U&&a(v,"value",b.value,U.value,V)}},W=(v,b,U,fe,V,ae,ue,ye,xe)=>{const G=b.el=v?v.el:f(""),z=b.anchor=v?v.anchor:f("");let{patchFlag:X,dynamicChildren:Ae,slotScopeIds:Ve}=b;Ve&&(ye=ye?ye.concat(Ve):Ve),v==null?(s(G,U,fe),s(z,U,fe),A(b.children||[],U,z,V,ae,ue,ye,xe)):X>0&&X&64&&Ae&&v.dynamicChildren&&v.dynamicChildren.length===Ae.length?(N(v.dynamicChildren,Ae,U,V,ae,ue,ye),(b.key!=null||V&&b===V.subTree)&&il(v,b,!0)):Ne(v,b,U,z,V,ae,ue,ye,xe)},ke=(v,b,U,fe,V,ae,ue,ye,xe)=>{b.slotScopeIds=ye,v==null?b.shapeFlag&512?V.ctx.activate(b,U,fe,ue,xe):Pe(b,U,fe,V,ae,ue,xe):Je(v,b,xe)},Pe=(v,b,U,fe,V,ae,ue)=>{const ye=v.component=Up(v,fe,V);if(mi(v)&&(ye.ctx.renderer=Tt),qp(ye,!1,ue),ye.asyncDep){if(V&&V.registerDep(ye,Le,ue,ae),!v.el){const xe=ye.subTree=$e(qt);oe(null,xe,b,U),v.placeholder=xe.el}}else Le(ye,v,b,U,V,ae,ue)},Je=(v,b,U)=>{const fe=b.component=v.component;if(Cp(v,b,U))if(fe.asyncDep&&!fe.asyncResolved){b.el=v.el,b.placeholder=v.placeholder,qe(fe,b,U);return}else fe.next=b,fe.update();else b.el=v.el,b.placeholder=v.placeholder,fe.vnode=b},Le=(v,b,U,fe,V,ae,ue)=>{const ye=()=>{if(v.isMounted){let{next:X,bu:Ae,u:Ve,parent:Ze,vnode:Ye}=v;{const zt=qc(v);if(zt){X&&(X.el=Ye.el,qe(v,X,ue)),zt.asyncDep.then(()=>{Jt(()=>{v.isUnmounted||G()},V)});return}}let tt=X,mt;xr(v,!1),X?(X.el=Ye.el,qe(v,X,ue)):X=Ye,Ae&&Po(Ae),(mt=X.props&&X.props.onVnodeBeforeUpdate)&&_n(mt,Ze,X,Ye),xr(v,!0);const kt=cu(v),Zt=v.subTree;v.subTree=kt,ne(Zt,kt,_(Zt.el),dt(Zt),v,V,ae),X.el=kt.el,tt===null&&Sp(v,kt.el),Ve&&Jt(Ve,V),(mt=X.props&&X.props.onVnodeUpdated)&&Jt(()=>_n(mt,Ze,X,Ye),V)}else{let X;const{el:Ae,props:Ve}=b,{bm:Ze,m:Ye,parent:tt,root:mt,type:kt}=v,Zt=Es(b);xr(v,!1),Ze&&Po(Ze),!Zt&&(X=Ve&&Ve.onVnodeBeforeMount)&&_n(X,tt,b),xr(v,!0);{mt.ce&&mt.ce._hasShadowRoot()&&mt.ce._injectChildStyle(kt,v.parent?v.parent.type:void 0);const zt=v.subTree=cu(v);ne(null,zt,U,fe,v,V,ae),b.el=zt.el}if(Ye&&Jt(Ye,V),!Zt&&(X=Ve&&Ve.onVnodeMounted)){const zt=b;Jt(()=>_n(X,tt,zt),V)}(b.shapeFlag&256||tt&&Es(tt.vnode)&&tt.vnode.shapeFlag&256)&&v.a&&Jt(v.a,V),v.isMounted=!0,b=U=fe=null}};v.scope.on();const xe=v.effect=new Xu(ye);v.scope.off();const G=v.update=xe.run.bind(xe),z=v.job=xe.runIfDirty.bind(xe);z.i=v,z.id=v.uid,xe.scheduler=()=>nl(z),xr(v,!0),G()},qe=(v,b,U)=>{b.component=v;const fe=v.vnode.props;v.vnode=b,v.next=null,$p(v,b.props,fe,U),Op(v,b.children,U),An(),hc(v),On()},Ne=(v,b,U,fe,V,ae,ue,ye,xe=!1)=>{const G=v&&v.children,z=v?v.shapeFlag:0,X=b.children,{patchFlag:Ae,shapeFlag:Ve}=b;if(Ae>0){if(Ae&128){Ge(G,X,U,fe,V,ae,ue,ye,xe);return}else if(Ae&256){it(G,X,U,fe,V,ae,ue,ye,xe);return}}Ve&8?(z&16&&Ke(G,V,ae),X!==G&&y(U,X)):z&16?Ve&16?Ge(G,X,U,fe,V,ae,ue,ye,xe):Ke(G,V,ae,!0):(z&8&&y(U,""),Ve&16&&A(X,U,fe,V,ae,ue,ye,xe))},it=(v,b,U,fe,V,ae,ue,ye,xe)=>{v=v||Pr,b=b||Pr;const G=v.length,z=b.length,X=Math.min(G,z);let Ae;for(Ae=0;Ae<X;Ae++){const Ve=b[Ae]=xe?Rn(b[Ae]):En(b[Ae]);ne(v[Ae],Ve,U,null,V,ae,ue,ye,xe)}G>z?Ke(v,V,ae,!0,!1,X):A(b,U,fe,V,ae,ue,ye,xe,X)},Ge=(v,b,U,fe,V,ae,ue,ye,xe)=>{let G=0;const z=b.length;let X=v.length-1,Ae=z-1;for(;G<=X&&G<=Ae;){const Ve=v[G],Ze=b[G]=xe?Rn(b[G]):En(b[G]);if($r(Ve,Ze))ne(Ve,Ze,U,null,V,ae,ue,ye,xe);else break;G++}for(;G<=X&&G<=Ae;){const Ve=v[X],Ze=b[Ae]=xe?Rn(b[Ae]):En(b[Ae]);if($r(Ve,Ze))ne(Ve,Ze,U,null,V,ae,ue,ye,xe);else break;X--,Ae--}if(G>X){if(G<=Ae){const Ve=Ae+1,Ze=Ve<z?b[Ve].el:fe;for(;G<=Ae;)ne(null,b[G]=xe?Rn(b[G]):En(b[G]),U,Ze,V,ae,ue,ye,xe),G++}}else if(G>Ae)for(;G<=X;)Se(v[G],V,ae,!0),G++;else{const Ve=G,Ze=G,Ye=new Map;for(G=Ze;G<=Ae;G++){const jt=b[G]=xe?Rn(b[G]):En(b[G]);jt.key!=null&&Ye.set(jt.key,G)}let tt,mt=0;const kt=Ae-Ze+1;let Zt=!1,zt=0;const tn=new Array(kt);for(G=0;G<kt;G++)tn[G]=0;for(G=Ve;G<=X;G++){const jt=v[G];if(mt>=kt){Se(jt,V,ae,!0);continue}let Pt;if(jt.key!=null)Pt=Ye.get(jt.key);else for(tt=Ze;tt<=Ae;tt++)if(tn[tt-Ze]===0&&$r(jt,b[tt])){Pt=tt;break}Pt===void 0?Se(jt,V,ae,!0):(tn[Pt-Ze]=G+1,Pt>=zt?zt=Pt:Zt=!0,ne(jt,b[Pt],U,null,V,ae,ue,ye,xe),mt++)}const vr=Zt?Dp(tn):Pr;for(tt=vr.length-1,G=kt-1;G>=0;G--){const jt=Ze+G,Pt=b[jt],De=b[jt+1],Wn=jt+1<z?De.el||Aa(De):fe;tn[G]===0?ne(null,Pt,U,Wn,V,ae,ue,ye,xe):Zt&&(tt<0||G!==vr[tt]?Qe(Pt,U,Wn,2):tt--)}}},Qe=(v,b,U,fe,V=null)=>{const{el:ae,type:ue,transition:ye,children:xe,shapeFlag:G}=v;if(G&6){Qe(v.component.subTree,b,U,fe);return}if(G&128){v.suspense.move(b,U,fe);return}if(G&64){ue.move(v,b,U,Tt);return}if(ue===Ie){s(ae,b,U);for(let X=0;X<xe.length;X++)Qe(xe[X],b,U,fe);s(v.anchor,b,U);return}if(ue===Oo){M(v,b,U);return}if(fe!==2&&G&1&&ye)if(fe===0)ye.persisted&&!ae[ln]?s(ae,b,U):(ye.beforeEnter(ae),s(ae,b,U),Jt(()=>ye.enter(ae),V));else{const{leave:X,delayLeave:Ae,afterLeave:Ve}=ye,Ze=()=>{v.ctx.isUnmounted?o(ae):s(ae,b,U)},Ye=()=>{const tt=ae._isLeaving||!!ae[ln];ae._isLeaving&&ae[ln](!0),ye.persisted&&!tt?Ze():X(ae,()=>{Ze(),Ve&&Ve()})};Ae?Ae(ae,Ze,Ye):Ye()}else s(ae,b,U)},Se=(v,b,U,fe=!1,V=!1)=>{const{type:ae,props:ue,ref:ye,children:xe,dynamicChildren:G,shapeFlag:z,patchFlag:X,dirs:Ae,cacheIndex:Ve,memo:Ze}=v;if((X===-2||G&&G.hasOnce)&&(V=!1),ye!=null&&(An(),Ss(ye,null,U,v,!0),On()),Ve!=null&&(!v.ctx||v.ctx===b)&&(b.renderCache[Ve]=void 0),z&256){b.ctx.deactivate(v);return}const Ye=z&1&&Ae,tt=!Es(v);let mt;if(tt&&(mt=ue&&ue.onVnodeBeforeUnmount)&&_n(mt,b,v),z&6)we(v.component,U,fe);else{if(z&128){v.suspense.unmount(U,fe);return}Ye&&kr(v,null,b,"beforeUnmount"),z&64?v.type.remove(v,b,U,Tt,fe):G&&!G.hasOnce&&(ae!==Ie||X>0&&X&64)?Ke(G,b,U,!1,!0):(ae===Ie&&X&384||!V&&z&16)&&Ke(xe,b,U),fe&&Z(v)}const kt=Ze!=null&&Ve==null;(tt&&(mt=ue&&ue.onVnodeUnmounted)||Ye||kt)&&Jt(()=>{mt&&_n(mt,b,v),Ye&&kr(v,null,b,"unmounted"),kt&&(v.el=null)},U)},Z=v=>{const{type:b,el:U,anchor:fe,transition:V}=v,ae=b===Ie;if(ae&&!V){ee(U,fe);return}if(b===Oo){Q(v),V&&!V.persisted&&V.afterLeave&&V.afterLeave();return}const ue=ae?Ds(v):v,ye=()=>{ae?_(U)&&ee(U,fe):o(U),V&&!V.persisted&&V.afterLeave&&V.afterLeave()};if(ue&&ue.shapeFlag&1&&V&&!V.persisted){const{leave:xe,delayLeave:G}=V,z=ue.el,X=()=>xe(z,ye);G?G(z,ye,X):X()}else ye()},ee=(v,b)=>{let U;for(;v!==b;)U=C(v),o(v),v=U;o(b)},we=(v,b,U)=>{const{bum:fe,scope:V,job:ae,subTree:ue,um:ye,m:xe,a:G}=v;pu(xe),pu(G),fe&&Po(fe),V.stop(),ae?(ae.flags|=8,Se(ue,v,b,U)):v.vnode.el&&ue&&(ue.transition=v.vnode.transition,Se(ue,v,b,U)),ye&&Jt(ye,b),Jt(()=>{v.isUnmounted=!0},b)},Ke=(v,b,U,fe=!1,V=!1,ae=0)=>{for(let ue=ae;ue<v.length;ue++)Se(v[ue],b,U,fe,V)},dt=v=>{if(v.shapeFlag&6)return dt(v.component.subTree);if(v.shapeFlag&128)return v.suspense.next();const b=C(v.anchor||v.el),U=b&&b[_c];return U?C(U):b},Kt=(v,b,U)=>{const fe=v&&b._vnode?void 0:v&&v.component?v.component.uid:Bp();Hf(()=>{v==null?b._vnode&&Se(b._vnode,null,null,!0):ne(b._vnode||null,v,b,null,null,null,U),b._vnode=v},fe)},Tt={p:ne,um:Se,m:Qe,r:Z,mt:Pe,mc:A,pc:Ne,pbc:N,n:dt,o:e};return{render:Kt,hydrate:void 0,createApp:gp(Kt)}}function da({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 xr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function jp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function il(e,t,n=!1){const s=e.children,o=t.children;if(Re(s)&&Re(o))for(let a=0;a<s.length;a++){const c=s[a];let f=o[a];f.shapeFlag&1&&!f.dynamicChildren&&((f.patchFlag<=0||f.patchFlag===32)&&(f=o[a]=Rn(o[a]),f.el=c.el),!n&&f.patchFlag!==-2&&il(c,f)),f.type===bi&&(f.patchFlag===-1&&(f=o[a]=Rn(f)),f.el=c.el),f.type===qt&&!f.el&&(f.el=c.el)}}function Dp(e){const t=e.slice(),n=[0];let s,o,a,c,f;const h=e.length;for(s=0;s<h;s++){const g=e[s];if(g!==0){if(o=n[n.length-1],e[o]<g){t[s]=o,n.push(s);continue}for(a=0,c=n.length-1;a<c;)f=a+c>>1,e[n[f]]<g?a=f+1:c=f;g<e[n[a]]&&(a>0&&(t[s]=n[a-1]),n[a]=s)}}for(a=n.length,c=n[a-1];a-- >0;)n[a]=c,c=t[c];return n}function qc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:qc(t)}function pu(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Aa(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Aa(t.subTree):null}const Hc=e=>e.__isSuspense;function Lp(e,t){t&&t.pendingBranch?Re(e)?t.effects.push(...e):t.effects.push(e):qf(e)}const Ie=Symbol.for("v-fgt"),bi=Symbol.for("v-txt"),qt=Symbol.for("v-cmt"),Oo=Symbol.for("v-stc"),Mr=[];let on=null;function S(e=!1){Mr.push(on=e?null:[])}function Wc(){Mr.pop(),on=Mr[Mr.length-1]||null}let Ls=1;function Ho(e,t=!1){Ls+=e,e<0&&on&&t&&(on.hasOnce=!0)}function zc(e){return e.dynamicChildren=Ls>0?on||Pr:null,Wc(),Ls>0&&on&&on.push(e),e}function j(e,t,n,s,o,a){return zc(l(e,t,n,s,o,a,!0))}function At(e,t,n,s,o){return zc($e(e,t,n,s,o,!0))}function Rs(e){return e?e.__v_isVNode===!0:!1}function $r(e,t){return e.type===t.type&&e.key===t.key}const Gc=({key:e})=>e??null,Mo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bt(e)||Ht(e)||We(e)?{i:un,r:e,k:t,f:!!n}:e:null);function l(e,t=null,n=null,s=0,o=null,a=e===Ie?0:1,c=!1,f=!1){const h={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Gc(t),ref:t&&Mo(t),scopeId:gc,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:a,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:un};return f?(Wo(h,n),a&128&&e.normalize(h)):n&&(h.shapeFlag|=bt(n)?8:16),Ls>0&&!c&&on&&(h.patchFlag>0||a&6)&&h.patchFlag!==32&&on.push(h),h}const $e=Rp;function Rp(e,t=null,n=null,s=0,o=null,a=!1){if((!e||e===cp)&&(e=qt),Rs(e)){const f=cr(e,t,!0);return n&&Wo(f,n),Ls>0&&!a&&on&&(f.shapeFlag&6?on[on.indexOf(e)]=f:on.push(f)),f.patchFlag=-2,f}if(Gp(e)&&(e=e.__vccOpts),t){t=Kp(t);let{class:f,style:h}=t;f&&!bt(f)&&(t.class=et(f)),ct(h)&&(tl(h)&&!Re(h)&&(h=$t({},h)),t.style=or(h))}const c=bt(e)?1:Hc(e)?128:hi(e)?64:ct(e)?4:We(e)?2:0;return l(e,t,n,s,o,c,a,!0)}function Kp(e){return e?tl(e)||Kc(e)?$t({},e):e:null}function cr(e,t,n=!1,s=!1){const{props:o,ref:a,patchFlag:c,children:f,transition:h}=e,g=t?Np(o||{},t):o,y={__v_isVNode:!0,__v_skip:!0,type:e.type,props:g,key:g&&Gc(g),ref:t&&t.ref?n&&a?Re(a)?a.concat(Mo(t)):[a,Mo(t)]:Mo(t):a,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!==Ie?c===-1?16:c|16:c,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:h,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&cr(e.ssContent),ssFallback:e.ssFallback&&cr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return h&&s&&ur(y,h.clone(y)),y}function en(e=" ",t=0){return $e(bi,null,e,t)}function Fp(e,t){const n=$e(Oo,null,e);return n.staticCount=t,n}function Ce(e="",t=!1){return t?(S(),At(qt,null,e)):$e(qt,null,e)}function En(e){return e==null||typeof e=="boolean"?$e(qt):Re(e)?$e(Ie,null,e.slice()):Rs(e)?Rn(e):$e(bi,null,String(e))}function Rn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:cr(e)}function Wo(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(Re(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Wo(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Kc(t)?t._ctx=un:o===3&&un&&(un.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(We(t)){if(s&65){Wo(e,{default:t});return}t={default:t,_ctx:un},n=32}else t=String(t),s&64?(n=16,t=[en(t)]):n=8;e.children=t,e.shapeFlag|=n}function Np(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=et([t.class,s.class]));else if(o==="style")t.style=or([t.style,s.style]);else if(li(o)){const a=t[o],c=s[o];c&&a!==c&&!(Re(a)&&a.includes(c))?t[o]=a?[].concat(a,c):c:c==null&&a==null&&!ui(o)&&(t[o]=c)}else o!==""&&(t[o]=s[o])}return t}function _n(e,t,n,s=null){fn(e,t,7,[n,s])}const Vp=Mc();let Yc=0;function Bp(){return Yc}function Up(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Vp,a={uid:Yc++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new hf(!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:Nc(s,o),emitsOptions:Ic(s,o),emit:null,emitted:null,propsDefaults:ft,inheritAttrs:s.inheritAttrs,ctx:ft,data:ft,props:ft,attrs:ft,slots:ft,refs:ft,setupState:ft,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 a.ctx={_:a},a.root=t?t.root:a,a.emit=wp.bind(null,a),e.ce&&e.ce(a),a}let Qt=null;const al=()=>Qt||un;let zo,Ks;{const e=fi(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),a=>{o.length>1?o.forEach(c=>c(a)):o[0](a)}};zo=t("__VUE_INSTANCE_SETTERS__",n=>Qt=n),Ks=t("__VUE_SSR_SETTERS__",n=>Fs=n)}const Ws=e=>{const t=Qt;return zo(e),e.scope.on(),()=>{e.scope.off(),zo(t)}},vu=()=>{Qt&&Qt.scope.off(),zo(null)};function Jc(e){return e.vnode.shapeFlag&4}let Fs=!1;function qp(e,t=!1,n=!1){t&&Ks(t);const{props:s,children:o}=e.vnode,a=Jc(e);Ep(e,s,a,t),Ap(e,o,n||t);const c=a?Hp(e,t):void 0;return t&&Ks(!1),c}function Hp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,dp);const{setup:s}=n;if(s){An();const o=e.setupContext=s.length>1?zp(e):null,a=Ws(e),c=Hs(s,e,0,[e.props,o]),f=Uu(c);if(On(),a(),(f||e.sp)&&!Es(e)&&Ec(e),f){if(c.then(vu,vu),t)return c.then(h=>{Ks(!0);try{hu(e,h,t)}finally{Ks(!1)}}).catch(h=>{vi(h,e,0)});e.asyncDep=c}else hu(e,c)}else Xc(e)}function hu(e,t,n){We(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ct(t)&&(e.setupState=fc(t)),Xc(e)}function Xc(e,t,n){const s=e.type;e.render||(e.render=s.render||Tn);{const o=Ws(e);An();try{fp(e)}finally{On(),o()}}}const Wp={get(e,t){return Bt(e,"get",""),e[t]}};function zp(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Wp),slots:e.slots,emit:e.emit,expose:t}}function wi(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(fc(jf(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in $s)return $s[n](e)},has(t,n){return n in t||n in $s}})):e.proxy}function Gp(e){return We(e)&&"__vccOpts"in e}const st=(e,t)=>Ff(e,t,Fs);function Yp(e,t,n){try{Ho(-1);const s=arguments.length;return s===2?ct(t)&&!Re(t)?Rs(t)?$e(e,null,[t]):$e(e,t):$e(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Rs(n)&&(n=[n]),$e(e,t,n))}finally{Ho(1)}}const Jp="3.5.44";/**
* @vue/runtime-dom v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Oa;const mu=typeof window<"u"&&window.trustedTypes;if(mu)try{Oa=mu.createPolicy("vue",{createHTML:e=>e})}catch{}const Qc=Oa?e=>Oa.createHTML(e):e=>e,Xp="http://www.w3.org/2000/svg",Qp="http://www.w3.org/1998/Math/MathML",Ln=typeof document<"u"?document:null,yu=Ln&&Ln.createElement("template"),Zp={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?Ln.createElementNS(Xp,e):t==="mathml"?Ln.createElementNS(Qp,e):n?Ln.createElement(e,{is:n}):Ln.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>Ln.createTextNode(e),createComment:e=>Ln.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ln.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,a){const c=n?n.previousSibling:t.lastChild;if(o&&(o===a||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===a||!(o=o.nextSibling)););else{yu.innerHTML=Qc(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const f=yu.content;if(s==="svg"||s==="mathml"){const h=f.firstChild;for(;h.firstChild;)f.appendChild(h.firstChild);f.removeChild(h)}t.insertBefore(f,n)}return[c?c.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Zn="transition",gs="animation",es=Symbol("_vtc"),Zc={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},ed=$t({},xc,Zc),ev=e=>(e.displayName="Transition",e.props=ed,e),os=ev((e,{slots:t})=>Yp(ep,td(e),t)),Cr=(e,t=[])=>{Re(e)?e.forEach(n=>n(...t)):e&&e(...t)},gu=e=>e?Re(e)?e.some(t=>t.length>1):e.length>1:!1;function td(e){const t={};for(const W in e)W in Zc||(t[W]=e[W]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:a=`${n}-enter-from`,enterActiveClass:c=`${n}-enter-active`,enterToClass:f=`${n}-enter-to`,appearFromClass:h=a,appearActiveClass:g=c,appearToClass:y=f,leaveFromClass:_=`${n}-leave-from`,leaveActiveClass:C=`${n}-leave-active`,leaveToClass:E=`${n}-leave-to`}=e,B=tv(o),ne=B&&B[0],re=B&&B[1],{onBeforeEnter:oe,onEnter:$,onEnterCancelled:M,onLeave:Q,onLeaveCancelled:ce,onBeforeAppear:ie=oe,onAppear:Y=$,onAppearCancelled:A=M}=t,x=(W,ke,Pe,Je)=>{W._enterCancelled=Je,tr(W,ke?y:f),tr(W,ke?g:c),Pe&&Pe()},N=(W,ke)=>{W._isLeaving=!1,tr(W,_),tr(W,E),tr(W,C),ke&&ke()},le=W=>(ke,Pe)=>{const Je=W?Y:$,Le=()=>x(ke,W,Pe);Cr(Je,[ke,Le]),bu(()=>{tr(ke,W?h:a),kn(ke,W?y:f),gu(Je)||wu(ke,s,ne,Le)})};return $t(t,{onBeforeEnter(W){Cr(oe,[W]),kn(W,a),kn(W,c)},onBeforeAppear(W){Cr(ie,[W]),kn(W,h),kn(W,g)},onEnter:le(!1),onAppear:le(!0),onLeave(W,ke){W._isLeaving=!0;const Pe=()=>N(W,ke);kn(W,_),W._enterCancelled?(kn(W,C),Ma(W)):(Ma(W),kn(W,C)),bu(()=>{W._isLeaving&&(tr(W,_),kn(W,E),gu(Q)||wu(W,s,re,Pe))}),Cr(Q,[W,Pe])},onEnterCancelled(W){x(W,!1,void 0,!0),Cr(M,[W])},onAppearCancelled(W){x(W,!0,void 0,!0),Cr(A,[W])},onLeaveCancelled(W){N(W),Cr(ce,[W])}})}function tv(e){if(e==null)return null;if(ct(e))return[fa(e.enter),fa(e.leave)];{const t=fa(e);return[t,t]}}function fa(e){return sf(e)}function kn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[es]||(e[es]=new Set)).add(t)}function tr(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[es];n&&(n.delete(t),n.size||(e[es]=void 0))}function bu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let nv=0;function wu(e,t,n,s){const o=e._endId=++nv,a=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(a,n);const{type:c,timeout:f,propCount:h}=nd(e,t);if(!c)return s();const g=c+"end";let y=0;const _=()=>{e.removeEventListener(g,C),a()},C=E=>{E.target===e&&++y>=h&&_()};setTimeout(()=>{y<h&&_()},f+1),e.addEventListener(g,C)}function nd(e,t){const n=window.getComputedStyle(e),s=B=>(n[B]||"").split(", "),o=s(`${Zn}Delay`),a=s(`${Zn}Duration`),c=_u(o,a),f=s(`${gs}Delay`),h=s(`${gs}Duration`),g=_u(f,h);let y=null,_=0,C=0;t===Zn?c>0&&(y=Zn,_=c,C=a.length):t===gs?g>0&&(y=gs,_=g,C=h.length):(_=Math.max(c,g),y=_>0?c>g?Zn:gs:null,C=y?y===Zn?a.length:h.length:0);const E=y===Zn&&/\b(?:transform|all)(?:,|$)/.test(s(`${Zn}Property`).toString());return{type:y,timeout:_,propCount:C,hasTransform:E}}function _u(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>ku(n)+ku(e[s])))}function ku(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Ma(e){return(e?e.ownerDocument:document).body.offsetHeight}function rv(e,t,n){const s=e[es];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const xu=Symbol("_vod"),rd=Symbol("_vsh"),sv=Symbol(""),ov=/(?:^|;)\s*display\s*:/;function iv(e,t,n){const s=e.style,o=bt(n);let a=!1;if(n&&!o){if(t)if(bt(t))for(const c of t.split(";")){const f=c.slice(0,c.indexOf(":")).trim();n[f]==null&&_s(s,f,"")}else for(const c in t)n[c]==null&&_s(s,c,"");for(const c in n){c==="display"&&(a=!0);const f=n[c];f!=null?lv(e,c,!bt(t)&&t?t[c]:void 0,f)||_s(s,c,f):_s(s,c,"")}}else if(o){if(t!==n){const c=s[sv];c&&(n+=";"+c),s.cssText=n,a=ov.test(n)}}else t&&e.removeAttribute("style");xu in e&&((!o||t!==n)&&(e[xu]=a?s.display:""),e[rd]&&(s.display="none"))}const Eo=/\s*!important$/;function _s(e,t,n){if(Re(n))n.forEach(s=>_s(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))Eo.test(n)?e.setProperty(t,n.replace(Eo,""),"important"):e.setProperty(t,n);else{const s=av(e,t);Eo.test(n)?e.setProperty(dr(s),n.replace(Eo,""),"important"):e[s]=n}}const Cu=["Webkit","Moz","ms"],pa={};function av(e,t){const n=pa[t];if(n)return n;let s=mn(t);if(s!=="filter"&&s in e)return pa[t]=s;s=Wu(s);for(let o=0;o<Cu.length;o++){const a=Cu[o]+s;if(a in e)return pa[t]=a}return t}function lv(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&bt(s)&&n===s}const Su="http://www.w3.org/1999/xlink";function Eu(e,t,n,s,o,a=df(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Su,t.slice(6,t.length)):e.setAttributeNS(Su,t,n):n==null||a&&!Gu(n)?e.removeAttribute(t):e.setAttribute(t,a?"":Pn(n)?String(n):n)}function $u(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Qc(n):n);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const f=a==="OPTION"?e.getAttribute("value")||"":e.value,h=n==null?e.type==="checkbox"?"on":"":String(n);(f!==h||!("_value"in e))&&(e.value=h),n==null&&e.removeAttribute(t),e._value=n;return}let c=!1;if(n===""||n==null){const f=typeof e[t];f==="boolean"?n=Gu(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 Tr(e,t,n,s){e.addEventListener(t,n,s)}function uv(e,t,n,s){e.removeEventListener(t,n,s)}const Tu=Symbol("_vei");function cv(e,t,n,s,o=null){const a=e[Tu]||(e[Tu]={}),c=a[t];if(s&&c)c.value=s;else{const[f,h]=pv(t);if(s){const g=a[t]=mv(s,o);Tr(e,f,g,h)}else c&&(uv(e,f,c,h),a[t]=void 0)}}const dv=/(Once|Passive|Capture)$/,fv=/^on:?(?:Once|Passive|Capture)$/;function pv(e){let t,n;for(;(n=e.match(dv))&&!fv.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):dr(e.slice(2)),t]}let va=0;const vv=Promise.resolve(),hv=()=>va||(vv.then(()=>va=0),va=Date.now());function mv(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(Re(o)){const a=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{a.call(s),s._stopped=!0};const c=o.slice(),f=[s];for(let h=0;h<c.length&&!s._stopped;h++){const g=c[h];g&&fn(g,t,5,f)}}else fn(o,t,5,[s])};return n.value=e,n.attached=hv(),n}const Pu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,yv=(e,t,n,s,o,a)=>{const c=o==="svg";t==="class"?rv(e,s,c):t==="style"?iv(e,n,s):li(t)?ui(t)||cv(e,t,n,s,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):gv(e,t,s,c))?($u(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Eu(e,t,s,c,a,t!=="value")):e._isVueCE&&(bv(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bt(s)))?$u(e,mn(t),s,a,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Eu(e,t,s,c))};function gv(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Pu(t)&&We(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 Pu(t)&&bt(n)?!1:t in e}function bv(e,t){const n=e._def.props;if(!n)return!1;const s=mn(t);return Array.isArray(n)?n.some(o=>mn(o)===s):Object.keys(n).some(o=>mn(o)===s)}const sd=new WeakMap,od=new WeakMap,Go=Symbol("_moveCb"),Au=Symbol("_enterCb"),Ia=new WeakMap,wv=e=>(delete e.props.mode,e),_v=wv({name:"TransitionGroup",props:$t({},ed,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=al(),s=kc();let o,a,c,f;const h=()=>(f===void 0&&(f=o.length>0&&Pv(o[0].el,n.vnode.el,Ou(e))),f);return Tc(()=>{if(Ia.delete(n),!h()){o=[],c=void 0;return}const g=Ou(e);o.forEach(xv);const y=c&&Tv(c,n.vnode.el);c=void 0,o.forEach(C=>Cv(C,y));const _=o.filter(Sv);Ma(n.vnode.el),_.forEach(C=>{const E=C.el,B=E.style;kn(E,g),B.transform=B.webkitTransform=B.transitionDuration="";const ne=E[Go]=re=>{re&&re.target!==E||(!re||re.propertyName.endsWith("transform"))&&(E.removeEventListener("transitionend",ne),E[Go]=null,tr(E,g))};E.addEventListener("transitionend",ne)}),o=[]}),()=>{const g=lt(e),y=td(g);let _=g.tag||Ie;if(o=[],f=void 0,a)for(let C=0;C<a.length;C++){const E=a[C];E.el&&E.el instanceof Element&&!E.el[rd]&&(o.push(E),ur(E,js(E,y,s,n)),sd.set(E,_i(E.el)))}a=t.default?rl(t.default()):[];for(let C=0;C<a.length;C++){const E=a[C];E.key!=null&&ur(E,js(E,y,s,n))}return o.length&&(c=Ev(n),Ia.set(n,h)),$e(_,null,a)}}}),kv=_v;function xv(e){const t=e.el;t[Go]&&t[Go](),t[Au]&&t[Au]()}function Ou(e){return e.moveClass||`${e.name||"v"}-move`}function Cv(e,t){od.set(e,_i(e.el,t))}function Sv(e){const t=sd.get(e),n=od.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const a=e.el,c=a.style,f=a.getBoundingClientRect();let h=1,g=1;return a.offsetWidth&&(h=f.width/a.offsetWidth),a.offsetHeight&&(g=f.height/a.offsetHeight),(!Number.isFinite(h)||h===0)&&(h=1),(!Number.isFinite(g)||g===0)&&(g=1),Math.abs(h-1)<.01&&(h=1),Math.abs(g-1)<.01&&(g=1),c.transform=c.webkitTransform=`translate(${s/h}px,${o/g}px)`,c.transitionDuration="0s",e}}function _i(e,t){const n=e.getBoundingClientRect();return{left:n.left-(t?t.left:0),top:n.top-(t?t.top:0)}}function Ev(e){let t;for(let n=e.parent;n;n=n.parent){const s=Ia.get(n);if(s){const o=$v(n.vnode.el,e.vnode.el);o&&(t||(t=[])).push($t(_i(o),{item:o,willMove:s}))}}return t}function $v(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 Tv(e,t){const n=e.find(s=>s.willMove()&&s.item.contains(t));return n&&_i(n.item,n)}function Pv(e,t,n){const s=e.cloneNode(),o=e[es];o&&o.forEach(f=>{f.split(/\s+/).forEach(h=>h&&s.classList.remove(h))}),n.split(/\s+/).forEach(f=>f&&s.classList.add(f)),s.style.display="none";const a=t.nodeType===1?t:t.parentNode;a.appendChild(s);const{hasTransform:c}=nd(s);return a.removeChild(s),c}const Yo=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Re(t)?n=>Po(t,n):t};function Av(e){e.target.composing=!0}function Mu(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ar=Symbol("_assign"),$o=Symbol("_initialValue");function ha(e,t,n){return t&&(e=e.trim()),n&&(e=di(e)),e}const je={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[$o]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[$o]=e.defaultValue.replace(/\r\n?/g,`
`))),e[Ar]=Yo(o);const a=s||o.props&&o.props.type==="number";Tr(e,t?"change":"input",c=>{c.target.composing||e[Ar](ha(e.value,n,a))}),(n||a)&&Tr(e,"change",()=>{e.value=ha(e.value,n,a)}),t||(Tr(e,"compositionstart",Av),Tr(e,"compositionend",Mu),Tr(e,"change",Mu))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",a=e[$o];delete e[$o],a!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==a?e[Ar](ha(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:a}},c){if(e[Ar]=Yo(c),e.composing)return;const f=(a||e.type==="number")&&!/^0\d/.test(e.value)?di(e.value):e.value,h=t??"";if(f===h)return;const g=e.getRootNode();(g instanceof Document||g instanceof ShadowRoot)&&g.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===h)||(e.value=h)}},Vn={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,Tr(e,"change",()=>{const o=Array.prototype.filter.call(e.options,h=>h.selected).map(h=>n?di(Jo(h)):Jo(h)),a=e.multiple,c=a?Ir(e._modelValue)?new Set(o):o:o[0],f=e._pendingValue=[a,a?Re(c)?o.slice():o:c];try{e[Ar](c)}finally{ss(()=>{e._pendingValue===f&&(e._pendingValue=void 0)})}}),e[Ar]=Yo(s)},mounted(e,{value:t}){Iu(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Ar]=Yo(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Ov(t,n[1],n[0]))&&Iu(e,t)}};function Ov(e,t,n){if(!n||Re(e))return ar(e,t);if(Ir(e)){if(e.size!==t.length)return!1;for(const s of t)if(!e.has(s))return!1;return!0}return!1}function Iu(e,t){const n=e.multiple,s=Re(t);if(!(n&&!s&&!Ir(t))){for(let o=0,a=e.options.length;o<a;o++){const c=e.options[o],f=Jo(c);if(n)if(s){const h=typeof f;h==="string"||h==="number"?c.selected=t.some(g=>String(g)===String(f)):c.selected=vf(t,f)>-1}else c.selected=t.has(f);else if(ar(Jo(c),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Jo(e){return"_value"in e?e._value:e.value}const Mv=["ctrl","shift","alt","meta"],Iv={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)=>Mv.some(n=>e[`${n}Key`]&&!t.includes(n))},sn=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(o,...a)=>{for(let c=0;c<t.length;c++){const f=Iv[t[c]];if(f&&f(o,t))return}return e(o,...a)})},jv={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ot=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=o=>{if(!("key"in o))return;const a=dr(o.key);if(t.some(c=>c===a||jv[c]===a))return e(o)})},Dv=$t({patchProp:yv},Zp);let ju;function Lv(){return ju||(ju=Mp(Dv))}const Rv=(...e)=>{const t=Lv().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=Fv(s);if(!o)return;const a=t._component;!We(a)&&!a.render&&!a.template&&(a.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const c=n(o,!1,Kv(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),c},t};function Kv(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Fv(e){return bt(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 Nv={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"/>')},Vv=["innerHTML"],Xe=Rt({__name:"Icon",props:{name:{},size:{default:16}},setup(e){const t=e,n=st(()=>Nv[t.name]||"");return(s,o)=>(S(),j("span",{class:"icon",style:or({width:e.size+"px",height:e.size+"px"}),innerHTML:n.value},null,12,Vv))}}),Bv=["aria-label"],Uv={class:"dialog-title"},qv={class:"dialog-msg"},Hv={class:"dialog-btns"},Wv=Rt({__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,s=t;function o(a){n.open&&a.key==="Escape"&&s("cancel")}return ht(()=>n.open,a=>{a?window.addEventListener("keydown",o):window.removeEventListener("keydown",o)}),pr(()=>window.removeEventListener("keydown",o)),(a,c)=>(S(),At(jr,{to:"body"},[$e(os,{name:"modal"},{default:fr(()=>[e.open?(S(),j("div",{key:0,class:"mask",onClick:c[2]||(c[2]=sn(f=>s("cancel"),["self"]))},[l("div",{class:"dialog",role:"dialog","aria-label":e.title},[l("div",Uv,te(e.title),1),l("div",qv,te(e.message),1),l("div",Hv,[l("button",{class:"btn btn-sm",onClick:c[0]||(c[0]=f=>s("cancel"))},te(e.cancelText),1),l("button",{class:et(["btn btn-sm",e.danger?"btn-danger-solid":"btn-primary"]),onClick:c[1]||(c[1]=f=>s("confirm"))},te(e.confirmText),3)])],8,Bv)])):Ce("",!0)]),_:1})]))}}),Wt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},qn=Wt(Wv,[["__scopeId","data-v-f27041d4"]]);var Du=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var id={exports:{}};(function(e,t){((n,s)=>{e.exports=s()})(Du,function(){var n=function(r,i){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])}))(r,i)},s=function(){return(s=Object.assign||function(r){for(var i,u=1,d=arguments.length;u<d;u++)for(var p in i=arguments[u])Object.prototype.hasOwnProperty.call(i,p)&&(r[p]=i[p]);return r}).apply(this,arguments)};function o(r,i,u){for(var d,p=0,m=i.length;p<m;p++)!d&&p in i||((d=d||Array.prototype.slice.call(i,0,p))[p]=i[p]);return r.concat(d||Array.prototype.slice.call(i))}var a=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Du,c=Object.keys,f=Array.isArray;function h(r,i){return typeof i=="object"&&c(i).forEach(function(u){r[u]=i[u]}),r}typeof Promise>"u"||a.Promise||(a.Promise=Promise);var g=Object.getPrototypeOf,y={}.hasOwnProperty;function _(r,i){return y.call(r,i)}function C(r,i){typeof i=="function"&&(i=i(g(r))),(typeof Reflect>"u"?c:Reflect.ownKeys)(i).forEach(function(u){B(r,u,i[u])})}var E=Object.defineProperty;function B(r,i,u,d){E(r,i,h(u&&_(u,"get")&&typeof u.get=="function"?{get:u.get,set:u.set,configurable:!0}:{value:u,configurable:!0,writable:!0},d))}function ne(r){return{from:function(i){return r.prototype=Object.create(i.prototype),B(r.prototype,"constructor",r),{extend:C.bind(null,r.prototype)}}}}var re=Object.getOwnPropertyDescriptor,oe=[].slice;function $(r,i,u){return oe.call(r,i,u)}function M(r,i){return i(r)}function Q(r){if(!r)throw new Error("Assertion Failed")}function ce(r){a.setImmediate?setImmediate(r):setTimeout(r,0)}function ie(r,i){if(typeof i=="string"&&_(r,i))return r[i];if(!i)return r;if(typeof i!="string"){for(var u=[],d=0,p=i.length;d<p;++d){var m=ie(r,i[d]);u.push(m)}return u}var w,k=i.indexOf(".");return k===-1||(w=r[i.substr(0,k)])==null?void 0:ie(w,i.substr(k+1))}function Y(r,i,u){if(r&&i!==void 0&&!("isFrozen"in Object&&Object.isFrozen(r)))if(typeof i!="string"&&"length"in i){Q(typeof u!="string"&&"length"in u);for(var d=0,p=i.length;d<p;++d)Y(r,i[d],u[d])}else{var m=i.indexOf(".");if(m!==-1){var w=i.substr(0,m),m=i.substr(m+1);if(m==="")u===void 0?f(r)&&!isNaN(parseInt(w))?r.splice(w,1):delete r[w]:r[w]=u;else{var k=r[w];if(!k||!_(r,w)){if(u===void 0)return;k=r[w]={}}Y(k,m,u)}}else u===void 0?f(r)&&!isNaN(parseInt(i))?r.splice(i,1):delete r[i]:r[i]=u}}function A(r){var i,u={};for(i in r)_(r,i)&&(u[i]=r[i]);return u}var x=[].concat;function N(r){return x.apply([],r)}var Se="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(N([8,16,32,64].map(function(r){return["Int","Uint","Float"].map(function(i){return i+r+"Array"})}))).filter(function(r){return a[r]}),le=new Set(Se.map(function(r){return a[r]})),W=null;function ke(r){return W=new WeakMap,r=function i(u){if(!u||typeof u!="object")return u;var d=W.get(u);if(d)return d;if(f(u)){d=[],W.set(u,d);for(var p=0,m=u.length;p<m;++p)d.push(i(u[p]))}else if(le.has(u.constructor))d=u;else{var w,k=g(u);for(w in d=k===Object.prototype?{}:Object.create(k),W.set(u,d),u)_(u,w)&&(d[w]=i(u[w]))}return d}(r),W=null,r}var Pe={}.toString;function Je(r){return Pe.call(r).slice(8,-1)}var Le=typeof Symbol<"u"?Symbol.iterator:"@@iterator",qe=typeof Le=="symbol"?function(r){var i;return r!=null&&(i=r[Le])&&i.apply(r)}:function(){return null};function Ne(r,i){i=r.indexOf(i),0<=i&&r.splice(i,1)}var it={};function Ge(r){var i,u,d,p;if(arguments.length===1){if(f(r))return r.slice();if(this===it&&typeof r=="string")return[r];if(p=qe(r))for(u=[];!(d=p.next()).done;)u.push(d.value);else{if(r==null)return[r];if(typeof(i=r.length)!="number")return[r];for(u=new Array(i);i--;)u[i]=r[i]}}else for(i=arguments.length,u=new Array(i);i--;)u[i]=arguments[i];return u}var Qe=typeof Symbol<"u"?function(r){return r[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Se=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Ye=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Se),Z={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 ee(r,i){this.name=r,this.message=i}function we(r,i){return r+". Errors: "+Object.keys(i).map(function(u){return i[u].toString()}).filter(function(u,d,p){return p.indexOf(u)===d}).join(`
`)}function Ke(r,i,u,d){this.failures=i,this.failedKeys=d,this.successCount=u,this.message=we(r,i)}function dt(r,i){this.name="BulkError",this.failures=Object.keys(i).map(function(u){return i[u]}),this.failuresByPos=i,this.message=we(r,this.failures)}ne(ee).from(Error).extend({toString:function(){return this.name+": "+this.message}}),ne(Ke).from(ee),ne(dt).from(ee);var Kt=Ye.reduce(function(r,i){return r[i]=i+"Error",r},{}),Tt=ee,de=Ye.reduce(function(r,i){var u=i+"Error";function d(p,m){this.name=u,p?typeof p=="string"?(this.message="".concat(p).concat(m?`
`+m:""),this.inner=m||null):typeof p=="object"&&(this.message="".concat(p.name," ").concat(p.message),this.inner=p):(this.message=Z[i]||u,this.inner=null)}return ne(d).from(Tt),r[i]=d,r},{}),v=(de.Syntax=SyntaxError,de.Type=TypeError,de.Range=RangeError,Se.reduce(function(r,i){return r[i+"Error"]=de[i],r},{}));Se=Ye.reduce(function(r,i){return["Syntax","Type","Range"].indexOf(i)===-1&&(r[i+"Error"]=de[i]),r},{});function b(){}function U(r){return r}function fe(r,i){return r==null||r===U?i:function(u){return i(r(u))}}function V(r,i){return function(){r.apply(this,arguments),i.apply(this,arguments)}}function ae(r,i){return r===b?i:function(){var u=r.apply(this,arguments),d=(u!==void 0&&(arguments[0]=u),this.onsuccess),p=this.onerror,m=(this.onsuccess=null,this.onerror=null,i.apply(this,arguments));return d&&(this.onsuccess=this.onsuccess?V(d,this.onsuccess):d),p&&(this.onerror=this.onerror?V(p,this.onerror):p),m!==void 0?m:u}}function ue(r,i){return r===b?i:function(){r.apply(this,arguments);var u=this.onsuccess,d=this.onerror;this.onsuccess=this.onerror=null,i.apply(this,arguments),u&&(this.onsuccess=this.onsuccess?V(u,this.onsuccess):u),d&&(this.onerror=this.onerror?V(d,this.onerror):d)}}function ye(r,i){return r===b?i:function(){var u=r.apply(this,arguments),d=(h(arguments[0],u),this.onsuccess),p=this.onerror,m=(this.onsuccess=null,this.onerror=null,i.apply(this,arguments));return d&&(this.onsuccess=this.onsuccess?V(d,this.onsuccess):d),p&&(this.onerror=this.onerror?V(p,this.onerror):p),u===void 0?m===void 0?void 0:m:h(u,m)}}function xe(r,i){return r===b?i:function(){return i.apply(this,arguments)!==!1&&r.apply(this,arguments)}}function G(r,i){return r===b?i:function(){var u=r.apply(this,arguments);if(u&&typeof u.then=="function"){for(var d=this,p=arguments.length,m=new Array(p);p--;)m[p]=arguments[p];return u.then(function(){return i.apply(d,m)})}return i.apply(this,arguments)}}Se.ModifyError=Ke,Se.DexieError=ee,Se.BulkError=dt;var z=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function X(r){z=r}var Ae={},Ve=100,Ze=typeof Promise>"u"?[]:(Ye=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[Ze=crypto.subtle.digest("SHA-512",new Uint8Array([0])),g(Ze),Ye]:[Ye,g(Ye),Ye]),Ye=Ze[0],qr=Ze[1],qr=qr&&qr.then,tt=Ye&&Ye.constructor,mt=!!Ze[2],kt=function(r,i){Wn.push([r,i]),zt&&(queueMicrotask(Ad),zt=!1)},Zt=!0,zt=!0,tn=[],vr=[],jt=U,Pt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:b,pgp:!1,env:{},finalize:b},De=Pt,Wn=[],hr=0,Js=[];function Ee(r){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var i=this._PSD=De;if(typeof r!="function"){if(r!==Ae)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&$i(this,this._value)}else this._state=null,this._value=null,++i.ref,function u(d,p){try{p(function(m){if(d._state===null){if(m===d)throw new TypeError("A promise cannot be resolved with itself.");var w=d._lib&&Kr();m&&typeof m.then=="function"?u(d,function(k,P){m instanceof Ee?m._then(k,P):m.then(k,P)}):(d._state=!0,d._value=m,yl(d)),w&&Fr()}},$i.bind(null,d))}catch(m){$i(d,m)}}(this,r)}var Ei={get:function(){var r=De,i=eo;function u(d,p){var m=this,w=!r.global&&(r!==De||i!==eo),k=w&&!Gn(),P=new Ee(function(q,I){Ti(m,new ml(bl(d,r,w,k),bl(p,r,w,k),q,I,r))});return this._consoleTask&&(P._consoleTask=this._consoleTask),P}return u.prototype=Ae,u},set:function(r){B(this,"then",r&&r.prototype===Ae?Ei:{get:function(){return r},set:Ei.set})}};function ml(r,i,u,d,p){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof i=="function"?i:null,this.resolve=u,this.reject=d,this.psd=p}function $i(r,i){var u,d;vr.push(i),r._state===null&&(u=r._lib&&Kr(),i=jt(i),r._state=!1,r._value=i,d=r,tn.some(function(p){return p._value===d._value})||tn.push(d),yl(r),u)&&Fr()}function yl(r){var i=r._listeners;r._listeners=[];for(var u=0,d=i.length;u<d;++u)Ti(r,i[u]);var p=r._PSD;--p.ref||p.finalize(),hr===0&&(++hr,kt(function(){--hr==0&&Pi()},[]))}function Ti(r,i){if(r._state===null)r._listeners.push(i);else{var u=r._state?i.onFulfilled:i.onRejected;if(u===null)return(r._state?i.resolve:i.reject)(r._value);++i.psd.ref,++hr,kt(Pd,[u,r,i])}}function Pd(r,i,u){try{var d,p=i._value;!i._state&&vr.length&&(vr=[]),d=z&&i._consoleTask?i._consoleTask.run(function(){return r(p)}):r(p),i._state||vr.indexOf(p)!==-1||(m=>{for(var w=tn.length;w;)if(tn[--w]._value===m._value)return tn.splice(w,1)})(i),u.resolve(d)}catch(m){u.reject(m)}finally{--hr==0&&Pi(),--u.psd.ref||u.psd.finalize()}}function Ad(){mr(Pt,function(){Kr()&&Fr()})}function Kr(){var r=Zt;return zt=Zt=!1,r}function Fr(){var r,i,u;do for(;0<Wn.length;)for(r=Wn,Wn=[],u=r.length,i=0;i<u;++i){var d=r[i];d[0].apply(null,d[1])}while(0<Wn.length);zt=Zt=!0}function Pi(){for(var r=tn,i=(tn=[],r.forEach(function(d){d._PSD.onunhandled.call(null,d._value,d)}),Js.slice(0)),u=i.length;u;)i[--u]()}function Xs(r){return new Ee(Ae,!1,r)}function yt(r,i){var u=De;return function(){var d=Kr(),p=De;try{return Yn(u,!0),r.apply(this,arguments)}catch(m){i&&i(m)}finally{Yn(p,!1),d&&Fr()}}}C(Ee.prototype,{then:Ei,_then:function(r,i){Ti(this,new ml(null,null,r,i,De))},catch:function(r){var i,u;return arguments.length===1?this.then(null,r):(i=r,u=arguments[1],typeof i=="function"?this.then(null,function(d){return(d instanceof i?u:Xs)(d)}):this.then(null,function(d){return(d&&d.name===i?u:Xs)(d)}))},finally:function(r){return this.then(function(i){return Ee.resolve(r()).then(function(){return i})},function(i){return Ee.resolve(r()).then(function(){return Xs(i)})})},timeout:function(r,i){var u=this;return r<1/0?new Ee(function(d,p){var m=setTimeout(function(){return p(new de.Timeout(i))},r);u.then(d,p).finally(clearTimeout.bind(null,m))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&B(Ee.prototype,Symbol.toStringTag,"Dexie.Promise"),Pt.env=gl(),C(Ee,{all:function(){var r=Ge.apply(null,arguments).map(to);return new Ee(function(i,u){r.length===0&&i([]);var d=r.length;r.forEach(function(p,m){return Ee.resolve(p).then(function(w){r[m]=w,--d||i(r)},u)})})},resolve:function(r){return r instanceof Ee?r:r&&typeof r.then=="function"?new Ee(function(i,u){r.then(i,u)}):new Ee(Ae,!0,r)},reject:Xs,race:function(){var r=Ge.apply(null,arguments).map(to);return new Ee(function(i,u){r.map(function(d){return Ee.resolve(d).then(i,u)})})},PSD:{get:function(){return De},set:function(r){return De=r}},totalEchoes:{get:function(){return eo}},newPSD:zn,usePSD:mr,scheduler:{get:function(){return kt},set:function(r){kt=r}},rejectionMapper:{get:function(){return jt},set:function(r){jt=r}},follow:function(r,i){return new Ee(function(u,d){return zn(function(p,m){var w=De;w.unhandleds=[],w.onunhandled=m,w.finalize=V(function(){var k,P=this;k=function(){P.unhandleds.length===0?p():m(P.unhandleds[0])},Js.push(function q(){k(),Js.splice(Js.indexOf(q),1)}),++hr,kt(function(){--hr==0&&Pi()},[])},w.finalize),r()},i,u,d)})}}),tt&&(tt.allSettled&&B(Ee,"allSettled",function(){var r=Ge.apply(null,arguments).map(to);return new Ee(function(i){r.length===0&&i([]);var u=r.length,d=new Array(u);r.forEach(function(p,m){return Ee.resolve(p).then(function(w){return d[m]={status:"fulfilled",value:w}},function(w){return d[m]={status:"rejected",reason:w}}).then(function(){return--u||i(d)})})})}),tt.any&&typeof AggregateError<"u"&&B(Ee,"any",function(){var r=Ge.apply(null,arguments).map(to);return new Ee(function(i,u){r.length===0&&u(new AggregateError([]));var d=r.length,p=new Array(d);r.forEach(function(m,w){return Ee.resolve(m).then(function(k){return i(k)},function(k){p[w]=k,--d||u(new AggregateError(p))})})})}),tt.withResolvers)&&(Ee.withResolvers=tt.withResolvers);var Mt={awaits:0,echoes:0,id:0},Od=0,Qs=[],Zs=0,eo=0,Md=0;function zn(r,w,u,d){var p=De,m=Object.create(p),w=(m.parent=p,m.ref=0,m.global=!1,m.id=++Md,Pt.env,m.env=mt?{Promise:Ee,PromiseProp:{value:Ee,configurable:!0,writable:!0},all:Ee.all,race:Ee.race,allSettled:Ee.allSettled,any:Ee.any,resolve:Ee.resolve,reject:Ee.reject}:{},w&&h(m,w),++p.ref,m.finalize=function(){--this.parent.ref||this.parent.finalize()},mr(m,r,u,d));return m.ref===0&&m.finalize(),w}function Nr(){return Mt.id||(Mt.id=++Od),++Mt.awaits,Mt.echoes+=Ve,Mt.id}function Gn(){return!!Mt.awaits&&(--Mt.awaits==0&&(Mt.id=0),Mt.echoes=Mt.awaits*Ve,!0)}function to(r){return Mt.echoes&&r&&r.constructor===tt?(Nr(),r.then(function(i){return Gn(),i},function(i){return Gn(),Ct(i)})):r}function Id(){var r=Qs[Qs.length-1];Qs.pop(),Yn(r,!1)}function Yn(r,i){var u,d,p=De;(i?!Mt.echoes||Zs++&&r===De:!Zs||--Zs&&r===De)||queueMicrotask(i?(function(m){++eo,Mt.echoes&&--Mt.echoes!=0||(Mt.echoes=Mt.awaits=Mt.id=0),Qs.push(De),Yn(m,!0)}).bind(null,r):Id),r!==De&&(De=r,p===Pt&&(Pt.env=gl()),mt)&&(u=Pt.env.Promise,d=r.env,p.global||r.global)&&(Object.defineProperty(a,"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 gl(){var r=a.Promise;return mt?{Promise:r,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:r.all,race:r.race,allSettled:r.allSettled,any:r.any,resolve:r.resolve,reject:r.reject}:{}}function mr(r,i,u,d,p){var m=De;try{return Yn(r,!0),i(u,d,p)}finally{Yn(m,!1)}}function bl(r,i,u,d){return typeof r!="function"?r:function(){var p=De;u&&Nr(),Yn(i,!0);try{return r.apply(this,arguments)}finally{Yn(p,!1),d&&queueMicrotask(Gn)}}}function Ai(r){Promise===tt&&Mt.echoes===0?Zs===0?r():enqueueNativeMicroTask(r):setTimeout(r,0)}(""+qr).indexOf("[native code]")===-1&&(Nr=Gn=b);var Ct=Ee.reject,yr="￿",In="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",wl="String expected.",no="__dbnames",Oi="readonly",Mi="readwrite";function gr(r,i){return r?i?function(){return r.apply(this,arguments)&&i.apply(this,arguments)}:r:i}var _l={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ro(r){return typeof r!="string"||/\./.test(r)?function(i){return i}:function(i){return i[r]===void 0&&r in i&&delete(i=ke(i))[r],i}}function kl(){throw de.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function rt(r,i){try{var u=xl(r),d=xl(i);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 i<r?1:r<i?-1:0;case"binary":for(var p=Cl(r),m=Cl(i),w=p.length,k=m.length,P=w<k?w:k,q=0;q<P;++q)if(p[q]!==m[q])return p[q]<m[q]?-1:1;return w===k?0:w<k?-1:1;case"Array":for(var I=r,T=i,O=I.length,F=T.length,R=O<F?O:F,D=0;D<R;++D){var K=rt(I[D],T[D]);if(K!==0)return K}return O===F?0:O<F?-1:1}}catch{}return NaN}function xl(r){var i=typeof r;return i=="object"&&(ArrayBuffer.isView(r)||(i=Je(r))==="ArrayBuffer")?"binary":i}function Cl(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r)}function so(r,i,u){var d=r.schema.yProps;return d?(i&&0<u.numFailures&&(i=i.filter(function(p,m){return!u.failures[m]})),Promise.all(d.map(function(p){return p=p.updatesTable,i?r.db.table(p).where("k").anyOf(i).delete():r.db.table(p).clear()})).then(function(){return u})):u}Sl.prototype.execute=function(r){var i=this["@@propmod"];if(i.add!==void 0){var u=i.add;if(f(u))return o(o([],f(r)?r:[],!0),u).sort();if(typeof u=="number")return(Number(r)||0)+u;if(typeof u=="bigint")try{return BigInt(r)+u}catch{return BigInt(0)+u}throw new TypeError("Invalid term ".concat(u))}if(i.remove!==void 0){var d=i.remove;if(f(d))return f(r)?r.filter(function(p){return!d.includes(p)}).sort():[];if(typeof d=="number")return Number(r)-d;if(typeof d=="bigint")try{return BigInt(r)-d}catch{return BigInt(0)-d}throw new TypeError("Invalid subtrahend ".concat(d))}return u=(u=i.replacePrefix)==null?void 0:u[0],u&&typeof r=="string"&&r.startsWith(u)?i.replacePrefix[1]+r.substring(u.length):r};var as=Sl;function Sl(r){this["@@propmod"]=r}function El(r,i){for(var u=c(i),d=u.length,p=!1,m=0;m<d;++m){var w=u[m],k=i[w],P=ie(r,w);k instanceof as?(Y(r,w,k.execute(P)),p=!0):P!==k&&(Y(r,w,k),p=!0)}return p}pt.prototype._trans=function(r,i,u){var d=this._tx||De.trans,p=this.name,m=z&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(r==="readonly"?"read":"write"," ").concat(this.name));function w(q,I,T){if(T.schema[p])return i(T.idbtrans,T);throw new de.NotFound("Table "+p+" not part of transaction")}var k=Kr();try{var P=d&&d.db._novip===this.db._novip?d===De.trans?d._promise(r,w,u):zn(function(){return d._promise(r,w,u)},{trans:d,transless:De.transless||De}):function q(I,T,O,F){if(I.idbdb&&(I._state.openComplete||De.letThrough||I._vip)){var R=I._createTransaction(T,O,I._dbSchema);try{R.create(),I._state.PR1398_maxLoop=3}catch(D){return D.name===Kt.InvalidState&&I.isOpen()&&0<--I._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),I.close({disableAutoOpen:!1}),I.open().then(function(){return q(I,T,O,F)})):Ct(D)}return R._promise(T,function(D,K){return zn(function(){return De.trans=R,F(D,K,R)})}).then(function(D){if(T==="readwrite")try{R.idbtrans.commit()}catch{}return T==="readonly"?D:R._completion.then(function(){return D})})}if(I._state.openComplete)return Ct(new de.DatabaseClosed(I._state.dbOpenError));if(!I._state.isBeingOpened){if(!I._state.autoOpen)return Ct(new de.DatabaseClosed);I.open().catch(b)}return I._state.dbReadyPromise.then(function(){return q(I,T,O,F)})}(this.db,r,[this.name],w);return m&&(P._consoleTask=m,P=P.catch(function(q){return console.trace(q),Ct(q)})),P}finally{k&&Fr()}},pt.prototype.get=function(r,i){var u=this;return r&&r.constructor===Object?this.where(r).first(i):r==null?Ct(new de.Type("Invalid argument to Table.get()")):this._trans("readonly",function(d){return u.core.get({trans:d,key:r}).then(function(p){return u.hook.reading.fire(p)})}).then(i)},pt.prototype.where=function(r){if(typeof r=="string")return new this.db.WhereClause(this,r);if(f(r))return new this.db.WhereClause(this,"[".concat(r.join("+"),"]"));var i=c(r);if(i.length===1)return this.where(i[0]).equals(r[i[0]]);var u=this.schema.indexes.concat(this.schema.primKey).filter(function(k){if(k.compound&&i.every(function(q){return 0<=k.keyPath.indexOf(q)})){for(var P=0;P<i.length;++P)if(i.indexOf(k.keyPath[P])===-1)return!1;return!0}return!1}).sort(function(k,P){return k.keyPath.length-P.keyPath.length})[0];if(u&&this.db._maxKey!==yr)return w=u.keyPath.slice(0,i.length),this.where(w).equals(w.map(function(k){return r[k]}));!u&&z&&console.warn("The query ".concat(JSON.stringify(r)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(i.join("+"),"]"));var d=this.schema.idxByName;function p(k,P){return rt(k,P)===0}var w=i.reduce(function(I,P){var q=I[0],I=I[1],T=d[P],O=r[P];return[q||T,q||!T?gr(I,T&&T.multi?function(F){return F=ie(F,P),f(F)&&F.some(function(R){return p(O,R)})}:function(F){return p(O,ie(F,P))}):I]},[null,null]),m=w[0],w=w[1];return m?this.where(m.name).equals(r[m.keyPath]).filter(w):u?this.filter(w):this.where(i).equals("")},pt.prototype.filter=function(r){return this.toCollection().and(r)},pt.prototype.count=function(r){return this.toCollection().count(r)},pt.prototype.offset=function(r){return this.toCollection().offset(r)},pt.prototype.limit=function(r){return this.toCollection().limit(r)},pt.prototype.each=function(r){return this.toCollection().each(r)},pt.prototype.toArray=function(r){return this.toCollection().toArray(r)},pt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},pt.prototype.orderBy=function(r){return new this.db.Collection(new this.db.WhereClause(this,f(r)?"[".concat(r.join("+"),"]"):r))},pt.prototype.reverse=function(){return this.toCollection().reverse()},pt.prototype.mapToClass=function(r){for(var i=this.db,u=this.name,d=((this.schema.mappedClass=r).prototype instanceof kl&&(r=(w=>{var k=I,P=w;if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");function q(){this.constructor=k}function I(){return w!==null&&w.apply(this,arguments)||this}return n(k,P),k.prototype=P===null?Object.create(P):(q.prototype=P.prototype,new q),Object.defineProperty(I.prototype,"db",{get:function(){return i},enumerable:!1,configurable:!0}),I.prototype.table=function(){return u},I})(r)),new Set),p=r.prototype;p;p=g(p))Object.getOwnPropertyNames(p).forEach(function(w){return d.add(w)});function m(w){if(!w)return w;var k,P=Object.create(r.prototype);for(k in w)if(!d.has(k))try{P[k]=w[k]}catch{}return P}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=m,this.hook("reading",m),r},pt.prototype.defineClass=function(){return this.mapToClass(function(r){h(this,r)})},pt.prototype.add=function(r,i){var u=this,d=this.schema.primKey,p=d.auto,m=d.keyPath,w=r;return m&&p&&(w=ro(m)(r)),this._trans("readwrite",function(k){return u.core.mutate({trans:k,type:"add",keys:i!=null?[i]:null,values:[w]})}).then(function(k){return k.numFailures?Ee.reject(k.failures[0]):k.lastResult}).then(function(k){if(m)try{Y(r,m,k)}catch{}return k})},pt.prototype.upsert=function(r,i){var u=this,d=this.schema.primKey.keyPath;return this._trans("readwrite",function(p){return u.core.get({trans:p,key:r}).then(function(m){var w=m??{};return El(w,i),d&&Y(w,d,r),u.core.mutate({trans:p,type:"put",values:[w],keys:[r],upsert:!0,updates:{keys:[r],changeSpecs:[i]}}).then(function(k){return k.numFailures?Ee.reject(k.failures[0]):!!m})})})},pt.prototype.update=function(r,i){return typeof r!="object"||f(r)?this.where(":id").equals(r).modify(i):(r=ie(r,this.schema.primKey.keyPath))===void 0?Ct(new de.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(i)},pt.prototype.put=function(r,i){var u=this,d=this.schema.primKey,p=d.auto,m=d.keyPath,w=r;return m&&p&&(w=ro(m)(r)),this._trans("readwrite",function(k){return u.core.mutate({trans:k,type:"put",values:[w],keys:i!=null?[i]:null})}).then(function(k){return k.numFailures?Ee.reject(k.failures[0]):k.lastResult}).then(function(k){if(m)try{Y(r,m,k)}catch{}return k})},pt.prototype.delete=function(r){var i=this;return this._trans("readwrite",function(u){return i.core.mutate({trans:u,type:"delete",keys:[r]}).then(function(d){return so(i,[r],d)}).then(function(d){return d.numFailures?Ee.reject(d.failures[0]):void 0})})},pt.prototype.clear=function(){var r=this;return this._trans("readwrite",function(i){return r.core.mutate({trans:i,type:"deleteRange",range:_l}).then(function(u){return so(r,null,u)})}).then(function(i){return i.numFailures?Ee.reject(i.failures[0]):void 0})},pt.prototype.bulkGet=function(r){var i=this;return this._trans("readonly",function(u){return i.core.getMany({keys:r,trans:u}).then(function(d){return d.map(function(p){return i.hook.reading.fire(p)})})})},pt.prototype.bulkAdd=function(r,i,u){var d=this,p=Array.isArray(i)?i:void 0,m=(u=u||(p?void 0:i))?u.allKeys:void 0;return this._trans("readwrite",function(w){var k=d.schema.primKey,q=k.auto,k=k.keyPath;if(k&&p)throw new de.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(p&&p.length!==r.length)throw new de.InvalidArgument("Arguments objects and keys must have the same length");var P=r.length,q=k&&q?r.map(ro(k)):r;return d.core.mutate({trans:w,type:"add",keys:p,values:q,wantResults:m}).then(function(I){var T=I.numFailures,O=I.failures;if(T===0)return m?I.results:I.lastResult;throw new dt("".concat(d.name,".bulkAdd(): ").concat(T," of ").concat(P," operations failed"),O)})})},pt.prototype.bulkPut=function(r,i,u){var d=this,p=Array.isArray(i)?i:void 0,m=(u=u||(p?void 0:i))?u.allKeys:void 0;return this._trans("readwrite",function(w){var k=d.schema.primKey,q=k.auto,k=k.keyPath;if(k&&p)throw new de.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(p&&p.length!==r.length)throw new de.InvalidArgument("Arguments objects and keys must have the same length");var P=r.length,q=k&&q?r.map(ro(k)):r;return d.core.mutate({trans:w,type:"put",keys:p,values:q,wantResults:m}).then(function(I){var T=I.numFailures,O=I.failures;if(T===0)return m?I.results:I.lastResult;throw new dt("".concat(d.name,".bulkPut(): ").concat(T," of ").concat(P," operations failed"),O)})})},pt.prototype.bulkUpdate=function(r){var i=this,u=this.core,d=r.map(function(w){return w.key}),p=r.map(function(w){return w.changes}),m=[];return this._trans("readwrite",function(w){return u.getMany({trans:w,keys:d,cache:"clone"}).then(function(k){var P=[],q=[],I=(r.forEach(function(T,O){var F=T.key,R=T.changes,D=k[O];if(D){for(var K=0,J=Object.keys(R);K<J.length;K++){var H=J[K],se=R[H];if(H===i.schema.primKey.keyPath){if(rt(se,F)!==0)throw new de.Constraint("Cannot update primary key in bulkUpdate()")}else Y(D,H,se)}m.push(O),P.push(F),q.push(D)}}),P.length);return u.mutate({trans:w,type:"put",keys:P,values:q,updates:{keys:d,changeSpecs:p}}).then(function(T){var O=T.numFailures,F=T.failures;if(O===0)return I;for(var R=0,D=Object.keys(F);R<D.length;R++){var K,J=D[R],H=m[Number(J)];H!=null&&(K=F[J],delete F[J],F[H]=K)}throw new dt("".concat(i.name,".bulkUpdate(): ").concat(O," of ").concat(I," operations failed"),F)})})})},pt.prototype.bulkDelete=function(r){var i=this,u=r.length;return this._trans("readwrite",function(d){return i.core.mutate({trans:d,type:"delete",keys:r}).then(function(p){return so(i,r,p)})}).then(function(d){var p=d.numFailures,m=d.failures;if(p===0)return d.lastResult;throw new dt("".concat(i.name,".bulkDelete(): ").concat(p," of ").concat(u," operations failed"),m)})};var $l=pt;function pt(){}function ls(r){function i(w,k){if(k){for(var P=arguments.length,q=new Array(P-1);--P;)q[P-1]=arguments[P];return u[w].subscribe.apply(null,q),r}if(typeof w=="string")return u[w]}var u={};i.addEventType=m;for(var d=1,p=arguments.length;d<p;++d)m(arguments[d]);return i;function m(w,k,P){var q,I;if(typeof w!="object")return k=k||xe,I={subscribers:[],fire:P=P||b,subscribe:function(T){I.subscribers.indexOf(T)===-1&&(I.subscribers.push(T),I.fire=k(I.fire,T))},unsubscribe:function(T){I.subscribers=I.subscribers.filter(function(O){return O!==T}),I.fire=I.subscribers.reduce(k,P)}},u[w]=i[w]=I;c(q=w).forEach(function(T){var O=q[T];if(f(O))m(T,q[T][0],q[T][1]);else{if(O!=="asap")throw new de.InvalidArgument("Invalid event config");var F=m(T,U,function(){for(var R=arguments.length,D=new Array(R);R--;)D[R]=arguments[R];F.subscribers.forEach(function(K){ce(function(){K.apply(null,D)})})})}})}}function us(r,i){return ne(i).from({prototype:r}),i}function Vr(r,i){return!(r.filter||r.algorithm||r.or)&&(i?r.justLimit:!r.replayFilter)}function Ii(r,i){r.filter=gr(r.filter,i)}function ji(r,i,u){var d=r.replayFilter;r.replayFilter=d?function(){return gr(d(),i())}:i,r.justLimit=u&&!d}function oo(r,i){if(r.isPrimKey)return i.primaryKey;var u=i.getIndexByKeyPath(r.index);if(u)return u;throw new de.Schema("KeyPath "+r.index+" on object store "+i.name+" is not indexed")}function Tl(r,i,u){var d=oo(r,i.schema);return i.openCursor({trans:u,values:!r.keysOnly,reverse:r.dir==="prev",unique:!!r.unique,query:{index:d,range:r.range}})}function io(r,i,u,d){var p,m,w=r.replayFilter?gr(r.filter,r.replayFilter()):r.filter;return r.or?(p={},m=function(k,P,q){var I,T;w&&!w(P,q,function(O){return P.stop(O)},function(O){return P.fail(O)})||((T=""+(I=P.primaryKey))=="[object ArrayBuffer]"&&(T=""+new Uint8Array(I)),_(p,T))||(p[T]=!0,i(k,P,q))},Promise.all([r.or._iterate(m,u),Pl(Tl(r,d,u),r.algorithm,m,!r.keysOnly&&r.valueMapper)])):Pl(Tl(r,d,u),gr(r.algorithm,w),i,!r.keysOnly&&r.valueMapper)}function Pl(r,i,u,d){var p=yt(d?function(m,w,k){return u(d(m),w,k)}:u);return r.then(function(m){if(m)return m.start(function(){var w=function(){return m.continue()};i&&!i(m,function(k){return w=k},function(k){m.stop(k),w=b},function(k){m.fail(k),w=b})||p(m.value,m,function(k){return w=k}),w()})})}at.prototype._read=function(r,i){var u=this._ctx;return u.error?u.table._trans(null,Ct.bind(null,u.error)):u.table._trans("readonly",r).then(i)},at.prototype._write=function(r){var i=this._ctx;return i.error?i.table._trans(null,Ct.bind(null,i.error)):i.table._trans("readwrite",r,"locked")},at.prototype._addAlgorithm=function(r){var i=this._ctx;i.algorithm=gr(i.algorithm,r)},at.prototype._iterate=function(r,i){return io(this._ctx,r,i,this._ctx.table.core)},at.prototype.clone=function(r){var i=Object.create(this.constructor.prototype),u=Object.create(this._ctx);return r&&h(u,r),i._ctx=u,i},at.prototype.raw=function(){return this._ctx.valueMapper=null,this},at.prototype.each=function(r){var i=this._ctx;return this._read(function(u){return io(i,r,u,i.table.core)})},at.prototype.count=function(r){var i=this;return this._read(function(u){var d,p=i._ctx,m=p.table.core;return Vr(p,!0)?m.count({trans:u,query:{index:oo(p,m.schema),range:p.range}}).then(function(w){return Math.min(w,p.limit)}):(d=0,io(p,function(){return++d,!1},u,m).then(function(){return d}))}).then(r)},at.prototype.sortBy=function(r,i){var u=r.split(".").reverse(),d=u[0],p=u.length-1;function m(P,q){return q?m(P[u[q]],q-1):P[d]}var w=this._ctx.dir==="next"?1:-1;function k(P,q){return rt(m(P,p),m(q,p))*w}return this.toArray(function(P){return P.slice().sort(k)}).then(i)},at.prototype.toArray=function(r){var i=this;return this._read(function(u){var d,p,m,w=i._ctx;return Vr(w,!0)&&0<w.limit?(d=w.valueMapper,p=oo(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})):(m=[],io(w,function(k){return m.push(k)},u,w.table.core).then(function(){return m}))},r)},at.prototype.offset=function(r){var i=this._ctx;return r<=0||(i.offset+=r,Vr(i)?ji(i,function(){var u=r;return function(d,p){return u===0||(u===1?--u:p(function(){d.advance(u),u=0}),!1)}}):ji(i,function(){var u=r;return function(){return--u<0}})),this},at.prototype.limit=function(r){return this._ctx.limit=Math.min(this._ctx.limit,r),ji(this._ctx,function(){var i=r;return function(u,d,p){return--i<=0&&d(p),0<=i}},!0),this},at.prototype.until=function(r,i){return Ii(this._ctx,function(u,d,p){return!r(u.value)||(d(p),i)}),this},at.prototype.first=function(r){return this.limit(1).toArray(function(i){return i[0]}).then(r)},at.prototype.last=function(r){return this.reverse().first(r)},at.prototype.filter=function(r){var i;return Ii(this._ctx,function(u){return r(u.value)}),(i=this._ctx).isMatch=gr(i.isMatch,r),this},at.prototype.and=function(r){return this.filter(r)},at.prototype.or=function(r){return new this.db.WhereClause(this._ctx.table,r,this)},at.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},at.prototype.desc=function(){return this.reverse()},at.prototype.eachKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(u,d){r(d.key,d)})},at.prototype.eachUniqueKey=function(r){return this._ctx.unique="unique",this.eachKey(r)},at.prototype.eachPrimaryKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(u,d){r(d.primaryKey,d)})},at.prototype.keys=function(r){var i=this._ctx,u=(i.keysOnly=!i.isMatch,[]);return this.each(function(d,p){u.push(p.key)}).then(function(){return u}).then(r)},at.prototype.primaryKeys=function(r){var i=this._ctx;if(Vr(i,!0)&&0<i.limit)return this._read(function(d){var p=oo(i,i.table.core.schema);return i.table.core.query({trans:d,values:!1,limit:i.limit,direction:i.dir==="prev"?"prev":void 0,query:{index:p,range:i.range}})}).then(function(d){return d.result}).then(r);i.keysOnly=!i.isMatch;var u=[];return this.each(function(d,p){u.push(p.primaryKey)}).then(function(){return u}).then(r)},at.prototype.uniqueKeys=function(r){return this._ctx.unique="unique",this.keys(r)},at.prototype.firstKey=function(r){return this.limit(1).keys(function(i){return i[0]}).then(r)},at.prototype.lastKey=function(r){return this.reverse().firstKey(r)},at.prototype.distinct=function(){var r,i=this._ctx,i=i.index&&i.table.schema.idxByName[i.index];return i&&i.multi&&(r={},Ii(this._ctx,function(d){var d=d.primaryKey.toString(),p=_(r,d);return r[d]=!0,!p})),this},at.prototype.modify=function(r){var i=this,u=this._ctx;return this._write(function(d){function p(D,K){var J=K.failures;O+=D-K.numFailures;for(var H=0,se=c(J);H<se.length;H++){var ve=se[H];T.push(J[ve])}}var m=typeof r=="function"?r:function(D){return El(D,r)},w=u.table.core,I=w.schema.primaryKey,k=I.outbound,P=I.extractKey,q=200,I=i.db._options.modifyChunkSize,T=(I&&(q=typeof I=="object"?I[w.name]||I["*"]||200:I),[]),O=0,F=[],R=r===Al;return i.clone().primaryKeys().then(function(D){function K(H){var se=Math.min(q,D.length-H),ve=D.slice(H,H+se);return(R?Promise.resolve([]):w.getMany({trans:d,keys:ve,cache:"immutable"})).then(function(me){var _e=[],ge=[],Oe=k?[]:null,be=R?ve:[];if(!R)for(var Me=0;Me<se;++Me){var he=me[Me],Be={value:ke(he),primKey:D[H+Me]};m.call(Be,Be.value,Be)!==!1&&(Be.value==null?be.push(D[H+Me]):k||rt(P(he),P(Be.value))===0?(ge.push(Be.value),k&&Oe.push(D[H+Me])):(be.push(D[H+Me]),_e.push(Be.value)))}return Promise.resolve(0<_e.length&&w.mutate({trans:d,type:"add",values:_e}).then(function(Ue){for(var ze in Ue.failures)be.splice(parseInt(ze),1);p(_e.length,Ue)})).then(function(){return(0<ge.length||J&&typeof r=="object")&&w.mutate({trans:d,type:"put",keys:Oe,values:ge,criteria:J,changeSpec:typeof r!="function"&&r,isAdditionalChunk:0<H}).then(function(Ue){return p(ge.length,Ue)})}).then(function(){return(0<be.length||J&&R)&&w.mutate({trans:d,type:"delete",keys:be,criteria:J,isAdditionalChunk:0<H}).then(function(Ue){return so(u.table,be,Ue)}).then(function(Ue){return p(be.length,Ue)})}).then(function(){return D.length>H+se&&K(H+q)})})}var J=Vr(u)&&u.limit===1/0&&(typeof r!="function"||R)&&{index:u.index,range:u.range};return K(0).then(function(){if(0<T.length)throw new Ke("Error modifying one or more objects",T,O,F);return D.length})})})},at.prototype.delete=function(){var r=this._ctx,i=r.range;return!Vr(r)||r.table.schema.yProps||!r.isPrimKey&&i.type!==3?this.modify(Al):this._write(function(u){var d=r.table.core.schema.primaryKey,p=i;return r.table.core.count({trans:u,query:{index:d,range:p}}).then(function(m){return r.table.core.mutate({trans:u,type:"deleteRange",range:p}).then(function(P){var k=P.failures,P=P.numFailures;if(P)throw new Ke("Could not delete some values",Object.keys(k).map(function(q){return k[q]}),m-P);return m-P})})})};var jd=at;function at(){}var Al=function(r,i){return i.value=null};function Dd(r,i){return r<i?-1:r===i?0:1}function Ld(r,i){return i<r?-1:r===i?0:1}function nn(r,i,u){return r=r instanceof Ml?new r.Collection(r):r,r._ctx.error=new(u||TypeError)(i),r}function Br(r){return new r.Collection(r,function(){return Ol("")}).limit(0)}function ao(F,i,u,d){var p,m,w,k,P,q,I,T=u.length;if(!u.every(function(D){return typeof D=="string"}))return nn(F,wl);function O(D){p=D==="next"?function(J){return J.toUpperCase()}:function(J){return J.toLowerCase()},m=D==="next"?function(J){return J.toLowerCase()}:function(J){return J.toUpperCase()},w=D==="next"?Dd:Ld;var K=u.map(function(J){return{lower:m(J),upper:p(J)}}).sort(function(J,H){return w(J.lower,H.lower)});k=K.map(function(J){return J.upper}),P=K.map(function(J){return J.lower}),I=(q=D)==="next"?"":d}O("next");var F=new F.Collection(F,function(){return Jn(k[0],P[T-1]+d)}),R=(F._ondirectionchange=function(D){O(D)},0);return F._addAlgorithm(function(D,K,J){var H=D.key;if(typeof H=="string"){var se=m(H);if(i(se,P,R))return!0;for(var ve=null,me=R;me<T;++me){var _e=((ge,Oe,be,Me,he,Be)=>{for(var Ue=Math.min(ge.length,Me.length),ze=-1,nt=0;nt<Ue;++nt){var rn=Oe[nt];if(rn!==Me[nt])return he(ge[nt],be[nt])<0?ge.substr(0,nt)+be[nt]+be.substr(nt+1):he(ge[nt],Me[nt])<0?ge.substr(0,nt)+Me[nt]+be.substr(nt+1):0<=ze?ge.substr(0,ze)+Oe[ze]+be.substr(ze+1):null;he(ge[nt],rn)<0&&(ze=nt)}return Ue<Me.length&&Be==="next"?ge+be.substr(ge.length):Ue<ge.length&&Be==="prev"?ge.substr(0,be.length):ze<0?null:ge.substr(0,ze)+Me[ze]+be.substr(ze+1)})(H,se,k[me],P[me],w,q);_e===null&&ve===null?R=me+1:(ve===null||0<w(ve,_e))&&(ve=_e)}K(ve!==null?function(){D.continue(ve+I)}:J)}return!1}),F}function Jn(r,i,u,d){return{type:2,lower:r,upper:i,lowerOpen:u,upperOpen:d}}function Ol(r){return{type:1,lower:r,upper:r}}Object.defineProperty(It.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),It.prototype.between=function(r,i,u,d){u=u!==!1,d=d===!0;try{return 0<this._cmp(r,i)||this._cmp(r,i)===0&&(u||d)&&(!u||!d)?Br(this):new this.Collection(this,function(){return Jn(r,i,!u,!d)})}catch{return nn(this,In)}},It.prototype.equals=function(r){return r==null?nn(this,In):new this.Collection(this,function(){return Ol(r)})},It.prototype.above=function(r){return r==null?nn(this,In):new this.Collection(this,function(){return Jn(r,void 0,!0)})},It.prototype.aboveOrEqual=function(r){return r==null?nn(this,In):new this.Collection(this,function(){return Jn(r,void 0,!1)})},It.prototype.below=function(r){return r==null?nn(this,In):new this.Collection(this,function(){return Jn(void 0,r,!1,!0)})},It.prototype.belowOrEqual=function(r){return r==null?nn(this,In):new this.Collection(this,function(){return Jn(void 0,r)})},It.prototype.startsWith=function(r){return typeof r!="string"?nn(this,wl):this.between(r,r+yr,!0,!0)},It.prototype.startsWithIgnoreCase=function(r){return r===""?this.startsWith(r):ao(this,function(i,u){return i.indexOf(u[0])===0},[r],yr)},It.prototype.equalsIgnoreCase=function(r){return ao(this,function(i,u){return i===u[0]},[r],"")},It.prototype.anyOfIgnoreCase=function(){var r=Ge.apply(it,arguments);return r.length===0?Br(this):ao(this,function(i,u){return u.indexOf(i)!==-1},r,"")},It.prototype.startsWithAnyOfIgnoreCase=function(){var r=Ge.apply(it,arguments);return r.length===0?Br(this):ao(this,function(i,u){return u.some(function(d){return i.indexOf(d)===0})},r,yr)},It.prototype.anyOf=function(){var r,i,u=this,d=Ge.apply(it,arguments),p=this._cmp;try{d.sort(p)}catch{return nn(this,In)}return d.length===0?Br(this):((r=new this.Collection(this,function(){return Jn(d[0],d[d.length-1])}))._ondirectionchange=function(m){p=m==="next"?u._ascending:u._descending,d.sort(p)},i=0,r._addAlgorithm(function(m,w,k){for(var P=m.key;0<p(P,d[i]);)if(++i===d.length)return w(k),!1;return p(P,d[i])===0||(w(function(){m.continue(d[i])}),!1)}),r)},It.prototype.notEqual=function(r){return this.inAnyRange([[-1/0,r],[r,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},It.prototype.noneOf=function(){var r=Ge.apply(it,arguments);if(r.length===0)return new this.Collection(this);try{r.sort(this._ascending)}catch{return nn(this,In)}var i=r.reduce(function(u,d){return u?u.concat([[u[u.length-1][1],d]]):[[-1/0,d]]},null);return i.push([r[r.length-1],this.db._maxKey]),this.inAnyRange(i,{includeLowers:!1,includeUppers:!1})},It.prototype.inAnyRange=function(r,J){var u=this,d=this._cmp,p=this._ascending,m=this._descending,w=this._min,k=this._max;if(r.length===0)return Br(this);if(!r.every(function(H){return H[0]!==void 0&&H[1]!==void 0&&p(H[0],H[1])<=0}))return nn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",de.InvalidArgument);var P=!J||J.includeLowers!==!1,q=J&&J.includeUppers===!0,I,T=p;function O(H,se){return T(H[0],se[0])}try{(I=r.reduce(function(H,se){for(var ve=0,me=H.length;ve<me;++ve){var _e=H[ve];if(d(se[0],_e[1])<0&&0<d(se[1],_e[0])){_e[0]=w(_e[0],se[0]),_e[1]=k(_e[1],se[1]);break}}return ve===me&&H.push(se),H},[])).sort(O)}catch{return nn(this,In)}var F=0,R=q?function(H){return 0<p(H,I[F][1])}:function(H){return 0<=p(H,I[F][1])},D=P?function(H){return 0<m(H,I[F][0])}:function(H){return 0<=m(H,I[F][0])},K=R,J=new this.Collection(this,function(){return Jn(I[0][0],I[I.length-1][1],!P,!q)});return J._ondirectionchange=function(H){T=H==="next"?(K=R,p):(K=D,m),I.sort(O)},J._addAlgorithm(function(H,se,ve){for(var me,_e=H.key;K(_e);)if(++F===I.length)return se(ve),!1;return!R(me=_e)&&!D(me)||(u._cmp(_e,I[F][1])===0||u._cmp(_e,I[F][0])===0||se(function(){T===p?H.continue(I[F][0]):H.continue(I[F][1])}),!1)}),J},It.prototype.startsWithAnyOf=function(){var r=Ge.apply(it,arguments);return r.every(function(i){return typeof i=="string"})?r.length===0?Br(this):this.inAnyRange(r.map(function(i){return[i,i+yr]})):nn(this,"startsWithAnyOf() only works with strings")};var Ml=It;function It(){}function vn(r){return yt(function(i){return cs(i),r(i.target.error),!1})}function cs(r){r.stopPropagation&&r.stopPropagation(),r.preventDefault&&r.preventDefault()}var lo="storagemutated",Di="x-storagemutated-1",Xn=ls(null,lo),Rd=(wn.prototype._lock=function(){return Q(!De.global),++this._reculock,this._reculock!==1||De.global||(De.lockOwnerFor=this),this},wn.prototype._unlock=function(){if(Q(!De.global),--this._reculock==0)for(De.global||(De.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var r=this._blockedFuncs.shift();try{mr(r[1],r[0])}catch{}}return this},wn.prototype._locked=function(){return this._reculock&&De.lockOwnerFor!==this},wn.prototype.create=function(r){var i=this;if(this.mode){var u=this.db.idbdb,d=this.db._state.dbOpenError;if(Q(!this.idbtrans),!r&&!u)switch(d&&d.name){case"DatabaseClosedError":throw new de.DatabaseClosed(d);case"MissingAPIError":throw new de.MissingAPI(d.message,d);default:throw new de.OpenFailed(d)}if(!this.active)throw new de.TransactionInactive;Q(this._completion._state===null),(r=this.idbtrans=r||(this.db.core||u).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=yt(function(p){cs(p),i._reject(r.error)}),r.onabort=yt(function(p){cs(p),i.active&&i._reject(new de.Abort(r.error)),i.active=!1,i.on("abort").fire(p)}),r.oncomplete=yt(function(){i.active=!1,i._resolve(),"mutatedParts"in r&&Xn.storagemutated.fire(r.mutatedParts)})}return this},wn.prototype._promise=function(r,i,u){var d,p=this;return r==="readwrite"&&this.mode!=="readwrite"?Ct(new de.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Ee(function(m,w){p._blockedFuncs.push([function(){p._promise(r,i,u).then(m,w)},De])}):u?zn(function(){var m=new Ee(function(w,k){p._lock();var P=i(w,k,p);P&&P.then&&P.then(w,k)});return m.finally(function(){return p._unlock()}),m._lib=!0,m}):((d=new Ee(function(m,w){var k=i(m,w,p);k&&k.then&&k.then(m,w)}))._lib=!0,d):Ct(new de.TransactionInactive)},wn.prototype._root=function(){return this.parent?this.parent._root():this},wn.prototype.waitFor=function(r){var i,u=this._root(),d=Ee.resolve(r),p=(u._waitingFor?u._waitingFor=u._waitingFor.then(function(){return d}):(u._waitingFor=d,u._waitingQueue=[],i=u.idbtrans.objectStore(u.storeNames[0]),function m(){for(++u._spinCount;u._waitingQueue.length;)u._waitingQueue.shift()();u._waitingFor&&(i.get(-1/0).onsuccess=m)}()),u._waitingFor);return new Ee(function(m,w){d.then(function(k){return u._waitingQueue.push(yt(m.bind(null,k)))},function(k){return u._waitingQueue.push(yt(w.bind(null,k)))}).finally(function(){u._waitingFor===p&&(u._waitingFor=null)})})},wn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new de.Abort))},wn.prototype.table=function(r){var i=this._memoizedTables||(this._memoizedTables={});if(_(i,r))return i[r];var u=this.schema[r];if(u)return(u=new this.db.Table(r,u,this)).core=this.db.core.table(r),i[r]=u;throw new de.NotFound("Table "+r+" not part of transaction")},wn);function wn(){}function Li(r,i,u,d,p,m,w,k){return{name:r,keyPath:i,unique:u,multi:d,auto:p,compound:m,src:(u&&!w?"&":"")+(d?"*":"")+(p?"++":"")+Il(i),type:k}}function Il(r){return typeof r=="string"?r:r?"["+[].join.call(r,"+")+"]":""}function Ri(r,i,u){return{name:r,primKey:i,indexes:u,mappedClass:null,idxByName:(d=function(p){return[p.name,p]},u.reduce(function(p,m,w){return m=d(m,w),m&&(p[m[0]]=m[1]),p},{}))};var d}var ds=function(r){try{return r.only([[]]),ds=function(){return[[]]},[[]]}catch{return ds=function(){return yr},yr}};function Ki(r){return r==null?function(){}:typeof r=="string"?(i=r).split(".").length===1?function(u){return u[i]}:function(u){return ie(u,i)}:function(u){return ie(u,r)};var i}function jl(r){return[].slice.call(r)}var Kd=0;function fs(r){return r==null?":id":typeof r=="string"?r:"[".concat(r.join("+"),"]")}function Fd(r,i,w){function d(K){if(K.type===3)return null;if(K.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var F=K.lower,R=K.upper,D=K.lowerOpen,K=K.upperOpen;return F===void 0?R===void 0?null:i.upperBound(R,!!K):R===void 0?i.lowerBound(F,!!D):i.bound(F,R,!!D,!!K)}function p(O){var F,R,D=O.name;return{name:D,schema:O,mutate:function(K){var J=K.trans,H=K.type,se=K.keys,ve=K.values,me=K.range;return new Promise(function(_e,ge){_e=yt(_e);var Oe=J.objectStore(D),be=Oe.keyPath==null,Me=H==="put"||H==="add";if(!Me&&H!=="delete"&&H!=="deleteRange")throw new Error("Invalid operation type: "+H);var he,Be=(se||ve||{length:1}).length;if(se&&ve&&se.length!==ve.length)throw new Error("Given keys array must have same length as given values array.");if(Be===0)return _e({numFailures:0,failures:{},results:[],lastResult:void 0});function Ue(Gt){++rn,cs(Gt)}var ze=[],nt=[],rn=0;if(H==="deleteRange"){if(me.type===4)return _e({numFailures:rn,failures:nt,results:[],lastResult:void 0});me.type===3?ze.push(he=Oe.clear()):ze.push(he=Oe.delete(d(me)))}else{var be=Me?be?[ve,se]:[ve,null]:[se,null],He=be[0],Nt=be[1];if(Me)for(var Vt=0;Vt<Be;++Vt)ze.push(he=Nt&&Nt[Vt]!==void 0?Oe[H](He[Vt],Nt[Vt]):Oe[H](He[Vt])),he.onerror=Ue;else for(Vt=0;Vt<Be;++Vt)ze.push(he=Oe[H](He[Vt])),he.onerror=Ue}function _o(Gt){Gt=Gt.target.result,ze.forEach(function(_r,na){return _r.error!=null&&(nt[na]=_r.error)}),_e({numFailures:rn,failures:nt,results:H==="delete"?se:ze.map(function(_r){return _r.result}),lastResult:Gt})}he.onerror=function(Gt){Ue(Gt),_o(Gt)},he.onsuccess=_o})},getMany:function(K){var J=K.trans,H=K.keys;return new Promise(function(se,ve){se=yt(se);for(var me,_e=J.objectStore(D),ge=H.length,Oe=new Array(ge),be=0,Me=0,he=function(ze){ze=ze.target,Oe[ze._pos]=ze.result,++Me===be&&se(Oe)},Be=vn(ve),Ue=0;Ue<ge;++Ue)H[Ue]!=null&&((me=_e.get(H[Ue]))._pos=Ue,me.onsuccess=he,me.onerror=Be,++be);be===0&&se(Oe)})},get:function(K){var J=K.trans,H=K.key;return new Promise(function(se,ve){se=yt(se);var me=J.objectStore(D).get(H);me.onsuccess=function(_e){return se(_e.target.result)},me.onerror=vn(ve)})},query:(F=P,R=q,function(K){return new Promise(function(J,H){J=yt(J);var se,ve,me,_e,Be=K.trans,ge=K.values,Oe=K.limit,he=K.query,be=(be=K.direction)!=null?be:"next",Me=Oe===1/0?void 0:Oe,Ue=he.index,he=he.range,Be=Be.objectStore(D),Be=Ue.isPrimaryKey?Be:Be.index(Ue.name),Ue=d(he);if(Oe===0)return J({result:[]});R?(he={query:Ue,count:Me,direction:be},(se=ge?Be.getAll(he):Be.getAllKeys(he)).onsuccess=function(ze){return J({result:ze.target.result})},se.onerror=vn(H)):F&&be==="next"?((se=ge?Be.getAll(Ue,Me):Be.getAllKeys(Ue,Me)).onsuccess=function(ze){return J({result:ze.target.result})},se.onerror=vn(H)):(ve=0,me=!ge&&"openKeyCursor"in Be?Be.openKeyCursor(Ue,be):Be.openCursor(Ue,be),_e=[],me.onsuccess=function(){var ze=me.result;return!ze||(_e.push(ge?ze.value:ze.primaryKey),++ve===Oe)?J({result:_e}):void ze.continue()},me.onerror=vn(H))})}),openCursor:function(K){var J=K.trans,H=K.values,se=K.query,ve=K.reverse,me=K.unique;return new Promise(function(_e,ge){_e=yt(_e);var Me=se.index,Oe=se.range,be=J.objectStore(D),be=Me.isPrimaryKey?be:be.index(Me.name),Me=ve?me?"prevunique":"prev":me?"nextunique":"next",he=!H&&"openKeyCursor"in be?be.openKeyCursor(d(Oe),Me):be.openCursor(d(Oe),Me);he.onerror=vn(ge),he.onsuccess=yt(function(Be){var Ue,ze,nt,rn,He=he.result;He?(He.___id=++Kd,He.done=!1,Ue=He.continue.bind(He),ze=(ze=He.continuePrimaryKey)&&ze.bind(He),nt=He.advance.bind(He),rn=function(){throw new Error("Cursor not stopped")},He.trans=J,He.stop=He.continue=He.continuePrimaryKey=He.advance=function(){throw new Error("Cursor not started")},He.fail=yt(ge),He.next=function(){var Nt=this,Vt=1;return this.start(function(){return Vt--?Nt.continue():Nt.stop()}).then(function(){return Nt})},He.start=function(Nt){function Vt(){if(he.result)try{Nt()}catch(Gt){He.fail(Gt)}else He.done=!0,He.start=function(){throw new Error("Cursor behind last entry")},He.stop()}var _o=new Promise(function(Gt,_r){Gt=yt(Gt),he.onerror=vn(_r),He.fail=_r,He.stop=function(na){He.stop=He.continue=He.continuePrimaryKey=He.advance=rn,Gt(na)}});return he.onsuccess=yt(function(Gt){he.onsuccess=Vt,Vt()}),He.continue=Ue,He.continuePrimaryKey=ze,He.advance=nt,Vt(),_o},_e(He)):_e(null)},ge)})},count:function(K){var J=K.query,H=K.trans,se=J.index,ve=J.range;return new Promise(function(me,_e){var ge=H.objectStore(D),ge=se.isPrimaryKey?ge:ge.index(se.name),Oe=d(ve),Oe=Oe?ge.count(Oe):ge.count();Oe.onsuccess=yt(function(be){return me(be.target.result)}),Oe.onerror=vn(_e)})}}}m=w,k=jl((w=r).objectStoreNames),I=0<k.length?m.objectStore(k[0]):{};var m,w={schema:{name:w.name,tables:k.map(function(O){return m.objectStore(O)}).map(function(O){var F=O.keyPath,R=O.autoIncrement,K=f(F),D={},K={name:O.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:F==null,compound:K,keyPath:F,autoIncrement:R,unique:!0,extractKey:Ki(F)},indexes:jl(O.indexNames).map(function(J){return O.index(J)}).map(function(ve){var me=ve.name,H=ve.unique,se=ve.multiEntry,ve=ve.keyPath,me={name:me,compound:f(ve),keyPath:ve,unique:H,multiEntry:se,extractKey:Ki(ve)};return D[fs(ve)]=me}),getIndexByKeyPath:function(J){return D[fs(J)]}};return D[":id"]=K.primaryKey,F!=null&&(D[fs(F)]=K.primaryKey),K})},hasGetAll:0<k.length&&"getAll"in I&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in I},k=w.schema,P=w.hasGetAll,q=w.hasIdb3Features,I=k.tables.map(p),T={};return I.forEach(function(O){return T[O.name]=O}),{stack:"dbcore",transaction:r.transaction.bind(r),table:function(O){if(T[O])return T[O];throw new Error("Table '".concat(O,"' not found"))},MIN_KEY:-1/0,MAX_KEY:ds(i),schema:k}}function Nd(r,i,u,d){return u=u.IDBKeyRange,i=Fd(i,u,d),{dbcore:r.dbcore.reduce(function(p,m){return m=m.create,s(s({},p),m(p))},i)}}function uo(r,i){var u=i.db,u=Nd(r._middlewares,u,r._deps,i);r.core=u.dbcore,r.tables.forEach(function(d){var p=d.name;r.core.schema.tables.some(function(m){return m.name===p})&&(d.core=r.core.table(p),r[p]instanceof r.Table)&&(r[p].core=d.core)})}function co(r,i,u,d){u.forEach(function(p){var m=d[p];i.forEach(function(w){var k=function P(q,I){return re(q,I)||(q=g(q))&&P(q,I)}(w,p);(!k||"value"in k&&k.value===void 0)&&(w===r.Transaction.prototype||w instanceof r.Transaction?B(w,p,{get:function(){return this.table(p)},set:function(P){E(this,p,{value:P,writable:!0,configurable:!0,enumerable:!0})}}):w[p]=new r.Table(p,m))})})}function Fi(r,i){i.forEach(function(u){for(var d in u)u[d]instanceof r.Table&&delete u[d]})}function Vd(r,i){return r._cfg.version-i._cfg.version}function Bd(r,i,u,d){var p=r._dbSchema,m=(u.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=Ri("$meta",Ll("")[0],[]),r._storeNames.push("$meta")),r._createTransaction("readwrite",r._storeNames,p)),w=(m.create(u),m._completion.catch(d),m._reject.bind(m)),k=De.transless||De;zn(function(){if(De.trans=m,De.transless=k,i!==0)return uo(r,u),q=i,((P=m).storeNames.includes("$meta")?P.table("$meta").get("version").then(function(I){return I??q}):Ee.resolve(q)).then(function(K){var T=r,O=K,F=m,R=u,D=[],K=T._versions,J=T._dbSchema=po(0,T.idbdb,R);return(K=K.filter(function(H){return H._cfg.version>=O})).length===0?Ee.resolve():(K.forEach(function(H){D.push(function(){var se,ve,me,_e=J,ge=H._cfg.dbschema,Oe=(vo(T,_e,R),vo(T,ge,R),J=T._dbSchema=ge,Ni(_e,ge)),be=(Oe.add.forEach(function(Me){Vi(R,Me[0],Me[1].primKey,Me[1].indexes)}),Oe.change.forEach(function(Me){if(Me.recreate)throw new de.Upgrade("Not yet support for changing primary key");var he=R.objectStore(Me.name);Me.add.forEach(function(Be){return fo(he,Be)}),Me.change.forEach(function(Be){he.deleteIndex(Be.name),fo(he,Be)}),Me.del.forEach(function(Be){return he.deleteIndex(Be)})}),H._cfg.contentUpgrade);if(be&&H._cfg.version>O)return uo(T,R),F._memoizedTables={},se=A(ge),Oe.del.forEach(function(Me){se[Me]=_e[Me]}),Fi(T,[T.Transaction.prototype]),co(T,[T.Transaction.prototype],c(se),se),F.schema=se,(ve=Qe(be))&&Nr(),ge=Ee.follow(function(){var Me;(me=be(F))&&ve&&(Me=Gn.bind(null,null),me.then(Me,Me))}),me&&typeof me.then=="function"?Ee.resolve(me):ge.then(function(){return me})}),D.push(function(se){var ve,me,_e=H._cfg.dbschema;ve=_e,me=se,[].slice.call(me.db.objectStoreNames).forEach(function(ge){return ve[ge]==null&&me.db.deleteObjectStore(ge)}),Fi(T,[T.Transaction.prototype]),co(T,[T.Transaction.prototype],T._storeNames,T._dbSchema),F.schema=T._dbSchema}),D.push(function(se){T.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(T.idbdb.version/10)===H._cfg.version?(T.idbdb.deleteObjectStore("$meta"),delete T._dbSchema.$meta,T._storeNames=T._storeNames.filter(function(ve){return ve!=="$meta"})):se.objectStore("$meta").put(H._cfg.version,"version"))})}),function H(){return D.length?Ee.resolve(D.shift()(F.idbtrans)).then(H):Ee.resolve()}().then(function(){Dl(J,R)}))}).catch(w);var P,q;c(p).forEach(function(I){Vi(u,I,p[I].primKey,p[I].indexes)}),uo(r,u),Ee.follow(function(){return r.on.populate.fire(m)}).catch(w)})}function Ud(r,i){Dl(r._dbSchema,i),i.db.version%10!=0||i.objectStoreNames.contains("$meta")||i.db.createObjectStore("$meta").add(Math.ceil(i.db.version/10-1),"version");var u=po(0,r.idbdb,i);vo(r,r._dbSchema,i);for(var d=0,p=Ni(u,r._dbSchema).change;d<p.length;d++){var m=(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=i.objectStore(w.name);w.add.forEach(function(P){z&&console.debug("Dexie upgrade patch: Creating missing index ".concat(w.name,".").concat(P.src)),fo(k,P)})})(p[d]);if(typeof m=="object")return m.value}}function Ni(r,i){var u,d={del:[],add:[],change:[]};for(u in r)i[u]||d.del.push(u);for(u in i){var p=r[u],m=i[u];if(p){var w={name:u,def:m,recreate:!1,del:[],add:[],change:[]};if(""+(p.primKey.keyPath||"")!=""+(m.primKey.keyPath||"")||p.primKey.auto!==m.primKey.auto)w.recreate=!0,d.change.push(w);else{var k=p.idxByName,P=m.idxByName,q=void 0;for(q in k)P[q]||w.del.push(q);for(q in P){var I=k[q],T=P[q];I?I.src!==T.src&&w.change.push(T):w.add.push(T)}(0<w.del.length||0<w.add.length||0<w.change.length)&&d.change.push(w)}}else d.add.push([u,m])}return d}function Vi(r,i,u,d){var p=r.db.createObjectStore(i,u.keyPath?{keyPath:u.keyPath,autoIncrement:u.auto}:{autoIncrement:u.auto});d.forEach(function(m){return fo(p,m)})}function Dl(r,i){c(r).forEach(function(u){i.db.objectStoreNames.contains(u)||(z&&console.debug("Dexie: Creating missing table",u),Vi(i,u,r[u].primKey,r[u].indexes))})}function fo(r,i){r.createIndex(i.name,i.keyPath,{unique:i.unique,multiEntry:i.multi})}function po(r,i,u){var d={};return $(i.objectStoreNames,0).forEach(function(p){for(var m=u.objectStore(p),w=Li(Il(q=m.keyPath),q||"",!0,!1,!!m.autoIncrement,q&&typeof q!="string",!0),k=[],P=0;P<m.indexNames.length;++P){var I=m.index(m.indexNames[P]),q=I.keyPath,I=Li(I.name,q,!!I.unique,!!I.multiEntry,!1,q&&typeof q!="string",!1);k.push(I)}d[p]=Ri(p,w,k)}),d}function vo(r,i,u){for(var d=u.db.objectStoreNames,p=0;p<d.length;++p){var m=d[p],w=u.objectStore(m);r._hasGetAll="getAll"in w;for(var k=0;k<w.indexNames.length;++k){var P,q=w.indexNames[k],I=w.index(q).keyPath,I=typeof I=="string"?I:"["+$(I).join("+")+"]";i[m]&&(P=i[m].idxByName[I])&&(P.name=q,delete i[m].idxByName[I],i[m].idxByName[q]=P)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a.WorkerGlobalScope&&a instanceof a.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)}function Ll(r){return r.split(",").map(function(i,u){var p=i.split(":"),d=(d=p[1])==null?void 0:d.trim(),p=(i=p[0].trim()).replace(/([&*]|\+\+)/g,""),m=/^\[/.test(p)?p.match(/^\[(.*)\]$/)[1].split("+"):p;return Li(p,m||null,/\&/.test(i),/\*/.test(i),/\+\+/.test(i),f(m),u===0,d)})}Ur.prototype._createTableSchema=Ri,Ur.prototype._parseIndexSyntax=Ll,Ur.prototype._parseStoresSpec=function(r,i){var u=this;c(r).forEach(function(d){if(r[d]!==null){var p=u._parseIndexSyntax(r[d]),m=p.shift();if(!m)throw new de.Schema("Invalid schema for table "+d+": "+r[d]);if(m.unique=!0,m.multi)throw new de.Schema("Primary key cannot be multiEntry*");p.forEach(function(w){if(w.auto)throw new de.Schema("Only primary key can be marked as autoIncrement (++)");if(!w.keyPath)throw new de.Schema("Index must have a name and cannot be an empty string")}),m=u._createTableSchema(d,m,p),i[d]=m}})},Ur.prototype.stores=function(u){var i=this.db,u=(this._cfg.storesSource=this._cfg.storesSource?h(this._cfg.storesSource,u):u,i._versions),d={},p={};return u.forEach(function(m){h(d,m._cfg.storesSource),p=m._cfg.dbschema={},m._parseStoresSpec(d,p)}),i._dbSchema=p,Fi(i,[i._allTables,i,i.Transaction.prototype]),co(i,[i._allTables,i,i.Transaction.prototype,this._cfg.tables],c(p),p),i._storeNames=c(p),this},Ur.prototype.upgrade=function(r){return this._cfg.contentUpgrade=G(this._cfg.contentUpgrade||b,r),this};var qd=Ur;function Ur(){}var ps=(()=>{var r,i,u;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(r=new Set,i=new FinalizationRegistry(function(d){r.delete(d)}),{toArray:function(){return Array.from(r).map(function(d){return d.deref()}).filter(function(d){return d!==void 0})},add:function(d){var p=new WeakRef(d._novip);r.add(p),i.register(d._novip,p,p),r.size>d._options.maxConnections&&(p=r.values().next().value,r.delete(p),i.unregister(p))},remove:function(d){if(d)for(var p=r.values(),m=p.next();!m.done;){var w=m.value;if(w.deref()===d._novip)return r.delete(w),void i.unregister(w);m=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 Bi(r,i){var u=r._dbNamesDB;return u||(u=r._dbNamesDB=new jn(no,{addons:[],indexedDB:r,IDBKeyRange:i})).version(1).stores({dbnames:"name"}),u.table("dbnames")}function Ui(r){return r&&typeof r.databases=="function"}function qi(r){return zn(function(){return De.letThrough=!0,r()})}function Hi(r){return!("from"in r)}var Ft=function(r,i){var u;if(!this)return u=new Ft,r&&"d"in r&&h(u,r),u;h(this,arguments.length?{d:1,from:r,to:1<arguments.length?i:r}:{d:0})};function vs(r,i,u){var d=rt(i,u);if(!isNaN(d)){if(0<d)throw RangeError();if(Hi(r))return h(r,{from:i,to:u,d:1});var d=r.l,p=r.r;if(rt(u,r.from)<0)return d?vs(d,i,u):r.l={from:i,to:u,d:1,l:null,r:null},Kl(r);if(0<rt(i,r.to))return p?vs(p,i,u):r.r={from:i,to:u,d:1,l:null,r:null},Kl(r);rt(i,r.from)<0&&(r.from=i,r.l=null,r.d=p?p.d+1:1),0<rt(u,r.to)&&(r.to=u,r.r=null,r.d=r.l?r.l.d+1:1),i=!r.r,d&&!r.l&&hs(r,d),p&&i&&hs(r,p)}}function hs(r,i){Hi(i)||function u(d,p){var m=p.from,w=p.l,k=p.r;vs(d,m,p.to),w&&u(d,w),k&&u(d,k)}(r,i)}function Rl(r,i){var u=ho(i),d=u.next();if(!d.done)for(var p=d.value,m=ho(r),w=m.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=m.next(p.from)).value}return!1}function ho(r){var i=Hi(r)?null:{s:0,n:r};return{next:function(u){for(var d=0<arguments.length;i;)switch(i.s){case 0:if(i.s=1,d)for(;i.n.l&&rt(u,i.n.from)<0;)i={up:i,n:i.n.l,s:1};else for(;i.n.l;)i={up:i,n:i.n.l,s:1};case 1:if(i.s=2,!d||rt(u,i.n.to)<=0)return{value:i.n,done:!1};case 2:if(i.n.r){i.s=3,i={up:i,n:i.n.r,s:0};continue}case 3:i=i.up}return{done:!0}}}}function Kl(r){var i,u,d,p=(((p=r.r)==null?void 0:p.d)||0)-(((p=r.l)==null?void 0:p.d)||0),p=1<p?"r":p<-1?"l":"";p&&(i=p=="r"?"l":"r",u=s({},r),d=r[p],r.from=d.from,r.to=d.to,r[p]=d[p],u[p]=d[i],(r[i]=u).d=Fl(u)),r.d=Fl(r)}function Fl(u){var i=u.r,u=u.l;return(i?u?Math.max(i.d,u.d):i.d:u?u.d:0)+1}function mo(r,i){return c(i).forEach(function(u){r[u]?hs(r[u],i[u]):r[u]=function d(p){var m,w,k={};for(m in p)_(p,m)&&(w=p[m],k[m]=!w||typeof w!="object"||le.has(w.constructor)?w:d(w));return k}(i[u])}),r}function Wi(r,i){return r.all||i.all||Object.keys(r).some(function(u){return i[u]&&Rl(i[u],r[u])})}C(Ft.prototype,((Ye={add:function(r){return hs(this,r),this},addKey:function(r){return vs(this,r,r),this},addKeys:function(r){var i=this;return r.forEach(function(u){return vs(i,u,u)}),this},hasKey:function(r){var i=ho(this).next(r).value;return i&&rt(i.from,r)<=0&&0<=rt(i.to,r)}})[Le]=function(){return ho(this)},Ye));var br={},zi={},Gi=!1;function yo(r){mo(zi,r),Gi||(Gi=!0,setTimeout(function(){Gi=!1,Yi(zi,!(zi={}))},0))}function Yi(r,i){i===void 0&&(i=!1);var u=new Set;if(r.all)for(var d=0,p=Object.values(br);d<p.length;d++)Nl(k=p[d],r,u,i);else for(var m in r){var w,k,m=/^idb\:\/\/(.*)\/(.*)\//.exec(m);m&&(w=m[1],m=m[2],k=br["idb://".concat(w,"/").concat(m)])&&Nl(k,r,u,i)}u.forEach(function(P){return P()})}function Nl(r,i,u,d){for(var p=[],m=0,w=Object.entries(r.queries.query);m<w.length;m++){for(var k=w[m],P=k[0],q=[],I=0,T=k[1];I<T.length;I++){var O=T[I];Wi(i,O.obsSet)?O.subscribers.forEach(function(K){return u.add(K)}):d&&q.push(O)}d&&p.push([P,q])}if(d)for(var F=0,R=p;F<R.length;F++){var D=R[F],P=D[0],q=D[1];r.queries.query[P]=q}}function Hd(r){var i=r._state,u=r._deps.indexedDB;if(i.isBeingOpened||r.idbdb)return i.dbReadyPromise.then(function(){return i.dbOpenError?Ct(i.dbOpenError):r});i.isBeingOpened=!0,i.dbOpenError=null,i.openComplete=!1;var d=i.openCanceller,p=Math.round(10*r.verno),m=!1;function w(){if(i.openCanceller!==d)throw new de.DatabaseClosed("db.open() was cancelled")}function k(){return new Ee(function(O,F){if(w(),!u)throw new de.MissingAPI;var R=r.name,D=i.autoSchema||!p?u.open(R):u.open(R,p);if(!D)throw new de.MissingAPI;D.onerror=vn(F),D.onblocked=yt(r._fireOnBlocked),D.onupgradeneeded=yt(function(K){var J;I=D.transaction,i.autoSchema&&!r._options.allowEmptyDB?(D.onerror=cs,I.abort(),D.result.close(),(J=u.deleteDatabase(R)).onsuccess=J.onerror=yt(function(){F(new de.NoSuchDatabase("Database ".concat(R," doesnt exist")))})):(I.onerror=vn(F),J=K.oldVersion>Math.pow(2,62)?0:K.oldVersion,T=J<1,r.idbdb=D.result,m&&Ud(r,I),Bd(r,J/10,I,F))},F),D.onsuccess=yt(function(){I=null;var K,J,H,se,ve,me,_e=r.idbdb=D.result,ge=$(_e.objectStoreNames);if(0<ge.length)try{var Oe=_e.transaction((ve=ge).length===1?ve[0]:ve,"readonly");if(i.autoSchema)me=_e,se=Oe,(H=r).verno=me.version/10,se=H._dbSchema=po(0,me,se),H._storeNames=$(me.objectStoreNames,0),co(H,[H._allTables],c(se),se);else if(vo(r,r._dbSchema,Oe),J=Oe,((J=Ni(po(0,(K=r).idbdb,J),K._dbSchema)).add.length||J.change.some(function(be){return be.add.length||be.change.length}))&&!m)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."),_e.close(),p=_e.version+1,m=!0,O(k());uo(r,Oe)}catch{}ps.add(r),_e.onversionchange=yt(function(be){i.vcFired=!0,r.on("versionchange").fire(be)}),_e.onclose=yt(function(){r.close({disableAutoOpen:!1})}),T&&(ge=r._deps,ve=R,Ui(me=ge.indexedDB)||ve===no||Bi(me,ge.IDBKeyRange).put({name:ve}).catch(b)),O()},F)}).catch(function(O){switch(O==null?void 0:O.name){case"UnknownError":if(0<i.PR1398_maxLoop)return i.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),k();break;case"VersionError":if(0<p)return p=0,k()}return Ee.reject(O)})}var P,q=i.dbReadyResolve,I=null,T=!1;return Ee.race([d,(typeof navigator>"u"?Ee.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(O){function F(){return indexedDB.databases().finally(O)}P=setInterval(F,100),F()}).finally(function(){return clearInterval(P)}):Promise.resolve()).then(k)]).then(function(){return w(),i.onReadyBeingFired=[],Ee.resolve(qi(function(){return r.on.ready.fire(r.vip)})).then(function O(){var F;if(0<i.onReadyBeingFired.length)return F=i.onReadyBeingFired.reduce(G,b),i.onReadyBeingFired=[],Ee.resolve(qi(function(){return F(r.vip)})).then(O)})}).finally(function(){i.openCanceller===d&&(i.onReadyBeingFired=null,i.isBeingOpened=!1)}).catch(function(O){i.dbOpenError=O;try{I&&I.abort()}catch{}return d===i.openCanceller&&r._close(),Ct(O)}).finally(function(){i.openComplete=!0,q()}).then(function(){var O;return T&&(O={},r.tables.forEach(function(F){F.schema.indexes.forEach(function(R){R.name&&(O["idb://".concat(r.name,"/").concat(F.name,"/").concat(R.name)]=new Ft(-1/0,[[[]]]))}),O["idb://".concat(r.name,"/").concat(F.name,"/")]=O["idb://".concat(r.name,"/").concat(F.name,"/:dels")]=new Ft(-1/0,[[[]]])}),Xn(lo).fire(O),Yi(O,!0)),r})}function Ji(r){function i(m){return r.next(m)}var u=p(i),d=p(function(m){return r.throw(m)});function p(m){return function(k){var k=m(k),P=k.value;return k.done?P:P&&typeof P.then=="function"?P.then(u,d):f(P)?Promise.all(P).then(u,d):u(P)}}return p(i)()}function go(r,i,u){for(var d=f(r)?r.slice():[r],p=0;p<u;++p)d.push(i);return d}var Wd={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(r){return s(s({},r),{table:function(d){var u=r.table(d),d=u.schema,p=Object.create(null),m=[];function w(O,F,R){var H=fs(O),D=p[H]=p[H]||[],K=O==null?0:typeof O=="string"?1:O.length,J=0<F,H=s(s({},R),{name:J?"".concat(H,"(virtual-from:").concat(R.name,")"):R.name,lowLevelIndex:R,isVirtual:J,keyTail:F,keyLength:K,extractKey:Ki(O),unique:!J&&R.unique});return D.push(H),H.isPrimaryKey||m.push(H),1<K&&w(K===2?O[0]:O.slice(0,K-1),F+1,R),D.sort(function(se,ve){return se.keyTail-ve.keyTail}),H}var k=w(d.primaryKey.keyPath,0,d.primaryKey);p[":id"]=[k];for(var P=0,q=d.indexes;P<q.length;P++){var I=q[P];w(I.keyPath,0,I)}function T(O){var F,R=O.query.index;return R.isVirtual?s(s({},O),{query:{index:R.lowLevelIndex,range:(F=O.query.range,R=R.keyTail,{type:F.type===1?2:F.type,lower:go(F.lower,F.lowerOpen?r.MAX_KEY:r.MIN_KEY,R),lowerOpen:!0,upper:go(F.upper,F.upperOpen?r.MIN_KEY:r.MAX_KEY,R),upperOpen:!0})}}):O}return s(s({},u),{schema:s(s({},d),{primaryKey:k,indexes:m,getIndexByKeyPath:function(O){return(O=p[fs(O)])&&O[0]}}),count:function(O){return u.count(T(O))},query:function(O){return u.query(T(O))},openCursor:function(O){var F=O.query.index,R=F.keyTail,D=F.keyLength;return F.isVirtual?u.openCursor(T(O)).then(function(J){return J&&K(J)}):u.openCursor(O);function K(J){return Object.create(J,{continue:{value:function(H){H!=null?J.continue(go(H,O.reverse?r.MAX_KEY:r.MIN_KEY,R)):O.unique?J.continue(J.key.slice(0,D).concat(O.reverse?r.MIN_KEY:r.MAX_KEY,R)):J.continue()}},continuePrimaryKey:{value:function(H,se){J.continuePrimaryKey(go(H,r.MAX_KEY,R),se)}},primaryKey:{get:function(){return J.primaryKey}},key:{get:function(){var H=J.key;return D===1?H[0]:H.slice(0,D)}},value:{get:function(){return J.value}}})}}})}})}};function Xi(r,i,u,d){return u=u||{},d=d||"",c(r).forEach(function(p){var m,w,k;_(i,p)?(m=r[p],w=i[p],typeof m=="object"&&typeof w=="object"&&m&&w?(k=Je(m))!==Je(w)?u[d+p]=i[p]:k==="Object"?Xi(m,w,u,d+p+"."):m!==w&&(u[d+p]=i[p]):m!==w&&(u[d+p]=i[p])):u[d+p]=void 0}),c(i).forEach(function(p){_(r,p)||(u[d+p]=i[p])}),u}function Qi(r,i){return i.type==="delete"?i.keys:i.keys||i.values.map(r.extractKey)}var zd={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(r){return s(s({},r),{table:function(i){var u=r.table(i),d=u.schema.primaryKey;return s(s({},u),{mutate:function(p){var m=De.trans,w=m.table(i).hook,k=w.deleting,P=w.creating,q=w.updating;switch(p.type){case"add":if(P.fire===b)break;return m._promise("readwrite",function(){return I(p)},!0);case"put":if(P.fire===b&&q.fire===b)break;return m._promise("readwrite",function(){return I(p)},!0);case"delete":if(k.fire===b)break;return m._promise("readwrite",function(){return I(p)},!0);case"deleteRange":if(k.fire===b)break;return m._promise("readwrite",function(){return function T(O,F,R){return u.query({trans:O,values:!1,query:{index:d,range:F},limit:R}).then(function(D){var K=D.result;return I({type:"delete",keys:K,trans:O}).then(function(J){return 0<J.numFailures?Promise.reject(J.failures[0]):K.length<R?{failures:[],numFailures:0,lastResult:void 0}:T(O,s(s({},F),{lower:K[K.length-1],lowerOpen:!0}),R)})})}(p.trans,p.range,1e4)},!0)}return u.mutate(p);function I(T){var O,F,R,D=De.trans,K=T.keys||Qi(d,T);if(K)return(T=T.type==="add"||T.type==="put"?s(s({},T),{keys:K}):s({},T)).type!=="delete"&&(T.values=o([],T.values)),T.keys&&(T.keys=o([],T.keys)),O=u,R=K,((F=T).type==="add"?Promise.resolve([]):O.getMany({trans:F.trans,keys:R,cache:"immutable"})).then(function(J){var H=K.map(function(se,ve){var me,_e,ge,Oe=J[ve],be={onerror:null,onsuccess:null};return T.type==="delete"?k.fire.call(be,se,Oe,D):T.type==="add"||Oe===void 0?(me=P.fire.call(be,se,T.values[ve],D),se==null&&me!=null&&(T.keys[ve]=se=me,d.outbound||Y(T.values[ve],d.keyPath,se))):(me=Xi(Oe,T.values[ve]),(_e=q.fire.call(be,me,se,Oe,D))&&(ge=T.values[ve],Object.keys(_e).forEach(function(Me){_(ge,Me)?ge[Me]=_e[Me]:Y(ge,Me,_e[Me])}))),be});return u.mutate(T).then(function(se){for(var ve=se.failures,me=se.results,_e=se.numFailures,se=se.lastResult,ge=0;ge<K.length;++ge){var Oe=(me||K)[ge],be=H[ge];Oe==null?be.onerror&&be.onerror(ve[ge]):be.onsuccess&&be.onsuccess(T.type==="put"&&J[ge]?T.values[ge]:Oe)}return{failures:ve,results:me,numFailures:_e,lastResult:se}}).catch(function(se){return H.forEach(function(ve){return ve.onerror&&ve.onerror(se)}),Promise.reject(se)})});throw new Error("Keys missing")}}})}})}};function Vl(r,i,u){try{if(!i||i.keys.length<r.length)return null;for(var d=[],p=0,m=0;p<i.keys.length&&m<r.length;++p)rt(i.keys[p],r[m])===0&&(d.push(u?ke(i.values[p]):i.values[p]),++m);return d.length===r.length?d:null}catch{return null}}var Gd={stack:"dbcore",level:-1,create:function(r){return{table:function(i){var u=r.table(i);return s(s({},u),{getMany:function(d){var p;return d.cache?(p=Vl(d.keys,d.trans._cache,d.cache==="clone"))?Ee.resolve(p):u.getMany(d).then(function(m){return d.trans._cache={keys:d.keys,values:d.cache==="clone"?ke(m):m},m}):u.getMany(d)},mutate:function(d){return d.type!=="add"&&(d.trans._cache=null),u.mutate(d)}})}}}};function Bl(r,i){return r.trans.mode==="readonly"&&!!r.subscr&&!r.trans.explicit&&r.trans.db._options.cache!=="disabled"&&!i.schema.primaryKey.outbound}function Ul(r,i){switch(r){case"query":return i.values&&!i.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Yd={stack:"dbcore",level:0,name:"Observability",create:function(r){var i=r.schema.name,u=new Ft(r.MIN_KEY,r.MAX_KEY);return s(s({},r),{transaction:function(d,p,m){if(De.subscr&&p!=="readonly")throw new de.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(De.querier));return r.transaction(d,p,m)},table:function(d){function p(K){var D,K=K.query;return[D=K.index,new Ft((D=(K=K.range).lower)!=null?D:r.MIN_KEY,(D=K.upper)!=null?D:r.MAX_KEY)]}var m=r.table(d),w=m.schema,k=w.primaryKey,P=w.indexes,q=k.extractKey,I=k.outbound,T=k.autoIncrement&&P.filter(function(R){return R.compound&&R.keyPath.includes(k.keyPath)}),O=s(s({},m),{mutate:function(R){function D(he){return he="idb://".concat(i,"/").concat(d,"/").concat(he),ve[he]||(ve[he]=new Ft)}var K,J,H,se=R.trans,ve=R.mutatedParts||(R.mutatedParts={}),me=D(""),_e=D(":dels"),ge=R.type,be=R.type==="deleteRange"?[R.range]:R.type==="delete"?[R.keys]:R.values.length<50?[Qi(k,R).filter(function(he){return he}),R.values]:[],Oe=be[0],be=be[1],Me=R.trans._cache;return f(Oe)?(me.addKeys(Oe),(ge=ge==="delete"||Oe.length===be.length?Vl(Oe,Me):null)||_e.addKeys(Oe),(ge||be)&&(K=D,J=ge,H=be,w.indexes.forEach(function(he){var Be=K(he.name||"");function Ue(nt){return nt!=null?he.extractKey(nt):null}function ze(nt){he.multiEntry&&f(nt)?nt.forEach(function(rn){return Be.addKey(rn)}):Be.addKey(nt)}(J||H).forEach(function(nt,Nt){var He=J&&Ue(J[Nt]),Nt=H&&Ue(H[Nt]);rt(He,Nt)!==0&&(He!=null&&ze(He),Nt!=null)&&ze(Nt)})}))):Oe?(be={from:(Me=Oe.lower)!=null?Me:r.MIN_KEY,to:(ge=Oe.upper)!=null?ge:r.MAX_KEY},_e.add(be),me.add(be)):(me.add(u),_e.add(u),w.indexes.forEach(function(he){return D(he.name).add(u)})),m.mutate(R).then(function(he){return!Oe||R.type!=="add"&&R.type!=="put"||(me.addKeys(he.results),T&&T.forEach(function(Be){for(var Ue=R.values.map(function(He){return Be.extractKey(He)}),ze=Be.keyPath.findIndex(function(He){return He===k.keyPath}),nt=0,rn=he.results.length;nt<rn;++nt)Ue[nt][ze]=he.results[nt];D(Be.name).addKeys(Ue)})),se.mutatedParts=mo(se.mutatedParts||{},ve),he})}}),F={get:function(R){return[k,new Ft(R.key)]},getMany:function(R){return[k,new Ft().addKeys(R.keys)]},count:p,query:p,openCursor:p};return c(F).forEach(function(R){O[R]=function(D){var K=De.subscr,J=!!K,H=Bl(De,m)&&Ul(R,D)?D.obsSet={}:K;if(J){var se,K=function(be){return be="idb://".concat(i,"/").concat(d,"/").concat(be),H[be]||(H[be]=new Ft)},ve=K(""),me=K(":dels"),J=F[R](D),_e=J[0],J=J[1];if((R==="query"&&_e.isPrimaryKey&&!D.values?me:K(_e.name||"")).add(J),!_e.isPrimaryKey){if(R!=="count")return se=R==="query"&&I&&D.values&&m.query(s(s({},D),{values:!1})),m[R].apply(this,arguments).then(function(be){if(R==="query"){if(I&&D.values)return se.then(function(Ue){return Ue=Ue.result,ve.addKeys(Ue),be});var Me=D.values?be.result.map(q):be.result;(D.values?ve:me).addKeys(Me)}else{var he,Be;if(R==="openCursor")return Be=D.values,(he=be)&&Object.create(he,{key:{get:function(){return me.addKey(he.primaryKey),he.key}},primaryKey:{get:function(){var Ue=he.primaryKey;return me.addKey(Ue),Ue}},value:{get:function(){return Be&&ve.addKey(he.primaryKey),he.value}}})}return be});me.add(u)}}return m[R].apply(this,arguments)}}),O}})}};function ql(r,i,u){var d;return u.numFailures===0?i:i.type==="deleteRange"||(d=i.keys?i.keys.length:"values"in i&&i.values?i.values.length:1,u.numFailures===d)?null:(d=s({},i),f(d.keys)&&(d.keys=d.keys.filter(function(p,m){return!(m in u.failures)})),"values"in d&&f(d.values)&&(d.values=d.values.filter(function(p,m){return!(m in u.failures)})),d)}function Zi(r,i){return u=r,((d=i).lower===void 0||(d.lowerOpen?0<rt(u,d.lower):0<=rt(u,d.lower)))&&(u=r,(d=i).upper===void 0||(d.upperOpen?rt(u,d.upper)<0:rt(u,d.upper)<=0));var u,d}function Hl(r,i,u,d,p,m){var w,k,P,q,I,T,O;return!u||u.length===0||(w=i.query.index,k=w.multiEntry,P=i.query.range,q=d.schema.primaryKey.extractKey,I=w.extractKey,T=(w.lowLevelIndex||w).extractKey,(d=u.reduce(function(F,R){var D=F,K=[];if(R.type==="add"||R.type==="put")for(var J=new Ft,H=R.values.length-1;0<=H;--H){var se,ve=R.values[H],me=q(ve);!J.hasKey(me)&&(se=I(ve),k&&f(se)?se.some(function(Me){return Zi(Me,P)}):Zi(se,P))&&(J.addKey(me),K.push(ve))}switch(R.type){case"add":var _e=new Ft().addKeys(i.values?F.map(function(he){return q(he)}):F),D=F.concat(i.values?K.filter(function(he){return he=q(he),!_e.hasKey(he)&&(_e.addKey(he),!0)}):K.map(function(he){return q(he)}).filter(function(he){return!_e.hasKey(he)&&(_e.addKey(he),!0)}));break;case"put":var ge=new Ft().addKeys(R.values.map(function(he){return q(he)}));D=F.filter(function(he){return!ge.hasKey(i.values?q(he):he)}).concat(i.values?K:K.map(function(he){return q(he)}));break;case"delete":var Oe=new Ft().addKeys(R.keys);D=F.filter(function(he){return!Oe.hasKey(i.values?q(he):he)});break;case"deleteRange":var be=R.range;D=F.filter(function(he){return!Zi(q(he),be)})}return D},r))===r)?r:(O=function(F,R){return rt(T(F),T(R))||rt(q(F),q(R))},d.sort(i.direction==="prev"||i.direction==="prevunique"?function(F,R){return O(R,F)}:O),i.limit&&i.limit<1/0&&(d.length>i.limit?d.length=i.limit:r.length===i.limit&&d.length<i.limit&&(p.dirty=!0)),m?Object.freeze(d):d)}function Wl(r,i){return rt(r.lower,i.lower)===0&&rt(r.upper,i.upper)===0&&!!r.lowerOpen==!!i.lowerOpen&&!!r.upperOpen==!!i.upperOpen}function Jd(r,i){return((u,d,p,m)=>{if(u===void 0)return d!==void 0?-1:0;if(d===void 0)return 1;if((u=rt(u,d))===0){if(p&&m)return 0;if(p)return 1;if(m)return-1}return u})(r.lower,i.lower,r.lowerOpen,i.lowerOpen)<=0&&0<=((u,d,p,m)=>{if(u===void 0)return d!==void 0?1:0;if(d===void 0)return-1;if((u=rt(u,d))===0){if(p&&m)return 0;if(p)return-1;if(m)return 1}return u})(r.upper,i.upper,r.upperOpen,i.upperOpen)}function Xd(r,i,u,d){r.subscribers.add(u),d.addEventListener("abort",function(){var p,m;r.subscribers.delete(u),r.subscribers.size===0&&(p=r,m=i,setTimeout(function(){p.subscribers.size===0&&Ne(m,p)},3e3))})}var Qd={stack:"dbcore",level:0,name:"Cache",create:function(r){var i=r.schema.name;return s(s({},r),{transaction:function(u,d,p){var m,w,k=r.transaction(u,d,p);return d==="readwrite"&&(p=(m=new AbortController).signal,k.addEventListener("abort",(w=function(P){return function(){if(m.abort(),d==="readwrite"){for(var q=new Set,I=0,T=u;I<T.length;I++){var O=T[I],F=br["idb://".concat(i,"/").concat(O)];if(F){var R=r.table(O),D=F.optimisticOps.filter(function(he){return he.trans===k});if(k._explicit&&P&&k.mutatedParts)for(var K=0,J=Object.values(F.queries.query);K<J.length;K++)for(var H=0,se=(_e=J[K]).slice();H<se.length;H++)Wi((ge=se[H]).obsSet,k.mutatedParts)&&(Ne(_e,ge),ge.subscribers.forEach(function(he){return q.add(he)}));else if(0<D.length){F.optimisticOps=F.optimisticOps.filter(function(he){return he.trans!==k});for(var ve=0,me=Object.values(F.queries.query);ve<me.length;ve++)for(var _e,ge,Oe,be=0,Me=(_e=me[ve]).slice();be<Me.length;be++)(ge=Me[be]).res!=null&&k.mutatedParts&&(P&&!ge.dirty?(Oe=Object.isFrozen(ge.res),Oe=Hl(ge.res,ge.req,D,R,ge,Oe),ge.dirty?(Ne(_e,ge),ge.subscribers.forEach(function(he){return q.add(he)})):Oe!==ge.res&&(ge.res=Oe,ge.promise=Ee.resolve({result:Oe}))):(ge.dirty&&Ne(_e,ge),ge.subscribers.forEach(function(he){return q.add(he)})))}}}q.forEach(function(he){return he()})}}})(!1),{signal:p}),k.addEventListener("error",w(!1),{signal:p}),k.addEventListener("complete",w(!0),{signal:p})),k},table:function(u){var d=r.table(u),p=d.schema.primaryKey;return s(s({},d),{mutate:function(m){var w,k=De.trans;return!p.outbound&&k.db._options.cache!=="disabled"&&!k.explicit&&k.idbtrans.mode==="readwrite"&&(w=br["idb://".concat(i,"/").concat(u)])?(k=d.mutate(m),m.type!=="add"&&m.type!=="put"||!(50<=m.values.length||Qi(p,m).some(function(P){return P==null}))?(w.optimisticOps.push(m),m.mutatedParts&&yo(m.mutatedParts),k.then(function(P){0<P.numFailures&&(Ne(w.optimisticOps,m),(P=ql(0,m,P))&&w.optimisticOps.push(P),m.mutatedParts)&&yo(m.mutatedParts)}),k.catch(function(){Ne(w.optimisticOps,m),m.mutatedParts&&yo(m.mutatedParts)})):k.then(function(P){var q=ql(0,s(s({},m),{values:m.values.map(function(I,T){var O;return P.failures[T]?I:(Y(O=(O=p.keyPath)!=null&&O.includes(".")?ke(I):s({},I),p.keyPath,P.results[T]),O)})}),P);w.optimisticOps.push(q),queueMicrotask(function(){return m.mutatedParts&&yo(m.mutatedParts)})}),k):d.mutate(m)},query:function(m){var w,k,P,q,I,T,O;return Bl(De,d)&&Ul("query",m)?(w=((P=De.trans)==null?void 0:P.db._options.cache)==="immutable",k=(P=De).requery,P=P.signal,T=((F,R,D,K)=>{var J=br["idb://".concat(F,"/").concat(R)];if(!J)return[];if(!(F=J.queries[D]))return[null,!1,J,null];var H=F[(K.query?K.query.index.name:null)||""];if(!H)return[null,!1,J,null];switch(D){case"query":var se=(ve=K.direction)!=null?ve:"next",ve=H.find(function(me){var _e;return me.req.limit===K.limit&&me.req.values===K.values&&((_e=me.req.direction)!=null?_e:"next")===se&&Wl(me.req.query.range,K.query.range)});return ve?[ve,!0,J,H]:[H.find(function(me){var _e;return("limit"in me.req?me.req.limit:1/0)>=K.limit&&((_e=me.req.direction)!=null?_e:"next")===se&&(!K.values||me.req.values)&&Jd(me.req.query.range,K.query.range)}),!1,J,H];case"count":return ve=H.find(function(me){return Wl(me.req.query.range,K.query.range)}),[ve,!!ve,J,H]}})(i,u,"query",m),O=T[0],q=T[2],I=T[3],O&&T[1]?O.obsSet=m.obsSet:(T=d.query(m).then(function(F){var R=F.result;if(O&&(O.res=R),w){for(var D=0,K=R.length;D<K;++D)Object.freeze(R[D]);Object.freeze(R)}return F}).catch(function(F){return I&&O&&Ne(I,O),Promise.reject(F)}),O={obsSet:m.obsSet,promise:T,subscribers:new Set,type:"query",req:m,dirty:!1},I?I.push(O):(I=[O],(q=q||(br["idb://".concat(i,"/").concat(u)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[m.query.index.name||""]=I)),Xd(O,I,k,P),O.promise.then(function(F){return F=Hl(F.result,m,q==null?void 0:q.optimisticOps,d,O,w),{result:w?F:ke(F)}})):d.query(m)}})}})}};function bo(r,i){return new Proxy(r,{get:function(u,d,p){return d==="db"?i:Reflect.get(u,d,p)}})}St.prototype.version=function(r){if(isNaN(r)||r<.1)throw new de.Type("Given version is not a positive number");if(r=Math.round(10*r)/10,this.idbdb||this._state.isBeingOpened)throw new de.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,r);var i=this._versions,u=i.filter(function(d){return d._cfg.version===r})[0];return u||(u=new this.Version(r),i.push(u),i.sort(Vd),u.stores({}),this._state.autoSchema=!1),u},St.prototype._whenReady=function(r){var i=this;return this.idbdb&&(this._state.openComplete||De.letThrough||this._vip)?r():new Ee(function(u,d){if(i._state.openComplete)return d(new de.DatabaseClosed(i._state.dbOpenError));if(!i._state.isBeingOpened){if(!i._state.autoOpen)return void d(new de.DatabaseClosed);i.open().catch(b)}i._state.dbReadyPromise.then(u,d)}).then(r)},St.prototype.use=function(p){var i=p.stack,u=p.create,d=p.level,p=p.name,m=(p&&this.unuse({stack:i,name:p}),this._middlewares[i]||(this._middlewares[i]=[]));return m.push({stack:i,create:u,level:d??10,name:p}),m.sort(function(w,k){return w.level-k.level}),this},St.prototype.unuse=function(r){var i=r.stack,u=r.name,d=r.create;return i&&this._middlewares[i]&&(this._middlewares[i]=this._middlewares[i].filter(function(p){return d?p.create!==d:!!u&&p.name!==u})),this},St.prototype.open=function(){var r=this;return mr(Pt,function(){return Hd(r)})},St.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var r=this._state;if(ps.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}r.isBeingOpened||(r.dbReadyPromise=new Ee(function(i){r.dbReadyResolve=i}),r.openCanceller=new Ee(function(i,u){r.cancelOpen=u}))},St.prototype.close=function(i){var i=(i===void 0?{disableAutoOpen:!0}:i).disableAutoOpen,u=this._state;i?(u.isBeingOpened&&u.cancelOpen(new de.DatabaseClosed),this._close(),u.autoOpen=!1,u.dbOpenError=new de.DatabaseClosed):(this._close(),u.autoOpen=this._options.autoOpen||u.isBeingOpened,u.openComplete=!1,u.dbOpenError=null)},St.prototype.delete=function(r){var i=this,u=(r===void 0&&(r={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),d=this._state;return new Ee(function(p,m){function w(){i.close(r);var k=i._deps.indexedDB.deleteDatabase(i.name);k.onsuccess=yt(function(){var P,q,I;P=i._deps,q=i.name,Ui(I=P.indexedDB)||q===no||Bi(I,P.IDBKeyRange).delete(q).catch(b),p()}),k.onerror=vn(m),k.onblocked=i._fireOnBlocked}if(u)throw new de.InvalidArgument("Invalid closeOptions argument to db.delete()");d.isBeingOpened?d.dbReadyPromise.then(w):w()})},St.prototype.backendDB=function(){return this.idbdb},St.prototype.isOpen=function(){return this.idbdb!==null},St.prototype.hasBeenClosed=function(){var r=this._state.dbOpenError;return r&&r.name==="DatabaseClosed"},St.prototype.hasFailed=function(){return this._state.dbOpenError!==null},St.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(St.prototype,"tables",{get:function(){var r=this;return c(this._allTables).map(function(i){return r._allTables[i]})},enumerable:!1,configurable:!0}),St.prototype.transaction=function(){var r=(function(i,u,d){var p=arguments.length;if(p<2)throw new de.InvalidArgument("Too few arguments");for(var m=new Array(p-1);--p;)m[p-1]=arguments[p];return d=m.pop(),[i,N(m),d]}).apply(this,arguments);return this._transaction.apply(this,r)},St.prototype._transaction=function(r,i,u){var d,p,m=this,w=De.trans,k=(w&&w.db===this&&r.indexOf("!")===-1||(w=null),r.indexOf("?")!==-1);r=r.replace("!","").replace("?","");try{if(p=i.map(function(q){if(q=q instanceof m.Table?q.name:q,typeof q!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return q}),r=="r"||r===Oi)d=Oi;else{if(r!="rw"&&r!=Mi)throw new de.InvalidArgument("Invalid transaction mode: "+r);d=Mi}if(w){if(w.mode===Oi&&d===Mi){if(!k)throw new de.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");w=null}w&&p.forEach(function(q){if(w&&w.storeNames.indexOf(q)===-1){if(!k)throw new de.SubTransaction("Table "+q+" not included in parent transaction.");w=null}}),k&&w&&!w.active&&(w=null)}}catch(q){return w?w._promise(null,function(I,T){T(q)}):Ct(q)}var P=(function q(I,T,O,F,R){return Ee.resolve().then(function(){var H=De.transless||De,D=I._createTransaction(T,O,I._dbSchema,F),H=(D.explicit=!0,{trans:D,transless:H});if(F)D.idbtrans=F.idbtrans;else try{D.create(),D.idbtrans._explicit=!0,I._state.PR1398_maxLoop=3}catch(se){return se.name===Kt.InvalidState&&I.isOpen()&&0<--I._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),I.close({disableAutoOpen:!1}),I.open().then(function(){return q(I,T,O,null,R)})):Ct(se)}var K,J=Qe(R),H=(J&&Nr(),Ee.follow(function(){var se;(K=R.call(D,D))&&(J?(se=Gn.bind(null,null),K.then(se,se)):typeof K.next=="function"&&typeof K.throw=="function"&&(K=Ji(K)))},H));return(K&&typeof K.then=="function"?Ee.resolve(K).then(function(se){return D.active?se:Ct(new de.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):H.then(function(){return K})).then(function(se){return F&&D._resolve(),D._completion.then(function(){return se})}).catch(function(se){return D._reject(se),Ct(se)})})}).bind(null,this,d,p,w,u);return w?w._promise(d,P,"lock"):De.trans?mr(De.transless,function(){return m._whenReady(P)}):this._whenReady(P)},St.prototype.table=function(r){if(_(this._allTables,r))return this._allTables[r];throw new de.InvalidTable("Table ".concat(r," does not exist"))};var jn=St;function St(r,i){var u,d,p,m,w,k=this,P=(this._middlewares={},this.verno=0,St.dependencies),P=(this._options=i=s({addons:St.addons,autoOpen:!0,indexedDB:P.indexedDB,IDBKeyRange:P.IDBKeyRange,cache:"cloned",maxConnections:1e3},i),this._deps={indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},i.addons),q=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:b,dbReadyPromise:null,cancelOpen:b,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:i.autoOpen}),I=(q.dbReadyPromise=new Ee(function(T){q.dbReadyResolve=T}),q.openCanceller=new Ee(function(T,O){q.cancelOpen=O}),this._state=q,this.name=r,this.on=ls(this,"populate","blocked","versionchange","close",{ready:[G,b]}),this.once=function(T,O){var F=function(){for(var R=[],D=0;D<arguments.length;D++)R[D]=arguments[D];k.on(T).unsubscribe(F),O.apply(k,R)};return k.on(T,F)},this.on.ready.subscribe=M(this.on.ready.subscribe,function(T){return function(O,F){St.vip(function(){var R,D=k._state;D.openComplete?(D.dbOpenError||Ee.resolve().then(O),F&&T(O)):D.onReadyBeingFired?(D.onReadyBeingFired.push(O),F&&T(O)):(T(O),R=k,F||T(function K(){R.on.ready.unsubscribe(O),R.on.ready.unsubscribe(K)}))})}}),this.Collection=(u=this,us(jd.prototype,function(K,D){this.db=u;var F=_l,R=null;if(D)try{F=D()}catch(H){R=H}var D=K._ctx,K=D.table,J=K.hook.reading.fire;this._ctx={table:K,index:D.index,isPrimKey:!D.index||K.schema.primKey.keyPath&&D.index===K.schema.primKey.name,range:F,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:R,or:D.or,valueMapper:J!==U?J:null}})),this.Table=(d=this,us($l.prototype,function(T,O,F){this.db=d,this._tx=F,this.name=T,this.schema=O,this.hook=d._allTables[T]?d._allTables[T].hook:ls(null,{creating:[ae,b],reading:[fe,U],updating:[ye,b],deleting:[ue,b]})})),this.Transaction=(p=this,us(Rd.prototype,function(T,O,F,R,D){var K=this;T!=="readonly"&&O.forEach(function(J){J=(J=F[J])==null?void 0:J.yProps,J&&(O=O.concat(J.map(function(H){return H.updatesTable})))}),this.db=p,this.mode=T,this.storeNames=O,this.schema=F,this.chromeTransactionDurability=R,this.idbtrans=null,this.on=ls(this,"complete","error","abort"),this.parent=D||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 Ee(function(J,H){K._resolve=J,K._reject=H}),this._completion.then(function(){K.active=!1,K.on.complete.fire()},function(J){var H=K.active;return K.active=!1,K.on.error.fire(J),K.parent?K.parent._reject(J):H&&K.idbtrans&&K.idbtrans.abort(),Ct(J)})})),this.Version=(m=this,us(qd.prototype,function(T){this.db=m,this._cfg={version:T,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(w=this,us(Ml.prototype,function(T,O,F){if(this.db=w,this._ctx={table:T,index:O===":id"?null:O,or:F},this._cmp=this._ascending=rt,this._descending=function(R,D){return rt(D,R)},this._max=function(R,D){return 0<rt(R,D)?R:D},this._min=function(R,D){return rt(R,D)<0?R:D},this._IDBKeyRange=w._deps.IDBKeyRange,!this._IDBKeyRange)throw new de.MissingAPI})),this.on("versionchange",function(T){0<T.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(T){!T.newVersion||T.newVersion<T.oldVersion?console.warn("Dexie.delete('".concat(k.name,"') was blocked")):console.warn("Upgrade '".concat(k.name,"' blocked by other connection holding version ").concat(T.oldVersion/10))}),this._maxKey=ds(i.IDBKeyRange),this._createTransaction=function(T,O,F,R){return new k.Transaction(T,O,F,k._options.chromeTransactionDurability,R)},this._fireOnBlocked=function(T){k.on("blocked").fire(T),ps.toArray().filter(function(O){return O.name===k.name&&O!==k&&!O._state.vcFired}).map(function(O){return O.on("versionchange").fire(T)})},this.use(Gd),this.use(Qd),this.use(Yd),this.use(Wd),this.use(zd),new Proxy(this,{get:function(T,O,F){var R;return O==="_vip"||(O==="table"?function(D){return bo(k.table(D),I)}:(R=Reflect.get(T,O,F))instanceof $l?bo(R,I):O==="tables"?R.map(function(D){return bo(D,I)}):O==="_createTransaction"?function(){return bo(R.apply(this,arguments),I)}:R)}}));this.vip=I,P.forEach(function(T){return T(k)})}var wo,qr=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Zd=(ea.prototype.subscribe=function(r,i,u){return this._subscribe(r&&typeof r!="function"?r:{next:r,error:i,complete:u})},ea.prototype[qr]=function(){return this},ea);function ea(r){this._subscribe=r}try{wo={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch{wo={indexedDB:null,IDBKeyRange:null}}function zl(r){var i,u=!1,d=new Zd(function(p){var m=Qe(r),w,k=!1,P={},q={},I={get closed(){return k},unsubscribe:function(){k||(k=!0,w&&w.abort(),T&&Xn.storagemutated.unsubscribe(R))}},T=(p.start&&p.start(I),!1),O=function(){return Ai(D)};function F(){return Wi(q,P)}var R=function(K){mo(P,K),F()&&O()},D=function(){var K,J,H;!k&&wo.indexedDB&&(P={},K={},w&&w.abort(),w=new AbortController,H=(se=>{var ve=Kr();try{m&&Nr();var me=zn(r,se);return me=m?me.finally(Gn):me}finally{ve&&Fr()}})(J={subscr:K,signal:w.signal,requery:O,querier:r,trans:null}),T||(Xn.storagemutated.subscribe(R),T=!0),Promise.resolve(H).then(function(se){u=!0,i=se,k||J.signal.aborted||(F()||(q=K,F())?O():(P={},Ai(function(){return!k&&p.next&&p.next(se)})))},function(se){u=!1,["DatabaseClosedError","AbortError"].includes(se==null?void 0:se.name)||k||Ai(function(){k||p.error&&p.error(se)})}))};return setTimeout(O,0),I});return d.hasValue=function(){return u},d.getValue=function(){return i},d}var wr=jn;function ta(r){var i=Qn;try{Qn=!0,Xn.storagemutated.fire(r),Yi(r,!0)}finally{Qn=i}}C(wr,s(s({},Se),{delete:function(r){return new wr(r,{addons:[]}).delete()},exists:function(r){return new wr(r,{addons:[]}).open().then(function(i){return i.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(r){try{return i=wr.dependencies,u=i.indexedDB,i=i.IDBKeyRange,(Ui(u)?Promise.resolve(u.databases()).then(function(d){return d.map(function(p){return p.name}).filter(function(p){return p!==no})}):Bi(u,i).toCollection().primaryKeys()).then(r)}catch{return Ct(new de.MissingAPI)}var i,u},defineClass:function(){return function(r){h(this,r)}},ignoreTransaction:function(r){return De.trans?mr(De.transless||Pt,r):r()},vip:qi,async:function(r){return function(){try{var i=Ji(r.apply(this,arguments));return i&&typeof i.then=="function"?i:Ee.resolve(i)}catch(u){return Ct(u)}}},spawn:function(r,i,u){try{var d=Ji(r.apply(u,i||[]));return d&&typeof d.then=="function"?d:Ee.resolve(d)}catch(p){return Ct(p)}},currentTransaction:{get:function(){return De.trans||null}},waitFor:function(r,i){return r=Ee.resolve(typeof r=="function"?wr.ignoreTransaction(r):r).timeout(i||6e4),De.trans?De.trans.waitFor(r):r},Promise:Ee,debug:{get:function(){return z},set:function(r){X(r)}},derive:ne,extend:h,props:C,override:M,Events:ls,on:Xn,liveQuery:zl,extendObservabilitySet:mo,getByKeyPath:ie,setByKeyPath:Y,delByKeyPath:function(r,i){typeof i=="string"?Y(r,i,void 0):"length"in i&&[].map.call(i,function(u){Y(r,u,void 0)})},shallowClone:A,deepClone:ke,getObjectDiff:Xi,cmp:rt,asap:ce,minKey:-1/0,addons:[],connections:{get:ps.toArray},errnames:Kt,dependencies:wo,cache:br,semVer:"4.4.6",version:"4.4.6".split(".").map(function(r){return parseInt(r)}).reduce(function(r,i,u){return r+i/Math.pow(10,2*u)})})),wr.maxKey=ds(wr.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Xn(lo,function(r){Qn||(r=new CustomEvent(Di,{detail:r}),Qn=!0,dispatchEvent(r),Qn=!1)}),addEventListener(Di,function(r){r=r.detail,Qn||ta(r)}));var Hr,Qn=!1,Gl=function(){};return typeof BroadcastChannel<"u"&&((Gl=function(){(Hr=new BroadcastChannel(Di)).onmessage=function(r){return r.data&&ta(r.data)}})(),typeof Hr.unref=="function"&&Hr.unref(),Xn(lo,function(r){Qn||Hr.postMessage(r)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(r){if(!jn.disableBfCache&&r.persisted){z&&console.debug("Dexie: handling persisted pagehide"),Hr!=null&&Hr.close();for(var i=0,u=ps.toArray();i<u.length;i++)u[i].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(r){!jn.disableBfCache&&r.persisted&&(z&&console.debug("Dexie: handling persisted pageshow"),Gl(),ta({all:new Ft(-1/0,[[]])}))})),Ee.rejectionMapper=function(r,i){return!r||r instanceof ee||r instanceof TypeError||r instanceof SyntaxError||!r.name||!v[r.name]?r:(i=new v[r.name](i||r.message,r),"stack"in r&&B(i,"stack",{get:function(){return this.inner.stack}}),i)},X(z),s(jn,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:jn,Entity:kl,PropModification:as,RangeSet:Ft,add:function(r){return new as({add:r})},cmp:rt,default:jn,liveQuery:zl,mergeRanges:hs,rangesOverlap:Rl,remove:function(r){return new as({remove:r})},replacePrefix:function(r,i){return new as({replacePrefix:[r,i]})}}),{default:jn}),jn})})(id);var Gv=id.exports;const ja=zv(Gv),Lu=Symbol.for("Dexie"),Xo=globalThis[Lu]||(globalThis[Lu]=ja);if(ja.semVer!==Xo.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${ja.semVer} and ${Xo.semVer}`);const{liveQuery:Yv,mergeRanges:Qk,rangesOverlap:Zk,RangeSet:ex,cmp:tx,Entity:nx,PropModification:rx,replacePrefix:sx,add:ox,remove:ix,DexieYProvider:ax}=Xo;class Jv extends Xo{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"})}}let pe;function Xv(e){pe=e}function ll(){pe&&pe.close(),pe=void 0}const Qv=4,Gr=["餐饮","交通","住房","通讯","学习","娱乐","其他"],Qo=["工资","报销","其他"],Ru=["公司","客户现场","出差","居家办公"],zs=[{key:"dev",label:"开发"},{key:"bugfix",label:"BUG修复"},{key:"test",label:"测试"},{key:"learning",label:"学习成长"},{key:"meeting",label:"会议沟通"},{key:"doc",label:"文档输出"},{key:"other",label:"其他"}];function Zo(e){const t=zs.find(n=>n.key===e);return t?t.label:"其他"}const Zv={class:"dialog",role:"dialog","aria-label":"编辑工作记录"},eh={class:"dialog-head"},th={key:0,class:"muted dialog-sub"},nh={class:"dialog-body"},rh={class:"form-grid"},sh={class:"field span2"},oh={key:0,class:"form-error"},ih={class:"field"},ah=["value"],lh={class:"field"},uh=["value"],ch={class:"field"},dh={class:"field"},fh={class:"field span2"},ph={class:"field"},vh={class:"field"},hh={class:"dialog-btns"},mh=Rt({__name:"EditLogDialog",props:{open:{type:Boolean},item:{},projects:{},date:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=L(""),a=L(null),c=L("dev"),f=L(null),h=L(""),g=L(""),y=L(0),_=L(0),C=L(""),E=L(null),B=st(()=>{var M;const oe=n.projects.filter(Q=>Q.archived!==1),$=(M=n.item)==null?void 0:M.project_id;if($&&!oe.some(Q=>Q.id===$)){const Q=n.projects.find(ie=>ie.id===$),ce=oe.slice();return Q&&ce.unshift({...Q,name:Q.name+"(已归档)"}),ce}return oe});function ne(oe){n.open&&oe.key==="Escape"&&s("cancel")}ht(()=>n.open,async oe=>{var $;if(oe){const M=n.item;o.value=(M==null?void 0:M.content)??"",a.value=(M==null?void 0:M.project_id)??null,c.value=(M==null?void 0:M.category)??"dev",f.value=(M==null?void 0:M.minutes)??null,h.value=(M==null?void 0:M.takeaway)??"",g.value=(M==null?void 0:M.remark)??"",y.value=(M==null?void 0:M.is_milestone)??0,_.value=(M==null?void 0:M.needs_followup)??0,C.value="",window.addEventListener("keydown",ne),await ss(),($=E.value)==null||$.focus()}else window.removeEventListener("keydown",ne)}),pr(()=>window.removeEventListener("keydown",ne)),ht(o,()=>{C.value&&(C.value="")});function re(){const oe=o.value.trim();if(!oe){C.value="请填写工作内容";return}if(!n.item||!n.item.id){s("cancel");return}s("save",{id:n.item.id,content:oe,project_id:a.value,category:c.value,minutes:f.value&&f.value>0?f.value:null,takeaway:h.value.trim()||null,remark:g.value.trim()||null,is_milestone:y.value?1:0,needs_followup:_.value?1:0})}return(oe,$)=>(S(),At(jr,{to:"body"},[$e(os,{name:"modal"},{default:fr(()=>[e.open?(S(),j("div",{key:0,class:"mask",onClick:$[10]||($[10]=sn(M=>s("cancel"),["self"]))},[l("div",Zv,[l("div",eh,[l("div",null,[$[11]||($[11]=l("div",{class:"dialog-title"},"编辑工作记录",-1)),e.date?(S(),j("div",th,te(e.date),1)):Ce("",!0)]),l("button",{class:"icon-btn",title:"关闭",onClick:$[0]||($[0]=M=>s("cancel"))},[$e(Xe,{name:"close",size:16})])]),l("div",nh,[l("div",rh,[l("div",sh,[$[12]||($[12]=l("label",null,"工作内容(必填)",-1)),Te(l("input",{ref_key:"contentInput",ref:E,class:et(["input",{invalid:C.value}]),"onUpdate:modelValue":$[1]||($[1]=M=>o.value=M),onKeydown:Ot(re,["enter"])},null,34),[[je,o.value]]),C.value?(S(),j("div",oh,te(C.value),1)):Ce("",!0)]),l("div",ih,[$[14]||($[14]=l("label",null,"所属项目",-1)),Te(l("select",{class:"select","onUpdate:modelValue":$[2]||($[2]=M=>a.value=M)},[$[13]||($[13]=l("option",{value:null},"无项目",-1)),(S(!0),j(Ie,null,ot(B.value,M=>(S(),j("option",{key:M.id,value:M.id},te(M.name),9,ah))),128))],512),[[Vn,a.value]])]),l("div",lh,[$[15]||($[15]=l("label",null,"工作分类",-1)),Te(l("select",{class:"select","onUpdate:modelValue":$[3]||($[3]=M=>c.value=M)},[(S(!0),j(Ie,null,ot(Ut(zs),M=>(S(),j("option",{key:M.key,value:M.key},te(M.label),9,uh))),128))],512),[[Vn,c.value]])]),l("div",ch,[$[16]||($[16]=l("label",null,"耗时(分钟)",-1)),Te(l("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":$[4]||($[4]=M=>f.value=M),placeholder:"选填"},null,512),[[je,f.value,void 0,{number:!0}]])]),l("div",dh,[$[17]||($[17]=l("label",null,"主要收获",-1)),Te(l("input",{class:"input","onUpdate:modelValue":$[5]||($[5]=M=>h.value=M),placeholder:"一句话:学到了什么"},null,512),[[je,h.value]])]),l("div",fh,[$[18]||($[18]=l("label",null,"备注",-1)),Te(l("textarea",{class:"textarea","onUpdate:modelValue":$[6]||($[6]=M=>g.value=M),placeholder:"背景、链接、未决事项(选填)"},null,512),[[je,g.value]])]),l("div",ph,[$[19]||($[19]=l("label",null,"成果标记",-1)),l("button",{class:et(["toggle-btn",{on:y.value===1}]),onClick:$[7]||($[7]=M=>y.value=y.value===1?0:1)},te(y.value===1?"已标记为成果":"未标记"),3)]),l("div",vh,[$[20]||($[20]=l("label",null,"待跟进",-1)),l("button",{class:et(["toggle-btn",{onwarn:_.value===1}]),onClick:$[8]||($[8]=M=>_.value=_.value===1?0:1)},te(_.value===1?"需要跟进":"无需跟进"),3)])])]),l("div",hh,[l("button",{class:"btn btn-sm",onClick:$[9]||($[9]=M=>s("cancel"))},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:re},"保存修改")])])])):Ce("",!0)]),_:1})]))}}),yh=Wt(mh,[["__scopeId","data-v-63bc0b48"]]);function Ts(e){return e<10?"0"+e:String(e)}function Bn(e){return e.getFullYear()+"-"+Ts(e.getMonth()+1)+"-"+Ts(e.getDate())}function xt(){return Bn(new Date)}function wt(){const e=new Date;return Bn(e)+"T"+Ts(e.getHours())+":"+Ts(e.getMinutes())+":"+Ts(e.getSeconds())}function Un(e){if(!e)return"--:--";const t=e.indexOf("T");return t>=0?e.slice(t+1,t+6):e.slice(0,5)}function is(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}function Nn(e,t){const n=is(e);return n.setDate(n.getDate()+t),Bn(n)}function ei(e,t){const n=is(e),s=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(s,o)),Bn(n)}function Ps(e){const t=is(e),n=(t.getDay()+6)%7;return t.setDate(t.getDate()-n),Bn(t)}function gh(e){const t=is(e).getDay();return t===0||t===6}function bh(e,t){return Math.round((new Date(t).getTime()-new Date(e).getTime())/6e4)}function ad(e){const t=is(e),n=["周日","周一","周二","周三","周四","周五","周六"];return t.getFullYear()+" 年 "+(t.getMonth()+1)+" 月 "+t.getDate()+" 日 "+n[t.getDay()]}const wh=15e4;function Da(e){const t=new Uint8Array(e);let n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return btoa(n)}function La(e){const t=atob(e),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}function _h(){return Da(crypto.getRandomValues(new Uint8Array(16)).buffer)}async function ti(e,t){const n=new TextEncoder,s=await crypto.subtle.importKey("raw",n.encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:La(t),iterations:wh,hash:"SHA-256"},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function ni(e,t){const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,new TextEncoder().encode(t));return Da(n.buffer)+":"+Da(s)}async function ki(e,t){const n=t.split(":");if(n.length!==2)throw new Error("密文格式错误");const s=await crypto.subtle.decrypt({name:"AES-GCM",iv:La(n[0])},e,La(n[1]));return new TextDecoder().decode(s)}async function ul(){await yd()}const ld="intern-log-vault-verify",ts="enc:v1:";let Dr=null;function kh(){return Dr!==null}function ri(){Dr=null}async function ud(){return await gt("pwd_salt","")!==""}async function xh(e){if(e.length<6)throw new Error("主密码至少 6 位");if(await ud())throw new Error("主密码已设置");const t=_h(),n=await ti(e,t),s=await ni(n,ld);await Lt("pwd_salt",t),await Lt("pwd_verifier",s),Dr=n}async function Ch(e){const t=await gt("pwd_salt","");if(!t)throw new Error("主密码尚未设置");const n=await ti(e,t),s=await gt("pwd_verifier","");try{await ki(n,s)}catch{throw new Error("主密码不正确")}Dr=n}async function cd(){if(!Dr)throw new Error("密码库未解锁");return Dr}async function Sh(e){const t=await cd();return ts+await ni(t,e)}async function Eh(e){if(!e)return"";if(!e.startsWith(ts))return e;const t=await cd();return ki(t,e.slice(ts.length))}async function $h(){return pe.credential.orderBy("system").toArray()}async function Th(e,t){const n=await Sh(e.password),s={system:e.system.trim(),account:e.account.trim(),password:n,remark:e.remark.trim()};t?await pe.credential.update(t,{...s,updated_at:wt()}):await pe.credential.add({...s,created_at:wt(),updated_at:wt()}),await ul()}async function Ph(e){await pe.credential.delete(e),await ul()}async function ma(e){const t=await pe.credential.get(e);if(!t)throw new Error("记录不存在");return Eh(t.password)}async function Ah(e,t){if(!e)throw new Error("请输入旧主密码");if(t.length<6)throw new Error("新主密码至少 6 位");if(t===e)throw new Error("新主密码不能与旧主密码相同");const n=await gt("pwd_salt","");if(!n)throw new Error("密码库尚未初始化");const s=await ti(e,n),o=await gt("pwd_verifier","");try{await ki(s,o)}catch{throw new Error("旧主密码不正确")}const a=await ti(t,n),c=await pe.credential.toArray();let f=0;for(const h of c){if(h.id==null)continue;const g=await Oh(h.password,s),y=ts+await ni(a,g);await pe.credential.update(h.id,{password:y}),f++}return await Lt("pwd_verifier",await ni(a,ld)),Dr=a,await ul(),f}async function Oh(e,t){return e?e.startsWith(ts)?ki(t,e.slice(ts.length)):e:""}const Mh="https://daywk.linyux.cn",Ih="dsh_sync_base",Ra="dsh_sync_token";function dd(e){try{return localStorage.getItem(e)||""}catch{return""}}function jh(e,t){try{localStorage.setItem(e,t)}catch{}}function Dh(e){try{localStorage.removeItem(e)}catch{}}async function Rr(){return dd(Ih)||Mh}function xi(){const e=dd(Ra);if(!e)return"";try{return e}catch{return""}}function Ns(e){e?jh(Ra,e):Dh(Ra)}const Lh="intern_worklog",cl="dsh_session_user";function Vs(){try{const e=localStorage.getItem(cl);if(!e)return null;const t=JSON.parse(e);if(t&&t.userId&&t.username)return t}catch{}return null}function Rh(e){localStorage.setItem(cl,JSON.stringify(e))}function fd(){localStorage.removeItem(cl)}const dl="dsh_cloud_creds";function pd(e,t){localStorage.setItem(dl,JSON.stringify({username:e,password:t}))}function gn(){try{const e=localStorage.getItem(dl);if(!e)return null;const t=JSON.parse(e);if(t&&t.username&&t.password)return t}catch{}return null}function Kh(){localStorage.removeItem(dl)}let si=null;function oi(e){si===e&&pe||(pe&&ll(),Xv(new Jv(Lh+"_"+e)),si=e)}async function Fh(e,t,n){const s=await Rr();let o;try{o=await fetch(s+"/api/auth/"+e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t.trim(),password:n})})}catch{throw new Error("无法连接同步服务器:请检查网络后重试")}const a=await o.json().catch(()=>({}));if(!o.ok){const c=a&&a.error||"服务返回 "+o.status;throw e==="register"&&o.status===409?new Error("云端已有同名账号且密码一致,直接登录即可"):new Error(String(c))}if(!a.userId||!a.username)throw new Error("登录响应异常");return{userId:String(a.userId),username:String(a.username)}}async function fl(e,t,n){const s=await Fh(n,e,t);oi(s.userId);const o={userId:s.userId,username:s.username};return Rh(o),pd(s.username,t),o}async function Nh(e,t){const n=(e||"").trim();if(!n||!t)throw new Error("请输入用户名与密码");return fl(n,t,"login")}async function Vh(e,t,n){const s=(e||"").trim();if(s.length<2||s.length>20)throw new Error("用户名需 2 到 20 个字符");if(t.length<6)throw new Error("登录密码至少 6 位");return fl(s,t,"register")}async function Bh(){const e=gn();if(!e)return null;try{return await fl(e.username,e.password,"login")}catch{return null}}async function Uh(){ri(),ll(),si=null,fd()}function qh(){ri(),ll(),si=null,fd(),Kh()}async function Hh(e,t){if(!Vs())throw new Error("未登录");if(t.length<6)throw new Error("新密码至少 6 位");const s=gn();if(!s||s.password!==e)throw new Error("旧密码不正确");const o=await Rr();let a;try{a=await fetch(o+"/api/auth/password",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+vd()},body:JSON.stringify({oldPassword:e,newPassword:t})})}catch{throw new Error("无法连接同步服务器")}if(!a.ok){const c=await a.json().catch(()=>({}));throw new Error(c&&c.error||"修改失败 "+a.status)}pd(s.username,t)}async function Wh(){if(!Vs())throw new Error("未登录");const t=await Rr();let n;try{n=await fetch(t+"/api/auth/delete",{method:"POST",headers:{Authorization:"Bearer "+vd()}})}catch{throw new Error("无法连接同步服务器")}if(!n.ok){const s=await n.json().catch(()=>({}));throw new Error(s&&s.error||"删除失败 "+n.status)}qh()}function vd(){return xi()}const Ka=L(null),Fa=L(null),Gs=L(0);function rr(){Gs.value++}const Xr=L(""),Bs=["project","work_log","log_item","attendance","weekly_note","setting","memo","credential","transaction"],Yr=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);function Io(e){return JSON.stringify(e)}async function zh(e){return pe.table(e).toArray()}function jo(e,t){return e==="setting"?t.key:t.id}async function Gh(){for(const e of Bs){const t=pe.table(e),n=await t.toArray();for(const s of n){if(e==="setting"&&Yr.has(s.key))continue;const o={};s.uuid||(o.uuid=Yh()),!s.updated_at&&s.created_at&&(o.updated_at=s.created_at),Object.keys(o).length&&await t.update(jo(e,s),o)}}}function Yh(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"u"+Date.now().toString(36)+Math.random().toString(36).slice(2,10)}async function Jh(){return gn()!=null}async function Xh(){try{return localStorage.getItem("dsh_last_sync")||""}catch{return""}}async function Qh(e){try{localStorage.setItem("dsh_last_sync",e)}catch{}}async function hd(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 s=await n.json();if(!s||!s.token)throw new Error("云端登录异常");return String(s.token)}async function Zh(e,t){let n=xi();return n||(n=await hd(e,t),Ns(n),n)}async function md(){const e=gn();if(!e)throw new Error("未登录");const t=await Rr(),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 Na(){const e=gn();if(!e)throw new Error("未登录,无法同步");return wd({baseUrl:await Rr(),username:e.username,password:e.password})}async function yd(){try{await Na()}catch(e){Xr.value=e instanceof Error?e.message:String(e);try{await Na()}catch{}throw e}}function gd(e,t,n){const s={};for(const o of Object.keys(t))o!=="id"&&(s[o]=t[o]);if(e==="log_item"){delete s.work_log_id,delete s.project_id;const o=t.work_log_id?n.workLog.get(t.work_log_id):null;o&&o.uuid&&(s.wuuid=o.uuid);const a=t.project_id?n.project.get(t.project_id):null;a&&a.uuid&&(s.puuid=a.uuid)}return s}async function bd(){const e=await pe.work_log.toArray(),t=await pe.project.toArray();return{workLog:new Map(e.map(n=>[n.id,n])),project:new Map(t.map(n=>[n.id,n]))}}let As=!1,Do=!1,Va=!1,Qr=null,xn=null,Ba="",Ua=!1,Lo=null;async function Zr(){if(As){Do=!0;return}try{if(!await Jh())return;await wd(await em()),Xr.value=""}catch(e){Xr.value=e instanceof Error?e.message:String(e)}}async function em(){const e=gn();if(!e)throw new Error("未登录,无法同步");return{baseUrl:await Rr(),username:e.username,password:e.password}}function tm(){if(Ua)return;Ua=!0,Lo=Yv(async()=>{const t={};for(const n of Bs)t[n]=await pe.table(n).count();return t}).subscribe({next:()=>{Va||As||(Qr&&globalThis.clearTimeout(Qr),Qr=globalThis.setTimeout(()=>{Zr()},3e3))},error:()=>{}})}function nm(){Lo&&(Lo.unsubscribe(),Lo=null),xn&&(xn.close(),xn=null,Ba=""),Qr&&(globalThis.clearTimeout(Qr),Qr=null),Ua=!1}function rm(e,t){const n=e+"|"+t;if(!(xn&&Ba===n)){xn&&(xn.close(),xn=null);try{xn=new EventSource(e+"/api/events?token="+encodeURIComponent(t)),Ba=n,xn.onmessage=()=>{Zr()}}catch{xn=null}}}async function wd(e){if(As)return Do=!0,{pushed:0,pulled:0,removed:0,errors:0,at:""};As=!0,Va=!0;try{const t=await sm(e);return Do&&(Do=!1,globalThis.setTimeout(()=>{Zr()},800)),t}finally{As=!1,Va=!1}}async function sm(e){const t=e.baseUrl.trim().replace(/\/+$/,"");if(!t)throw new Error("请先配置同步服务地址");await Gh();const n=await bd(),s=await pe.sync_mirror.toArray(),o=new Map;for(const re of s)o.set(re.table+"|"+re.uuid,re);const a={},c=[];let f=0;for(const re of Bs){let oe=await zh(re);re==="setting"&&(oe=oe.filter(M=>!Yr.has(M.key)));const $=new Map;for(const M of oe)$.set(M.uuid,M);for(const[M,Q]of $){const ce=gd(re,Q,n),ie=Io(ce),Y=o.get(re+"|"+M);(!Y||Y.hash!==ie)&&(a[re]=a[re]||[],a[re].push(ce),f++)}for(const[M,Q]of o)M.startsWith(re+"|")&&!$.has(Q.uuid)&&c.push({table:re,uuid:Q.uuid,deleted_at:wt()});a[re]=a[re]||[]}c.push(...um());const h=await Zh(t,e),g=re=>fetch(t+"/api/sync",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+re},body:JSON.stringify({device:"client",tables:a,tombstones:c})});let y=await g(h);if(y.status===401){Ns("");const re=await hd(t,e);Ns(re),y=await g(re)}if(!y.ok)throw new Error("同步服务返回 "+y.status);const _=await y.json(),C=_.tables||{},E=_.tombstones||[],B=await am(C,E);rm(t,xi()||h);const ne=wt();return await Qh(ne),(B.changed>0||B.removed>0||f>0)&&rr(),{pushed:f,pulled:B.changed,removed:B.removed,errors:0,at:ne}}function _d(){var t;return"dsh_idmap_"+(((t=gn())==null?void 0:t.username)||"anon")}function om(){try{const e=localStorage.getItem(_d());if(e)return JSON.parse(e)}catch{}return{}}function im(e){try{localStorage.setItem(_d(),JSON.stringify(e))}catch{}}async function am(e,t){const n=om(),s=new Set(t.map(C=>C.table+"|"+C.uuid)),o=new Map;for(const C of await pe.sync_mirror.toArray())o.set(C.table+"|"+C.uuid,C);const a=new Set(Array.from(o.keys()).map(C=>C.split("|")[1]));let c=0,f=0;const h={},g={};for(const C of Bs){const E=pe.table(C),B=await E.toArray(),ne=new Map(B.map(x=>[jo(C,x),x])),re=new Map(B.filter(x=>x.uuid).map(x=>[x.uuid,x])),oe=(e[C]||[]).filter(x=>!s.has(C+"|"+x.uuid)),$=oe.filter(x=>!(C==="setting"&&Yr.has(x.key))),M=oe.filter(x=>C==="setting"&&Yr.has(x.key));for(const x of M)lm(C,x.uuid);const Q=C==="setting"?[]:B.filter(x=>x.uuid&&!a.has(x.uuid)&&!s.has(C+"|"+x.uuid)),ce={v:Math.max(0,...B.map(x=>Number(x.id)||0))};$.length;const ie=[];for(const x of $){const N={...x};if(C==="log_item"){const ke=N.wuuid?h[N.wuuid]:void 0;if(!ke)continue;N.work_log_id=ke,delete N.wuuid,N.project_id=N.puuid?g[N.puuid]??null:null,delete N.puuid}let le=jo(C,x);if(C==="setting")le=x.key;else{const ke=n[C]&&n[C][x.uuid],Pe=re.get(x.uuid);Pe&&Pe.id!=null?le=Pe.id:typeof ke=="number"?le=ke:le=++ce.v}const W={...N,id:le};C==="setting"&&Yr.has(W.key)||(ie.push(W),C==="work_log"&&(h[x.uuid]=le),C==="project"&&(g[x.uuid]=le))}const Y=ie.concat(Q);for(const x of Y){const N=ne.get(jo(C,x));(!N||Io(N)!==Io(x))&&c++}f+=B.filter(x=>x.uuid&&!ie.some(N=>N.uuid===x.uuid)&&!s.has(C+"|"+x.uuid)).length,await E.clear(),Y.length&&await E.bulkPut(Y);const A={};for(const x of Y)x.uuid&&(A[x.uuid]=x.id);n[C]=A}im(n);const y=await bd(),_=[];for(const C of Bs){const E=await pe.table(C).toArray();for(const B of E)C==="setting"&&Yr.has(B.key)||B.uuid&&_.push({table:C,uuid:B.uuid,hash:Io(gd(C,B,y))})}return await pe.sync_mirror.clear(),_.length&&await pe.sync_mirror.bulkAdd(_.map(C=>({...C}))),await pe.tombstone.clear(),{changed:c,removed:f+ii.length}}const ii=[];function lm(e,t){ii.some(n=>n.table===e&&n.uuid===t)||ii.push({table:e,uuid:t,deleted_at:wt()})}function um(){return ii.splice(0)}const cm=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);async function _t(){await yd()}async function gt(e,t){const n=await pe.setting.get(e);return n?n.value:t}async function Lt(e,t){await pe.setting.put({key:e,value:t}),cm.has(e)||await _t()}async function Lr(){const e=await Promise.all([gt("work_start","09:00"),gt("work_end","18:00"),gt("grace_minutes","10"),gt("lunch_minutes","60"),gt("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 dm(){const e=await gt("last_project",""),t=await gt("last_category","dev");return{project_id:e?Number(e):null,category:t||"dev"}}async function fm(){return gt("last_location","")}async function pm(e,t){const n=t.trim();await Lt("last_location",n),n&&await ai(n);let s=!1;const o=await bn(e);o&&o.id?(o.location||"")!==n&&(await pe.attendance.update(o.id,{location:n||null}),s=!0):n&&(await pe.attendance.add({date:e,clock_in_at:null,clock_out_at:null,kind:"normal",note:null,location:n,created_at:wt()}),s=!0),s&&await _t()}async function pl(){const e=await gt("location_presets","");if(!e)return Ru.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 Ru.slice()}async function kd(e){const t=Array.from(new Set(e.map(n=>n.trim()).filter(Boolean)));await Lt("location_presets",JSON.stringify(t))}async function ai(e){const t=e.trim();if(!t)return;const n=await pl();n.includes(t)||await kd([...n,t])}async function Us(e=!1){const t=await pe.project.orderBy("name").toArray();return e?t:t.filter(n=>n.archived!==1)}async function vm(e){await pe.project.add({name:e.trim(),archived:0,created_at:wt()}),await _t()}async function hm(e,t){await pe.project.update(e,{name:t.trim()}),await _t()}async function mm(e,t){await pe.project.update(e,{archived:t?1:0}),await _t()}async function bn(e){return pe.attendance.where("date").equals(e).first()}async function xd(e,t){const n=((t===void 0?await gt("last_location",""):t)||"").trim();let s=!1;const o=await bn(e);if(o&&o.id){if(!o.clock_in_at){const a={clock_in_at:wt()};n&&(a.location=n),await pe.attendance.update(o.id,a),s=!0}n&&(await gt("last_location","")!==n&&await Lt("last_location",n),await ai(n)),s&&await _t();return}await pe.attendance.add({date:e,clock_in_at:wt(),clock_out_at:null,kind:"normal",note:null,location:n||null,created_at:wt()}),n&&(await Lt("last_location",n),await ai(n)),await _t()}async function ym(e){const t=await bn(e);t&&t.id&&t.clock_in_at&&!t.clock_out_at&&(await pe.attendance.update(t.id,{clock_out_at:wt()}),await _t())}async function gm(){const e=new Date,t=Bn(e);let n="";if(e.getHours()<4){const s=await bn(Nn(t,-1));s&&s.id&&s.clock_in_at&&!s.clock_out_at&&(await pe.attendance.update(s.id,{clock_out_at:wt()}),n=s.date)}if(!n){const s=await bn(t);s&&s.id&&s.clock_in_at&&!s.clock_out_at&&(await pe.attendance.update(s.id,{clock_out_at:wt()}),n=s.date)}if(!n)throw new Error("没有进行中的打卡");return await _t(),n}async function bm(e,t,n,s,o){(o||"").trim()&&await ai(o);const a=await bn(e),c={date:e,clock_in_at:t,clock_out_at:n,kind:"makeup",note:s||null,location:(o||"").trim()||null,created_at:wt()};a&&a.id?await pe.attendance.update(a.id,c):await pe.attendance.add(c),await _t()}async function wm(e,t,n){const s=(n||"").trim();if(!s)return;const o=await bn(e);o&&o.id&&(await pe.attendance.update(o.id,{[t]:e+"T"+s+":00"}),await _t())}async function Ci(e,t){return pe.attendance.where("date").between(e,t,!0,!0).toArray()}async function _m(e,t){const n=await bn(e);if(t){const s={date:e,kind:"leave",clock_in_at:null,clock_out_at:null,created_at:wt()};n&&n.id?await pe.attendance.update(n.id,s):await pe.attendance.add({...s,note:null,location:null})}else n&&n.id&&await pe.attendance.update(n.id,{kind:"normal"});await _t()}async function km(e){const t=await pe.work_log.where("date").equals(e).first();return t||{id:await pe.work_log.add({date:e,created_at:wt()}),date:e,created_at:wt()}}async function xm(e){return pe.work_log.where("date").equals(e).first()}async function Cm(e){const t=await xm(e);return!t||!t.id?[]:(await pe.log_item.where("work_log_id").equals(t.id).toArray()).sort((s,o)=>o.id-s.id)}async function Sm(e,t){const n=await pe.work_log.where("date").equals(e).first();let s;n&&n.id?s=n:s=await km(e),await pe.table("log_item").add({work_log_id:s.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:wt()});const o=t.project_id?String(t.project_id):"";await gt("last_project","")!==o&&await Lt("last_project",o),await gt("last_category","")!==t.category&&await Lt("last_category",t.category),await _t()}async function ya(e,t){await pe.table("log_item").update(e,t),await _t()}async function Em(e){await pe.table("log_item").delete(e),await _t()}async function Si(e,t){const n=await pe.work_log.where("date").between(e,t,!0,!0).toArray();if(!n.length)return[];const s=new Map(n.map(a=>[a.id,a.date]));return(await pe.table("log_item").where("work_log_id").anyOf(n.map(a=>a.id)).toArray()).map(a=>({...a,date:s.get(a.work_log_id)||""})).sort((a,c)=>a.date===c.date?a.id-c.id:a.date<c.date?-1:1)}async function vl(e){return pe.weekly_note.where("week_start").equals(e).first()}async function $m(e,t){const n=await vl(e);n&&n.id?await pe.weekly_note.update(n.id,t):await pe.weekly_note.add({week_start:e,highlights:t.highlights??null,challenges:t.challenges??null,plan_next:t.plan_next??null,created_at:wt()}),await _t()}async function Tm(e,t){return pe.weekly_note.where("week_start").between(e,t,!0,!0).toArray()}async function Pm(){return(await pe.memo.toArray()).sort((t,n)=>t.updated_at<n.updated_at?1:-1)}async function Am(e,t){const n=wt(),s=await pe.memo.add({title:e.trim(),content:t,created_at:n,updated_at:n});return await _t(),{id:s,title:e.trim(),content:t,created_at:n,updated_at:n}}async function Om(e,t,n){await pe.memo.update(e,{title:t.trim(),content:n,updated_at:wt()}),await _t()}async function Mm(e){await pe.memo.delete(e),await _t()}async function Im(e,t=8){const n=e.trim().toLowerCase();if(!n)return[];const s=await pe.work_log.toArray(),o=new Map(s.map(c=>[c.id,c.date]));return(await pe.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 jm(e,t=4){const n=e.trim().toLowerCase();return n?(await pe.memo.toArray()).filter(o=>((o.title||"")+" "+(o.content||"")).toLowerCase().includes(n)).sort((o,a)=>o.updated_at<a.updated_at?1:-1).slice(0,t):[]}async function Dm(e,t){return pe.table("transaction").where("date").between(e,t,!0,!0).toArray()}async function Lm(e){await pe.table("transaction").add({...e,created_at:wt()}),await _t()}async function Rm(e,t){await pe.table("transaction").update(e,{...t}),await _t()}async function Km(e){await pe.table("transaction").delete(e),await _t()}async function Fm(e,t){await pe.table("transaction").update(e,{reimbursed:1}),await _t()}async function Nm(){const e=await Promise.all([pe.project.toArray(),pe.work_log.toArray(),pe.table("log_item").toArray(),pe.attendance.toArray(),pe.weekly_note.toArray(),pe.setting.toArray(),pe.memo.toArray(),pe.credential.toArray(),pe.table("transaction").toArray()]);return JSON.stringify({schema_version:Qv,exported_at:wt(),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]}},null,2)}async function Vm(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.data)throw new Error("文件格式或 schema 版本不匹配");const n=t.data,s=pe.table("log_item"),o=pe.table("transaction");await pe.transaction("rw",[pe.project,pe.work_log,s,pe.attendance,pe.weekly_note,pe.setting,pe.memo,pe.credential,o],async()=>{await Promise.all([pe.project.clear(),pe.work_log.clear(),s.clear(),pe.attendance.clear(),pe.weekly_note.clear(),pe.setting.clear(),pe.memo.clear(),pe.credential.clear(),o.clear()]),n.project&&n.project.length&&await pe.project.bulkAdd(n.project),n.work_log&&n.work_log.length&&await pe.work_log.bulkAdd(n.work_log),n.log_item&&n.log_item.length&&await s.bulkAdd(n.log_item),n.attendance&&n.attendance.length&&await pe.attendance.bulkAdd(n.attendance),n.weekly_note&&n.weekly_note.length&&await pe.weekly_note.bulkAdd(n.weekly_note),n.setting&&n.setting.length&&await pe.setting.bulkAdd(n.setting),n.memo&&n.memo.length&&await pe.memo.bulkAdd(n.memo),n.credential&&n.credential.length&&await pe.credential.bulkAdd(n.credential),n.transaction&&n.transaction.length&&await o.bulkAdd(n.transaction)}),await _t()}function To(e){const t=e.split(":");return Number(t[0])*60+Number(t[1])}function Ys(e,t,n,s){if(e&&e.kind==="leave")return{status:"leave",label:"请假",makeup:!1,workedMinutes:null};if(gh(t))return{status:"rest",label:"休息日",makeup:!1,workedMinutes:null};if(!e||!e.clock_in_at)return s?{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:s?"进行中":"未完成",makeup:o,workedMinutes:null};const a=To(Un(e.clock_in_at)),c=To(Un(e.clock_out_at)),f=To(n.work_start),h=To(n.work_end);let g="normal";!o&&a>f+n.grace_minutes?g="late":!o&&c<h&&(g="early");const y=bh(e.clock_in_at,e.clock_out_at),_=Math.max(0,y-n.lunch_minutes);return{status:g,label:o?"补卡":g==="late"?"迟到":g==="early"?"早退":"正常",makeup:o,workedMinutes:_}}const Ro=L([]);let Bm=0;function Fe(e){const t=++Bm;Ro.value.push({id:t,text:e}),setTimeout(()=>{Ro.value=Ro.value.filter(n=>n.id!==t)},2e3)}function Um(){return Ro}const qm={class:"day-panel"},Hm={class:"dp-head"},Wm={class:"dp-date"},zm={class:"card sec"},Gm={class:"att-grid"},Ym={class:"att-cell"},Jm={key:0,class:"edit-row"},Xm={key:1,class:"att-val"},Qm={class:"att-cell"},Zm={key:0,class:"edit-row"},ey={key:1,class:"att-val"},ty={class:"att-cell"},ny=["list"],ry=["id"],sy=["value"],oy={class:"att-cell"},iy={class:"att-val status-val"},ay={key:0,class:"tag"},ly={key:1,class:"muted"},uy={key:0,class:"att-note muted"},cy={class:"att-actions"},dy=["disabled"],fy=["disabled"],py=["disabled"],vy=["disabled"],hy={key:0,class:"card sec makeup"},my={class:"form-grid"},yy={class:"field"},gy={class:"field"},by={class:"field span2"},wy=["list"],_y={class:"field span2"},ky={key:0,class:"form-error"},xy={class:"form-footer"},Cy={class:"card sec"},Sy={class:"form-grid"},Ey={class:"field span2"},$y={key:0,class:"form-error"},Ty={class:"field"},Py=["value"],Ay={class:"field"},Oy=["value"],My={class:"field"},Iy={class:"field"},jy={class:"field span2"},Dy={class:"form-footer"},Ly=["disabled"],Ry=["disabled"],Ky={class:"list-sec"},Fy={class:"sec-title"},Ny={key:0,class:"empty muted"},Vy={class:"item-main"},By={class:"tag"},Uy=["onClick"],qy={key:0,class:"muted item-meta"},Hy={key:1,class:"muted num item-meta"},Wy=["onClick"],zy=["onClick"],Gy=["onClick"],Yy=["onClick"],Jy={key:0,class:"item-sub"},Xy={key:0,class:"muted2"},Qy={key:1,class:"muted"},Zy={key:1,class:"dp-foot muted num"},eg=Rt({__name:"DayPanel",props:{date:{}},setup(e){const t=e,n=L(!0),s=L(null),o=L(void 0),a=L([]),c=L([]),f=L(""),h=L([]),g=st(()=>"loc-list-"+t.date),y=st(()=>t.date===xt());async function _(){n.value=!0,s.value=await Lr(),o.value=await bn(t.date),a.value=await Cm(t.date),c.value=await Us(!0),h.value=await pl(),f.value=o.value&&o.value.location||await fm(),n.value=!1}pn(_),ht(()=>t.date,_),ht(Gs,()=>{_()});const C=st(()=>c.value.filter(G=>G.archived!==1));function E(G){if(!G)return"";const z=c.value.find(X=>X.id===G);return z?z.name:"已删除项目"}const B=st(()=>s.value?Ys(o.value,t.date,s.value,y.value):null),ne=st(()=>a.value.reduce((G,z)=>G+(z.minutes||0),0)),re=L(!1);async function oe(){re.value||(re.value=!0,await xd(t.date,f.value),await _(),rr(),Fe("上班打卡成功"),re.value=!1)}async function $(){re.value||(re.value=!0,await ym(t.date),await _(),rr(),Fe("下班打卡成功"),re.value=!1)}async function M(){await pm(t.date,f.value),rr(),Fe("地点已更新")}const Q=L(!1),ce=st(()=>{var G;return((G=o.value)==null?void 0:G.kind)==="leave"});function ie(){if(o.value&&o.value.clock_in_at){Q.value=!0;return}Y(!0)}async function Y(G){Q.value=!1,await _m(t.date,G),await _(),rr(),Fe(G?"已标记为休假":"已取消休假")}const A=L(null),x=L(""),N=L(null);ht(A,async G=>{var z;G&&(await ss(),(z=N.value)==null||z.focus())});function le(G){var X,Ae;const z=G==="in"?(X=o.value)==null?void 0:X.clock_in_at:(Ae=o.value)==null?void 0:Ae.clock_out_at;A.value=G,x.value=z?Un(z):G==="in"?"09:00":"18:00"}function W(){A.value=null}async function ke(){const G=A.value;G&&(A.value=null,x.value&&(await wm(t.date,G==="in"?"clock_in_at":"clock_out_at",x.value),await _(),rr(),Fe("打卡时间已修改")))}const Pe=L(!1),Je=L("09:00"),Le=L("18:00"),qe=L(""),Ne=L(""),it=L("");function Ge(){Ne.value=f.value,it.value="",Pe.value=!Pe.value}async function Qe(){if(!Je.value||!Le.value){it.value="请填写上班与下班时间";return}await bm(t.date,t.date+"T"+Je.value+":00",t.date+"T"+Le.value+":00",qe.value.trim(),Ne.value),Pe.value=!1,qe.value="",it.value="",await _(),rr(),Fe("补卡已保存")}const Se=L(""),Z=L("");ht(Se,()=>{Z.value&&(Z.value="")});const ee=L(null),we=L("dev"),Ke=L(null),dt=L(""),Kt=L(""),Tt=L(!1),de=st(()=>!!(Se.value.trim()||Ke.value||dt.value.trim()||Kt.value.trim()));pn(async()=>{const G=await dm();ee.value=G.project_id,we.value=G.category});function v(){Se.value="",Ke.value=null,dt.value="",Kt.value="",Z.value=""}async function b(){const G=Se.value.trim();if(!G){Z.value="请填写工作内容";return}Tt.value||(Tt.value=!0,await Sm(t.date,{content:G,project_id:ee.value,category:we.value,minutes:Ke.value&&Ke.value>0?Ke.value:null,takeaway:dt.value.trim()||null,remark:Kt.value.trim()||null}),v(),await _(),Fe("记录已添加"),Tt.value=!1)}const U=L(null);function fe(G){U.value=G}async function V(G){const z=G.id,X={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};await ya(z,X),U.value=null,await _(),Fe("修改已保存")}async function ae(G){await ya(G.id,{is_milestone:G.is_milestone?0:1}),await _()}async function ue(G){await ya(G.id,{needs_followup:G.needs_followup?0:1}),await _()}const ye=L(null);async function xe(){ye.value&&ye.value.id&&await Em(ye.value.id),ye.value=null,await _(),Fe("记录已删除")}return(G,z)=>(S(),j("div",qm,[l("div",Hm,[l("div",Wm,te(Ut(ad)(e.date)),1)]),l("div",zm,[z[25]||(z[25]=l("div",{class:"sec-title"},"出勤信息",-1)),l("div",Gm,[l("div",Ym,[z[21]||(z[21]=l("label",null,"上班时间",-1)),A.value==="in"?(S(),j("div",Jm,[Te(l("input",{ref_key:"timeInput",ref:N,type:"time",class:"input time-input","onUpdate:modelValue":z[0]||(z[0]=X=>x.value=X),onKeydown:[Ot(ke,["enter"]),Ot(W,["esc"])]},null,544),[[je,x.value]]),l("button",{class:"btn btn-primary btn-sm",onClick:ke},"确认"),l("button",{class:"btn btn-sm",onClick:W},"取消")])):(S(),j("div",Xm,[l("span",{class:et(["num",{"val-empty":!(o.value&&o.value.clock_in_at)}])},te(o.value&&o.value.clock_in_at?Ut(Un)(o.value.clock_in_at):"未打卡"),3),o.value&&o.value.id?(S(),j("button",{key:0,class:"icon-btn",title:"修改上班时间",onClick:z[1]||(z[1]=X=>le("in"))},[$e(Xe,{name:"edit",size:13})])):Ce("",!0)]))]),l("div",Qm,[z[22]||(z[22]=l("label",null,"下班时间",-1)),A.value==="out"?(S(),j("div",Zm,[Te(l("input",{ref_key:"timeInput",ref:N,type:"time",class:"input time-input","onUpdate:modelValue":z[2]||(z[2]=X=>x.value=X),onKeydown:[Ot(ke,["enter"]),Ot(W,["esc"])]},null,544),[[je,x.value]]),l("button",{class:"btn btn-primary btn-sm",onClick:ke},"确认"),l("button",{class:"btn btn-sm",onClick:W},"取消")])):(S(),j("div",ey,[l("span",{class:et(["num",{"val-empty":!(o.value&&o.value.clock_out_at)}])},te(o.value&&o.value.clock_out_at?Ut(Un)(o.value.clock_out_at):"未打卡"),3),o.value&&o.value.id?(S(),j("button",{key:0,class:"icon-btn",title:"修改下班时间",onClick:z[3]||(z[3]=X=>le("out"))},[$e(Xe,{name:"edit",size:13})])):Ce("",!0)]))]),l("div",ty,[z[23]||(z[23]=l("label",null,"上班地点",-1)),Te(l("input",{class:"input","onUpdate:modelValue":z[4]||(z[4]=X=>f.value=X),list:g.value,placeholder:"可直接输入",title:"上班地点,可自由输入",onChange:M},null,40,ny),[[je,f.value]]),l("datalist",{id:g.value},[(S(!0),j(Ie,null,ot(h.value,X=>(S(),j("option",{key:X,value:X},null,8,sy))),128))],8,ry)]),l("div",oy,[z[24]||(z[24]=l("label",null,"考勤状态",-1)),l("div",iy,[B.value?(S(),j(Ie,{key:0},[l("span",{class:et(["dot",B.value.status])},null,2),l("span",null,te(B.value.label),1),o.value&&o.value.kind==="makeup"?(S(),j("span",ay,"补卡")):Ce("",!0)],64)):(S(),j("span",ly,"--"))])])]),o.value&&o.value.note?(S(),j("div",uy,"补卡说明:"+te(o.value.note),1)):Ce("",!0),l("div",cy,[y.value&&(!o.value||!o.value.clock_in_at)?(S(),j("button",{key:0,class:"btn btn-primary btn-sm",disabled:re.value,onClick:oe},"上班打卡",8,dy)):y.value&&o.value&&o.value.clock_in_at&&!o.value.clock_out_at?(S(),j("button",{key:1,class:"btn btn-primary btn-sm",disabled:re.value,onClick:$},"下班打卡",8,fy)):Ce("",!0),!y.value&&(!o.value||!o.value.clock_in_at)?(S(),j("button",{key:2,class:"btn btn-sm",onClick:Ge},"补卡")):Ce("",!0),ce.value?(S(),j("button",{key:4,class:"btn btn-sm",disabled:re.value,onClick:z[5]||(z[5]=X=>Y(!1))},"取消休假",8,vy)):(S(),j("button",{key:3,class:"btn btn-sm",disabled:re.value,onClick:ie},"标记休假",8,py))])]),Pe.value?(S(),j("div",hy,[z[30]||(z[30]=l("div",{class:"sec-title"},"补卡登记",-1)),l("div",my,[l("div",yy,[z[26]||(z[26]=l("label",null,"上班时间",-1)),Te(l("input",{type:"time",class:"input","onUpdate:modelValue":z[6]||(z[6]=X=>Je.value=X)},null,512),[[je,Je.value]])]),l("div",gy,[z[27]||(z[27]=l("label",null,"下班时间",-1)),Te(l("input",{type:"time",class:"input","onUpdate:modelValue":z[7]||(z[7]=X=>Le.value=X)},null,512),[[je,Le.value]])]),l("div",by,[z[28]||(z[28]=l("label",null,"上班地点",-1)),Te(l("input",{class:"input",list:g.value,"onUpdate:modelValue":z[8]||(z[8]=X=>Ne.value=X),placeholder:"可直接输入"},null,8,wy),[[je,Ne.value]])]),l("div",_y,[z[29]||(z[29]=l("label",null,"补卡原因",-1)),Te(l("input",{class:"input","onUpdate:modelValue":z[9]||(z[9]=X=>qe.value=X),placeholder:"如:外出拜访客户忘记打卡"},null,512),[[je,qe.value]])])]),it.value?(S(),j("div",ky,te(it.value),1)):Ce("",!0),l("div",xy,[l("button",{class:"btn btn-sm",onClick:z[10]||(z[10]=X=>Pe.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:Qe},"保存补卡")])])):Ce("",!0),l("div",Cy,[z[38]||(z[38]=l("div",{class:"sec-head"},[l("span",{class:"sec-title"},"新增工作记录"),l("span",{class:"muted form-hint"},"内容必填,其余选填")],-1)),l("div",Sy,[l("div",Ey,[z[31]||(z[31]=l("label",null,"工作内容(必填)",-1)),Te(l("input",{class:et(["input",{invalid:Z.value}]),"onUpdate:modelValue":z[11]||(z[11]=X=>Se.value=X),placeholder:"做了什么,一句话一条",onKeydown:Ot(b,["enter"])},null,34),[[je,Se.value]]),Z.value?(S(),j("div",$y,te(Z.value),1)):Ce("",!0)]),l("div",Ty,[z[33]||(z[33]=l("label",null,"所属项目",-1)),Te(l("select",{class:"select","onUpdate:modelValue":z[12]||(z[12]=X=>ee.value=X)},[z[32]||(z[32]=l("option",{value:null},"无项目",-1)),(S(!0),j(Ie,null,ot(C.value,X=>(S(),j("option",{key:X.id,value:X.id},te(X.name),9,Py))),128))],512),[[Vn,ee.value]])]),l("div",Ay,[z[34]||(z[34]=l("label",null,"工作分类",-1)),Te(l("select",{class:"select","onUpdate:modelValue":z[13]||(z[13]=X=>we.value=X)},[(S(!0),j(Ie,null,ot(Ut(zs),X=>(S(),j("option",{key:X.key,value:X.key},te(X.label),9,Oy))),128))],512),[[Vn,we.value]])]),l("div",My,[z[35]||(z[35]=l("label",null,"耗时(分钟)",-1)),Te(l("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":z[14]||(z[14]=X=>Ke.value=X),placeholder:"选填"},null,512),[[je,Ke.value,void 0,{number:!0}]])]),l("div",Iy,[z[36]||(z[36]=l("label",null,"主要收获",-1)),Te(l("input",{class:"input","onUpdate:modelValue":z[15]||(z[15]=X=>dt.value=X),placeholder:"一句话:学到了什么"},null,512),[[je,dt.value]])]),l("div",jy,[z[37]||(z[37]=l("label",null,"备注",-1)),Te(l("textarea",{class:"textarea","onUpdate:modelValue":z[16]||(z[16]=X=>Kt.value=X),placeholder:"背景、链接、未决事项(选填)"},null,512),[[je,Kt.value]])])]),l("div",Dy,[l("button",{class:"btn btn-sm",disabled:!de.value,onClick:v},"重置",8,Ly),l("button",{class:"btn btn-primary btn-sm",disabled:Tt.value,onClick:b},"添加记录",8,Ry)])]),l("div",Ky,[l("div",Fy,"工作记录("+te(a.value.length)+")",1),!a.value.length&&!n.value?(S(),j("div",Ny,"暂无记录")):Ce("",!0),(S(!0),j(Ie,null,ot(a.value,X=>(S(),j("div",{key:X.id,class:"item"},[l("div",Vy,[l("span",By,te(Ut(Zo)(X.category)),1),l("span",{class:"item-content",title:"点击编辑",onClick:Ae=>fe(X)},te(X.content),9,Uy),X.project_id?(S(),j("span",qy,te(E(X.project_id)),1)):Ce("",!0),X.minutes?(S(),j("span",Hy,te(X.minutes)+" 分钟",1)):Ce("",!0),z[39]||(z[39]=l("span",{class:"flex1"},null,-1)),l("button",{class:"icon-btn",title:"编辑完整信息",onClick:Ae=>fe(X)},[$e(Xe,{name:"edit",size:14})],8,Wy),l("button",{class:et(["icon-btn",{active:X.is_milestone===1}]),title:"成果标记",onClick:Ae=>ae(X)},[$e(Xe,{name:"star",size:14})],10,zy),l("button",{class:et(["icon-btn",{"active-warn":X.needs_followup===1}]),title:"待跟进",onClick:Ae=>ue(X)},[$e(Xe,{name:"flag",size:14})],10,Gy),l("button",{class:"icon-btn",title:"删除",onClick:Ae=>ye.value=X},[$e(Xe,{name:"close",size:14})],8,Yy)]),X.takeaway||X.remark?(S(),j("div",Jy,[X.takeaway?(S(),j("div",Xy,"收获:"+te(X.takeaway),1)):Ce("",!0),X.remark?(S(),j("div",Qy,"备注:"+te(X.remark),1)):Ce("",!0)])):Ce("",!0)]))),128)),a.value.length?(S(),j("div",Zy,[en(" 共 "+te(a.value.length)+" 条事项 ",1),ne.value?(S(),j(Ie,{key:0},[en(" · "+te((ne.value/60).toFixed(1))+" 小时",1)],64)):Ce("",!0)])):Ce("",!0)]),$e(qn,{open:!!ye.value,title:"删除确认",message:ye.value?"将删除工作记录「"+ye.value.content+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:z[17]||(z[17]=X=>ye.value=null),onConfirm:xe},null,8,["open","message"]),$e(qn,{open:Q.value,title:"标记休假确认",message:"该日已有打卡记录,标记休假将清空上下班时间。是否继续?","confirm-text":"标记休假",danger:"",onCancel:z[18]||(z[18]=X=>Q.value=!1),onConfirm:z[19]||(z[19]=X=>Y(!0))},null,8,["open"]),$e(yh,{open:!!U.value,item:U.value,projects:c.value,date:e.date,onCancel:z[20]||(z[20]=X=>U.value=null),onSave:V},null,8,["open","item","projects","date"])]))}}),Cd=Wt(eg,[["__scopeId","data-v-2e90c9d8"]]),tg={class:"cal-page"},ng={class:"cal-toolbar"},rg={class:"cal-title num"},sg={class:"cal-head"},og={class:"cal-grid"},ig=["title","onClick"],ag={class:"cal-marks"},lg={key:0,class:"drawer"},ug={class:"drawer-head"},cg={class:"drawer-body"},dg=Rt({__name:"CalendarView",setup(e){const t=L(xt()),n=st(()=>Number(t.value.slice(0,4))),s=st(()=>Number(t.value.slice(5,7))-1),o=st(()=>n.value+" 年 "+(s.value+1)+" 月"),a=["一","二","三","四","五","六","日"],c=st(()=>{const Q=(new Date(n.value,s.value,1).getDay()+6)%7,ce=new Date(n.value,s.value+1,0).getDate(),ie=[];for(let Y=0;Y<Q;Y++)ie.push({date:"",inMonth:!1,weekend:!1});for(let Y=1;Y<=ce;Y++){const A=new Date(n.value,s.value,Y),x=A.getDay();ie.push({date:Bn(A),inMonth:!0,weekend:x===0||x===6})}return ie}),f=L(new Map),h=xt();async function g(){var N;const M=Bn(new Date(n.value,s.value,1)),Q=Bn(new Date(n.value,s.value+1,0)),ce=await Promise.all([Lr(),Ci(M,Q),Si(M,Q)]),ie=ce[0],Y=new Map(ce[1].map(le=>[le.date,le])),A=ce[2],x=new Map;for(const le of c.value){if(!le.inMonth)continue;const W=Ys(Y.get(le.date),le.date,ie,le.date===h),ke=A.filter(Pe=>Pe.date===le.date);x.set(le.date,{status:W.status,label:W.label,location:((N=Y.get(le.date))==null?void 0:N.location)||"",hasLog:ke.length>0,hasMilestone:ke.some(Pe=>Pe.is_milestone===1)})}f.value=x}ht([n,s],g,{immediate:!0}),ht(Gs,()=>{g()});function y(M){var Q;return((Q=f.value.get(M))==null?void 0:Q.status)??""}function _(M){const Q=f.value.get(M);return Q?M+" · "+Q.label+(Q.location?" · "+Q.location:""):M}function C(M){var Q;return!!((Q=f.value.get(M))!=null&&Q.hasLog)}function E(M){var Q;return!!((Q=f.value.get(M))!=null&&Q.hasMilestone)}function B(){t.value=ei(t.value,-1)}function ne(){t.value=ei(t.value,1)}function re(){t.value=xt()}const oe=L(null);function $(M,Q){Q&&(oe.value=M)}return ht(Ka,M=>{M&&(t.value=M,oe.value=M,Ka.value=null)},{immediate:!0}),(M,Q)=>(S(),j("div",tg,[l("div",ng,[l("button",{class:"icon-btn",onClick:B},[$e(Xe,{name:"chevron-left",size:16})]),l("span",rg,te(o.value),1),l("button",{class:"icon-btn",onClick:ne},[$e(Xe,{name:"chevron-right",size:16})]),l("button",{class:"btn btn-sm",onClick:re},"回到今天")]),l("div",sg,[(S(),j(Ie,null,ot(a,ce=>l("span",{key:ce,class:"cal-week muted"},te(ce),1)),64))]),l("div",og,[(S(!0),j(Ie,null,ot(c.value,(ce,ie)=>(S(),j("button",{key:ie,class:et(["cal-cell",{blank:!ce.inMonth,weekend:ce.weekend,selected:oe.value===ce.date}]),title:ce.inMonth?_(ce.date):void 0,onClick:Y=>$(ce.date,ce.inMonth)},[ce.inMonth?(S(),j(Ie,{key:0},[l("span",{class:et(["daynum num",{today:ce.date===Ut(h)}])},te(Number(ce.date.slice(8,10))),3),l("span",ag,[y(ce.date)?(S(),j("span",{key:0,class:et(["dot",y(ce.date)])},null,2)):Ce("",!0),C(ce.date)?(S(),At(Xe,{key:1,name:"check-circle",size:12,class:"mark-log"})):Ce("",!0),E(ce.date)?(S(),At(Xe,{key:2,name:"star",size:12,class:"mark-star"})):Ce("",!0)])],64)):Ce("",!0)],10,ig))),128))]),$e(os,{name:"drawer"},{default:fr(()=>[oe.value?(S(),j("aside",lg,[l("div",ug,[Q[1]||(Q[1]=l("span",{class:"drawer-title"},"当日详情",-1)),l("button",{class:"icon-btn",onClick:Q[0]||(Q[0]=ce=>oe.value=null)},[$e(Xe,{name:"close",size:16})])]),l("div",cg,[$e(Cd,{date:oe.value},null,8,["date"])])])):Ce("",!0)]),_:1})]))}}),fg=Wt(dg,[["__scopeId","data-v-2404dfbe"]]),pg={class:"detail-page"},vg={class:"detail-toolbar"},hg=["value"],mg=["disabled"],yg=Rt({__name:"TodayView",setup(e){const t=L(xt()),n=st(()=>t.value===xt());function s(){t.value=Nn(t.value,-1)}function o(){t.value=Nn(t.value,1)}function a(){t.value=xt()}function c(f){const h=f.target.value;h&&(t.value=h)}return(f,h)=>(S(),j("div",pg,[l("div",vg,[l("button",{class:"icon-btn",title:"前一天",onClick:s},[$e(Xe,{name:"chevron-left",size:16})]),l("span",{class:et(["date-title num",{"is-today":n.value}])},te(Ut(ad)(t.value)),3),l("button",{class:"icon-btn",title:"后一天",onClick:o},[$e(Xe,{name:"chevron-right",size:16})]),l("input",{type:"date",class:"input w-date",value:t.value,onChange:c},null,40,hg),l("button",{class:"btn btn-sm",disabled:n.value,onClick:a},"回到今天",8,mg)]),$e(Cd,{date:t.value},null,8,["date"])]))}}),gg=Wt(yg,[["__scopeId","data-v-76243d98"]]),bg={class:"stats"},wg={class:"cards"},_g={class:"card stat-card"},kg={class:"stat-num num"},xg={class:"card stat-card"},Cg={class:"stat-num num"},Sg={class:"card stat-card"},Eg={class:"stat-num num"},$g={class:"card stat-card"},Tg={class:"stat-num num"},Pg={class:"card section"},Ag={class:"heat"},Og=["title"],Mg={class:"two-col"},Ig={class:"card section"},jg={class:"bar-label"},Dg={class:"bar-track"},Lg={class:"muted num bar-num"},Rg={key:0,class:"muted"},Kg={class:"card section"},Fg={class:"bar-label"},Ng={class:"bar-track"},Vg={class:"muted num bar-num"},Bg={key:0,class:"muted"},Ug={class:"card section"},qg={class:"bar-label loc-label"},Hg={class:"bar-track"},Wg={class:"muted num bar-num"},zg={key:0,class:"muted"},Gg=Rt({__name:"StatsView",setup(e){const t=L({attendDays:0,totalHours:"0",itemCount:0,streak:0}),n=L([]),s=L([]),o=L([]),a=L([]);async function c(){const g=xt(),y="2000-01-01",_=await Promise.all([Lr(),Ci(y,g),Si(y,g),Us(!0)]),C=_[0],E=_[1],B=_[2],ne=_[3],re=E.filter(W=>W.clock_in_at||W.kind==="makeup");let oe=0;for(const W of re){const ke=Ys(W,W.date,C,W.date===g);oe+=ke.workedMinutes??0}const $=new Set(B.map(W=>W.date));let M=0,Q=g;for($.has(Q)||(Q=Nn(g,-1));$.has(Q);)M++,Q=Nn(Q,-1);t.value={attendDays:re.length,totalHours:(oe/60).toFixed(1),itemCount:B.length,streak:M};const ce=new Map;for(const W of re){const ke=W.location||"未记录";ce.set(ke,(ce.get(ke)||0)+1)}a.value=Array.from(ce.entries()).map(W=>({name:W[0],count:W[1],percent:Math.round(W[1]/(re.length||1)*100)})).sort((W,ke)=>ke.count-W.count);const ie=B.length||1;s.value=zs.map(W=>{const ke=B.filter(Pe=>Pe.category===W.key).length;return{key:W.key,label:W.label,count:ke,percent:Math.round(ke/ie*100)}}).filter(W=>W.count>0).sort((W,ke)=>ke.count-W.count);const Y=new Map(ne.map(W=>[W.id,W.name])),A=new Map;for(const W of B){const ke=W.project_id?Y.get(W.project_id)||"已删除项目":"无项目";A.set(ke,(A.get(ke)||0)+1)}o.value=Array.from(A.entries()).map(W=>({name:W[0],count:W[1],percent:Math.round(W[1]/ie*100)})).sort((W,ke)=>ke.count-W.count);const x=new Map;for(const W of B)x.set(W.date,(x.get(W.date)||0)+1);const N=Ps(g),le=[];for(let W=11;W>=0;W--){const ke=Nn(N,-7*W),Pe=[];for(let Je=0;Je<7;Je++){const Le=Nn(ke,Je);Pe.push({date:Le,count:x.get(Le)||0})}le.push(Pe)}n.value=le}pn(async()=>{await c()}),ht(Gs,()=>{c()});function f(g){return g===0?0:g===1?1:g<=3?2:g<=5?3:4}function h(g,y){return g+" · "+(y?y+" 条":"无记录")}return(g,y)=>(S(),j("div",bg,[l("div",wg,[l("div",_g,[y[0]||(y[0]=l("div",{class:"muted"},"出勤天数",-1)),l("div",kg,te(t.value.attendDays),1)]),l("div",xg,[y[1]||(y[1]=l("div",{class:"muted"},"累计工时(小时)",-1)),l("div",Cg,te(t.value.totalHours),1)]),l("div",Sg,[y[2]||(y[2]=l("div",{class:"muted"},"记录条数",-1)),l("div",Eg,te(t.value.itemCount),1)]),l("div",$g,[y[3]||(y[3]=l("div",{class:"muted"},"连续记录(天)",-1)),l("div",Tg,te(t.value.streak),1)])]),l("div",Pg,[y[4]||(y[4]=l("div",{class:"section-title"},"记录热力图(近 12 周)",-1)),l("div",Ag,[(S(!0),j(Ie,null,ot(n.value,(_,C)=>(S(),j("div",{key:C,class:"heat-col"},[(S(!0),j(Ie,null,ot(_,E=>(S(),j("span",{key:E.date,class:et(["heat-cell","lv"+f(E.count)]),title:h(E.date,E.count)},null,10,Og))),128))]))),128))]),y[5]||(y[5]=Fp('<div class="heat-legend muted" data-v-73e5ba49><span data-v-73e5ba49>少</span><span class="heat-cell lv0" data-v-73e5ba49></span><span class="heat-cell lv1" data-v-73e5ba49></span><span class="heat-cell lv2" data-v-73e5ba49></span><span class="heat-cell lv3" data-v-73e5ba49></span><span class="heat-cell lv4" data-v-73e5ba49></span><span data-v-73e5ba49>多</span></div>',1))]),l("div",Mg,[l("div",Ig,[y[6]||(y[6]=l("div",{class:"section-title"},"分类分布",-1)),(S(!0),j(Ie,null,ot(s.value,_=>(S(),j("div",{key:_.key,class:"bar-row"},[l("span",jg,te(_.label),1),l("span",Dg,[l("span",{class:"bar-fill",style:or({width:_.percent+"%"})},null,4)]),l("span",Lg,te(_.count)+" 条 · "+te(_.percent)+"%",1)]))),128)),s.value.length?Ce("",!0):(S(),j("div",Rg,"暂无数据"))]),l("div",Kg,[y[7]||(y[7]=l("div",{class:"section-title"},"项目投入",-1)),(S(!0),j(Ie,null,ot(o.value,_=>(S(),j("div",{key:_.name,class:"bar-row"},[l("span",Fg,te(_.name),1),l("span",Ng,[l("span",{class:"bar-fill",style:or({width:_.percent+"%"})},null,4)]),l("span",Vg,te(_.count)+" 条 · "+te(_.percent)+"%",1)]))),128)),o.value.length?Ce("",!0):(S(),j("div",Bg,"暂无数据"))])]),l("div",Ug,[y[8]||(y[8]=l("div",{class:"section-title"},"地点分布(按出勤天)",-1)),(S(!0),j(Ie,null,ot(a.value,_=>(S(),j("div",{key:_.name,class:"bar-row"},[l("span",qg,te(_.name),1),l("span",Hg,[l("span",{class:"bar-fill",style:or({width:_.percent+"%"})},null,4)]),l("span",Wg,te(_.count)+" 天 · "+te(_.percent)+"%",1)]))),128)),a.value.length?Ce("",!0):(S(),j("div",zg,"暂无数据"))])]))}}),Yg=Wt(Gg,[["__scopeId","data-v-73e5ba49"]]);async function Jg(e,t,n){const s=xt(),o=await Promise.all([Lr(),Ci(e,t),Si(e,t),Us(!0),Tm(e,t)]),a=o[0],c=o[1],f=o[2],h=o[3],g=o[4];let y=0,_=0,C=0;for(const A of c){(A.clock_in_at||A.kind==="makeup")&&y++,A.kind==="makeup"&&C++;const x=Ys(A,A.date,a,A.date===s);_+=x.workedMinutes??0}const E=new Map;for(const A of c){if(!(A.clock_in_at||A.kind==="makeup"))continue;const x=A.location||"未记录";E.set(x,(E.get(x)||0)+1)}const B=Array.from(E.entries()).map(A=>({name:A[0],count:A[1]})).sort((A,x)=>x.count-A.count),ne=f.length||1,re=zs.map(A=>{const x=f.filter(N=>N.category===A.key).length;return{key:A.key,label:A.label,count:x,percent:Math.round(x/ne*100)}}).filter(A=>A.count>0).sort((A,x)=>x.count-A.count),oe=new Map(h.map(A=>[A.id,A.name])),$=new Map;for(const A of f){const x=A.project_id?oe.get(A.project_id)||"已删除项目":"无项目";$.set(x,($.get(x)||0)+1)}const M=Array.from($.entries()).map(A=>({name:A[0],count:A[1]})).sort((A,x)=>x.count-A.count),Q=f.filter(A=>A.is_milestone===1).map(A=>({date:A.date,content:A.content})),ce=f.filter(A=>A.needs_followup===1).map(A=>({date:A.date,content:A.content,remark:A.remark||""})),ie=f.filter(A=>!!A.takeaway).map(A=>({date:A.date,text:A.takeaway})),Y=g.map(A=>({weekStart:A.week_start,highlights:A.highlights||"",challenges:A.challenges||"",plan_next:A.plan_next||""}));return{range:{start:e,end:t,label:n},attendDays:y,totalHours:(_/60).toFixed(1),makeupCount:C,leaveCount:c.filter(A=>A.kind==="leave").length,itemCount:f.length,categoryStats:re,projectStats:M,locationStats:B,milestones:Q,followups:ce,takeaways:ie,weekNotes:Y}}function Xg(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(s=>s.name!=="未记录");n.length&&t.push("其中:"+n.map(s=>s.name+" "+s.count+" 天").join(",")),t.push(""),t.push("## 二、工作内容分布"),t.push(""),t.push(e.categoryStats.length?e.categoryStats.map(s=>s.label+" "+s.percent+"%("+s.count+" 条)").join(","):"(无记录)"),t.push(""),t.push("## 三、项目投入"),t.push(""),t.push(e.projectStats.length?e.projectStats.map(s=>s.name+" "+s.count+" 条").join(","):"(无记录)"),t.push(""),t.push("## 四、主要成果"),t.push(""),e.milestones.length?e.milestones.forEach((s,o)=>t.push(o+1+". 【成果】"+s.content+"("+s.date+")")):t.push("(无)"),t.push(""),t.push("## 五、待跟进事项"),t.push(""),e.followups.length?e.followups.forEach(s=>t.push("- 【待跟进】"+s.content+(s.remark?"("+s.date+" 备注:"+s.remark+")":"("+s.date+")"))):t.push("(无)"),t.push(""),t.push("## 六、学习与成长"),t.push(""),e.takeaways.length?e.takeaways.forEach(s=>t.push("- "+s.text+"("+s.date+")")):t.push("(无)");for(const s of e.weekNotes)t.push(""),t.push("### 周记("+s.weekStart+" 起)"),t.push(""),t.push("- 本周亮点:"+(s.highlights||"(无)")),t.push("- 踩的坑:"+(s.challenges||"(无)")),t.push("- 下周计划:"+(s.plan_next||"(无)"));return t.push(""),t.join(`
`)}const Qg="modulepreload",Zg=function(e,t){return new URL(e,t).href},Ku={},Sd=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),h=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));o=Promise.allSettled(n.map(g=>{if(g=Zg(g,s),g in Ku)return;Ku[g]=!0;const y=g.endsWith(".css"),_=y?'[rel="stylesheet"]':"";if(!!s)for(let B=c.length-1;B>=0;B--){const ne=c[B];if(ne.href===g&&(!y||ne.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${_}`))return;const E=document.createElement("link");if(E.rel=y?"stylesheet":Qg,y||(E.as="script"),E.crossOrigin="",E.href=g,h&&E.setAttribute("nonce",h),document.head.appendChild(E),y)return new Promise((B,ne)=>{E.addEventListener("load",B),E.addEventListener("error",()=>ne(new Error(`Unable to preload CSS for ${g}`)))})}))}function a(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"&&a(f.reason);return t().catch(a)})};/*! Capacitor: https://capacitorjs.com/ - MIT License */const eb=e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t},s=(a,c)=>{n.platforms.set(a,c)},o=a=>{n.platforms.has(a)&&(n.currentPlatform=n.platforms.get(a))};return n.addPlatform=s,n.setPlatform=o,n},tb=e=>e.CapacitorPlatforms=eb(e),Ed=tb(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});Ed.addPlatform;Ed.setPlatform;var ns;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(ns||(ns={}));class ga extends Error{constructor(t,n,s){super(t),this.message=t,this.code=n,this.data=s}}const nb=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"},rb=e=>{var t,n,s,o,a;const c=e.CapacitorCustomPlatform||null,f=e.Capacitor||{},h=f.Plugins=f.Plugins||{},g=e.CapacitorPlatforms,y=()=>c!==null?c.name:nb(e),_=((t=g==null?void 0:g.currentPlatform)===null||t===void 0?void 0:t.getPlatform)||y,C=()=>_()!=="web",E=((n=g==null?void 0:g.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||C,B=Y=>{const A=Q.get(Y);return!!(A!=null&&A.platforms.has(_())||oe(Y))},ne=((s=g==null?void 0:g.currentPlatform)===null||s===void 0?void 0:s.isPluginAvailable)||B,re=Y=>{var A;return(A=f.PluginHeaders)===null||A===void 0?void 0:A.find(x=>x.name===Y)},oe=((o=g==null?void 0:g.currentPlatform)===null||o===void 0?void 0:o.getPluginHeader)||re,$=Y=>e.console.error(Y),M=(Y,A,x)=>Promise.reject(`${x} does not have an implementation of "${A}".`),Q=new Map,ce=(Y,A={})=>{const x=Q.get(Y);if(x)return console.warn(`Capacitor plugin "${Y}" already registered. Cannot register plugins twice.`),x.proxy;const N=_(),le=oe(Y);let W;const ke=async()=>(!W&&N in A?W=typeof A[N]=="function"?W=await A[N]():W=A[N]:c!==null&&!W&&"web"in A&&(W=typeof A.web=="function"?W=await A.web():W=A.web),W),Pe=(Ge,Qe)=>{var Se,Z;if(le){const ee=le==null?void 0:le.methods.find(we=>Qe===we.name);if(ee)return ee.rtype==="promise"?we=>f.nativePromise(Y,Qe.toString(),we):(we,Ke)=>f.nativeCallback(Y,Qe.toString(),we,Ke);if(Ge)return(Se=Ge[Qe])===null||Se===void 0?void 0:Se.bind(Ge)}else{if(Ge)return(Z=Ge[Qe])===null||Z===void 0?void 0:Z.bind(Ge);throw new ga(`"${Y}" plugin is not implemented on ${N}`,ns.Unimplemented)}},Je=Ge=>{let Qe;const Se=(...Z)=>{const ee=ke().then(we=>{const Ke=Pe(we,Ge);if(Ke){const dt=Ke(...Z);return Qe=dt==null?void 0:dt.remove,dt}else throw new ga(`"${Y}.${Ge}()" is not implemented on ${N}`,ns.Unimplemented)});return Ge==="addListener"&&(ee.remove=async()=>Qe()),ee};return Se.toString=()=>`${Ge.toString()}() { [capacitor code] }`,Object.defineProperty(Se,"name",{value:Ge,writable:!1,configurable:!1}),Se},Le=Je("addListener"),qe=Je("removeListener"),Ne=(Ge,Qe)=>{const Se=Le({eventName:Ge},Qe),Z=async()=>{const we=await Se;qe({eventName:Ge,callbackId:we},Qe)},ee=new Promise(we=>Se.then(()=>we({remove:Z})));return ee.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await Z()},ee},it=new Proxy({},{get(Ge,Qe){switch(Qe){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return le?Ne:Le;case"removeListener":return qe;default:return Je(Qe)}}});return h[Y]=it,Q.set(Y,{name:Y,proxy:it,platforms:new Set([...Object.keys(A),...le?[N]:[]])}),it},ie=((a=g==null?void 0:g.currentPlatform)===null||a===void 0?void 0:a.registerPlugin)||ce;return f.convertFileSrc||(f.convertFileSrc=Y=>Y),f.getPlatform=_,f.handleError=$,f.isNativePlatform=E,f.isPluginAvailable=ne,f.pluginMethodNoop=M,f.registerPlugin=ie,f.Exception=ga,f.DEBUG=!!f.DEBUG,f.isLoggingEnabled=!!f.isLoggingEnabled,f.platform=f.getPlatform(),f.isNative=f.isNativePlatform(),f},sb=e=>e.Capacitor=rb(e),rs=sb(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),$d=rs.registerPlugin;rs.Plugins;class Td{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 s=!1;this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(n);const a=this.windowListeners[t];a&&!a.registered&&this.addWindowListener(a),s&&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,s){const o=this.listeners[t];if(!o){if(s){let a=this.retainedEventArguments[t];a||(a=[]),a.push(n),this.retainedEventArguments[t]=a}return}o.forEach(a=>a(n))}hasListeners(t){return!!this.listeners[t].length}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:s=>{this.notifyListeners(n,s)}}}unimplemented(t="not implemented"){return new rs.Exception(t,ns.Unimplemented)}unavailable(t="not available"){return new rs.Exception(t,ns.Unavailable)}async removeListener(t,n){const s=this.listeners[t];if(!s)return;const o=s.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(s=>{this.notifyListeners(t,s)}))}}const Fu=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Nu=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ob extends Td{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(s=>{if(s.length<=0)return;let[o,a]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=Nu(o).trim(),a=Nu(a).trim(),n[o]=a}),n}async setCookie(t){try{const n=Fu(t.key),s=Fu(t.value),o=`; expires=${(t.expires||"").replace("expires=","")}`,a=(t.path||"/").replace("path=",""),c=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${s||""}${o}; path=${a}; ${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)}}}$d("CapacitorCookies",{web:()=>new ob});const ib=async e=>new Promise((t,n)=>{const s=new FileReader;s.onload=()=>{const o=s.result;t(o.indexOf(",")>=0?o.split(",")[1]:o)},s.onerror=o=>n(o),s.readAsDataURL(e)}),ab=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,a,c)=>(o[a]=e[t[c]],o),{})},lb=(e,t=!0)=>e?Object.entries(e).reduce((s,o)=>{const[a,c]=o;let f,h;return Array.isArray(c)?(h="",c.forEach(g=>{f=t?encodeURIComponent(g):g,h+=`${a}=${f}&`}),h.slice(0,-1)):(f=t?encodeURIComponent(c):c,h=`${a}=${f}`),`${s}&${h}`},"").substr(1):null,ub=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),o=ab(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[c,f]of Object.entries(e.data||{}))a.set(c,f);n.body=a.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const a=new FormData;if(e.data instanceof FormData)e.data.forEach((f,h)=>{a.append(h,f)});else for(const f of Object.keys(e.data))a.append(f,e.data[f]);n.body=a;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 cb extends Td{async request(t){const n=ub(t,t.webFetchExtra),s=lb(t.params,t.shouldEncodeUrlParams),o=s?`${t.url}?${s}`:t.url,a=await fetch(o,n),c=a.headers.get("content-type")||"";let{responseType:f="text"}=a.ok?t:{};c.includes("application/json")&&(f="json");let h,g;switch(f){case"arraybuffer":case"blob":g=await a.blob(),h=await ib(g);break;case"json":h=await a.json();break;case"document":case"text":default:h=await a.text()}const y={};return a.headers.forEach((_,C)=>{y[C]=_}),{data:h,headers:y,status:a.status,url:a.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"}))}}$d("CapacitorHttp",{web:()=>new cb});async function hl(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(rs.isNativePlatform()){const{Filesystem:c,Directory:f,Encoding:h}=await Sd(async()=>{const{Filesystem:g,Directory:y,Encoding:_}=await import("./index-BE9xlWZ7.js");return{Filesystem:g,Directory:y,Encoding:_}},[],import.meta.url);try{return(await c.writeFile({path:e,data:t,directory:f.Documents,encoding:h.UTF8,recursive:!0})).uri}catch{return(await c.writeFile({path:e,data:t,directory:f.Cache,encoding:h.UTF8,recursive:!0})).uri}}const s=new Blob([t],{type:"text/plain;charset=utf-8"}),o=URL.createObjectURL(s),a=document.createElement("a");return a.href=o,a.download=e,a.click(),window.setTimeout(()=>URL.revokeObjectURL(o),1e4),""}const db=Object.freeze(Object.defineProperty({__proto__:null,downloadText:hl},Symbol.toStringTag,{value:"Module"}));async function qa(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 fb(e){const t=await Promise.all([gt("ai_base_url",""),gt("ai_api_key",""),gt("ai_model","")]),n=t[0].trim().replace(/\/+$/,""),s=t[1].trim(),o=t[2].trim();if(!n||!o)throw new Error("请先在设置页配置 AI 接口地址与模型名称");const a=n+"/chat/completions",c={"Content-Type":"application/json"};s&&(c.Authorization="Bearer "+s);const h=JSON.stringify({model:o,messages:[{role:"system",content:"你是一名严谨的中文助理。请将用户提供的工作总结 Markdown 草稿润色为通顺、专业、简洁的工作总结。要求:保留原有章节结构与全部事实数据(数字、日期、条目),不得虚构或遗漏内容,只输出 Markdown 正文。"},{role:"user",content:e}],temperature:.3});let g;try{g=await fetch(a,{method:"POST",headers:c,body:h})}catch{throw new Error("无法访问 AI 接口:请检查地址是否正确、服务端是否允许浏览器跨域访问")}if(!g.ok){let C="接口返回 "+g.status;try{const E=await g.json();E&&E.error&&E.error.message&&(C+=":"+E.error.message)}catch{}throw new Error(C)}const y=await g.json(),_=y&&y.choices&&y.choices[0]&&y.choices[0].message&&y.choices[0].message.content;if(!_)throw new Error("接口未返回内容");return String(_)}const pb={class:"report"},vb={class:"report-toolbar"},hb={class:"seg"},mb=["onClick"],yb=["disabled"],gb=["disabled"],bb={key:0,class:"ai-error"},wb={class:"report-grid"},_b={class:"report-left"},kb={class:"card section"},xb={class:"section-title"},Cb={class:"muted note-saved"},Sb={class:"card section"},Eb={class:"report-right"},$b={key:0,class:"card section"},Tb={class:"sum-row"},Pb={class:"num"},Ab={class:"sum-row"},Ob={class:"num"},Mb={class:"sum-row"},Ib={class:"num"},jb={class:"sum-row"},Db={class:"num"},Lb={class:"sum-row"},Rb={class:"num"},Kb={class:"muted"},Fb={class:"num"},Nb={key:0,class:"muted sum-empty"},Vb={class:"muted"},Bb={key:1,class:"muted sum-empty"},Ub={class:"muted"},qb={key:2,class:"muted sum-empty"},Hb={class:"muted"},Wb={key:3,class:"muted sum-empty"},zb=Rt({__name:"ReportView",setup(e){const t=[{key:"week",label:"本周"},{key:"month",label:"本月"},{key:"all",label:"全部"},{key:"custom",label:"自定义"}],n=L("week"),s=L(Ps(xt())),o=L(xt()),a=L(null),c=L(""),f=L(!1),h=L(!1),g=L(null),y=L(""),_=L(Ps(xt())),C=L(""),E=L(""),B=L(""),ne=L(!1);async function re(){const A=await vl(_.value);C.value=(A==null?void 0:A.highlights)||"",E.value=(A==null?void 0:A.challenges)||"",B.value=(A==null?void 0:A.plan_next)||"",ne.value=!1}async function oe(){await $m(_.value,{highlights:C.value.trim()||null,challenges:E.value.trim()||null,plan_next:B.value.trim()||null}),ne.value=!0,await M()}function $(A){const x=xt();if(A==="week"){const N=Ps(x);return{start:N,end:Nn(N,6),label:"本周"}}if(A==="month"){const N=x.slice(0,7);return{start:N+"-01",end:x,label:N+" 本月"}}return A==="all"?{start:"2000-01-01",end:x,label:"全部实习期"}:{start:s.value,end:o.value,label:s.value+" ~ "+o.value}}async function M(){f.value=!0;const A=$(n.value),x=await Jg(A.start,A.end,A.label);a.value=x,c.value=Xg(x),f.value=!1}ht(n,M),ht([s,o],()=>{n.value==="custom"&&M()}),pn(async()=>{await re(),await M()});async function Q(){const A=xt().replace(/-/g,""),x=await hl("实习工作总结_"+A+".md",c.value);Fe(x?"总结已导出到:"+x:"总结已导出到系统下载目录")}async function ce(){await qa(c.value),Fe("总结已复制到剪贴板")}async function ie(){if(h.value)return;y.value="";const A=c.value.trim();if(!A){y.value="当前草稿为空,无法润色";return}h.value=!0;try{g.value=c.value,c.value=await fb(A),Fe("AI 润色完成")}catch(x){g.value=null,y.value=x instanceof Error?x.message:"润色失败"}h.value=!1}function Y(){g.value!==null&&(c.value=g.value),g.value=null}return(A,x)=>(S(),j("div",pb,[l("div",vb,[l("div",hb,[(S(),j(Ie,null,ot(t,N=>l("button",{key:N.key,class:et(["seg-btn",{active:n.value===N.key}]),onClick:le=>n.value=N.key},te(N.label),11,mb)),64))]),n.value==="custom"?(S(),j(Ie,{key:0},[Te(l("input",{type:"date",class:"input w-date","onUpdate:modelValue":x[0]||(x[0]=N=>s.value=N)},null,512),[[je,s.value]]),x[6]||(x[6]=l("span",{class:"muted"},"至",-1)),Te(l("input",{type:"date",class:"input w-date","onUpdate:modelValue":x[1]||(x[1]=N=>o.value=N)},null,512),[[je,o.value]])],64)):Ce("",!0),x[10]||(x[10]=l("span",{class:"flex1"},null,-1)),l("button",{class:"btn btn-sm",disabled:h.value,onClick:ie},[$e(Xe,{name:"edit",size:14}),x[7]||(x[7]=en("AI 润色 ",-1))],8,yb),g.value!==null?(S(),j("button",{key:1,class:"btn btn-sm",onClick:Y},"还原润色前")):Ce("",!0),l("button",{class:"btn btn-sm",disabled:f.value,onClick:M},[$e(Xe,{name:"edit",size:14}),x[8]||(x[8]=en("重新生成 ",-1))],8,gb),l("button",{class:"btn btn-sm",onClick:ce},"复制"),l("button",{class:"btn btn-primary btn-sm",onClick:Q},[$e(Xe,{name:"export",size:14}),x[9]||(x[9]=en("导出 Markdown ",-1))])]),y.value?(S(),j("div",bb,te(y.value),1)):Ce("",!0),l("div",wb,[l("div",_b,[l("div",kb,[l("div",xb,"本周周记("+te(_.value)+" 起)",1),x[11]||(x[11]=l("label",{class:"note-label muted"},"本周亮点",-1)),Te(l("textarea",{class:"textarea","onUpdate:modelValue":x[2]||(x[2]=N=>C.value=N),placeholder:"本周最有价值的一件事",onBlur:oe},null,544),[[je,C.value]]),x[12]||(x[12]=l("label",{class:"note-label muted"},"踩的坑",-1)),Te(l("textarea",{class:"textarea","onUpdate:modelValue":x[3]||(x[3]=N=>E.value=N),placeholder:"遇到的问题与教训",onBlur:oe},null,544),[[je,E.value]]),x[13]||(x[13]=l("label",{class:"note-label muted"},"下周计划",-1)),Te(l("textarea",{class:"textarea","onUpdate:modelValue":x[4]||(x[4]=N=>B.value=N),placeholder:"下周准备做什么",onBlur:oe},null,544),[[je,B.value]]),l("div",Cb,te(ne.value?"已保存":"失焦自动保存"),1)]),l("div",Sb,[x[14]||(x[14]=l("div",{class:"section-title"},"总结草稿(可编辑)",-1)),Te(l("textarea",{class:"textarea md-editor","onUpdate:modelValue":x[5]||(x[5]=N=>c.value=N),spellcheck:"false"},null,512),[[je,c.value]])])]),l("div",Eb,[a.value?(S(),j("div",$b,[x[20]||(x[20]=l("div",{class:"section-title"},"数据摘要",-1)),l("div",Tb,[x[15]||(x[15]=l("span",{class:"muted"},"出勤",-1)),l("span",Pb,te(a.value.attendDays)+" 天",1)]),l("div",Ab,[x[16]||(x[16]=l("span",{class:"muted"},"工时",-1)),l("span",Ob,te(a.value.totalHours)+" 小时",1)]),l("div",Mb,[x[17]||(x[17]=l("span",{class:"muted"},"补卡",-1)),l("span",Ib,te(a.value.makeupCount)+" 次",1)]),l("div",jb,[x[18]||(x[18]=l("span",{class:"muted"},"请假",-1)),l("span",Db,te(a.value.leaveCount)+" 天",1)]),l("div",Lb,[x[19]||(x[19]=l("span",{class:"muted"},"记录",-1)),l("span",Rb,te(a.value.itemCount)+" 条",1)]),x[21]||(x[21]=l("div",{class:"section-sub"},"分类分布",-1)),(S(!0),j(Ie,null,ot(a.value.categoryStats,N=>(S(),j("div",{key:N.key,class:"sum-row"},[l("span",Kb,te(N.label),1),l("span",Fb,te(N.count)+" 条 · "+te(N.percent)+"%",1)]))),128)),a.value.categoryStats.length?Ce("",!0):(S(),j("div",Nb,"(无)")),x[22]||(x[22]=l("div",{class:"section-sub"},"主要成果",-1)),(S(!0),j(Ie,null,ot(a.value.milestones,(N,le)=>(S(),j("div",{key:"m"+le,class:"sum-item"},[en(te(N.content),1),l("span",Vb,"("+te(N.date)+")",1)]))),128)),a.value.milestones.length?Ce("",!0):(S(),j("div",Bb,"(无)")),x[23]||(x[23]=l("div",{class:"section-sub"},"待跟进",-1)),(S(!0),j(Ie,null,ot(a.value.followups,(N,le)=>(S(),j("div",{key:"f"+le,class:"sum-item"},[en(te(N.content),1),l("span",Ub,"("+te(N.date)+")",1)]))),128)),a.value.followups.length?Ce("",!0):(S(),j("div",qb,"(无)")),x[24]||(x[24]=l("div",{class:"section-sub"},"学习与成长",-1)),(S(!0),j(Ie,null,ot(a.value.takeaways,(N,le)=>(S(),j("div",{key:"t"+le,class:"sum-item"},[en(te(N.text),1),l("span",Hb,"("+te(N.date)+")",1)]))),128)),a.value.takeaways.length?Ce("",!0):(S(),j("div",Wb,"(无)"))])):Ce("",!0)])])]))}}),Gb=Wt(zb,[["__scopeId","data-v-43f9c59b"]]),Yb=["aria-label"],Jb={class:"dialog-head"},Xb={class:"dialog-title"},Qb={class:"dialog-body"},Zb={class:"form-grid"},ew={class:"field span2"},tw={class:"seg"},nw={class:"field"},rw={class:"field"},sw={class:"field"},ow=["value"],iw={key:0,class:"field"},aw={class:"seg"},lw={class:"field span2"},uw={key:0,class:"form-error"},cw={class:"dialog-btns"},dw=Rt({__name:"TransactionDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=L("expense"),a=L("餐饮"),c=L(""),f=L(""),h=L(""),g=L(!1),y=L(!1),_=L(""),C=L(null);function E(oe){n.open&&oe.key==="Escape"&&s("cancel")}ht(()=>n.open,async oe=>{var $;oe?(o.value=n.initial.type==="income"?"income":"expense",a.value=n.initial.category,c.value=n.initial.amountYuan,f.value=n.initial.date,h.value=n.initial.note,g.value=n.initial.reimbursable===1,y.value=n.initial.reimbursed===1,_.value="",window.addEventListener("keydown",E),await ss(),($=C.value)==null||$.focus()):window.removeEventListener("keydown",E)}),pr(()=>window.removeEventListener("keydown",E)),ht(o,oe=>{a.value=oe==="expense"?Gr[0]:Qo[0]});const B=st(()=>o.value==="expense"?Gr:Qo);function ne(){return a.value&&B.value.includes(a.value)?a.value:B.value[0]}function re(){const oe=String(c.value??"").trim(),$=Number(oe);if(!oe||!isFinite($)||$<=0){_.value="请填写大于 0 的金额";return}if(!f.value){_.value="请选择日期";return}const M=o.value==="expense"&&g.value?1:0;s("save",{type:o.value,category:ne(),amount:Math.round($*100),date:f.value,note:String(h.value??"").trim(),reimbursable:M,reimbursed:M&&y.value?1:0})}return(oe,$)=>(S(),At(jr,{to:"body"},[$e(os,{name:"modal"},{default:fr(()=>[e.open?(S(),j("div",{key:0,class:"mask",onClick:$[11]||($[11]=sn(M=>s("cancel"),["self"]))},[l("div",{class:"dialog",role:"dialog","aria-label":e.title},[l("div",Jb,[l("span",Xb,te(e.title),1),l("button",{class:"icon-btn",title:"关闭",onClick:$[0]||($[0]=M=>s("cancel"))},[$e(Xe,{name:"close",size:16})])]),l("div",Qb,[l("div",Zb,[l("div",ew,[$[12]||($[12]=l("label",null,"类型",-1)),l("div",tw,[l("button",{class:et(["seg-btn",{active:o.value==="expense"}]),onClick:$[1]||($[1]=M=>o.value="expense")},"支出",2),l("button",{class:et(["seg-btn",{active:o.value==="income"}]),onClick:$[2]||($[2]=M=>o.value="income")},"收入",2)])]),l("div",nw,[$[13]||($[13]=l("label",null,"金额(元,必填)",-1)),Te(l("input",{ref_key:"amountInput",ref:C,class:et(["input",{invalid:_.value}]),"onUpdate:modelValue":$[3]||($[3]=M=>c.value=M),type:"number",min:"0",step:"0.01",placeholder:"0.00"},null,2),[[je,c.value]])]),l("div",rw,[$[14]||($[14]=l("label",null,"日期(必填)",-1)),Te(l("input",{class:"input",type:"date","onUpdate:modelValue":$[4]||($[4]=M=>f.value=M)},null,512),[[je,f.value]])]),l("div",sw,[$[15]||($[15]=l("label",null,"分类",-1)),Te(l("select",{class:"select","onUpdate:modelValue":$[5]||($[5]=M=>a.value=M)},[(S(!0),j(Ie,null,ot(B.value,M=>(S(),j("option",{key:M,value:M},te(M),9,ow))),128))],512),[[Vn,a.value]])]),o.value==="expense"?(S(),j("div",iw,[$[16]||($[16]=l("label",null,"报销状态",-1)),l("div",aw,[l("button",{class:et(["seg-btn",{active:!g.value}]),onClick:$[6]||($[6]=M=>{g.value=!1,y.value=!1})},"无需报销",2),l("button",{class:et(["seg-btn",{active:g.value&&!y.value}]),onClick:$[7]||($[7]=M=>{g.value=!0,y.value=!1})},"待报销",2),l("button",{class:et(["seg-btn",{active:g.value&&y.value}]),onClick:$[8]||($[8]=M=>{g.value=!0,y.value=!0})},"已报销",2)])])):Ce("",!0),l("div",lw,[$[17]||($[17]=l("label",null,"备注",-1)),Te(l("textarea",{class:"textarea","onUpdate:modelValue":$[9]||($[9]=M=>h.value=M),placeholder:"选填"},null,512),[[je,h.value]])])]),_.value?(S(),j("div",uw,te(_.value),1)):Ce("",!0)]),l("div",cw,[l("button",{class:"btn btn-sm",onClick:$[10]||($[10]=M=>s("cancel"))},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:re},"保存")])],8,Yb)])):Ce("",!0)]),_:1})]))}}),fw=Wt(dw,[["__scopeId","data-v-edca3327"]]),pw={class:"ledger-page"},vw={class:"ledger-toolbar"},hw={class:"month-title num"},mw={class:"cards"},yw={class:"card stat-card"},gw={class:"stat-num num amt-income"},bw={class:"card stat-card"},ww={class:"stat-num num"},_w={class:"card stat-card"},kw={class:"card stat-card"},xw={class:"stat-num num amt-warn"},Cw={class:"card sec"},Sw={class:"form-grid"},Ew={class:"field span2"},$w={class:"seg"},Tw={class:"field"},Pw={class:"field"},Aw={class:"field"},Ow=["value"],Mw={key:0,class:"field"},Iw={class:"field span2"},jw={key:0,class:"form-error"},Dw={class:"form-footer"},Lw=["disabled"],Rw=["disabled"],Kw={key:0,class:"card sec"},Fw={class:"bar-label"},Nw={class:"bar-track"},Vw={class:"muted num bar-num"},Bw={key:1,class:"card section"},Uw={class:"form-error"},qw={class:"card table-card"},Hw={class:"tx-table"},Ww={class:"num","data-label":"日期"},zw={"data-label":"分类"},Gw={class:"tag"},Yw={class:"td-note","data-label":"备注"},Jw={"data-label":"报销"},Xw={key:0,class:"muted"},Qw={key:1,class:"tx-done"},Zw={key:2,class:"tx-pending"},e_={class:"ops-cell"},t_={class:"ops"},n_=["onClick"],r_=["onClick"],s_=["onClick"],o_={key:0},i_={class:"muted vault-note num"},a_=Rt({__name:"LedgerView",setup(e){const t=L(xt()),n=L([]),s=L(!0),o=L("expense"),a=L(""),c=L(Gr[0]),f=L(xt()),h=L(""),g=L(!1),y=L(""),_=L(""),C=L(!1),E=L(!1),B=L(null),ne=L({type:"expense",category:Gr[0],amountYuan:"",date:xt(),note:"",reimbursable:0,reimbursed:0}),re=L(null),oe=st(()=>t.value.slice(0,7)+"-01"),$=st(()=>{const Z=Number(t.value.slice(0,4)),ee=Number(t.value.slice(5,7))-1,we=new Date(Z,ee+1,0).getDate();return t.value.slice(0,7)+"-"+(we<10?"0"+we:String(we))}),M=st(()=>Number(t.value.slice(0,4))+" 年 "+Number(t.value.slice(5,7))+" 月");async function Q(){s.value=!0;try{n.value=await Dm(oe.value,$.value),_.value=""}catch(Z){_.value="账目加载失败:"+(Z instanceof Error?Z.stack||Z.message:String(Z)),Fe("账目加载失败")}s.value=!1}pn(Q),ht(t,Q),ht(o,Z=>{c.value=Z==="expense"?Gr[0]:Qo[0]});const ce=st(()=>n.value.slice().sort((Z,ee)=>Z.date===ee.date?ee.id-Z.id:Z.date<ee.date?1:-1)),ie=st(()=>{let Z=0,ee=0,we=0;for(const Ke of n.value)Ke.type==="income"?Z+=Ke.amount:(ee+=Ke.amount,Ke.reimbursable===1&&Ke.reimbursed!==1&&(we+=Ke.amount));return{income:Z,expense:ee,pending:we,balance:Z-ee}}),Y=L("all"),A=L("all"),x=st(()=>ce.value.filter(Z=>!(Y.value!=="all"&&Z.type!==Y.value||A.value==="pending"&&!(Z.type==="expense"&&Z.reimbursable===1&&Z.reimbursed!==1)||A.value==="done"&&!(Z.reimbursable===1&&Z.reimbursed===1)))),N=st(()=>{const Z=new Map;let ee=0;for(const Ke of n.value)Ke.type==="expense"&&(Z.set(Ke.category,(Z.get(Ke.category)||0)+Ke.amount),ee+=Ke.amount);const we=ee||1;return Array.from(Z.entries()).map(Ke=>({name:Ke[0],amount:Ke[1],percent:Math.round(Ke[1]/we*100)})).sort((Ke,dt)=>dt.amount-Ke.amount)});function le(Z){return(Z/100).toFixed(2)}function W(Z){return(Z.type==="income"?"+":"-")+le(Z.amount)}function ke(){t.value=ei(t.value,-1)}function Pe(){t.value=ei(t.value,1)}function Je(){t.value=xt()}ht(a,()=>{y.value&&(y.value="")});async function Le(){const Z=String(a.value??"").trim(),ee=Number(Z);if(!Z||!isFinite(ee)||ee<=0){y.value="请填写大于 0 的金额";return}if(!f.value){y.value="请选择日期";return}if(!C.value){C.value=!0;try{await Lm({type:o.value,category:c.value,amount:Math.round(ee*100),date:f.value,note:String(h.value??"").trim(),reimbursable:o.value==="expense"&&g.value?1:0,reimbursed:0})}catch(we){Fe("添加失败:"+(we instanceof Error?we.message:String(we))),C.value=!1;return}a.value="",h.value="",g.value=!1,y.value="",await Q(),Fe("记账已添加"),C.value=!1}}const qe=st(()=>String(a.value??"").trim()!==""||String(h.value??"").trim()!=="");function Ne(){a.value="",h.value="",g.value=!1,y.value=""}async function it(Z){await Fm(Z.id),await Q(),Fe("已标记为已报销")}function Ge(Z){B.value=Z.id,ne.value={type:Z.type,category:Z.category,amountYuan:le(Z.amount),date:Z.date,note:Z.note||"",reimbursable:Z.reimbursable,reimbursed:Z.reimbursed},E.value=!0}async function Qe(Z){const ee=B.value;await Rm(ee,Z),E.value=!1,await Q(),Fe("账目已更新")}async function Se(){re.value&&re.value.id&&await Km(re.value.id),re.value=null,await Q(),Fe("账目已删除")}return(Z,ee)=>(S(),j("div",pw,[l("div",vw,[l("button",{class:"icon-btn",onClick:ke},[$e(Xe,{name:"chevron-left",size:16})]),l("span",hw,te(M.value),1),l("button",{class:"icon-btn",onClick:Pe},[$e(Xe,{name:"chevron-right",size:16})]),l("button",{class:"btn btn-sm",onClick:Je},"回到本月"),ee[13]||(ee[13]=l("span",{class:"flex1"},null,-1)),Te(l("select",{class:"select w-filter","onUpdate:modelValue":ee[0]||(ee[0]=we=>Y.value=we)},[...ee[11]||(ee[11]=[l("option",{value:"all"},"全部类型",-1),l("option",{value:"expense"},"仅支出",-1),l("option",{value:"income"},"仅收入",-1)])],512),[[Vn,Y.value]]),Te(l("select",{class:"select w-filter","onUpdate:modelValue":ee[1]||(ee[1]=we=>A.value=we)},[...ee[12]||(ee[12]=[l("option",{value:"all"},"全部报销",-1),l("option",{value:"pending"},"待报销",-1),l("option",{value:"done"},"已报销",-1)])],512),[[Vn,A.value]])]),l("div",mw,[l("div",yw,[ee[14]||(ee[14]=l("div",{class:"muted"},"本月收入(元)",-1)),l("div",gw,te(le(ie.value.income)),1)]),l("div",bw,[ee[15]||(ee[15]=l("div",{class:"muted"},"本月支出(元)",-1)),l("div",ww,te(le(ie.value.expense)),1)]),l("div",_w,[ee[16]||(ee[16]=l("div",{class:"muted"},"本月结余(元)",-1)),l("div",{class:et(["stat-num num",{"amt-income":ie.value.balance>=0,"amt-expense":ie.value.balance<0}])},te(le(ie.value.balance)),3)]),l("div",kw,[ee[17]||(ee[17]=l("div",{class:"muted"},"待报销(元)",-1)),l("div",xw,te(le(ie.value.pending)),1)])]),l("div",Cw,[ee[24]||(ee[24]=l("div",{class:"sec-head"},[l("span",{class:"sec-title"},"新增一笔"),l("span",{class:"muted form-hint"},"金额必填,回车快速添加")],-1)),l("div",Sw,[l("div",Ew,[ee[18]||(ee[18]=l("label",null,"类型",-1)),l("div",$w,[l("button",{class:et(["seg-btn",{active:o.value==="expense"}]),onClick:ee[2]||(ee[2]=we=>o.value="expense")},"支出",2),l("button",{class:et(["seg-btn",{active:o.value==="income"}]),onClick:ee[3]||(ee[3]=we=>o.value="income")},"收入",2)])]),l("div",Tw,[ee[19]||(ee[19]=l("label",null,"金额(元,必填)",-1)),Te(l("input",{class:et(["input",{invalid:y.value}]),"onUpdate:modelValue":ee[4]||(ee[4]=we=>a.value=we),type:"number",min:"0",step:"0.01",placeholder:"0.00",onKeydown:Ot(Le,["enter"])},null,34),[[je,a.value]])]),l("div",Pw,[ee[20]||(ee[20]=l("label",null,"日期",-1)),Te(l("input",{class:"input",type:"date","onUpdate:modelValue":ee[5]||(ee[5]=we=>f.value=we)},null,512),[[je,f.value]])]),l("div",Aw,[ee[21]||(ee[21]=l("label",null,"分类",-1)),Te(l("select",{class:"select","onUpdate:modelValue":ee[6]||(ee[6]=we=>c.value=we)},[(S(!0),j(Ie,null,ot(o.value==="expense"?Ut(Gr):Ut(Qo),we=>(S(),j("option",{key:we,value:we},te(we),9,Ow))),128))],512),[[Vn,c.value]])]),o.value==="expense"?(S(),j("div",Mw,[ee[22]||(ee[22]=l("label",null,"报销",-1)),l("button",{class:et(["toggle-btn",{on:g.value}]),onClick:ee[7]||(ee[7]=we=>g.value=!g.value)},te(g.value?"需要报销":"无需报销"),3)])):Ce("",!0),l("div",Iw,[ee[23]||(ee[23]=l("label",null,"备注",-1)),Te(l("input",{class:"input","onUpdate:modelValue":ee[8]||(ee[8]=we=>h.value=we),placeholder:"选填,如:客户现场午餐",onKeydown:Ot(Le,["enter"])},null,544),[[je,h.value]])])]),y.value?(S(),j("div",jw,te(y.value),1)):Ce("",!0),l("div",Dw,[l("button",{class:"btn btn-sm",disabled:!qe.value,onClick:Ne},"重置",8,Lw),l("button",{class:"btn btn-primary btn-sm",disabled:C.value,onClick:Le},"添加记录",8,Rw)])]),N.value.length?(S(),j("div",Kw,[ee[25]||(ee[25]=l("div",{class:"sec-title"},"本月支出分类",-1)),(S(!0),j(Ie,null,ot(N.value,we=>(S(),j("div",{key:we.name,class:"bar-row"},[l("span",Fw,te(we.name),1),l("span",Nw,[l("span",{class:"bar-fill",style:or({width:we.percent+"%"})},null,4)]),l("span",Vw,te(le(we.amount))+" 元 · "+te(we.percent)+"%",1)]))),128))])):Ce("",!0),_.value?(S(),j("div",Bw,[l("div",Uw,te(_.value),1),ee[26]||(ee[26]=l("div",{class:"muted loc-note"},"请将上方完整错误文字发送给开发者",-1))])):Ce("",!0),l("div",qw,[l("table",Hw,[ee[28]||(ee[28]=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,[(S(!0),j(Ie,null,ot(x.value,we=>(S(),j("tr",{key:we.id},[l("td",Ww,te(we.date),1),l("td",zw,[l("span",Gw,te(we.category),1)]),l("td",{class:et(["num",we.type==="income"?"amt-income":"amt-expense"]),"data-label":"金额"},te(W(we)),3),l("td",Yw,te(we.note||"--"),1),l("td",Jw,[we.type!=="expense"||we.reimbursable!==1?(S(),j("span",Xw,"--")):we.reimbursed===1?(S(),j("span",Qw,"已报销")):(S(),j("span",Zw,"待报销"))]),l("td",e_,[l("div",t_,[we.type==="expense"&&we.reimbursable===1&&we.reimbursed!==1?(S(),j("button",{key:0,class:"btn btn-xs",onClick:Ke=>it(we)},"标记已报销",8,n_)):Ce("",!0),l("button",{class:"btn btn-xs",onClick:Ke=>Ge(we)},"编辑",8,r_),l("button",{class:"btn btn-xs",onClick:Ke=>re.value=we},"删除",8,s_)])])]))),128)),!x.value.length&&!s.value?(S(),j("tr",o_,[...ee[27]||(ee[27]=[l("td",{colspan:"6",class:"empty muted"},"本月暂无账目",-1)])])):Ce("",!0)])])]),l("div",i_,"本月 "+te(n.value.length)+" 条 · 当前筛选 "+te(x.value.length)+" 条",1),$e(fw,{open:E.value,title:(B.value,"编辑账目"),initial:ne.value,onCancel:ee[9]||(ee[9]=we=>E.value=!1),onSave:Qe},null,8,["open","title","initial"]),$e(qn,{open:!!re.value,title:"删除确认",message:re.value?"将删除 "+re.value.date+" 的账目("+re.value.category+" "+le(re.value.amount)+" 元)。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:ee[10]||(ee[10]=we=>re.value=null),onConfirm:Se},null,8,["open","message"])]))}}),l_=Wt(a_,[["__scopeId","data-v-5490dec1"]]),u_={class:"memo-page"},c_={class:"card memo-list"},d_={class:"pane-head"},f_={class:"pane-title"},p_={class:"memo-scroll"},v_=["onClick"],h_={class:"memo-item-title"},m_={class:"muted memo-item-sub"},y_={class:"muted num memo-item-time"},g_={key:0,class:"muted empty"},b_={class:"card memo-editor"},w_={class:"editor-foot"},__={class:"muted foot-info"},k_=["disabled"],x_=["disabled"],C_={key:1,class:"empty muted editor-empty"},S_=Rt({__name:"MemoView",setup(e){const t=L([]),n=L(null),s=L(!1),o=L(""),a=L(""),c=L(null),f=L(null);async function h(){if(t.value=await Pm(),n.value&&n.value.id){const ie=t.value.find(Y=>Y.id===n.value.id);ie&&(n.value=ie)}}pn(async()=>{await h(),t.value.length&&_(t.value[0]),window.addEventListener("keydown",g)}),pr(()=>window.removeEventListener("keydown",g)),ht(Fa,async ie=>{if(!ie)return;t.value.length||await h();const Y=t.value.find(A=>A.id===ie);Fa.value=null,Y&&C(Y)},{immediate:!0});function g(ie){(ie.ctrlKey||ie.metaKey)&&ie.key.toLowerCase()==="s"&&s.value&&y.value&&(ie.preventDefault(),re())}const y=st(()=>{if(!s.value)return!1;const ie=n.value?n.value.title:"",Y=n.value?n.value.content:"";return o.value!==ie||a.value!==Y});function _(ie){n.value=ie,s.value=!0,o.value=ie.title,a.value=ie.content}function C(ie){if(!(s.value&&n.value&&n.value.id===ie.id)){if(y.value){f.value={type:"select",memo:ie};return}_(ie)}}function E(){if(y.value){f.value={type:"new"};return}B()}function B(){n.value=null,s.value=!0,o.value="",a.value=""}function ne(){n.value?_(n.value):B()}async function re(){if(!o.value.trim()&&!a.value.trim()){Fe("标题与内容不能都为空");return}if(n.value&&n.value.id)await Om(n.value.id,o.value,a.value),Fe("备忘已保存");else{const ie=await Am(o.value,a.value);n.value=ie,o.value=ie.title,a.value=ie.content,Fe("备忘已创建")}await h()}function oe(){n.value&&n.value.id&&(c.value=n.value)}async function $(){c.value&&c.value.id&&(await Mm(c.value.id),Fe("备忘已删除")),c.value=null,await h(),B()}function M(){const ie=f.value;f.value=null,ie&&(ie.type==="select"?_(ie.memo):B())}function Q(ie){return(ie.content||"").replace(/\s+/g," ").slice(0,30)}function ce(ie){return ie.replace("T"," ").slice(0,16)}return(ie,Y)=>(S(),j("div",u_,[l("aside",c_,[l("div",d_,[l("span",f_,"备忘录("+te(t.value.length)+")",1),l("button",{class:"btn btn-primary btn-sm",onClick:E},"新建")]),l("div",p_,[(S(!0),j(Ie,null,ot(t.value,A=>(S(),j("div",{key:A.id,class:et(["memo-item",{active:s.value&&n.value&&n.value.id===A.id}]),onClick:x=>C(A)},[l("div",h_,te(A.title||"无标题"),1),l("div",m_,te(Q(A)||"空"),1),l("div",y_,te(ce(A.updated_at)),1)],10,v_))),128)),t.value.length?Ce("",!0):(S(),j("div",g_,"暂无备忘"))])]),l("section",b_,[s.value?(S(),j(Ie,{key:0},[Te(l("input",{class:"input title-input","onUpdate:modelValue":Y[0]||(Y[0]=A=>o.value=A),placeholder:"标题"},null,512),[[je,o.value]]),Te(l("textarea",{class:"textarea content-textarea","onUpdate:modelValue":Y[1]||(Y[1]=A=>a.value=A),placeholder:"内容"},null,512),[[je,a.value]]),l("div",w_,[l("span",__,[y.value?(S(),j(Ie,{key:0},[en("有未保存修改")],64)):n.value&&n.value.id?(S(),j(Ie,{key:1},[en("更新于 "+te(ce(n.value.updated_at)),1)],64)):(S(),j(Ie,{key:2},[en("新备忘")],64))]),Y[4]||(Y[4]=l("span",{class:"flex1"},null,-1)),n.value&&n.value.id?(S(),j("button",{key:0,class:"btn btn-sm",onClick:oe},"删除")):Ce("",!0),l("button",{class:"btn btn-sm",disabled:!y.value,onClick:ne},"放弃修改",8,k_),l("button",{class:"btn btn-primary btn-sm",disabled:!y.value,onClick:re},"保存",8,x_)])],64)):(S(),j("div",C_,"选择左侧备忘,或点击右上角新建"))]),$e(qn,{open:!!c.value,title:"删除确认",message:c.value?"将删除备忘「"+(c.value.title||"无标题")+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:Y[2]||(Y[2]=A=>c.value=null),onConfirm:$},null,8,["open","message"]),$e(qn,{open:!!f.value,title:"未保存提示",message:"当前备忘有未保存的修改,继续操作将丢失这些修改。","confirm-text":"放弃修改并继续",onCancel:Y[3]||(Y[3]=A=>f.value=null),onConfirm:M},null,8,["open"])]))}}),E_=Wt(S_,[["__scopeId","data-v-74d60dba"]]),$_=["aria-label"],T_={class:"dialog-head"},P_={class:"dialog-title"},A_={class:"dialog-body"},O_={class:"form-grid"},M_={class:"field span2"},I_={class:"field span2"},j_={class:"field span2"},D_={class:"pwd-row"},L_={class:"field span2"},R_={key:0,class:"form-error"},K_={class:"dialog-btns"},F_=Rt({__name:"CredentialDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=L(""),a=L(""),c=L(""),f=L(""),h=L(""),g=L(null);function y(E){n.open&&E.key==="Escape"&&s("cancel")}ht(()=>n.open,async E=>{var B;E?(o.value=n.initial.system,a.value=n.initial.account,c.value=n.initial.password,f.value=n.initial.remark,h.value="",window.addEventListener("keydown",y),await ss(),(B=g.value)==null||B.focus()):window.removeEventListener("keydown",y)}),pr(()=>window.removeEventListener("keydown",y));function _(){const E="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789",B="!@#$%^&*",ne=crypto.getRandomValues(new Uint8Array(14));let re="";for(let oe=0;oe<ne.length;oe++)re+=E[ne[oe]%E.length];re+=B[crypto.getRandomValues(new Uint8Array(1))[0]%B.length],c.value=re,h.value=""}function C(){if(!o.value.trim()||!a.value.trim()||!c.value){h.value="系统名称、账号、密码为必填项";return}s("save",{system:o.value.trim(),account:a.value.trim(),password:c.value,remark:f.value.trim()})}return(E,B)=>(S(),At(jr,{to:"body"},[$e(os,{name:"modal"},{default:fr(()=>[e.open?(S(),j("div",{key:0,class:"mask",onClick:B[6]||(B[6]=sn(ne=>s("cancel"),["self"]))},[l("div",{class:"dialog",role:"dialog","aria-label":e.title},[l("div",T_,[l("span",P_,te(e.title),1),l("button",{class:"icon-btn",title:"关闭",onClick:B[0]||(B[0]=ne=>s("cancel"))},[$e(Xe,{name:"close",size:16})])]),l("div",A_,[l("div",O_,[l("div",M_,[B[7]||(B[7]=l("label",null,"系统名称(必填)",-1)),Te(l("input",{ref_key:"systemInput",ref:g,class:"input","onUpdate:modelValue":B[1]||(B[1]=ne=>o.value=ne),placeholder:"如:企业邮箱 / OA / VPN"},null,512),[[je,o.value]])]),l("div",I_,[B[8]||(B[8]=l("label",null,"账号(必填)",-1)),Te(l("input",{class:"input","onUpdate:modelValue":B[2]||(B[2]=ne=>a.value=ne),placeholder:"用户名、工号或邮箱"},null,512),[[je,a.value]])]),l("div",j_,[B[9]||(B[9]=l("label",null,"密码(必填)",-1)),l("div",D_,[Te(l("input",{class:"input","onUpdate:modelValue":B[3]||(B[3]=ne=>c.value=ne),placeholder:"输入或点击生成"},null,512),[[je,c.value]]),l("button",{class:"btn btn-sm",onClick:_},"生成")])]),l("div",L_,[B[10]||(B[10]=l("label",null,"备注",-1)),Te(l("textarea",{class:"textarea","onUpdate:modelValue":B[4]||(B[4]=ne=>f.value=ne),placeholder:"用途、到期时间、负责人等(选填)"},null,512),[[je,f.value]])])]),h.value?(S(),j("div",R_,te(h.value),1)):Ce("",!0)]),l("div",K_,[l("button",{class:"btn btn-sm",onClick:B[5]||(B[5]=ne=>s("cancel"))},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:C},"保存")])],8,$_)])):Ce("",!0)]),_:1})]))}}),N_=Wt(F_,[["__scopeId","data-v-f383b0a6"]]),V_={class:"vault-page"},B_={key:0,class:"empty muted"},U_={key:1,class:"card lock-card"},q_={class:"lock-badge"},H_={key:0,class:"form-error"},W_=["disabled"],z_={key:0,class:"form-error"},G_=["disabled"],Y_={class:"vault-toolbar"},J_={class:"search-wrap"},X_={class:"card table-card"},Q_={class:"cred-table"},Z_={class:"td-system"},e1=["onClick"],t1={class:"pwd-cell"},n1={class:"num pwd-text"},r1=["onClick"],s1=["onClick"],o1={class:"td-remark"},i1={class:"td-ops"},a1={class:"ops"},l1=["onClick"],u1=["onClick"],c1={key:0},d1={class:"muted vault-note num"},f1={class:"dialog pwd-dialog"},p1={class:"dialog-head"},v1={class:"dialog-body"},h1={class:"vp-field"},m1={class:"vp-field"},y1={class:"vp-field"},g1={key:0,class:"form-error"},b1={class:"dialog-btns"},w1=5*60*1e3,_1=Rt({__name:"VaultView",setup(e){const t=L(null),n=L(kh()),s=L(!1),o=L(""),a=L(""),c=L(""),f=L(""),h=L(""),g=L([]),y=L(""),_=L({}),C=L(!1),E=L(null),B=L({system:"",account:"",password:"",remark:""}),ne=L(null),re=L(!1),oe=L(""),$=L(""),M=L(""),Q=L("");async function ce(){g.value=await $h(),_.value={}}let ie=null;function Y(){ie!==null&&window.clearTimeout(ie),ie=window.setTimeout(()=>{n.value&&(ri(),n.value=!1,g.value=[],_.value={},Fe("长时间未操作,密码库已自动锁定"))},w1)}function A(){n.value&&Y()}pn(async()=>{t.value=await ud(),window.addEventListener("click",A),window.addEventListener("keydown",A),n.value&&Y()}),pr(()=>{window.removeEventListener("click",A),window.removeEventListener("keydown",A),ie!==null&&window.clearTimeout(ie)});const x=st(()=>{const Se=y.value.trim().toLowerCase();return Se?g.value.filter(Z=>(Z.system+" "+Z.account+" "+(Z.remark||"")).toLowerCase().includes(Se)):g.value});async function N(){if(!s.value){if(c.value="",!o.value){c.value="请输入主密码";return}if(o.value.length<6){c.value="主密码至少 6 位";return}if(o.value!==a.value){c.value="两次输入的主密码不一致";return}s.value=!0;try{await xh(o.value),o.value="",a.value="",n.value=!0,Y(),await ce(),Fe("主密码已设置,密码库已解锁")}catch(Se){c.value=Se instanceof Error?Se.message:"设置失败"}s.value=!1}}async function le(){if(!s.value){if(h.value="",!f.value){h.value="请输入主密码";return}s.value=!0;try{await Ch(f.value),f.value="",n.value=!0,Y(),await ce()}catch(Se){h.value=Se instanceof Error?Se.message:"解锁失败"}s.value=!1}}function W(){ri(),n.value=!1,g.value=[],_.value={},ie!==null&&window.clearTimeout(ie),Fe("密码库已锁定")}async function ke(Se){const Z=Se.id;if(_.value[Z]){_.value[Z]=!1;return}try{Se.passwordPlain=await ma(Z),_.value[Z]=!0}catch(ee){Fe(ee instanceof Error?ee.message:"解密失败")}}async function Pe(Se){try{const Z=await ma(Se.id);await qa(Z),Fe("密码已复制")}catch(Z){Fe(Z instanceof Error?Z.message:"复制失败")}}async function Je(Se){await qa(Se.account),Fe("账号已复制")}function Le(){E.value=null,B.value={system:"",account:"",password:"",remark:""},C.value=!0}async function qe(Se){try{const Z=await ma(Se.id);E.value=Se.id,B.value={system:Se.system,account:Se.account,password:Z,remark:Se.remark||""},C.value=!0}catch(Z){Fe(Z instanceof Error?Z.message:"解密失败")}}async function Ne(Se){const Z=E.value??void 0;await Th(Se,Z),C.value=!1,await ce(),Fe(Z?"账号已更新":"账号已添加")}async function it(){ne.value&&ne.value.id&&(await Ph(ne.value.id),Fe("账号已删除")),ne.value=null,await ce()}function Ge(){oe.value="",$.value="",M.value="",Q.value="",re.value=!0}async function Qe(){Q.value="";try{const Se=await Ah(oe.value,$.value);re.value=!1,oe.value="",$.value="",M.value="",Fe("主密码已修改,"+Se+" 条账号密码已重新加密")}catch(Se){Q.value=Se instanceof Error?Se.message:"修改失败"}}return(Se,Z)=>(S(),j("div",V_,[t.value===null?(S(),j("div",B_,"加载中")):n.value?(S(),j(Ie,{key:2},[l("div",Y_,[l("div",J_,[$e(Xe,{name:"search",size:14,class:"search-icon"}),Te(l("input",{class:"input","onUpdate:modelValue":Z[3]||(Z[3]=ee=>y.value=ee),placeholder:"搜索系统名称、账号或备注"},null,512),[[je,y.value]])]),Z[16]||(Z[16]=l("span",{class:"flex1"},null,-1)),l("button",{class:"btn btn-sm",onClick:Ge},"修改主密码"),l("button",{class:"btn btn-sm",onClick:W},"锁定"),l("button",{class:"btn btn-primary btn-sm",onClick:Le},"新增账号")]),l("div",X_,[l("table",Q_,[Z[18]||(Z[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,[(S(!0),j(Ie,null,ot(x.value,ee=>(S(),j("tr",{key:ee.id},[l("td",Z_,te(ee.system),1),l("td",null,[l("span",{class:"copyable",title:"点击复制账号",onClick:we=>Je(ee)},te(ee.account),9,e1)]),l("td",null,[l("div",t1,[l("span",n1,te(_.value[ee.id]?ee.passwordPlain:"........"),1),l("button",{class:"btn btn-xs",onClick:we=>ke(ee)},te(_.value[ee.id]?"隐藏":"显示"),9,r1),l("button",{class:"btn btn-xs",onClick:we=>Pe(ee)},"复制",8,s1)])]),l("td",o1,te(ee.remark||"--"),1),l("td",i1,[l("div",a1,[l("button",{class:"btn btn-xs",onClick:we=>qe(ee)},"编辑",8,l1),l("button",{class:"btn btn-xs",onClick:we=>ne.value=ee},"删除",8,u1)])])]))),128)),x.value.length?Ce("",!0):(S(),j("tr",c1,[...Z[17]||(Z[17]=[l("td",{colspan:"5",class:"empty muted"},"暂无账号,点击右上角新增",-1)])]))])])]),l("div",d1,"共 "+te(g.value.length)+" 条账号记录 · 密码以 AES-256-GCM 加密,服务器仅存密文",1)],64)):(S(),j("div",U_,[l("div",q_,[$e(Xe,{name:"lock",size:26})]),t.value===!1?(S(),j(Ie,{key:0},[Z[12]||(Z[12]=l("div",{class:"lock-title"},"设置主密码",-1)),Z[13]||(Z[13]=l("div",{class:"muted lock-tip"},"主密码用于加密保存在本机的账号密码,遗忘后无法找回,请务必牢记",-1)),Te(l("input",{type:"password",class:"input","onUpdate:modelValue":Z[0]||(Z[0]=ee=>o.value=ee),placeholder:"设置主密码(至少 6 位)",onKeydown:Ot(N,["enter"])},null,544),[[je,o.value]]),Te(l("input",{type:"password",class:"input","onUpdate:modelValue":Z[1]||(Z[1]=ee=>a.value=ee),placeholder:"再次输入主密码",onKeydown:Ot(N,["enter"])},null,544),[[je,a.value]]),c.value?(S(),j("div",H_,te(c.value),1)):Ce("",!0),l("button",{class:"btn btn-primary lock-btn",disabled:s.value,onClick:N},"完成设置并解锁",8,W_)],64)):(S(),j(Ie,{key:1},[Z[14]||(Z[14]=l("div",{class:"lock-title"},"密码库已锁定",-1)),Z[15]||(Z[15]=l("div",{class:"muted lock-tip"},"输入主密码解锁后查看与复制密码",-1)),Te(l("input",{type:"password",class:"input","onUpdate:modelValue":Z[2]||(Z[2]=ee=>f.value=ee),placeholder:"主密码",onKeydown:Ot(le,["enter"])},null,544),[[je,f.value]]),h.value?(S(),j("div",z_,te(h.value),1)):Ce("",!0),l("button",{class:"btn btn-primary lock-btn",disabled:s.value,onClick:le},"解锁",8,G_)],64))])),$e(N_,{open:C.value,title:E.value?"编辑账号":"新增账号",initial:B.value,onCancel:Z[4]||(Z[4]=ee=>C.value=!1),onSave:Ne},null,8,["open","title","initial"]),$e(qn,{open:!!ne.value,title:"删除确认",message:ne.value?"将删除系统「"+ne.value.system+"」的账号记录。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:Z[5]||(Z[5]=ee=>ne.value=null),onConfirm:it},null,8,["open","message"]),(S(),At(jr,{to:"body"},[$e(os,{name:"modal"},{default:fr(()=>[re.value?(S(),j("div",{key:0,class:"mask",onClick:Z[11]||(Z[11]=sn(ee=>re.value=!1,["self"]))},[l("div",f1,[l("div",p1,[Z[19]||(Z[19]=l("span",{class:"dialog-title"},"修改主密码",-1)),l("button",{class:"icon-btn",title:"关闭",onClick:Z[6]||(Z[6]=ee=>re.value=!1)},[$e(Xe,{name:"close",size:16})])]),l("div",v1,[l("div",h1,[Z[20]||(Z[20]=l("label",null,"旧主密码",-1)),Te(l("input",{type:"password",class:"input","onUpdate:modelValue":Z[7]||(Z[7]=ee=>oe.value=ee)},null,512),[[je,oe.value]])]),l("div",m1,[Z[21]||(Z[21]=l("label",null,"新主密码(至少 6 位)",-1)),Te(l("input",{type:"password",class:"input","onUpdate:modelValue":Z[8]||(Z[8]=ee=>$.value=ee)},null,512),[[je,$.value]])]),l("div",y1,[Z[22]||(Z[22]=l("label",null,"确认新主密码",-1)),Te(l("input",{type:"password",class:"input","onUpdate:modelValue":Z[9]||(Z[9]=ee=>M.value=ee)},null,512),[[je,M.value]])]),Q.value?(S(),j("div",g1,te(Q.value),1)):Ce("",!0),Z[23]||(Z[23]=l("div",{class:"muted vp-tip"},"确认后所有账号密码将使用新主密码重新加密",-1))]),l("div",b1,[l("button",{class:"btn btn-sm",onClick:Z[10]||(Z[10]=ee=>re.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:Qe},"确认修改")])])])):Ce("",!0)]),_:1})]))]))}}),k1=Wt(_1,[["__scopeId","data-v-c2db283d"]]);function x1(e){return'"'+(e==null?"":String(e)).replace(/"/g,'""')+'"'}async function Vu(e,t){const s="\uFEFF"+t.map(f=>f.map(x1).join(",")).join(`\r
`);if(rs.isNativePlatform()){const{downloadText:f}=await Sd(async()=>{const{downloadText:h}=await Promise.resolve().then(()=>db);return{downloadText:h}},void 0,import.meta.url);return f(e,s)}const o=new Blob([s],{type:"text/csv;charset=utf-8"}),a=URL.createObjectURL(o),c=document.createElement("a");return c.href=a,c.download=e,c.click(),window.setTimeout(()=>URL.revokeObjectURL(a),1e4),""}const C1={class:"settings"},S1={class:"card section"},E1={class:"muted acc-line"},$1={class:"ai-grid"},T1={class:"rule-item"},P1={class:"rule-item"},A1={class:"rule-item"},O1={key:0,class:"form-error"},M1={class:"rule-save"},I1={class:"card section"},j1={class:"rule-grid"},D1={class:"rule-item"},L1={class:"rule-item"},R1={class:"rule-item"},K1={class:"rule-item"},F1={class:"rule-item"},N1={class:"card section"},V1={class:"proj-add"},B1={key:0,class:"muted proj-tip"},U1=["onKeydown"],q1=["onClick"],H1=["onClick"],W1=["onClick"],z1={key:1,class:"muted"},G1={class:"card section"},Y1={class:"card section"},J1={class:"muted acc-line"},X1={class:"rule-save"},Q1=["disabled"],Z1={key:0,class:"muted acc-line"},e0={key:1,class:"form-error"},t0={key:2,class:"form-error"},n0={class:"card section"},r0={class:"ai-grid"},s0={class:"rule-item"},o0={class:"rule-item"},i0={class:"rule-item"},a0={class:"card section"},l0={class:"backup-row"},u0={key:0,class:"import-error"},c0=Rt({__name:"SettingsView",setup(e){var Tt;const t=L({work_start:"09:00",work_end:"18:00",grace_minutes:10,lunch_minutes:60,remind_weekly:"friday"}),n=L([]),s=L(""),o=L(""),a=L(""),c=L(""),f=L(""),h=L(""),g=L(null),y=L(""),_=L(null),C=L(null),E=L(""),B=L(((Tt=Vs())==null?void 0:Tt.username)||""),ne=L(""),re=L(""),oe=L(""),$=L(""),M=L(!1),Q="0.3.0",ce=L(""),ie=L(""),Y=L(""),A=L(""),x=L(!1),N=L("");async function le(){var de;ce.value=((de=gn())==null?void 0:de.username)||"",N.value=await Xh(),A.value=Xr.value}ht(Xr,de=>{A.value=de});async function W(){Y.value="";try{await md(),Fe("云端绑定已重建")}catch(de){Y.value=de instanceof Error?de.message:"绑定失败"}}async function ke(){if(!x.value){Y.value="",A.value=Xr.value,x.value=!0;try{const de=await Na();N.value=de.at,ie.value="推送 "+de.pushed+" 条 · 拉取 "+de.pulled+" 条 · 删除 "+de.removed+" 条",A.value="",Fe("同步完成")}catch(de){Y.value=de instanceof Error?de.message:"同步失败"}x.value=!1}}async function Pe(){if($.value="",re.value!==oe.value){$.value="两次输入的新密码不一致";return}try{await Hh(ne.value,re.value),ne.value="",re.value="",oe.value="",Fe("登录密码已修改")}catch(de){$.value=de instanceof Error?de.message:"修改失败"}}async function Je(){await Wh(),window.location.reload()}async function Le(){t.value=await Lr(),n.value=await Us(!0),a.value=(await pl()).join(`
`),c.value=await gt("ai_base_url",""),f.value=await gt("ai_api_key",""),h.value=await gt("ai_model",""),await le()}async function qe(){await Lt("ai_base_url",c.value.trim()),await Lt("ai_api_key",f.value.trim()),await Lt("ai_model",h.value.trim()),Fe("AI 配置已保存")}async function Ne(){const de=xt(),v=await Promise.all([Si("2000-01-01",de),Us(!0)]),b=v[0],U=v[1],fe=new Map(U.map(ue=>[ue.id,ue.name])),V=[["日期","分类","项目","内容","耗时(分钟)","成果","待跟进","收获","备注"]];for(const ue of b)V.push([ue.date,Zo(ue.category),ue.project_id&&fe.get(ue.project_id)||"",ue.content,ue.minutes==null?"":ue.minutes,ue.is_milestone?"是":"",ue.needs_followup?"是":"",ue.takeaway||"",ue.remark||""]);const ae=await Vu("工作记录_"+de.replace(/-/g,"")+".csv",V);Fe(ae?"CSV 已导出到:"+ae:"CSV 已导出到系统下载目录")}async function it(){const de=xt(),v=await Promise.all([Lr(),Ci("2000-01-01",de)]),b=v[0],U=v[1],fe=["周日","周一","周二","周三","周四","周五","周六"],V=[["日期","星期","状态","上班时间","下班时间","地点","类型","说明"]];for(const ue of U){const ye=Ys(ue,ue.date,b,ue.date===de);V.push([ue.date,fe[is(ue.date).getDay()],ye.label,ue.clock_in_at?Un(ue.clock_in_at):"",ue.clock_out_at?Un(ue.clock_out_at):"",ue.location||"",ue.kind==="makeup"?"补卡":ue.kind==="leave"?"休假":"正常",ue.note||""])}const ae=await Vu("考勤记录_"+de.replace(/-/g,"")+".csv",V);Fe(ae?"CSV 已导出到:"+ae:"CSV 已导出到系统下载目录")}pn(Le);async function Ge(){await Lt("work_start",t.value.work_start),await Lt("work_end",t.value.work_end),await Lt("grace_minutes",String(t.value.grace_minutes)),await Lt("lunch_minutes",String(t.value.lunch_minutes)),await Lt("remind_weekly",t.value.remind_weekly),Fe("打卡规则已保存")}async function Qe(){await kd(a.value.split(`
`)),Fe("常用地点已保存")}async function Se(){const de=s.value.trim();if(de){try{await vm(de),o.value="",s.value=""}catch{o.value="项目名已存在"}await Le()}}function Z(de){g.value=de.id,y.value=de.name}async function ee(de){const v=y.value.trim();if(v)try{await hm(de.id,v),o.value=""}catch{o.value="项目名已存在"}g.value=null,await Le()}async function we(de){await mm(de.id,de.archived!==1),await Le()}async function Ke(){try{const de=await Nm(),v=await hl("实习日志备份_"+xt().replace(/-/g,"")+".json",de);Fe(v?"备份已导出到:"+v:"备份已导出到系统下载目录")}catch(de){Fe("导出失败:"+(de instanceof Error?de.message:String(de)))}}function dt(de){const v=de.target,b=v.files&&v.files[0];if(E.value="",!b)return;const U=b.name;b.text().then(fe=>{C.value={name:U,text:fe}}),v.value=""}async function Kt(){if(C.value)try{await Vm(C.value.text),C.value=null,E.value="",await Le(),Fe("数据导入完成")}catch(de){C.value=null,E.value=de instanceof Error?de.message:"导入失败"}}return(de,v)=>(S(),j("div",C1,[l("div",S1,[v[22]||(v[22]=l("div",{class:"section-title"},"账号与隐私",-1)),l("div",E1,"v"+te(Ut(Q))+" · 当前账号 "+te(B.value)+" · 登录密码仅存 PBKDF2 哈希",1),l("div",$1,[l("div",T1,[v[19]||(v[19]=l("label",null,"旧登录密码",-1)),Te(l("input",{type:"password",class:"input","onUpdate:modelValue":v[0]||(v[0]=b=>ne.value=b)},null,512),[[je,ne.value]])]),l("div",P1,[v[20]||(v[20]=l("label",null,"新登录密码(至少 6 位)",-1)),Te(l("input",{type:"password",class:"input","onUpdate:modelValue":v[1]||(v[1]=b=>re.value=b)},null,512),[[je,re.value]])]),l("div",A1,[v[21]||(v[21]=l("label",null,"确认新登录密码",-1)),Te(l("input",{type:"password",class:"input","onUpdate:modelValue":v[2]||(v[2]=b=>oe.value=b)},null,512),[[je,oe.value]])])]),$.value?(S(),j("div",O1,te($.value),1)):Ce("",!0),l("div",M1,[l("button",{class:"btn btn-primary btn-sm",onClick:Pe},"修改登录密码"),l("button",{class:"btn btn-sm btn-danger",onClick:v[3]||(v[3]=b=>M.value=!0)},"删除此用户及全部数据")])]),l("div",I1,[v[29]||(v[29]=l("div",{class:"section-title"},"打卡规则",-1)),l("div",j1,[l("div",D1,[v[23]||(v[23]=l("label",null,"上班时间",-1)),Te(l("input",{type:"time",class:"input","onUpdate:modelValue":v[4]||(v[4]=b=>t.value.work_start=b)},null,512),[[je,t.value.work_start]])]),l("div",L1,[v[24]||(v[24]=l("label",null,"下班时间",-1)),Te(l("input",{type:"time",class:"input","onUpdate:modelValue":v[5]||(v[5]=b=>t.value.work_end=b)},null,512),[[je,t.value.work_end]])]),l("div",R1,[v[25]||(v[25]=l("label",null,"迟到宽限(分钟)",-1)),Te(l("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":v[6]||(v[6]=b=>t.value.grace_minutes=b)},null,512),[[je,t.value.grace_minutes,void 0,{number:!0}]])]),l("div",K1,[v[26]||(v[26]=l("label",null,"午休扣除(分钟)",-1)),Te(l("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":v[7]||(v[7]=b=>t.value.lunch_minutes=b)},null,512),[[je,t.value.lunch_minutes,void 0,{number:!0}]])]),l("div",F1,[v[28]||(v[28]=l("label",null,"周记提醒",-1)),Te(l("select",{class:"select","onUpdate:modelValue":v[8]||(v[8]=b=>t.value.remind_weekly=b)},[...v[27]||(v[27]=[l("option",{value:"friday"},"每周五提醒",-1),l("option",{value:"off"},"关闭",-1)])],512),[[Vn,t.value.remind_weekly]])])]),l("div",{class:"rule-save"},[l("button",{class:"btn btn-primary btn-sm",onClick:Ge},"保存规则")])]),l("div",N1,[v[30]||(v[30]=l("div",{class:"section-title"},"项目管理",-1)),l("div",V1,[Te(l("input",{class:"input","onUpdate:modelValue":v[9]||(v[9]=b=>s.value=b),placeholder:"新项目名称",onKeydown:Ot(Se,["enter"])},null,544),[[je,s.value]]),l("button",{class:"btn btn-sm",onClick:Se},"添加")]),o.value?(S(),j("div",B1,te(o.value),1)):Ce("",!0),(S(!0),j(Ie,null,ot(n.value,b=>(S(),j("div",{key:b.id,class:"proj-row"},[g.value===b.id?(S(),j(Ie,{key:0},[Te(l("input",{class:"input","onUpdate:modelValue":v[10]||(v[10]=U=>y.value=U),onKeydown:Ot(U=>ee(b),["enter"])},null,40,U1),[[je,y.value]]),l("button",{class:"btn btn-sm",onClick:U=>ee(b)},"保存",8,q1),l("button",{class:"btn btn-sm",onClick:v[11]||(v[11]=U=>g.value=null)},"取消")],64)):(S(),j(Ie,{key:1},[l("span",{class:et(["proj-name",{archived:b.archived===1}])},te(b.name),3),l("button",{class:"icon-btn",title:"重命名",onClick:U=>Z(b)},[$e(Xe,{name:"edit",size:14})],8,H1),l("button",{class:"btn btn-sm",onClick:U=>we(b)},te(b.archived===1?"恢复":"归档"),9,W1)],64))]))),128)),n.value.length?Ce("",!0):(S(),j("div",z1,"暂无项目,先添加一个"))]),l("div",G1,[v[32]||(v[32]=l("div",{class:"section-title"},"常用地点",-1)),Te(l("textarea",{class:"textarea","onUpdate:modelValue":v[12]||(v[12]=b=>a.value=b),placeholder:"每行一个地点,如:公司、客户现场、出差、居家办公"},null,512),[[je,a.value]]),l("div",{class:"rule-save"},[l("button",{class:"btn btn-primary btn-sm",onClick:Qe},"保存地点"),v[31]||(v[31]=l("span",{class:"muted loc-note"},"打卡时可直接输入新地点,保存后自动加入列表",-1))])]),l("div",Y1,[v[33]||(v[33]=l("div",{class:"section-title"},"多端数据同步",-1)),l("div",J1,"云端账号:"+te(ce.value||"未绑定")+" · 数据存于服务器,其他端变更秒级自动刷新",1),l("div",X1,[l("button",{class:"btn btn-primary btn-sm",disabled:x.value,onClick:ke},te(x.value?"同步中":"立即同步"),9,Q1),l("button",{class:"btn btn-sm",onClick:W},"重新校验连接")]),ie.value?(S(),j("div",Z1,"上次同步:"+te(N.value||"--")+" · "+te(ie.value),1)):Ce("",!0),Y.value?(S(),j("div",e0,te(Y.value),1)):Ce("",!0),A.value?(S(),j("div",t0,"最近自动同步失败:"+te(A.value)+"(可点「立即同步」重试)",1)):Ce("",!0)]),l("div",n0,[v[38]||(v[38]=l("div",{class:"section-title"},"AI 润色配置(可选)",-1)),l("div",r0,[l("div",s0,[v[34]||(v[34]=l("label",null,"接口地址(OpenAI 兼容,到 /v1 为止)",-1)),Te(l("input",{class:"input","onUpdate:modelValue":v[13]||(v[13]=b=>c.value=b),placeholder:"https://api.example.com/v1"},null,512),[[je,c.value]])]),l("div",o0,[v[35]||(v[35]=l("label",null,"API Key",-1)),Te(l("input",{class:"input","onUpdate:modelValue":v[14]||(v[14]=b=>f.value=b),placeholder:"sk-..."},null,512),[[je,f.value]])]),l("div",i0,[v[36]||(v[36]=l("label",null,"模型名称",-1)),Te(l("input",{class:"input","onUpdate:modelValue":v[15]||(v[15]=b=>h.value=b),placeholder:"如:deepseek-chat"},null,512),[[je,h.value]])])]),l("div",{class:"rule-save"},[l("button",{class:"btn btn-primary btn-sm",onClick:qe},"保存 AI 配置"),v[37]||(v[37]=l("span",{class:"muted loc-note"},"配置仅保存在本机;总结页「AI 润色」需此处先配置",-1))])]),l("div",a0,[v[39]||(v[39]=l("div",{class:"section-title"},"数据备份",-1)),l("div",l0,[l("button",{class:"btn btn-sm",onClick:Ke},"导出 JSON 备份"),l("button",{class:"btn btn-sm",onClick:v[16]||(v[16]=b=>{var U;return(U=_.value)==null?void 0:U.click()})},"导入 JSON 备份"),l("button",{class:"btn btn-sm",onClick:Ne},"导出工作记录 CSV"),l("button",{class:"btn btn-sm",onClick:it},"导出考勤 CSV"),l("input",{ref_key:"fileInput",ref:_,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:dt},null,544)]),E.value?(S(),j("div",u0,te(E.value),1)):Ce("",!0),v[40]||(v[40]=l("div",{class:"muted backup-note"},"数据保存在云端服务器;导出的 JSON 备份用于跨设备迁移或灾后恢复。",-1))]),$e(qn,{open:!!C.value,title:"导入确认",message:C.value?"将从文件「"+C.value.name+"」导入备份。现有全部数据将被覆盖,且不可恢复,请先确认已导出当前备份。":"","confirm-text":"覆盖导入",danger:"",onCancel:v[17]||(v[17]=b=>C.value=null),onConfirm:Kt},null,8,["open","message"]),$e(qn,{open:M.value,title:"删除用户确认",message:"将永久删除云端账号「"+B.value+"」及其服务器上的全部数据:工作日志、考勤、备忘录、账号密码库都将被清除,任何设备都无法再取回,且不可恢复。请确认。","confirm-text":"永久删除",danger:"",onCancel:v[18]||(v[18]=b=>M.value=!1),onConfirm:Je},null,8,["open","message"])]))}}),d0=Wt(c0,[["__scopeId","data-v-904000ea"]]),f0={class:"admin-page"},p0={class:"card sec"},v0={class:"toolbar"},h0={key:0,class:"form-error"},m0={class:"card table-card admin-table-card"},y0={class:"admin-table"},g0={class:"td-name","data-label":"用户名"},b0={"data-label":"角色"},w0={key:0,class:"role-badge"},_0={key:1,class:"muted"},k0={class:"muted num","data-label":"创建时间"},x0={class:"muted num","data-label":"数据量"},C0={class:"td-ops"},S0={class:"ops"},E0=["onClick"],$0=["disabled","onClick"],T0={key:0},P0={key:0,class:"muted load-line"},A0={class:"dialog create-dialog",role:"dialog","aria-label":"新增用户"},O0={class:"dialog-head"},M0={class:"dialog-body"},I0={class:"form-row"},j0={class:"form-row"},D0={class:"form-row"},L0={key:0,class:"form-error"},R0={class:"dialog-btns"},K0=["disabled"],F0={class:"dialog create-dialog",role:"dialog","aria-label":"重置密码"},N0={class:"dialog-head"},V0={class:"dialog-title"},B0={class:"dialog-body"},U0={class:"form-row"},q0={key:0,class:"form-error"},H0={class:"dialog-btns"},W0=["disabled"],z0=Rt({__name:"UserAdminView",setup(e){const t=L([]),n=L(""),s=L(!0),o=L("");async function a(x,N){const le=await Rr();let W=xi();if(!W){const Pe=gn(),Je=await fetch(le+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:Pe==null?void 0:Pe.username,password:Pe==null?void 0:Pe.password})});if(Je.ok){const Le=await Je.json();W=String(Le.token||""),Ns(W)}}const ke=await fetch(le+x,{method:N?"POST":"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+W},body:N?JSON.stringify(N):void 0});if(ke.status===401&&gn()){const Pe=gn(),Je=await fetch(le+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:Pe==null?void 0:Pe.username,password:Pe==null?void 0:Pe.password})});if(Je.ok){const Le=await Je.json();W=String(Le.token||""),Ns(W);const qe=await fetch(le+x,{method:N?"POST":"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+W},body:N?JSON.stringify(N):void 0});return{ok:qe.ok,status:qe.status,data:await qe.json().catch(()=>({}))}}}return{ok:ke.ok,status:ke.status,data:await ke.json().catch(()=>({}))}}async function c(){s.value=!0,o.value="";const x=await a("/api/admin/users");if(!x.ok){s.value=!1,o.value=x.data&&x.data.error||"加载失败 "+x.status;return}t.value=x.data.users||[],n.value=x.data.me||"",s.value=!1}function f(x){return x<=0?"--":x<1024?x+" B":x<1024*1024?(x/1024).toFixed(1)+" KB":(x/1024/1024).toFixed(2)+" MB"}function h(x){return(x||"").slice(0,10)}const g=L(!1),y=L(""),_=L(""),C=L(""),E=L(""),B=L(!1);function ne(){g.value=!0,E.value="",y.value="",_.value="",C.value=""}async function re(){const x=y.value.trim();if(_.value!==C.value){E.value="两次输入的密码不一致";return}if(_.value.length<6){E.value="密码至少 6 位";return}B.value=!0;const N=await a("/api/admin/users/create",{username:x,password:_.value});if(B.value=!1,!N.ok){E.value=N.data&&N.data.error||"创建失败 "+N.status;return}Fe("用户「"+x+"」已创建"),g.value=!1,await c()}const oe=L(null),$=L(""),M=L(""),Q=L(!1);function ce(x){oe.value=x,$.value="",M.value=""}async function ie(){if(!oe.value)return;if($.value.length<6){M.value="密码至少 6 位";return}Q.value=!0;const x=await a("/api/admin/users/password",{userId:oe.value.id,newPassword:$.value});if(Q.value=!1,!x.ok){M.value=x.data&&x.data.error||"重置失败 "+x.status;return}Fe("已重置「"+oe.value.username+"」的登录密码"),oe.value=null}const Y=L(null);async function A(){if(!Y.value)return;const x=await a("/api/admin/users/delete",{userId:Y.value.id});if(!x.ok){Y.value=null,Fe(x.data&&x.data.error||"删除失败");return}Fe("已删除账号「"+Y.value.username+"」及其全部云端数据"),Y.value=null,await c()}return pn(c),(x,N)=>(S(),j("div",f0,[l("div",p0,[l("div",v0,[N[12]||(N[12]=l("div",{class:"head-wrap"},[l("div",{class:"sec-title"},"用户管理"),l("div",{class:"muted head-sub"},"云端账号统一管理 · 管理员:xionglin")],-1)),l("button",{class:"btn btn-primary btn-sm",onClick:ne},[$e(Xe,{name:"plus",size:14}),N[11]||(N[11]=en(" 新增用户 ",-1))])]),o.value?(S(),j("div",h0,te(o.value),1)):Ce("",!0)]),l("div",m0,[l("table",y0,[N[14]||(N[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,[(S(!0),j(Ie,null,ot(t.value,le=>(S(),j("tr",{key:le.id},[l("td",g0,te(le.username),1),l("td",b0,[le.role==="admin"?(S(),j("span",w0,"管理员")):(S(),j("span",_0,"普通用户"))]),l("td",k0,te(h(le.created_at)),1),l("td",x0,te(f(le.data_bytes)),1),l("td",C0,[l("div",S0,[l("button",{class:"btn btn-xs",onClick:W=>ce(le)},"重置密码",8,E0),l("button",{class:"btn btn-xs btn-danger",disabled:le.id===n.value,onClick:W=>Y.value=le},"删除",8,$0)])])]))),128)),!s.value&&!t.value.length?(S(),j("tr",T0,[...N[13]||(N[13]=[l("td",{colspan:"5",class:"empty muted"},"加载结果为空",-1)])])):Ce("",!0)])]),s.value?(S(),j("div",P0,"加载中")):Ce("",!0)]),N[20]||(N[20]=l("div",{class:"muted admin-note"},"重置密码立即生效;删除账号将移除其全部云端数据,不可恢复。自己的账号不能删除。",-1)),(S(),At(jr,{to:"body"},[g.value?(S(),j("div",{key:0,class:"fixed-mask",onClick:N[5]||(N[5]=sn(le=>g.value=!1,["self"]))},[l("div",A0,[l("div",O0,[N[15]||(N[15]=l("span",{class:"dialog-title"},"新增用户",-1)),l("button",{class:"icon-btn",onClick:N[0]||(N[0]=le=>g.value=!1)},[$e(Xe,{name:"close",size:16})])]),l("div",M0,[l("div",I0,[N[16]||(N[16]=l("label",null,"用户名(2 到 20 个字符)",-1)),Te(l("input",{class:"input","onUpdate:modelValue":N[1]||(N[1]=le=>y.value=le),placeholder:"如:xiaowang"},null,512),[[je,y.value]])]),l("div",j0,[N[17]||(N[17]=l("label",null,"初始登录密码(至少 6 位)",-1)),Te(l("input",{class:"input",type:"password","onUpdate:modelValue":N[2]||(N[2]=le=>_.value=le),placeholder:"转发给使用者,登录后可自行修改"},null,512),[[je,_.value]])]),l("div",D0,[N[18]||(N[18]=l("label",null,"确认密码",-1)),Te(l("input",{class:"input",type:"password","onUpdate:modelValue":N[3]||(N[3]=le=>C.value=le),onKeydown:Ot(re,["enter"])},null,544),[[je,C.value]])]),E.value?(S(),j("div",L0,te(E.value),1)):Ce("",!0)]),l("div",R0,[l("button",{class:"btn btn-sm",onClick:N[4]||(N[4]=le=>g.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",disabled:B.value||!y.value.trim(),onClick:re},te(B.value?"创建中":"创建"),9,K0)])])])):Ce("",!0)])),(S(),At(jr,{to:"body"},[oe.value?(S(),j("div",{key:0,class:"fixed-mask",onClick:N[9]||(N[9]=sn(le=>oe.value=null,["self"]))},[l("div",F0,[l("div",N0,[l("span",V0,"重置「"+te(oe.value.username)+"」的登录密码",1),l("button",{class:"icon-btn",onClick:N[6]||(N[6]=le=>oe.value=null)},[$e(Xe,{name:"close",size:16})])]),l("div",B0,[l("div",U0,[N[19]||(N[19]=l("label",null,"新登录密码(至少 6 位)",-1)),Te(l("input",{class:"input",type:"password","onUpdate:modelValue":N[7]||(N[7]=le=>$.value=le),onKeydown:Ot(ie,["enter"])},null,544),[[je,$.value]])]),M.value?(S(),j("div",q0,te(M.value),1)):Ce("",!0)]),l("div",H0,[l("button",{class:"btn btn-sm",onClick:N[8]||(N[8]=le=>oe.value=null)},"取消"),l("button",{class:"btn btn-primary btn-sm",disabled:Q.value,onClick:ie},te(Q.value?"提交中":"重置"),9,W0)])])])):Ce("",!0)])),$e(qn,{open:!!Y.value,title:"删除用户确认",message:Y.value?"将永久删除云端账号「"+Y.value.username+"」及其服务器上的全部数据,不可恢复。请确认。":"","confirm-text":"永久删除",danger:"",onCancel:N[10]||(N[10]=le=>Y.value=null),onConfirm:A},null,8,["open","message"])]))}}),G0=Wt(z0,[["__scopeId","data-v-06be07ff"]]),Y0={class:"login-page"},J0={class:"card login-card"},X0={class:"login-brand"},Q0={class:"brand-icon"},Z0={class:"seg"},ek=["placeholder"],tk={key:1,class:"form-error"},nk=["disabled"],rk=Rt({__name:"LoginView",emits:["login"],setup(e,{emit:t}){const n=t,s=L("login"),o=L(""),a=L(""),c=L(""),f=L(""),h=L(!1);function g(_){s.value=_,f.value="",c.value=""}async function y(){if(!h.value){f.value="",h.value=!0;try{let _;if(s.value==="login")_=await Nh(o.value,a.value);else{if(a.value.length<6){f.value="登录密码至少 6 位",h.value=!1;return}if(a.value!==c.value){f.value="两次输入的密码不一致",h.value=!1;return}_=await Vh(o.value,a.value)}n("login",_)}catch(_){f.value=_ instanceof Error?_.message:"操作失败"}h.value=!1}}return(_,C)=>(S(),j("div",Y0,[l("div",J0,[l("div",X0,[l("div",Q0,[$e(Xe,{name:"calendar",size:22})]),C[5]||(C[5]=l("div",{class:"login-title"},"实习工作日志",-1)),C[6]||(C[6]=l("div",{class:"muted login-sub"},"打卡 · 记录 · 总结 · 备忘录 · 密码库",-1)),C[7]||(C[7]=l("div",{class:"muted login-sub"},"数据保存在云端服务器,所有设备登录同一账号即可实时同步",-1))]),l("div",Z0,[l("button",{class:et(["seg-btn",{active:s.value==="login"}]),onClick:C[0]||(C[0]=E=>g("login"))},"登录",2),l("button",{class:et(["seg-btn",{active:s.value==="create"}]),onClick:C[1]||(C[1]=E=>g("create"))},"创建用户",2)]),Te(l("input",{class:"input","onUpdate:modelValue":C[2]||(C[2]=E=>o.value=E),placeholder:"用户名(2 到 20 个字符)",onKeydown:Ot(y,["enter"])},null,544),[[je,o.value]]),Te(l("input",{type:"password",class:"input","onUpdate:modelValue":C[3]||(C[3]=E=>a.value=E),placeholder:s.value==="login"?"登录密码":"设置登录密码(至少 6 位)",onKeydown:Ot(y,["enter"])},null,40,ek),[[je,a.value]]),s.value==="create"?Te((S(),j("input",{key:0,type:"password",class:"input","onUpdate:modelValue":C[4]||(C[4]=E=>c.value=E),placeholder:"再次输入密码",onKeydown:Ot(y,["enter"])},null,544)),[[je,c.value]]):Ce("",!0),f.value?(S(),j("div",tk,te(f.value),1)):Ce("",!0),l("button",{class:"btn btn-primary login-btn",disabled:h.value,onClick:y},te(s.value==="login"?"登录":"创建并进入"),9,nk),C[8]||(C[8]=l("div",{class:"muted login-note"}," 登录密码仅服务器保存哈希;本机保存加密的自动登录凭据,登录后无需重复输入 ",-1))])]))}}),sk=Wt(rk,[["__scopeId","data-v-bf714afa"]]),ok={key:1,class:"app"},ik={class:"side"},ak={key:0,class:"nav-sep"},lk=["data-tip","onClick"],uk={class:"main"},ck={class:"topbar"},dk={class:"title"},fk={class:"gsearch"},pk={key:0,class:"gs-panel"},vk={key:0,class:"gs-group muted"},hk=["onMousedown"],mk={class:"tag"},yk={class:"gs-text"},gk={class:"muted num gs-date"},bk={key:1,class:"gs-group muted"},wk=["onMousedown"],_k={class:"gs-text"},kk={class:"muted gs-sub"},xk={key:1,class:"gs-empty muted"},Ck={class:"topbar-actions"},Sk={class:"user-chip num mobile-hide"},Ek=["disabled"],$k={class:"num"},Tk={class:"content"},Pk={class:"content-inner"},Ak={class:"tabbar"},Ok=["onClick"],Mk={class:"sheet-user num"},Ik=["onClick"],jk={class:"sheet-name"},Dk={class:"msw"},Lk={class:"msw-bar"},Rk={class:"msw-results"},Kk={key:0,class:"gs-group muted"},Fk=["onMousedown"],Nk={class:"tag"},Vk={class:"gs-text"},Bk={class:"muted num gs-date"},Uk={key:1,class:"gs-group muted"},qk=["onMousedown"],Hk={class:"gs-text"},Wk={class:"muted gs-sub"},zk={key:1,class:"gs-empty muted"},Gk={class:"toast-wrap"},Yk=Rt({__name:"App",setup(e){const t=Um(),n=L(Vs());async function s(v){n.value=v,oi(v.userId),location.hash="#/calendar",ce.value="calendar",await ee(),await de(),c();try{await md(),await Zr()}catch{}Fe("欢迎,"+v.username);const b=sessionStorage.getItem("dsh_migrate_toast");b&&(sessionStorage.removeItem("dsh_migrate_toast"),Fe("已迁移原有数据 "+b+" 条"))}async function o(){Le.value=!1,Pe.value=!1,nm(),a!==null&&(window.clearInterval(a),a=null),await Uh(),n.value=null,ce.value="calendar",location.hash="#/calendar",Fe("已退出登录")}let a=null;function c(){tm(),a!==null&&window.clearInterval(a),a=window.setInterval(()=>{Zr()},60*1e3),Zr()}const f=L(null),h=L(""),g=L(!1),y=L({logs:[],memos:[]});let _=null;const C=st(()=>!!(y.value.logs.length||y.value.memos.length));function E(){_&&window.clearTimeout(_);const v=h.value;_=window.setTimeout(async()=>{const b=v.trim();if(!b){y.value={logs:[],memos:[]};return}const U=await Promise.all([Im(b,8),jm(b,4)]);y.value={logs:U[0],memos:U[1]}},200)}function B(){h.value="",y.value={logs:[],memos:[]},g.value=!1}function ne(v){Ka.value=v.date,ie("calendar"),B()}function re(v){Fa.value=v.id,ie("memo"),B()}function oe(){window.setTimeout(()=>{g.value=!1},150)}function $(v){var b;(v.ctrlKey||v.metaKey)&&v.key.toLowerCase()==="k"&&(v.preventDefault(),(b=f.value)==null||b.focus())}const M=[{key:"calendar",name:"日历",icon:"calendar",group:"记录"},{key:"today",name:"详情",icon:"edit",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 Q(){var b;const v=(location.hash||"").replace("#/","");return!M.some(U=>U.key===v)||v==="admin"&&(((b=Vs())==null?void 0:b.username)||"")!=="xionglin"?"calendar":v}const ce=L(Q());window.addEventListener("hashchange",()=>{ce.value=Q()});function ie(v){location.hash="#/"+v}const Y=st(()=>M.find(v=>v.key===ce.value)||M[0]),A=st(()=>{var v;return(((v=n.value)==null?void 0:v.username)||"")==="xionglin"}),x=st(()=>A.value?M:M.filter(v=>v.key!=="admin")),N=st(()=>{const v=M.filter(b=>!W.includes(b.key));return A.value?v:v.filter(b=>b.key!=="admin")}),le=st(()=>N.value.some(v=>v.key===ce.value));ht([A,ce],()=>{ce.value==="admin"&&!A.value&&ie("calendar")},{immediate:!0});const W=["calendar","today","ledger","memo"],ke=M.filter(v=>W.includes(v.key)),Pe=L(!1);function Je(v){Pe.value=!1,ie(v)}const Le=L(!1),qe=L(null);function Ne(){Le.value=!0,window.setTimeout(()=>{var v;return(v=qe.value)==null?void 0:v.focus()},60)}function it(v){ne(v),Le.value=!1}function Ge(v){re(v),Le.value=!1}const Qe=L(xt()),Se=L(void 0),Z=L(!1);async function ee(){if(Se.value=await bn(Qe.value),Z.value=!1,new Date().getHours()<4){const b=await bn(Nn(Qe.value,-1));Z.value=!!(b&&b.clock_in_at&&!b.clock_out_at)}}const we=st(()=>{const v=Se.value;return v&&v.clock_in_at&&!v.clock_out_at?!0:Z.value&&!(v&&v.clock_in_at)}),Ke=st(()=>{const v=Se.value;return!!(v&&v.clock_in_at&&v.clock_out_at)}),dt=st(()=>{const v=Se.value;return we.value?"下班打卡":Ke.value?"已打卡 "+Un(v==null?void 0:v.clock_in_at)+" - "+Un(v==null?void 0:v.clock_out_at):"上班打卡"});async function Kt(){if(we.value)try{await gm()}catch{}else await xd(Qe.value);await ee(),rr()}ht(Gs,()=>{n.value&&ee()});const Tt=L(!1);async function de(){if((await Lr()).remind_weekly==="off"){Tt.value=!1;return}const b=new Date().getDay();if(b===5||b===6||b===0){const U=await vl(Ps(Qe.value));Tt.value=!U||!U.highlights&&!U.challenges&&!U.plan_next}else Tt.value=!1}return pn(async()=>{window.addEventListener("keydown",$),n.value&&(oi(n.value.userId),await ee(),await de(),c())}),(v,b)=>{var U,fe;return n.value?(S(),j("div",ok,[l("nav",ik,[(S(!0),j(Ie,null,ot(x.value,(V,ae)=>(S(),j(Ie,{key:V.key},[ae>0&&V.group!==x.value[ae-1].group?(S(),j("div",ak)):Ce("",!0),l("button",{class:et(["nav-btn",{active:ce.value===V.key}]),"data-tip":V.name,onClick:ue=>ie(V.key)},[$e(Xe,{name:V.icon,size:18},null,8,["name"])],10,lk)],64))),128))]),l("div",uk,[l("header",ck,[l("span",dk,te(Y.value.name),1),l("button",{class:"mob-search-btn",title:"搜索",onClick:Ne},[$e(Xe,{name:"search",size:16})]),l("div",fk,[$e(Xe,{name:"search",size:14,class:"gs-icon"}),Te(l("input",{ref_key:"gsInput",ref:f,class:"input gs-input","onUpdate:modelValue":b[0]||(b[0]=V=>h.value=V),placeholder:"搜索工作记录与备忘录(Ctrl+K)",onInput:E,onFocus:b[1]||(b[1]=V=>g.value=!0),onBlur:oe,onKeydown:Ot(B,["esc"])},null,544),[[je,h.value]]),g.value&&h.value.trim()?(S(),j("div",pk,[C.value?(S(),j(Ie,{key:0},[y.value.logs.length?(S(),j("div",vk,"工作记录")):Ce("",!0),(S(!0),j(Ie,null,ot(y.value.logs,V=>(S(),j("div",{key:"l"+V.id,class:"gs-item",onMousedown:sn(ae=>ne(V),["prevent"])},[l("span",mk,te(Ut(Zo)(V.category)),1),l("span",yk,te(V.content),1),l("span",gk,te(V.date),1)],40,hk))),128)),y.value.memos.length?(S(),j("div",bk,"备忘录")):Ce("",!0),(S(!0),j(Ie,null,ot(y.value.memos,V=>(S(),j("div",{key:"m"+V.id,class:"gs-item",onMousedown:sn(ae=>re(V),["prevent"])},[l("span",_k,te(V.title||"无标题"),1),l("span",kk,te(V.content),1)],40,wk))),128))],64)):(S(),j("div",xk,"无匹配结果"))])):Ce("",!0)]),b[12]||(b[12]=l("span",{class:"flex1"},null,-1)),l("div",Ck,[Tt.value?(S(),j("button",{key:0,class:"week-tip",onClick:b[2]||(b[2]=V=>ie("report"))},[...b[11]||(b[11]=[l("span",{class:"dot",style:{background:"var(--warn)"}},null,-1),en(" 填写本周周记 ",-1)])])):Ce("",!0),l("span",Sk,te((U=n.value)==null?void 0:U.username),1),l("button",{class:"btn btn-sm mobile-hide",onClick:o},"退出"),l("button",{class:"btn btn-primary btn-sm",disabled:Ke.value,onClick:Kt},[$e(Xe,{name:Ke.value?"check-circle":"clock",size:14},null,8,["name"]),l("span",$k,te(dt.value),1)],8,Ek)])]),l("main",Tk,[l("div",Pk,[ce.value==="calendar"?(S(),At(fg,{key:0})):ce.value==="today"?(S(),At(gg,{key:1})):ce.value==="stats"?(S(),At(Yg,{key:2})):ce.value==="report"?(S(),At(Gb,{key:3})):ce.value==="ledger"?(S(),At(l_,{key:4})):ce.value==="memo"?(S(),At(E_,{key:5})):ce.value==="vault"?(S(),At(k1,{key:6})):ce.value==="admin"?(S(),At(G0,{key:7})):(S(),At(d0,{key:8}))])]),l("nav",Ak,[(S(!0),j(Ie,null,ot(Ut(ke),V=>(S(),j("button",{key:V.key,class:et(["tab-btn",{active:ce.value===V.key}]),onClick:ae=>ie(V.key)},[$e(Xe,{name:V.icon,size:20},null,8,["name"]),l("span",null,te(V.name),1)],10,Ok))),128)),l("button",{class:et(["tab-btn",{active:le.value}]),onClick:b[3]||(b[3]=V=>Pe.value=!0)},[$e(Xe,{name:"more",size:20}),b[13]||(b[13]=l("span",null,"更多",-1))],2)]),Pe.value?(S(),j("div",{key:0,class:"sheet-mask",onClick:b[6]||(b[6]=V=>Pe.value=!1)},[l("div",{class:"more-sheet",onClick:b[5]||(b[5]=sn(()=>{},["stop"]))},[l("div",Mk,te((fe=n.value)==null?void 0:fe.username),1),(S(!0),j(Ie,null,ot(N.value,V=>(S(),j("button",{key:V.key,class:"sheet-row",onClick:ae=>Je(V.key)},[$e(Xe,{name:V.icon,size:18},null,8,["name"]),l("span",jk,te(V.name),1),$e(Xe,{name:"chevron-right",size:14,class:"sheet-go"})],8,Ik))),128)),b[15]||(b[15]=l("div",{class:"sheet-divider"},null,-1)),l("button",{class:"sheet-row sheet-danger",onClick:b[4]||(b[4]=V=>{Pe.value=!1,o()})},[$e(Xe,{name:"close",size:18}),b[14]||(b[14]=l("span",{class:"sheet-name"},"退出登录",-1))])])])):Ce("",!0),Le.value?(S(),j("div",{key:1,class:"msw-mask",onClick:b[10]||(b[10]=sn(V=>Le.value=!1,["self"]))},[l("div",Dk,[l("div",Lk,[$e(Xe,{name:"search",size:16,class:"msw-icon"}),Te(l("input",{ref_key:"msInput",ref:qe,class:"msw-input","onUpdate:modelValue":b[7]||(b[7]=V=>h.value=V),placeholder:"搜索工作记录与备忘录",onInput:E,onKeydown:b[8]||(b[8]=Ot(V=>Le.value=!1,["esc"]))},null,544),[[je,h.value]]),l("button",{class:"icon-btn",onClick:b[9]||(b[9]=V=>{B(),Le.value=!1})},[$e(Xe,{name:"close",size:16})])]),l("div",Rk,[C.value?(S(),j(Ie,{key:0},[y.value.logs.length?(S(),j("div",Kk,"工作记录")):Ce("",!0),(S(!0),j(Ie,null,ot(y.value.logs,V=>(S(),j("div",{key:"l"+V.id,class:"msw-item",onMousedown:sn(ae=>it(V),["prevent"])},[l("span",Nk,te(Ut(Zo)(V.category)),1),l("span",Vk,te(V.content),1),l("span",Bk,te(V.date),1)],40,Fk))),128)),y.value.memos.length?(S(),j("div",Uk,"备忘录")):Ce("",!0),(S(!0),j(Ie,null,ot(y.value.memos,V=>(S(),j("div",{key:"m"+V.id,class:"msw-item",onMousedown:sn(ae=>Ge(V),["prevent"])},[l("span",Hk,te(V.title||"无标题"),1),l("span",Wk,te(V.content),1)],40,qk))),128))],64)):h.value.trim()?(S(),j("div",zk,"无匹配结果")):Ce("",!0)])])])):Ce("",!0)]),l("div",Gk,[$e(kv,{name:"toast"},{default:fr(()=>[(S(!0),j(Ie,null,ot(Ut(t),V=>(S(),j("div",{key:V.id,class:"toast"},te(V.text),1))),128))]),_:1})])])):(S(),At(sk,{key:0,onLogin:s}))}}}),Jk=Wt(Yk,[["__scopeId","data-v-4b4a9c88"]]);function Ko(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",a=>{a.target===n&&n.parentElement&&n.parentElement.removeChild(n)}),document.body.appendChild(n));const s=document.createElement("div");s.style.cssText="border:1px solid #E5484D;border-radius:8px;padding:12px;margin-bottom:12px;word-break:break-all;white-space:pre-wrap;",s.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(s),n.appendChild(o)}catch{}}async function Xk(){const e=await Bh();e&&oi(e.userId);const t=Rv(Jk);t.config.errorHandler=(n,s,o)=>{const a=n;Ko("应用内部错误(点击空白处关闭,请将以下内容发送给开发者)",a&&(a.stack||a.message)||String(n)+`
触发位置: `+o)},window.addEventListener("unhandledrejection",n=>{const s=n.reason;Ko("未处理的异步错误(点击空白处关闭)",s&&(s.stack||s.message)||String(n.reason))}),window.addEventListener("error",n=>{n.message&&n.message!=="ResizeObserver loop limit exceeded"&&Ko("运行错误(点击空白处关闭)",n.message)}),t.mount("#app"),"serviceWorker"in navigator&&location.protocol.startsWith("http")&&window.addEventListener("load",()=>{navigator.serviceWorker.register("sw.js").catch(()=>{})})}Xk().catch(e=>{Ko("无法启动:连接同步服务器失败",e&&(e.stack||e.message)||String(e))});export{Td as W,Sd as _,ub as b,$d as r};