@arbocollab/arbo-web-scene 1.26.10 → 1.26.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/umd/index.umd.js CHANGED
@@ -37,7 +37,7 @@ Only state can be modified.`);o[0]="$state",eP=!1,r.set(i,o,r.state.value),eP=!0
37
37
  state: () => new MyClass()
38
38
  Found in store "${E.$id}".`),g&&i&&n.hydrate&&n.hydrate(E.$state,g),u=!0,c=!0,E}/*! #__NO_SIDE_EFFECTS__ */function Y_(e,t,n){let r;const a=typeof t=="function";r=a?n:t;function i(o,s){const l=Ny();if(o=(ze.env.NODE_ENV==="test"&&ZA&&ZA._testing?null:o)||(l?Br(zq,null):null),o&&eU(o),ze.env.NODE_ENV!=="production"&&!ZA)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
39
39
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
40
- This will fail in production.`);o=ZA,o._s.has(e)||(a?Tde(e,t,r,o):TVe(e,r,o),ze.env.NODE_ENV!=="production"&&(i._pinia=o));const u=o._s.get(e);if(ze.env.NODE_ENV!=="production"&&s){const c="__hot:"+e,d=a?Tde(c,t,r,o,!0):TVe(c,Uy({},r),o,!0);s._hotUpdate(d),delete o.state.value[c],o._s.delete(c)}if(ze.env.NODE_ENV!=="production"&&AS){const c=_a();if(c&&c.proxy&&!s){const d=c.proxy,p="_pStores"in d?d._pStores:d._pStores={};p[e]=u}}return u}return i.$id=e,i}function sr(e){const t=ra(e),n={};for(const r in t){const a=t[r];a.effect?n[r]=z({get:()=>e[r],set(i){e[r]=i}}):(Or(a)||Tl(a))&&(n[r]=os(e,r))}return n}function E7t(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(t,n){(e.get(t)||[]).slice().map(function(r){r(n)}),(e.get("*")||[]).slice().map(function(r){r(t,n)})}}}function Dde(e,t,n){if(!n)return t;const r=e==null?void 0:e[n];if(r==null)throw new Error(`Key is ${r} on item (keyField is '${n}')`);return r}function eO(e,t){return e.map((n,r)=>Dde(n,r,t))}function x7t(e,t,n){const r=[],a=[];for(let i=0;i<e.length;i++){const o=e[i],s=Dde(o,i,t),l=n(o,i,s);r.push(s),a.push(typeof l=="number"&&l>0?l:null)}return{keys:r,sizes:a}}function T7t(e,t,n){if(!e||e.keys.length!==t.length||e.sizes.length!==t.length)return!1;for(let r=0;r<t.length;r++)if(e.keys[r]!==Dde(t[r],r,n))return!1;return!0}function Ade(e,t,n){if(!T7t(e,t,n))return{};const r={};for(let a=0;a<e.keys.length;a++){const i=e.sizes[a];typeof i=="number"&&i>0&&(r[e.keys[a]]=i)}return r}function DVe(e,t){if(!e.length||t.length<=e.length)return 0;const n=e[0],r=t.indexOf(n);if(r<=0||r+e.length<t.length&&e.length>t.length-r)return 0;for(let a=0;a<e.length;a++)if(t[r+a]!==e[a])return 0;return r}function AVe(e,t,n,r,a,i=0){const o=a??"start";if(o==="nearest"){const s=n+r,l=e+t;return e>=n&&l<=s?null:e<n?e+i:l-r+i}return o==="end"?e+t-r+i:o==="center"?e+(t-r)/2+i:e+i}function OVe(e,t,n,r){let a=null,i=null,o=null,s=!1,l=null;const u=[],c=n.resizeObserver?()=>{}:n.onVscrollUpdate(b),d=z(()=>{const B=xn(e);if(n.vscrollData.simpleArray){if(B.index==null)throw new Error("index is required when using simple-array mode with dynamic item measurement");return B.index}if(n.vscrollData.keyField in B.item)return B.item[n.vscrollData.keyField];throw new Error(`keyField '${n.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`)}),p=z(()=>n.vscrollData.sizes[d.value]||0),h=z(()=>xn(e).active&&n.vscrollData.active);function g(){h.value?i!==d.value&&(i=d.value,a=null,o=null,y(d.value)):a=d.value}function v(){xn(e).watchData&&!n.resizeObserver?l=lt(()=>xn(e).item,()=>{_()},{deep:!0}):l&&(l(),l=null)}function b({force:B}){!h.value&&B&&(o=d.value),(a===d.value||B||!p.value)&&g()}function _(){g()}function C(B){n.undefinedMap[B]&&n.undefinedSizeCount.value--,n.undefinedMap[B]=void 0}function S(B,P){if(n.vscrollData.sizes[B]){C(B);return}if(P){n.undefinedMap[B]||n.undefinedSizeCount.value++,n.undefinedMap[B]=!0;return}n.undefinedMap[B]&&(n.undefinedSizeCount.value--,n.undefinedMap[B]=!1)}function y(B){Ct(()=>{if(d.value===B){const P=xn(t);if(!P)return;const $=P.offsetWidth,V=P.offsetHeight;T($,V)}i=null})}function T(B,P){const $=~~(n.direction.value==="vertical"?P:B);$&&p.value!==$&&k($)}function k(B){var P,$;C(d.value),n.vscrollData.sizes[d.value]=B,xn(e).emitResize&&(($=(P=xn(r))==null?void 0:P.onResize)==null||$.call(P,d.value))}function E(){if(!n.resizeObserver||s)return;const B=xn(t);B&&(n.resizeObserver.observe(B),B.$_vs_id=d.value,B.$_vs_onResize=D,s=!0)}function I(){if(!n.resizeObserver||!s)return;const B=xn(t);B&&(n.resizeObserver.unobserve(B),B.$_vs_onResize=void 0,s=!1)}function D(B,P,$){d.value===B&&T(P,$)}u.push(lt(()=>xn(e).watchData,()=>{v()})),n.resizeObserver||u.push(lt(()=>xn(e).sizeDependencies,()=>{_()},{deep:!0})),u.push(lt(d,(B,P)=>{const $=xn(t);$&&($.$_vs_id=B),C(P),S(B,h.value);const V=n.vscrollData.sizes[B];if(!V){a=B,_();return}C(B),s&&(n.vscrollData.sizes[B]=V)})),u.push(lt(h,B=>{S(d.value,B),n.resizeObserver?B?E():I():B&&o===d.value&&g()})),v();function A(){h.value&&(g(),E())}function R(){c(),I(),C(d.value);const B=xn(t);B&&(B.$_vs_id=void 0,B.$_vs_onResize=void 0),l&&(l(),l=null);for(const P of u)P();u.length=0}return{id:d,size:p,finalActive:h,updateSize:g,mount:A,unmount:R}}const IVe={itemsLimit:1e3};function RVe(e){return typeof window<"u"&&e===window}const D7t=(()=>{if(typeof document>"u")return"negative";const e=document.createElement("div"),t=document.createElement("div");e.style.width="4px",e.style.height="1px",e.style.overflow="auto",e.style.direction="rtl",t.style.width="8px",t.style.height="1px",e.appendChild(t),document.body.appendChild(e),e.scrollLeft=-1;const n=e.scrollLeft<0;return document.body.removeChild(e),n?"negative":"default"})();function nP(e,t,n){return t!=="horizontal"||!n||RVe(n)||getComputedStyle(n).direction!=="rtl"?e:D7t==="negative"?-e:e}function A7t(e,t,n){return nP(e,t,n)}function Ode(e,t,n,r){const a=A7t(n,t,e),i=!!(r!=null&&r.smooth);if(RVe(e)){t==="vertical"?e.scrollTo({top:a,behavior:i?"smooth":"auto"}):e.scrollTo({left:a,behavior:i?"smooth":"auto"});return}if(typeof e.scrollTo=="function"){e.scrollTo(t==="vertical"?{top:a,behavior:i?"smooth":"auto"}:{left:a,behavior:i?"smooth":"auto"});return}t==="vertical"?e.scrollTop=a:e.scrollLeft=a}function O7t(e,t,n){return n?t==="vertical"?window.innerHeight:window.innerWidth:t==="vertical"?e.clientHeight:e.clientWidth}const I7t=/auto|scroll/;function $Ve(e,t){return e.parentNode===null?t:$Ve(e.parentNode,[...t,e])}function Ide(e,t){return getComputedStyle(e,null).getPropertyValue(t)}function R7t(e){return Ide(e,"overflow")+Ide(e,"overflow-y")+Ide(e,"overflow-x")}function $7t(e){return I7t.test(R7t(e))}function Jq(e){if(!(e instanceof HTMLElement||e instanceof SVGElement))return;const t=$Ve(e.parentNode,[]);for(let n=0;n<t.length;n+=1)if(t[n]instanceof Element&&$7t(t[n]))return t[n];return document.scrollingElement||document.documentElement}let Rde=!1;function P7t(){return Rde}if(typeof window<"u"){Rde=!1;try{const e=Object.defineProperty({},"passive",{get(){Rde=!0}});window.addEventListener("test",null,e)}catch{}}let M7t=0;function $de(e){const t=e;t._vs_styleStamp++}function N7t(e,t,n){const r=e==null?void 0:e[n];if(r==null)throw new Error(`Key is ${r} on item (keyField is '${n}')`);return r}function Pde(e,t,n,r,a){const i=W([]),o=W(0),s=W(!1);let l=0,u=0;const c=new Map,d=new Map;let p=!1,h=0,g=0,v=!1,b=null,_=null,C=null,S=0,y=null,T=[],k=null,E=null,I=null,D=!1;const A=new Set,R=W({}),B=z(()=>{const _t=xn(e);return _t.items.length>0&&typeof _t.items[0]!="object"}),P=z(()=>{const _t=xn(e);if(_t.itemSize===null){const Et={[-1]:{accumulator:0}},qt=_t.items,le=_t.sizeField??"size",we=_t.minItemSize,Xe=R.value;let rt=1e4,He=0,$e;for(let kt=0,Gt=qt.length;kt<Gt;kt++){const Ut=B.value?kt:N7t(qt[kt],kt,_t.keyField);$e=Xe[Ut]||qt[kt][le]||we,$e<rt&&(rt=$e),He+=$e,Et[kt]={accumulator:He,size:$e}}return S=rt,Et}return[]}),$=z(()=>i.value.filter(_t=>_t.nr.used).sort((_t,Et)=>_t.nr.index-Et.nr.index)),V=z(()=>{const _t=xn(e),Et=B.value?null:_t.keyField;return x7t(_t.items,Et,(qt,le,we)=>_t.itemSize!=null?_t.itemSize:R.value[we]||(qt==null?void 0:qt[_t.sizeField??"size"])||void 0)});function N(_t){const Et=xn(e);return R.value=Ade(_t,Et.items,B.value?null:Et.keyField),Object.keys(R.value).length>0}function q(_t){let Et=d.get(_t);return Et||(Et=[],d.set(_t,Et)),Et}function J(_t,Et,qt,le,we){const Xe=Ms({id:M7t++,index:Et,used:!0,key:le,type:we}),rt=ALe({item:qt,position:0,offset:0,nr:Xe,_vs_styleStamp:0});return _t.push(rt),rt}function ie(_t){const Et=q(_t);if(Et&&Et.length){const qt=Et.pop();return qt.nr.used=!0,$de(qt),qt}}function de(_t){const Et=_t.nr.type;q(Et).push(_t),_t.nr.used=!1,_t.position=-9999,$de(_t),c.delete(_t.nr.key)}function ee(){c.clear(),d.clear();for(let _t=0,Et=i.value.length;_t<Et;_t++){const qt=i.value[_t];qt&&de(qt)}}function j(_t){let Et=-1;return Et=requestAnimationFrame(()=>{A.delete(Et),_t()}),A.add(Et),Et}function U(){for(const _t of A)cancelAnimationFrame(_t);A.clear()}function Z(){b&&(clearTimeout(b),b=null),_&&(clearTimeout(_),_=null),C&&(clearTimeout(C),C=null),E&&(clearTimeout(E),E=null),I&&(clearTimeout(I),I=null)}function oe(){var _t;(_t=a==null?void 0:a.onResize)==null||_t.call(a),s.value&&Ge(!1)}function fe(){k&&!D&&xe();const _t=xn(e);if(!p){if(p=!0,b)return;const Et=()=>j(()=>{p=!1;const{continuous:qt}=Ge(!1,!0);qt||(_&&clearTimeout(_),_=setTimeout(fe,_t.updateInterval+100))});Et(),_t.updateInterval&&(b=setTimeout(()=>{b=null,p&&Et()},_t.updateInterval))}}function ae(_t,Et){var qt,le;s.value&&(_t||Et.boundingClientRect.width!==0||Et.boundingClientRect.height!==0?((qt=a==null?void 0:a.onVisible)==null||qt.call(a),j(()=>{Ge(!1)})):(le=a==null?void 0:a.onHidden)==null||le.call(a))}function G(){const _t=xn(t),Et=_t?Jq(_t):void 0;return window.document&&(Et===window.document.documentElement||Et===window.document.body)?window:Et||window}function Y(){const _t=xn(n);return _t?xn(e).direction==="vertical"?_t.scrollHeight:_t.scrollWidth:0}function Ee(){const _t=xn(t);if(!_t)return{start:0,end:0};const Et=xn(e),qt=Et.direction==="vertical";let le;if(Et.pageMode){const we=_t.getBoundingClientRect(),Xe=qt?we.height:we.width;let rt=-(qt?we.top:we.left),He=qt?window.innerHeight:window.innerWidth;rt<0&&(He+=rt,rt=0),rt+He>Xe&&(He=Xe-rt),le={start:rt,end:rt+He}}else qt?le={start:_t.scrollTop,end:_t.scrollTop+_t.clientHeight}:le={start:nP(_t.scrollLeft,Et.direction,_t),end:nP(_t.scrollLeft,Et.direction,_t)+_t.clientWidth};return le}function he(){const _t=xn(t);if(!_t)return{start:0,end:0};if(xn(e).direction==="vertical"){const Et=nP(_t.scrollLeft,"horizontal",_t);return{start:Et,end:Et+_t.clientWidth}}return{start:_t.scrollTop,end:_t.scrollTop+_t.clientHeight}}function Pe(_t){const Et=xn(e);if(Et.itemSize!=null)return Et.itemSize;const qt=P.value[_t];return(qt==null?void 0:qt.size)||Number(Et.minItemSize)||0}function Te(_t){var Et;const qt=xn(e),le=qt.gridItems||1;return _t<=0?0:qt.itemSize!=null?Math.floor(_t/le)*qt.itemSize:((Et=P.value[_t-1])==null?void 0:Et.accumulator)||0}function Ae(_t){const Et=xn(e),qt=Et.items.length,le=Et.gridItems||1;if(!qt)return 0;if(Et.itemSize!=null){const He=Math.floor(_t/Et.itemSize)*le;return Math.min(Math.max(He,0),qt-1)}let we=0,Xe=qt-1,rt=0;for(;we<=Xe;){const He=Math.floor((we+Xe)/2);Te(He)<=_t?(rt=He,we=He+1):Xe=He-1}return rt}function xe(){E&&(clearTimeout(E),E=null),k=null}function Je(){E&&clearTimeout(E),E=setTimeout(()=>{k=null,E=null},150)}function We(_t,Et){if(!_t.length){xe();return}const qt=Math.max(Ee().start-Y(),0),le=Math.min(Ae(qt),_t.length-1),we=_t[le],Xe=Et?we==null?void 0:we[Et]:le;if(Xe==null){xe();return}const rt=Y()+Te(le);k={key:Xe,offset:Ee().start-rt}}function Ye(_t){if(!k)return!1;const Et=xn(e),qt=_t??Et.items,le=B.value?null:Et.keyField,we=eO(qt,le).indexOf(k.key);if(we===-1)return xe(),!1;const Xe=Y()+Te(we)+k.offset,rt=Ee().start;return Math.abs(Xe-rt)<.5?!1:(D=!0,It(Xe),j(()=>{D=!1}),!0)}function Ze(){xn(e).pageMode?ne():se()}function ne(){y=G(),y.addEventListener("scroll",fe,P7t()?{passive:!0}:!1),y.addEventListener("resize",oe)}function se(){y&&(y.removeEventListener("scroll",fe),y.removeEventListener("resize",oe),y=null)}function Ue(_t,Et,qt,le,we,Xe){const rt=Math.ceil(_t/Et)*qt,He=Math.max(0,Math.floor(we.start/qt)),$e=Math.min(Math.ceil(we.end/qt),Math.ceil(_t/Et)),kt=Math.max(0,Math.floor(Xe.start/le)),Gt=Math.min(Math.ceil(Xe.end/le),Et),Ut=[];for(let gt=He;gt<$e;gt++){const wt=gt*Et;for(let xt=kt;xt<Gt;xt++){const Ht=wt+xt;if(Ht>=_t)break;Ut.push(Ht)}}const Jt=Ut[0]??0,dn=Ut.at(-1)??-1;return{renderedIndices:Ut,startIndex:Jt,endIndex:dn+1,visibleStartIndex:Jt,visibleEndIndex:dn,totalSize:rt}}function je(){const _t=xn(e);if(!_t.gridItems||_t.itemSize==null)return!1;const Et=xn(t);if(!Et)return!1;const qt=_t.itemSecondarySize||_t.itemSize,le=_t.direction==="vertical"?Et.clientWidth:Et.clientHeight;return qt*_t.gridItems>le}function Ge(_t,Et=!1){var qt,le;const we=xn(e),Xe=we.itemSize,rt=we.gridItems||1,He=we.itemSecondarySize||Xe,$e=S,kt=we.typeField,Gt=B.value?null:we.keyField,Ut=we.items,Jt=Ut.length,dn=P.value,gt=c,wt=i.value;let xt=null,Ht=null,wn,An,Vt,ln,di;if(!Jt)wn=An=ln=di=Vt=0;else if(v)wn=ln=0,An=di=Math.min(we.prerender,Ut.length),Vt=0;else{const Yn=Ee(),ar=he();if(Et){let or=Yn.start-h;or<0&&(or=-or);let no=ar.start-g;no<0&&(no=-no);const ia=Xe===null&&or>=$e||Xe!==null&&or>=Xe,un=rt>1&&Xe!=null&&no>=He;if(!ia&&!un)return{continuous:!0}}h=Yn.start,g=ar.start;const yr=we.buffer;Yn.start-=yr,Yn.end+=yr,ar.start-=yr,ar.end+=yr;let cs=0;const Dr=xn(n);Dr&&(cs=Dr.scrollHeight,Yn.start-=cs);const Do=xn(r);if(Do){const or=Do.scrollHeight;Yn.end+=or}if(Xe===null){let or,no=0,ia=Jt-1,un=~~(Jt/2),oa;do oa=un,or=dn[un].accumulator,or<Yn.start?no=un:un<Jt-1&&dn[un+1].accumulator>Yn.start&&(ia=un),un=~~((no+ia)/2);while(un!==oa);for(un<0&&(un=0),wn=un,Vt=dn[Jt-1].accumulator,An=un;An<Jt&&dn[An].accumulator<Yn.end;An++);for(An===-1?An=Ut.length-1:(An++,An>Jt&&(An=Jt)),ln=wn;ln<Jt&&cs+dn[ln].accumulator<Yn.start;ln++);for(di=ln;di<Jt&&cs+dn[di].accumulator<Yn.end;di++);}else if(rt>1){const or=Ue(Jt,rt,Xe,He,Yn,ar);xt=or.renderedIndices,Ht=new Set(xt),wn=or.startIndex,An=or.endIndex,ln=or.visibleStartIndex,di=or.visibleEndIndex,Vt=or.totalSize}else{wn=~~(Yn.start/Xe*rt);const or=wn%rt;wn-=or,An=Math.ceil(Yn.end/Xe*rt),ln=Math.max(0,Math.floor((Yn.start-cs)/Xe*rt)),di=Math.floor((Yn.end-cs)/Xe*rt),wn<0&&(wn=0),An>Jt&&(An=Jt),ln<0&&(ln=0),di>Jt&&(di=Jt),Vt=Math.ceil(Jt/rt)*Xe}}An-wn>IVe.itemsLimit&&Ke(),o.value=Vt;let lr;const ca=wn<=u&&An>=l;if(!ca||_t)ee();else for(let Yn=0,ar=wt.length;Yn<ar;Yn++){const yr=wt[Yn];if(yr&&(lr=yr,lr.nr.used)){const cs=Ht?Ht.has(lr.nr.index):lr.nr.index>=wn&&lr.nr.index<An,Dr=Xe||dn[lr.nr.index]&&dn[lr.nr.index].size;(!cs||!Dr)&&de(lr)}}let gi,Zs;const Lr=xt??Array.from({length:Math.max(0,An-wn)},(Yn,ar)=>wn+ar);for(const Yn of Lr){if(!(Xe||dn[Yn]&&dn[Yn].size))continue;gi=Ut[Yn];const ar=Gt?gi[Gt]:Yn;if(ar==null)throw new Error(`Key is ${ar} on item (keyField is '${Gt}')`);if(lr=gt.get(ar),lr)lr.item!==gi&&(lr.item=gi),lr.nr.used||console.warn(`Expected existing view's used flag to be true, got ${lr.nr.used}`);else{if(Zs=gi[kt],lr=ie(Zs),lr){const yr=lr.nr.index!==Yn||lr.nr.key!==ar;lr.item=gi,lr.nr.index=Yn,lr.nr.key=ar,lr.nr.type!==Zs&&console.warn("Reused view's type does not match pool's type"),yr&&$de(lr)}else lr=J(wt,Yn,gi,ar,Zs);gt.set(ar,lr)}Xe===null?(lr.position=((qt=dn[Yn-1])==null?void 0:qt.accumulator)||0,lr.offset=0):(lr.position=Math.floor(Yn/rt)*Xe,lr.offset=Yn%rt*He)}return l=wn,u=An,we.emitUpdate&&((le=a==null?void 0:a.onUpdate)==null||le.call(a,wn,An,ln,di)),C&&clearTimeout(C),C=setTimeout(mt,we.updateInterval+300),{continuous:ca}}function Ke(){throw I=setTimeout(()=>{I=null,console.warn("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",xn(t)),console.warn("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")}function ut(){if(je())return!1;const _t=i.value.filter(({nr:Et})=>Et.used);for(let Et=1;Et<_t.length;Et++)if(_t[Et].nr.index!==_t[Et-1].nr.index+1)return!0;return!1}function mt(){i.value.sort((_t,Et)=>_t.nr.index-Et.nr.index),ut()&&(Ge(!1),C&&clearTimeout(C))}function ht(_t,Et){const qt=xn(e),le=xn(t);if(!le)return;const we=Math.max(0,Math.min(_t,qt.items.length-1)),Xe=Ee().start,rt=O7t(le,qt.direction,qt.pageMode),He=Te(we),$e=Pe(we),kt=AVe(He,$e,Xe,rt,Et==null?void 0:Et.align,(Et==null?void 0:Et.offset)??0);if(kt!=null&&(It(kt,Et),qt.gridItems&&qt.itemSize!=null)){const Gt=xn(t);if(!Gt)return;const Ut=qt.gridItems,Jt=qt.itemSecondarySize||qt.itemSize,dn=we%Ut*Jt,gt=qt.direction==="vertical"?"horizontal":"vertical",wt=gt==="horizontal"?nP(Gt.scrollLeft,"horizontal",Gt):Gt.scrollTop,xt=gt==="horizontal"?Gt.clientWidth:Gt.clientHeight,Ht=AVe(dn,Jt,wt,xt,Et==null?void 0:Et.align,(Et==null?void 0:Et.offset)??0);Ht!=null&&Ode(Gt,gt,Ht,Et)}}function It(_t,Et){const qt=xn(e),le=xn(t);if(le)if(qt.pageMode){const we=Jq(le),Xe=we.getBoundingClientRect(),rt=le.getBoundingClientRect(),He=qt.direction==="vertical"?"top":"left",$e=Jq(le)===document.documentElement||Jq(le)===document.body?qt.direction==="vertical"?window.scrollY:window.scrollX:nP(qt.direction==="vertical"?we.scrollTop:we.scrollLeft,qt.direction,we),kt=rt[He]-Xe[He];Ode(we.tagName==="HTML"?window:we,qt.direction,_t+$e+kt,Et)}else Ode(le,qt.direction,_t,Et)}const Lt=xn(e);return T=eO(Lt.items,Lt.items.length>0&&typeof Lt.items[0]!="object"?null:Lt.keyField),Lt.cache&&N(Lt.cache),Lt.prerender&&(v=!0,Ge(!1)),Lt.gridItems&&!Lt.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems"),nn(()=>{Ze(),Ct(()=>{v=!1,Ge(!0),s.value=!0})}),H$(()=>{const _t=h;typeof _t=="number"&&Ct(()=>{It(_t)})}),$r(()=>{Z(),U(),se()}),lt(()=>xn(e).cache,_t=>{N(_t),Ge(!0)}),lt(()=>xn(e).items,(_t,Et)=>{const qt=xn(e),le=B.value?null:qt.keyField,we=eO(_t,le);if(qt.shift){const Xe=Et?eO(Et,le):T;DVe(Xe,we)>0?We(Et??[],le):xe()}else xe();T=we,Ye(_t),Ge(!0)}),lt(()=>xn(e).pageMode,()=>{Ze(),Ge(!1)}),lt(P,()=>{Ye()&&Je(),Ge(!1)},{deep:!0}),lt(()=>xn(e).gridItems,()=>{Ge(!0)}),lt(()=>xn(e).itemSecondarySize,()=>{Ge(!0)}),{pool:i,visiblePool:$,totalSize:o,ready:s,sizes:P,simpleArray:B,scrollToItem:ht,scrollToPosition:It,getScroll:Ee,findItemIndex:Ae,getItemOffset:Te,getItemSize:Pe,cacheSnapshot:V,restoreCache:N,updateVisibleItems:Ge,handleScroll:fe,handleResize:oe,handleVisibilityChange:ae,sortViews:mt}}function Mde(e){return e.item}function L7t(e){return e._vs_styleStamp??0}const PVe=["position","top","left","transform","willChange","visibility","pointerEvents"];function MVe(e){const t={};for(const n of PVe)t[n]=e.style[n];return t}function NVe(e,t){for(const n of PVe)e.style[n]=t[n]??""}function LVe(e,t,n,r){if(!("view"in t)){NVe(e,r);return}const a=n==="vertical",i=e.tagName==="TR",o=a?`translateY(${t.view.position}px) translateX(${t.view.offset}px)`:`translateX(${t.view.position}px) translateY(${t.view.offset}px)`;e.style.position="absolute",e.style.top=a&&i?`${t.view.position}px`:"0px",e.style.left=!a&&i?`${t.view.position}px`:"0px",e.style.transform=i?"":o,e.style.willChange=i?"unset":"transform",e.style.visibility=t.view.nr.used?"visible":"hidden",e.style.pointerEvents=t.view.nr.used?"":"none"}function FVe(e){return"view"in e?{item:Mde(e.view).item,active:e.view.nr.used,index:e.view.nr.index,watchData:e.watchData??!1,emitResize:e.emitResize??!1,sizeDependencies:e.sizeDependencies??null,onResize:e.onResize}:{watchData:!1,emitResize:!1,sizeDependencies:null,...e}}function BVe(e,t,n,r){return n?r??null:(e==null?void 0:e[t])??null}function F7t(e){let t=0,n={};const r=E7t();let a=!1,i,o=!1,s=[],l=null,u=null;const c=new Set,d=Wn({active:!0,sizes:{},keyField:xn(e).keyField,simpleArray:!1}),p=z(()=>xn(e).direction),h=z(()=>xn(xn(e).el)),g=z(()=>xn(xn(e).before)),v=z(()=>xn(xn(e).after)),b=new Map;function _(ae){let G=-1;return G=requestAnimationFrame(()=>{c.delete(G),ae()}),c.add(G),G}function C(){for(const ae of c)cancelAnimationFrame(ae);c.clear()}typeof ResizeObserver<"u"&&(i=new ResizeObserver(ae=>{_(()=>{if(Array.isArray(ae)){for(const G of ae)if(G.target&&G.target.$_vs_onResize){let Y,Ee;if(G.borderBoxSize){const he=G.borderBoxSize[0];Y=he.inlineSize,Ee=he.blockSize}else Y=G.contentRect.width,Ee=G.contentRect.height;G.target.$_vs_onResize(G.target.$_vs_id,Y,Ee)}}})}));const S={vscrollData:d,resizeObserver:i,direction:p,undefinedMap:n,undefinedSizeCount:{get value(){return t},set value(ae){t=ae}},onVscrollUpdate(ae){const G=Y=>{ae(Y)};return r.on("vscroll:update",G),()=>r.off("vscroll:update",G)}};Yc("vscrollData",d),Yc("vscrollParent",{get $_undefinedSizes(){return t},set $_undefinedSizes(ae){t=ae},get $_undefinedMap(){return n},set $_undefinedMap(ae){n=ae},$_events:r,direction:p}),Yc("vscrollResizeObserver",i),Yc("vscrollMeasurementContext",S),Yc("vscrollAnchorRegistry",{delete(ae){b.delete(ae)},set(ae,G){b.set(ae,G)}});const y=z(()=>{const ae=xn(e);return ae.items.length>0&&typeof ae.items[0]!="object"}),T=z(()=>{const ae=[],G=xn(e),{items:Y,keyField:Ee}=G,he=y.value,Pe=d.sizes,Te=Y.length;for(let Ae=0;Ae<Te;Ae++){const xe=Y[Ae],Je=he?Ae:xe[Ee];let We=Pe[Je];typeof We>"u"&&!n[Je]&&(We=0),ae.push({item:xe,id:Je,size:We})}return ae}),k=xn(e);s=eO(k.items,y.value?null:k.keyField),k.cache&&(d.sizes=Ade(k.cache,k.items,y.value?null:k.keyField));const E=z(()=>{const ae=xn(e);return{items:T.value,keyField:"id",direction:ae.direction,itemSize:null,gridItems:void 0,itemSecondarySize:void 0,minItemSize:ae.minItemSize,sizeField:"size",typeField:"type",buffer:ae.buffer??200,pageMode:ae.pageMode??!1,shift:!1,cache:ae.cache,prerender:ae.prerender??0,emitUpdate:ae.emitUpdate??!1,updateInterval:ae.updateInterval??0}});function I(){var ae,G;ee(),(G=(ae=xn(e)).onResize)==null||G.call(ae)}function D(){var ae,G;r.emit("vscroll:update",{force:!1}),(G=(ae=xn(e)).onVisible)==null||G.call(ae)}const A=Pde(E,h,g,v,{onResize:I,onVisible:D,onHidden:()=>{var ae,G;return(G=(ae=xn(e)).onHidden)==null?void 0:G.call(ae)},onUpdate:(ae,G,Y,Ee)=>{var he,Pe;return(Pe=(he=xn(e)).onUpdate)==null?void 0:Pe.call(he,ae,G,Y,Ee)}}),R=new WeakMap;function B(){u!=null&&(cancelAnimationFrame(u),c.delete(u),u=null)}function P(){B(),l=null}function $(){l==null||u!=null||(u=_(()=>{u=null,J()}))}function V(){const ae=h.value;if(!ae)return null;const G=ae.getBoundingClientRect();let Y=null;for(const[Ee,he]of b.entries()){if(!he.active||getComputedStyle(Ee).visibility==="hidden")continue;const Pe=Ee.getBoundingClientRect();if(Pe.bottom<=G.top||Pe.top>=G.bottom)continue;const Te=Math.max(Pe.top,G.top)-G.top;(!Y||Te<Y.score)&&(Y={key:he.id,offset:Pe.top-G.top,score:Te})}return Y}function N(ae){const G=h.value;if(!G){P();return}const Y=G.scrollTop,Ee=Math.min(A.findItemIndex(Y),ae.length-1),he=ae[Ee];if(he==null){P();return}const Pe=V();l={logicalKey:he,logicalOffset:Y-A.getItemOffset(Ee),pendingKeys:new Set,stableFrames:0,visualKey:(Pe==null?void 0:Pe.key)??null,visualOffset:(Pe==null?void 0:Pe.offset)??0}}function q(ae){const G=h.value;return!G||Math.abs(G.scrollTop-ae)<.5?!1:(o=!0,G.scrollTop=ae,G.dispatchEvent(new Event("scroll")),_(()=>{o=!1}),!0)}function J(){const ae=l,G=h.value;if(!ae||!G)return;const Y=T.value.findIndex(Te=>Te.id===ae.logicalKey);if(Y===-1){P();return}let Ee=!1;const he=A.getItemOffset(Y)+ae.logicalOffset;if(Ee=q(he)||Ee,ae.visualKey!=null)for(const[Te,Ae]of b.entries()){if(!Ae.active||Ae.id!==ae.visualKey||getComputedStyle(Te).visibility==="hidden")continue;const xe=Te.getBoundingClientRect().top-G.getBoundingClientRect().top-ae.visualOffset;Ee=q(G.scrollTop+xe)||Ee;break}let Pe=!0;for(const Te of ae.pendingKeys)if(!(typeof d.sizes[Te]=="number"&&d.sizes[Te]>0)){Pe=!1;break}if(!Ee&&Pe){if(ae.stableFrames++,ae.stableFrames>=2){P();return}}else ae.stableFrames=0;$()}function ie(ae,G,Y,Ee){const he=yS(),Pe=Hl(G),Te=Hl(Y),Ae=Hl({onResize:Y.onResize}),xe=Hl(ae),Je=he.run(()=>(lt(()=>{const We=Pe.value;if(!("view"in We))return{active:Te.value.active,direction:p.value,id:BVe(Te.value.item,xn(e).keyField,d.simpleArray,Te.value.index),legacy:!0};const{view:Ye}=We;return{active:Ye.nr.used,direction:p.value,id:Mde(Ye).id,legacy:!1,position:Ye.position,offset:Ye.offset,styleStamp:L7t(Ye)}},()=>{const We=xe.value;if(We){const Ye=Pe.value,Ze="view"in Ye?Mde(Ye.view).id:BVe(Te.value.item,xn(e).keyField,d.simpleArray,Te.value.index);Ze!=null&&b.set(We,{active:Te.value.active&&d.active,id:Ze}),LVe(We,Pe.value,p.value,Ee)}},{immediate:!0}),OVe(Te,xe,S,Ae)));Je.mount(),R.set(ae,{binding:Pe,scope:he,options:Te,callbacks:Ae,el:xe,controller:Je,restoreStyles:Ee})}const de={mounted(ae,G){const Y=MVe(ae);ie(ae,G.value,FVe(G.value),Y)},updated(ae,G){const Y=R.get(ae),Ee=FVe(G.value);if(!Y){const he=MVe(ae);ie(ae,G.value,Ee,he);return}Y.binding.value=G.value,Y.options.value=Ee,Y.callbacks.value={onResize:Ee.onResize},Y.el.value=ae,LVe(ae,G.value,p.value,Y.restoreStyles)},unmounted(ae){const G=R.get(ae);G&&(G.controller.unmount(),G.scope.stop(),NVe(ae,G.restoreStyles),b.delete(ae),R.delete(ae))}};function ee(ae=!1){(ae||y.value)&&(d.sizes={}),r.emit("vscroll:update",{force:!0})}function j(ae,G){A.scrollToItem(ae,G)}function U(ae){const G=xn(e);return d.sizes=Ade(ae,G.items,y.value?null:G.keyField),A.restoreCache(ae)}function Z(ae,G){const Y=xn(e),Ee=y.value?G??Y.items.indexOf(ae):ae[Y.keyField];return d.sizes[Ee]||0}function oe(){const ae=h.value;ae&&(a||(a=!0,Ct(()=>{ae.scrollTop=ae.scrollHeight+5e3;const G=()=>{ae.scrollTop=ae.scrollHeight+5e3,_(()=>{ae.scrollTop=ae.scrollHeight+5e3,t===0?a=!1:_(G)})};_(G)})))}function fe(){l&&!o&&P()}return lt(()=>xn(e).items,(ae,G)=>{const Y=xn(e),Ee=y.value?null:Y.keyField,he=eO(ae,Ee);if(Y.shift){const Pe=G?eO(G,Ee):s,Te=DVe(Pe,he);Te>0?(N(Pe),l&&(l.pendingKeys=new Set(he.slice(0,Te)),l.stableFrames=0,Ct(()=>{l&&J()}))):P()}else P();s=he,ee()},{flush:"sync"}),lt(()=>xn(e).cache,ae=>{ae&&U(ae)}),lt(y,ae=>{d.simpleArray=ae},{immediate:!0}),lt(()=>xn(e).direction,()=>{P(),ee(!0)}),lt(h,(ae,G)=>{G==null||G.removeEventListener("scroll",fe),ae==null||ae.addEventListener("scroll",fe)},{immediate:!0}),lt(T,(ae,G)=>{const Y=h.value;if(!Y)return;if(l){J();return}const Ee=Y.scrollTop,he=xn(e);let Pe=0,Te=0;const Ae=Math.min(ae.length,G.length);for(let Je=0;Je<Ae&&!(Pe>=Ee);Je++)Pe+=G[Je].size||he.minItemSize,Te+=ae[Je].size||he.minItemSize;const xe=Te-Pe;xe!==0&&(Y.scrollTop+=xe)},{flush:"post"}),H$(()=>{d.active=!0}),Ace(()=>{d.active=!1}),ss(()=>{var ae;B(),C(),(ae=h.value)==null||ae.removeEventListener("scroll",fe),r.all.clear()}),{vscrollData:d,itemsWithSize:T,resizeObserver:i,measurementContext:S,vDynamicScrollerItem:de,...A,simpleArray:y,forceUpdate:ee,scrollToItem:j,restoreCache:U,getItemSize:Z,scrollToBottom:oe,onScrollerResize:I,onScrollerVisible:D}}const Nde=new WeakMap;function B7t(e){return typeof e=="function"?{callback:e,observer:null,intersection:void 0,visible:null}:{callback:e.callback,observer:null,intersection:e.intersection,visible:null}}function VVe(e,t){UVe(e);const n=B7t(t.value);if(Nde.set(e,n),typeof IntersectionObserver>"u"){const r=e.getBoundingClientRect();n.visible=!0,n.callback(!0,{boundingClientRect:r});return}n.observer=new IntersectionObserver(r=>{const a=r[0],i=!!(a!=null&&a.isIntersecting);n.visible!==null&&n.visible===i||(n.visible=i,n.callback(i,a))},n.intersection),n.observer.observe(e)}function UVe(e){const t=Nde.get(e);t!=null&&t.observer&&(t.observer.disconnect(),t.observer=null)}const HVe={mounted(e,t){VVe(e,t)},updated(e,t){t.value!==t.oldValue&&VVe(e,t)},unmounted(e){UVe(e),Nde.delete(e)}},jVe=ct({__name:"ItemView",props:{view:{},itemTag:{}},setup(e){const t=e;return(n,r)=>(L(),qe(sc(t.itemTag),{class:"vue-recycle-scroller__item-view"},{default:Re(()=>[at(n.$slots,"default",{item:t.view.item,index:t.view.nr.index,active:t.view.nr.used})]),_:3}))}}),V7t=ct({__name:"ResizeObserver",emits:["notify"],setup(e,{emit:t}){const n=t,r=W();let a=null,i=null;function o(){n("notify")}return nn(()=>{var s;const l=(s=r.value)==null?void 0:s.parentElement;if(l){if(typeof ResizeObserver<"u"){a=new ResizeObserver(()=>{o()}),a.observe(l);return}i=()=>o(),window.addEventListener("resize",i)}}),$r(()=>{a&&(a.disconnect(),a=null),i&&(window.removeEventListener("resize",i),i=null)}),(s,l)=>(L(),re("div",{ref_key:"el",ref:r,class:"vue-recycle-scroller__resize-observer","aria-hidden":"true"},null,512))}}),U7t=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n},zVe=U7t(V7t,[["__scopeId","data-v-08cc04ab"]]),Lde=ct({__name:"RecycleScroller",props:{items:{},keyField:{default:"id"},direction:{default:"vertical"},listTag:{default:"div"},itemTag:{default:"div"},itemSize:{default:null},gridItems:{default:void 0},itemSecondarySize:{default:void 0},minItemSize:{default:null},sizeField:{default:"size"},typeField:{default:"type"},buffer:{default:200},pageMode:{type:Boolean,default:!1},shift:{type:Boolean,default:!1},cache:{default:void 0},prerender:{default:0},emitUpdate:{type:Boolean,default:!1},disableTransform:{type:Boolean,default:!1},updateInterval:{default:0},skipHover:{type:Boolean,default:!1},listClass:{default:""},itemClass:{default:""}},emits:["resize","visible","hidden","update","scrollStart","scrollEnd"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=HVe,o=W(),s=W(),l=W(),u=W(null),c=Pde(r,o,s,l,{onResize:()=>a("resize"),onVisible:()=>a("visible"),onHidden:()=>a("hidden"),onUpdate:($,V,N,q)=>{a("update",$,V,N,q),N<=0&&a("scrollStart"),q>=r.items.length-1&&a("scrollEnd")}}),{pool:d,visiblePool:p,totalSize:h,ready:g,scrollToItem:v,scrollToPosition:b,getScroll:_,findItemIndex:C,getItemOffset:S,getItemSize:y,cacheSnapshot:T,restoreCache:k,updateVisibleItems:E,handleScroll:I,handleResize:D,handleVisibilityChange:A}=c;function R($){u.value=$}function B(){u.value=null}const P=z(()=>{const $={[r.direction==="vertical"?"minHeight":"minWidth"]:`${h.value}px`};if(r.gridItems&&r.itemSize!=null){const V=(r.itemSecondarySize||r.itemSize)*r.gridItems;$[r.direction==="vertical"?"minWidth":"minHeight"]=`${V}px`}return $});return t({el:o,visiblePool:p,scrollToItem:v,scrollToPosition:b,getScroll:_,findItemIndex:C,getItemOffset:S,getItemSize:y,cacheSnapshot:T,restoreCache:k,updateVisibleItems:E}),($,V)=>ft((L(),re("div",{ref_key:"el",ref:o,class:ke(["vue-recycle-scroller",{"grid-mode":r.gridItems,ready:F(g),"page-mode":r.pageMode,[`direction-${r.direction}`]:!0}]),onScrollPassive:V[0]||(V[0]=(...N)=>F(I)&&F(I)(...N))},[$.$slots.before?(L(),re("div",{key:0,ref_key:"before",ref:s,class:"vue-recycle-scroller__slot"},[at($.$slots,"before")],512)):Ve("",!0),(L(),qe(sc(r.listTag),{style:Yt(P.value),class:ke(["vue-recycle-scroller__item-wrapper",r.listClass])},{default:Re(()=>[(L(!0),re($t,null,rn(F(d),N=>(L(),qe(jVe,Zt({key:N.nr.id,view:N,"item-tag":r.itemTag,style:F(g)?[r.disableTransform?{[r.direction==="vertical"?"top":"left"]:`${N.position}px`,willChange:"unset"}:{transform:`translate${r.direction==="vertical"?"Y":"X"}(${N.position}px) translate${r.direction==="vertical"?"X":"Y"}(${N.offset}px)`},{width:r.gridItems?`${r.direction==="vertical"&&r.itemSecondarySize||r.itemSize}px`:void 0,height:r.gridItems?`${r.direction==="horizontal"&&r.itemSecondarySize||r.itemSize}px`:void 0,visibility:N.nr.used?"visible":"hidden"}]:null,class:["vue-recycle-scroller__item-view",[r.itemClass,{hover:!r.skipHover&&u.value===N.nr.key}]]},fzt(r.skipHover?{}:{mouseenter:()=>{R(N.nr.key)},mouseleave:()=>{B()}})),{default:Re(q=>[at($.$slots,"default",Zt({ref_for:!0},q))]),_:2},1040,["view","item-tag","style","class"]))),128)),r.items.length===0?at($.$slots,"empty",{key:0}):Ve("",!0)]),_:3},8,["style","class"])),$.$slots.after?(L(),re("div",{key:1,ref_key:"after",ref:l,class:"vue-recycle-scroller__slot"},[at($.$slots,"after")],512)):Ve("",!0),De(zVe,{onNotify:F(D)},null,8,["onNotify"])],34)),[[F(i),F(A)]])}}),WVe=ct({inheritAttrs:!1,__name:"DynamicScroller",props:{items:{},keyField:{default:"id"},direction:{default:"vertical"},listTag:{default:"div"},itemTag:{default:"div"},minItemSize:{},shift:{type:Boolean,default:!1},cache:{default:void 0}},emits:["resize","visible"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=W(),o=z(()=>{var k;const E=(k=i.value)==null?void 0:k.el;return E&&typeof E=="object"&&"value"in E?E.value:E}),s=z(()=>({items:r.items,keyField:r.keyField,direction:r.direction,minItemSize:r.minItemSize,shift:r.shift,cache:r.cache,el:o.value,onResize:()=>a("resize"),onVisible:()=>a("visible")})),l=F7t(s),{itemsWithSize:u,forceUpdate:c,scrollToItem:d,scrollToPosition:p,findItemIndex:h,getItemOffset:g,getItemSize:v,cacheSnapshot:b,restoreCache:_,scrollToBottom:C,onScrollerResize:S,onScrollerVisible:y}=l;function T(k,E,I){return{item:k.item,index:E,active:I,itemWithSize:k}}return t({scrollToItem:d,scrollToPosition:p,findItemIndex:h,getItemOffset:g,scrollToBottom:C,getItemSize:v,cacheSnapshot:b,restoreCache:_,forceUpdate:c}),(k,E)=>(L(),qe(Lde,Zt({ref_key:"scroller",ref:i,items:F(u),"min-item-size":r.minItemSize,direction:r.direction,cache:r.cache,"key-field":"id","list-tag":r.listTag,"item-tag":r.itemTag},k.$attrs,{onResize:F(S),onVisible:F(y)}),Ho({default:Re(({item:I,index:D,active:A})=>[at(k.$slots,"default",so(Eo(T(I,D,A))))]),empty:Re(()=>[at(k.$slots,"empty")]),_:2},[k.$slots.before?{name:"before",fn:Re(()=>[at(k.$slots,"before")]),key:"0"}:void 0,k.$slots.after?{name:"after",fn:Re(()=>[at(k.$slots,"after")]),key:"1"}:void 0]),1040,["items","min-item-size","direction","cache","list-tag","item-tag","onResize","onVisible"]))}});function H7t(e,t,n){const r=Br("vscrollMeasurementContext"),a=Br("vscrollAnchorRegistry",null),i=OVe(e,t,r,n);return nn(()=>{i.mount()}),a&&lt([i.id,i.finalActive,()=>xn(t)],([o,s,l],[u,c,d])=>{d&&d!==l&&a.delete(d),l&&a.set(l,{active:s,id:o})},{immediate:!0}),$r(()=>{const o=xn(t);a&&o&&a.delete(o),i.unmount()}),{id:i.id,size:i.size,finalActive:i.finalActive,updateSize:i.updateSize}}const GVe=ct({__name:"DynamicScrollerItem",props:{item:{},watchData:{type:Boolean,default:!1},active:{type:Boolean},index:{default:void 0},sizeDependencies:{default:null},emitResize:{type:Boolean,default:!1},tag:{default:"div"}},emits:["resize"],setup(e,{emit:t}){const n=e,r=t,a=W();return H7t(n,a,{onResize:i=>r("resize",i)}),(i,o)=>(L(),qe(sc(n.tag),{ref_key:"el",ref:a},{default:Re(()=>[at(i.$slots,"default")]),_:3},512))}});function j7t(e,t,n,r,a){return Pde(z(()=>({...xn(e),pageMode:!0})),t,n,r,a)}const qVe=ct({__name:"WindowScroller",props:{items:{},keyField:{default:"id"},direction:{default:"vertical"},listTag:{default:"div"},itemTag:{default:"div"},itemSize:{default:null},gridItems:{default:void 0},itemSecondarySize:{default:void 0},minItemSize:{default:null},sizeField:{default:"size"},typeField:{default:"type"},buffer:{default:200},shift:{type:Boolean,default:!1},cache:{default:void 0},prerender:{default:0},emitUpdate:{type:Boolean,default:!1},disableTransform:{type:Boolean,default:!1},updateInterval:{default:0},listClass:{default:""},itemClass:{default:""}},emits:["resize","visible","hidden","update"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=HVe,o=W(),s=W(),l=W(),u=j7t(r,o,s,l,{onResize:()=>a("resize"),onVisible:()=>a("visible"),onHidden:()=>a("hidden"),onUpdate:(D,A,R,B)=>a("update",D,A,R,B)}),{pool:c,totalSize:d,ready:p,scrollToItem:h,scrollToPosition:g,getScroll:v,findItemIndex:b,getItemOffset:_,getItemSize:C,cacheSnapshot:S,restoreCache:y,updateVisibleItems:T,handleScroll:k,handleResize:E,handleVisibilityChange:I}=u;return t({el:o,scrollToItem:h,scrollToPosition:g,getScroll:v,findItemIndex:b,getItemOffset:_,getItemSize:C,cacheSnapshot:S,restoreCache:y,updateVisibleItems:T}),(D,A)=>ft((L(),re("div",{ref_key:"el",ref:o,class:ke(["vue-recycle-scroller vue-window-scroller",{ready:F(p),[`direction-${r.direction}`]:!0}]),onScrollPassive:A[0]||(A[0]=(...R)=>F(k)&&F(k)(...R))},[D.$slots.before?(L(),re("div",{key:0,ref_key:"before",ref:s,class:"vue-recycle-scroller__slot"},[at(D.$slots,"before")],512)):Ve("",!0),(L(),qe(sc(r.listTag),{style:Yt({[r.direction==="vertical"?"minHeight":"minWidth"]:`${F(d)}px`}),class:ke(["vue-recycle-scroller__item-wrapper",r.listClass])},{default:Re(()=>[(L(!0),re($t,null,rn(F(c),R=>(L(),qe(jVe,{key:R.nr.id,view:R,"item-tag":r.itemTag,style:Yt(F(p)?[r.disableTransform?{[r.direction==="vertical"?"top":"left"]:`${R.position}px`,willChange:"unset"}:{transform:`translate${r.direction==="vertical"?"Y":"X"}(${R.position}px) translate${r.direction==="vertical"?"X":"Y"}(${R.offset}px)`},{width:r.gridItems?`${r.direction==="vertical"&&r.itemSecondarySize||r.itemSize}px`:void 0,height:r.gridItems?`${r.direction==="horizontal"&&r.itemSecondarySize||r.itemSize}px`:void 0,visibility:R.nr.used?"visible":"hidden"}]:null),class:ke(["vue-recycle-scroller__item-view",r.itemClass])},{default:Re(B=>[at(D.$slots,"default",Zt({ref_for:!0},B))]),_:2},1032,["view","item-tag","style","class"]))),128)),r.items.length===0?at(D.$slots,"empty",{key:0}):Ve("",!0)]),_:3},8,["style","class"])),D.$slots.after?(L(),re("div",{key:1,ref_key:"after",ref:l,class:"vue-recycle-scroller__slot"},[at(D.$slots,"after")],512)):Ve("",!0),De(zVe,{onNotify:F(E)},null,8,["onNotify"])],34)),[[F(i),F(I)]])}});function z7t(e,t){e.component(`${t}recycle-scroller`,Lde),e.component(`${t}RecycleScroller`,Lde),e.component(`${t}dynamic-scroller`,WVe),e.component(`${t}DynamicScroller`,WVe),e.component(`${t}dynamic-scroller-item`,GVe),e.component(`${t}DynamicScrollerItem`,GVe),e.component(`${t}window-scroller`,qVe),e.component(`${t}WindowScroller`,qVe)}const W7t={version:"2.0.1",install(e,t){const n={installComponents:!0,componentsPrefix:"",...t};for(const r in n)typeof n[r]<"u"&&(IVe[r]=n[r]);n.installComponents&&z7t(e,n.componentsPrefix)}},G7t=(e,t)=>{const n=i=>t._s.get(i),r=(i,o,s)=>{const l=n(i);return l&&o in l?(l[o](s),!0):(console.warn(`[initWebScene] Store "${i}" or dispactcher "${o}" not found`),!1)};function a(i){var o,s;(s=(o=e==null?void 0:e.config)==null?void 0:o.globalProperties)==null||s.setStoreValue("scene","setCurrentSceneTabId",i)}return e.config.globalProperties.setStoreValue=r,e.config.globalProperties.handleSetTab=a,{handleSetTab:a}},q7t="1.26.10",K7t={"@arbocollab/ag-grid-ui-components":"0.0.53","@arbocollab/arbo-calendar-component":"0.0.51","@arbocollab/arbo-chart-component":"1.0.1","@arbocollab/arbo-comment-utils":"1.0.1","@arbocollab/arbo-common-utils":"npm:@arbocollab/arbo-common-utils@1.0.15","@arbocollab/arbo-media-player-component":"0.0.38","@arbocollab/arbo-metric-table":"npm:@arbocollab/arbo-metric-table@0.0.28","@arbocollab/arbo-table-component":"1.0.1","@arbocollab/arbo-ui-components":"npm:@arbocollab/arbo-ui-components-beta@0.0.378-alpha.69","@arbocollab/arbo-virtual-list-component":"0.0.22-alpha.20","@ctrl/tinycolor":"^4.2.0","@vueuse/core":"^10.11.1",axios:"^1.7.2","date-fns":"^4.1.0","date-fns-tz":"^3.2.0",dayjs:"^1.11.11",dexie:"4.0.10","js-cookie":"^3.0.5",pinia:"^3.0.3","prettier-plugin-stylus":"^0.1.0","sanitize-html":"^2.15.0","vite-bundle-visualizer":"^1.2.1","vite-plugin-html":"^3.2.2",vue:"^3.5.18","vue-draggable-next":"^2.2.1","vue-i18n":"^9.13.1","vue-router":"^4.5.1","vue-virtual-scroller":"^2.0.0-beta.8"};var rP=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tU(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function KVe(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var YVe={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(rP,function(){var n=function(f,m){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,x){w.__proto__=x}||function(w,x){for(var O in x)Object.prototype.hasOwnProperty.call(x,O)&&(w[O]=x[O])})(f,m)},r=function(){return(r=Object.assign||function(f){for(var m,w=1,x=arguments.length;w<x;w++)for(var O in m=arguments[w])Object.prototype.hasOwnProperty.call(m,O)&&(f[O]=m[O]);return f}).apply(this,arguments)};function a(f,m,w){for(var x,O=0,M=m.length;O<M;O++)!x&&O in m||((x=x||Array.prototype.slice.call(m,0,O))[O]=m[O]);return f.concat(x||Array.prototype.slice.call(m))}var i=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:rP,o=Object.keys,s=Array.isArray;function l(f,m){return typeof m!="object"||o(m).forEach(function(w){f[w]=m[w]}),f}typeof Promise>"u"||i.Promise||(i.Promise=Promise);var u=Object.getPrototypeOf,c={}.hasOwnProperty;function d(f,m){return c.call(f,m)}function p(f,m){typeof m=="function"&&(m=m(u(f))),(typeof Reflect>"u"?o:Reflect.ownKeys)(m).forEach(function(w){g(f,w,m[w])})}var h=Object.defineProperty;function g(f,m,w,x){h(f,m,l(w&&d(w,"get")&&typeof w.get=="function"?{get:w.get,set:w.set,configurable:!0}:{value:w,configurable:!0,writable:!0},x))}function v(f){return{from:function(m){return f.prototype=Object.create(m.prototype),g(f.prototype,"constructor",f),{extend:p.bind(null,f.prototype)}}}}var b=Object.getOwnPropertyDescriptor,_=[].slice;function C(f,m,w){return _.call(f,m,w)}function S(f,m){return m(f)}function y(f){if(!f)throw new Error("Assertion Failed")}function T(f){i.setImmediate?setImmediate(f):setTimeout(f,0)}function k(f,m){if(typeof m=="string"&&d(f,m))return f[m];if(!m)return f;if(typeof m!="string"){for(var w=[],x=0,O=m.length;x<O;++x){var M=k(f,m[x]);w.push(M)}return w}var K=m.indexOf(".");if(K!==-1){var te=f[m.substr(0,K)];return te==null?void 0:k(te,m.substr(K+1))}}function E(f,m,w){if(f&&m!==void 0&&!("isFrozen"in Object&&Object.isFrozen(f)))if(typeof m!="string"&&"length"in m){y(typeof w!="string"&&"length"in w);for(var x=0,O=m.length;x<O;++x)E(f,m[x],w[x])}else{var M,K,te=m.indexOf(".");te!==-1?(M=m.substr(0,te),(K=m.substr(te+1))===""?w===void 0?s(f)&&!isNaN(parseInt(M))?f.splice(M,1):delete f[M]:f[M]=w:E(te=!(te=f[M])||!d(f,M)?f[M]={}:te,K,w)):w===void 0?s(f)&&!isNaN(parseInt(m))?f.splice(m,1):delete f[m]:f[m]=w}}function I(f){var m,w={};for(m in f)d(f,m)&&(w[m]=f[m]);return w}var D=[].concat;function A(f){return D.apply([],f)}var Wr="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(A([8,16,32,64].map(function(f){return["Int","Uint","Float"].map(function(m){return m+f+"Array"})}))).filter(function(f){return i[f]}),R=new Set(Wr.map(function(f){return i[f]})),B=null;function P(f){return B=new WeakMap,f=function m(w){if(!w||typeof w!="object")return w;var x=B.get(w);if(x)return x;if(s(w)){x=[],B.set(w,x);for(var O=0,M=w.length;O<M;++O)x.push(m(w[O]))}else if(R.has(w.constructor))x=w;else{var K,te=u(w);for(K in x=te===Object.prototype?{}:Object.create(te),B.set(w,x),w)d(w,K)&&(x[K]=m(w[K]))}return x}(f),B=null,f}var $={}.toString;function V(f){return $.call(f).slice(8,-1)}var N=typeof Symbol<"u"?Symbol.iterator:"@@iterator",q=typeof N=="symbol"?function(f){var m;return f!=null&&(m=f[N])&&m.apply(f)}:function(){return null};function J(f,m){return m=f.indexOf(m),0<=m&&f.splice(m,1),0<=m}var ie={};function de(f){var m,w,x,O;if(arguments.length===1){if(s(f))return f.slice();if(this===ie&&typeof f=="string")return[f];if(O=q(f)){for(w=[];!(x=O.next()).done;)w.push(x.value);return w}if(f==null)return[f];if(typeof(m=f.length)!="number")return[f];for(w=new Array(m);m--;)w[m]=f[m];return w}for(m=arguments.length,w=new Array(m);m--;)w[m]=arguments[m];return w}var ee=typeof Symbol<"u"?function(f){return f[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Ke=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],er=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ke),j={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 U(f,m){this.name=f,this.message=m}function Z(f,m){return f+". Errors: "+Object.keys(m).map(function(w){return m[w].toString()}).filter(function(w,x,O){return O.indexOf(w)===x}).join(`
40
+ This will fail in production.`);o=ZA,o._s.has(e)||(a?Tde(e,t,r,o):TVe(e,r,o),ze.env.NODE_ENV!=="production"&&(i._pinia=o));const u=o._s.get(e);if(ze.env.NODE_ENV!=="production"&&s){const c="__hot:"+e,d=a?Tde(c,t,r,o,!0):TVe(c,Uy({},r),o,!0);s._hotUpdate(d),delete o.state.value[c],o._s.delete(c)}if(ze.env.NODE_ENV!=="production"&&AS){const c=_a();if(c&&c.proxy&&!s){const d=c.proxy,p="_pStores"in d?d._pStores:d._pStores={};p[e]=u}}return u}return i.$id=e,i}function sr(e){const t=ra(e),n={};for(const r in t){const a=t[r];a.effect?n[r]=z({get:()=>e[r],set(i){e[r]=i}}):(Or(a)||Tl(a))&&(n[r]=os(e,r))}return n}function E7t(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(t,n){(e.get(t)||[]).slice().map(function(r){r(n)}),(e.get("*")||[]).slice().map(function(r){r(t,n)})}}}function Dde(e,t,n){if(!n)return t;const r=e==null?void 0:e[n];if(r==null)throw new Error(`Key is ${r} on item (keyField is '${n}')`);return r}function eO(e,t){return e.map((n,r)=>Dde(n,r,t))}function x7t(e,t,n){const r=[],a=[];for(let i=0;i<e.length;i++){const o=e[i],s=Dde(o,i,t),l=n(o,i,s);r.push(s),a.push(typeof l=="number"&&l>0?l:null)}return{keys:r,sizes:a}}function T7t(e,t,n){if(!e||e.keys.length!==t.length||e.sizes.length!==t.length)return!1;for(let r=0;r<t.length;r++)if(e.keys[r]!==Dde(t[r],r,n))return!1;return!0}function Ade(e,t,n){if(!T7t(e,t,n))return{};const r={};for(let a=0;a<e.keys.length;a++){const i=e.sizes[a];typeof i=="number"&&i>0&&(r[e.keys[a]]=i)}return r}function DVe(e,t){if(!e.length||t.length<=e.length)return 0;const n=e[0],r=t.indexOf(n);if(r<=0||r+e.length<t.length&&e.length>t.length-r)return 0;for(let a=0;a<e.length;a++)if(t[r+a]!==e[a])return 0;return r}function AVe(e,t,n,r,a,i=0){const o=a??"start";if(o==="nearest"){const s=n+r,l=e+t;return e>=n&&l<=s?null:e<n?e+i:l-r+i}return o==="end"?e+t-r+i:o==="center"?e+(t-r)/2+i:e+i}function OVe(e,t,n,r){let a=null,i=null,o=null,s=!1,l=null;const u=[],c=n.resizeObserver?()=>{}:n.onVscrollUpdate(b),d=z(()=>{const B=xn(e);if(n.vscrollData.simpleArray){if(B.index==null)throw new Error("index is required when using simple-array mode with dynamic item measurement");return B.index}if(n.vscrollData.keyField in B.item)return B.item[n.vscrollData.keyField];throw new Error(`keyField '${n.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`)}),p=z(()=>n.vscrollData.sizes[d.value]||0),h=z(()=>xn(e).active&&n.vscrollData.active);function g(){h.value?i!==d.value&&(i=d.value,a=null,o=null,y(d.value)):a=d.value}function v(){xn(e).watchData&&!n.resizeObserver?l=lt(()=>xn(e).item,()=>{_()},{deep:!0}):l&&(l(),l=null)}function b({force:B}){!h.value&&B&&(o=d.value),(a===d.value||B||!p.value)&&g()}function _(){g()}function C(B){n.undefinedMap[B]&&n.undefinedSizeCount.value--,n.undefinedMap[B]=void 0}function S(B,P){if(n.vscrollData.sizes[B]){C(B);return}if(P){n.undefinedMap[B]||n.undefinedSizeCount.value++,n.undefinedMap[B]=!0;return}n.undefinedMap[B]&&(n.undefinedSizeCount.value--,n.undefinedMap[B]=!1)}function y(B){Ct(()=>{if(d.value===B){const P=xn(t);if(!P)return;const $=P.offsetWidth,V=P.offsetHeight;T($,V)}i=null})}function T(B,P){const $=~~(n.direction.value==="vertical"?P:B);$&&p.value!==$&&k($)}function k(B){var P,$;C(d.value),n.vscrollData.sizes[d.value]=B,xn(e).emitResize&&(($=(P=xn(r))==null?void 0:P.onResize)==null||$.call(P,d.value))}function E(){if(!n.resizeObserver||s)return;const B=xn(t);B&&(n.resizeObserver.observe(B),B.$_vs_id=d.value,B.$_vs_onResize=D,s=!0)}function I(){if(!n.resizeObserver||!s)return;const B=xn(t);B&&(n.resizeObserver.unobserve(B),B.$_vs_onResize=void 0,s=!1)}function D(B,P,$){d.value===B&&T(P,$)}u.push(lt(()=>xn(e).watchData,()=>{v()})),n.resizeObserver||u.push(lt(()=>xn(e).sizeDependencies,()=>{_()},{deep:!0})),u.push(lt(d,(B,P)=>{const $=xn(t);$&&($.$_vs_id=B),C(P),S(B,h.value);const V=n.vscrollData.sizes[B];if(!V){a=B,_();return}C(B),s&&(n.vscrollData.sizes[B]=V)})),u.push(lt(h,B=>{S(d.value,B),n.resizeObserver?B?E():I():B&&o===d.value&&g()})),v();function A(){h.value&&(g(),E())}function R(){c(),I(),C(d.value);const B=xn(t);B&&(B.$_vs_id=void 0,B.$_vs_onResize=void 0),l&&(l(),l=null);for(const P of u)P();u.length=0}return{id:d,size:p,finalActive:h,updateSize:g,mount:A,unmount:R}}const IVe={itemsLimit:1e3};function RVe(e){return typeof window<"u"&&e===window}const D7t=(()=>{if(typeof document>"u")return"negative";const e=document.createElement("div"),t=document.createElement("div");e.style.width="4px",e.style.height="1px",e.style.overflow="auto",e.style.direction="rtl",t.style.width="8px",t.style.height="1px",e.appendChild(t),document.body.appendChild(e),e.scrollLeft=-1;const n=e.scrollLeft<0;return document.body.removeChild(e),n?"negative":"default"})();function nP(e,t,n){return t!=="horizontal"||!n||RVe(n)||getComputedStyle(n).direction!=="rtl"?e:D7t==="negative"?-e:e}function A7t(e,t,n){return nP(e,t,n)}function Ode(e,t,n,r){const a=A7t(n,t,e),i=!!(r!=null&&r.smooth);if(RVe(e)){t==="vertical"?e.scrollTo({top:a,behavior:i?"smooth":"auto"}):e.scrollTo({left:a,behavior:i?"smooth":"auto"});return}if(typeof e.scrollTo=="function"){e.scrollTo(t==="vertical"?{top:a,behavior:i?"smooth":"auto"}:{left:a,behavior:i?"smooth":"auto"});return}t==="vertical"?e.scrollTop=a:e.scrollLeft=a}function O7t(e,t,n){return n?t==="vertical"?window.innerHeight:window.innerWidth:t==="vertical"?e.clientHeight:e.clientWidth}const I7t=/auto|scroll/;function $Ve(e,t){return e.parentNode===null?t:$Ve(e.parentNode,[...t,e])}function Ide(e,t){return getComputedStyle(e,null).getPropertyValue(t)}function R7t(e){return Ide(e,"overflow")+Ide(e,"overflow-y")+Ide(e,"overflow-x")}function $7t(e){return I7t.test(R7t(e))}function Jq(e){if(!(e instanceof HTMLElement||e instanceof SVGElement))return;const t=$Ve(e.parentNode,[]);for(let n=0;n<t.length;n+=1)if(t[n]instanceof Element&&$7t(t[n]))return t[n];return document.scrollingElement||document.documentElement}let Rde=!1;function P7t(){return Rde}if(typeof window<"u"){Rde=!1;try{const e=Object.defineProperty({},"passive",{get(){Rde=!0}});window.addEventListener("test",null,e)}catch{}}let M7t=0;function $de(e){const t=e;t._vs_styleStamp++}function N7t(e,t,n){const r=e==null?void 0:e[n];if(r==null)throw new Error(`Key is ${r} on item (keyField is '${n}')`);return r}function Pde(e,t,n,r,a){const i=W([]),o=W(0),s=W(!1);let l=0,u=0;const c=new Map,d=new Map;let p=!1,h=0,g=0,v=!1,b=null,_=null,C=null,S=0,y=null,T=[],k=null,E=null,I=null,D=!1;const A=new Set,R=W({}),B=z(()=>{const _t=xn(e);return _t.items.length>0&&typeof _t.items[0]!="object"}),P=z(()=>{const _t=xn(e);if(_t.itemSize===null){const Et={[-1]:{accumulator:0}},qt=_t.items,le=_t.sizeField??"size",we=_t.minItemSize,Xe=R.value;let rt=1e4,He=0,$e;for(let kt=0,Gt=qt.length;kt<Gt;kt++){const Ut=B.value?kt:N7t(qt[kt],kt,_t.keyField);$e=Xe[Ut]||qt[kt][le]||we,$e<rt&&(rt=$e),He+=$e,Et[kt]={accumulator:He,size:$e}}return S=rt,Et}return[]}),$=z(()=>i.value.filter(_t=>_t.nr.used).sort((_t,Et)=>_t.nr.index-Et.nr.index)),V=z(()=>{const _t=xn(e),Et=B.value?null:_t.keyField;return x7t(_t.items,Et,(qt,le,we)=>_t.itemSize!=null?_t.itemSize:R.value[we]||(qt==null?void 0:qt[_t.sizeField??"size"])||void 0)});function N(_t){const Et=xn(e);return R.value=Ade(_t,Et.items,B.value?null:Et.keyField),Object.keys(R.value).length>0}function q(_t){let Et=d.get(_t);return Et||(Et=[],d.set(_t,Et)),Et}function J(_t,Et,qt,le,we){const Xe=Ms({id:M7t++,index:Et,used:!0,key:le,type:we}),rt=ALe({item:qt,position:0,offset:0,nr:Xe,_vs_styleStamp:0});return _t.push(rt),rt}function ie(_t){const Et=q(_t);if(Et&&Et.length){const qt=Et.pop();return qt.nr.used=!0,$de(qt),qt}}function de(_t){const Et=_t.nr.type;q(Et).push(_t),_t.nr.used=!1,_t.position=-9999,$de(_t),c.delete(_t.nr.key)}function ee(){c.clear(),d.clear();for(let _t=0,Et=i.value.length;_t<Et;_t++){const qt=i.value[_t];qt&&de(qt)}}function j(_t){let Et=-1;return Et=requestAnimationFrame(()=>{A.delete(Et),_t()}),A.add(Et),Et}function U(){for(const _t of A)cancelAnimationFrame(_t);A.clear()}function Z(){b&&(clearTimeout(b),b=null),_&&(clearTimeout(_),_=null),C&&(clearTimeout(C),C=null),E&&(clearTimeout(E),E=null),I&&(clearTimeout(I),I=null)}function oe(){var _t;(_t=a==null?void 0:a.onResize)==null||_t.call(a),s.value&&Ge(!1)}function fe(){k&&!D&&xe();const _t=xn(e);if(!p){if(p=!0,b)return;const Et=()=>j(()=>{p=!1;const{continuous:qt}=Ge(!1,!0);qt||(_&&clearTimeout(_),_=setTimeout(fe,_t.updateInterval+100))});Et(),_t.updateInterval&&(b=setTimeout(()=>{b=null,p&&Et()},_t.updateInterval))}}function ae(_t,Et){var qt,le;s.value&&(_t||Et.boundingClientRect.width!==0||Et.boundingClientRect.height!==0?((qt=a==null?void 0:a.onVisible)==null||qt.call(a),j(()=>{Ge(!1)})):(le=a==null?void 0:a.onHidden)==null||le.call(a))}function G(){const _t=xn(t),Et=_t?Jq(_t):void 0;return window.document&&(Et===window.document.documentElement||Et===window.document.body)?window:Et||window}function Y(){const _t=xn(n);return _t?xn(e).direction==="vertical"?_t.scrollHeight:_t.scrollWidth:0}function Ee(){const _t=xn(t);if(!_t)return{start:0,end:0};const Et=xn(e),qt=Et.direction==="vertical";let le;if(Et.pageMode){const we=_t.getBoundingClientRect(),Xe=qt?we.height:we.width;let rt=-(qt?we.top:we.left),He=qt?window.innerHeight:window.innerWidth;rt<0&&(He+=rt,rt=0),rt+He>Xe&&(He=Xe-rt),le={start:rt,end:rt+He}}else qt?le={start:_t.scrollTop,end:_t.scrollTop+_t.clientHeight}:le={start:nP(_t.scrollLeft,Et.direction,_t),end:nP(_t.scrollLeft,Et.direction,_t)+_t.clientWidth};return le}function he(){const _t=xn(t);if(!_t)return{start:0,end:0};if(xn(e).direction==="vertical"){const Et=nP(_t.scrollLeft,"horizontal",_t);return{start:Et,end:Et+_t.clientWidth}}return{start:_t.scrollTop,end:_t.scrollTop+_t.clientHeight}}function Pe(_t){const Et=xn(e);if(Et.itemSize!=null)return Et.itemSize;const qt=P.value[_t];return(qt==null?void 0:qt.size)||Number(Et.minItemSize)||0}function Te(_t){var Et;const qt=xn(e),le=qt.gridItems||1;return _t<=0?0:qt.itemSize!=null?Math.floor(_t/le)*qt.itemSize:((Et=P.value[_t-1])==null?void 0:Et.accumulator)||0}function Ae(_t){const Et=xn(e),qt=Et.items.length,le=Et.gridItems||1;if(!qt)return 0;if(Et.itemSize!=null){const He=Math.floor(_t/Et.itemSize)*le;return Math.min(Math.max(He,0),qt-1)}let we=0,Xe=qt-1,rt=0;for(;we<=Xe;){const He=Math.floor((we+Xe)/2);Te(He)<=_t?(rt=He,we=He+1):Xe=He-1}return rt}function xe(){E&&(clearTimeout(E),E=null),k=null}function Je(){E&&clearTimeout(E),E=setTimeout(()=>{k=null,E=null},150)}function We(_t,Et){if(!_t.length){xe();return}const qt=Math.max(Ee().start-Y(),0),le=Math.min(Ae(qt),_t.length-1),we=_t[le],Xe=Et?we==null?void 0:we[Et]:le;if(Xe==null){xe();return}const rt=Y()+Te(le);k={key:Xe,offset:Ee().start-rt}}function Ye(_t){if(!k)return!1;const Et=xn(e),qt=_t??Et.items,le=B.value?null:Et.keyField,we=eO(qt,le).indexOf(k.key);if(we===-1)return xe(),!1;const Xe=Y()+Te(we)+k.offset,rt=Ee().start;return Math.abs(Xe-rt)<.5?!1:(D=!0,It(Xe),j(()=>{D=!1}),!0)}function Ze(){xn(e).pageMode?ne():se()}function ne(){y=G(),y.addEventListener("scroll",fe,P7t()?{passive:!0}:!1),y.addEventListener("resize",oe)}function se(){y&&(y.removeEventListener("scroll",fe),y.removeEventListener("resize",oe),y=null)}function Ue(_t,Et,qt,le,we,Xe){const rt=Math.ceil(_t/Et)*qt,He=Math.max(0,Math.floor(we.start/qt)),$e=Math.min(Math.ceil(we.end/qt),Math.ceil(_t/Et)),kt=Math.max(0,Math.floor(Xe.start/le)),Gt=Math.min(Math.ceil(Xe.end/le),Et),Ut=[];for(let gt=He;gt<$e;gt++){const wt=gt*Et;for(let xt=kt;xt<Gt;xt++){const Ht=wt+xt;if(Ht>=_t)break;Ut.push(Ht)}}const Jt=Ut[0]??0,dn=Ut.at(-1)??-1;return{renderedIndices:Ut,startIndex:Jt,endIndex:dn+1,visibleStartIndex:Jt,visibleEndIndex:dn,totalSize:rt}}function je(){const _t=xn(e);if(!_t.gridItems||_t.itemSize==null)return!1;const Et=xn(t);if(!Et)return!1;const qt=_t.itemSecondarySize||_t.itemSize,le=_t.direction==="vertical"?Et.clientWidth:Et.clientHeight;return qt*_t.gridItems>le}function Ge(_t,Et=!1){var qt,le;const we=xn(e),Xe=we.itemSize,rt=we.gridItems||1,He=we.itemSecondarySize||Xe,$e=S,kt=we.typeField,Gt=B.value?null:we.keyField,Ut=we.items,Jt=Ut.length,dn=P.value,gt=c,wt=i.value;let xt=null,Ht=null,wn,An,Vt,ln,di;if(!Jt)wn=An=ln=di=Vt=0;else if(v)wn=ln=0,An=di=Math.min(we.prerender,Ut.length),Vt=0;else{const Yn=Ee(),ar=he();if(Et){let or=Yn.start-h;or<0&&(or=-or);let no=ar.start-g;no<0&&(no=-no);const ia=Xe===null&&or>=$e||Xe!==null&&or>=Xe,un=rt>1&&Xe!=null&&no>=He;if(!ia&&!un)return{continuous:!0}}h=Yn.start,g=ar.start;const yr=we.buffer;Yn.start-=yr,Yn.end+=yr,ar.start-=yr,ar.end+=yr;let cs=0;const Dr=xn(n);Dr&&(cs=Dr.scrollHeight,Yn.start-=cs);const Do=xn(r);if(Do){const or=Do.scrollHeight;Yn.end+=or}if(Xe===null){let or,no=0,ia=Jt-1,un=~~(Jt/2),oa;do oa=un,or=dn[un].accumulator,or<Yn.start?no=un:un<Jt-1&&dn[un+1].accumulator>Yn.start&&(ia=un),un=~~((no+ia)/2);while(un!==oa);for(un<0&&(un=0),wn=un,Vt=dn[Jt-1].accumulator,An=un;An<Jt&&dn[An].accumulator<Yn.end;An++);for(An===-1?An=Ut.length-1:(An++,An>Jt&&(An=Jt)),ln=wn;ln<Jt&&cs+dn[ln].accumulator<Yn.start;ln++);for(di=ln;di<Jt&&cs+dn[di].accumulator<Yn.end;di++);}else if(rt>1){const or=Ue(Jt,rt,Xe,He,Yn,ar);xt=or.renderedIndices,Ht=new Set(xt),wn=or.startIndex,An=or.endIndex,ln=or.visibleStartIndex,di=or.visibleEndIndex,Vt=or.totalSize}else{wn=~~(Yn.start/Xe*rt);const or=wn%rt;wn-=or,An=Math.ceil(Yn.end/Xe*rt),ln=Math.max(0,Math.floor((Yn.start-cs)/Xe*rt)),di=Math.floor((Yn.end-cs)/Xe*rt),wn<0&&(wn=0),An>Jt&&(An=Jt),ln<0&&(ln=0),di>Jt&&(di=Jt),Vt=Math.ceil(Jt/rt)*Xe}}An-wn>IVe.itemsLimit&&Ke(),o.value=Vt;let lr;const ca=wn<=u&&An>=l;if(!ca||_t)ee();else for(let Yn=0,ar=wt.length;Yn<ar;Yn++){const yr=wt[Yn];if(yr&&(lr=yr,lr.nr.used)){const cs=Ht?Ht.has(lr.nr.index):lr.nr.index>=wn&&lr.nr.index<An,Dr=Xe||dn[lr.nr.index]&&dn[lr.nr.index].size;(!cs||!Dr)&&de(lr)}}let gi,Zs;const Lr=xt??Array.from({length:Math.max(0,An-wn)},(Yn,ar)=>wn+ar);for(const Yn of Lr){if(!(Xe||dn[Yn]&&dn[Yn].size))continue;gi=Ut[Yn];const ar=Gt?gi[Gt]:Yn;if(ar==null)throw new Error(`Key is ${ar} on item (keyField is '${Gt}')`);if(lr=gt.get(ar),lr)lr.item!==gi&&(lr.item=gi),lr.nr.used||console.warn(`Expected existing view's used flag to be true, got ${lr.nr.used}`);else{if(Zs=gi[kt],lr=ie(Zs),lr){const yr=lr.nr.index!==Yn||lr.nr.key!==ar;lr.item=gi,lr.nr.index=Yn,lr.nr.key=ar,lr.nr.type!==Zs&&console.warn("Reused view's type does not match pool's type"),yr&&$de(lr)}else lr=J(wt,Yn,gi,ar,Zs);gt.set(ar,lr)}Xe===null?(lr.position=((qt=dn[Yn-1])==null?void 0:qt.accumulator)||0,lr.offset=0):(lr.position=Math.floor(Yn/rt)*Xe,lr.offset=Yn%rt*He)}return l=wn,u=An,we.emitUpdate&&((le=a==null?void 0:a.onUpdate)==null||le.call(a,wn,An,ln,di)),C&&clearTimeout(C),C=setTimeout(mt,we.updateInterval+300),{continuous:ca}}function Ke(){throw I=setTimeout(()=>{I=null,console.warn("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",xn(t)),console.warn("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")}function ut(){if(je())return!1;const _t=i.value.filter(({nr:Et})=>Et.used);for(let Et=1;Et<_t.length;Et++)if(_t[Et].nr.index!==_t[Et-1].nr.index+1)return!0;return!1}function mt(){i.value.sort((_t,Et)=>_t.nr.index-Et.nr.index),ut()&&(Ge(!1),C&&clearTimeout(C))}function ht(_t,Et){const qt=xn(e),le=xn(t);if(!le)return;const we=Math.max(0,Math.min(_t,qt.items.length-1)),Xe=Ee().start,rt=O7t(le,qt.direction,qt.pageMode),He=Te(we),$e=Pe(we),kt=AVe(He,$e,Xe,rt,Et==null?void 0:Et.align,(Et==null?void 0:Et.offset)??0);if(kt!=null&&(It(kt,Et),qt.gridItems&&qt.itemSize!=null)){const Gt=xn(t);if(!Gt)return;const Ut=qt.gridItems,Jt=qt.itemSecondarySize||qt.itemSize,dn=we%Ut*Jt,gt=qt.direction==="vertical"?"horizontal":"vertical",wt=gt==="horizontal"?nP(Gt.scrollLeft,"horizontal",Gt):Gt.scrollTop,xt=gt==="horizontal"?Gt.clientWidth:Gt.clientHeight,Ht=AVe(dn,Jt,wt,xt,Et==null?void 0:Et.align,(Et==null?void 0:Et.offset)??0);Ht!=null&&Ode(Gt,gt,Ht,Et)}}function It(_t,Et){const qt=xn(e),le=xn(t);if(le)if(qt.pageMode){const we=Jq(le),Xe=we.getBoundingClientRect(),rt=le.getBoundingClientRect(),He=qt.direction==="vertical"?"top":"left",$e=Jq(le)===document.documentElement||Jq(le)===document.body?qt.direction==="vertical"?window.scrollY:window.scrollX:nP(qt.direction==="vertical"?we.scrollTop:we.scrollLeft,qt.direction,we),kt=rt[He]-Xe[He];Ode(we.tagName==="HTML"?window:we,qt.direction,_t+$e+kt,Et)}else Ode(le,qt.direction,_t,Et)}const Lt=xn(e);return T=eO(Lt.items,Lt.items.length>0&&typeof Lt.items[0]!="object"?null:Lt.keyField),Lt.cache&&N(Lt.cache),Lt.prerender&&(v=!0,Ge(!1)),Lt.gridItems&&!Lt.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems"),nn(()=>{Ze(),Ct(()=>{v=!1,Ge(!0),s.value=!0})}),H$(()=>{const _t=h;typeof _t=="number"&&Ct(()=>{It(_t)})}),$r(()=>{Z(),U(),se()}),lt(()=>xn(e).cache,_t=>{N(_t),Ge(!0)}),lt(()=>xn(e).items,(_t,Et)=>{const qt=xn(e),le=B.value?null:qt.keyField,we=eO(_t,le);if(qt.shift){const Xe=Et?eO(Et,le):T;DVe(Xe,we)>0?We(Et??[],le):xe()}else xe();T=we,Ye(_t),Ge(!0)}),lt(()=>xn(e).pageMode,()=>{Ze(),Ge(!1)}),lt(P,()=>{Ye()&&Je(),Ge(!1)},{deep:!0}),lt(()=>xn(e).gridItems,()=>{Ge(!0)}),lt(()=>xn(e).itemSecondarySize,()=>{Ge(!0)}),{pool:i,visiblePool:$,totalSize:o,ready:s,sizes:P,simpleArray:B,scrollToItem:ht,scrollToPosition:It,getScroll:Ee,findItemIndex:Ae,getItemOffset:Te,getItemSize:Pe,cacheSnapshot:V,restoreCache:N,updateVisibleItems:Ge,handleScroll:fe,handleResize:oe,handleVisibilityChange:ae,sortViews:mt}}function Mde(e){return e.item}function L7t(e){return e._vs_styleStamp??0}const PVe=["position","top","left","transform","willChange","visibility","pointerEvents"];function MVe(e){const t={};for(const n of PVe)t[n]=e.style[n];return t}function NVe(e,t){for(const n of PVe)e.style[n]=t[n]??""}function LVe(e,t,n,r){if(!("view"in t)){NVe(e,r);return}const a=n==="vertical",i=e.tagName==="TR",o=a?`translateY(${t.view.position}px) translateX(${t.view.offset}px)`:`translateX(${t.view.position}px) translateY(${t.view.offset}px)`;e.style.position="absolute",e.style.top=a&&i?`${t.view.position}px`:"0px",e.style.left=!a&&i?`${t.view.position}px`:"0px",e.style.transform=i?"":o,e.style.willChange=i?"unset":"transform",e.style.visibility=t.view.nr.used?"visible":"hidden",e.style.pointerEvents=t.view.nr.used?"":"none"}function FVe(e){return"view"in e?{item:Mde(e.view).item,active:e.view.nr.used,index:e.view.nr.index,watchData:e.watchData??!1,emitResize:e.emitResize??!1,sizeDependencies:e.sizeDependencies??null,onResize:e.onResize}:{watchData:!1,emitResize:!1,sizeDependencies:null,...e}}function BVe(e,t,n,r){return n?r??null:(e==null?void 0:e[t])??null}function F7t(e){let t=0,n={};const r=E7t();let a=!1,i,o=!1,s=[],l=null,u=null;const c=new Set,d=Wn({active:!0,sizes:{},keyField:xn(e).keyField,simpleArray:!1}),p=z(()=>xn(e).direction),h=z(()=>xn(xn(e).el)),g=z(()=>xn(xn(e).before)),v=z(()=>xn(xn(e).after)),b=new Map;function _(ae){let G=-1;return G=requestAnimationFrame(()=>{c.delete(G),ae()}),c.add(G),G}function C(){for(const ae of c)cancelAnimationFrame(ae);c.clear()}typeof ResizeObserver<"u"&&(i=new ResizeObserver(ae=>{_(()=>{if(Array.isArray(ae)){for(const G of ae)if(G.target&&G.target.$_vs_onResize){let Y,Ee;if(G.borderBoxSize){const he=G.borderBoxSize[0];Y=he.inlineSize,Ee=he.blockSize}else Y=G.contentRect.width,Ee=G.contentRect.height;G.target.$_vs_onResize(G.target.$_vs_id,Y,Ee)}}})}));const S={vscrollData:d,resizeObserver:i,direction:p,undefinedMap:n,undefinedSizeCount:{get value(){return t},set value(ae){t=ae}},onVscrollUpdate(ae){const G=Y=>{ae(Y)};return r.on("vscroll:update",G),()=>r.off("vscroll:update",G)}};Yc("vscrollData",d),Yc("vscrollParent",{get $_undefinedSizes(){return t},set $_undefinedSizes(ae){t=ae},get $_undefinedMap(){return n},set $_undefinedMap(ae){n=ae},$_events:r,direction:p}),Yc("vscrollResizeObserver",i),Yc("vscrollMeasurementContext",S),Yc("vscrollAnchorRegistry",{delete(ae){b.delete(ae)},set(ae,G){b.set(ae,G)}});const y=z(()=>{const ae=xn(e);return ae.items.length>0&&typeof ae.items[0]!="object"}),T=z(()=>{const ae=[],G=xn(e),{items:Y,keyField:Ee}=G,he=y.value,Pe=d.sizes,Te=Y.length;for(let Ae=0;Ae<Te;Ae++){const xe=Y[Ae],Je=he?Ae:xe[Ee];let We=Pe[Je];typeof We>"u"&&!n[Je]&&(We=0),ae.push({item:xe,id:Je,size:We})}return ae}),k=xn(e);s=eO(k.items,y.value?null:k.keyField),k.cache&&(d.sizes=Ade(k.cache,k.items,y.value?null:k.keyField));const E=z(()=>{const ae=xn(e);return{items:T.value,keyField:"id",direction:ae.direction,itemSize:null,gridItems:void 0,itemSecondarySize:void 0,minItemSize:ae.minItemSize,sizeField:"size",typeField:"type",buffer:ae.buffer??200,pageMode:ae.pageMode??!1,shift:!1,cache:ae.cache,prerender:ae.prerender??0,emitUpdate:ae.emitUpdate??!1,updateInterval:ae.updateInterval??0}});function I(){var ae,G;ee(),(G=(ae=xn(e)).onResize)==null||G.call(ae)}function D(){var ae,G;r.emit("vscroll:update",{force:!1}),(G=(ae=xn(e)).onVisible)==null||G.call(ae)}const A=Pde(E,h,g,v,{onResize:I,onVisible:D,onHidden:()=>{var ae,G;return(G=(ae=xn(e)).onHidden)==null?void 0:G.call(ae)},onUpdate:(ae,G,Y,Ee)=>{var he,Pe;return(Pe=(he=xn(e)).onUpdate)==null?void 0:Pe.call(he,ae,G,Y,Ee)}}),R=new WeakMap;function B(){u!=null&&(cancelAnimationFrame(u),c.delete(u),u=null)}function P(){B(),l=null}function $(){l==null||u!=null||(u=_(()=>{u=null,J()}))}function V(){const ae=h.value;if(!ae)return null;const G=ae.getBoundingClientRect();let Y=null;for(const[Ee,he]of b.entries()){if(!he.active||getComputedStyle(Ee).visibility==="hidden")continue;const Pe=Ee.getBoundingClientRect();if(Pe.bottom<=G.top||Pe.top>=G.bottom)continue;const Te=Math.max(Pe.top,G.top)-G.top;(!Y||Te<Y.score)&&(Y={key:he.id,offset:Pe.top-G.top,score:Te})}return Y}function N(ae){const G=h.value;if(!G){P();return}const Y=G.scrollTop,Ee=Math.min(A.findItemIndex(Y),ae.length-1),he=ae[Ee];if(he==null){P();return}const Pe=V();l={logicalKey:he,logicalOffset:Y-A.getItemOffset(Ee),pendingKeys:new Set,stableFrames:0,visualKey:(Pe==null?void 0:Pe.key)??null,visualOffset:(Pe==null?void 0:Pe.offset)??0}}function q(ae){const G=h.value;return!G||Math.abs(G.scrollTop-ae)<.5?!1:(o=!0,G.scrollTop=ae,G.dispatchEvent(new Event("scroll")),_(()=>{o=!1}),!0)}function J(){const ae=l,G=h.value;if(!ae||!G)return;const Y=T.value.findIndex(Te=>Te.id===ae.logicalKey);if(Y===-1){P();return}let Ee=!1;const he=A.getItemOffset(Y)+ae.logicalOffset;if(Ee=q(he)||Ee,ae.visualKey!=null)for(const[Te,Ae]of b.entries()){if(!Ae.active||Ae.id!==ae.visualKey||getComputedStyle(Te).visibility==="hidden")continue;const xe=Te.getBoundingClientRect().top-G.getBoundingClientRect().top-ae.visualOffset;Ee=q(G.scrollTop+xe)||Ee;break}let Pe=!0;for(const Te of ae.pendingKeys)if(!(typeof d.sizes[Te]=="number"&&d.sizes[Te]>0)){Pe=!1;break}if(!Ee&&Pe){if(ae.stableFrames++,ae.stableFrames>=2){P();return}}else ae.stableFrames=0;$()}function ie(ae,G,Y,Ee){const he=yS(),Pe=Hl(G),Te=Hl(Y),Ae=Hl({onResize:Y.onResize}),xe=Hl(ae),Je=he.run(()=>(lt(()=>{const We=Pe.value;if(!("view"in We))return{active:Te.value.active,direction:p.value,id:BVe(Te.value.item,xn(e).keyField,d.simpleArray,Te.value.index),legacy:!0};const{view:Ye}=We;return{active:Ye.nr.used,direction:p.value,id:Mde(Ye).id,legacy:!1,position:Ye.position,offset:Ye.offset,styleStamp:L7t(Ye)}},()=>{const We=xe.value;if(We){const Ye=Pe.value,Ze="view"in Ye?Mde(Ye.view).id:BVe(Te.value.item,xn(e).keyField,d.simpleArray,Te.value.index);Ze!=null&&b.set(We,{active:Te.value.active&&d.active,id:Ze}),LVe(We,Pe.value,p.value,Ee)}},{immediate:!0}),OVe(Te,xe,S,Ae)));Je.mount(),R.set(ae,{binding:Pe,scope:he,options:Te,callbacks:Ae,el:xe,controller:Je,restoreStyles:Ee})}const de={mounted(ae,G){const Y=MVe(ae);ie(ae,G.value,FVe(G.value),Y)},updated(ae,G){const Y=R.get(ae),Ee=FVe(G.value);if(!Y){const he=MVe(ae);ie(ae,G.value,Ee,he);return}Y.binding.value=G.value,Y.options.value=Ee,Y.callbacks.value={onResize:Ee.onResize},Y.el.value=ae,LVe(ae,G.value,p.value,Y.restoreStyles)},unmounted(ae){const G=R.get(ae);G&&(G.controller.unmount(),G.scope.stop(),NVe(ae,G.restoreStyles),b.delete(ae),R.delete(ae))}};function ee(ae=!1){(ae||y.value)&&(d.sizes={}),r.emit("vscroll:update",{force:!0})}function j(ae,G){A.scrollToItem(ae,G)}function U(ae){const G=xn(e);return d.sizes=Ade(ae,G.items,y.value?null:G.keyField),A.restoreCache(ae)}function Z(ae,G){const Y=xn(e),Ee=y.value?G??Y.items.indexOf(ae):ae[Y.keyField];return d.sizes[Ee]||0}function oe(){const ae=h.value;ae&&(a||(a=!0,Ct(()=>{ae.scrollTop=ae.scrollHeight+5e3;const G=()=>{ae.scrollTop=ae.scrollHeight+5e3,_(()=>{ae.scrollTop=ae.scrollHeight+5e3,t===0?a=!1:_(G)})};_(G)})))}function fe(){l&&!o&&P()}return lt(()=>xn(e).items,(ae,G)=>{const Y=xn(e),Ee=y.value?null:Y.keyField,he=eO(ae,Ee);if(Y.shift){const Pe=G?eO(G,Ee):s,Te=DVe(Pe,he);Te>0?(N(Pe),l&&(l.pendingKeys=new Set(he.slice(0,Te)),l.stableFrames=0,Ct(()=>{l&&J()}))):P()}else P();s=he,ee()},{flush:"sync"}),lt(()=>xn(e).cache,ae=>{ae&&U(ae)}),lt(y,ae=>{d.simpleArray=ae},{immediate:!0}),lt(()=>xn(e).direction,()=>{P(),ee(!0)}),lt(h,(ae,G)=>{G==null||G.removeEventListener("scroll",fe),ae==null||ae.addEventListener("scroll",fe)},{immediate:!0}),lt(T,(ae,G)=>{const Y=h.value;if(!Y)return;if(l){J();return}const Ee=Y.scrollTop,he=xn(e);let Pe=0,Te=0;const Ae=Math.min(ae.length,G.length);for(let Je=0;Je<Ae&&!(Pe>=Ee);Je++)Pe+=G[Je].size||he.minItemSize,Te+=ae[Je].size||he.minItemSize;const xe=Te-Pe;xe!==0&&(Y.scrollTop+=xe)},{flush:"post"}),H$(()=>{d.active=!0}),Ace(()=>{d.active=!1}),ss(()=>{var ae;B(),C(),(ae=h.value)==null||ae.removeEventListener("scroll",fe),r.all.clear()}),{vscrollData:d,itemsWithSize:T,resizeObserver:i,measurementContext:S,vDynamicScrollerItem:de,...A,simpleArray:y,forceUpdate:ee,scrollToItem:j,restoreCache:U,getItemSize:Z,scrollToBottom:oe,onScrollerResize:I,onScrollerVisible:D}}const Nde=new WeakMap;function B7t(e){return typeof e=="function"?{callback:e,observer:null,intersection:void 0,visible:null}:{callback:e.callback,observer:null,intersection:e.intersection,visible:null}}function VVe(e,t){UVe(e);const n=B7t(t.value);if(Nde.set(e,n),typeof IntersectionObserver>"u"){const r=e.getBoundingClientRect();n.visible=!0,n.callback(!0,{boundingClientRect:r});return}n.observer=new IntersectionObserver(r=>{const a=r[0],i=!!(a!=null&&a.isIntersecting);n.visible!==null&&n.visible===i||(n.visible=i,n.callback(i,a))},n.intersection),n.observer.observe(e)}function UVe(e){const t=Nde.get(e);t!=null&&t.observer&&(t.observer.disconnect(),t.observer=null)}const HVe={mounted(e,t){VVe(e,t)},updated(e,t){t.value!==t.oldValue&&VVe(e,t)},unmounted(e){UVe(e),Nde.delete(e)}},jVe=ct({__name:"ItemView",props:{view:{},itemTag:{}},setup(e){const t=e;return(n,r)=>(L(),qe(sc(t.itemTag),{class:"vue-recycle-scroller__item-view"},{default:Re(()=>[at(n.$slots,"default",{item:t.view.item,index:t.view.nr.index,active:t.view.nr.used})]),_:3}))}}),V7t=ct({__name:"ResizeObserver",emits:["notify"],setup(e,{emit:t}){const n=t,r=W();let a=null,i=null;function o(){n("notify")}return nn(()=>{var s;const l=(s=r.value)==null?void 0:s.parentElement;if(l){if(typeof ResizeObserver<"u"){a=new ResizeObserver(()=>{o()}),a.observe(l);return}i=()=>o(),window.addEventListener("resize",i)}}),$r(()=>{a&&(a.disconnect(),a=null),i&&(window.removeEventListener("resize",i),i=null)}),(s,l)=>(L(),re("div",{ref_key:"el",ref:r,class:"vue-recycle-scroller__resize-observer","aria-hidden":"true"},null,512))}}),U7t=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n},zVe=U7t(V7t,[["__scopeId","data-v-08cc04ab"]]),Lde=ct({__name:"RecycleScroller",props:{items:{},keyField:{default:"id"},direction:{default:"vertical"},listTag:{default:"div"},itemTag:{default:"div"},itemSize:{default:null},gridItems:{default:void 0},itemSecondarySize:{default:void 0},minItemSize:{default:null},sizeField:{default:"size"},typeField:{default:"type"},buffer:{default:200},pageMode:{type:Boolean,default:!1},shift:{type:Boolean,default:!1},cache:{default:void 0},prerender:{default:0},emitUpdate:{type:Boolean,default:!1},disableTransform:{type:Boolean,default:!1},updateInterval:{default:0},skipHover:{type:Boolean,default:!1},listClass:{default:""},itemClass:{default:""}},emits:["resize","visible","hidden","update","scrollStart","scrollEnd"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=HVe,o=W(),s=W(),l=W(),u=W(null),c=Pde(r,o,s,l,{onResize:()=>a("resize"),onVisible:()=>a("visible"),onHidden:()=>a("hidden"),onUpdate:($,V,N,q)=>{a("update",$,V,N,q),N<=0&&a("scrollStart"),q>=r.items.length-1&&a("scrollEnd")}}),{pool:d,visiblePool:p,totalSize:h,ready:g,scrollToItem:v,scrollToPosition:b,getScroll:_,findItemIndex:C,getItemOffset:S,getItemSize:y,cacheSnapshot:T,restoreCache:k,updateVisibleItems:E,handleScroll:I,handleResize:D,handleVisibilityChange:A}=c;function R($){u.value=$}function B(){u.value=null}const P=z(()=>{const $={[r.direction==="vertical"?"minHeight":"minWidth"]:`${h.value}px`};if(r.gridItems&&r.itemSize!=null){const V=(r.itemSecondarySize||r.itemSize)*r.gridItems;$[r.direction==="vertical"?"minWidth":"minHeight"]=`${V}px`}return $});return t({el:o,visiblePool:p,scrollToItem:v,scrollToPosition:b,getScroll:_,findItemIndex:C,getItemOffset:S,getItemSize:y,cacheSnapshot:T,restoreCache:k,updateVisibleItems:E}),($,V)=>ft((L(),re("div",{ref_key:"el",ref:o,class:ke(["vue-recycle-scroller",{"grid-mode":r.gridItems,ready:F(g),"page-mode":r.pageMode,[`direction-${r.direction}`]:!0}]),onScrollPassive:V[0]||(V[0]=(...N)=>F(I)&&F(I)(...N))},[$.$slots.before?(L(),re("div",{key:0,ref_key:"before",ref:s,class:"vue-recycle-scroller__slot"},[at($.$slots,"before")],512)):Ve("",!0),(L(),qe(sc(r.listTag),{style:Yt(P.value),class:ke(["vue-recycle-scroller__item-wrapper",r.listClass])},{default:Re(()=>[(L(!0),re($t,null,rn(F(d),N=>(L(),qe(jVe,Zt({key:N.nr.id,view:N,"item-tag":r.itemTag,style:F(g)?[r.disableTransform?{[r.direction==="vertical"?"top":"left"]:`${N.position}px`,willChange:"unset"}:{transform:`translate${r.direction==="vertical"?"Y":"X"}(${N.position}px) translate${r.direction==="vertical"?"X":"Y"}(${N.offset}px)`},{width:r.gridItems?`${r.direction==="vertical"&&r.itemSecondarySize||r.itemSize}px`:void 0,height:r.gridItems?`${r.direction==="horizontal"&&r.itemSecondarySize||r.itemSize}px`:void 0,visibility:N.nr.used?"visible":"hidden"}]:null,class:["vue-recycle-scroller__item-view",[r.itemClass,{hover:!r.skipHover&&u.value===N.nr.key}]]},fzt(r.skipHover?{}:{mouseenter:()=>{R(N.nr.key)},mouseleave:()=>{B()}})),{default:Re(q=>[at($.$slots,"default",Zt({ref_for:!0},q))]),_:2},1040,["view","item-tag","style","class"]))),128)),r.items.length===0?at($.$slots,"empty",{key:0}):Ve("",!0)]),_:3},8,["style","class"])),$.$slots.after?(L(),re("div",{key:1,ref_key:"after",ref:l,class:"vue-recycle-scroller__slot"},[at($.$slots,"after")],512)):Ve("",!0),De(zVe,{onNotify:F(D)},null,8,["onNotify"])],34)),[[F(i),F(A)]])}}),WVe=ct({inheritAttrs:!1,__name:"DynamicScroller",props:{items:{},keyField:{default:"id"},direction:{default:"vertical"},listTag:{default:"div"},itemTag:{default:"div"},minItemSize:{},shift:{type:Boolean,default:!1},cache:{default:void 0}},emits:["resize","visible"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=W(),o=z(()=>{var k;const E=(k=i.value)==null?void 0:k.el;return E&&typeof E=="object"&&"value"in E?E.value:E}),s=z(()=>({items:r.items,keyField:r.keyField,direction:r.direction,minItemSize:r.minItemSize,shift:r.shift,cache:r.cache,el:o.value,onResize:()=>a("resize"),onVisible:()=>a("visible")})),l=F7t(s),{itemsWithSize:u,forceUpdate:c,scrollToItem:d,scrollToPosition:p,findItemIndex:h,getItemOffset:g,getItemSize:v,cacheSnapshot:b,restoreCache:_,scrollToBottom:C,onScrollerResize:S,onScrollerVisible:y}=l;function T(k,E,I){return{item:k.item,index:E,active:I,itemWithSize:k}}return t({scrollToItem:d,scrollToPosition:p,findItemIndex:h,getItemOffset:g,scrollToBottom:C,getItemSize:v,cacheSnapshot:b,restoreCache:_,forceUpdate:c}),(k,E)=>(L(),qe(Lde,Zt({ref_key:"scroller",ref:i,items:F(u),"min-item-size":r.minItemSize,direction:r.direction,cache:r.cache,"key-field":"id","list-tag":r.listTag,"item-tag":r.itemTag},k.$attrs,{onResize:F(S),onVisible:F(y)}),Ho({default:Re(({item:I,index:D,active:A})=>[at(k.$slots,"default",so(Eo(T(I,D,A))))]),empty:Re(()=>[at(k.$slots,"empty")]),_:2},[k.$slots.before?{name:"before",fn:Re(()=>[at(k.$slots,"before")]),key:"0"}:void 0,k.$slots.after?{name:"after",fn:Re(()=>[at(k.$slots,"after")]),key:"1"}:void 0]),1040,["items","min-item-size","direction","cache","list-tag","item-tag","onResize","onVisible"]))}});function H7t(e,t,n){const r=Br("vscrollMeasurementContext"),a=Br("vscrollAnchorRegistry",null),i=OVe(e,t,r,n);return nn(()=>{i.mount()}),a&&lt([i.id,i.finalActive,()=>xn(t)],([o,s,l],[u,c,d])=>{d&&d!==l&&a.delete(d),l&&a.set(l,{active:s,id:o})},{immediate:!0}),$r(()=>{const o=xn(t);a&&o&&a.delete(o),i.unmount()}),{id:i.id,size:i.size,finalActive:i.finalActive,updateSize:i.updateSize}}const GVe=ct({__name:"DynamicScrollerItem",props:{item:{},watchData:{type:Boolean,default:!1},active:{type:Boolean},index:{default:void 0},sizeDependencies:{default:null},emitResize:{type:Boolean,default:!1},tag:{default:"div"}},emits:["resize"],setup(e,{emit:t}){const n=e,r=t,a=W();return H7t(n,a,{onResize:i=>r("resize",i)}),(i,o)=>(L(),qe(sc(n.tag),{ref_key:"el",ref:a},{default:Re(()=>[at(i.$slots,"default")]),_:3},512))}});function j7t(e,t,n,r,a){return Pde(z(()=>({...xn(e),pageMode:!0})),t,n,r,a)}const qVe=ct({__name:"WindowScroller",props:{items:{},keyField:{default:"id"},direction:{default:"vertical"},listTag:{default:"div"},itemTag:{default:"div"},itemSize:{default:null},gridItems:{default:void 0},itemSecondarySize:{default:void 0},minItemSize:{default:null},sizeField:{default:"size"},typeField:{default:"type"},buffer:{default:200},shift:{type:Boolean,default:!1},cache:{default:void 0},prerender:{default:0},emitUpdate:{type:Boolean,default:!1},disableTransform:{type:Boolean,default:!1},updateInterval:{default:0},listClass:{default:""},itemClass:{default:""}},emits:["resize","visible","hidden","update"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=HVe,o=W(),s=W(),l=W(),u=j7t(r,o,s,l,{onResize:()=>a("resize"),onVisible:()=>a("visible"),onHidden:()=>a("hidden"),onUpdate:(D,A,R,B)=>a("update",D,A,R,B)}),{pool:c,totalSize:d,ready:p,scrollToItem:h,scrollToPosition:g,getScroll:v,findItemIndex:b,getItemOffset:_,getItemSize:C,cacheSnapshot:S,restoreCache:y,updateVisibleItems:T,handleScroll:k,handleResize:E,handleVisibilityChange:I}=u;return t({el:o,scrollToItem:h,scrollToPosition:g,getScroll:v,findItemIndex:b,getItemOffset:_,getItemSize:C,cacheSnapshot:S,restoreCache:y,updateVisibleItems:T}),(D,A)=>ft((L(),re("div",{ref_key:"el",ref:o,class:ke(["vue-recycle-scroller vue-window-scroller",{ready:F(p),[`direction-${r.direction}`]:!0}]),onScrollPassive:A[0]||(A[0]=(...R)=>F(k)&&F(k)(...R))},[D.$slots.before?(L(),re("div",{key:0,ref_key:"before",ref:s,class:"vue-recycle-scroller__slot"},[at(D.$slots,"before")],512)):Ve("",!0),(L(),qe(sc(r.listTag),{style:Yt({[r.direction==="vertical"?"minHeight":"minWidth"]:`${F(d)}px`}),class:ke(["vue-recycle-scroller__item-wrapper",r.listClass])},{default:Re(()=>[(L(!0),re($t,null,rn(F(c),R=>(L(),qe(jVe,{key:R.nr.id,view:R,"item-tag":r.itemTag,style:Yt(F(p)?[r.disableTransform?{[r.direction==="vertical"?"top":"left"]:`${R.position}px`,willChange:"unset"}:{transform:`translate${r.direction==="vertical"?"Y":"X"}(${R.position}px) translate${r.direction==="vertical"?"X":"Y"}(${R.offset}px)`},{width:r.gridItems?`${r.direction==="vertical"&&r.itemSecondarySize||r.itemSize}px`:void 0,height:r.gridItems?`${r.direction==="horizontal"&&r.itemSecondarySize||r.itemSize}px`:void 0,visibility:R.nr.used?"visible":"hidden"}]:null),class:ke(["vue-recycle-scroller__item-view",r.itemClass])},{default:Re(B=>[at(D.$slots,"default",Zt({ref_for:!0},B))]),_:2},1032,["view","item-tag","style","class"]))),128)),r.items.length===0?at(D.$slots,"empty",{key:0}):Ve("",!0)]),_:3},8,["style","class"])),D.$slots.after?(L(),re("div",{key:1,ref_key:"after",ref:l,class:"vue-recycle-scroller__slot"},[at(D.$slots,"after")],512)):Ve("",!0),De(zVe,{onNotify:F(E)},null,8,["onNotify"])],34)),[[F(i),F(I)]])}});function z7t(e,t){e.component(`${t}recycle-scroller`,Lde),e.component(`${t}RecycleScroller`,Lde),e.component(`${t}dynamic-scroller`,WVe),e.component(`${t}DynamicScroller`,WVe),e.component(`${t}dynamic-scroller-item`,GVe),e.component(`${t}DynamicScrollerItem`,GVe),e.component(`${t}window-scroller`,qVe),e.component(`${t}WindowScroller`,qVe)}const W7t={version:"2.0.1",install(e,t){const n={installComponents:!0,componentsPrefix:"",...t};for(const r in n)typeof n[r]<"u"&&(IVe[r]=n[r]);n.installComponents&&z7t(e,n.componentsPrefix)}},G7t=(e,t)=>{const n=i=>t._s.get(i),r=(i,o,s)=>{const l=n(i);return l&&o in l?(l[o](s),!0):(console.warn(`[initWebScene] Store "${i}" or dispactcher "${o}" not found`),!1)};function a(i){var o,s;(s=(o=e==null?void 0:e.config)==null?void 0:o.globalProperties)==null||s.setStoreValue("scene","setCurrentSceneTabId",i)}return e.config.globalProperties.setStoreValue=r,e.config.globalProperties.handleSetTab=a,{handleSetTab:a}},q7t="1.26.11",K7t={"@arbocollab/ag-grid-ui-components":"0.0.53","@arbocollab/arbo-calendar-component":"0.0.51","@arbocollab/arbo-chart-component":"1.0.1","@arbocollab/arbo-comment-utils":"1.0.1","@arbocollab/arbo-common-utils":"npm:@arbocollab/arbo-common-utils@1.0.15","@arbocollab/arbo-media-player-component":"0.0.38","@arbocollab/arbo-metric-table":"npm:@arbocollab/arbo-metric-table@0.0.29","@arbocollab/arbo-table-component":"1.0.1","@arbocollab/arbo-ui-components":"npm:@arbocollab/arbo-ui-components-beta@0.0.378-alpha.69","@arbocollab/arbo-virtual-list-component":"0.0.22-alpha.20","@ctrl/tinycolor":"^4.2.0","@vueuse/core":"^10.11.1",axios:"^1.7.2","date-fns":"^4.1.0","date-fns-tz":"^3.2.0",dayjs:"^1.11.11",dexie:"4.0.10","js-cookie":"^3.0.5",pinia:"^3.0.3","prettier-plugin-stylus":"^0.1.0","sanitize-html":"^2.15.0","vite-bundle-visualizer":"^1.2.1","vite-plugin-html":"^3.2.2",vue:"^3.5.18","vue-draggable-next":"^2.2.1","vue-i18n":"^9.13.1","vue-router":"^4.5.1","vue-virtual-scroller":"^2.0.0-beta.8"};var rP=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tU(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function KVe(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var YVe={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(rP,function(){var n=function(f,m){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,x){w.__proto__=x}||function(w,x){for(var O in x)Object.prototype.hasOwnProperty.call(x,O)&&(w[O]=x[O])})(f,m)},r=function(){return(r=Object.assign||function(f){for(var m,w=1,x=arguments.length;w<x;w++)for(var O in m=arguments[w])Object.prototype.hasOwnProperty.call(m,O)&&(f[O]=m[O]);return f}).apply(this,arguments)};function a(f,m,w){for(var x,O=0,M=m.length;O<M;O++)!x&&O in m||((x=x||Array.prototype.slice.call(m,0,O))[O]=m[O]);return f.concat(x||Array.prototype.slice.call(m))}var i=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:rP,o=Object.keys,s=Array.isArray;function l(f,m){return typeof m!="object"||o(m).forEach(function(w){f[w]=m[w]}),f}typeof Promise>"u"||i.Promise||(i.Promise=Promise);var u=Object.getPrototypeOf,c={}.hasOwnProperty;function d(f,m){return c.call(f,m)}function p(f,m){typeof m=="function"&&(m=m(u(f))),(typeof Reflect>"u"?o:Reflect.ownKeys)(m).forEach(function(w){g(f,w,m[w])})}var h=Object.defineProperty;function g(f,m,w,x){h(f,m,l(w&&d(w,"get")&&typeof w.get=="function"?{get:w.get,set:w.set,configurable:!0}:{value:w,configurable:!0,writable:!0},x))}function v(f){return{from:function(m){return f.prototype=Object.create(m.prototype),g(f.prototype,"constructor",f),{extend:p.bind(null,f.prototype)}}}}var b=Object.getOwnPropertyDescriptor,_=[].slice;function C(f,m,w){return _.call(f,m,w)}function S(f,m){return m(f)}function y(f){if(!f)throw new Error("Assertion Failed")}function T(f){i.setImmediate?setImmediate(f):setTimeout(f,0)}function k(f,m){if(typeof m=="string"&&d(f,m))return f[m];if(!m)return f;if(typeof m!="string"){for(var w=[],x=0,O=m.length;x<O;++x){var M=k(f,m[x]);w.push(M)}return w}var K=m.indexOf(".");if(K!==-1){var te=f[m.substr(0,K)];return te==null?void 0:k(te,m.substr(K+1))}}function E(f,m,w){if(f&&m!==void 0&&!("isFrozen"in Object&&Object.isFrozen(f)))if(typeof m!="string"&&"length"in m){y(typeof w!="string"&&"length"in w);for(var x=0,O=m.length;x<O;++x)E(f,m[x],w[x])}else{var M,K,te=m.indexOf(".");te!==-1?(M=m.substr(0,te),(K=m.substr(te+1))===""?w===void 0?s(f)&&!isNaN(parseInt(M))?f.splice(M,1):delete f[M]:f[M]=w:E(te=!(te=f[M])||!d(f,M)?f[M]={}:te,K,w)):w===void 0?s(f)&&!isNaN(parseInt(m))?f.splice(m,1):delete f[m]:f[m]=w}}function I(f){var m,w={};for(m in f)d(f,m)&&(w[m]=f[m]);return w}var D=[].concat;function A(f){return D.apply([],f)}var Wr="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(A([8,16,32,64].map(function(f){return["Int","Uint","Float"].map(function(m){return m+f+"Array"})}))).filter(function(f){return i[f]}),R=new Set(Wr.map(function(f){return i[f]})),B=null;function P(f){return B=new WeakMap,f=function m(w){if(!w||typeof w!="object")return w;var x=B.get(w);if(x)return x;if(s(w)){x=[],B.set(w,x);for(var O=0,M=w.length;O<M;++O)x.push(m(w[O]))}else if(R.has(w.constructor))x=w;else{var K,te=u(w);for(K in x=te===Object.prototype?{}:Object.create(te),B.set(w,x),w)d(w,K)&&(x[K]=m(w[K]))}return x}(f),B=null,f}var $={}.toString;function V(f){return $.call(f).slice(8,-1)}var N=typeof Symbol<"u"?Symbol.iterator:"@@iterator",q=typeof N=="symbol"?function(f){var m;return f!=null&&(m=f[N])&&m.apply(f)}:function(){return null};function J(f,m){return m=f.indexOf(m),0<=m&&f.splice(m,1),0<=m}var ie={};function de(f){var m,w,x,O;if(arguments.length===1){if(s(f))return f.slice();if(this===ie&&typeof f=="string")return[f];if(O=q(f)){for(w=[];!(x=O.next()).done;)w.push(x.value);return w}if(f==null)return[f];if(typeof(m=f.length)!="number")return[f];for(w=new Array(m);m--;)w[m]=f[m];return w}for(m=arguments.length,w=new Array(m);m--;)w[m]=arguments[m];return w}var ee=typeof Symbol<"u"?function(f){return f[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Ke=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],er=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ke),j={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 U(f,m){this.name=f,this.message=m}function Z(f,m){return f+". Errors: "+Object.keys(m).map(function(w){return m[w].toString()}).filter(function(w,x,O){return O.indexOf(w)===x}).join(`
41
41
  `)}function oe(f,m,w,x){this.failures=m,this.failedKeys=x,this.successCount=w,this.message=Z(f,m)}function fe(f,m){this.name="BulkError",this.failures=Object.keys(m).map(function(w){return m[w]}),this.failuresByPos=m,this.message=Z(f,this.failures)}v(U).from(Error).extend({toString:function(){return this.name+": "+this.message}}),v(oe).from(U),v(fe).from(U);var ae=er.reduce(function(f,m){return f[m]=m+"Error",f},{}),G=U,Y=er.reduce(function(f,m){var w=m+"Error";function x(O,M){this.name=w,O?typeof O=="string"?(this.message="".concat(O).concat(M?`
42
42
  `+M:""),this.inner=M||null):typeof O=="object"&&(this.message="".concat(O.name," ").concat(O.message),this.inner=O):(this.message=j[m]||w,this.inner=null)}return v(x).from(G),f[m]=x,f},{});Y.Syntax=SyntaxError,Y.Type=TypeError,Y.Range=RangeError;var Ee=Ke.reduce(function(f,m){return f[m+"Error"]=Y[m],f},{}),he=er.reduce(function(f,m){return["Syntax","Type","Range"].indexOf(m)===-1&&(f[m+"Error"]=Y[m]),f},{});function Pe(){}function Te(f){return f}function Ae(f,m){return f==null||f===Te?m:function(w){return m(f(w))}}function xe(f,m){return function(){f.apply(this,arguments),m.apply(this,arguments)}}function Je(f,m){return f===Pe?m:function(){var w=f.apply(this,arguments);w!==void 0&&(arguments[0]=w);var x=this.onsuccess,O=this.onerror;this.onsuccess=null,this.onerror=null;var M=m.apply(this,arguments);return x&&(this.onsuccess=this.onsuccess?xe(x,this.onsuccess):x),O&&(this.onerror=this.onerror?xe(O,this.onerror):O),M!==void 0?M:w}}function We(f,m){return f===Pe?m:function(){f.apply(this,arguments);var w=this.onsuccess,x=this.onerror;this.onsuccess=this.onerror=null,m.apply(this,arguments),w&&(this.onsuccess=this.onsuccess?xe(w,this.onsuccess):w),x&&(this.onerror=this.onerror?xe(x,this.onerror):x)}}function Ye(f,m){return f===Pe?m:function(w){var x=f.apply(this,arguments);l(w,x);var O=this.onsuccess,M=this.onerror;return this.onsuccess=null,this.onerror=null,w=m.apply(this,arguments),O&&(this.onsuccess=this.onsuccess?xe(O,this.onsuccess):O),M&&(this.onerror=this.onerror?xe(M,this.onerror):M),x===void 0?w===void 0?void 0:w:l(x,w)}}function Ze(f,m){return f===Pe?m:function(){return m.apply(this,arguments)!==!1&&f.apply(this,arguments)}}function ne(f,m){return f===Pe?m:function(){var w=f.apply(this,arguments);if(w&&typeof w.then=="function"){for(var x=this,O=arguments.length,M=new Array(O);O--;)M[O]=arguments[O];return w.then(function(){return m.apply(x,M)})}return m.apply(this,arguments)}}he.ModifyError=oe,he.DexieError=U,he.BulkError=fe;var se=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Ue(f){se=f}var je={},Ge=100,Wr=typeof Promise>"u"?[]:function(){var f=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[f,u(f),f];var m=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[m,u(m),f]}(),Ke=Wr[0],er=Wr[1],Wr=Wr[2],er=er&&er.then,ut=Ke&&Ke.constructor,mt=!!Wr,ht=function(f,m){Xe.push([f,m]),Lt&&(queueMicrotask(wt),Lt=!1)},It=!0,Lt=!0,_t=[],Et=[],qt=Te,le={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Pe,pgp:!1,env:{},finalize:Pe},we=le,Xe=[],rt=0,He=[];function $e(f){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var m=this._PSD=we;if(typeof f!="function"){if(f!==je)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Ut(this,this._value))}this._state=null,this._value=null,++m.ref,function w(x,O){try{O(function(M){if(x._state===null){if(M===x)throw new TypeError("A promise cannot be resolved with itself.");var K=x._lib&&xt();M&&typeof M.then=="function"?w(x,function(te,pe){M instanceof $e?M._then(te,pe):M.then(te,pe)}):(x._state=!0,x._value=M,Jt(x)),K&&Ht()}},Ut.bind(null,x))}catch(M){Ut(x,M)}}(this,f)}var kt={get:function(){var f=we,m=gi;function w(x,O){var M=this,K=!f.global&&(f!==we||m!==gi),te=K&&!ar(),pe=new $e(function(ge,ue){dn(M,new Gt(no(x,f,K,te),no(O,f,K,te),ge,ue,f))});return this._consoleTask&&(pe._consoleTask=this._consoleTask),pe}return w.prototype=je,w},set:function(f){g(this,"then",f&&f.prototype===je?kt:{get:function(){return f},set:kt.set})}};function Gt(f,m,w,x,O){this.onFulfilled=typeof f=="function"?f:null,this.onRejected=typeof m=="function"?m:null,this.resolve=w,this.reject=x,this.psd=O}function Ut(f,m){var w,x;Et.push(m),f._state===null&&(w=f._lib&&xt(),m=qt(m),f._state=!1,f._value=m,x=f,_t.some(function(O){return O._value===x._value})||_t.push(x),Jt(f),w&&Ht())}function Jt(f){var m=f._listeners;f._listeners=[];for(var w=0,x=m.length;w<x;++w)dn(f,m[w]);var O=f._PSD;--O.ref||O.finalize(),rt===0&&(++rt,ht(function(){--rt==0&&wn()},[]))}function dn(f,m){if(f._state!==null){var w=f._state?m.onFulfilled:m.onRejected;if(w===null)return(f._state?m.resolve:m.reject)(f._value);++m.psd.ref,++rt,ht(gt,[w,f,m])}else f._listeners.push(m)}function gt(f,m,w){try{var x,O=m._value;!m._state&&Et.length&&(Et=[]),x=se&&m._consoleTask?m._consoleTask.run(function(){return f(O)}):f(O),m._state||Et.indexOf(O)!==-1||function(M){for(var K=_t.length;K;)if(_t[--K]._value===M._value)return _t.splice(K,1)}(m),w.resolve(x)}catch(M){w.reject(M)}finally{--rt==0&&wn(),--w.psd.ref||w.psd.finalize()}}function wt(){or(le,function(){xt()&&Ht()})}function xt(){var f=It;return Lt=It=!1,f}function Ht(){var f,m,w;do for(;0<Xe.length;)for(f=Xe,Xe=[],w=f.length,m=0;m<w;++m){var x=f[m];x[0].apply(null,x[1])}while(0<Xe.length);Lt=It=!0}function wn(){var f=_t;_t=[],f.forEach(function(x){x._PSD.onunhandled.call(null,x._value,x)});for(var m=He.slice(0),w=m.length;w;)m[--w]()}function An(f){return new $e(je,!1,f)}function Vt(f,m){var w=we;return function(){var x=xt(),O=we;try{return Dr(w,!0),f.apply(this,arguments)}catch(M){m&&m(M)}finally{Dr(O,!1),x&&Ht()}}}p($e.prototype,{then:kt,_then:function(f,m){dn(this,new Gt(null,null,f,m,we))},catch:function(f){if(arguments.length===1)return this.then(null,f);var m=f,w=arguments[1];return typeof m=="function"?this.then(null,function(x){return(x instanceof m?w:An)(x)}):this.then(null,function(x){return(x&&x.name===m?w:An)(x)})},finally:function(f){return this.then(function(m){return $e.resolve(f()).then(function(){return m})},function(m){return $e.resolve(f()).then(function(){return An(m)})})},timeout:function(f,m){var w=this;return f<1/0?new $e(function(x,O){var M=setTimeout(function(){return O(new Y.Timeout(m))},f);w.then(x,O).finally(clearTimeout.bind(null,M))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&g($e.prototype,Symbol.toStringTag,"Dexie.Promise"),le.env=Do(),p($e,{all:function(){var f=de.apply(null,arguments).map(yr);return new $e(function(m,w){f.length===0&&m([]);var x=f.length;f.forEach(function(O,M){return $e.resolve(O).then(function(K){f[M]=K,--x||m(f)},w)})})},resolve:function(f){return f instanceof $e?f:f&&typeof f.then=="function"?new $e(function(m,w){f.then(m,w)}):new $e(je,!0,f)},reject:An,race:function(){var f=de.apply(null,arguments).map(yr);return new $e(function(m,w){f.map(function(x){return $e.resolve(x).then(m,w)})})},PSD:{get:function(){return we},set:function(f){return we=f}},totalEchoes:{get:function(){return gi}},newPSD:Lr,usePSD:or,scheduler:{get:function(){return ht},set:function(f){ht=f}},rejectionMapper:{get:function(){return qt},set:function(f){qt=f}},follow:function(f,m){return new $e(function(w,x){return Lr(function(O,M){var K=we;K.unhandleds=[],K.onunhandled=M,K.finalize=xe(function(){var te,pe=this;te=function(){pe.unhandleds.length===0?O():M(pe.unhandleds[0])},He.push(function ge(){te(),He.splice(He.indexOf(ge),1)}),++rt,ht(function(){--rt==0&&wn()},[])},K.finalize),f()},m,w,x)})}}),ut&&(ut.allSettled&&g($e,"allSettled",function(){var f=de.apply(null,arguments).map(yr);return new $e(function(m){f.length===0&&m([]);var w=f.length,x=new Array(w);f.forEach(function(O,M){return $e.resolve(O).then(function(K){return x[M]={status:"fulfilled",value:K}},function(K){return x[M]={status:"rejected",reason:K}}).then(function(){return--w||m(x)})})})}),ut.any&&typeof AggregateError<"u"&&g($e,"any",function(){var f=de.apply(null,arguments).map(yr);return new $e(function(m,w){f.length===0&&w(new AggregateError([]));var x=f.length,O=new Array(x);f.forEach(function(M,K){return $e.resolve(M).then(function(te){return m(te)},function(te){O[K]=te,--x||w(new AggregateError(O))})})})}),ut.withResolvers&&($e.withResolvers=ut.withResolvers));var ln={awaits:0,echoes:0,id:0},di=0,lr=[],ca=0,gi=0,Zs=0;function Lr(f,m,w,x){var O=we,M=Object.create(O);return M.parent=O,M.ref=0,M.global=!1,M.id=++Zs,le.env,M.env=mt?{Promise:$e,PromiseProp:{value:$e,configurable:!0,writable:!0},all:$e.all,race:$e.race,allSettled:$e.allSettled,any:$e.any,resolve:$e.resolve,reject:$e.reject}:{},m&&l(M,m),++O.ref,M.finalize=function(){--this.parent.ref||this.parent.finalize()},x=or(M,f,w,x),M.ref===0&&M.finalize(),x}function Yn(){return ln.id||(ln.id=++di),++ln.awaits,ln.echoes+=Ge,ln.id}function ar(){return!!ln.awaits&&(--ln.awaits==0&&(ln.id=0),ln.echoes=ln.awaits*Ge,!0)}function yr(f){return ln.echoes&&f&&f.constructor===ut?(Yn(),f.then(function(m){return ar(),m},function(m){return ar(),un(m)})):f}function cs(){var f=lr[lr.length-1];lr.pop(),Dr(f,!1)}function Dr(f,m){var w,x=we;(m?!ln.echoes||ca++&&f===we:!ca||--ca&&f===we)||queueMicrotask(m?(function(O){++gi,ln.echoes&&--ln.echoes!=0||(ln.echoes=ln.awaits=ln.id=0),lr.push(we),Dr(O,!0)}).bind(null,f):cs),f!==we&&(we=f,x===le&&(le.env=Do()),mt&&(w=le.env.Promise,m=f.env,(x.global||f.global)&&(Object.defineProperty(i,"Promise",m.PromiseProp),w.all=m.all,w.race=m.race,w.resolve=m.resolve,w.reject=m.reject,m.allSettled&&(w.allSettled=m.allSettled),m.any&&(w.any=m.any))))}function Do(){var f=i.Promise;return mt?{Promise:f,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:f.all,race:f.race,allSettled:f.allSettled,any:f.any,resolve:f.resolve,reject:f.reject}:{}}function or(f,m,w,x,O){var M=we;try{return Dr(f,!0),m(w,x,O)}finally{Dr(M,!1)}}function no(f,m,w,x){return typeof f!="function"?f:function(){var O=we;w&&Yn(),Dr(m,!0);try{return f.apply(this,arguments)}finally{Dr(O,!1),x&&queueMicrotask(ar)}}}function ia(f){Promise===ut&&ln.echoes===0?ca===0?f():enqueueNativeMicroTask(f):setTimeout(f,0)}(""+er).indexOf("[native code]")===-1&&(Yn=ar=Pe);var un=$e.reject,oa="￿",Ir="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Tu="String expected.",wa=[],ho="__dbnames",Xs="readonly",Qs="readwrite";function Ea(f,m){return f?m?function(){return f.apply(this,arguments)&&m.apply(this,arguments)}:f:m}var Uc={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Mo(f){return typeof f!="string"||/\./.test(f)?function(m){return m}:function(m){return m[f]===void 0&&f in m&&delete(m=P(m))[f],m}}function Du(){throw Y.Type()}function Kt(f,m){try{var w=Hc(f),x=Hc(m);if(w!==x)return w==="Array"?1:x==="Array"?-1:w==="binary"?1:x==="binary"?-1:w==="string"?1:x==="string"?-1:w==="Date"?1:x!=="Date"?NaN:-1;switch(w){case"number":case"Date":case"string":return m<f?1:f<m?-1:0;case"binary":return function(O,M){for(var K=O.length,te=M.length,pe=K<te?K:te,ge=0;ge<pe;++ge)if(O[ge]!==M[ge])return O[ge]<M[ge]?-1:1;return K===te?0:K<te?-1:1}(uu(f),uu(m));case"Array":return function(O,M){for(var K=O.length,te=M.length,pe=K<te?K:te,ge=0;ge<pe;++ge){var ue=Kt(O[ge],M[ge]);if(ue!==0)return ue}return K===te?0:K<te?-1:1}(f,m)}}catch{}return NaN}function Hc(f){var m=typeof f;return m!="object"?m:ArrayBuffer.isView(f)?"binary":(f=V(f),f==="ArrayBuffer"?"binary":f)}function uu(f){return f instanceof Uint8Array?f:ArrayBuffer.isView(f)?new Uint8Array(f.buffer,f.byteOffset,f.byteLength):new Uint8Array(f)}var Vl=(sn.prototype._trans=function(f,m,w){var x=this._tx||we.trans,O=this.name,M=se&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(f==="readonly"?"read":"write"," ").concat(this.name));function K(ge,ue,Q){if(!Q.schema[O])throw new Y.NotFound("Table "+O+" not part of transaction");return m(Q.idbtrans,Q)}var te=xt();try{var pe=x&&x.db._novip===this.db._novip?x===we.trans?x._promise(f,K,w):Lr(function(){return x._promise(f,K,w)},{trans:x,transless:we.transless||we}):function ge(ue,Q,me,ce){if(ue.idbdb&&(ue._state.openComplete||we.letThrough||ue._vip)){var ye=ue._createTransaction(Q,me,ue._dbSchema);try{ye.create(),ue._state.PR1398_maxLoop=3}catch(Se){return Se.name===ae.InvalidState&&ue.isOpen()&&0<--ue._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ue.close({disableAutoOpen:!1}),ue.open().then(function(){return ge(ue,Q,me,ce)})):un(Se)}return ye._promise(Q,function(Se,ve){return Lr(function(){return we.trans=ye,ce(Se,ve,ye)})}).then(function(Se){if(Q==="readwrite")try{ye.idbtrans.commit()}catch{}return Q==="readonly"?Se:ye._completion.then(function(){return Se})})}if(ue._state.openComplete)return un(new Y.DatabaseClosed(ue._state.dbOpenError));if(!ue._state.isBeingOpened){if(!ue._state.autoOpen)return un(new Y.DatabaseClosed);ue.open().catch(Pe)}return ue._state.dbReadyPromise.then(function(){return ge(ue,Q,me,ce)})}(this.db,f,[this.name],K);return M&&(pe._consoleTask=M,pe=pe.catch(function(ge){return console.trace(ge),un(ge)})),pe}finally{te&&Ht()}},sn.prototype.get=function(f,m){var w=this;return f&&f.constructor===Object?this.where(f).first(m):f==null?un(new Y.Type("Invalid argument to Table.get()")):this._trans("readonly",function(x){return w.core.get({trans:x,key:f}).then(function(O){return w.hook.reading.fire(O)})}).then(m)},sn.prototype.where=function(f){if(typeof f=="string")return new this.db.WhereClause(this,f);if(s(f))return new this.db.WhereClause(this,"[".concat(f.join("+"),"]"));var m=o(f);if(m.length===1)return this.where(m[0]).equals(f[m[0]]);var w=this.schema.indexes.concat(this.schema.primKey).filter(function(te){if(te.compound&&m.every(function(ge){return 0<=te.keyPath.indexOf(ge)})){for(var pe=0;pe<m.length;++pe)if(m.indexOf(te.keyPath[pe])===-1)return!1;return!0}return!1}).sort(function(te,pe){return te.keyPath.length-pe.keyPath.length})[0];if(w&&this.db._maxKey!==oa){var M=w.keyPath.slice(0,m.length);return this.where(M).equals(M.map(function(pe){return f[pe]}))}!w&&se&&console.warn("The query ".concat(JSON.stringify(f)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(m.join("+"),"]"));var x=this.schema.idxByName;function O(te,pe){return Kt(te,pe)===0}var K=m.reduce(function(Q,pe){var ge=Q[0],ue=Q[1],Q=x[pe],me=f[pe];return[ge||Q,ge||!Q?Ea(ue,Q&&Q.multi?function(ce){return ce=k(ce,pe),s(ce)&&ce.some(function(ye){return O(me,ye)})}:function(ce){return O(me,k(ce,pe))}):ue]},[null,null]),M=K[0],K=K[1];return M?this.where(M.name).equals(f[M.keyPath]).filter(K):w?this.filter(K):this.where(m).equals("")},sn.prototype.filter=function(f){return this.toCollection().and(f)},sn.prototype.count=function(f){return this.toCollection().count(f)},sn.prototype.offset=function(f){return this.toCollection().offset(f)},sn.prototype.limit=function(f){return this.toCollection().limit(f)},sn.prototype.each=function(f){return this.toCollection().each(f)},sn.prototype.toArray=function(f){return this.toCollection().toArray(f)},sn.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},sn.prototype.orderBy=function(f){return new this.db.Collection(new this.db.WhereClause(this,s(f)?"[".concat(f.join("+"),"]"):f))},sn.prototype.reverse=function(){return this.toCollection().reverse()},sn.prototype.mapToClass=function(f){var m,w=this.db,x=this.name;function O(){return m!==null&&m.apply(this,arguments)||this}(this.schema.mappedClass=f).prototype instanceof Du&&(function(pe,ge){if(typeof ge!="function"&&ge!==null)throw new TypeError("Class extends value "+String(ge)+" is not a constructor or null");function ue(){this.constructor=pe}n(pe,ge),pe.prototype=ge===null?Object.create(ge):(ue.prototype=ge.prototype,new ue)}(O,m=f),Object.defineProperty(O.prototype,"db",{get:function(){return w},enumerable:!1,configurable:!0}),O.prototype.table=function(){return x},f=O);for(var M=new Set,K=f.prototype;K;K=u(K))Object.getOwnPropertyNames(K).forEach(function(pe){return M.add(pe)});function te(pe){if(!pe)return pe;var ge,ue=Object.create(f.prototype);for(ge in pe)if(!M.has(ge))try{ue[ge]=pe[ge]}catch{}return ue}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=te,this.hook("reading",te),f},sn.prototype.defineClass=function(){return this.mapToClass(function(f){l(this,f)})},sn.prototype.add=function(f,m){var w=this,x=this.schema.primKey,O=x.auto,M=x.keyPath,K=f;return M&&O&&(K=Mo(M)(f)),this._trans("readwrite",function(te){return w.core.mutate({trans:te,type:"add",keys:m!=null?[m]:null,values:[K]})}).then(function(te){return te.numFailures?$e.reject(te.failures[0]):te.lastResult}).then(function(te){if(M)try{E(f,M,te)}catch{}return te})},sn.prototype.update=function(f,m){return typeof f!="object"||s(f)?this.where(":id").equals(f).modify(m):(f=k(f,this.schema.primKey.keyPath),f===void 0?un(new Y.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(f).modify(m))},sn.prototype.put=function(f,m){var w=this,x=this.schema.primKey,O=x.auto,M=x.keyPath,K=f;return M&&O&&(K=Mo(M)(f)),this._trans("readwrite",function(te){return w.core.mutate({trans:te,type:"put",values:[K],keys:m!=null?[m]:null})}).then(function(te){return te.numFailures?$e.reject(te.failures[0]):te.lastResult}).then(function(te){if(M)try{E(f,M,te)}catch{}return te})},sn.prototype.delete=function(f){var m=this;return this._trans("readwrite",function(w){return m.core.mutate({trans:w,type:"delete",keys:[f]})}).then(function(w){return w.numFailures?$e.reject(w.failures[0]):void 0})},sn.prototype.clear=function(){var f=this;return this._trans("readwrite",function(m){return f.core.mutate({trans:m,type:"deleteRange",range:Uc})}).then(function(m){return m.numFailures?$e.reject(m.failures[0]):void 0})},sn.prototype.bulkGet=function(f){var m=this;return this._trans("readonly",function(w){return m.core.getMany({keys:f,trans:w}).then(function(x){return x.map(function(O){return m.hook.reading.fire(O)})})})},sn.prototype.bulkAdd=function(f,m,w){var x=this,O=Array.isArray(m)?m:void 0,M=(w=w||(O?void 0:m))?w.allKeys:void 0;return this._trans("readwrite",function(K){var ge=x.schema.primKey,te=ge.auto,ge=ge.keyPath;if(ge&&O)throw new Y.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(O&&O.length!==f.length)throw new Y.InvalidArgument("Arguments objects and keys must have the same length");var pe=f.length,ge=ge&&te?f.map(Mo(ge)):f;return x.core.mutate({trans:K,type:"add",keys:O,values:ge,wantResults:M}).then(function(ye){var Q=ye.numFailures,me=ye.results,ce=ye.lastResult,ye=ye.failures;if(Q===0)return M?me:ce;throw new fe("".concat(x.name,".bulkAdd(): ").concat(Q," of ").concat(pe," operations failed"),ye)})})},sn.prototype.bulkPut=function(f,m,w){var x=this,O=Array.isArray(m)?m:void 0,M=(w=w||(O?void 0:m))?w.allKeys:void 0;return this._trans("readwrite",function(K){var ge=x.schema.primKey,te=ge.auto,ge=ge.keyPath;if(ge&&O)throw new Y.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(O&&O.length!==f.length)throw new Y.InvalidArgument("Arguments objects and keys must have the same length");var pe=f.length,ge=ge&&te?f.map(Mo(ge)):f;return x.core.mutate({trans:K,type:"put",keys:O,values:ge,wantResults:M}).then(function(ye){var Q=ye.numFailures,me=ye.results,ce=ye.lastResult,ye=ye.failures;if(Q===0)return M?me:ce;throw new fe("".concat(x.name,".bulkPut(): ").concat(Q," of ").concat(pe," operations failed"),ye)})})},sn.prototype.bulkUpdate=function(f){var m=this,w=this.core,x=f.map(function(K){return K.key}),O=f.map(function(K){return K.changes}),M=[];return this._trans("readwrite",function(K){return w.getMany({trans:K,keys:x,cache:"clone"}).then(function(te){var pe=[],ge=[];f.forEach(function(Q,me){var ce=Q.key,ye=Q.changes,Se=te[me];if(Se){for(var ve=0,Oe=Object.keys(ye);ve<Oe.length;ve++){var Me=Oe[ve],Ne=ye[Me];if(Me===m.schema.primKey.keyPath){if(Kt(Ne,ce)!==0)throw new Y.Constraint("Cannot update primary key in bulkUpdate()")}else E(Se,Me,Ne)}M.push(me),pe.push(ce),ge.push(Se)}});var ue=pe.length;return w.mutate({trans:K,type:"put",keys:pe,values:ge,updates:{keys:x,changeSpecs:O}}).then(function(Q){var me=Q.numFailures,ce=Q.failures;if(me===0)return ue;for(var ye=0,Se=Object.keys(ce);ye<Se.length;ye++){var ve,Oe=Se[ye],Me=M[Number(Oe)];Me!=null&&(ve=ce[Oe],delete ce[Oe],ce[Me]=ve)}throw new fe("".concat(m.name,".bulkUpdate(): ").concat(me," of ").concat(ue," operations failed"),ce)})})})},sn.prototype.bulkDelete=function(f){var m=this,w=f.length;return this._trans("readwrite",function(x){return m.core.mutate({trans:x,type:"delete",keys:f})}).then(function(K){var O=K.numFailures,M=K.lastResult,K=K.failures;if(O===0)return M;throw new fe("".concat(m.name,".bulkDelete(): ").concat(O," of ").concat(w," operations failed"),K)})},sn);function sn(){}function wi(f){function m(K,te){if(te){for(var pe=arguments.length,ge=new Array(pe-1);--pe;)ge[pe-1]=arguments[pe];return w[K].subscribe.apply(null,ge),f}if(typeof K=="string")return w[K]}var w={};m.addEventType=M;for(var x=1,O=arguments.length;x<O;++x)M(arguments[x]);return m;function M(K,te,pe){if(typeof K!="object"){var ge;te=te||Ze;var ue={subscribers:[],fire:pe=pe||Pe,subscribe:function(Q){ue.subscribers.indexOf(Q)===-1&&(ue.subscribers.push(Q),ue.fire=te(ue.fire,Q))},unsubscribe:function(Q){ue.subscribers=ue.subscribers.filter(function(me){return me!==Q}),ue.fire=ue.subscribers.reduce(te,pe)}};return w[K]=m[K]=ue}o(ge=K).forEach(function(Q){var me=ge[Q];if(s(me))M(Q,ge[Q][0],ge[Q][1]);else{if(me!=="asap")throw new Y.InvalidArgument("Invalid event config");var ce=M(Q,Te,function(){for(var ye=arguments.length,Se=new Array(ye);ye--;)Se[ye]=arguments[ye];ce.subscribers.forEach(function(ve){T(function(){ve.apply(null,Se)})})})}})}}function ji(f,m){return v(m).from({prototype:f}),m}function vi(f,m){return!(f.filter||f.algorithm||f.or)&&(m?f.justLimit:!f.replayFilter)}function cl(f,m){f.filter=Ea(f.filter,m)}function Us(f,m,w){var x=f.replayFilter;f.replayFilter=x?function(){return Ea(x(),m())}:m,f.justLimit=w&&!x}function zi(f,m){if(f.isPrimKey)return m.primaryKey;var w=m.getIndexByKeyPath(f.index);if(!w)throw new Y.Schema("KeyPath "+f.index+" on object store "+m.name+" is not indexed");return w}function Au(f,m,w){var x=zi(f,m.schema);return m.openCursor({trans:w,values:!f.keysOnly,reverse:f.dir==="prev",unique:!!f.unique,query:{index:x,range:f.range}})}function No(f,m,w,x){var O=f.replayFilter?Ea(f.filter,f.replayFilter()):f.filter;if(f.or){var M={},K=function(te,pe,ge){var ue,Q;O&&!O(pe,ge,function(me){return pe.stop(me)},function(me){return pe.fail(me)})||((Q=""+(ue=pe.primaryKey))=="[object ArrayBuffer]"&&(Q=""+new Uint8Array(ue)),d(M,Q)||(M[Q]=!0,m(te,pe,ge)))};return Promise.all([f.or._iterate(K,w),Ou(Au(f,x,w),f.algorithm,K,!f.keysOnly&&f.valueMapper)])}return Ou(Au(f,x,w),Ea(f.algorithm,O),m,!f.keysOnly&&f.valueMapper)}function Ou(f,m,w,x){var O=Vt(x?function(M,K,te){return w(x(M),K,te)}:w);return f.then(function(M){if(M)return M.start(function(){var K=function(){return M.continue()};m&&!m(M,function(te){return K=te},function(te){M.stop(te),K=Pe},function(te){M.fail(te),K=Pe})||O(M.value,M,function(te){return K=te}),K()})})}var Wr=Symbol(),za=(jc.prototype.execute=function(f){if(this.add!==void 0){var m=this.add;if(s(m))return a(a([],s(f)?f:[],!0),m).sort();if(typeof m=="number")return(Number(f)||0)+m;if(typeof m=="bigint")try{return BigInt(f)+m}catch{return BigInt(0)+m}throw new TypeError("Invalid term ".concat(m))}if(this.remove!==void 0){var w=this.remove;if(s(w))return s(f)?f.filter(function(x){return!w.includes(x)}).sort():[];if(typeof w=="number")return Number(f)-w;if(typeof w=="bigint")try{return BigInt(f)-w}catch{return BigInt(0)-w}throw new TypeError("Invalid subtrahend ".concat(w))}return m=(m=this.replacePrefix)===null||m===void 0?void 0:m[0],m&&typeof f=="string"&&f.startsWith(m)?this.replacePrefix[1]+f.substring(m.length):f},jc);function jc(f){Object.assign(this,f)}var Wd=(Qt.prototype._read=function(f,m){var w=this._ctx;return w.error?w.table._trans(null,un.bind(null,w.error)):w.table._trans("readonly",f).then(m)},Qt.prototype._write=function(f){var m=this._ctx;return m.error?m.table._trans(null,un.bind(null,m.error)):m.table._trans("readwrite",f,"locked")},Qt.prototype._addAlgorithm=function(f){var m=this._ctx;m.algorithm=Ea(m.algorithm,f)},Qt.prototype._iterate=function(f,m){return No(this._ctx,f,m,this._ctx.table.core)},Qt.prototype.clone=function(f){var m=Object.create(this.constructor.prototype),w=Object.create(this._ctx);return f&&l(w,f),m._ctx=w,m},Qt.prototype.raw=function(){return this._ctx.valueMapper=null,this},Qt.prototype.each=function(f){var m=this._ctx;return this._read(function(w){return No(m,f,w,m.table.core)})},Qt.prototype.count=function(f){var m=this;return this._read(function(w){var x=m._ctx,O=x.table.core;if(vi(x,!0))return O.count({trans:w,query:{index:zi(x,O.schema),range:x.range}}).then(function(K){return Math.min(K,x.limit)});var M=0;return No(x,function(){return++M,!1},w,O).then(function(){return M})}).then(f)},Qt.prototype.sortBy=function(f,m){var w=f.split(".").reverse(),x=w[0],O=w.length-1;function M(pe,ge){return ge?M(pe[w[ge]],ge-1):pe[x]}var K=this._ctx.dir==="next"?1:-1;function te(pe,ge){return Kt(M(pe,O),M(ge,O))*K}return this.toArray(function(pe){return pe.sort(te)}).then(m)},Qt.prototype.toArray=function(f){var m=this;return this._read(function(w){var x=m._ctx;if(x.dir==="next"&&vi(x,!0)&&0<x.limit){var O=x.valueMapper,M=zi(x,x.table.core.schema);return x.table.core.query({trans:w,limit:x.limit,values:!0,query:{index:M,range:x.range}}).then(function(te){return te=te.result,O?te.map(O):te})}var K=[];return No(x,function(te){return K.push(te)},w,x.table.core).then(function(){return K})},f)},Qt.prototype.offset=function(f){var m=this._ctx;return f<=0||(m.offset+=f,vi(m)?Us(m,function(){var w=f;return function(x,O){return w===0||(w===1?--w:O(function(){x.advance(w),w=0}),!1)}}):Us(m,function(){var w=f;return function(){return--w<0}})),this},Qt.prototype.limit=function(f){return this._ctx.limit=Math.min(this._ctx.limit,f),Us(this._ctx,function(){var m=f;return function(w,x,O){return--m<=0&&x(O),0<=m}},!0),this},Qt.prototype.until=function(f,m){return cl(this._ctx,function(w,x,O){return!f(w.value)||(x(O),m)}),this},Qt.prototype.first=function(f){return this.limit(1).toArray(function(m){return m[0]}).then(f)},Qt.prototype.last=function(f){return this.reverse().first(f)},Qt.prototype.filter=function(f){var m;return cl(this._ctx,function(w){return f(w.value)}),(m=this._ctx).isMatch=Ea(m.isMatch,f),this},Qt.prototype.and=function(f){return this.filter(f)},Qt.prototype.or=function(f){return new this.db.WhereClause(this._ctx.table,f,this)},Qt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Qt.prototype.desc=function(){return this.reverse()},Qt.prototype.eachKey=function(f){var m=this._ctx;return m.keysOnly=!m.isMatch,this.each(function(w,x){f(x.key,x)})},Qt.prototype.eachUniqueKey=function(f){return this._ctx.unique="unique",this.eachKey(f)},Qt.prototype.eachPrimaryKey=function(f){var m=this._ctx;return m.keysOnly=!m.isMatch,this.each(function(w,x){f(x.primaryKey,x)})},Qt.prototype.keys=function(f){var m=this._ctx;m.keysOnly=!m.isMatch;var w=[];return this.each(function(x,O){w.push(O.key)}).then(function(){return w}).then(f)},Qt.prototype.primaryKeys=function(f){var m=this._ctx;if(m.dir==="next"&&vi(m,!0)&&0<m.limit)return this._read(function(x){var O=zi(m,m.table.core.schema);return m.table.core.query({trans:x,values:!1,limit:m.limit,query:{index:O,range:m.range}})}).then(function(x){return x.result}).then(f);m.keysOnly=!m.isMatch;var w=[];return this.each(function(x,O){w.push(O.primaryKey)}).then(function(){return w}).then(f)},Qt.prototype.uniqueKeys=function(f){return this._ctx.unique="unique",this.keys(f)},Qt.prototype.firstKey=function(f){return this.limit(1).keys(function(m){return m[0]}).then(f)},Qt.prototype.lastKey=function(f){return this.reverse().firstKey(f)},Qt.prototype.distinct=function(){var f=this._ctx,f=f.index&&f.table.schema.idxByName[f.index];if(!f||!f.multi)return this;var m={};return cl(this._ctx,function(O){var x=O.primaryKey.toString(),O=d(m,x);return m[x]=!0,!O}),this},Qt.prototype.modify=function(f){var m=this,w=this._ctx;return this._write(function(x){var O,M,K;K=typeof f=="function"?f:(O=o(f),M=O.length,function(ve){for(var Oe=!1,Me=0;Me<M;++Me){var Ne=O[Me],Fe=f[Ne],nt=k(ve,Ne);Fe instanceof za?(E(ve,Ne,Fe.execute(nt)),Oe=!0):nt!==Fe&&(E(ve,Ne,Fe),Oe=!0)}return Oe});var te=w.table.core,Q=te.schema.primaryKey,pe=Q.outbound,ge=Q.extractKey,ue=200,Q=m.db._options.modifyChunkSize;Q&&(ue=typeof Q=="object"?Q[te.name]||Q["*"]||200:Q);function me(ve,Ne){var Me=Ne.failures,Ne=Ne.numFailures;ye+=ve-Ne;for(var Fe=0,nt=o(Me);Fe<nt.length;Fe++){var dt=nt[Fe];ce.push(Me[dt])}}var ce=[],ye=0,Se=[];return m.clone().primaryKeys().then(function(ve){function Oe(Ne){var Fe=Math.min(ue,ve.length-Ne);return te.getMany({trans:x,keys:ve.slice(Ne,Ne+Fe),cache:"immutable"}).then(function(nt){for(var dt=[],tt=[],ot=pe?[]:null,pt=[],it=0;it<Fe;++it){var bt=nt[it],Nt={value:P(bt),primKey:ve[Ne+it]};K.call(Nt,Nt.value,Nt)!==!1&&(Nt.value==null?pt.push(ve[Ne+it]):pe||Kt(ge(bt),ge(Nt.value))===0?(tt.push(Nt.value),pe&&ot.push(ve[Ne+it])):(pt.push(ve[Ne+it]),dt.push(Nt.value)))}return Promise.resolve(0<dt.length&&te.mutate({trans:x,type:"add",values:dt}).then(function(jt){for(var Wt in jt.failures)pt.splice(parseInt(Wt),1);me(dt.length,jt)})).then(function(){return(0<tt.length||Me&&typeof f=="object")&&te.mutate({trans:x,type:"put",keys:ot,values:tt,criteria:Me,changeSpec:typeof f!="function"&&f,isAdditionalChunk:0<Ne}).then(function(jt){return me(tt.length,jt)})}).then(function(){return(0<pt.length||Me&&f===Ao)&&te.mutate({trans:x,type:"delete",keys:pt,criteria:Me,isAdditionalChunk:0<Ne}).then(function(jt){return me(pt.length,jt)})}).then(function(){return ve.length>Ne+Fe&&Oe(Ne+ue)})})}var Me=vi(w)&&w.limit===1/0&&(typeof f!="function"||f===Ao)&&{index:w.index,range:w.range};return Oe(0).then(function(){if(0<ce.length)throw new oe("Error modifying one or more objects",ce,ye,Se);return ve.length})})})},Qt.prototype.delete=function(){var f=this._ctx,m=f.range;return vi(f)&&(f.isPrimKey||m.type===3)?this._write(function(w){var x=f.table.core.schema.primaryKey,O=m;return f.table.core.count({trans:w,query:{index:x,range:O}}).then(function(M){return f.table.core.mutate({trans:w,type:"deleteRange",range:O}).then(function(K){var te=K.failures;if(K.lastResult,K.results,K=K.numFailures,K)throw new oe("Could not delete some values",Object.keys(te).map(function(pe){return te[pe]}),M-K);return M-K})})}):this.modify(Ao)},Qt);function Qt(){}var Ao=function(f,m){return m.value=null};function gd(f,m){return f<m?-1:f===m?0:1}function Gf(f,m){return m<f?-1:f===m?0:1}function Zn(f,m,w){return f=f instanceof Iu?new f.Collection(f):f,f._ctx.error=new(w||TypeError)(m),f}function ti(f){return new f.Collection(f,function(){return zc("")}).limit(0)}function Lo(f,m,w,x){var O,M,K,te,pe,ge,ue,Q=w.length;if(!w.every(function(ye){return typeof ye=="string"}))return Zn(f,Tu);function me(ye){O=ye==="next"?function(ve){return ve.toUpperCase()}:function(ve){return ve.toLowerCase()},M=ye==="next"?function(ve){return ve.toLowerCase()}:function(ve){return ve.toUpperCase()},K=ye==="next"?gd:Gf;var Se=w.map(function(ve){return{lower:M(ve),upper:O(ve)}}).sort(function(ve,Oe){return K(ve.lower,Oe.lower)});te=Se.map(function(ve){return ve.upper}),pe=Se.map(function(ve){return ve.lower}),ue=(ge=ye)==="next"?"":x}me("next"),f=new f.Collection(f,function(){return fa(te[0],pe[Q-1]+x)}),f._ondirectionchange=function(ye){me(ye)};var ce=0;return f._addAlgorithm(function(ye,Se,ve){var Oe=ye.key;if(typeof Oe!="string")return!1;var Me=M(Oe);if(m(Me,pe,ce))return!0;for(var Ne=null,Fe=ce;Fe<Q;++Fe){var nt=function(dt,tt,ot,pt,it,bt){for(var Nt=Math.min(dt.length,pt.length),jt=-1,Wt=0;Wt<Nt;++Wt){var Xn=tt[Wt];if(Xn!==pt[Wt])return it(dt[Wt],ot[Wt])<0?dt.substr(0,Wt)+ot[Wt]+ot.substr(Wt+1):it(dt[Wt],pt[Wt])<0?dt.substr(0,Wt)+pt[Wt]+ot.substr(Wt+1):0<=jt?dt.substr(0,jt)+tt[jt]+ot.substr(jt+1):null;it(dt[Wt],Xn)<0&&(jt=Wt)}return Nt<pt.length&&bt==="next"?dt+ot.substr(dt.length):Nt<dt.length&&bt==="prev"?dt.substr(0,ot.length):jt<0?null:dt.substr(0,jt)+pt[jt]+ot.substr(jt+1)}(Oe,Me,te[Fe],pe[Fe],K,ge);nt===null&&Ne===null?ce=Fe+1:(Ne===null||0<K(Ne,nt))&&(Ne=nt)}return Se(Ne!==null?function(){ye.continue(Ne+ue)}:ve),!1}),f}function fa(f,m,w,x){return{type:2,lower:f,upper:m,lowerOpen:w,upperOpen:x}}function zc(f){return{type:1,lower:f,upper:f}}var Iu=(Object.defineProperty(Tn.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Tn.prototype.between=function(f,m,w,x){w=w!==!1,x=x===!0;try{return 0<this._cmp(f,m)||this._cmp(f,m)===0&&(w||x)&&(!w||!x)?ti(this):new this.Collection(this,function(){return fa(f,m,!w,!x)})}catch{return Zn(this,Ir)}},Tn.prototype.equals=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return zc(f)})},Tn.prototype.above=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return fa(f,void 0,!0)})},Tn.prototype.aboveOrEqual=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return fa(f,void 0,!1)})},Tn.prototype.below=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return fa(void 0,f,!1,!0)})},Tn.prototype.belowOrEqual=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return fa(void 0,f)})},Tn.prototype.startsWith=function(f){return typeof f!="string"?Zn(this,Tu):this.between(f,f+oa,!0,!0)},Tn.prototype.startsWithIgnoreCase=function(f){return f===""?this.startsWith(f):Lo(this,function(m,w){return m.indexOf(w[0])===0},[f],oa)},Tn.prototype.equalsIgnoreCase=function(f){return Lo(this,function(m,w){return m===w[0]},[f],"")},Tn.prototype.anyOfIgnoreCase=function(){var f=de.apply(ie,arguments);return f.length===0?ti(this):Lo(this,function(m,w){return w.indexOf(m)!==-1},f,"")},Tn.prototype.startsWithAnyOfIgnoreCase=function(){var f=de.apply(ie,arguments);return f.length===0?ti(this):Lo(this,function(m,w){return w.some(function(x){return m.indexOf(x)===0})},f,oa)},Tn.prototype.anyOf=function(){var f=this,m=de.apply(ie,arguments),w=this._cmp;try{m.sort(w)}catch{return Zn(this,Ir)}if(m.length===0)return ti(this);var x=new this.Collection(this,function(){return fa(m[0],m[m.length-1])});x._ondirectionchange=function(M){w=M==="next"?f._ascending:f._descending,m.sort(w)};var O=0;return x._addAlgorithm(function(M,K,te){for(var pe=M.key;0<w(pe,m[O]);)if(++O===m.length)return K(te),!1;return w(pe,m[O])===0||(K(function(){M.continue(m[O])}),!1)}),x},Tn.prototype.notEqual=function(f){return this.inAnyRange([[-1/0,f],[f,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Tn.prototype.noneOf=function(){var f=de.apply(ie,arguments);if(f.length===0)return new this.Collection(this);try{f.sort(this._ascending)}catch{return Zn(this,Ir)}var m=f.reduce(function(w,x){return w?w.concat([[w[w.length-1][1],x]]):[[-1/0,x]]},null);return m.push([f[f.length-1],this.db._maxKey]),this.inAnyRange(m,{includeLowers:!1,includeUppers:!1})},Tn.prototype.inAnyRange=function(Oe,m){var w=this,x=this._cmp,O=this._ascending,M=this._descending,K=this._min,te=this._max;if(Oe.length===0)return ti(this);if(!Oe.every(function(Me){return Me[0]!==void 0&&Me[1]!==void 0&&O(Me[0],Me[1])<=0}))return Zn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Y.InvalidArgument);var pe=!m||m.includeLowers!==!1,ge=m&&m.includeUppers===!0,ue,Q=O;function me(Me,Ne){return Q(Me[0],Ne[0])}try{(ue=Oe.reduce(function(Me,Ne){for(var Fe=0,nt=Me.length;Fe<nt;++Fe){var dt=Me[Fe];if(x(Ne[0],dt[1])<0&&0<x(Ne[1],dt[0])){dt[0]=K(dt[0],Ne[0]),dt[1]=te(dt[1],Ne[1]);break}}return Fe===nt&&Me.push(Ne),Me},[])).sort(me)}catch{return Zn(this,Ir)}var ce=0,ye=ge?function(Me){return 0<O(Me,ue[ce][1])}:function(Me){return 0<=O(Me,ue[ce][1])},Se=pe?function(Me){return 0<M(Me,ue[ce][0])}:function(Me){return 0<=M(Me,ue[ce][0])},ve=ye,Oe=new this.Collection(this,function(){return fa(ue[0][0],ue[ue.length-1][1],!pe,!ge)});return Oe._ondirectionchange=function(Me){Q=Me==="next"?(ve=ye,O):(ve=Se,M),ue.sort(me)},Oe._addAlgorithm(function(Me,Ne,Fe){for(var nt,dt=Me.key;ve(dt);)if(++ce===ue.length)return Ne(Fe),!1;return!ye(nt=dt)&&!Se(nt)||(w._cmp(dt,ue[ce][1])===0||w._cmp(dt,ue[ce][0])===0||Ne(function(){Q===O?Me.continue(ue[ce][0]):Me.continue(ue[ce][1])}),!1)}),Oe},Tn.prototype.startsWithAnyOf=function(){var f=de.apply(ie,arguments);return f.every(function(m){return typeof m=="string"})?f.length===0?ti(this):this.inAnyRange(f.map(function(m){return[m,m+oa]})):Zn(this,"startsWithAnyOf() only works with strings")},Tn);function Tn(){}function Vr(f){return Vt(function(m){return Wi(m),f(m.target.error),!1})}function Wi(f){f.stopPropagation&&f.stopPropagation(),f.preventDefault&&f.preventDefault()}var ro="storagemutated",dl="x-storagemutated-1",pa=wi(null,ro),qf=(Rr.prototype._lock=function(){return y(!we.global),++this._reculock,this._reculock!==1||we.global||(we.lockOwnerFor=this),this},Rr.prototype._unlock=function(){if(y(!we.global),--this._reculock==0)for(we.global||(we.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var f=this._blockedFuncs.shift();try{or(f[1],f[0])}catch{}}return this},Rr.prototype._locked=function(){return this._reculock&&we.lockOwnerFor!==this},Rr.prototype.create=function(f){var m=this;if(!this.mode)return this;var w=this.db.idbdb,x=this.db._state.dbOpenError;if(y(!this.idbtrans),!f&&!w)switch(x&&x.name){case"DatabaseClosedError":throw new Y.DatabaseClosed(x);case"MissingAPIError":throw new Y.MissingAPI(x.message,x);default:throw new Y.OpenFailed(x)}if(!this.active)throw new Y.TransactionInactive;return y(this._completion._state===null),(f=this.idbtrans=f||(this.db.core||w).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Vt(function(O){Wi(O),m._reject(f.error)}),f.onabort=Vt(function(O){Wi(O),m.active&&m._reject(new Y.Abort(f.error)),m.active=!1,m.on("abort").fire(O)}),f.oncomplete=Vt(function(){m.active=!1,m._resolve(),"mutatedParts"in f&&pa.storagemutated.fire(f.mutatedParts)}),this},Rr.prototype._promise=function(f,m,w){var x=this;if(f==="readwrite"&&this.mode!=="readwrite")return un(new Y.ReadOnly("Transaction is readonly"));if(!this.active)return un(new Y.TransactionInactive);if(this._locked())return new $e(function(M,K){x._blockedFuncs.push([function(){x._promise(f,m,w).then(M,K)},we])});if(w)return Lr(function(){var M=new $e(function(K,te){x._lock();var pe=m(K,te,x);pe&&pe.then&&pe.then(K,te)});return M.finally(function(){return x._unlock()}),M._lib=!0,M});var O=new $e(function(M,K){var te=m(M,K,x);te&&te.then&&te.then(M,K)});return O._lib=!0,O},Rr.prototype._root=function(){return this.parent?this.parent._root():this},Rr.prototype.waitFor=function(f){var m,w=this._root(),x=$e.resolve(f);w._waitingFor?w._waitingFor=w._waitingFor.then(function(){return x}):(w._waitingFor=x,w._waitingQueue=[],m=w.idbtrans.objectStore(w.storeNames[0]),function M(){for(++w._spinCount;w._waitingQueue.length;)w._waitingQueue.shift()();w._waitingFor&&(m.get(-1/0).onsuccess=M)}());var O=w._waitingFor;return new $e(function(M,K){x.then(function(te){return w._waitingQueue.push(Vt(M.bind(null,te)))},function(te){return w._waitingQueue.push(Vt(K.bind(null,te)))}).finally(function(){w._waitingFor===O&&(w._waitingFor=null)})})},Rr.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Y.Abort))},Rr.prototype.table=function(f){var m=this._memoizedTables||(this._memoizedTables={});if(d(m,f))return m[f];var w=this.schema[f];if(!w)throw new Y.NotFound("Table "+f+" not part of transaction");return w=new this.db.Table(f,w,this),w.core=this.db.core.table(f),m[f]=w},Rr);function Rr(){}function fl(f,m,w,x,O,M,K){return{name:f,keyPath:m,unique:w,multi:x,auto:O,compound:M,src:(w&&!K?"&":"")+(x?"*":"")+(O?"++":"")+vd(m)}}function vd(f){return typeof f=="string"?f:f?"["+[].join.call(f,"+")+"]":""}function Sl(f,m,w){return{name:f,primKey:m,indexes:w,mappedClass:null,idxByName:(x=function(O){return[O.name,O]},w.reduce(function(O,M,K){return K=x(M,K),K&&(O[K[0]]=K[1]),O},{}))};var x}var Ji=function(f){try{return f.only([[]]),Ji=function(){return[[]]},[[]]}catch{return Ji=function(){return oa},oa}};function hl(f){return f==null?function(){}:typeof f=="string"?(m=f).split(".").length===1?function(w){return w[m]}:function(w){return k(w,m)}:function(w){return k(w,f)};var m}function yi(f){return[].slice.call(f)}var Gi=0;function ao(f){return f==null?":id":typeof f=="string"?f:"[".concat(f.join("+"),"]")}function km(f,m,pe){function x(ve){if(ve.type===3)return null;if(ve.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var ce=ve.lower,ye=ve.upper,Se=ve.lowerOpen,ve=ve.upperOpen;return ce===void 0?ye===void 0?null:m.upperBound(ye,!!ve):ye===void 0?m.lowerBound(ce,!!Se):m.bound(ce,ye,!!Se,!!ve)}function O(me){var ce,ye=me.name;return{name:ye,schema:me,mutate:function(Se){var ve=Se.trans,Oe=Se.type,Me=Se.keys,Ne=Se.values,Fe=Se.range;return new Promise(function(nt,dt){nt=Vt(nt);var tt=ve.objectStore(ye),ot=tt.keyPath==null,pt=Oe==="put"||Oe==="add";if(!pt&&Oe!=="delete"&&Oe!=="deleteRange")throw new Error("Invalid operation type: "+Oe);var it,bt=(Me||Ne||{length:1}).length;if(Me&&Ne&&Me.length!==Ne.length)throw new Error("Given keys array must have same length as given values array.");if(bt===0)return nt({numFailures:0,failures:{},results:[],lastResult:void 0});function Nt(zn){++Xn,Wi(zn)}var jt=[],Wt=[],Xn=0;if(Oe==="deleteRange"){if(Fe.type===4)return nt({numFailures:Xn,failures:Wt,results:[],lastResult:void 0});Fe.type===3?jt.push(it=tt.clear()):jt.push(it=tt.delete(x(Fe)))}else{var ot=pt?ot?[Ne,Me]:[Ne,null]:[Me,null],Pt=ot[0],Pn=ot[1];if(pt)for(var Rn=0;Rn<bt;++Rn)jt.push(it=Pn&&Pn[Rn]!==void 0?tt[Oe](Pt[Rn],Pn[Rn]):tt[Oe](Pt[Rn])),it.onerror=Nt;else for(Rn=0;Rn<bt;++Rn)jt.push(it=tt[Oe](Pt[Rn])),it.onerror=Nt}function Co(zn){zn=zn.target.result,jt.forEach(function(Sa,vl){return Sa.error!=null&&(Wt[vl]=Sa.error)}),nt({numFailures:Xn,failures:Wt,results:Oe==="delete"?Me:jt.map(function(Sa){return Sa.result}),lastResult:zn})}it.onerror=function(zn){Nt(zn),Co(zn)},it.onsuccess=Co})},getMany:function(Se){var ve=Se.trans,Oe=Se.keys;return new Promise(function(Me,Ne){Me=Vt(Me);for(var Fe,nt=ve.objectStore(ye),dt=Oe.length,tt=new Array(dt),ot=0,pt=0,it=function(jt){jt=jt.target,tt[jt._pos]=jt.result,++pt===ot&&Me(tt)},bt=Vr(Ne),Nt=0;Nt<dt;++Nt)Oe[Nt]!=null&&((Fe=nt.get(Oe[Nt]))._pos=Nt,Fe.onsuccess=it,Fe.onerror=bt,++ot);ot===0&&Me(tt)})},get:function(Se){var ve=Se.trans,Oe=Se.key;return new Promise(function(Me,Ne){Me=Vt(Me);var Fe=ve.objectStore(ye).get(Oe);Fe.onsuccess=function(nt){return Me(nt.target.result)},Fe.onerror=Vr(Ne)})},query:(ce=ge,function(Se){return new Promise(function(ve,Oe){ve=Vt(ve);var Me,Ne,Fe,ot=Se.trans,nt=Se.values,dt=Se.limit,it=Se.query,tt=dt===1/0?void 0:dt,pt=it.index,it=it.range,ot=ot.objectStore(ye),pt=pt.isPrimaryKey?ot:ot.index(pt.name),it=x(it);if(dt===0)return ve({result:[]});ce?((tt=nt?pt.getAll(it,tt):pt.getAllKeys(it,tt)).onsuccess=function(bt){return ve({result:bt.target.result})},tt.onerror=Vr(Oe)):(Me=0,Ne=!nt&&"openKeyCursor"in pt?pt.openKeyCursor(it):pt.openCursor(it),Fe=[],Ne.onsuccess=function(bt){var Nt=Ne.result;return Nt?(Fe.push(nt?Nt.value:Nt.primaryKey),++Me===dt?ve({result:Fe}):void Nt.continue()):ve({result:Fe})},Ne.onerror=Vr(Oe))})}),openCursor:function(Se){var ve=Se.trans,Oe=Se.values,Me=Se.query,Ne=Se.reverse,Fe=Se.unique;return new Promise(function(nt,dt){nt=Vt(nt);var pt=Me.index,tt=Me.range,ot=ve.objectStore(ye),ot=pt.isPrimaryKey?ot:ot.index(pt.name),pt=Ne?Fe?"prevunique":"prev":Fe?"nextunique":"next",it=!Oe&&"openKeyCursor"in ot?ot.openKeyCursor(x(tt),pt):ot.openCursor(x(tt),pt);it.onerror=Vr(dt),it.onsuccess=Vt(function(bt){var Nt,jt,Wt,Xn,Pt=it.result;Pt?(Pt.___id=++Gi,Pt.done=!1,Nt=Pt.continue.bind(Pt),jt=(jt=Pt.continuePrimaryKey)&&jt.bind(Pt),Wt=Pt.advance.bind(Pt),Xn=function(){throw new Error("Cursor not stopped")},Pt.trans=ve,Pt.stop=Pt.continue=Pt.continuePrimaryKey=Pt.advance=function(){throw new Error("Cursor not started")},Pt.fail=Vt(dt),Pt.next=function(){var Pn=this,Rn=1;return this.start(function(){return Rn--?Pn.continue():Pn.stop()}).then(function(){return Pn})},Pt.start=function(Pn){function Rn(){if(it.result)try{Pn()}catch(zn){Pt.fail(zn)}else Pt.done=!0,Pt.start=function(){throw new Error("Cursor behind last entry")},Pt.stop()}var Co=new Promise(function(zn,Sa){zn=Vt(zn),it.onerror=Vr(Sa),Pt.fail=Sa,Pt.stop=function(vl){Pt.stop=Pt.continue=Pt.continuePrimaryKey=Pt.advance=Xn,zn(vl)}});return it.onsuccess=Vt(function(zn){it.onsuccess=Rn,Rn()}),Pt.continue=Nt,Pt.continuePrimaryKey=jt,Pt.advance=Wt,Rn(),Co},nt(Pt)):nt(null)},dt)})},count:function(Se){var ve=Se.query,Oe=Se.trans,Me=ve.index,Ne=ve.range;return new Promise(function(Fe,nt){var dt=Oe.objectStore(ye),tt=Me.isPrimaryKey?dt:dt.index(Me.name),dt=x(Ne),tt=dt?tt.count(dt):tt.count();tt.onsuccess=Vt(function(ot){return Fe(ot.target.result)}),tt.onerror=Vr(nt)})}}}var M,K,te,ue=(K=pe,te=yi((M=f).objectStoreNames),{schema:{name:M.name,tables:te.map(function(me){return K.objectStore(me)}).map(function(me){var ce=me.keyPath,ve=me.autoIncrement,ye=s(ce),Se={},ve={name:me.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ce==null,compound:ye,keyPath:ce,autoIncrement:ve,unique:!0,extractKey:hl(ce)},indexes:yi(me.indexNames).map(function(Oe){return me.index(Oe)}).map(function(Fe){var Me=Fe.name,Ne=Fe.unique,nt=Fe.multiEntry,Fe=Fe.keyPath,nt={name:Me,compound:s(Fe),keyPath:Fe,unique:Ne,multiEntry:nt,extractKey:hl(Fe)};return Se[ao(Fe)]=nt}),getIndexByKeyPath:function(Oe){return Se[ao(Oe)]}};return Se[":id"]=ve.primaryKey,ce!=null&&(Se[ao(ce)]=ve.primaryKey),ve})},hasGetAll:0<te.length&&"getAll"in K.objectStore(te[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),pe=ue.schema,ge=ue.hasGetAll,ue=pe.tables.map(O),Q={};return ue.forEach(function(me){return Q[me.name]=me}),{stack:"dbcore",transaction:f.transaction.bind(f),table:function(me){if(!Q[me])throw new Error("Table '".concat(me,"' not found"));return Q[me]},MIN_KEY:-1/0,MAX_KEY:Ji(m),schema:pe}}function Em(f,m,w,x){var O=w.IDBKeyRange;return w.indexedDB,{dbcore:(x=km(m,O,x),f.dbcore.reduce(function(M,K){return K=K.create,r(r({},M),K(M))},x))}}function Qo(f,x){var w=x.db,x=Em(f._middlewares,w,f._deps,x);f.core=x.dbcore,f.tables.forEach(function(O){var M=O.name;f.core.schema.tables.some(function(K){return K.name===M})&&(O.core=f.core.table(M),f[M]instanceof f.Table&&(f[M].core=O.core))})}function es(f,m,w,x){w.forEach(function(O){var M=x[O];m.forEach(function(K){var te=function pe(ge,ue){return b(ge,ue)||(ge=u(ge))&&pe(ge,ue)}(K,O);(!te||"value"in te&&te.value===void 0)&&(K===f.Transaction.prototype||K instanceof f.Transaction?g(K,O,{get:function(){return this.table(O)},set:function(pe){h(this,O,{value:pe,writable:!0,configurable:!0,enumerable:!0})}}):K[O]=new f.Table(O,M))})})}function kl(f,m){m.forEach(function(w){for(var x in w)w[x]instanceof f.Table&&delete w[x]})}function Kf(f,m){return f._cfg.version-m._cfg.version}function xm(f,m,w,x){var O=f._dbSchema;w.objectStoreNames.contains("$meta")&&!O.$meta&&(O.$meta=Sl("$meta",cu("")[0],[]),f._storeNames.push("$meta"));var M=f._createTransaction("readwrite",f._storeNames,O);M.create(w),M._completion.catch(x);var K=M._reject.bind(M),te=we.transless||we;Lr(function(){return we.trans=M,we.transless=te,m!==0?(Qo(f,w),ge=m,((pe=M).storeNames.includes("$meta")?pe.table("$meta").get("version").then(function(ue){return ue??ge}):$e.resolve(ge)).then(function(ue){return me=ue,ce=M,ye=w,Se=[],ue=(Q=f)._versions,ve=Q._dbSchema=_i(0,Q.idbdb,ye),(ue=ue.filter(function(Oe){return Oe._cfg.version>=me})).length!==0?(ue.forEach(function(Oe){Se.push(function(){var Me=ve,Ne=Oe._cfg.dbschema;Fo(Q,Me,ye),Fo(Q,Ne,ye),ve=Q._dbSchema=Ne;var Fe=fs(Me,Ne);Fe.add.forEach(function(pt){ts(ye,pt[0],pt[1].primKey,pt[1].indexes)}),Fe.change.forEach(function(pt){if(pt.recreate)throw new Y.Upgrade("Not yet support for changing primary key");var it=ye.objectStore(pt.name);pt.add.forEach(function(bt){return Oo(it,bt)}),pt.change.forEach(function(bt){it.deleteIndex(bt.name),Oo(it,bt)}),pt.del.forEach(function(bt){return it.deleteIndex(bt)})});var nt=Oe._cfg.contentUpgrade;if(nt&&Oe._cfg.version>me){Qo(Q,ye),ce._memoizedTables={};var dt=I(Ne);Fe.del.forEach(function(pt){dt[pt]=Me[pt]}),kl(Q,[Q.Transaction.prototype]),es(Q,[Q.Transaction.prototype],o(dt),dt),ce.schema=dt;var tt,ot=ee(nt);return ot&&Yn(),Fe=$e.follow(function(){var pt;(tt=nt(ce))&&ot&&(pt=ar.bind(null,null),tt.then(pt,pt))}),tt&&typeof tt.then=="function"?$e.resolve(tt):Fe.then(function(){return tt})}}),Se.push(function(Me){var Ne,Fe,nt=Oe._cfg.dbschema;Ne=nt,Fe=Me,[].slice.call(Fe.db.objectStoreNames).forEach(function(dt){return Ne[dt]==null&&Fe.db.deleteObjectStore(dt)}),kl(Q,[Q.Transaction.prototype]),es(Q,[Q.Transaction.prototype],Q._storeNames,Q._dbSchema),ce.schema=Q._dbSchema}),Se.push(function(Me){Q.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(Q.idbdb.version/10)===Oe._cfg.version?(Q.idbdb.deleteObjectStore("$meta"),delete Q._dbSchema.$meta,Q._storeNames=Q._storeNames.filter(function(Ne){return Ne!=="$meta"})):Me.objectStore("$meta").put(Oe._cfg.version,"version"))})}),function Oe(){return Se.length?$e.resolve(Se.shift()(ce.idbtrans)).then(Oe):$e.resolve()}().then(function(){Wc(ve,ye)})):$e.resolve();var Q,me,ce,ye,Se,ve}).catch(K)):(o(O).forEach(function(ue){ts(w,ue,O[ue].primKey,O[ue].indexes)}),Qo(f,w),void $e.follow(function(){return f.on.populate.fire(M)}).catch(K));var pe,ge})}function ds(f,m){Wc(f._dbSchema,m),m.db.version%10!=0||m.objectStoreNames.contains("$meta")||m.db.createObjectStore("$meta").add(Math.ceil(m.db.version/10-1),"version");var w=_i(0,f.idbdb,m);Fo(f,f._dbSchema,m);for(var x=0,O=fs(w,f._dbSchema).change;x<O.length;x++){var M=function(K){if(K.change.length||K.recreate)return console.warn("Unable to patch indexes of table ".concat(K.name," because it has changes on the type of index or primary key.")),{value:void 0};var te=m.objectStore(K.name);K.add.forEach(function(pe){se&&console.debug("Dexie upgrade patch: Creating missing index ".concat(K.name,".").concat(pe.src)),Oo(te,pe)})}(O[x]);if(typeof M=="object")return M.value}}function fs(f,m){var w,x={del:[],add:[],change:[]};for(w in f)m[w]||x.del.push(w);for(w in m){var O=f[w],M=m[w];if(O){var K={name:w,def:M,recreate:!1,del:[],add:[],change:[]};if(""+(O.primKey.keyPath||"")!=""+(M.primKey.keyPath||"")||O.primKey.auto!==M.primKey.auto)K.recreate=!0,x.change.push(K);else{var te=O.idxByName,pe=M.idxByName,ge=void 0;for(ge in te)pe[ge]||K.del.push(ge);for(ge in pe){var ue=te[ge],Q=pe[ge];ue?ue.src!==Q.src&&K.change.push(Q):K.add.push(Q)}(0<K.del.length||0<K.add.length||0<K.change.length)&&x.change.push(K)}}else x.add.push([w,M])}return x}function ts(f,m,w,x){var O=f.db.createObjectStore(m,w.keyPath?{keyPath:w.keyPath,autoIncrement:w.auto}:{autoIncrement:w.auto});return x.forEach(function(M){return Oo(O,M)}),O}function Wc(f,m){o(f).forEach(function(w){m.db.objectStoreNames.contains(w)||(se&&console.debug("Dexie: Creating missing table",w),ts(m,w,f[w].primKey,f[w].indexes))})}function Oo(f,m){f.createIndex(m.name,m.keyPath,{unique:m.unique,multiEntry:m.multi})}function _i(f,m,w){var x={};return C(m.objectStoreNames,0).forEach(function(O){for(var M=w.objectStore(O),K=fl(vd(ge=M.keyPath),ge||"",!0,!1,!!M.autoIncrement,ge&&typeof ge!="string",!0),te=[],pe=0;pe<M.indexNames.length;++pe){var ue=M.index(M.indexNames[pe]),ge=ue.keyPath,ue=fl(ue.name,ge,!!ue.unique,!!ue.multiEntry,!1,ge&&typeof ge!="string",!1);te.push(ue)}x[O]=Sl(O,K,te)}),x}function Fo(f,m,w){for(var x=w.db.objectStoreNames,O=0;O<x.length;++O){var M=x[O],K=w.objectStore(M);f._hasGetAll="getAll"in K;for(var te=0;te<K.indexNames.length;++te){var pe=K.indexNames[te],ge=K.index(pe).keyPath,ue=typeof ge=="string"?ge:"["+C(ge).join("+")+"]";!m[M]||(ge=m[M].idxByName[ue])&&(ge.name=pe,delete m[M].idxByName[ue],m[M].idxByName[pe]=ge)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(f._hasGetAll=!1)}function cu(f){return f.split(",").map(function(m,w){var x=(m=m.trim()).replace(/([&*]|\+\+)/g,""),O=/^\[/.test(x)?x.match(/^\[(.*)\]$/)[1].split("+"):x;return fl(x,O||null,/\&/.test(m),/\*/.test(m),/\+\+/.test(m),s(O),w===0)})}var Gd=(lo.prototype._parseStoresSpec=function(f,m){o(f).forEach(function(w){if(f[w]!==null){var x=cu(f[w]),O=x.shift();if(O.unique=!0,O.multi)throw new Y.Schema("Primary key cannot be multi-valued");x.forEach(function(M){if(M.auto)throw new Y.Schema("Only primary key can be marked as autoIncrement (++)");if(!M.keyPath)throw new Y.Schema("Index must have a name and cannot be an empty string")}),m[w]=Sl(w,O,x)}})},lo.prototype.stores=function(w){var m=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,w):w;var w=m._versions,x={},O={};return w.forEach(function(M){l(x,M._cfg.storesSource),O=M._cfg.dbschema={},M._parseStoresSpec(x,O)}),m._dbSchema=O,kl(m,[m._allTables,m,m.Transaction.prototype]),es(m,[m._allTables,m,m.Transaction.prototype,this._cfg.tables],o(O),O),m._storeNames=o(O),this},lo.prototype.upgrade=function(f){return this._cfg.contentUpgrade=ne(this._cfg.contentUpgrade||Pe,f),this},lo);function lo(){}function $s(f,m){var w=f._dbNamesDB;return w||(w=f._dbNamesDB=new ea(ho,{addons:[],indexedDB:f,IDBKeyRange:m})).version(1).stores({dbnames:"name"}),w.table("dbnames")}function uo(f){return f&&typeof f.databases=="function"}function fi(f){return Lr(function(){return we.letThrough=!0,f()})}function Hs(f){return!("from"in f)}var Dn=function(f,m){if(!this){var w=new Dn;return f&&"d"in f&&l(w,f),w}l(this,arguments.length?{d:1,from:f,to:1<arguments.length?m:f}:{d:0})};function io(f,m,w){var x=Kt(m,w);if(!isNaN(x)){if(0<x)throw RangeError();if(Hs(f))return l(f,{from:m,to:w,d:1});var O=f.l,x=f.r;if(Kt(w,f.from)<0)return O?io(O,m,w):f.l={from:m,to:w,d:1,l:null,r:null},Ru(f);if(0<Kt(m,f.to))return x?io(x,m,w):f.r={from:m,to:w,d:1,l:null,r:null},Ru(f);Kt(m,f.from)<0&&(f.from=m,f.l=null,f.d=x?x.d+1:1),0<Kt(w,f.to)&&(f.to=w,f.r=null,f.d=f.l?f.l.d+1:1),w=!f.r,O&&!f.l&&Zi(f,O),x&&w&&Zi(f,x)}}function Zi(f,m){Hs(m)||function w(x,pe){var M=pe.from,K=pe.to,te=pe.l,pe=pe.r;io(x,M,K),te&&w(x,te),pe&&w(x,pe)}(f,m)}function pl(f,m){var w=_o(m),x=w.next();if(x.done)return!1;for(var O=x.value,M=_o(f),K=M.next(O.from),te=K.value;!x.done&&!K.done;){if(Kt(te.from,O.to)<=0&&0<=Kt(te.to,O.from))return!0;Kt(O.from,te.from)<0?O=(x=w.next(te.from)).value:te=(K=M.next(O.from)).value}return!1}function _o(f){var m=Hs(f)?null:{s:0,n:f};return{next:function(w){for(var x=0<arguments.length;m;)switch(m.s){case 0:if(m.s=1,x)for(;m.n.l&&Kt(w,m.n.from)<0;)m={up:m,n:m.n.l,s:1};else for(;m.n.l;)m={up:m,n:m.n.l,s:1};case 1:if(m.s=2,!x||Kt(w,m.n.to)<=0)return{value:m.n,done:!1};case 2:if(m.n.r){m.s=3,m={up:m,n:m.n.r,s:0};continue}case 3:m=m.up}return{done:!0}}}}function Ru(f){var m,w,x=(((m=f.r)===null||m===void 0?void 0:m.d)||0)-(((w=f.l)===null||w===void 0?void 0:w.d)||0),O=1<x?"r":x<-1?"l":"";O&&(m=O=="r"?"l":"r",w=r({},f),x=f[O],f.from=x.from,f.to=x.to,f[O]=x[O],w[O]=x[m],(f[m]=w).d=bi(w)),f.d=bi(f)}function bi(w){var m=w.r,w=w.l;return(m?w?Math.max(m.d,w.d):m.d:w?w.d:0)+1}function ki(f,m){return o(m).forEach(function(w){f[w]?Zi(f[w],m[w]):f[w]=function x(O){var M,K,te={};for(M in O)d(O,M)&&(K=O[M],te[M]=!K||typeof K!="object"||R.has(K.constructor)?K:x(K));return te}(m[w])}),f}function ns(f,m){return f.all||m.all||Object.keys(f).some(function(w){return m[w]&&pl(m[w],f[w])})}p(Dn.prototype,((er={add:function(f){return Zi(this,f),this},addKey:function(f){return io(this,f,f),this},addKeys:function(f){var m=this;return f.forEach(function(w){return io(m,w,w)}),this},hasKey:function(f){var m=_o(this).next(f).value;return m&&Kt(m.from,f)<=0&&0<=Kt(m.to,f)}})[N]=function(){return _o(this)},er));var Ca={},Io={},El=!1;function Bo(f){ki(Io,f),El||(El=!0,setTimeout(function(){El=!1,ml(Io,!(Io={}))},0))}function ml(f,m){m===void 0&&(m=!1);var w=new Set;if(f.all)for(var x=0,O=Object.values(Ca);x<O.length;x++)tc(K=O[x],f,w,m);else for(var M in f){var K,te=/^idb\:\/\/(.*)\/(.*)\//.exec(M);te&&(M=te[1],te=te[2],(K=Ca["idb://".concat(M,"/").concat(te)])&&tc(K,f,w,m))}w.forEach(function(pe){return pe()})}function tc(f,m,w,x){for(var O=[],M=0,K=Object.entries(f.queries.query);M<K.length;M++){for(var te=K[M],pe=te[0],ge=[],ue=0,Q=te[1];ue<Q.length;ue++){var me=Q[ue];ns(m,me.obsSet)?me.subscribers.forEach(function(ve){return w.add(ve)}):x&&ge.push(me)}x&&O.push([pe,ge])}if(x)for(var ce=0,ye=O;ce<ye.length;ce++){var Se=ye[ce],pe=Se[0],ge=Se[1];f.queries.query[pe]=ge}}function Yf(f){var m=f._state,w=f._deps.indexedDB;if(m.isBeingOpened||f.idbdb)return m.dbReadyPromise.then(function(){return m.dbOpenError?un(m.dbOpenError):f});m.isBeingOpened=!0,m.dbOpenError=null,m.openComplete=!1;var x=m.openCanceller,O=Math.round(10*f.verno),M=!1;function K(){if(m.openCanceller!==x)throw new Y.DatabaseClosed("db.open() was cancelled")}function te(){return new $e(function(me,ce){if(K(),!w)throw new Y.MissingAPI;var ye=f.name,Se=m.autoSchema||!O?w.open(ye):w.open(ye,O);if(!Se)throw new Y.MissingAPI;Se.onerror=Vr(ce),Se.onblocked=Vt(f._fireOnBlocked),Se.onupgradeneeded=Vt(function(ve){var Oe;ue=Se.transaction,m.autoSchema&&!f._options.allowEmptyDB?(Se.onerror=Wi,ue.abort(),Se.result.close(),(Oe=w.deleteDatabase(ye)).onsuccess=Oe.onerror=Vt(function(){ce(new Y.NoSuchDatabase("Database ".concat(ye," doesnt exist")))})):(ue.onerror=Vr(ce),ve=ve.oldVersion>Math.pow(2,62)?0:ve.oldVersion,Q=ve<1,f.idbdb=Se.result,M&&ds(f,ue),xm(f,ve/10,ue,ce))},ce),Se.onsuccess=Vt(function(){ue=null;var ve,Oe,Me,Ne,Fe,nt=f.idbdb=Se.result,dt=C(nt.objectStoreNames);if(0<dt.length)try{var tt=nt.transaction((Ne=dt).length===1?Ne[0]:Ne,"readonly");if(m.autoSchema)Oe=nt,Me=tt,(ve=f).verno=Oe.version/10,Me=ve._dbSchema=_i(0,Oe,Me),ve._storeNames=C(Oe.objectStoreNames,0),es(ve,[ve._allTables],o(Me),Me);else if(Fo(f,f._dbSchema,tt),((Fe=fs(_i(0,(Fe=f).idbdb,tt),Fe._dbSchema)).add.length||Fe.change.some(function(ot){return ot.add.length||ot.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."),nt.close(),O=nt.version+1,M=!0,me(te());Qo(f,tt)}catch{}wa.push(f),nt.onversionchange=Vt(function(ot){m.vcFired=!0,f.on("versionchange").fire(ot)}),nt.onclose=Vt(function(ot){f.on("close").fire(ot)}),Q&&(Fe=f._deps,tt=ye,nt=Fe.indexedDB,Fe=Fe.IDBKeyRange,uo(nt)||tt===ho||$s(nt,Fe).put({name:tt}).catch(Pe)),me()},ce)}).catch(function(me){switch(me==null?void 0:me.name){case"UnknownError":if(0<m.PR1398_maxLoop)return m.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),te();break;case"VersionError":if(0<O)return O=0,te()}return $e.reject(me)})}var pe,ge=m.dbReadyResolve,ue=null,Q=!1;return $e.race([x,(typeof navigator>"u"?$e.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(me){function ce(){return indexedDB.databases().finally(me)}pe=setInterval(ce,100),ce()}).finally(function(){return clearInterval(pe)}):Promise.resolve()).then(te)]).then(function(){return K(),m.onReadyBeingFired=[],$e.resolve(fi(function(){return f.on.ready.fire(f.vip)})).then(function me(){if(0<m.onReadyBeingFired.length){var ce=m.onReadyBeingFired.reduce(ne,Pe);return m.onReadyBeingFired=[],$e.resolve(fi(function(){return ce(f.vip)})).then(me)}})}).finally(function(){m.openCanceller===x&&(m.onReadyBeingFired=null,m.isBeingOpened=!1)}).catch(function(me){m.dbOpenError=me;try{ue&&ue.abort()}catch{}return x===m.openCanceller&&f._close(),un(me)}).finally(function(){m.openComplete=!0,ge()}).then(function(){var me;return Q&&(me={},f.tables.forEach(function(ce){ce.schema.indexes.forEach(function(ye){ye.name&&(me["idb://".concat(f.name,"/").concat(ce.name,"/").concat(ye.name)]=new Dn(-1/0,[[[]]]))}),me["idb://".concat(f.name,"/").concat(ce.name,"/")]=me["idb://".concat(f.name,"/").concat(ce.name,"/:dels")]=new Dn(-1/0,[[[]]])}),pa(ro).fire(me),ml(me,!0)),f})}function hs(f){function m(M){return f.next(M)}var w=O(m),x=O(function(M){return f.throw(M)});function O(M){return function(pe){var te=M(pe),pe=te.value;return te.done?pe:pe&&typeof pe.then=="function"?pe.then(w,x):s(pe)?Promise.all(pe).then(w,x):w(pe)}}return O(m)()}function rs(f,m,w){for(var x=s(f)?f.slice():[f],O=0;O<w;++O)x.push(m);return x}var bf={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(f){return r(r({},f),{table:function(m){var w=f.table(m),x=w.schema,O={},M=[];function K(Q,me,ce){var ye=ao(Q),Se=O[ye]=O[ye]||[],ve=Q==null?0:typeof Q=="string"?1:Q.length,Oe=0<me,Oe=r(r({},ce),{name:Oe?"".concat(ye,"(virtual-from:").concat(ce.name,")"):ce.name,lowLevelIndex:ce,isVirtual:Oe,keyTail:me,keyLength:ve,extractKey:hl(Q),unique:!Oe&&ce.unique});return Se.push(Oe),Oe.isPrimaryKey||M.push(Oe),1<ve&&K(ve===2?Q[0]:Q.slice(0,ve-1),me+1,ce),Se.sort(function(Me,Ne){return Me.keyTail-Ne.keyTail}),Oe}m=K(x.primaryKey.keyPath,0,x.primaryKey),O[":id"]=[m];for(var te=0,pe=x.indexes;te<pe.length;te++){var ge=pe[te];K(ge.keyPath,0,ge)}function ue(Q){var me,ce=Q.query.index;return ce.isVirtual?r(r({},Q),{query:{index:ce.lowLevelIndex,range:(me=Q.query.range,ce=ce.keyTail,{type:me.type===1?2:me.type,lower:rs(me.lower,me.lowerOpen?f.MAX_KEY:f.MIN_KEY,ce),lowerOpen:!0,upper:rs(me.upper,me.upperOpen?f.MIN_KEY:f.MAX_KEY,ce),upperOpen:!0})}}):Q}return r(r({},w),{schema:r(r({},x),{primaryKey:m,indexes:M,getIndexByKeyPath:function(Q){return(Q=O[ao(Q)])&&Q[0]}}),count:function(Q){return w.count(ue(Q))},query:function(Q){return w.query(ue(Q))},openCursor:function(Q){var me=Q.query.index,ce=me.keyTail,ye=me.isVirtual,Se=me.keyLength;return ye?w.openCursor(ue(Q)).then(function(Oe){return Oe&&ve(Oe)}):w.openCursor(Q);function ve(Oe){return Object.create(Oe,{continue:{value:function(Me){Me!=null?Oe.continue(rs(Me,Q.reverse?f.MAX_KEY:f.MIN_KEY,ce)):Q.unique?Oe.continue(Oe.key.slice(0,Se).concat(Q.reverse?f.MIN_KEY:f.MAX_KEY,ce)):Oe.continue()}},continuePrimaryKey:{value:function(Me,Ne){Oe.continuePrimaryKey(rs(Me,f.MAX_KEY,ce),Ne)}},primaryKey:{get:function(){return Oe.primaryKey}},key:{get:function(){var Me=Oe.key;return Se===1?Me[0]:Me.slice(0,Se)}},value:{get:function(){return Oe.value}}})}}})}})}};function gl(f,m,w,x){return w=w||{},x=x||"",o(f).forEach(function(O){var M,K,te;d(m,O)?(M=f[O],K=m[O],typeof M=="object"&&typeof K=="object"&&M&&K?(te=V(M))!==V(K)?w[x+O]=m[O]:te==="Object"?gl(M,K,w,x+O+"."):M!==K&&(w[x+O]=m[O]):M!==K&&(w[x+O]=m[O])):w[x+O]=void 0}),o(m).forEach(function(O){d(f,O)||(w[x+O]=m[O])}),w}function js(f,m){return m.type==="delete"?m.keys:m.keys||m.values.map(f.extractKey)}var xh={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(f){return r(r({},f),{table:function(m){var w=f.table(m),x=w.schema.primaryKey;return r(r({},w),{mutate:function(O){var M=we.trans,K=M.table(m).hook,te=K.deleting,pe=K.creating,ge=K.updating;switch(O.type){case"add":if(pe.fire===Pe)break;return M._promise("readwrite",function(){return ue(O)},!0);case"put":if(pe.fire===Pe&&ge.fire===Pe)break;return M._promise("readwrite",function(){return ue(O)},!0);case"delete":if(te.fire===Pe)break;return M._promise("readwrite",function(){return ue(O)},!0);case"deleteRange":if(te.fire===Pe)break;return M._promise("readwrite",function(){return function Q(me,ce,ye){return w.query({trans:me,values:!1,query:{index:x,range:ce},limit:ye}).then(function(Se){var ve=Se.result;return ue({type:"delete",keys:ve,trans:me}).then(function(Oe){return 0<Oe.numFailures?Promise.reject(Oe.failures[0]):ve.length<ye?{failures:[],numFailures:0,lastResult:void 0}:Q(me,r(r({},ce),{lower:ve[ve.length-1],lowerOpen:!0}),ye)})})}(O.trans,O.range,1e4)},!0)}return w.mutate(O);function ue(Q){var me,ce,ye,Se=we.trans,ve=Q.keys||js(x,Q);if(!ve)throw new Error("Keys missing");return(Q=Q.type==="add"||Q.type==="put"?r(r({},Q),{keys:ve}):r({},Q)).type!=="delete"&&(Q.values=a([],Q.values)),Q.keys&&(Q.keys=a([],Q.keys)),me=w,ye=ve,((ce=Q).type==="add"?Promise.resolve([]):me.getMany({trans:ce.trans,keys:ye,cache:"immutable"})).then(function(Oe){var Me=ve.map(function(Ne,Fe){var nt,dt,tt,ot=Oe[Fe],pt={onerror:null,onsuccess:null};return Q.type==="delete"?te.fire.call(pt,Ne,ot,Se):Q.type==="add"||ot===void 0?(nt=pe.fire.call(pt,Ne,Q.values[Fe],Se),Ne==null&&nt!=null&&(Q.keys[Fe]=Ne=nt,x.outbound||E(Q.values[Fe],x.keyPath,Ne))):(nt=gl(ot,Q.values[Fe]),(dt=ge.fire.call(pt,nt,Ne,ot,Se))&&(tt=Q.values[Fe],Object.keys(dt).forEach(function(it){d(tt,it)?tt[it]=dt[it]:E(tt,it,dt[it])}))),pt});return w.mutate(Q).then(function(Ne){for(var Fe=Ne.failures,nt=Ne.results,dt=Ne.numFailures,Ne=Ne.lastResult,tt=0;tt<ve.length;++tt){var ot=(nt||ve)[tt],pt=Me[tt];ot==null?pt.onerror&&pt.onerror(Fe[tt]):pt.onsuccess&&pt.onsuccess(Q.type==="put"&&Oe[tt]?Q.values[tt]:ot)}return{failures:Fe,results:nt,numFailures:dt,lastResult:Ne}}).catch(function(Ne){return Me.forEach(function(Fe){return Fe.onerror&&Fe.onerror(Ne)}),Promise.reject(Ne)})})}}})}})}};function Gc(f,m,w){try{if(!m||m.keys.length<f.length)return null;for(var x=[],O=0,M=0;O<m.keys.length&&M<f.length;++O)Kt(m.keys[O],f[M])===0&&(x.push(w?P(m.values[O]):m.values[O]),++M);return x.length===f.length?x:null}catch{return null}}var Np={stack:"dbcore",level:-1,create:function(f){return{table:function(m){var w=f.table(m);return r(r({},w),{getMany:function(x){if(!x.cache)return w.getMany(x);var O=Gc(x.keys,x.trans._cache,x.cache==="clone");return O?$e.resolve(O):w.getMany(x).then(function(M){return x.trans._cache={keys:x.keys,values:x.cache==="clone"?P(M):M},M})},mutate:function(x){return x.type!=="add"&&(x.trans._cache=null),w.mutate(x)}})}}}};function du(f,m){return f.trans.mode==="readonly"&&!!f.subscr&&!f.trans.explicit&&f.trans.db._options.cache!=="disabled"&&!m.schema.primaryKey.outbound}function nc(f,m){switch(f){case"query":return m.values&&!m.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Tm={stack:"dbcore",level:0,name:"Observability",create:function(f){var m=f.schema.name,w=new Dn(f.MIN_KEY,f.MAX_KEY);return r(r({},f),{transaction:function(x,O,M){if(we.subscr&&O!=="readonly")throw new Y.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(we.querier));return f.transaction(x,O,M)},table:function(x){var O=f.table(x),M=O.schema,K=M.primaryKey,Q=M.indexes,te=K.extractKey,pe=K.outbound,ge=K.autoIncrement&&Q.filter(function(ce){return ce.compound&&ce.keyPath.includes(K.keyPath)}),ue=r(r({},O),{mutate:function(ce){function ye(it){return it="idb://".concat(m,"/").concat(x,"/").concat(it),Ne[it]||(Ne[it]=new Dn)}var Se,ve,Oe,Me=ce.trans,Ne=ce.mutatedParts||(ce.mutatedParts={}),Fe=ye(""),nt=ye(":dels"),dt=ce.type,pt=ce.type==="deleteRange"?[ce.range]:ce.type==="delete"?[ce.keys]:ce.values.length<50?[js(K,ce).filter(function(it){return it}),ce.values]:[],tt=pt[0],ot=pt[1],pt=ce.trans._cache;return s(tt)?(Fe.addKeys(tt),(pt=dt==="delete"||tt.length===ot.length?Gc(tt,pt):null)||nt.addKeys(tt),(pt||ot)&&(Se=ye,ve=pt,Oe=ot,M.indexes.forEach(function(it){var bt=Se(it.name||"");function Nt(Wt){return Wt!=null?it.extractKey(Wt):null}function jt(Wt){return it.multiEntry&&s(Wt)?Wt.forEach(function(Xn){return bt.addKey(Xn)}):bt.addKey(Wt)}(ve||Oe).forEach(function(Wt,Pn){var Pt=ve&&Nt(ve[Pn]),Pn=Oe&&Nt(Oe[Pn]);Kt(Pt,Pn)!==0&&(Pt!=null&&jt(Pt),Pn!=null&&jt(Pn))})}))):tt?(ot={from:(ot=tt.lower)!==null&&ot!==void 0?ot:f.MIN_KEY,to:(ot=tt.upper)!==null&&ot!==void 0?ot:f.MAX_KEY},nt.add(ot),Fe.add(ot)):(Fe.add(w),nt.add(w),M.indexes.forEach(function(it){return ye(it.name).add(w)})),O.mutate(ce).then(function(it){return!tt||ce.type!=="add"&&ce.type!=="put"||(Fe.addKeys(it.results),ge&&ge.forEach(function(bt){for(var Nt=ce.values.map(function(Pt){return bt.extractKey(Pt)}),jt=bt.keyPath.findIndex(function(Pt){return Pt===K.keyPath}),Wt=0,Xn=it.results.length;Wt<Xn;++Wt)Nt[Wt][jt]=it.results[Wt];ye(bt.name).addKeys(Nt)})),Me.mutatedParts=ki(Me.mutatedParts||{},Ne),it})}}),Q=function(ye){var Se=ye.query,ye=Se.index,Se=Se.range;return[ye,new Dn((ye=Se.lower)!==null&&ye!==void 0?ye:f.MIN_KEY,(Se=Se.upper)!==null&&Se!==void 0?Se:f.MAX_KEY)]},me={get:function(ce){return[K,new Dn(ce.key)]},getMany:function(ce){return[K,new Dn().addKeys(ce.keys)]},count:Q,query:Q,openCursor:Q};return o(me).forEach(function(ce){ue[ce]=function(ye){var Se=we.subscr,ve=!!Se,Oe=du(we,O)&&nc(ce,ye)?ye.obsSet={}:Se;if(ve){var Me=function(ot){return ot="idb://".concat(m,"/").concat(x,"/").concat(ot),Oe[ot]||(Oe[ot]=new Dn)},Ne=Me(""),Fe=Me(":dels"),Se=me[ce](ye),ve=Se[0],Se=Se[1];if((ce==="query"&&ve.isPrimaryKey&&!ye.values?Fe:Me(ve.name||"")).add(Se),!ve.isPrimaryKey){if(ce!=="count"){var nt=ce==="query"&&pe&&ye.values&&O.query(r(r({},ye),{values:!1}));return O[ce].apply(this,arguments).then(function(ot){if(ce==="query"){if(pe&&ye.values)return nt.then(function(Nt){return Nt=Nt.result,Ne.addKeys(Nt),ot});var pt=ye.values?ot.result.map(te):ot.result;(ye.values?Ne:Fe).addKeys(pt)}else if(ce==="openCursor"){var it=ot,bt=ye.values;return it&&Object.create(it,{key:{get:function(){return Fe.addKey(it.primaryKey),it.key}},primaryKey:{get:function(){var Nt=it.primaryKey;return Fe.addKey(Nt),Nt}},value:{get:function(){return bt&&Ne.addKey(it.primaryKey),it.value}}})}return ot})}Fe.add(w)}}return O[ce].apply(this,arguments)}}),ue}})}};function qc(f,m,w){if(w.numFailures===0)return m;if(m.type==="deleteRange")return null;var x=m.keys?m.keys.length:"values"in m&&m.values?m.values.length:1;return w.numFailures===x?null:(m=r({},m),s(m.keys)&&(m.keys=m.keys.filter(function(O,M){return!(M in w.failures)})),"values"in m&&s(m.values)&&(m.values=m.values.filter(function(O,M){return!(M in w.failures)})),m)}function qi(f,m){return w=f,((x=m).lower===void 0||(x.lowerOpen?0<Kt(w,x.lower):0<=Kt(w,x.lower)))&&(f=f,(m=m).upper===void 0||(m.upperOpen?Kt(f,m.upper)<0:Kt(f,m.upper)<=0));var w,x}function rc(f,m,me,x,O,M){if(!me||me.length===0)return f;var K=m.query.index,te=K.multiEntry,pe=m.query.range,ge=x.schema.primaryKey.extractKey,ue=K.extractKey,Q=(K.lowLevelIndex||K).extractKey,me=me.reduce(function(ce,ye){var Se=ce,ve=[];if(ye.type==="add"||ye.type==="put")for(var Oe=new Dn,Me=ye.values.length-1;0<=Me;--Me){var Ne,Fe=ye.values[Me],nt=ge(Fe);Oe.hasKey(nt)||(Ne=ue(Fe),(te&&s(Ne)?Ne.some(function(it){return qi(it,pe)}):qi(Ne,pe))&&(Oe.addKey(nt),ve.push(Fe)))}switch(ye.type){case"add":var dt=new Dn().addKeys(m.values?ce.map(function(bt){return ge(bt)}):ce),Se=ce.concat(m.values?ve.filter(function(bt){return bt=ge(bt),!dt.hasKey(bt)&&(dt.addKey(bt),!0)}):ve.map(function(bt){return ge(bt)}).filter(function(bt){return!dt.hasKey(bt)&&(dt.addKey(bt),!0)}));break;case"put":var tt=new Dn().addKeys(ye.values.map(function(bt){return ge(bt)}));Se=ce.filter(function(bt){return!tt.hasKey(m.values?ge(bt):bt)}).concat(m.values?ve:ve.map(function(bt){return ge(bt)}));break;case"delete":var ot=new Dn().addKeys(ye.keys);Se=ce.filter(function(bt){return!ot.hasKey(m.values?ge(bt):bt)});break;case"deleteRange":var pt=ye.range;Se=ce.filter(function(bt){return!qi(ge(bt),pt)})}return Se},f);return me===f?f:(me.sort(function(ce,ye){return Kt(Q(ce),Q(ye))||Kt(ge(ce),ge(ye))}),m.limit&&m.limit<1/0&&(me.length>m.limit?me.length=m.limit:f.length===m.limit&&me.length<m.limit&&(O.dirty=!0)),M?Object.freeze(me):me)}function Ul(f,m){return Kt(f.lower,m.lower)===0&&Kt(f.upper,m.upper)===0&&!!f.lowerOpen==!!m.lowerOpen&&!!f.upperOpen==!!m.upperOpen}function Lp(f,m){return function(w,x,O,M){if(w===void 0)return x!==void 0?-1:0;if(x===void 0)return 1;if((x=Kt(w,x))===0){if(O&&M)return 0;if(O)return 1;if(M)return-1}return x}(f.lower,m.lower,f.lowerOpen,m.lowerOpen)<=0&&0<=function(w,x,O,M){if(w===void 0)return x!==void 0?1:0;if(x===void 0)return-1;if((x=Kt(w,x))===0){if(O&&M)return 0;if(O)return-1;if(M)return 1}return x}(f.upper,m.upper,f.upperOpen,m.upperOpen)}function Fp(f,m,w,x){f.subscribers.add(w),x.addEventListener("abort",function(){var O,M;f.subscribers.delete(w),f.subscribers.size===0&&(O=f,M=m,setTimeout(function(){O.subscribers.size===0&&J(M,O)},3e3))})}var Bp={stack:"dbcore",level:0,name:"Cache",create:function(f){var m=f.schema.name;return r(r({},f),{transaction:function(w,x,O){var M,K,te=f.transaction(w,x,O);return x==="readwrite"&&(K=(M=new AbortController).signal,O=function(pe){return function(){if(M.abort(),x==="readwrite"){for(var ge=new Set,ue=0,Q=w;ue<Q.length;ue++){var me=Q[ue],ce=Ca["idb://".concat(m,"/").concat(me)];if(ce){var ye=f.table(me),Se=ce.optimisticOps.filter(function(bt){return bt.trans===te});if(te._explicit&&pe&&te.mutatedParts)for(var ve=0,Oe=Object.values(ce.queries.query);ve<Oe.length;ve++)for(var Me=0,Ne=(dt=Oe[ve]).slice();Me<Ne.length;Me++)ns((tt=Ne[Me]).obsSet,te.mutatedParts)&&(J(dt,tt),tt.subscribers.forEach(function(bt){return ge.add(bt)}));else if(0<Se.length){ce.optimisticOps=ce.optimisticOps.filter(function(bt){return bt.trans!==te});for(var Fe=0,nt=Object.values(ce.queries.query);Fe<nt.length;Fe++)for(var dt,tt,ot,pt=0,it=(dt=nt[Fe]).slice();pt<it.length;pt++)(tt=it[pt]).res!=null&&te.mutatedParts&&(pe&&!tt.dirty?(ot=Object.isFrozen(tt.res),ot=rc(tt.res,tt.req,Se,ye,tt,ot),tt.dirty?(J(dt,tt),tt.subscribers.forEach(function(bt){return ge.add(bt)})):ot!==tt.res&&(tt.res=ot,tt.promise=$e.resolve({result:ot}))):(tt.dirty&&J(dt,tt),tt.subscribers.forEach(function(bt){return ge.add(bt)})))}}}ge.forEach(function(bt){return bt()})}}},te.addEventListener("abort",O(!1),{signal:K}),te.addEventListener("error",O(!1),{signal:K}),te.addEventListener("complete",O(!0),{signal:K})),te},table:function(w){var x=f.table(w),O=x.schema.primaryKey;return r(r({},x),{mutate:function(M){var K=we.trans;if(O.outbound||K.db._options.cache==="disabled"||K.explicit||K.idbtrans.mode!=="readwrite")return x.mutate(M);var te=Ca["idb://".concat(m,"/").concat(w)];return te?(K=x.mutate(M),M.type!=="add"&&M.type!=="put"||!(50<=M.values.length||js(O,M).some(function(pe){return pe==null}))?(te.optimisticOps.push(M),M.mutatedParts&&Bo(M.mutatedParts),K.then(function(pe){0<pe.numFailures&&(J(te.optimisticOps,M),(pe=qc(0,M,pe))&&te.optimisticOps.push(pe),M.mutatedParts&&Bo(M.mutatedParts))}),K.catch(function(){J(te.optimisticOps,M),M.mutatedParts&&Bo(M.mutatedParts)})):K.then(function(pe){var ge=qc(0,r(r({},M),{values:M.values.map(function(ue,Q){var me;return pe.failures[Q]?ue:(ue=(me=O.keyPath)!==null&&me!==void 0&&me.includes(".")?P(ue):r({},ue),E(ue,O.keyPath,pe.results[Q]),ue)})}),pe);te.optimisticOps.push(ge),queueMicrotask(function(){return M.mutatedParts&&Bo(M.mutatedParts)})}),K):x.mutate(M)},query:function(M){if(!du(we,x)||!nc("query",M))return x.query(M);var K=((ge=we.trans)===null||ge===void 0?void 0:ge.db._options.cache)==="immutable",Q=we,te=Q.requery,pe=Q.signal,ge=function(ye,Se,ve,Oe){var Me=Ca["idb://".concat(ye,"/").concat(Se)];if(!Me)return[];if(!(Se=Me.queries[ve]))return[null,!1,Me,null];var Ne=Se[(Oe.query?Oe.query.index.name:null)||""];if(!Ne)return[null,!1,Me,null];switch(ve){case"query":var Fe=Ne.find(function(nt){return nt.req.limit===Oe.limit&&nt.req.values===Oe.values&&Ul(nt.req.query.range,Oe.query.range)});return Fe?[Fe,!0,Me,Ne]:[Ne.find(function(nt){return("limit"in nt.req?nt.req.limit:1/0)>=Oe.limit&&(!Oe.values||nt.req.values)&&Lp(nt.req.query.range,Oe.query.range)}),!1,Me,Ne];case"count":return Fe=Ne.find(function(nt){return Ul(nt.req.query.range,Oe.query.range)}),[Fe,!!Fe,Me,Ne]}}(m,w,"query",M),ue=ge[0],Q=ge[1],me=ge[2],ce=ge[3];return ue&&Q?ue.obsSet=M.obsSet:(Q=x.query(M).then(function(ye){var Se=ye.result;if(ue&&(ue.res=Se),K){for(var ve=0,Oe=Se.length;ve<Oe;++ve)Object.freeze(Se[ve]);Object.freeze(Se)}else ye.result=P(Se);return ye}).catch(function(ye){return ce&&ue&&J(ce,ue),Promise.reject(ye)}),ue={obsSet:M.obsSet,promise:Q,subscribers:new Set,type:"query",req:M,dirty:!1},ce?ce.push(ue):(ce=[ue],(me=me||(Ca["idb://".concat(m,"/").concat(w)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[M.query.index.name||""]=ce)),Fp(ue,ce,te,pe),ue.promise.then(function(ye){return{result:rc(ye.result,M,me==null?void 0:me.optimisticOps,x,ue,K)}})}})}})}};function as(f,m){return new Proxy(f,{get:function(w,x,O){return x==="db"?m:Reflect.get(w,x,O)}})}var ea=(bn.prototype.version=function(f){if(isNaN(f)||f<.1)throw new Y.Type("Given version is not a positive number");if(f=Math.round(10*f)/10,this.idbdb||this._state.isBeingOpened)throw new Y.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,f);var m=this._versions,w=m.filter(function(x){return x._cfg.version===f})[0];return w||(w=new this.Version(f),m.push(w),m.sort(Kf),w.stores({}),this._state.autoSchema=!1,w)},bn.prototype._whenReady=function(f){var m=this;return this.idbdb&&(this._state.openComplete||we.letThrough||this._vip)?f():new $e(function(w,x){if(m._state.openComplete)return x(new Y.DatabaseClosed(m._state.dbOpenError));if(!m._state.isBeingOpened){if(!m._state.autoOpen)return void x(new Y.DatabaseClosed);m.open().catch(Pe)}m._state.dbReadyPromise.then(w,x)}).then(f)},bn.prototype.use=function(f){var m=f.stack,w=f.create,x=f.level,O=f.name;return O&&this.unuse({stack:m,name:O}),f=this._middlewares[m]||(this._middlewares[m]=[]),f.push({stack:m,create:w,level:x??10,name:O}),f.sort(function(M,K){return M.level-K.level}),this},bn.prototype.unuse=function(f){var m=f.stack,w=f.name,x=f.create;return m&&this._middlewares[m]&&(this._middlewares[m]=this._middlewares[m].filter(function(O){return x?O.create!==x:!!w&&O.name!==w})),this},bn.prototype.open=function(){var f=this;return or(le,function(){return Yf(f)})},bn.prototype._close=function(){var f=this._state,m=wa.indexOf(this);if(0<=m&&wa.splice(m,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}f.isBeingOpened||(f.dbReadyPromise=new $e(function(w){f.dbReadyResolve=w}),f.openCanceller=new $e(function(w,x){f.cancelOpen=x}))},bn.prototype.close=function(w){var m=(w===void 0?{disableAutoOpen:!0}:w).disableAutoOpen,w=this._state;m?(w.isBeingOpened&&w.cancelOpen(new Y.DatabaseClosed),this._close(),w.autoOpen=!1,w.dbOpenError=new Y.DatabaseClosed):(this._close(),w.autoOpen=this._options.autoOpen||w.isBeingOpened,w.openComplete=!1,w.dbOpenError=null)},bn.prototype.delete=function(f){var m=this;f===void 0&&(f={disableAutoOpen:!0});var w=0<arguments.length&&typeof arguments[0]!="object",x=this._state;return new $e(function(O,M){function K(){m.close(f);var te=m._deps.indexedDB.deleteDatabase(m.name);te.onsuccess=Vt(function(){var pe,ge,ue;pe=m._deps,ge=m.name,ue=pe.indexedDB,pe=pe.IDBKeyRange,uo(ue)||ge===ho||$s(ue,pe).delete(ge).catch(Pe),O()}),te.onerror=Vr(M),te.onblocked=m._fireOnBlocked}if(w)throw new Y.InvalidArgument("Invalid closeOptions argument to db.delete()");x.isBeingOpened?x.dbReadyPromise.then(K):K()})},bn.prototype.backendDB=function(){return this.idbdb},bn.prototype.isOpen=function(){return this.idbdb!==null},bn.prototype.hasBeenClosed=function(){var f=this._state.dbOpenError;return f&&f.name==="DatabaseClosed"},bn.prototype.hasFailed=function(){return this._state.dbOpenError!==null},bn.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(bn.prototype,"tables",{get:function(){var f=this;return o(this._allTables).map(function(m){return f._allTables[m]})},enumerable:!1,configurable:!0}),bn.prototype.transaction=function(){var f=(function(m,w,x){var O=arguments.length;if(O<2)throw new Y.InvalidArgument("Too few arguments");for(var M=new Array(O-1);--O;)M[O-1]=arguments[O];return x=M.pop(),[m,A(M),x]}).apply(this,arguments);return this._transaction.apply(this,f)},bn.prototype._transaction=function(f,m,w){var x=this,O=we.trans;O&&O.db===this&&f.indexOf("!")===-1||(O=null);var M,K,te=f.indexOf("?")!==-1;f=f.replace("!","").replace("?","");try{if(K=m.map(function(ge){if(ge=ge instanceof x.Table?ge.name:ge,typeof ge!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return ge}),f=="r"||f===Xs)M=Xs;else{if(f!="rw"&&f!=Qs)throw new Y.InvalidArgument("Invalid transaction mode: "+f);M=Qs}if(O){if(O.mode===Xs&&M===Qs){if(!te)throw new Y.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");O=null}O&&K.forEach(function(ge){if(O&&O.storeNames.indexOf(ge)===-1){if(!te)throw new Y.SubTransaction("Table "+ge+" not included in parent transaction.");O=null}}),te&&O&&!O.active&&(O=null)}}catch(ge){return O?O._promise(null,function(ue,Q){Q(ge)}):un(ge)}var pe=(function ge(ue,Q,me,ce,ye){return $e.resolve().then(function(){var Se=we.transless||we,ve=ue._createTransaction(Q,me,ue._dbSchema,ce);if(ve.explicit=!0,Se={trans:ve,transless:Se},ce)ve.idbtrans=ce.idbtrans;else try{ve.create(),ve.idbtrans._explicit=!0,ue._state.PR1398_maxLoop=3}catch(Ne){return Ne.name===ae.InvalidState&&ue.isOpen()&&0<--ue._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ue.close({disableAutoOpen:!1}),ue.open().then(function(){return ge(ue,Q,me,null,ye)})):un(Ne)}var Oe,Me=ee(ye);return Me&&Yn(),Se=$e.follow(function(){var Ne;(Oe=ye.call(ve,ve))&&(Me?(Ne=ar.bind(null,null),Oe.then(Ne,Ne)):typeof Oe.next=="function"&&typeof Oe.throw=="function"&&(Oe=hs(Oe)))},Se),(Oe&&typeof Oe.then=="function"?$e.resolve(Oe).then(function(Ne){return ve.active?Ne:un(new Y.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):Se.then(function(){return Oe})).then(function(Ne){return ce&&ve._resolve(),ve._completion.then(function(){return Ne})}).catch(function(Ne){return ve._reject(Ne),un(Ne)})})}).bind(null,this,M,K,O,w);return O?O._promise(M,pe,"lock"):we.trans?or(we.transless,function(){return x._whenReady(pe)}):this._whenReady(pe)},bn.prototype.table=function(f){if(!d(this._allTables,f))throw new Y.InvalidTable("Table ".concat(f," does not exist"));return this._allTables[f]},bn);function bn(f,m){var w=this;this._middlewares={},this.verno=0;var x=bn.dependencies;this._options=m=r({addons:bn.addons,autoOpen:!0,indexedDB:x.indexedDB,IDBKeyRange:x.IDBKeyRange,cache:"cloned"},m),this._deps={indexedDB:m.indexedDB,IDBKeyRange:m.IDBKeyRange},x=m.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var O,M,K,te,pe,ge={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Pe,dbReadyPromise:null,cancelOpen:Pe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:m.autoOpen};ge.dbReadyPromise=new $e(function(Q){ge.dbReadyResolve=Q}),ge.openCanceller=new $e(function(Q,me){ge.cancelOpen=me}),this._state=ge,this.name=f,this.on=wi(this,"populate","blocked","versionchange","close",{ready:[ne,Pe]}),this.on.ready.subscribe=S(this.on.ready.subscribe,function(Q){return function(me,ce){bn.vip(function(){var ye,Se=w._state;Se.openComplete?(Se.dbOpenError||$e.resolve().then(me),ce&&Q(me)):Se.onReadyBeingFired?(Se.onReadyBeingFired.push(me),ce&&Q(me)):(Q(me),ye=w,ce||Q(function ve(){ye.on.ready.unsubscribe(me),ye.on.ready.unsubscribe(ve)}))})}}),this.Collection=(O=this,ji(Wd.prototype,function(Oe,ve){this.db=O;var ce=Uc,ye=null;if(ve)try{ce=ve()}catch(Me){ye=Me}var Se=Oe._ctx,ve=Se.table,Oe=ve.hook.reading.fire;this._ctx={table:ve,index:Se.index,isPrimKey:!Se.index||ve.schema.primKey.keyPath&&Se.index===ve.schema.primKey.name,range:ce,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:ye,or:Se.or,valueMapper:Oe!==Te?Oe:null}})),this.Table=(M=this,ji(Vl.prototype,function(Q,me,ce){this.db=M,this._tx=ce,this.name=Q,this.schema=me,this.hook=M._allTables[Q]?M._allTables[Q].hook:wi(null,{creating:[Je,Pe],reading:[Ae,Te],updating:[Ye,Pe],deleting:[We,Pe]})})),this.Transaction=(K=this,ji(qf.prototype,function(Q,me,ce,ye,Se){var ve=this;this.db=K,this.mode=Q,this.storeNames=me,this.schema=ce,this.chromeTransactionDurability=ye,this.idbtrans=null,this.on=wi(this,"complete","error","abort"),this.parent=Se||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 $e(function(Oe,Me){ve._resolve=Oe,ve._reject=Me}),this._completion.then(function(){ve.active=!1,ve.on.complete.fire()},function(Oe){var Me=ve.active;return ve.active=!1,ve.on.error.fire(Oe),ve.parent?ve.parent._reject(Oe):Me&&ve.idbtrans&&ve.idbtrans.abort(),un(Oe)})})),this.Version=(te=this,ji(Gd.prototype,function(Q){this.db=te,this._cfg={version:Q,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(pe=this,ji(Iu.prototype,function(Q,me,ce){if(this.db=pe,this._ctx={table:Q,index:me===":id"?null:me,or:ce},this._cmp=this._ascending=Kt,this._descending=function(ye,Se){return Kt(Se,ye)},this._max=function(ye,Se){return 0<Kt(ye,Se)?ye:Se},this._min=function(ye,Se){return Kt(ye,Se)<0?ye:Se},this._IDBKeyRange=pe._deps.IDBKeyRange,!this._IDBKeyRange)throw new Y.MissingAPI})),this.on("versionchange",function(Q){0<Q.newVersion?console.warn("Another connection wants to upgrade database '".concat(w.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(w.name,"'. Closing db now to resume the delete request.")),w.close({disableAutoOpen:!1})}),this.on("blocked",function(Q){!Q.newVersion||Q.newVersion<Q.oldVersion?console.warn("Dexie.delete('".concat(w.name,"') was blocked")):console.warn("Upgrade '".concat(w.name,"' blocked by other connection holding version ").concat(Q.oldVersion/10))}),this._maxKey=Ji(m.IDBKeyRange),this._createTransaction=function(Q,me,ce,ye){return new w.Transaction(Q,me,ce,w._options.chromeTransactionDurability,ye)},this._fireOnBlocked=function(Q){w.on("blocked").fire(Q),wa.filter(function(me){return me.name===w.name&&me!==w&&!me._state.vcFired}).map(function(me){return me.on("versionchange").fire(Q)})},this.use(Np),this.use(Bp),this.use(Tm),this.use(bf),this.use(xh);var ue=new Proxy(this,{get:function(Q,me,ce){if(me==="_vip")return!0;if(me==="table")return function(Se){return as(w.table(Se),ue)};var ye=Reflect.get(Q,me,ce);return ye instanceof Vl?as(ye,ue):me==="tables"?ye.map(function(Se){return as(Se,ue)}):me==="_createTransaction"?function(){return as(ye.apply(this,arguments),ue)}:ye}});this.vip=ue,x.forEach(function(Q){return Q(w)})}var Vo,er=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Dm=(zs.prototype.subscribe=function(f,m,w){return this._subscribe(f&&typeof f!="function"?f:{next:f,error:m,complete:w})},zs.prototype[er]=function(){return this},zs);function zs(f){this._subscribe=f}try{Vo={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch{Vo={indexedDB:null,IDBKeyRange:null}}function ac(f){var m,w=!1,x=new Dm(function(O){var M=ee(f),K,te=!1,pe={},ge={},ue={get closed(){return te},unsubscribe:function(){te||(te=!0,K&&K.abort(),Q&&pa.storagemutated.unsubscribe(ce))}};O.start&&O.start(ue);var Q=!1,me=function(){return ia(ye)},ce=function(Se){ki(pe,Se),ns(ge,pe)&&me()},ye=function(){var Se,ve,Oe;!te&&Vo.indexedDB&&(pe={},Se={},K&&K.abort(),K=new AbortController,Oe=function(Me){var Ne=xt();try{M&&Yn();var Fe=Lr(f,Me);return Fe=M?Fe.finally(ar):Fe}finally{Ne&&Ht()}}(ve={subscr:Se,signal:K.signal,requery:me,querier:f,trans:null}),Promise.resolve(Oe).then(function(Me){w=!0,m=Me,te||ve.signal.aborted||(pe={},function(Ne){for(var Fe in Ne)if(d(Ne,Fe))return;return 1}(ge=Se)||Q||(pa(ro,ce),Q=!0),ia(function(){return!te&&O.next&&O.next(Me)}))},function(Me){w=!1,["DatabaseClosedError","AbortError"].includes(Me==null?void 0:Me.name)||te||ia(function(){te||O.error&&O.error(Me)})}))};return setTimeout(me,0),ue});return x.hasValue=function(){return w},x.getValue=function(){return m},x}var Ta=ea;function Uo(f){var m=ha;try{ha=!0,pa.storagemutated.fire(f),ml(f,!0)}finally{ha=m}}p(Ta,r(r({},he),{delete:function(f){return new Ta(f,{addons:[]}).delete()},exists:function(f){return new Ta(f,{addons:[]}).open().then(function(m){return m.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(f){try{return m=Ta.dependencies,w=m.indexedDB,m=m.IDBKeyRange,(uo(w)?Promise.resolve(w.databases()).then(function(x){return x.map(function(O){return O.name}).filter(function(O){return O!==ho})}):$s(w,m).toCollection().primaryKeys()).then(f)}catch{return un(new Y.MissingAPI)}var m,w},defineClass:function(){return function(f){l(this,f)}},ignoreTransaction:function(f){return we.trans?or(we.transless,f):f()},vip:fi,async:function(f){return function(){try{var m=hs(f.apply(this,arguments));return m&&typeof m.then=="function"?m:$e.resolve(m)}catch(w){return un(w)}}},spawn:function(f,m,w){try{var x=hs(f.apply(w,m||[]));return x&&typeof x.then=="function"?x:$e.resolve(x)}catch(O){return un(O)}},currentTransaction:{get:function(){return we.trans||null}},waitFor:function(f,m){return m=$e.resolve(typeof f=="function"?Ta.ignoreTransaction(f):f).timeout(m||6e4),we.trans?we.trans.waitFor(m):m},Promise:$e,debug:{get:function(){return se},set:function(f){Ue(f)}},derive:v,extend:l,props:p,override:S,Events:wi,on:pa,liveQuery:ac,extendObservabilitySet:ki,getByKeyPath:k,setByKeyPath:E,delByKeyPath:function(f,m){typeof m=="string"?E(f,m,void 0):"length"in m&&[].map.call(m,function(w){E(f,w,void 0)})},shallowClone:I,deepClone:P,getObjectDiff:gl,cmp:Kt,asap:T,minKey:-1/0,addons:[],connections:wa,errnames:ae,dependencies:Vo,cache:Ca,semVer:"4.0.10",version:"4.0.10".split(".").map(function(f){return parseInt(f)}).reduce(function(f,m,w){return f+m/Math.pow(10,2*w)})})),Ta.maxKey=Ji(Ta.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(pa(ro,function(f){ha||(f=new CustomEvent(dl,{detail:f}),ha=!0,dispatchEvent(f),ha=!1)}),addEventListener(dl,function(f){f=f.detail,ha||Uo(f)}));var Ba,ha=!1,yd=function(){};return typeof BroadcastChannel<"u"&&((yd=function(){(Ba=new BroadcastChannel(dl)).onmessage=function(f){return f.data&&Uo(f.data)}})(),typeof Ba.unref=="function"&&Ba.unref(),pa(ro,function(f){ha||Ba.postMessage(f)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(f){if(!ea.disableBfCache&&f.persisted){se&&console.debug("Dexie: handling persisted pagehide"),Ba!=null&&Ba.close();for(var m=0,w=wa;m<w.length;m++)w[m].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(f){!ea.disableBfCache&&f.persisted&&(se&&console.debug("Dexie: handling persisted pageshow"),yd(),Uo({all:new Dn(-1/0,[[]])}))})),$e.rejectionMapper=function(f,m){return!f||f instanceof U||f instanceof TypeError||f instanceof SyntaxError||!f.name||!Ee[f.name]?f:(m=new Ee[f.name](m||f.message,f),"stack"in f&&g(m,"stack",{get:function(){return this.inner.stack}}),m)},Ue(se),r(ea,Object.freeze({__proto__:null,Dexie:ea,liveQuery:ac,Entity:Du,cmp:Kt,PropModSymbol:Wr,PropModification:za,replacePrefix:function(f,m){return new za({replacePrefix:[f,m]})},add:function(f){return new za({add:f})},remove:function(f){return new za({remove:f})},default:ea,RangeSet:Dn,mergeRanges:Zi,rangesOverlap:pl}),{default:ea}),ea})})(YVe);var Y7t=YVe.exports;const Fde=tU(Y7t),JVe=Symbol.for("Dexie"),mx=globalThis[JVe]||(globalThis[JVe]=Fde);if(Fde.semVer!==mx.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Fde.semVer} and ${mx.semVer}`);const{liveQuery:SWa,mergeRanges:kWa,rangesOverlap:EWa,RangeSet:xWa,cmp:TWa,Entity:DWa,PropModSymbol:AWa,PropModification:OWa,replacePrefix:IWa,add:RWa,remove:$Wa}=mx,J_=new mx("CommentDatabase");J_.version(1).stores({comments:"++renditionId, comment "});const aP=new mx("CommentFile");aP.version(1).stores({files:"++id, files "});const G0="MMM DD, YYYY",Bde="MMM DD, YYYY · HH:mm:ss",Zq="MMM DD, YYYY · HH:mm:ss",J7t="MMM dd, yyyy · HH:mm",ZVe="MMM DD",Z7t=[{label:"User",key:"user",sortAble:!1},{label:"Field",key:"field",sortAble:!1},{label:"Before",key:"before",sortAble:!1,type:"number"},{label:"After",key:"after",sortAble:!1},{label:"Timestamp",key:"timestamp",sortAble:!1}],Vde={dropdown:"dropdown",number:"number",rating:"icon"};function X7t(e){return e==="archived_status"?"Archive status":e}const Xq={text:"text",description:"description",name:"name",start_date:"start_date",due_date:"due_date",avatar:"avatar",image:"image",color:"color",Status:"template_flow_status_id",archived_status:"archived_status"},Qq={image:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml","image/webp","image/tiff","image"],video:["video/mp4","video/quicktime","video/x-m4v","video/mpeg","video/webm","video"],audio:["audio/mp3","audio/webm","audio/mpeg","audio/wav","audio/ogg","audio"],document:["application/pdf","application/msword","application/vnd.ms-powerpoint","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/csv","text/plain","document"],zip:["application/x-zip-compressed","application/zip","application/x-rar-compressed","application/x-7z-compressed","zip","other"]},Ude=Object.entries(Qq).reduce((e,[,t])=>(e.push(...t),e),[]).flat(),XVe={renditionName:"renditionName",description:"description"},Q7t=["jpeg","png","mov","mp4","quicktime"],tO=5242880,nO=52428800,eqt="scene_comment";/*! js-cookie v3.0.8 | MIT */function eK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)r!=="__proto__"&&(e[r]=n[r])}return e}var tqt={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Hde(e,t){function n(a,i,o){if(!(typeof document>"u")){o=eK({},t,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var l in o)o[l]&&(s+="; "+l,o[l]!==!0&&(s+="="+o[l].split(";")[0]));return document.cookie=a+"="+e.write(i,a)+s}}function r(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var i=document.cookie?document.cookie.split("; "):[],o={},s=0;s<i.length;s++){var l=i[s].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(c in o||(o[c]=e.read(u,c)),a===c)break}catch{}}return a?o[a]:o}}return Object.create({set:n,get:r,remove:function(a,i){n(a,"",eK({},i,{expires:-1}))},withAttributes:function(a){return Hde(this.converter,eK({},this.attributes,a))},withConverter:function(a){return Hde(eK({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var iP=Hde(tqt,{path:"/"});const nqt={Accept:"application/json","Content-Type":"application/json"},nU="parent,attachments,markers,ws_creator,ws_editor,fulfiller,parent.ws_creator,parent.attachments,parent.assigned_user,parent.resolved_user,assigned_user,emoji_users,resolved_user",rU="created_at-desc",rqt="ws.code",oP="account.last_prefered_timezone",q0=10,gx=1,jo={success:!1,data:void 0},lc=()=>sessionStorage.getItem(rqt)||"",Gp=()=>{const e=sessionStorage.getItem("scene_id")||"";return e||(console.error("Scene ID not found in sessionStorage"),"")};var Vi=(e=>(e.Scene="scene",e.Rendition="rendition",e))(Vi||{});const aqt=30*24*60*60*1e3,jde=()=>{Gp();const e=10,t=async()=>{try{const p=(await J_.table("comments").toArray()).filter(h=>h.updatedAt&&new Date(h.updatedAt).getTime()>=new Date().getTime()-aqt).sort((h,g)=>{const v=new Date(h.updatedAt).getTime();return new Date(g.updatedAt).getTime()-v}).slice(0,e).map(h=>h.renditionId);n(p)}catch(d){console.error("Error optimizing database",d)}},n=async d=>{if(!Array.isArray(d)){console.error("Invalid ids array provided to clearNonMatchingRecords");return}try{const g=(await J_.table("comments").toArray()).filter(v=>!d.includes(v.renditionId)).map(async v=>{try{return await J_.table("comments").delete(v.renditionId)}catch(b){return console.warn(`Failed to delete comment ${v.renditionId}:`,b),null}});await Promise.all(g)}catch(p){console.error("Error clearing non-matching records",p)}},r=async(d,p)=>{try{return await J_.table(d).where("renditionId").equals(p).first()}catch(h){console.error("Error fetching data",h);return}};return{addDraftCommentData:async(d,p)=>{if(!d||typeof d!="string")return console.warn("Invalid id provided to addDraftCommentData"),!1;if(!p||typeof p!="string")return console.warn("Invalid data provided to addDraftCommentData"),await J_.comments.where("renditionId").equals(d).delete(),!1;try{return await J_.comments.where("renditionId").equals(d).first()?await J_.comments.update(d,{comment:p,renditionId:d,updatedAt:new Date().toISOString()}):await J_.comments.add({renditionId:d,comment:p,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),!0}catch(h){return console.error("Error adding comment",h),!1}},getCommentFile:async d=>{try{return await aP.files.where("id").equals(d).first()}catch(p){console.error("Error removing comment file",p)}},removeDraft:async d=>{try{await J_.comments.where("renditionId").equals(d).delete()}catch(p){console.error("Error removing draft",p)}},handleLoadDraftComment:async(d,p)=>{if(d==Vi.Scene)return await r("comments",p)},setCommentFile:async d=>{try{await aP.files.put(d)}catch(p){console.error("Error setting comment file",p)}},updateCommentFile:async(d,p)=>{try{await aP.files.update(d,p)}catch(h){console.error("Error updating comment file",h)}},removeCommentFile:async d=>{try{await aP.files.where("id").equals(d).delete()}catch(p){console.error("Error removing comment file",p)}},optimizeDatabase:t}};/*!
43
43
  * shared v9.14.5
@@ -1028,13 +1028,13 @@ If you are trying to annotate ${r} with application data, use the '${r}.context'
1028
1028
  * Date: 2023-02-28T14:09:41.732Z
1029
1029
  */function oLt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function vse(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oLt(Object(n),!0).forEach(function(r){rTa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oLt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tTa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sLt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,lLt(r.key),r)}}function nTa(e,t,n){return t&&sLt(e.prototype,t),n&&sLt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function rTa(e,t,n){return t=lLt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yse(){return yse=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yse.apply(this,arguments)}function aTa(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function lLt(e){var t=aTa(e,"string");return typeof t=="symbol"?t:String(t)}var uLt={exports:{}};(function(e){typeof window>"u"||function(t){var n=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,r=t.Blob&&function(){try{return!!new Blob}catch{return!1}}(),a=r&&t.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),i=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,o=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,s=(r||i)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(l){var u,c,d,p,h,g,v,b,_;if(u=l.match(o),!u)throw new Error("invalid data URI");for(c=u[2]?u[1]:"text/plain"+(u[3]||";charset=US-ASCII"),d=!!u[4],p=l.slice(u[0].length),d?h=atob(p):h=decodeURIComponent(p),g=new ArrayBuffer(h.length),v=new Uint8Array(g),b=0;b<h.length;b+=1)v[b]=h.charCodeAt(b);return r?new Blob([a?v:g],{type:c}):(_=new i,_.append(g),_.getBlob(c))};t.HTMLCanvasElement&&!n.toBlob&&(n.mozGetAsFile?n.toBlob=function(l,u,c){var d=this;setTimeout(function(){c&&n.toDataURL&&s?l(s(d.toDataURL(u,c))):l(d.mozGetAsFile("blob",u))})}:n.toDataURL&&s&&(n.msToBlob?n.toBlob=function(l,u,c){var d=this;setTimeout(function(){(u&&u!=="image/png"||c)&&n.toDataURL&&s?l(s(d.toDataURL(u,c))):l(d.msToBlob(u))})}:n.toBlob=function(l,u,c){var d=this;setTimeout(function(){l(s(d.toDataURL(u,c)))})})),e.exports?e.exports=s:t.dataURLtoBlob=s}(window)})(uLt);var cLt=uLt.exports,iTa=function(e){return typeof Blob>"u"?!1:e instanceof Blob||Object.prototype.toString.call(e)==="[object Blob]"},dLt={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},oTa=typeof window<"u"&&typeof window.document<"u",lA=oTa?window:{},bse=function(e){return e>0&&e<1/0},sTa=Array.prototype.slice;function XIe(e){return Array.from?Array.from(e):sTa.call(e)}var lTa=/^image\/.+$/;function QIe(e){return lTa.test(e)}function uTa(e){var t=QIe(e)?e.substr(6):"";return t==="jpeg"&&(t="jpg"),".".concat(t)}var fLt=String.fromCharCode;function cTa(e,t,n){var r="",a;for(n+=t,a=t;a<n;a+=1)r+=fLt(e.getUint8(a));return r}var dTa=lA.btoa;function hLt(e,t){for(var n=[],r=8192,a=new Uint8Array(e);a.length>0;)n.push(fLt.apply(null,XIe(a.subarray(0,r)))),a=a.subarray(r);return"data:".concat(t,";base64,").concat(dTa(n.join("")))}function fTa(e){var t=new DataView(e),n;try{var r,a,i;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var o=t.byteLength,s=2;s+1<o;){if(t.getUint8(s)===255&&t.getUint8(s+1)===225){a=s;break}s+=1}if(a){var l=a+4,u=a+10;if(cTa(t,l,4)==="Exif"){var c=t.getUint16(u);if(r=c===18761,(r||c===19789)&&t.getUint16(u+2,r)===42){var d=t.getUint32(u+4,r);d>=8&&(i=u+d)}}}if(i){var p=t.getUint16(i,r),h,g;for(g=0;g<p;g+=1)if(h=i+g*12+2,t.getUint16(h,r)===274){h+=8,n=t.getUint16(h,r),t.setUint16(h,1,r);break}}}catch{n=1}return n}function hTa(e){var t=0,n=1,r=1;switch(e){case 2:n=-1;break;case 3:t=-180;break;case 4:r=-1;break;case 5:t=90,r=-1;break;case 6:t=90;break;case 7:t=90,n=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:n,scaleY:r}}var pTa=/\.\d*(?:0|9){12}\d*$/;function pLt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return pTa.test(e)?Math.round(e*t)/t:e}function W9(e){var t=e.aspectRatio,n=e.height,r=e.width,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",i=bse(r),o=bse(n);if(i&&o){var s=n*t;(a==="contain"||a==="none")&&s>r||a==="cover"&&s<r?n=r/t:r=n*t}else i?n=r/t:o&&(r=n*t);return{width:r,height:n}}function mTa(e){for(var t=XIe(new Uint8Array(e)),n=t.length,r=[],a=0;a+3<n;){var i=t[a],o=t[a+1];if(i===255&&o===218)break;if(i===255&&o===216)a+=2;else{var s=t[a+2]*256+t[a+3],l=a+s+2,u=t.slice(a,l);r.push(u),a=l}}return r.reduce(function(c,d){return d[0]===255&&d[1]===225?c.concat(d):c},[])}function gTa(e,t){var n=XIe(new Uint8Array(e));if(n[2]!==255||n[3]!==224)return e;var r=n[4]*256+n[5],a=[255,216].concat(t,n.slice(4+r));return new Uint8Array(a)}var vTa=lA.ArrayBuffer,eRe=lA.FileReader,GR=lA.URL||lA.webkitURL,yTa=/\.\w+$/,bTa=lA.Compressor,wTa=function(){function e(t,n){tTa(this,e),this.file=t,this.exif=[],this.image=new Image,this.options=vse(vse({},dLt),n),this.aborted=!1,this.result=null,this.init()}return nTa(e,[{key:"init",value:function(){var t=this,n=this.file,r=this.options;if(!iTa(n)){this.fail(new Error("The first argument must be a File or Blob object."));return}var a=n.type;if(!QIe(a)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!GR||!eRe){this.fail(new Error("The current browser does not support image compression."));return}vTa||(r.checkOrientation=!1,r.retainExif=!1);var i=a==="image/jpeg",o=i&&r.checkOrientation,s=i&&r.retainExif;if(GR&&!o&&!s)this.load({url:GR.createObjectURL(n)});else{var l=new eRe;this.reader=l,l.onload=function(u){var c=u.target,d=c.result,p={},h=1;o&&(h=fTa(d),h>1&&yse(p,hTa(h))),s&&(t.exif=mTa(d)),o||s?!GR||h>1?p.url=hLt(d,a):p.url=GR.createObjectURL(n):p.url=d,t.load(p)},l.onabort=function(){t.fail(new Error("Aborted to read the image with FileReader."))},l.onerror=function(){t.fail(new Error("Failed to read the image with FileReader."))},l.onloadend=function(){t.reader=null},o||s?l.readAsArrayBuffer(n):l.readAsDataURL(n)}}},{key:"load",value:function(t){var n=this,r=this.file,a=this.image;a.onload=function(){n.draw(vse(vse({},t),{},{naturalWidth:a.naturalWidth,naturalHeight:a.naturalHeight}))},a.onabort=function(){n.fail(new Error("Aborted to load the image."))},a.onerror=function(){n.fail(new Error("Failed to load the image."))},lA.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(lA.navigator.userAgent)&&(a.crossOrigin="anonymous"),a.alt=r.name,a.src=t.url}},{key:"draw",value:function(t){var n=this,r=t.naturalWidth,a=t.naturalHeight,i=t.rotate,o=i===void 0?0:i,s=t.scaleX,l=s===void 0?1:s,u=t.scaleY,c=u===void 0?1:u,d=this.file,p=this.image,h=this.options,g=document.createElement("canvas"),v=g.getContext("2d"),b=Math.abs(o)%180===90,_=(h.resize==="contain"||h.resize==="cover")&&bse(h.width)&&bse(h.height),C=Math.max(h.maxWidth,0)||1/0,S=Math.max(h.maxHeight,0)||1/0,y=Math.max(h.minWidth,0)||0,T=Math.max(h.minHeight,0)||0,k=r/a,E=h.width,I=h.height;if(b){var D=[S,C];C=D[0],S=D[1];var A=[T,y];y=A[0],T=A[1];var R=[I,E];E=R[0],I=R[1]}_&&(k=E/I);var B=W9({aspectRatio:k,width:C,height:S},"contain");C=B.width,S=B.height;var P=W9({aspectRatio:k,width:y,height:T},"cover");if(y=P.width,T=P.height,_){var $=W9({aspectRatio:k,width:E,height:I},h.resize);E=$.width,I=$.height}else{var V=W9({aspectRatio:k,width:E,height:I}),N=V.width;E=N===void 0?r:N;var q=V.height;I=q===void 0?a:q}E=Math.floor(pLt(Math.min(Math.max(E,y),C))),I=Math.floor(pLt(Math.min(Math.max(I,T),S)));var J=-E/2,ie=-I/2,de=E,ee=I,j=[];if(_){var U=0,Z=0,oe=r,fe=a,ae=W9({aspectRatio:k,width:r,height:a},{contain:"cover",cover:"contain"}[h.resize]);oe=ae.width,fe=ae.height,U=(r-oe)/2,Z=(a-fe)/2,j.push(U,Z,oe,fe)}if(j.push(J,ie,de,ee),b){var G=[I,E];E=G[0],I=G[1]}g.width=E,g.height=I,QIe(h.mimeType)||(h.mimeType=d.type);var Y="transparent";d.size>h.convertSize&&h.convertTypes.indexOf(h.mimeType)>=0&&(h.mimeType="image/jpeg");var Ee=h.mimeType==="image/jpeg";if(Ee&&(Y="#fff"),v.fillStyle=Y,v.fillRect(0,0,E,I),h.beforeDraw&&h.beforeDraw.call(this,v,g),!this.aborted&&(v.save(),v.translate(E/2,I/2),v.rotate(o*Math.PI/180),v.scale(l,c),v.drawImage.apply(v,[p].concat(j)),v.restore(),h.drew&&h.drew.call(this,v,g),!this.aborted)){var he=function(Pe){if(!n.aborted){var Te=function(Je){return n.done({naturalWidth:r,naturalHeight:a,result:Je})};if(Pe&&Ee&&h.retainExif&&n.exif&&n.exif.length>0){var Ae=function(Je){return Te(cLt(hLt(gTa(Je,n.exif),h.mimeType)))};if(Pe.arrayBuffer)Pe.arrayBuffer().then(Ae).catch(function(){n.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var xe=new eRe;n.reader=xe,xe.onload=function(Je){var We=Je.target;Ae(We.result)},xe.onabort=function(){n.fail(new Error("Aborted to read the compressed image with FileReader."))},xe.onerror=function(){n.fail(new Error("Failed to read the compressed image with FileReader."))},xe.onloadend=function(){n.reader=null},xe.readAsArrayBuffer(Pe)}}else Te(Pe)}};g.toBlob?g.toBlob(he,h.mimeType,h.quality):he(cLt(g.toDataURL(h.mimeType,h.quality)))}}},{key:"done",value:function(t){var n=t.naturalWidth,r=t.naturalHeight,a=t.result,i=this.file,o=this.image,s=this.options;if(GR&&o.src.indexOf("blob:")===0&&GR.revokeObjectURL(o.src),a)if(s.strict&&!s.retainExif&&a.size>i.size&&s.mimeType===i.type&&!(s.width>n||s.height>r||s.minWidth>n||s.minHeight>r||s.maxWidth<n||s.maxHeight<r))a=i;else{var l=new Date;a.lastModified=l.getTime(),a.lastModifiedDate=l,a.name=i.name,a.name&&a.type!==i.type&&(a.name=a.name.replace(yTa,uTa(a.type)))}else a=i;this.result=a,s.success&&s.success.call(this,a)}},{key:"fail",value:function(t){var n=this.options;if(n.error)n.error.call(this,t);else throw t}},{key:"abort",value:function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))}}],[{key:"noConflict",value:function(){return window.Compressor=bTa,e}},{key:"setDefaults",value:function(t){yse(dLt,t)}}]),e}(),mLt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _Ta(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gLt={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(mLt,function(){var n=function(f,m){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,x){w.__proto__=x}||function(w,x){for(var O in x)Object.prototype.hasOwnProperty.call(x,O)&&(w[O]=x[O])})(f,m)},r=function(){return(r=Object.assign||function(f){for(var m,w=1,x=arguments.length;w<x;w++)for(var O in m=arguments[w])Object.prototype.hasOwnProperty.call(m,O)&&(f[O]=m[O]);return f}).apply(this,arguments)};function a(f,m,w){for(var x,O=0,M=m.length;O<M;O++)!x&&O in m||((x=x||Array.prototype.slice.call(m,0,O))[O]=m[O]);return f.concat(x||Array.prototype.slice.call(m))}var i=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:mLt,o=Object.keys,s=Array.isArray;function l(f,m){return typeof m!="object"||o(m).forEach(function(w){f[w]=m[w]}),f}typeof Promise>"u"||i.Promise||(i.Promise=Promise);var u=Object.getPrototypeOf,c={}.hasOwnProperty;function d(f,m){return c.call(f,m)}function p(f,m){typeof m=="function"&&(m=m(u(f))),(typeof Reflect>"u"?o:Reflect.ownKeys)(m).forEach(function(w){g(f,w,m[w])})}var h=Object.defineProperty;function g(f,m,w,x){h(f,m,l(w&&d(w,"get")&&typeof w.get=="function"?{get:w.get,set:w.set,configurable:!0}:{value:w,configurable:!0,writable:!0},x))}function v(f){return{from:function(m){return f.prototype=Object.create(m.prototype),g(f.prototype,"constructor",f),{extend:p.bind(null,f.prototype)}}}}var b=Object.getOwnPropertyDescriptor,_=[].slice;function C(f,m,w){return _.call(f,m,w)}function S(f,m){return m(f)}function y(f){if(!f)throw new Error("Assertion Failed")}function T(f){i.setImmediate?setImmediate(f):setTimeout(f,0)}function k(f,m){if(typeof m=="string"&&d(f,m))return f[m];if(!m)return f;if(typeof m!="string"){for(var w=[],x=0,O=m.length;x<O;++x){var M=k(f,m[x]);w.push(M)}return w}var K=m.indexOf(".");if(K!==-1){var te=f[m.substr(0,K)];return te==null?void 0:k(te,m.substr(K+1))}}function E(f,m,w){if(f&&m!==void 0&&!("isFrozen"in Object&&Object.isFrozen(f)))if(typeof m!="string"&&"length"in m){y(typeof w!="string"&&"length"in w);for(var x=0,O=m.length;x<O;++x)E(f,m[x],w[x])}else{var M,K,te=m.indexOf(".");te!==-1?(M=m.substr(0,te),(K=m.substr(te+1))===""?w===void 0?s(f)&&!isNaN(parseInt(M))?f.splice(M,1):delete f[M]:f[M]=w:E(te=!(te=f[M])||!d(f,M)?f[M]={}:te,K,w)):w===void 0?s(f)&&!isNaN(parseInt(m))?f.splice(m,1):delete f[m]:f[m]=w}}function I(f){var m,w={};for(m in f)d(f,m)&&(w[m]=f[m]);return w}var D=[].concat;function A(f){return D.apply([],f)}var Wr="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(A([8,16,32,64].map(function(f){return["Int","Uint","Float"].map(function(m){return m+f+"Array"})}))).filter(function(f){return i[f]}),R=new Set(Wr.map(function(f){return i[f]})),B=null;function P(f){return B=new WeakMap,f=function m(w){if(!w||typeof w!="object")return w;var x=B.get(w);if(x)return x;if(s(w)){x=[],B.set(w,x);for(var O=0,M=w.length;O<M;++O)x.push(m(w[O]))}else if(R.has(w.constructor))x=w;else{var K,te=u(w);for(K in x=te===Object.prototype?{}:Object.create(te),B.set(w,x),w)d(w,K)&&(x[K]=m(w[K]))}return x}(f),B=null,f}var $={}.toString;function V(f){return $.call(f).slice(8,-1)}var N=typeof Symbol<"u"?Symbol.iterator:"@@iterator",q=typeof N=="symbol"?function(f){var m;return f!=null&&(m=f[N])&&m.apply(f)}:function(){return null};function J(f,m){return m=f.indexOf(m),0<=m&&f.splice(m,1),0<=m}var ie={};function de(f){var m,w,x,O;if(arguments.length===1){if(s(f))return f.slice();if(this===ie&&typeof f=="string")return[f];if(O=q(f)){for(w=[];!(x=O.next()).done;)w.push(x.value);return w}if(f==null)return[f];if(typeof(m=f.length)!="number")return[f];for(w=new Array(m);m--;)w[m]=f[m];return w}for(m=arguments.length,w=new Array(m);m--;)w[m]=arguments[m];return w}var ee=typeof Symbol<"u"?function(f){return f[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Ke=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],er=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ke),j={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 U(f,m){this.name=f,this.message=m}function Z(f,m){return f+". Errors: "+Object.keys(m).map(function(w){return m[w].toString()}).filter(function(w,x,O){return O.indexOf(w)===x}).join(`
1030
1030
  `)}function oe(f,m,w,x){this.failures=m,this.failedKeys=x,this.successCount=w,this.message=Z(f,m)}function fe(f,m){this.name="BulkError",this.failures=Object.keys(m).map(function(w){return m[w]}),this.failuresByPos=m,this.message=Z(f,this.failures)}v(U).from(Error).extend({toString:function(){return this.name+": "+this.message}}),v(oe).from(U),v(fe).from(U);var ae=er.reduce(function(f,m){return f[m]=m+"Error",f},{}),G=U,Y=er.reduce(function(f,m){var w=m+"Error";function x(O,M){this.name=w,O?typeof O=="string"?(this.message="".concat(O).concat(M?`
1031
- `+M:""),this.inner=M||null):typeof O=="object"&&(this.message="".concat(O.name," ").concat(O.message),this.inner=O):(this.message=j[m]||w,this.inner=null)}return v(x).from(G),f[m]=x,f},{});Y.Syntax=SyntaxError,Y.Type=TypeError,Y.Range=RangeError;var Ee=Ke.reduce(function(f,m){return f[m+"Error"]=Y[m],f},{}),he=er.reduce(function(f,m){return["Syntax","Type","Range"].indexOf(m)===-1&&(f[m+"Error"]=Y[m]),f},{});function Pe(){}function Te(f){return f}function Ae(f,m){return f==null||f===Te?m:function(w){return m(f(w))}}function xe(f,m){return function(){f.apply(this,arguments),m.apply(this,arguments)}}function Je(f,m){return f===Pe?m:function(){var w=f.apply(this,arguments);w!==void 0&&(arguments[0]=w);var x=this.onsuccess,O=this.onerror;this.onsuccess=null,this.onerror=null;var M=m.apply(this,arguments);return x&&(this.onsuccess=this.onsuccess?xe(x,this.onsuccess):x),O&&(this.onerror=this.onerror?xe(O,this.onerror):O),M!==void 0?M:w}}function We(f,m){return f===Pe?m:function(){f.apply(this,arguments);var w=this.onsuccess,x=this.onerror;this.onsuccess=this.onerror=null,m.apply(this,arguments),w&&(this.onsuccess=this.onsuccess?xe(w,this.onsuccess):w),x&&(this.onerror=this.onerror?xe(x,this.onerror):x)}}function Ye(f,m){return f===Pe?m:function(w){var x=f.apply(this,arguments);l(w,x);var O=this.onsuccess,M=this.onerror;return this.onsuccess=null,this.onerror=null,w=m.apply(this,arguments),O&&(this.onsuccess=this.onsuccess?xe(O,this.onsuccess):O),M&&(this.onerror=this.onerror?xe(M,this.onerror):M),x===void 0?w===void 0?void 0:w:l(x,w)}}function Ze(f,m){return f===Pe?m:function(){return m.apply(this,arguments)!==!1&&f.apply(this,arguments)}}function ne(f,m){return f===Pe?m:function(){var w=f.apply(this,arguments);if(w&&typeof w.then=="function"){for(var x=this,O=arguments.length,M=new Array(O);O--;)M[O]=arguments[O];return w.then(function(){return m.apply(x,M)})}return m.apply(this,arguments)}}he.ModifyError=oe,he.DexieError=U,he.BulkError=fe;var se=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Ue(f){se=f}var je={},Ge=100,Wr=typeof Promise>"u"?[]:function(){var f=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[f,u(f),f];var m=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[m,u(m),f]}(),Ke=Wr[0],er=Wr[1],Wr=Wr[2],er=er&&er.then,ut=Ke&&Ke.constructor,mt=!!Wr,ht=function(f,m){Xe.push([f,m]),Lt&&(queueMicrotask(wt),Lt=!1)},It=!0,Lt=!0,_t=[],Et=[],qt=Te,le={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Pe,pgp:!1,env:{},finalize:Pe},we=le,Xe=[],rt=0,He=[];function $e(f){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var m=this._PSD=we;if(typeof f!="function"){if(f!==je)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Ut(this,this._value))}this._state=null,this._value=null,++m.ref,function w(x,O){try{O(function(M){if(x._state===null){if(M===x)throw new TypeError("A promise cannot be resolved with itself.");var K=x._lib&&xt();M&&typeof M.then=="function"?w(x,function(te,pe){M instanceof $e?M._then(te,pe):M.then(te,pe)}):(x._state=!0,x._value=M,Jt(x)),K&&Ht()}},Ut.bind(null,x))}catch(M){Ut(x,M)}}(this,f)}var kt={get:function(){var f=we,m=gi;function w(x,O){var M=this,K=!f.global&&(f!==we||m!==gi),te=K&&!ar(),pe=new $e(function(ge,ue){dn(M,new Gt(no(x,f,K,te),no(O,f,K,te),ge,ue,f))});return this._consoleTask&&(pe._consoleTask=this._consoleTask),pe}return w.prototype=je,w},set:function(f){g(this,"then",f&&f.prototype===je?kt:{get:function(){return f},set:kt.set})}};function Gt(f,m,w,x,O){this.onFulfilled=typeof f=="function"?f:null,this.onRejected=typeof m=="function"?m:null,this.resolve=w,this.reject=x,this.psd=O}function Ut(f,m){var w,x;Et.push(m),f._state===null&&(w=f._lib&&xt(),m=qt(m),f._state=!1,f._value=m,x=f,_t.some(function(O){return O._value===x._value})||_t.push(x),Jt(f),w&&Ht())}function Jt(f){var m=f._listeners;f._listeners=[];for(var w=0,x=m.length;w<x;++w)dn(f,m[w]);var O=f._PSD;--O.ref||O.finalize(),rt===0&&(++rt,ht(function(){--rt==0&&wn()},[]))}function dn(f,m){if(f._state!==null){var w=f._state?m.onFulfilled:m.onRejected;if(w===null)return(f._state?m.resolve:m.reject)(f._value);++m.psd.ref,++rt,ht(gt,[w,f,m])}else f._listeners.push(m)}function gt(f,m,w){try{var x,O=m._value;!m._state&&Et.length&&(Et=[]),x=se&&m._consoleTask?m._consoleTask.run(function(){return f(O)}):f(O),m._state||Et.indexOf(O)!==-1||function(M){for(var K=_t.length;K;)if(_t[--K]._value===M._value)return _t.splice(K,1)}(m),w.resolve(x)}catch(M){w.reject(M)}finally{--rt==0&&wn(),--w.psd.ref||w.psd.finalize()}}function wt(){or(le,function(){xt()&&Ht()})}function xt(){var f=It;return Lt=It=!1,f}function Ht(){var f,m,w;do for(;0<Xe.length;)for(f=Xe,Xe=[],w=f.length,m=0;m<w;++m){var x=f[m];x[0].apply(null,x[1])}while(0<Xe.length);Lt=It=!0}function wn(){var f=_t;_t=[],f.forEach(function(x){x._PSD.onunhandled.call(null,x._value,x)});for(var m=He.slice(0),w=m.length;w;)m[--w]()}function An(f){return new $e(je,!1,f)}function Vt(f,m){var w=we;return function(){var x=xt(),O=we;try{return Dr(w,!0),f.apply(this,arguments)}catch(M){m&&m(M)}finally{Dr(O,!1),x&&Ht()}}}p($e.prototype,{then:kt,_then:function(f,m){dn(this,new Gt(null,null,f,m,we))},catch:function(f){if(arguments.length===1)return this.then(null,f);var m=f,w=arguments[1];return typeof m=="function"?this.then(null,function(x){return(x instanceof m?w:An)(x)}):this.then(null,function(x){return(x&&x.name===m?w:An)(x)})},finally:function(f){return this.then(function(m){return $e.resolve(f()).then(function(){return m})},function(m){return $e.resolve(f()).then(function(){return An(m)})})},timeout:function(f,m){var w=this;return f<1/0?new $e(function(x,O){var M=setTimeout(function(){return O(new Y.Timeout(m))},f);w.then(x,O).finally(clearTimeout.bind(null,M))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&g($e.prototype,Symbol.toStringTag,"Dexie.Promise"),le.env=Do(),p($e,{all:function(){var f=de.apply(null,arguments).map(yr);return new $e(function(m,w){f.length===0&&m([]);var x=f.length;f.forEach(function(O,M){return $e.resolve(O).then(function(K){f[M]=K,--x||m(f)},w)})})},resolve:function(f){return f instanceof $e?f:f&&typeof f.then=="function"?new $e(function(m,w){f.then(m,w)}):new $e(je,!0,f)},reject:An,race:function(){var f=de.apply(null,arguments).map(yr);return new $e(function(m,w){f.map(function(x){return $e.resolve(x).then(m,w)})})},PSD:{get:function(){return we},set:function(f){return we=f}},totalEchoes:{get:function(){return gi}},newPSD:Lr,usePSD:or,scheduler:{get:function(){return ht},set:function(f){ht=f}},rejectionMapper:{get:function(){return qt},set:function(f){qt=f}},follow:function(f,m){return new $e(function(w,x){return Lr(function(O,M){var K=we;K.unhandleds=[],K.onunhandled=M,K.finalize=xe(function(){var te,pe=this;te=function(){pe.unhandleds.length===0?O():M(pe.unhandleds[0])},He.push(function ge(){te(),He.splice(He.indexOf(ge),1)}),++rt,ht(function(){--rt==0&&wn()},[])},K.finalize),f()},m,w,x)})}}),ut&&(ut.allSettled&&g($e,"allSettled",function(){var f=de.apply(null,arguments).map(yr);return new $e(function(m){f.length===0&&m([]);var w=f.length,x=new Array(w);f.forEach(function(O,M){return $e.resolve(O).then(function(K){return x[M]={status:"fulfilled",value:K}},function(K){return x[M]={status:"rejected",reason:K}}).then(function(){return--w||m(x)})})})}),ut.any&&typeof AggregateError<"u"&&g($e,"any",function(){var f=de.apply(null,arguments).map(yr);return new $e(function(m,w){f.length===0&&w(new AggregateError([]));var x=f.length,O=new Array(x);f.forEach(function(M,K){return $e.resolve(M).then(function(te){return m(te)},function(te){O[K]=te,--x||w(new AggregateError(O))})})})}),ut.withResolvers&&($e.withResolvers=ut.withResolvers));var ln={awaits:0,echoes:0,id:0},di=0,lr=[],ca=0,gi=0,Zs=0;function Lr(f,m,w,x){var O=we,M=Object.create(O);return M.parent=O,M.ref=0,M.global=!1,M.id=++Zs,le.env,M.env=mt?{Promise:$e,PromiseProp:{value:$e,configurable:!0,writable:!0},all:$e.all,race:$e.race,allSettled:$e.allSettled,any:$e.any,resolve:$e.resolve,reject:$e.reject}:{},m&&l(M,m),++O.ref,M.finalize=function(){--this.parent.ref||this.parent.finalize()},x=or(M,f,w,x),M.ref===0&&M.finalize(),x}function Yn(){return ln.id||(ln.id=++di),++ln.awaits,ln.echoes+=Ge,ln.id}function ar(){return!!ln.awaits&&(--ln.awaits==0&&(ln.id=0),ln.echoes=ln.awaits*Ge,!0)}function yr(f){return ln.echoes&&f&&f.constructor===ut?(Yn(),f.then(function(m){return ar(),m},function(m){return ar(),un(m)})):f}function cs(){var f=lr[lr.length-1];lr.pop(),Dr(f,!1)}function Dr(f,m){var w,x=we;(m?!ln.echoes||ca++&&f===we:!ca||--ca&&f===we)||queueMicrotask(m?(function(O){++gi,ln.echoes&&--ln.echoes!=0||(ln.echoes=ln.awaits=ln.id=0),lr.push(we),Dr(O,!0)}).bind(null,f):cs),f!==we&&(we=f,x===le&&(le.env=Do()),mt&&(w=le.env.Promise,m=f.env,(x.global||f.global)&&(Object.defineProperty(i,"Promise",m.PromiseProp),w.all=m.all,w.race=m.race,w.resolve=m.resolve,w.reject=m.reject,m.allSettled&&(w.allSettled=m.allSettled),m.any&&(w.any=m.any))))}function Do(){var f=i.Promise;return mt?{Promise:f,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:f.all,race:f.race,allSettled:f.allSettled,any:f.any,resolve:f.resolve,reject:f.reject}:{}}function or(f,m,w,x,O){var M=we;try{return Dr(f,!0),m(w,x,O)}finally{Dr(M,!1)}}function no(f,m,w,x){return typeof f!="function"?f:function(){var O=we;w&&Yn(),Dr(m,!0);try{return f.apply(this,arguments)}finally{Dr(O,!1),x&&queueMicrotask(ar)}}}function ia(f){Promise===ut&&ln.echoes===0?ca===0?f():enqueueNativeMicroTask(f):setTimeout(f,0)}(""+er).indexOf("[native code]")===-1&&(Yn=ar=Pe);var un=$e.reject,oa="￿",Ir="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Tu="String expected.",wa=[],ho="__dbnames",Xs="readonly",Qs="readwrite";function Ea(f,m){return f?m?function(){return f.apply(this,arguments)&&m.apply(this,arguments)}:f:m}var Uc={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Mo(f){return typeof f!="string"||/\./.test(f)?function(m){return m}:function(m){return m[f]===void 0&&f in m&&delete(m=P(m))[f],m}}function Du(){throw Y.Type()}function Kt(f,m){try{var w=Hc(f),x=Hc(m);if(w!==x)return w==="Array"?1:x==="Array"?-1:w==="binary"?1:x==="binary"?-1:w==="string"?1:x==="string"?-1:w==="Date"?1:x!=="Date"?NaN:-1;switch(w){case"number":case"Date":case"string":return m<f?1:f<m?-1:0;case"binary":return function(O,M){for(var K=O.length,te=M.length,pe=K<te?K:te,ge=0;ge<pe;++ge)if(O[ge]!==M[ge])return O[ge]<M[ge]?-1:1;return K===te?0:K<te?-1:1}(uu(f),uu(m));case"Array":return function(O,M){for(var K=O.length,te=M.length,pe=K<te?K:te,ge=0;ge<pe;++ge){var ue=Kt(O[ge],M[ge]);if(ue!==0)return ue}return K===te?0:K<te?-1:1}(f,m)}}catch{}return NaN}function Hc(f){var m=typeof f;return m!="object"?m:ArrayBuffer.isView(f)?"binary":(f=V(f),f==="ArrayBuffer"?"binary":f)}function uu(f){return f instanceof Uint8Array?f:ArrayBuffer.isView(f)?new Uint8Array(f.buffer,f.byteOffset,f.byteLength):new Uint8Array(f)}var Vl=(sn.prototype._trans=function(f,m,w){var x=this._tx||we.trans,O=this.name,M=se&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(f==="readonly"?"read":"write"," ").concat(this.name));function K(ge,ue,Q){if(!Q.schema[O])throw new Y.NotFound("Table "+O+" not part of transaction");return m(Q.idbtrans,Q)}var te=xt();try{var pe=x&&x.db._novip===this.db._novip?x===we.trans?x._promise(f,K,w):Lr(function(){return x._promise(f,K,w)},{trans:x,transless:we.transless||we}):function ge(ue,Q,me,ce){if(ue.idbdb&&(ue._state.openComplete||we.letThrough||ue._vip)){var ye=ue._createTransaction(Q,me,ue._dbSchema);try{ye.create(),ue._state.PR1398_maxLoop=3}catch(Se){return Se.name===ae.InvalidState&&ue.isOpen()&&0<--ue._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ue.close({disableAutoOpen:!1}),ue.open().then(function(){return ge(ue,Q,me,ce)})):un(Se)}return ye._promise(Q,function(Se,ve){return Lr(function(){return we.trans=ye,ce(Se,ve,ye)})}).then(function(Se){if(Q==="readwrite")try{ye.idbtrans.commit()}catch{}return Q==="readonly"?Se:ye._completion.then(function(){return Se})})}if(ue._state.openComplete)return un(new Y.DatabaseClosed(ue._state.dbOpenError));if(!ue._state.isBeingOpened){if(!ue._state.autoOpen)return un(new Y.DatabaseClosed);ue.open().catch(Pe)}return ue._state.dbReadyPromise.then(function(){return ge(ue,Q,me,ce)})}(this.db,f,[this.name],K);return M&&(pe._consoleTask=M,pe=pe.catch(function(ge){return console.trace(ge),un(ge)})),pe}finally{te&&Ht()}},sn.prototype.get=function(f,m){var w=this;return f&&f.constructor===Object?this.where(f).first(m):f==null?un(new Y.Type("Invalid argument to Table.get()")):this._trans("readonly",function(x){return w.core.get({trans:x,key:f}).then(function(O){return w.hook.reading.fire(O)})}).then(m)},sn.prototype.where=function(f){if(typeof f=="string")return new this.db.WhereClause(this,f);if(s(f))return new this.db.WhereClause(this,"[".concat(f.join("+"),"]"));var m=o(f);if(m.length===1)return this.where(m[0]).equals(f[m[0]]);var w=this.schema.indexes.concat(this.schema.primKey).filter(function(te){if(te.compound&&m.every(function(ge){return 0<=te.keyPath.indexOf(ge)})){for(var pe=0;pe<m.length;++pe)if(m.indexOf(te.keyPath[pe])===-1)return!1;return!0}return!1}).sort(function(te,pe){return te.keyPath.length-pe.keyPath.length})[0];if(w&&this.db._maxKey!==oa){var M=w.keyPath.slice(0,m.length);return this.where(M).equals(M.map(function(pe){return f[pe]}))}!w&&se&&console.warn("The query ".concat(JSON.stringify(f)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(m.join("+"),"]"));var x=this.schema.idxByName;function O(te,pe){return Kt(te,pe)===0}var K=m.reduce(function(Q,pe){var ge=Q[0],ue=Q[1],Q=x[pe],me=f[pe];return[ge||Q,ge||!Q?Ea(ue,Q&&Q.multi?function(ce){return ce=k(ce,pe),s(ce)&&ce.some(function(ye){return O(me,ye)})}:function(ce){return O(me,k(ce,pe))}):ue]},[null,null]),M=K[0],K=K[1];return M?this.where(M.name).equals(f[M.keyPath]).filter(K):w?this.filter(K):this.where(m).equals("")},sn.prototype.filter=function(f){return this.toCollection().and(f)},sn.prototype.count=function(f){return this.toCollection().count(f)},sn.prototype.offset=function(f){return this.toCollection().offset(f)},sn.prototype.limit=function(f){return this.toCollection().limit(f)},sn.prototype.each=function(f){return this.toCollection().each(f)},sn.prototype.toArray=function(f){return this.toCollection().toArray(f)},sn.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},sn.prototype.orderBy=function(f){return new this.db.Collection(new this.db.WhereClause(this,s(f)?"[".concat(f.join("+"),"]"):f))},sn.prototype.reverse=function(){return this.toCollection().reverse()},sn.prototype.mapToClass=function(f){var m,w=this.db,x=this.name;function O(){return m!==null&&m.apply(this,arguments)||this}(this.schema.mappedClass=f).prototype instanceof Du&&(function(pe,ge){if(typeof ge!="function"&&ge!==null)throw new TypeError("Class extends value "+String(ge)+" is not a constructor or null");function ue(){this.constructor=pe}n(pe,ge),pe.prototype=ge===null?Object.create(ge):(ue.prototype=ge.prototype,new ue)}(O,m=f),Object.defineProperty(O.prototype,"db",{get:function(){return w},enumerable:!1,configurable:!0}),O.prototype.table=function(){return x},f=O);for(var M=new Set,K=f.prototype;K;K=u(K))Object.getOwnPropertyNames(K).forEach(function(pe){return M.add(pe)});function te(pe){if(!pe)return pe;var ge,ue=Object.create(f.prototype);for(ge in pe)if(!M.has(ge))try{ue[ge]=pe[ge]}catch{}return ue}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=te,this.hook("reading",te),f},sn.prototype.defineClass=function(){return this.mapToClass(function(f){l(this,f)})},sn.prototype.add=function(f,m){var w=this,x=this.schema.primKey,O=x.auto,M=x.keyPath,K=f;return M&&O&&(K=Mo(M)(f)),this._trans("readwrite",function(te){return w.core.mutate({trans:te,type:"add",keys:m!=null?[m]:null,values:[K]})}).then(function(te){return te.numFailures?$e.reject(te.failures[0]):te.lastResult}).then(function(te){if(M)try{E(f,M,te)}catch{}return te})},sn.prototype.update=function(f,m){return typeof f!="object"||s(f)?this.where(":id").equals(f).modify(m):(f=k(f,this.schema.primKey.keyPath),f===void 0?un(new Y.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(f).modify(m))},sn.prototype.put=function(f,m){var w=this,x=this.schema.primKey,O=x.auto,M=x.keyPath,K=f;return M&&O&&(K=Mo(M)(f)),this._trans("readwrite",function(te){return w.core.mutate({trans:te,type:"put",values:[K],keys:m!=null?[m]:null})}).then(function(te){return te.numFailures?$e.reject(te.failures[0]):te.lastResult}).then(function(te){if(M)try{E(f,M,te)}catch{}return te})},sn.prototype.delete=function(f){var m=this;return this._trans("readwrite",function(w){return m.core.mutate({trans:w,type:"delete",keys:[f]})}).then(function(w){return w.numFailures?$e.reject(w.failures[0]):void 0})},sn.prototype.clear=function(){var f=this;return this._trans("readwrite",function(m){return f.core.mutate({trans:m,type:"deleteRange",range:Uc})}).then(function(m){return m.numFailures?$e.reject(m.failures[0]):void 0})},sn.prototype.bulkGet=function(f){var m=this;return this._trans("readonly",function(w){return m.core.getMany({keys:f,trans:w}).then(function(x){return x.map(function(O){return m.hook.reading.fire(O)})})})},sn.prototype.bulkAdd=function(f,m,w){var x=this,O=Array.isArray(m)?m:void 0,M=(w=w||(O?void 0:m))?w.allKeys:void 0;return this._trans("readwrite",function(K){var ge=x.schema.primKey,te=ge.auto,ge=ge.keyPath;if(ge&&O)throw new Y.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(O&&O.length!==f.length)throw new Y.InvalidArgument("Arguments objects and keys must have the same length");var pe=f.length,ge=ge&&te?f.map(Mo(ge)):f;return x.core.mutate({trans:K,type:"add",keys:O,values:ge,wantResults:M}).then(function(ye){var Q=ye.numFailures,me=ye.results,ce=ye.lastResult,ye=ye.failures;if(Q===0)return M?me:ce;throw new fe("".concat(x.name,".bulkAdd(): ").concat(Q," of ").concat(pe," operations failed"),ye)})})},sn.prototype.bulkPut=function(f,m,w){var x=this,O=Array.isArray(m)?m:void 0,M=(w=w||(O?void 0:m))?w.allKeys:void 0;return this._trans("readwrite",function(K){var ge=x.schema.primKey,te=ge.auto,ge=ge.keyPath;if(ge&&O)throw new Y.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(O&&O.length!==f.length)throw new Y.InvalidArgument("Arguments objects and keys must have the same length");var pe=f.length,ge=ge&&te?f.map(Mo(ge)):f;return x.core.mutate({trans:K,type:"put",keys:O,values:ge,wantResults:M}).then(function(ye){var Q=ye.numFailures,me=ye.results,ce=ye.lastResult,ye=ye.failures;if(Q===0)return M?me:ce;throw new fe("".concat(x.name,".bulkPut(): ").concat(Q," of ").concat(pe," operations failed"),ye)})})},sn.prototype.bulkUpdate=function(f){var m=this,w=this.core,x=f.map(function(K){return K.key}),O=f.map(function(K){return K.changes}),M=[];return this._trans("readwrite",function(K){return w.getMany({trans:K,keys:x,cache:"clone"}).then(function(te){var pe=[],ge=[];f.forEach(function(Q,me){var ce=Q.key,ye=Q.changes,Se=te[me];if(Se){for(var ve=0,Oe=Object.keys(ye);ve<Oe.length;ve++){var Me=Oe[ve],Ne=ye[Me];if(Me===m.schema.primKey.keyPath){if(Kt(Ne,ce)!==0)throw new Y.Constraint("Cannot update primary key in bulkUpdate()")}else E(Se,Me,Ne)}M.push(me),pe.push(ce),ge.push(Se)}});var ue=pe.length;return w.mutate({trans:K,type:"put",keys:pe,values:ge,updates:{keys:x,changeSpecs:O}}).then(function(Q){var me=Q.numFailures,ce=Q.failures;if(me===0)return ue;for(var ye=0,Se=Object.keys(ce);ye<Se.length;ye++){var ve,Oe=Se[ye],Me=M[Number(Oe)];Me!=null&&(ve=ce[Oe],delete ce[Oe],ce[Me]=ve)}throw new fe("".concat(m.name,".bulkUpdate(): ").concat(me," of ").concat(ue," operations failed"),ce)})})})},sn.prototype.bulkDelete=function(f){var m=this,w=f.length;return this._trans("readwrite",function(x){return m.core.mutate({trans:x,type:"delete",keys:f})}).then(function(K){var O=K.numFailures,M=K.lastResult,K=K.failures;if(O===0)return M;throw new fe("".concat(m.name,".bulkDelete(): ").concat(O," of ").concat(w," operations failed"),K)})},sn);function sn(){}function wi(f){function m(K,te){if(te){for(var pe=arguments.length,ge=new Array(pe-1);--pe;)ge[pe-1]=arguments[pe];return w[K].subscribe.apply(null,ge),f}if(typeof K=="string")return w[K]}var w={};m.addEventType=M;for(var x=1,O=arguments.length;x<O;++x)M(arguments[x]);return m;function M(K,te,pe){if(typeof K!="object"){var ge;te=te||Ze;var ue={subscribers:[],fire:pe=pe||Pe,subscribe:function(Q){ue.subscribers.indexOf(Q)===-1&&(ue.subscribers.push(Q),ue.fire=te(ue.fire,Q))},unsubscribe:function(Q){ue.subscribers=ue.subscribers.filter(function(me){return me!==Q}),ue.fire=ue.subscribers.reduce(te,pe)}};return w[K]=m[K]=ue}o(ge=K).forEach(function(Q){var me=ge[Q];if(s(me))M(Q,ge[Q][0],ge[Q][1]);else{if(me!=="asap")throw new Y.InvalidArgument("Invalid event config");var ce=M(Q,Te,function(){for(var ye=arguments.length,Se=new Array(ye);ye--;)Se[ye]=arguments[ye];ce.subscribers.forEach(function(ve){T(function(){ve.apply(null,Se)})})})}})}}function ji(f,m){return v(m).from({prototype:f}),m}function vi(f,m){return!(f.filter||f.algorithm||f.or)&&(m?f.justLimit:!f.replayFilter)}function cl(f,m){f.filter=Ea(f.filter,m)}function Us(f,m,w){var x=f.replayFilter;f.replayFilter=x?function(){return Ea(x(),m())}:m,f.justLimit=w&&!x}function zi(f,m){if(f.isPrimKey)return m.primaryKey;var w=m.getIndexByKeyPath(f.index);if(!w)throw new Y.Schema("KeyPath "+f.index+" on object store "+m.name+" is not indexed");return w}function Au(f,m,w){var x=zi(f,m.schema);return m.openCursor({trans:w,values:!f.keysOnly,reverse:f.dir==="prev",unique:!!f.unique,query:{index:x,range:f.range}})}function No(f,m,w,x){var O=f.replayFilter?Ea(f.filter,f.replayFilter()):f.filter;if(f.or){var M={},K=function(te,pe,ge){var ue,Q;O&&!O(pe,ge,function(me){return pe.stop(me)},function(me){return pe.fail(me)})||((Q=""+(ue=pe.primaryKey))=="[object ArrayBuffer]"&&(Q=""+new Uint8Array(ue)),d(M,Q)||(M[Q]=!0,m(te,pe,ge)))};return Promise.all([f.or._iterate(K,w),Ou(Au(f,x,w),f.algorithm,K,!f.keysOnly&&f.valueMapper)])}return Ou(Au(f,x,w),Ea(f.algorithm,O),m,!f.keysOnly&&f.valueMapper)}function Ou(f,m,w,x){var O=Vt(x?function(M,K,te){return w(x(M),K,te)}:w);return f.then(function(M){if(M)return M.start(function(){var K=function(){return M.continue()};m&&!m(M,function(te){return K=te},function(te){M.stop(te),K=Pe},function(te){M.fail(te),K=Pe})||O(M.value,M,function(te){return K=te}),K()})})}var Wr=Symbol(),za=(jc.prototype.execute=function(f){if(this.add!==void 0){var m=this.add;if(s(m))return a(a([],s(f)?f:[],!0),m).sort();if(typeof m=="number")return(Number(f)||0)+m;if(typeof m=="bigint")try{return BigInt(f)+m}catch{return BigInt(0)+m}throw new TypeError("Invalid term ".concat(m))}if(this.remove!==void 0){var w=this.remove;if(s(w))return s(f)?f.filter(function(x){return!w.includes(x)}).sort():[];if(typeof w=="number")return Number(f)-w;if(typeof w=="bigint")try{return BigInt(f)-w}catch{return BigInt(0)-w}throw new TypeError("Invalid subtrahend ".concat(w))}return m=(m=this.replacePrefix)===null||m===void 0?void 0:m[0],m&&typeof f=="string"&&f.startsWith(m)?this.replacePrefix[1]+f.substring(m.length):f},jc);function jc(f){Object.assign(this,f)}var Wd=(Qt.prototype._read=function(f,m){var w=this._ctx;return w.error?w.table._trans(null,un.bind(null,w.error)):w.table._trans("readonly",f).then(m)},Qt.prototype._write=function(f){var m=this._ctx;return m.error?m.table._trans(null,un.bind(null,m.error)):m.table._trans("readwrite",f,"locked")},Qt.prototype._addAlgorithm=function(f){var m=this._ctx;m.algorithm=Ea(m.algorithm,f)},Qt.prototype._iterate=function(f,m){return No(this._ctx,f,m,this._ctx.table.core)},Qt.prototype.clone=function(f){var m=Object.create(this.constructor.prototype),w=Object.create(this._ctx);return f&&l(w,f),m._ctx=w,m},Qt.prototype.raw=function(){return this._ctx.valueMapper=null,this},Qt.prototype.each=function(f){var m=this._ctx;return this._read(function(w){return No(m,f,w,m.table.core)})},Qt.prototype.count=function(f){var m=this;return this._read(function(w){var x=m._ctx,O=x.table.core;if(vi(x,!0))return O.count({trans:w,query:{index:zi(x,O.schema),range:x.range}}).then(function(K){return Math.min(K,x.limit)});var M=0;return No(x,function(){return++M,!1},w,O).then(function(){return M})}).then(f)},Qt.prototype.sortBy=function(f,m){var w=f.split(".").reverse(),x=w[0],O=w.length-1;function M(pe,ge){return ge?M(pe[w[ge]],ge-1):pe[x]}var K=this._ctx.dir==="next"?1:-1;function te(pe,ge){return Kt(M(pe,O),M(ge,O))*K}return this.toArray(function(pe){return pe.sort(te)}).then(m)},Qt.prototype.toArray=function(f){var m=this;return this._read(function(w){var x=m._ctx;if(x.dir==="next"&&vi(x,!0)&&0<x.limit){var O=x.valueMapper,M=zi(x,x.table.core.schema);return x.table.core.query({trans:w,limit:x.limit,values:!0,query:{index:M,range:x.range}}).then(function(te){return te=te.result,O?te.map(O):te})}var K=[];return No(x,function(te){return K.push(te)},w,x.table.core).then(function(){return K})},f)},Qt.prototype.offset=function(f){var m=this._ctx;return f<=0||(m.offset+=f,vi(m)?Us(m,function(){var w=f;return function(x,O){return w===0||(w===1?--w:O(function(){x.advance(w),w=0}),!1)}}):Us(m,function(){var w=f;return function(){return--w<0}})),this},Qt.prototype.limit=function(f){return this._ctx.limit=Math.min(this._ctx.limit,f),Us(this._ctx,function(){var m=f;return function(w,x,O){return--m<=0&&x(O),0<=m}},!0),this},Qt.prototype.until=function(f,m){return cl(this._ctx,function(w,x,O){return!f(w.value)||(x(O),m)}),this},Qt.prototype.first=function(f){return this.limit(1).toArray(function(m){return m[0]}).then(f)},Qt.prototype.last=function(f){return this.reverse().first(f)},Qt.prototype.filter=function(f){var m;return cl(this._ctx,function(w){return f(w.value)}),(m=this._ctx).isMatch=Ea(m.isMatch,f),this},Qt.prototype.and=function(f){return this.filter(f)},Qt.prototype.or=function(f){return new this.db.WhereClause(this._ctx.table,f,this)},Qt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Qt.prototype.desc=function(){return this.reverse()},Qt.prototype.eachKey=function(f){var m=this._ctx;return m.keysOnly=!m.isMatch,this.each(function(w,x){f(x.key,x)})},Qt.prototype.eachUniqueKey=function(f){return this._ctx.unique="unique",this.eachKey(f)},Qt.prototype.eachPrimaryKey=function(f){var m=this._ctx;return m.keysOnly=!m.isMatch,this.each(function(w,x){f(x.primaryKey,x)})},Qt.prototype.keys=function(f){var m=this._ctx;m.keysOnly=!m.isMatch;var w=[];return this.each(function(x,O){w.push(O.key)}).then(function(){return w}).then(f)},Qt.prototype.primaryKeys=function(f){var m=this._ctx;if(m.dir==="next"&&vi(m,!0)&&0<m.limit)return this._read(function(x){var O=zi(m,m.table.core.schema);return m.table.core.query({trans:x,values:!1,limit:m.limit,query:{index:O,range:m.range}})}).then(function(x){return x.result}).then(f);m.keysOnly=!m.isMatch;var w=[];return this.each(function(x,O){w.push(O.primaryKey)}).then(function(){return w}).then(f)},Qt.prototype.uniqueKeys=function(f){return this._ctx.unique="unique",this.keys(f)},Qt.prototype.firstKey=function(f){return this.limit(1).keys(function(m){return m[0]}).then(f)},Qt.prototype.lastKey=function(f){return this.reverse().firstKey(f)},Qt.prototype.distinct=function(){var f=this._ctx,f=f.index&&f.table.schema.idxByName[f.index];if(!f||!f.multi)return this;var m={};return cl(this._ctx,function(O){var x=O.primaryKey.toString(),O=d(m,x);return m[x]=!0,!O}),this},Qt.prototype.modify=function(f){var m=this,w=this._ctx;return this._write(function(x){var O,M,K;K=typeof f=="function"?f:(O=o(f),M=O.length,function(ve){for(var Oe=!1,Me=0;Me<M;++Me){var Ne=O[Me],Fe=f[Ne],nt=k(ve,Ne);Fe instanceof za?(E(ve,Ne,Fe.execute(nt)),Oe=!0):nt!==Fe&&(E(ve,Ne,Fe),Oe=!0)}return Oe});var te=w.table.core,Q=te.schema.primaryKey,pe=Q.outbound,ge=Q.extractKey,ue=200,Q=m.db._options.modifyChunkSize;Q&&(ue=typeof Q=="object"?Q[te.name]||Q["*"]||200:Q);function me(ve,Ne){var Me=Ne.failures,Ne=Ne.numFailures;ye+=ve-Ne;for(var Fe=0,nt=o(Me);Fe<nt.length;Fe++){var dt=nt[Fe];ce.push(Me[dt])}}var ce=[],ye=0,Se=[];return m.clone().primaryKeys().then(function(ve){function Oe(Ne){var Fe=Math.min(ue,ve.length-Ne);return te.getMany({trans:x,keys:ve.slice(Ne,Ne+Fe),cache:"immutable"}).then(function(nt){for(var dt=[],tt=[],ot=pe?[]:null,pt=[],it=0;it<Fe;++it){var bt=nt[it],Nt={value:P(bt),primKey:ve[Ne+it]};K.call(Nt,Nt.value,Nt)!==!1&&(Nt.value==null?pt.push(ve[Ne+it]):pe||Kt(ge(bt),ge(Nt.value))===0?(tt.push(Nt.value),pe&&ot.push(ve[Ne+it])):(pt.push(ve[Ne+it]),dt.push(Nt.value)))}return Promise.resolve(0<dt.length&&te.mutate({trans:x,type:"add",values:dt}).then(function(jt){for(var Wt in jt.failures)pt.splice(parseInt(Wt),1);me(dt.length,jt)})).then(function(){return(0<tt.length||Me&&typeof f=="object")&&te.mutate({trans:x,type:"put",keys:ot,values:tt,criteria:Me,changeSpec:typeof f!="function"&&f,isAdditionalChunk:0<Ne}).then(function(jt){return me(tt.length,jt)})}).then(function(){return(0<pt.length||Me&&f===Ao)&&te.mutate({trans:x,type:"delete",keys:pt,criteria:Me,isAdditionalChunk:0<Ne}).then(function(jt){return me(pt.length,jt)})}).then(function(){return ve.length>Ne+Fe&&Oe(Ne+ue)})})}var Me=vi(w)&&w.limit===1/0&&(typeof f!="function"||f===Ao)&&{index:w.index,range:w.range};return Oe(0).then(function(){if(0<ce.length)throw new oe("Error modifying one or more objects",ce,ye,Se);return ve.length})})})},Qt.prototype.delete=function(){var f=this._ctx,m=f.range;return vi(f)&&(f.isPrimKey||m.type===3)?this._write(function(w){var x=f.table.core.schema.primaryKey,O=m;return f.table.core.count({trans:w,query:{index:x,range:O}}).then(function(M){return f.table.core.mutate({trans:w,type:"deleteRange",range:O}).then(function(K){var te=K.failures;if(K.lastResult,K.results,K=K.numFailures,K)throw new oe("Could not delete some values",Object.keys(te).map(function(pe){return te[pe]}),M-K);return M-K})})}):this.modify(Ao)},Qt);function Qt(){}var Ao=function(f,m){return m.value=null};function gd(f,m){return f<m?-1:f===m?0:1}function Gf(f,m){return m<f?-1:f===m?0:1}function Zn(f,m,w){return f=f instanceof Iu?new f.Collection(f):f,f._ctx.error=new(w||TypeError)(m),f}function ti(f){return new f.Collection(f,function(){return zc("")}).limit(0)}function Lo(f,m,w,x){var O,M,K,te,pe,ge,ue,Q=w.length;if(!w.every(function(ye){return typeof ye=="string"}))return Zn(f,Tu);function me(ye){O=ye==="next"?function(ve){return ve.toUpperCase()}:function(ve){return ve.toLowerCase()},M=ye==="next"?function(ve){return ve.toLowerCase()}:function(ve){return ve.toUpperCase()},K=ye==="next"?gd:Gf;var Se=w.map(function(ve){return{lower:M(ve),upper:O(ve)}}).sort(function(ve,Oe){return K(ve.lower,Oe.lower)});te=Se.map(function(ve){return ve.upper}),pe=Se.map(function(ve){return ve.lower}),ue=(ge=ye)==="next"?"":x}me("next"),f=new f.Collection(f,function(){return fa(te[0],pe[Q-1]+x)}),f._ondirectionchange=function(ye){me(ye)};var ce=0;return f._addAlgorithm(function(ye,Se,ve){var Oe=ye.key;if(typeof Oe!="string")return!1;var Me=M(Oe);if(m(Me,pe,ce))return!0;for(var Ne=null,Fe=ce;Fe<Q;++Fe){var nt=function(dt,tt,ot,pt,it,bt){for(var Nt=Math.min(dt.length,pt.length),jt=-1,Wt=0;Wt<Nt;++Wt){var Xn=tt[Wt];if(Xn!==pt[Wt])return it(dt[Wt],ot[Wt])<0?dt.substr(0,Wt)+ot[Wt]+ot.substr(Wt+1):it(dt[Wt],pt[Wt])<0?dt.substr(0,Wt)+pt[Wt]+ot.substr(Wt+1):0<=jt?dt.substr(0,jt)+tt[jt]+ot.substr(jt+1):null;it(dt[Wt],Xn)<0&&(jt=Wt)}return Nt<pt.length&&bt==="next"?dt+ot.substr(dt.length):Nt<dt.length&&bt==="prev"?dt.substr(0,ot.length):jt<0?null:dt.substr(0,jt)+pt[jt]+ot.substr(jt+1)}(Oe,Me,te[Fe],pe[Fe],K,ge);nt===null&&Ne===null?ce=Fe+1:(Ne===null||0<K(Ne,nt))&&(Ne=nt)}return Se(Ne!==null?function(){ye.continue(Ne+ue)}:ve),!1}),f}function fa(f,m,w,x){return{type:2,lower:f,upper:m,lowerOpen:w,upperOpen:x}}function zc(f){return{type:1,lower:f,upper:f}}var Iu=(Object.defineProperty(Tn.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Tn.prototype.between=function(f,m,w,x){w=w!==!1,x=x===!0;try{return 0<this._cmp(f,m)||this._cmp(f,m)===0&&(w||x)&&(!w||!x)?ti(this):new this.Collection(this,function(){return fa(f,m,!w,!x)})}catch{return Zn(this,Ir)}},Tn.prototype.equals=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return zc(f)})},Tn.prototype.above=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return fa(f,void 0,!0)})},Tn.prototype.aboveOrEqual=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return fa(f,void 0,!1)})},Tn.prototype.below=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return fa(void 0,f,!1,!0)})},Tn.prototype.belowOrEqual=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return fa(void 0,f)})},Tn.prototype.startsWith=function(f){return typeof f!="string"?Zn(this,Tu):this.between(f,f+oa,!0,!0)},Tn.prototype.startsWithIgnoreCase=function(f){return f===""?this.startsWith(f):Lo(this,function(m,w){return m.indexOf(w[0])===0},[f],oa)},Tn.prototype.equalsIgnoreCase=function(f){return Lo(this,function(m,w){return m===w[0]},[f],"")},Tn.prototype.anyOfIgnoreCase=function(){var f=de.apply(ie,arguments);return f.length===0?ti(this):Lo(this,function(m,w){return w.indexOf(m)!==-1},f,"")},Tn.prototype.startsWithAnyOfIgnoreCase=function(){var f=de.apply(ie,arguments);return f.length===0?ti(this):Lo(this,function(m,w){return w.some(function(x){return m.indexOf(x)===0})},f,oa)},Tn.prototype.anyOf=function(){var f=this,m=de.apply(ie,arguments),w=this._cmp;try{m.sort(w)}catch{return Zn(this,Ir)}if(m.length===0)return ti(this);var x=new this.Collection(this,function(){return fa(m[0],m[m.length-1])});x._ondirectionchange=function(M){w=M==="next"?f._ascending:f._descending,m.sort(w)};var O=0;return x._addAlgorithm(function(M,K,te){for(var pe=M.key;0<w(pe,m[O]);)if(++O===m.length)return K(te),!1;return w(pe,m[O])===0||(K(function(){M.continue(m[O])}),!1)}),x},Tn.prototype.notEqual=function(f){return this.inAnyRange([[-1/0,f],[f,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Tn.prototype.noneOf=function(){var f=de.apply(ie,arguments);if(f.length===0)return new this.Collection(this);try{f.sort(this._ascending)}catch{return Zn(this,Ir)}var m=f.reduce(function(w,x){return w?w.concat([[w[w.length-1][1],x]]):[[-1/0,x]]},null);return m.push([f[f.length-1],this.db._maxKey]),this.inAnyRange(m,{includeLowers:!1,includeUppers:!1})},Tn.prototype.inAnyRange=function(Oe,m){var w=this,x=this._cmp,O=this._ascending,M=this._descending,K=this._min,te=this._max;if(Oe.length===0)return ti(this);if(!Oe.every(function(Me){return Me[0]!==void 0&&Me[1]!==void 0&&O(Me[0],Me[1])<=0}))return Zn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Y.InvalidArgument);var pe=!m||m.includeLowers!==!1,ge=m&&m.includeUppers===!0,ue,Q=O;function me(Me,Ne){return Q(Me[0],Ne[0])}try{(ue=Oe.reduce(function(Me,Ne){for(var Fe=0,nt=Me.length;Fe<nt;++Fe){var dt=Me[Fe];if(x(Ne[0],dt[1])<0&&0<x(Ne[1],dt[0])){dt[0]=K(dt[0],Ne[0]),dt[1]=te(dt[1],Ne[1]);break}}return Fe===nt&&Me.push(Ne),Me},[])).sort(me)}catch{return Zn(this,Ir)}var ce=0,ye=ge?function(Me){return 0<O(Me,ue[ce][1])}:function(Me){return 0<=O(Me,ue[ce][1])},Se=pe?function(Me){return 0<M(Me,ue[ce][0])}:function(Me){return 0<=M(Me,ue[ce][0])},ve=ye,Oe=new this.Collection(this,function(){return fa(ue[0][0],ue[ue.length-1][1],!pe,!ge)});return Oe._ondirectionchange=function(Me){Q=Me==="next"?(ve=ye,O):(ve=Se,M),ue.sort(me)},Oe._addAlgorithm(function(Me,Ne,Fe){for(var nt,dt=Me.key;ve(dt);)if(++ce===ue.length)return Ne(Fe),!1;return!ye(nt=dt)&&!Se(nt)||(w._cmp(dt,ue[ce][1])===0||w._cmp(dt,ue[ce][0])===0||Ne(function(){Q===O?Me.continue(ue[ce][0]):Me.continue(ue[ce][1])}),!1)}),Oe},Tn.prototype.startsWithAnyOf=function(){var f=de.apply(ie,arguments);return f.every(function(m){return typeof m=="string"})?f.length===0?ti(this):this.inAnyRange(f.map(function(m){return[m,m+oa]})):Zn(this,"startsWithAnyOf() only works with strings")},Tn);function Tn(){}function Vr(f){return Vt(function(m){return Wi(m),f(m.target.error),!1})}function Wi(f){f.stopPropagation&&f.stopPropagation(),f.preventDefault&&f.preventDefault()}var ro="storagemutated",dl="x-storagemutated-1",pa=wi(null,ro),qf=(Rr.prototype._lock=function(){return y(!we.global),++this._reculock,this._reculock!==1||we.global||(we.lockOwnerFor=this),this},Rr.prototype._unlock=function(){if(y(!we.global),--this._reculock==0)for(we.global||(we.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var f=this._blockedFuncs.shift();try{or(f[1],f[0])}catch{}}return this},Rr.prototype._locked=function(){return this._reculock&&we.lockOwnerFor!==this},Rr.prototype.create=function(f){var m=this;if(!this.mode)return this;var w=this.db.idbdb,x=this.db._state.dbOpenError;if(y(!this.idbtrans),!f&&!w)switch(x&&x.name){case"DatabaseClosedError":throw new Y.DatabaseClosed(x);case"MissingAPIError":throw new Y.MissingAPI(x.message,x);default:throw new Y.OpenFailed(x)}if(!this.active)throw new Y.TransactionInactive;return y(this._completion._state===null),(f=this.idbtrans=f||(this.db.core||w).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Vt(function(O){Wi(O),m._reject(f.error)}),f.onabort=Vt(function(O){Wi(O),m.active&&m._reject(new Y.Abort(f.error)),m.active=!1,m.on("abort").fire(O)}),f.oncomplete=Vt(function(){m.active=!1,m._resolve(),"mutatedParts"in f&&pa.storagemutated.fire(f.mutatedParts)}),this},Rr.prototype._promise=function(f,m,w){var x=this;if(f==="readwrite"&&this.mode!=="readwrite")return un(new Y.ReadOnly("Transaction is readonly"));if(!this.active)return un(new Y.TransactionInactive);if(this._locked())return new $e(function(M,K){x._blockedFuncs.push([function(){x._promise(f,m,w).then(M,K)},we])});if(w)return Lr(function(){var M=new $e(function(K,te){x._lock();var pe=m(K,te,x);pe&&pe.then&&pe.then(K,te)});return M.finally(function(){return x._unlock()}),M._lib=!0,M});var O=new $e(function(M,K){var te=m(M,K,x);te&&te.then&&te.then(M,K)});return O._lib=!0,O},Rr.prototype._root=function(){return this.parent?this.parent._root():this},Rr.prototype.waitFor=function(f){var m,w=this._root(),x=$e.resolve(f);w._waitingFor?w._waitingFor=w._waitingFor.then(function(){return x}):(w._waitingFor=x,w._waitingQueue=[],m=w.idbtrans.objectStore(w.storeNames[0]),function M(){for(++w._spinCount;w._waitingQueue.length;)w._waitingQueue.shift()();w._waitingFor&&(m.get(-1/0).onsuccess=M)}());var O=w._waitingFor;return new $e(function(M,K){x.then(function(te){return w._waitingQueue.push(Vt(M.bind(null,te)))},function(te){return w._waitingQueue.push(Vt(K.bind(null,te)))}).finally(function(){w._waitingFor===O&&(w._waitingFor=null)})})},Rr.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Y.Abort))},Rr.prototype.table=function(f){var m=this._memoizedTables||(this._memoizedTables={});if(d(m,f))return m[f];var w=this.schema[f];if(!w)throw new Y.NotFound("Table "+f+" not part of transaction");return w=new this.db.Table(f,w,this),w.core=this.db.core.table(f),m[f]=w},Rr);function Rr(){}function fl(f,m,w,x,O,M,K){return{name:f,keyPath:m,unique:w,multi:x,auto:O,compound:M,src:(w&&!K?"&":"")+(x?"*":"")+(O?"++":"")+vd(m)}}function vd(f){return typeof f=="string"?f:f?"["+[].join.call(f,"+")+"]":""}function Sl(f,m,w){return{name:f,primKey:m,indexes:w,mappedClass:null,idxByName:(x=function(O){return[O.name,O]},w.reduce(function(O,M,K){return K=x(M,K),K&&(O[K[0]]=K[1]),O},{}))};var x}var Ji=function(f){try{return f.only([[]]),Ji=function(){return[[]]},[[]]}catch{return Ji=function(){return oa},oa}};function hl(f){return f==null?function(){}:typeof f=="string"?(m=f).split(".").length===1?function(w){return w[m]}:function(w){return k(w,m)}:function(w){return k(w,f)};var m}function yi(f){return[].slice.call(f)}var Gi=0;function ao(f){return f==null?":id":typeof f=="string"?f:"[".concat(f.join("+"),"]")}function km(f,m,pe){function x(ve){if(ve.type===3)return null;if(ve.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var ce=ve.lower,ye=ve.upper,Se=ve.lowerOpen,ve=ve.upperOpen;return ce===void 0?ye===void 0?null:m.upperBound(ye,!!ve):ye===void 0?m.lowerBound(ce,!!Se):m.bound(ce,ye,!!Se,!!ve)}function O(me){var ce,ye=me.name;return{name:ye,schema:me,mutate:function(Se){var ve=Se.trans,Oe=Se.type,Me=Se.keys,Ne=Se.values,Fe=Se.range;return new Promise(function(nt,dt){nt=Vt(nt);var tt=ve.objectStore(ye),ot=tt.keyPath==null,pt=Oe==="put"||Oe==="add";if(!pt&&Oe!=="delete"&&Oe!=="deleteRange")throw new Error("Invalid operation type: "+Oe);var it,bt=(Me||Ne||{length:1}).length;if(Me&&Ne&&Me.length!==Ne.length)throw new Error("Given keys array must have same length as given values array.");if(bt===0)return nt({numFailures:0,failures:{},results:[],lastResult:void 0});function Nt(zn){++Xn,Wi(zn)}var jt=[],Wt=[],Xn=0;if(Oe==="deleteRange"){if(Fe.type===4)return nt({numFailures:Xn,failures:Wt,results:[],lastResult:void 0});Fe.type===3?jt.push(it=tt.clear()):jt.push(it=tt.delete(x(Fe)))}else{var ot=pt?ot?[Ne,Me]:[Ne,null]:[Me,null],Pt=ot[0],Pn=ot[1];if(pt)for(var Rn=0;Rn<bt;++Rn)jt.push(it=Pn&&Pn[Rn]!==void 0?tt[Oe](Pt[Rn],Pn[Rn]):tt[Oe](Pt[Rn])),it.onerror=Nt;else for(Rn=0;Rn<bt;++Rn)jt.push(it=tt[Oe](Pt[Rn])),it.onerror=Nt}function Co(zn){zn=zn.target.result,jt.forEach(function(Sa,vl){return Sa.error!=null&&(Wt[vl]=Sa.error)}),nt({numFailures:Xn,failures:Wt,results:Oe==="delete"?Me:jt.map(function(Sa){return Sa.result}),lastResult:zn})}it.onerror=function(zn){Nt(zn),Co(zn)},it.onsuccess=Co})},getMany:function(Se){var ve=Se.trans,Oe=Se.keys;return new Promise(function(Me,Ne){Me=Vt(Me);for(var Fe,nt=ve.objectStore(ye),dt=Oe.length,tt=new Array(dt),ot=0,pt=0,it=function(jt){jt=jt.target,tt[jt._pos]=jt.result,++pt===ot&&Me(tt)},bt=Vr(Ne),Nt=0;Nt<dt;++Nt)Oe[Nt]!=null&&((Fe=nt.get(Oe[Nt]))._pos=Nt,Fe.onsuccess=it,Fe.onerror=bt,++ot);ot===0&&Me(tt)})},get:function(Se){var ve=Se.trans,Oe=Se.key;return new Promise(function(Me,Ne){Me=Vt(Me);var Fe=ve.objectStore(ye).get(Oe);Fe.onsuccess=function(nt){return Me(nt.target.result)},Fe.onerror=Vr(Ne)})},query:(ce=ge,function(Se){return new Promise(function(ve,Oe){ve=Vt(ve);var Me,Ne,Fe,ot=Se.trans,nt=Se.values,dt=Se.limit,it=Se.query,tt=dt===1/0?void 0:dt,pt=it.index,it=it.range,ot=ot.objectStore(ye),pt=pt.isPrimaryKey?ot:ot.index(pt.name),it=x(it);if(dt===0)return ve({result:[]});ce?((tt=nt?pt.getAll(it,tt):pt.getAllKeys(it,tt)).onsuccess=function(bt){return ve({result:bt.target.result})},tt.onerror=Vr(Oe)):(Me=0,Ne=!nt&&"openKeyCursor"in pt?pt.openKeyCursor(it):pt.openCursor(it),Fe=[],Ne.onsuccess=function(bt){var Nt=Ne.result;return Nt?(Fe.push(nt?Nt.value:Nt.primaryKey),++Me===dt?ve({result:Fe}):void Nt.continue()):ve({result:Fe})},Ne.onerror=Vr(Oe))})}),openCursor:function(Se){var ve=Se.trans,Oe=Se.values,Me=Se.query,Ne=Se.reverse,Fe=Se.unique;return new Promise(function(nt,dt){nt=Vt(nt);var pt=Me.index,tt=Me.range,ot=ve.objectStore(ye),ot=pt.isPrimaryKey?ot:ot.index(pt.name),pt=Ne?Fe?"prevunique":"prev":Fe?"nextunique":"next",it=!Oe&&"openKeyCursor"in ot?ot.openKeyCursor(x(tt),pt):ot.openCursor(x(tt),pt);it.onerror=Vr(dt),it.onsuccess=Vt(function(bt){var Nt,jt,Wt,Xn,Pt=it.result;Pt?(Pt.___id=++Gi,Pt.done=!1,Nt=Pt.continue.bind(Pt),jt=(jt=Pt.continuePrimaryKey)&&jt.bind(Pt),Wt=Pt.advance.bind(Pt),Xn=function(){throw new Error("Cursor not stopped")},Pt.trans=ve,Pt.stop=Pt.continue=Pt.continuePrimaryKey=Pt.advance=function(){throw new Error("Cursor not started")},Pt.fail=Vt(dt),Pt.next=function(){var Pn=this,Rn=1;return this.start(function(){return Rn--?Pn.continue():Pn.stop()}).then(function(){return Pn})},Pt.start=function(Pn){function Rn(){if(it.result)try{Pn()}catch(zn){Pt.fail(zn)}else Pt.done=!0,Pt.start=function(){throw new Error("Cursor behind last entry")},Pt.stop()}var Co=new Promise(function(zn,Sa){zn=Vt(zn),it.onerror=Vr(Sa),Pt.fail=Sa,Pt.stop=function(vl){Pt.stop=Pt.continue=Pt.continuePrimaryKey=Pt.advance=Xn,zn(vl)}});return it.onsuccess=Vt(function(zn){it.onsuccess=Rn,Rn()}),Pt.continue=Nt,Pt.continuePrimaryKey=jt,Pt.advance=Wt,Rn(),Co},nt(Pt)):nt(null)},dt)})},count:function(Se){var ve=Se.query,Oe=Se.trans,Me=ve.index,Ne=ve.range;return new Promise(function(Fe,nt){var dt=Oe.objectStore(ye),tt=Me.isPrimaryKey?dt:dt.index(Me.name),dt=x(Ne),tt=dt?tt.count(dt):tt.count();tt.onsuccess=Vt(function(ot){return Fe(ot.target.result)}),tt.onerror=Vr(nt)})}}}var M,K,te,ue=(K=pe,te=yi((M=f).objectStoreNames),{schema:{name:M.name,tables:te.map(function(me){return K.objectStore(me)}).map(function(me){var ce=me.keyPath,ve=me.autoIncrement,ye=s(ce),Se={},ve={name:me.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ce==null,compound:ye,keyPath:ce,autoIncrement:ve,unique:!0,extractKey:hl(ce)},indexes:yi(me.indexNames).map(function(Oe){return me.index(Oe)}).map(function(Fe){var Me=Fe.name,Ne=Fe.unique,nt=Fe.multiEntry,Fe=Fe.keyPath,nt={name:Me,compound:s(Fe),keyPath:Fe,unique:Ne,multiEntry:nt,extractKey:hl(Fe)};return Se[ao(Fe)]=nt}),getIndexByKeyPath:function(Oe){return Se[ao(Oe)]}};return Se[":id"]=ve.primaryKey,ce!=null&&(Se[ao(ce)]=ve.primaryKey),ve})},hasGetAll:0<te.length&&"getAll"in K.objectStore(te[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),pe=ue.schema,ge=ue.hasGetAll,ue=pe.tables.map(O),Q={};return ue.forEach(function(me){return Q[me.name]=me}),{stack:"dbcore",transaction:f.transaction.bind(f),table:function(me){if(!Q[me])throw new Error("Table '".concat(me,"' not found"));return Q[me]},MIN_KEY:-1/0,MAX_KEY:Ji(m),schema:pe}}function Em(f,m,w,x){var O=w.IDBKeyRange;return w.indexedDB,{dbcore:(x=km(m,O,x),f.dbcore.reduce(function(M,K){return K=K.create,r(r({},M),K(M))},x))}}function Qo(f,x){var w=x.db,x=Em(f._middlewares,w,f._deps,x);f.core=x.dbcore,f.tables.forEach(function(O){var M=O.name;f.core.schema.tables.some(function(K){return K.name===M})&&(O.core=f.core.table(M),f[M]instanceof f.Table&&(f[M].core=O.core))})}function es(f,m,w,x){w.forEach(function(O){var M=x[O];m.forEach(function(K){var te=function pe(ge,ue){return b(ge,ue)||(ge=u(ge))&&pe(ge,ue)}(K,O);(!te||"value"in te&&te.value===void 0)&&(K===f.Transaction.prototype||K instanceof f.Transaction?g(K,O,{get:function(){return this.table(O)},set:function(pe){h(this,O,{value:pe,writable:!0,configurable:!0,enumerable:!0})}}):K[O]=new f.Table(O,M))})})}function kl(f,m){m.forEach(function(w){for(var x in w)w[x]instanceof f.Table&&delete w[x]})}function Kf(f,m){return f._cfg.version-m._cfg.version}function xm(f,m,w,x){var O=f._dbSchema;w.objectStoreNames.contains("$meta")&&!O.$meta&&(O.$meta=Sl("$meta",cu("")[0],[]),f._storeNames.push("$meta"));var M=f._createTransaction("readwrite",f._storeNames,O);M.create(w),M._completion.catch(x);var K=M._reject.bind(M),te=we.transless||we;Lr(function(){return we.trans=M,we.transless=te,m!==0?(Qo(f,w),ge=m,((pe=M).storeNames.includes("$meta")?pe.table("$meta").get("version").then(function(ue){return ue??ge}):$e.resolve(ge)).then(function(ue){return me=ue,ce=M,ye=w,Se=[],ue=(Q=f)._versions,ve=Q._dbSchema=_i(0,Q.idbdb,ye),(ue=ue.filter(function(Oe){return Oe._cfg.version>=me})).length!==0?(ue.forEach(function(Oe){Se.push(function(){var Me=ve,Ne=Oe._cfg.dbschema;Fo(Q,Me,ye),Fo(Q,Ne,ye),ve=Q._dbSchema=Ne;var Fe=fs(Me,Ne);Fe.add.forEach(function(pt){ts(ye,pt[0],pt[1].primKey,pt[1].indexes)}),Fe.change.forEach(function(pt){if(pt.recreate)throw new Y.Upgrade("Not yet support for changing primary key");var it=ye.objectStore(pt.name);pt.add.forEach(function(bt){return Oo(it,bt)}),pt.change.forEach(function(bt){it.deleteIndex(bt.name),Oo(it,bt)}),pt.del.forEach(function(bt){return it.deleteIndex(bt)})});var nt=Oe._cfg.contentUpgrade;if(nt&&Oe._cfg.version>me){Qo(Q,ye),ce._memoizedTables={};var dt=I(Ne);Fe.del.forEach(function(pt){dt[pt]=Me[pt]}),kl(Q,[Q.Transaction.prototype]),es(Q,[Q.Transaction.prototype],o(dt),dt),ce.schema=dt;var tt,ot=ee(nt);return ot&&Yn(),Fe=$e.follow(function(){var pt;(tt=nt(ce))&&ot&&(pt=ar.bind(null,null),tt.then(pt,pt))}),tt&&typeof tt.then=="function"?$e.resolve(tt):Fe.then(function(){return tt})}}),Se.push(function(Me){var Ne,Fe,nt=Oe._cfg.dbschema;Ne=nt,Fe=Me,[].slice.call(Fe.db.objectStoreNames).forEach(function(dt){return Ne[dt]==null&&Fe.db.deleteObjectStore(dt)}),kl(Q,[Q.Transaction.prototype]),es(Q,[Q.Transaction.prototype],Q._storeNames,Q._dbSchema),ce.schema=Q._dbSchema}),Se.push(function(Me){Q.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(Q.idbdb.version/10)===Oe._cfg.version?(Q.idbdb.deleteObjectStore("$meta"),delete Q._dbSchema.$meta,Q._storeNames=Q._storeNames.filter(function(Ne){return Ne!=="$meta"})):Me.objectStore("$meta").put(Oe._cfg.version,"version"))})}),function Oe(){return Se.length?$e.resolve(Se.shift()(ce.idbtrans)).then(Oe):$e.resolve()}().then(function(){Wc(ve,ye)})):$e.resolve();var Q,me,ce,ye,Se,ve}).catch(K)):(o(O).forEach(function(ue){ts(w,ue,O[ue].primKey,O[ue].indexes)}),Qo(f,w),void $e.follow(function(){return f.on.populate.fire(M)}).catch(K));var pe,ge})}function ds(f,m){Wc(f._dbSchema,m),m.db.version%10!=0||m.objectStoreNames.contains("$meta")||m.db.createObjectStore("$meta").add(Math.ceil(m.db.version/10-1),"version");var w=_i(0,f.idbdb,m);Fo(f,f._dbSchema,m);for(var x=0,O=fs(w,f._dbSchema).change;x<O.length;x++){var M=function(K){if(K.change.length||K.recreate)return console.warn("Unable to patch indexes of table ".concat(K.name," because it has changes on the type of index or primary key.")),{value:void 0};var te=m.objectStore(K.name);K.add.forEach(function(pe){se&&console.debug("Dexie upgrade patch: Creating missing index ".concat(K.name,".").concat(pe.src)),Oo(te,pe)})}(O[x]);if(typeof M=="object")return M.value}}function fs(f,m){var w,x={del:[],add:[],change:[]};for(w in f)m[w]||x.del.push(w);for(w in m){var O=f[w],M=m[w];if(O){var K={name:w,def:M,recreate:!1,del:[],add:[],change:[]};if(""+(O.primKey.keyPath||"")!=""+(M.primKey.keyPath||"")||O.primKey.auto!==M.primKey.auto)K.recreate=!0,x.change.push(K);else{var te=O.idxByName,pe=M.idxByName,ge=void 0;for(ge in te)pe[ge]||K.del.push(ge);for(ge in pe){var ue=te[ge],Q=pe[ge];ue?ue.src!==Q.src&&K.change.push(Q):K.add.push(Q)}(0<K.del.length||0<K.add.length||0<K.change.length)&&x.change.push(K)}}else x.add.push([w,M])}return x}function ts(f,m,w,x){var O=f.db.createObjectStore(m,w.keyPath?{keyPath:w.keyPath,autoIncrement:w.auto}:{autoIncrement:w.auto});return x.forEach(function(M){return Oo(O,M)}),O}function Wc(f,m){o(f).forEach(function(w){m.db.objectStoreNames.contains(w)||(se&&console.debug("Dexie: Creating missing table",w),ts(m,w,f[w].primKey,f[w].indexes))})}function Oo(f,m){f.createIndex(m.name,m.keyPath,{unique:m.unique,multiEntry:m.multi})}function _i(f,m,w){var x={};return C(m.objectStoreNames,0).forEach(function(O){for(var M=w.objectStore(O),K=fl(vd(ge=M.keyPath),ge||"",!0,!1,!!M.autoIncrement,ge&&typeof ge!="string",!0),te=[],pe=0;pe<M.indexNames.length;++pe){var ue=M.index(M.indexNames[pe]),ge=ue.keyPath,ue=fl(ue.name,ge,!!ue.unique,!!ue.multiEntry,!1,ge&&typeof ge!="string",!1);te.push(ue)}x[O]=Sl(O,K,te)}),x}function Fo(f,m,w){for(var x=w.db.objectStoreNames,O=0;O<x.length;++O){var M=x[O],K=w.objectStore(M);f._hasGetAll="getAll"in K;for(var te=0;te<K.indexNames.length;++te){var pe=K.indexNames[te],ge=K.index(pe).keyPath,ue=typeof ge=="string"?ge:"["+C(ge).join("+")+"]";!m[M]||(ge=m[M].idxByName[ue])&&(ge.name=pe,delete m[M].idxByName[ue],m[M].idxByName[pe]=ge)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(f._hasGetAll=!1)}function cu(f){return f.split(",").map(function(m,w){var x=(m=m.trim()).replace(/([&*]|\+\+)/g,""),O=/^\[/.test(x)?x.match(/^\[(.*)\]$/)[1].split("+"):x;return fl(x,O||null,/\&/.test(m),/\*/.test(m),/\+\+/.test(m),s(O),w===0)})}var Gd=(lo.prototype._parseStoresSpec=function(f,m){o(f).forEach(function(w){if(f[w]!==null){var x=cu(f[w]),O=x.shift();if(O.unique=!0,O.multi)throw new Y.Schema("Primary key cannot be multi-valued");x.forEach(function(M){if(M.auto)throw new Y.Schema("Only primary key can be marked as autoIncrement (++)");if(!M.keyPath)throw new Y.Schema("Index must have a name and cannot be an empty string")}),m[w]=Sl(w,O,x)}})},lo.prototype.stores=function(w){var m=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,w):w;var w=m._versions,x={},O={};return w.forEach(function(M){l(x,M._cfg.storesSource),O=M._cfg.dbschema={},M._parseStoresSpec(x,O)}),m._dbSchema=O,kl(m,[m._allTables,m,m.Transaction.prototype]),es(m,[m._allTables,m,m.Transaction.prototype,this._cfg.tables],o(O),O),m._storeNames=o(O),this},lo.prototype.upgrade=function(f){return this._cfg.contentUpgrade=ne(this._cfg.contentUpgrade||Pe,f),this},lo);function lo(){}function $s(f,m){var w=f._dbNamesDB;return w||(w=f._dbNamesDB=new ea(ho,{addons:[],indexedDB:f,IDBKeyRange:m})).version(1).stores({dbnames:"name"}),w.table("dbnames")}function uo(f){return f&&typeof f.databases=="function"}function fi(f){return Lr(function(){return we.letThrough=!0,f()})}function Hs(f){return!("from"in f)}var Dn=function(f,m){if(!this){var w=new Dn;return f&&"d"in f&&l(w,f),w}l(this,arguments.length?{d:1,from:f,to:1<arguments.length?m:f}:{d:0})};function io(f,m,w){var x=Kt(m,w);if(!isNaN(x)){if(0<x)throw RangeError();if(Hs(f))return l(f,{from:m,to:w,d:1});var O=f.l,x=f.r;if(Kt(w,f.from)<0)return O?io(O,m,w):f.l={from:m,to:w,d:1,l:null,r:null},Ru(f);if(0<Kt(m,f.to))return x?io(x,m,w):f.r={from:m,to:w,d:1,l:null,r:null},Ru(f);Kt(m,f.from)<0&&(f.from=m,f.l=null,f.d=x?x.d+1:1),0<Kt(w,f.to)&&(f.to=w,f.r=null,f.d=f.l?f.l.d+1:1),w=!f.r,O&&!f.l&&Zi(f,O),x&&w&&Zi(f,x)}}function Zi(f,m){Hs(m)||function w(x,pe){var M=pe.from,K=pe.to,te=pe.l,pe=pe.r;io(x,M,K),te&&w(x,te),pe&&w(x,pe)}(f,m)}function pl(f,m){var w=_o(m),x=w.next();if(x.done)return!1;for(var O=x.value,M=_o(f),K=M.next(O.from),te=K.value;!x.done&&!K.done;){if(Kt(te.from,O.to)<=0&&0<=Kt(te.to,O.from))return!0;Kt(O.from,te.from)<0?O=(x=w.next(te.from)).value:te=(K=M.next(O.from)).value}return!1}function _o(f){var m=Hs(f)?null:{s:0,n:f};return{next:function(w){for(var x=0<arguments.length;m;)switch(m.s){case 0:if(m.s=1,x)for(;m.n.l&&Kt(w,m.n.from)<0;)m={up:m,n:m.n.l,s:1};else for(;m.n.l;)m={up:m,n:m.n.l,s:1};case 1:if(m.s=2,!x||Kt(w,m.n.to)<=0)return{value:m.n,done:!1};case 2:if(m.n.r){m.s=3,m={up:m,n:m.n.r,s:0};continue}case 3:m=m.up}return{done:!0}}}}function Ru(f){var m,w,x=(((m=f.r)===null||m===void 0?void 0:m.d)||0)-(((w=f.l)===null||w===void 0?void 0:w.d)||0),O=1<x?"r":x<-1?"l":"";O&&(m=O=="r"?"l":"r",w=r({},f),x=f[O],f.from=x.from,f.to=x.to,f[O]=x[O],w[O]=x[m],(f[m]=w).d=bi(w)),f.d=bi(f)}function bi(w){var m=w.r,w=w.l;return(m?w?Math.max(m.d,w.d):m.d:w?w.d:0)+1}function ki(f,m){return o(m).forEach(function(w){f[w]?Zi(f[w],m[w]):f[w]=function x(O){var M,K,te={};for(M in O)d(O,M)&&(K=O[M],te[M]=!K||typeof K!="object"||R.has(K.constructor)?K:x(K));return te}(m[w])}),f}function ns(f,m){return f.all||m.all||Object.keys(f).some(function(w){return m[w]&&pl(m[w],f[w])})}p(Dn.prototype,((er={add:function(f){return Zi(this,f),this},addKey:function(f){return io(this,f,f),this},addKeys:function(f){var m=this;return f.forEach(function(w){return io(m,w,w)}),this},hasKey:function(f){var m=_o(this).next(f).value;return m&&Kt(m.from,f)<=0&&0<=Kt(m.to,f)}})[N]=function(){return _o(this)},er));var Ca={},Io={},El=!1;function Bo(f){ki(Io,f),El||(El=!0,setTimeout(function(){El=!1,ml(Io,!(Io={}))},0))}function ml(f,m){m===void 0&&(m=!1);var w=new Set;if(f.all)for(var x=0,O=Object.values(Ca);x<O.length;x++)tc(K=O[x],f,w,m);else for(var M in f){var K,te=/^idb\:\/\/(.*)\/(.*)\//.exec(M);te&&(M=te[1],te=te[2],(K=Ca["idb://".concat(M,"/").concat(te)])&&tc(K,f,w,m))}w.forEach(function(pe){return pe()})}function tc(f,m,w,x){for(var O=[],M=0,K=Object.entries(f.queries.query);M<K.length;M++){for(var te=K[M],pe=te[0],ge=[],ue=0,Q=te[1];ue<Q.length;ue++){var me=Q[ue];ns(m,me.obsSet)?me.subscribers.forEach(function(ve){return w.add(ve)}):x&&ge.push(me)}x&&O.push([pe,ge])}if(x)for(var ce=0,ye=O;ce<ye.length;ce++){var Se=ye[ce],pe=Se[0],ge=Se[1];f.queries.query[pe]=ge}}function Yf(f){var m=f._state,w=f._deps.indexedDB;if(m.isBeingOpened||f.idbdb)return m.dbReadyPromise.then(function(){return m.dbOpenError?un(m.dbOpenError):f});m.isBeingOpened=!0,m.dbOpenError=null,m.openComplete=!1;var x=m.openCanceller,O=Math.round(10*f.verno),M=!1;function K(){if(m.openCanceller!==x)throw new Y.DatabaseClosed("db.open() was cancelled")}function te(){return new $e(function(me,ce){if(K(),!w)throw new Y.MissingAPI;var ye=f.name,Se=m.autoSchema||!O?w.open(ye):w.open(ye,O);if(!Se)throw new Y.MissingAPI;Se.onerror=Vr(ce),Se.onblocked=Vt(f._fireOnBlocked),Se.onupgradeneeded=Vt(function(ve){var Oe;ue=Se.transaction,m.autoSchema&&!f._options.allowEmptyDB?(Se.onerror=Wi,ue.abort(),Se.result.close(),(Oe=w.deleteDatabase(ye)).onsuccess=Oe.onerror=Vt(function(){ce(new Y.NoSuchDatabase("Database ".concat(ye," doesnt exist")))})):(ue.onerror=Vr(ce),ve=ve.oldVersion>Math.pow(2,62)?0:ve.oldVersion,Q=ve<1,f.idbdb=Se.result,M&&ds(f,ue),xm(f,ve/10,ue,ce))},ce),Se.onsuccess=Vt(function(){ue=null;var ve,Oe,Me,Ne,Fe,nt=f.idbdb=Se.result,dt=C(nt.objectStoreNames);if(0<dt.length)try{var tt=nt.transaction((Ne=dt).length===1?Ne[0]:Ne,"readonly");if(m.autoSchema)Oe=nt,Me=tt,(ve=f).verno=Oe.version/10,Me=ve._dbSchema=_i(0,Oe,Me),ve._storeNames=C(Oe.objectStoreNames,0),es(ve,[ve._allTables],o(Me),Me);else if(Fo(f,f._dbSchema,tt),((Fe=fs(_i(0,(Fe=f).idbdb,tt),Fe._dbSchema)).add.length||Fe.change.some(function(ot){return ot.add.length||ot.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."),nt.close(),O=nt.version+1,M=!0,me(te());Qo(f,tt)}catch{}wa.push(f),nt.onversionchange=Vt(function(ot){m.vcFired=!0,f.on("versionchange").fire(ot)}),nt.onclose=Vt(function(ot){f.on("close").fire(ot)}),Q&&(Fe=f._deps,tt=ye,nt=Fe.indexedDB,Fe=Fe.IDBKeyRange,uo(nt)||tt===ho||$s(nt,Fe).put({name:tt}).catch(Pe)),me()},ce)}).catch(function(me){switch(me==null?void 0:me.name){case"UnknownError":if(0<m.PR1398_maxLoop)return m.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),te();break;case"VersionError":if(0<O)return O=0,te()}return $e.reject(me)})}var pe,ge=m.dbReadyResolve,ue=null,Q=!1;return $e.race([x,(typeof navigator>"u"?$e.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(me){function ce(){return indexedDB.databases().finally(me)}pe=setInterval(ce,100),ce()}).finally(function(){return clearInterval(pe)}):Promise.resolve()).then(te)]).then(function(){return K(),m.onReadyBeingFired=[],$e.resolve(fi(function(){return f.on.ready.fire(f.vip)})).then(function me(){if(0<m.onReadyBeingFired.length){var ce=m.onReadyBeingFired.reduce(ne,Pe);return m.onReadyBeingFired=[],$e.resolve(fi(function(){return ce(f.vip)})).then(me)}})}).finally(function(){m.openCanceller===x&&(m.onReadyBeingFired=null,m.isBeingOpened=!1)}).catch(function(me){m.dbOpenError=me;try{ue&&ue.abort()}catch{}return x===m.openCanceller&&f._close(),un(me)}).finally(function(){m.openComplete=!0,ge()}).then(function(){var me;return Q&&(me={},f.tables.forEach(function(ce){ce.schema.indexes.forEach(function(ye){ye.name&&(me["idb://".concat(f.name,"/").concat(ce.name,"/").concat(ye.name)]=new Dn(-1/0,[[[]]]))}),me["idb://".concat(f.name,"/").concat(ce.name,"/")]=me["idb://".concat(f.name,"/").concat(ce.name,"/:dels")]=new Dn(-1/0,[[[]]])}),pa(ro).fire(me),ml(me,!0)),f})}function hs(f){function m(M){return f.next(M)}var w=O(m),x=O(function(M){return f.throw(M)});function O(M){return function(pe){var te=M(pe),pe=te.value;return te.done?pe:pe&&typeof pe.then=="function"?pe.then(w,x):s(pe)?Promise.all(pe).then(w,x):w(pe)}}return O(m)()}function rs(f,m,w){for(var x=s(f)?f.slice():[f],O=0;O<w;++O)x.push(m);return x}var bf={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(f){return r(r({},f),{table:function(m){var w=f.table(m),x=w.schema,O={},M=[];function K(Q,me,ce){var ye=ao(Q),Se=O[ye]=O[ye]||[],ve=Q==null?0:typeof Q=="string"?1:Q.length,Oe=0<me,Oe=r(r({},ce),{name:Oe?"".concat(ye,"(virtual-from:").concat(ce.name,")"):ce.name,lowLevelIndex:ce,isVirtual:Oe,keyTail:me,keyLength:ve,extractKey:hl(Q),unique:!Oe&&ce.unique});return Se.push(Oe),Oe.isPrimaryKey||M.push(Oe),1<ve&&K(ve===2?Q[0]:Q.slice(0,ve-1),me+1,ce),Se.sort(function(Me,Ne){return Me.keyTail-Ne.keyTail}),Oe}m=K(x.primaryKey.keyPath,0,x.primaryKey),O[":id"]=[m];for(var te=0,pe=x.indexes;te<pe.length;te++){var ge=pe[te];K(ge.keyPath,0,ge)}function ue(Q){var me,ce=Q.query.index;return ce.isVirtual?r(r({},Q),{query:{index:ce.lowLevelIndex,range:(me=Q.query.range,ce=ce.keyTail,{type:me.type===1?2:me.type,lower:rs(me.lower,me.lowerOpen?f.MAX_KEY:f.MIN_KEY,ce),lowerOpen:!0,upper:rs(me.upper,me.upperOpen?f.MIN_KEY:f.MAX_KEY,ce),upperOpen:!0})}}):Q}return r(r({},w),{schema:r(r({},x),{primaryKey:m,indexes:M,getIndexByKeyPath:function(Q){return(Q=O[ao(Q)])&&Q[0]}}),count:function(Q){return w.count(ue(Q))},query:function(Q){return w.query(ue(Q))},openCursor:function(Q){var me=Q.query.index,ce=me.keyTail,ye=me.isVirtual,Se=me.keyLength;return ye?w.openCursor(ue(Q)).then(function(Oe){return Oe&&ve(Oe)}):w.openCursor(Q);function ve(Oe){return Object.create(Oe,{continue:{value:function(Me){Me!=null?Oe.continue(rs(Me,Q.reverse?f.MAX_KEY:f.MIN_KEY,ce)):Q.unique?Oe.continue(Oe.key.slice(0,Se).concat(Q.reverse?f.MIN_KEY:f.MAX_KEY,ce)):Oe.continue()}},continuePrimaryKey:{value:function(Me,Ne){Oe.continuePrimaryKey(rs(Me,f.MAX_KEY,ce),Ne)}},primaryKey:{get:function(){return Oe.primaryKey}},key:{get:function(){var Me=Oe.key;return Se===1?Me[0]:Me.slice(0,Se)}},value:{get:function(){return Oe.value}}})}}})}})}};function gl(f,m,w,x){return w=w||{},x=x||"",o(f).forEach(function(O){var M,K,te;d(m,O)?(M=f[O],K=m[O],typeof M=="object"&&typeof K=="object"&&M&&K?(te=V(M))!==V(K)?w[x+O]=m[O]:te==="Object"?gl(M,K,w,x+O+"."):M!==K&&(w[x+O]=m[O]):M!==K&&(w[x+O]=m[O])):w[x+O]=void 0}),o(m).forEach(function(O){d(f,O)||(w[x+O]=m[O])}),w}function js(f,m){return m.type==="delete"?m.keys:m.keys||m.values.map(f.extractKey)}var xh={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(f){return r(r({},f),{table:function(m){var w=f.table(m),x=w.schema.primaryKey;return r(r({},w),{mutate:function(O){var M=we.trans,K=M.table(m).hook,te=K.deleting,pe=K.creating,ge=K.updating;switch(O.type){case"add":if(pe.fire===Pe)break;return M._promise("readwrite",function(){return ue(O)},!0);case"put":if(pe.fire===Pe&&ge.fire===Pe)break;return M._promise("readwrite",function(){return ue(O)},!0);case"delete":if(te.fire===Pe)break;return M._promise("readwrite",function(){return ue(O)},!0);case"deleteRange":if(te.fire===Pe)break;return M._promise("readwrite",function(){return function Q(me,ce,ye){return w.query({trans:me,values:!1,query:{index:x,range:ce},limit:ye}).then(function(Se){var ve=Se.result;return ue({type:"delete",keys:ve,trans:me}).then(function(Oe){return 0<Oe.numFailures?Promise.reject(Oe.failures[0]):ve.length<ye?{failures:[],numFailures:0,lastResult:void 0}:Q(me,r(r({},ce),{lower:ve[ve.length-1],lowerOpen:!0}),ye)})})}(O.trans,O.range,1e4)},!0)}return w.mutate(O);function ue(Q){var me,ce,ye,Se=we.trans,ve=Q.keys||js(x,Q);if(!ve)throw new Error("Keys missing");return(Q=Q.type==="add"||Q.type==="put"?r(r({},Q),{keys:ve}):r({},Q)).type!=="delete"&&(Q.values=a([],Q.values)),Q.keys&&(Q.keys=a([],Q.keys)),me=w,ye=ve,((ce=Q).type==="add"?Promise.resolve([]):me.getMany({trans:ce.trans,keys:ye,cache:"immutable"})).then(function(Oe){var Me=ve.map(function(Ne,Fe){var nt,dt,tt,ot=Oe[Fe],pt={onerror:null,onsuccess:null};return Q.type==="delete"?te.fire.call(pt,Ne,ot,Se):Q.type==="add"||ot===void 0?(nt=pe.fire.call(pt,Ne,Q.values[Fe],Se),Ne==null&&nt!=null&&(Q.keys[Fe]=Ne=nt,x.outbound||E(Q.values[Fe],x.keyPath,Ne))):(nt=gl(ot,Q.values[Fe]),(dt=ge.fire.call(pt,nt,Ne,ot,Se))&&(tt=Q.values[Fe],Object.keys(dt).forEach(function(it){d(tt,it)?tt[it]=dt[it]:E(tt,it,dt[it])}))),pt});return w.mutate(Q).then(function(Ne){for(var Fe=Ne.failures,nt=Ne.results,dt=Ne.numFailures,Ne=Ne.lastResult,tt=0;tt<ve.length;++tt){var ot=(nt||ve)[tt],pt=Me[tt];ot==null?pt.onerror&&pt.onerror(Fe[tt]):pt.onsuccess&&pt.onsuccess(Q.type==="put"&&Oe[tt]?Q.values[tt]:ot)}return{failures:Fe,results:nt,numFailures:dt,lastResult:Ne}}).catch(function(Ne){return Me.forEach(function(Fe){return Fe.onerror&&Fe.onerror(Ne)}),Promise.reject(Ne)})})}}})}})}};function Gc(f,m,w){try{if(!m||m.keys.length<f.length)return null;for(var x=[],O=0,M=0;O<m.keys.length&&M<f.length;++O)Kt(m.keys[O],f[M])===0&&(x.push(w?P(m.values[O]):m.values[O]),++M);return x.length===f.length?x:null}catch{return null}}var Np={stack:"dbcore",level:-1,create:function(f){return{table:function(m){var w=f.table(m);return r(r({},w),{getMany:function(x){if(!x.cache)return w.getMany(x);var O=Gc(x.keys,x.trans._cache,x.cache==="clone");return O?$e.resolve(O):w.getMany(x).then(function(M){return x.trans._cache={keys:x.keys,values:x.cache==="clone"?P(M):M},M})},mutate:function(x){return x.type!=="add"&&(x.trans._cache=null),w.mutate(x)}})}}}};function du(f,m){return f.trans.mode==="readonly"&&!!f.subscr&&!f.trans.explicit&&f.trans.db._options.cache!=="disabled"&&!m.schema.primaryKey.outbound}function nc(f,m){switch(f){case"query":return m.values&&!m.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Tm={stack:"dbcore",level:0,name:"Observability",create:function(f){var m=f.schema.name,w=new Dn(f.MIN_KEY,f.MAX_KEY);return r(r({},f),{transaction:function(x,O,M){if(we.subscr&&O!=="readonly")throw new Y.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(we.querier));return f.transaction(x,O,M)},table:function(x){var O=f.table(x),M=O.schema,K=M.primaryKey,Q=M.indexes,te=K.extractKey,pe=K.outbound,ge=K.autoIncrement&&Q.filter(function(ce){return ce.compound&&ce.keyPath.includes(K.keyPath)}),ue=r(r({},O),{mutate:function(ce){function ye(it){return it="idb://".concat(m,"/").concat(x,"/").concat(it),Ne[it]||(Ne[it]=new Dn)}var Se,ve,Oe,Me=ce.trans,Ne=ce.mutatedParts||(ce.mutatedParts={}),Fe=ye(""),nt=ye(":dels"),dt=ce.type,pt=ce.type==="deleteRange"?[ce.range]:ce.type==="delete"?[ce.keys]:ce.values.length<50?[js(K,ce).filter(function(it){return it}),ce.values]:[],tt=pt[0],ot=pt[1],pt=ce.trans._cache;return s(tt)?(Fe.addKeys(tt),(pt=dt==="delete"||tt.length===ot.length?Gc(tt,pt):null)||nt.addKeys(tt),(pt||ot)&&(Se=ye,ve=pt,Oe=ot,M.indexes.forEach(function(it){var bt=Se(it.name||"");function Nt(Wt){return Wt!=null?it.extractKey(Wt):null}function jt(Wt){return it.multiEntry&&s(Wt)?Wt.forEach(function(Xn){return bt.addKey(Xn)}):bt.addKey(Wt)}(ve||Oe).forEach(function(Wt,Pn){var Pt=ve&&Nt(ve[Pn]),Pn=Oe&&Nt(Oe[Pn]);Kt(Pt,Pn)!==0&&(Pt!=null&&jt(Pt),Pn!=null&&jt(Pn))})}))):tt?(ot={from:(ot=tt.lower)!==null&&ot!==void 0?ot:f.MIN_KEY,to:(ot=tt.upper)!==null&&ot!==void 0?ot:f.MAX_KEY},nt.add(ot),Fe.add(ot)):(Fe.add(w),nt.add(w),M.indexes.forEach(function(it){return ye(it.name).add(w)})),O.mutate(ce).then(function(it){return!tt||ce.type!=="add"&&ce.type!=="put"||(Fe.addKeys(it.results),ge&&ge.forEach(function(bt){for(var Nt=ce.values.map(function(Pt){return bt.extractKey(Pt)}),jt=bt.keyPath.findIndex(function(Pt){return Pt===K.keyPath}),Wt=0,Xn=it.results.length;Wt<Xn;++Wt)Nt[Wt][jt]=it.results[Wt];ye(bt.name).addKeys(Nt)})),Me.mutatedParts=ki(Me.mutatedParts||{},Ne),it})}}),Q=function(ye){var Se=ye.query,ye=Se.index,Se=Se.range;return[ye,new Dn((ye=Se.lower)!==null&&ye!==void 0?ye:f.MIN_KEY,(Se=Se.upper)!==null&&Se!==void 0?Se:f.MAX_KEY)]},me={get:function(ce){return[K,new Dn(ce.key)]},getMany:function(ce){return[K,new Dn().addKeys(ce.keys)]},count:Q,query:Q,openCursor:Q};return o(me).forEach(function(ce){ue[ce]=function(ye){var Se=we.subscr,ve=!!Se,Oe=du(we,O)&&nc(ce,ye)?ye.obsSet={}:Se;if(ve){var Me=function(ot){return ot="idb://".concat(m,"/").concat(x,"/").concat(ot),Oe[ot]||(Oe[ot]=new Dn)},Ne=Me(""),Fe=Me(":dels"),Se=me[ce](ye),ve=Se[0],Se=Se[1];if((ce==="query"&&ve.isPrimaryKey&&!ye.values?Fe:Me(ve.name||"")).add(Se),!ve.isPrimaryKey){if(ce!=="count"){var nt=ce==="query"&&pe&&ye.values&&O.query(r(r({},ye),{values:!1}));return O[ce].apply(this,arguments).then(function(ot){if(ce==="query"){if(pe&&ye.values)return nt.then(function(Nt){return Nt=Nt.result,Ne.addKeys(Nt),ot});var pt=ye.values?ot.result.map(te):ot.result;(ye.values?Ne:Fe).addKeys(pt)}else if(ce==="openCursor"){var it=ot,bt=ye.values;return it&&Object.create(it,{key:{get:function(){return Fe.addKey(it.primaryKey),it.key}},primaryKey:{get:function(){var Nt=it.primaryKey;return Fe.addKey(Nt),Nt}},value:{get:function(){return bt&&Ne.addKey(it.primaryKey),it.value}}})}return ot})}Fe.add(w)}}return O[ce].apply(this,arguments)}}),ue}})}};function qc(f,m,w){if(w.numFailures===0)return m;if(m.type==="deleteRange")return null;var x=m.keys?m.keys.length:"values"in m&&m.values?m.values.length:1;return w.numFailures===x?null:(m=r({},m),s(m.keys)&&(m.keys=m.keys.filter(function(O,M){return!(M in w.failures)})),"values"in m&&s(m.values)&&(m.values=m.values.filter(function(O,M){return!(M in w.failures)})),m)}function qi(f,m){return w=f,((x=m).lower===void 0||(x.lowerOpen?0<Kt(w,x.lower):0<=Kt(w,x.lower)))&&(f=f,(m=m).upper===void 0||(m.upperOpen?Kt(f,m.upper)<0:Kt(f,m.upper)<=0));var w,x}function rc(f,m,me,x,O,M){if(!me||me.length===0)return f;var K=m.query.index,te=K.multiEntry,pe=m.query.range,ge=x.schema.primaryKey.extractKey,ue=K.extractKey,Q=(K.lowLevelIndex||K).extractKey,me=me.reduce(function(ce,ye){var Se=ce,ve=[];if(ye.type==="add"||ye.type==="put")for(var Oe=new Dn,Me=ye.values.length-1;0<=Me;--Me){var Ne,Fe=ye.values[Me],nt=ge(Fe);Oe.hasKey(nt)||(Ne=ue(Fe),(te&&s(Ne)?Ne.some(function(it){return qi(it,pe)}):qi(Ne,pe))&&(Oe.addKey(nt),ve.push(Fe)))}switch(ye.type){case"add":var dt=new Dn().addKeys(m.values?ce.map(function(bt){return ge(bt)}):ce),Se=ce.concat(m.values?ve.filter(function(bt){return bt=ge(bt),!dt.hasKey(bt)&&(dt.addKey(bt),!0)}):ve.map(function(bt){return ge(bt)}).filter(function(bt){return!dt.hasKey(bt)&&(dt.addKey(bt),!0)}));break;case"put":var tt=new Dn().addKeys(ye.values.map(function(bt){return ge(bt)}));Se=ce.filter(function(bt){return!tt.hasKey(m.values?ge(bt):bt)}).concat(m.values?ve:ve.map(function(bt){return ge(bt)}));break;case"delete":var ot=new Dn().addKeys(ye.keys);Se=ce.filter(function(bt){return!ot.hasKey(m.values?ge(bt):bt)});break;case"deleteRange":var pt=ye.range;Se=ce.filter(function(bt){return!qi(ge(bt),pt)})}return Se},f);return me===f?f:(me.sort(function(ce,ye){return Kt(Q(ce),Q(ye))||Kt(ge(ce),ge(ye))}),m.limit&&m.limit<1/0&&(me.length>m.limit?me.length=m.limit:f.length===m.limit&&me.length<m.limit&&(O.dirty=!0)),M?Object.freeze(me):me)}function Ul(f,m){return Kt(f.lower,m.lower)===0&&Kt(f.upper,m.upper)===0&&!!f.lowerOpen==!!m.lowerOpen&&!!f.upperOpen==!!m.upperOpen}function Lp(f,m){return function(w,x,O,M){if(w===void 0)return x!==void 0?-1:0;if(x===void 0)return 1;if((x=Kt(w,x))===0){if(O&&M)return 0;if(O)return 1;if(M)return-1}return x}(f.lower,m.lower,f.lowerOpen,m.lowerOpen)<=0&&0<=function(w,x,O,M){if(w===void 0)return x!==void 0?1:0;if(x===void 0)return-1;if((x=Kt(w,x))===0){if(O&&M)return 0;if(O)return-1;if(M)return 1}return x}(f.upper,m.upper,f.upperOpen,m.upperOpen)}function Fp(f,m,w,x){f.subscribers.add(w),x.addEventListener("abort",function(){var O,M;f.subscribers.delete(w),f.subscribers.size===0&&(O=f,M=m,setTimeout(function(){O.subscribers.size===0&&J(M,O)},3e3))})}var Bp={stack:"dbcore",level:0,name:"Cache",create:function(f){var m=f.schema.name;return r(r({},f),{transaction:function(w,x,O){var M,K,te=f.transaction(w,x,O);return x==="readwrite"&&(K=(M=new AbortController).signal,O=function(pe){return function(){if(M.abort(),x==="readwrite"){for(var ge=new Set,ue=0,Q=w;ue<Q.length;ue++){var me=Q[ue],ce=Ca["idb://".concat(m,"/").concat(me)];if(ce){var ye=f.table(me),Se=ce.optimisticOps.filter(function(bt){return bt.trans===te});if(te._explicit&&pe&&te.mutatedParts)for(var ve=0,Oe=Object.values(ce.queries.query);ve<Oe.length;ve++)for(var Me=0,Ne=(dt=Oe[ve]).slice();Me<Ne.length;Me++)ns((tt=Ne[Me]).obsSet,te.mutatedParts)&&(J(dt,tt),tt.subscribers.forEach(function(bt){return ge.add(bt)}));else if(0<Se.length){ce.optimisticOps=ce.optimisticOps.filter(function(bt){return bt.trans!==te});for(var Fe=0,nt=Object.values(ce.queries.query);Fe<nt.length;Fe++)for(var dt,tt,ot,pt=0,it=(dt=nt[Fe]).slice();pt<it.length;pt++)(tt=it[pt]).res!=null&&te.mutatedParts&&(pe&&!tt.dirty?(ot=Object.isFrozen(tt.res),ot=rc(tt.res,tt.req,Se,ye,tt,ot),tt.dirty?(J(dt,tt),tt.subscribers.forEach(function(bt){return ge.add(bt)})):ot!==tt.res&&(tt.res=ot,tt.promise=$e.resolve({result:ot}))):(tt.dirty&&J(dt,tt),tt.subscribers.forEach(function(bt){return ge.add(bt)})))}}}ge.forEach(function(bt){return bt()})}}},te.addEventListener("abort",O(!1),{signal:K}),te.addEventListener("error",O(!1),{signal:K}),te.addEventListener("complete",O(!0),{signal:K})),te},table:function(w){var x=f.table(w),O=x.schema.primaryKey;return r(r({},x),{mutate:function(M){var K=we.trans;if(O.outbound||K.db._options.cache==="disabled"||K.explicit||K.idbtrans.mode!=="readwrite")return x.mutate(M);var te=Ca["idb://".concat(m,"/").concat(w)];return te?(K=x.mutate(M),M.type!=="add"&&M.type!=="put"||!(50<=M.values.length||js(O,M).some(function(pe){return pe==null}))?(te.optimisticOps.push(M),M.mutatedParts&&Bo(M.mutatedParts),K.then(function(pe){0<pe.numFailures&&(J(te.optimisticOps,M),(pe=qc(0,M,pe))&&te.optimisticOps.push(pe),M.mutatedParts&&Bo(M.mutatedParts))}),K.catch(function(){J(te.optimisticOps,M),M.mutatedParts&&Bo(M.mutatedParts)})):K.then(function(pe){var ge=qc(0,r(r({},M),{values:M.values.map(function(ue,Q){var me;return pe.failures[Q]||(ue=(me=O.keyPath)!==null&&me!==void 0&&me.includes(".")?P(ue):r({},ue),E(ue,O.keyPath,pe.results[Q])),ue})}),pe);te.optimisticOps.push(ge),queueMicrotask(function(){return M.mutatedParts&&Bo(M.mutatedParts)})}),K):x.mutate(M)},query:function(M){if(!du(we,x)||!nc("query",M))return x.query(M);var K=((ge=we.trans)===null||ge===void 0?void 0:ge.db._options.cache)==="immutable",Q=we,te=Q.requery,pe=Q.signal,ge=function(ye,Se,ve,Oe){var Me=Ca["idb://".concat(ye,"/").concat(Se)];if(!Me)return[];if(!(Se=Me.queries[ve]))return[null,!1,Me,null];var Ne=Se[(Oe.query?Oe.query.index.name:null)||""];if(!Ne)return[null,!1,Me,null];switch(ve){case"query":var Fe=Ne.find(function(nt){return nt.req.limit===Oe.limit&&nt.req.values===Oe.values&&Ul(nt.req.query.range,Oe.query.range)});return Fe?[Fe,!0,Me,Ne]:[Ne.find(function(nt){return("limit"in nt.req?nt.req.limit:1/0)>=Oe.limit&&(!Oe.values||nt.req.values)&&Lp(nt.req.query.range,Oe.query.range)}),!1,Me,Ne];case"count":return Fe=Ne.find(function(nt){return Ul(nt.req.query.range,Oe.query.range)}),[Fe,!!Fe,Me,Ne]}}(m,w,"query",M),ue=ge[0],Q=ge[1],me=ge[2],ce=ge[3];return ue&&Q?ue.obsSet=M.obsSet:(Q=x.query(M).then(function(ye){var Se=ye.result;if(ue&&(ue.res=Se),K){for(var ve=0,Oe=Se.length;ve<Oe;++ve)Object.freeze(Se[ve]);Object.freeze(Se)}else ye.result=P(Se);return ye}).catch(function(ye){return ce&&ue&&J(ce,ue),Promise.reject(ye)}),ue={obsSet:M.obsSet,promise:Q,subscribers:new Set,type:"query",req:M,dirty:!1},ce?ce.push(ue):(ce=[ue],(me=me||(Ca["idb://".concat(m,"/").concat(w)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[M.query.index.name||""]=ce)),Fp(ue,ce,te,pe),ue.promise.then(function(ye){return{result:rc(ye.result,M,me==null?void 0:me.optimisticOps,x,ue,K)}})}})}})}};function as(f,m){return new Proxy(f,{get:function(w,x,O){return x==="db"?m:Reflect.get(w,x,O)}})}var ea=(bn.prototype.version=function(f){if(isNaN(f)||f<.1)throw new Y.Type("Given version is not a positive number");if(f=Math.round(10*f)/10,this.idbdb||this._state.isBeingOpened)throw new Y.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,f);var m=this._versions,w=m.filter(function(x){return x._cfg.version===f})[0];return w||(w=new this.Version(f),m.push(w),m.sort(Kf),w.stores({}),this._state.autoSchema=!1,w)},bn.prototype._whenReady=function(f){var m=this;return this.idbdb&&(this._state.openComplete||we.letThrough||this._vip)?f():new $e(function(w,x){if(m._state.openComplete)return x(new Y.DatabaseClosed(m._state.dbOpenError));if(!m._state.isBeingOpened){if(!m._state.autoOpen)return void x(new Y.DatabaseClosed);m.open().catch(Pe)}m._state.dbReadyPromise.then(w,x)}).then(f)},bn.prototype.use=function(f){var m=f.stack,w=f.create,x=f.level,O=f.name;return O&&this.unuse({stack:m,name:O}),f=this._middlewares[m]||(this._middlewares[m]=[]),f.push({stack:m,create:w,level:x??10,name:O}),f.sort(function(M,K){return M.level-K.level}),this},bn.prototype.unuse=function(f){var m=f.stack,w=f.name,x=f.create;return m&&this._middlewares[m]&&(this._middlewares[m]=this._middlewares[m].filter(function(O){return x?O.create!==x:!!w&&O.name!==w})),this},bn.prototype.open=function(){var f=this;return or(le,function(){return Yf(f)})},bn.prototype._close=function(){var f=this._state,m=wa.indexOf(this);if(0<=m&&wa.splice(m,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}f.isBeingOpened||(f.dbReadyPromise=new $e(function(w){f.dbReadyResolve=w}),f.openCanceller=new $e(function(w,x){f.cancelOpen=x}))},bn.prototype.close=function(w){var m=(w===void 0?{disableAutoOpen:!0}:w).disableAutoOpen,w=this._state;m?(w.isBeingOpened&&w.cancelOpen(new Y.DatabaseClosed),this._close(),w.autoOpen=!1,w.dbOpenError=new Y.DatabaseClosed):(this._close(),w.autoOpen=this._options.autoOpen||w.isBeingOpened,w.openComplete=!1,w.dbOpenError=null)},bn.prototype.delete=function(f){var m=this;f===void 0&&(f={disableAutoOpen:!0});var w=0<arguments.length&&typeof arguments[0]!="object",x=this._state;return new $e(function(O,M){function K(){m.close(f);var te=m._deps.indexedDB.deleteDatabase(m.name);te.onsuccess=Vt(function(){var pe,ge,ue;pe=m._deps,ge=m.name,ue=pe.indexedDB,pe=pe.IDBKeyRange,uo(ue)||ge===ho||$s(ue,pe).delete(ge).catch(Pe),O()}),te.onerror=Vr(M),te.onblocked=m._fireOnBlocked}if(w)throw new Y.InvalidArgument("Invalid closeOptions argument to db.delete()");x.isBeingOpened?x.dbReadyPromise.then(K):K()})},bn.prototype.backendDB=function(){return this.idbdb},bn.prototype.isOpen=function(){return this.idbdb!==null},bn.prototype.hasBeenClosed=function(){var f=this._state.dbOpenError;return f&&f.name==="DatabaseClosed"},bn.prototype.hasFailed=function(){return this._state.dbOpenError!==null},bn.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(bn.prototype,"tables",{get:function(){var f=this;return o(this._allTables).map(function(m){return f._allTables[m]})},enumerable:!1,configurable:!0}),bn.prototype.transaction=function(){var f=(function(m,w,x){var O=arguments.length;if(O<2)throw new Y.InvalidArgument("Too few arguments");for(var M=new Array(O-1);--O;)M[O-1]=arguments[O];return x=M.pop(),[m,A(M),x]}).apply(this,arguments);return this._transaction.apply(this,f)},bn.prototype._transaction=function(f,m,w){var x=this,O=we.trans;O&&O.db===this&&f.indexOf("!")===-1||(O=null);var M,K,te=f.indexOf("?")!==-1;f=f.replace("!","").replace("?","");try{if(K=m.map(function(ge){if(ge=ge instanceof x.Table?ge.name:ge,typeof ge!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return ge}),f=="r"||f===Xs)M=Xs;else{if(f!="rw"&&f!=Qs)throw new Y.InvalidArgument("Invalid transaction mode: "+f);M=Qs}if(O){if(O.mode===Xs&&M===Qs){if(!te)throw new Y.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");O=null}O&&K.forEach(function(ge){if(O&&O.storeNames.indexOf(ge)===-1){if(!te)throw new Y.SubTransaction("Table "+ge+" not included in parent transaction.");O=null}}),te&&O&&!O.active&&(O=null)}}catch(ge){return O?O._promise(null,function(ue,Q){Q(ge)}):un(ge)}var pe=(function ge(ue,Q,me,ce,ye){return $e.resolve().then(function(){var Se=we.transless||we,ve=ue._createTransaction(Q,me,ue._dbSchema,ce);if(ve.explicit=!0,Se={trans:ve,transless:Se},ce)ve.idbtrans=ce.idbtrans;else try{ve.create(),ve.idbtrans._explicit=!0,ue._state.PR1398_maxLoop=3}catch(Ne){return Ne.name===ae.InvalidState&&ue.isOpen()&&0<--ue._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ue.close({disableAutoOpen:!1}),ue.open().then(function(){return ge(ue,Q,me,null,ye)})):un(Ne)}var Oe,Me=ee(ye);return Me&&Yn(),Se=$e.follow(function(){var Ne;(Oe=ye.call(ve,ve))&&(Me?(Ne=ar.bind(null,null),Oe.then(Ne,Ne)):typeof Oe.next=="function"&&typeof Oe.throw=="function"&&(Oe=hs(Oe)))},Se),(Oe&&typeof Oe.then=="function"?$e.resolve(Oe).then(function(Ne){return ve.active?Ne:un(new Y.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):Se.then(function(){return Oe})).then(function(Ne){return ce&&ve._resolve(),ve._completion.then(function(){return Ne})}).catch(function(Ne){return ve._reject(Ne),un(Ne)})})}).bind(null,this,M,K,O,w);return O?O._promise(M,pe,"lock"):we.trans?or(we.transless,function(){return x._whenReady(pe)}):this._whenReady(pe)},bn.prototype.table=function(f){if(!d(this._allTables,f))throw new Y.InvalidTable("Table ".concat(f," does not exist"));return this._allTables[f]},bn);function bn(f,m){var w=this;this._middlewares={},this.verno=0;var x=bn.dependencies;this._options=m=r({addons:bn.addons,autoOpen:!0,indexedDB:x.indexedDB,IDBKeyRange:x.IDBKeyRange,cache:"cloned"},m),this._deps={indexedDB:m.indexedDB,IDBKeyRange:m.IDBKeyRange},x=m.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var O,M,K,te,pe,ge={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Pe,dbReadyPromise:null,cancelOpen:Pe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:m.autoOpen};ge.dbReadyPromise=new $e(function(Q){ge.dbReadyResolve=Q}),ge.openCanceller=new $e(function(Q,me){ge.cancelOpen=me}),this._state=ge,this.name=f,this.on=wi(this,"populate","blocked","versionchange","close",{ready:[ne,Pe]}),this.on.ready.subscribe=S(this.on.ready.subscribe,function(Q){return function(me,ce){bn.vip(function(){var ye,Se=w._state;Se.openComplete?(Se.dbOpenError||$e.resolve().then(me),ce&&Q(me)):Se.onReadyBeingFired?(Se.onReadyBeingFired.push(me),ce&&Q(me)):(Q(me),ye=w,ce||Q(function ve(){ye.on.ready.unsubscribe(me),ye.on.ready.unsubscribe(ve)}))})}}),this.Collection=(O=this,ji(Wd.prototype,function(Oe,ve){this.db=O;var ce=Uc,ye=null;if(ve)try{ce=ve()}catch(Me){ye=Me}var Se=Oe._ctx,ve=Se.table,Oe=ve.hook.reading.fire;this._ctx={table:ve,index:Se.index,isPrimKey:!Se.index||ve.schema.primKey.keyPath&&Se.index===ve.schema.primKey.name,range:ce,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:ye,or:Se.or,valueMapper:Oe!==Te?Oe:null}})),this.Table=(M=this,ji(Vl.prototype,function(Q,me,ce){this.db=M,this._tx=ce,this.name=Q,this.schema=me,this.hook=M._allTables[Q]?M._allTables[Q].hook:wi(null,{creating:[Je,Pe],reading:[Ae,Te],updating:[Ye,Pe],deleting:[We,Pe]})})),this.Transaction=(K=this,ji(qf.prototype,function(Q,me,ce,ye,Se){var ve=this;this.db=K,this.mode=Q,this.storeNames=me,this.schema=ce,this.chromeTransactionDurability=ye,this.idbtrans=null,this.on=wi(this,"complete","error","abort"),this.parent=Se||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 $e(function(Oe,Me){ve._resolve=Oe,ve._reject=Me}),this._completion.then(function(){ve.active=!1,ve.on.complete.fire()},function(Oe){var Me=ve.active;return ve.active=!1,ve.on.error.fire(Oe),ve.parent?ve.parent._reject(Oe):Me&&ve.idbtrans&&ve.idbtrans.abort(),un(Oe)})})),this.Version=(te=this,ji(Gd.prototype,function(Q){this.db=te,this._cfg={version:Q,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(pe=this,ji(Iu.prototype,function(Q,me,ce){if(this.db=pe,this._ctx={table:Q,index:me===":id"?null:me,or:ce},this._cmp=this._ascending=Kt,this._descending=function(ye,Se){return Kt(Se,ye)},this._max=function(ye,Se){return 0<Kt(ye,Se)?ye:Se},this._min=function(ye,Se){return Kt(ye,Se)<0?ye:Se},this._IDBKeyRange=pe._deps.IDBKeyRange,!this._IDBKeyRange)throw new Y.MissingAPI})),this.on("versionchange",function(Q){0<Q.newVersion?console.warn("Another connection wants to upgrade database '".concat(w.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(w.name,"'. Closing db now to resume the delete request.")),w.close({disableAutoOpen:!1})}),this.on("blocked",function(Q){!Q.newVersion||Q.newVersion<Q.oldVersion?console.warn("Dexie.delete('".concat(w.name,"') was blocked")):console.warn("Upgrade '".concat(w.name,"' blocked by other connection holding version ").concat(Q.oldVersion/10))}),this._maxKey=Ji(m.IDBKeyRange),this._createTransaction=function(Q,me,ce,ye){return new w.Transaction(Q,me,ce,w._options.chromeTransactionDurability,ye)},this._fireOnBlocked=function(Q){w.on("blocked").fire(Q),wa.filter(function(me){return me.name===w.name&&me!==w&&!me._state.vcFired}).map(function(me){return me.on("versionchange").fire(Q)})},this.use(Np),this.use(Bp),this.use(Tm),this.use(bf),this.use(xh);var ue=new Proxy(this,{get:function(Q,me,ce){if(me==="_vip")return!0;if(me==="table")return function(Se){return as(w.table(Se),ue)};var ye=Reflect.get(Q,me,ce);return ye instanceof Vl?as(ye,ue):me==="tables"?ye.map(function(Se){return as(Se,ue)}):me==="_createTransaction"?function(){return as(ye.apply(this,arguments),ue)}:ye}});this.vip=ue,x.forEach(function(Q){return Q(w)})}var Vo,er=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Dm=(zs.prototype.subscribe=function(f,m,w){return this._subscribe(f&&typeof f!="function"?f:{next:f,error:m,complete:w})},zs.prototype[er]=function(){return this},zs);function zs(f){this._subscribe=f}try{Vo={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch{Vo={indexedDB:null,IDBKeyRange:null}}function ac(f){var m,w=!1,x=new Dm(function(O){var M=ee(f),K,te=!1,pe={},ge={},ue={get closed(){return te},unsubscribe:function(){te||(te=!0,K&&K.abort(),Q&&pa.storagemutated.unsubscribe(ce))}};O.start&&O.start(ue);var Q=!1,me=function(){return ia(ye)},ce=function(Se){ki(pe,Se),ns(ge,pe)&&me()},ye=function(){var Se,ve,Oe;!te&&Vo.indexedDB&&(pe={},Se={},K&&K.abort(),K=new AbortController,Oe=function(Me){var Ne=xt();try{M&&Yn();var Fe=Lr(f,Me);return Fe=M?Fe.finally(ar):Fe}finally{Ne&&Ht()}}(ve={subscr:Se,signal:K.signal,requery:me,querier:f,trans:null}),Promise.resolve(Oe).then(function(Me){w=!0,m=Me,te||ve.signal.aborted||(pe={},function(Ne){for(var Fe in Ne)if(d(Ne,Fe))return;return 1}(ge=Se)||Q||(pa(ro,ce),Q=!0),ia(function(){return!te&&O.next&&O.next(Me)}))},function(Me){w=!1,["DatabaseClosedError","AbortError"].includes(Me==null?void 0:Me.name)||te||ia(function(){te||O.error&&O.error(Me)})}))};return setTimeout(me,0),ue});return x.hasValue=function(){return w},x.getValue=function(){return m},x}var Ta=ea;function Uo(f){var m=ha;try{ha=!0,pa.storagemutated.fire(f),ml(f,!0)}finally{ha=m}}p(Ta,r(r({},he),{delete:function(f){return new Ta(f,{addons:[]}).delete()},exists:function(f){return new Ta(f,{addons:[]}).open().then(function(m){return m.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(f){try{return m=Ta.dependencies,w=m.indexedDB,m=m.IDBKeyRange,(uo(w)?Promise.resolve(w.databases()).then(function(x){return x.map(function(O){return O.name}).filter(function(O){return O!==ho})}):$s(w,m).toCollection().primaryKeys()).then(f)}catch{return un(new Y.MissingAPI)}var m,w},defineClass:function(){return function(f){l(this,f)}},ignoreTransaction:function(f){return we.trans?or(we.transless,f):f()},vip:fi,async:function(f){return function(){try{var m=hs(f.apply(this,arguments));return m&&typeof m.then=="function"?m:$e.resolve(m)}catch(w){return un(w)}}},spawn:function(f,m,w){try{var x=hs(f.apply(w,m||[]));return x&&typeof x.then=="function"?x:$e.resolve(x)}catch(O){return un(O)}},currentTransaction:{get:function(){return we.trans||null}},waitFor:function(f,m){return m=$e.resolve(typeof f=="function"?Ta.ignoreTransaction(f):f).timeout(m||6e4),we.trans?we.trans.waitFor(m):m},Promise:$e,debug:{get:function(){return se},set:function(f){Ue(f)}},derive:v,extend:l,props:p,override:S,Events:wi,on:pa,liveQuery:ac,extendObservabilitySet:ki,getByKeyPath:k,setByKeyPath:E,delByKeyPath:function(f,m){typeof m=="string"?E(f,m,void 0):"length"in m&&[].map.call(m,function(w){E(f,w,void 0)})},shallowClone:I,deepClone:P,getObjectDiff:gl,cmp:Kt,asap:T,minKey:-1/0,addons:[],connections:wa,errnames:ae,dependencies:Vo,cache:Ca,semVer:"4.0.10",version:"4.0.10".split(".").map(function(f){return parseInt(f)}).reduce(function(f,m,w){return f+m/Math.pow(10,2*w)})})),Ta.maxKey=Ji(Ta.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(pa(ro,function(f){ha||(f=new CustomEvent(dl,{detail:f}),ha=!0,dispatchEvent(f),ha=!1)}),addEventListener(dl,function(f){f=f.detail,ha||Uo(f)}));var Ba,ha=!1,yd=function(){};return typeof BroadcastChannel<"u"&&((yd=function(){(Ba=new BroadcastChannel(dl)).onmessage=function(f){return f.data&&Uo(f.data)}})(),typeof Ba.unref=="function"&&Ba.unref(),pa(ro,function(f){ha||Ba.postMessage(f)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(f){if(!ea.disableBfCache&&f.persisted){se&&console.debug("Dexie: handling persisted pagehide"),Ba!=null&&Ba.close();for(var m=0,w=wa;m<w.length;m++)w[m].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(f){!ea.disableBfCache&&f.persisted&&(se&&console.debug("Dexie: handling persisted pageshow"),yd(),Uo({all:new Dn(-1/0,[[]])}))})),$e.rejectionMapper=function(f,m){return!f||f instanceof U||f instanceof TypeError||f instanceof SyntaxError||!f.name||!Ee[f.name]?f:(m=new Ee[f.name](m||f.message,f),"stack"in f&&g(m,"stack",{get:function(){return this.inner.stack}}),m)},Ue(se),r(ea,Object.freeze({__proto__:null,Dexie:ea,liveQuery:ac,Entity:Du,cmp:Kt,PropModSymbol:Wr,PropModification:za,replacePrefix:function(f,m){return new za({replacePrefix:[f,m]})},add:function(f){return new za({add:f})},remove:function(f){return new za({remove:f})},default:ea,RangeSet:Dn,mergeRanges:Zi,rangesOverlap:pl}),{default:ea}),ea})})(gLt);var CTa=gLt.exports;const tRe=_Ta(CTa),vLt=Symbol.for("Dexie"),G9=globalThis[vLt]||(globalThis[vLt]=tRe);if(tRe.semVer!==G9.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${tRe.semVer} and ${G9.semVer}`);const{liveQuery:vqa,mergeRanges:yqa,rangesOverlap:bqa,RangeSet:wqa,cmp:_qa,Entity:Cqa,PropModSymbol:Sqa,PropModification:kqa,replacePrefix:Eqa,add:xqa,remove:Tqa}=G9;class yLt extends G9{constructor(t){super(t),Ud(this,"icons"),Ud(this,"visuals"),Ud(this,"users"),Ud(this,"columns"),Ud(this,"general"),this.version(1).stores({icons:"key",visuals:"key",users:"key",columns:"key",general:"key"})}getTable(t){return this[t]?this[t]:this.general}}const wse=new Map,STa=async e=>{if(!wse.has(e)){const t=new yLt(e);try{await t.open(),wse.set(e,t)}catch(n){console.error("Failed to open database, attempting to delete and recreate:",n);try{await G9.delete(e);const r=new yLt(e);await r.open(),wse.set(e,r)}catch(r){throw console.error("Failed to delete and recreate database:",r),r}}}return wse.get(e)},nRe=({dbName:e,storeName:t})=>{const n=async()=>(await STa(e)).getTable(t);return{getCachedValue:async r=>{try{const a=await n();if(!a){console.error(`Store is undefined for key: ${r}`);return}const i=await a.get(r);return i==null?void 0:i.value}catch(a){console.error("Failed to get cached value:",a);return}},setCachedValue:async(r,a)=>{try{console.trace(`Caching value for key: ${r}`,a);const i=await n();if(!i){console.error(`Store is undefined, cannot cache key: ${r}`);return}await i.put({key:r,value:a,timestamp:Date.now()})}catch(i){console.error("Failed to cache value:",i)}},deleteCachedValue:async r=>{try{const a=await n();if(!a){console.error(`Store is undefined, cannot delete key: ${r}`);return}await a.delete(r)}catch(a){console.error("Failed to delete cached value:",a)}},clearCache:async()=>{try{const r=await n();if(!r){console.error("Store is undefined, cannot clear cache");return}await r.clear()}catch(r){console.error("Failed to clear cache:",r)}},getAllKeys:async()=>{try{const r=await n();return r?(await r.toArray()).map(a=>a.key):(console.error("Store is undefined, cannot get all keys"),[])}catch(r){return console.error("Failed to get all keys:",r),[]}},getCachedValueWithTimestamp:async r=>{try{const a=await n();if(!a){console.error(`Store is undefined for key: ${r}`);return}return await a.get(r)}catch(a){console.error("Failed to get cached value with timestamp:",a);return}}}},kTa="AvatarCache",ETa="images",qR={},_se={},xTa=()=>{const{getCachedValue:e,setCachedValue:t}=nRe({dbName:kTa,storeName:ETa}),n=i=>new Promise((o,s)=>{const l=new FileReader;l.onloadend=()=>o(l.result),l.onerror=s,l.readAsDataURL(i)}),r=async i=>{try{if(qR[i])return qR[i];if(_se[i])return await _se[i];const o=(async()=>{try{const s=await e(i);if(!s||!(s instanceof Blob))return null;const l=await n(s);return qR[i]=l,l}catch(s){return console.warn(`Failed to get cached image for key: ${i}`,s),null}})();return _se[i]=o,o.finally(()=>{delete _se[i]}),await o}catch(o){return console.error(`Error in getCachedImage for key: ${i}`,o),null}},a=i=>new Promise((o,s)=>{new wTa(i,{width:96,height:96,quality:1,success(l){o(l)},error(l){console.error("Image compression failed:",l.message),s(l)}})});return{getCachedImage:r,setCachedImage:async(i,o)=>{try{const s=await a(o);await t(i,s);const l=await n(s);qR[i]=l}catch(s){throw console.error(`Failed to cache image for key: ${i}`,s),s}},clearMemoryCache:i=>{try{i?delete qR[i]:Object.keys(qR).forEach(o=>delete qR[o])}catch(o){console.error("Error clearing memory cache:",o)}}}},q9=new Map,KC=new Map,K3=new Map,TTa=5*60*1e3,bLt=100;function DTa(){const e=Date.now(),t=[];K3.forEach((n,r)=>{e-n>TTa&&t.push(r)}),t.forEach(n=>{q9.delete(n),K3.delete(n),KC.delete(n)})}function ATa(){if(K3.size<=bLt)return;const e=Array.from(K3.entries()).sort((t,n)=>t[1]-n[1]);e.slice(0,e.length-bLt).forEach(([t])=>{q9.delete(t),K3.delete(t),KC.delete(t)})}const OTa=(e,t)=>{const n=KC.get(e);return n==null||n.forEach(r=>r(t)),KC.delete(e),t};async function ITa({userId:e,avatarUrl:t,cacheInterface:n,onLoadingChange:r}){let a=e;if(t)try{const c=new URL(t,"http://localhost").pathname.split("/").pop();c?a=`${e}_${c}`:a=t}catch{a=t||e}const i=await n.getCachedImage(a),o=q9.has(a),s=KC.has(a);if(i)return OTa(a,i);if(DTa(),o)return new Promise(c=>{s||KC.set(a,[]),KC.get(a).push(c)});const l=(async()=>{let c=null,d=null;try{const p=Math.random()*300;await new Promise(g=>setTimeout(g,p)),r==null||r(!0);const h=await fetch(t,{cache:"no-cache"});if(!h.ok)throw new Error("Failed to fetch image");return c=await h.blob(),await n.setCachedImage(a,c),d=URL.createObjectURL(c),d}catch(p){throw console.error("Error loading avatar image:",p),p}finally{c=null,r==null||r(!1),K3.set(a,Date.now()),setTimeout(()=>{q9.delete(a),ATa()},100)}})();q9.set(a,l);const u=await l;return KC.has(a)&&(KC.get(a).forEach(c=>c(u)),KC.delete(a)),u}const RTa=(e,t=3,n=1e3)=>{const r=W(0),a=W(!1),i=W(!1),o=async()=>{try{await e()}catch(s){if(r.value<t)return r.value++,i.value=!0,await new Promise(l=>setTimeout(l,n)),o();throw a.value=!0,s}};return{retry:o,currentAttempt:r,errorRetry:a,isRetrying:i}};function Sh(e,t){$Ta(e)&&(e="100%");const n=PTa(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Cse(e){return Math.min(1,Math.max(0,e))}function $Ta(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function PTa(e){return typeof e=="string"&&e.indexOf("%")!==-1}function wLt(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Sse(e){return Number(e)<=1?`${Number(e)*100}%`:e}function KR(e){return e.length===1?"0"+e:String(e)}function MTa(e,t,n){return{r:Sh(e,255)*255,g:Sh(t,255)*255,b:Sh(n,255)*255}}function _Lt(e,t,n){e=Sh(e,255),t=Sh(t,255),n=Sh(n,255);const r=Math.max(e,t,n),a=Math.min(e,t,n);let i=0,o=0;const s=(r+a)/2;if(r===a)o=0,i=0;else{const l=r-a;switch(o=s>.5?l/(2-r-a):l/(r+a),r){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break}i/=6}return{h:i,s:o,l:s}}function rRe(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function NTa(e,t,n){let r,a,i;if(e=Sh(e,360),t=Sh(t,100),n=Sh(n,100),t===0)a=n,i=n,r=n;else{const o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;r=rRe(s,o,e+1/3),a=rRe(s,o,e),i=rRe(s,o,e-1/3)}return{r:r*255,g:a*255,b:i*255}}function CLt(e,t,n){e=Sh(e,255),t=Sh(t,255),n=Sh(n,255);const r=Math.max(e,t,n),a=Math.min(e,t,n);let i=0;const o=r,s=r-a,l=r===0?0:s/r;if(r===a)i=0;else{switch(r){case e:i=(t-n)/s+(t<n?6:0);break;case t:i=(n-e)/s+2;break;case n:i=(e-t)/s+4;break}i/=6}return{h:i,s:l,v:o}}function LTa(e,t,n){e=Sh(e,360)*6,t=Sh(t,100),n=Sh(n,100);const r=Math.floor(e),a=e-r,i=n*(1-t),o=n*(1-a*t),s=n*(1-(1-a)*t),l=r%6,u=[n,o,i,i,s,n][l],c=[s,n,n,o,i,i][l],d=[i,i,s,n,n,o][l];return{r:u*255,g:c*255,b:d*255}}function SLt(e,t,n,r){const a=[KR(Math.round(e).toString(16)),KR(Math.round(t).toString(16)),KR(Math.round(n).toString(16))];return r&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function FTa(e,t,n,r,a){const i=[KR(Math.round(e).toString(16)),KR(Math.round(t).toString(16)),KR(Math.round(n).toString(16)),KR(VTa(r))];return a&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function BTa(e,t,n,r){const a=e/100,i=t/100,o=n/100,s=r/100,l=255*(1-a)*(1-s),u=255*(1-i)*(1-s),c=255*(1-o)*(1-s);return{r:l,g:u,b:c}}function kLt(e,t,n){let r=1-e/255,a=1-t/255,i=1-n/255,o=Math.min(r,a,i);return o===1?(r=0,a=0,i=0):(r=(r-o)/(1-o)*100,a=(a-o)/(1-o)*100,i=(i-o)/(1-o)*100),o*=100,{c:Math.round(r),m:Math.round(a),y:Math.round(i),k:Math.round(o)}}function VTa(e){return Math.round(parseFloat(e)*255).toString(16)}function ELt(e){return hy(e)/255}function hy(e){return parseInt(e,16)}function UTa(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const aRe={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function HTa(e){let t={r:0,g:0,b:0},n=1,r=null,a=null,i=null,o=!1,s=!1;return typeof e=="string"&&(e=WTa(e)),typeof e=="object"&&(py(e.r)&&py(e.g)&&py(e.b)?(t=MTa(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):py(e.h)&&py(e.s)&&py(e.v)?(r=Sse(e.s),a=Sse(e.v),t=LTa(e.h,r,a),o=!0,s="hsv"):py(e.h)&&py(e.s)&&py(e.l)?(r=Sse(e.s),i=Sse(e.l),t=NTa(e.h,r,i),o=!0,s="hsl"):py(e.c)&&py(e.m)&&py(e.y)&&py(e.k)&&(t=BTa(e.c,e.m,e.y,e.k),o=!0,s="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=wLt(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}const jTa="[-\\+]?\\d+%?",zTa="[-\\+]?\\d*\\.\\d+%?",uA="(?:"+zTa+")|(?:"+jTa+")",iRe="[\\s|\\(]+("+uA+")[,|\\s]+("+uA+")[,|\\s]+("+uA+")\\s*\\)?",kse="[\\s|\\(]+("+uA+")[,|\\s]+("+uA+")[,|\\s]+("+uA+")[,|\\s]+("+uA+")\\s*\\)?",k0={CSS_UNIT:new RegExp(uA),rgb:new RegExp("rgb"+iRe),rgba:new RegExp("rgba"+kse),hsl:new RegExp("hsl"+iRe),hsla:new RegExp("hsla"+kse),hsv:new RegExp("hsv"+iRe),hsva:new RegExp("hsva"+kse),cmyk:new RegExp("cmyk"+kse),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function WTa(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(aRe[e])e=aRe[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let n=k0.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=k0.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=k0.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=k0.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=k0.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=k0.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=k0.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:(n=k0.hex8.exec(e),n?{r:hy(n[1]),g:hy(n[2]),b:hy(n[3]),a:ELt(n[4]),format:t?"name":"hex8"}:(n=k0.hex6.exec(e),n?{r:hy(n[1]),g:hy(n[2]),b:hy(n[3]),format:t?"name":"hex"}:(n=k0.hex4.exec(e),n?{r:hy(n[1]+n[1]),g:hy(n[2]+n[2]),b:hy(n[3]+n[3]),a:ELt(n[4]+n[4]),format:t?"name":"hex8"}:(n=k0.hex3.exec(e),n?{r:hy(n[1]+n[1]),g:hy(n[2]+n[2]),b:hy(n[3]+n[3]),format:t?"name":"hex"}:!1))))))))))}function py(e){return typeof e=="number"?!Number.isNaN(e):k0.CSS_UNIT.test(e)}class Xu{constructor(t="",n={}){if(t instanceof Xu)return t;typeof t=="number"&&(t=UTa(t)),this.originalInput=t;const r=HTa(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3}getLuminance(){const t=this.toRgb();let n,r,a;const i=t.r/255,o=t.g/255,s=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),o<=.03928?r=o/12.92:r=Math.pow((o+.055)/1.055,2.4),s<=.03928?a=s/12.92:a=Math.pow((s+.055)/1.055,2.4),.2126*n+.7152*r+.0722*a}getAlpha(){return this.a}setAlpha(t){return this.a=wLt(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return t===0}toHsv(){const t=CLt(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=CLt(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),a=Math.round(t.v*100);return this.a===1?`hsv(${n}, ${r}%, ${a}%)`:`hsva(${n}, ${r}%, ${a}%, ${this.roundA})`}toHsl(){const t=_Lt(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=_Lt(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),a=Math.round(t.l*100);return this.a===1?`hsl(${n}, ${r}%, ${a}%)`:`hsla(${n}, ${r}%, ${a}%, ${this.roundA})`}toHex(t=!1){return SLt(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return FTa(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return this.a===1?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?`rgb(${t}, ${n}, ${r})`:`rgba(${t}, ${n}, ${r}, ${this.roundA})`}toPercentageRgb(){const t=n=>`${Math.round(Sh(n,255)*100)}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=n=>Math.round(Sh(n,255)*100);return this.a===1?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toCmyk(){return{...kLt(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:n,y:r,k:a}=kLt(this.r,this.g,this.b);return`cmyk(${t}, ${n}, ${r}, ${a})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const t="#"+SLt(this.r,this.g,this.b,!1);for(const[n,r]of Object.entries(aRe))if(t===r)return n;return!1}toString(t){const n=!!t;t=t??this.format;let r=!1;const a=this.a<1&&this.a>=0;return!n&&a&&(t.startsWith("hex")||t==="name")?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),t==="cmyk"&&(r=this.toCmykString()),r||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new Xu(this.toString())}lighten(t=10){const n=this.toHsl();return n.l+=t/100,n.l=Cse(n.l),new Xu(n)}brighten(t=10){const n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new Xu(n)}darken(t=10){const n=this.toHsl();return n.l-=t/100,n.l=Cse(n.l),new Xu(n)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const n=this.toHsl();return n.s-=t/100,n.s=Cse(n.s),new Xu(n)}saturate(t=10){const n=this.toHsl();return n.s+=t/100,n.s=Cse(n.s),new Xu(n)}greyscale(){return this.desaturate(100)}spin(t){const n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new Xu(n)}mix(t,n=50){const r=this.toRgb(),a=new Xu(t).toRgb(),i=n/100,o={r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a};return new Xu(o)}analogous(t=6,n=30){const r=this.toHsl(),a=360/n,i=[this];for(r.h=(r.h-(a*t>>1)+720)%360;--t;)r.h=(r.h+a)%360,i.push(new Xu(r));return i}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new Xu(t)}monochromatic(t=6){const n=this.toHsv(),{h:r}=n,{s:a}=n;let{v:i}=n;const o=[],s=1/t;for(;t--;)o.push(new Xu({h:r,s:a,v:i})),i=(i+s)%1;return o}splitcomplement(){const t=this.toHsl(),{h:n}=t;return[this,new Xu({h:(n+72)%360,s:t.s,l:t.l}),new Xu({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){const n=this.toRgb(),r=new Xu(t).toRgb(),a=n.a+r.a*(1-n.a);return new Xu({r:(n.r*n.a+r.r*r.a*(1-n.a))/a,g:(n.g*n.a+r.g*r.a*(1-n.a))/a,b:(n.b*n.a+r.b*r.a*(1-n.a))/a,a})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const n=this.toHsl(),{h:r}=n,a=[this],i=360/t;for(let o=1;o<t;o++)a.push(new Xu({h:(r+o*i)%360,s:n.s,l:n.l}));return a}equals(t){const n=new Xu(t);return this.format==="cmyk"||n.format==="cmyk"?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}function xLt(e){return new Xu(e||"").isValid}function GTa(e,t){const{c1:n,c2:r}={c1:new Xu(e),c2:new Xu(t)};return n.equals(r)}const TLt=class B7{constructor(){Ud(this,"KEY_PAIR",{workspaceCode:"ws.code",apiBaseUrl:"API_BASE_URL",assetUrl:"ASSET_URL",baseUrl:"BASE_URL",baseReviewUrl:"BASE_REVIEW_URL"}),Object.values(this.KEY_PAIR).every(t=>{const n=sessionStorage.getItem(t);return(n==null||n==="")&&console.error(`[SessionStorageHelper] Key "${t}" is not set in sessionStorage.`),!0})||console.error("[SessionStorageHelper] Some expected keys are missing in sessionStorage. Please ensure all required keys are set.")}static getInstance(){return B7.instance||(B7.instance=new B7),B7.instance}setItem(t,n){try{sessionStorage.setItem(t,n)}catch(r){console.error("Error setting sessionStorage item:",r)}}getItem(t){try{const n=sessionStorage.getItem(t);return n===null?"":n}catch(n){throw console.error("Error getting sessionStorage item:",n),n}}};Ud(TLt,"instance");let oRe=TLt;const qTa=["src","alt"],KTa=ct({__name:"Avatar",props:{name:{},id:{},profile_image:{},color:{},initial:{},isMe:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{default:24},isUseShortLabel:{type:Boolean,default:!0},borderRadius:{default:void 0}},setup(e){const t=e,n=z(()=>t.isMe||t.id===p.value),r=W(""),a=W(!1),i=W(null),o=W(!1),s=z(()=>({name:t.name||"",id:t.id||"",profile_image:t.profile_image||null,color:t.color||{bgColor:"#CCCCCC",textColor:"var(--background-color)"},initial:t.initial})),l=z(()=>{var k;const E=((k=s.value.color)==null?void 0:k.bgColor)||"#CCCCCC";return xLt(E)?E:"#CCCCCC"}),u=z(()=>{var k;const E=((k=s.value.color)==null?void 0:k.textColor)||"var(--background-color)";return xLt(E)?E:"var(--background-color)"}),c=z(()=>{if(!t.isUseShortLabel)return"";const{initial:k,name:E}=s.value;if(typeof k=="string"&&k.trim())return k.trim();if(!(E!=null&&E.trim()))return"";const I=E.trim().split(/\s+/).filter(Boolean);return I.length===1?I[0].slice(0,2).toUpperCase():(I[0][0]+I[1][0]).toUpperCase()}),d=z(()=>s.value.profile_image?"image":"text"),p=z(()=>oRe.getInstance().getItem("user.ws_user_role_id")),h=z(()=>({"--avatar-size":`${t.size}px`,"--avatar-bg":l.value,"--avatar-border":t.isMe?"var(--primary-color)":"#f3f5f8","--text-color":u.value,"--font-size":`${Math.floor(t.size/2)}px`,"--border-radius":t.borderRadius?typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius:"4px"})),g=()=>{r.value="",o.value=!0},{getCachedImage:v,setCachedImage:b}=xTa(),_=async()=>{if(i.value&&i.value.abort(),r.value.startsWith("blob:")&&URL.revokeObjectURL(r.value),!s.value.id||!s.value.profile_image){r.value="";return}i.value=new AbortController;const k=i.value;try{const E=await ITa({userId:s.value.id,avatarUrl:s.value.profile_image,cacheInterface:{getCachedImage:v,setCachedImage:b},onLoadingChange:I=>{k.signal.aborted||(a.value=I)}});if(!k.signal.aborted&&(r.value=E,E.length===0))throw console.warn("Loaded avatar image is empty, displaying initials instead."),g(),new Error("Empty image source")}catch(E){k.signal.aborted||(console.error("Failed to load avatar:",E),r.value="")}},{retry:C,errorRetry:S,isRetrying:y}=RTa(_,3,2e3),T=lt(()=>[s.value.id,s.value.profile_image],C,{immediate:!0});return $r(()=>{T(),i.value&&(i.value.abort(),i.value=null),r.value.startsWith("blob:")&&URL.revokeObjectURL(r.value),r.value="",a.value=!1}),(k,E)=>(L(),re("div",{class:ke([k.$style["avatar-wrapper"],{[k.$style.me]:n.value,[k.$style.loading]:a.value,[k.$style.disabled]:e.disabled,[k.$style.readOnly]:t.readOnly}]),style:Yt(h.value)},[a.value||F(y)?(L(),re("div",{key:0,class:ke(k.$style["skeleton-loader"])},null,2)):(L(),re($t,{key:1},[d.value==="text"||F(S)||o.value?(L(),re("div",{key:0,class:ke(k.$style["short-label"])},vt(c.value),3)):r.value.length>0||s.value.profile_image?(L(),re("img",{key:1,src:r.value||s.value.profile_image||"",alt:s.value.name||"Avatar",loading:"lazy"},null,8,qTa)):Ve("",!0)],64))],6))}}),YTa="_me_1dygt_18",JTa="_action_1dygt_40",ZTa="_loading_1dygt_58",XTa="_disabled_1dygt_61",QTa="_readOnly_1dygt_64",eDa={"avatar-wrapper":"_avatar-wrapper_1dygt_1",me:YTa,"short-label":"_short-label_1dygt_22",action:JTa,loading:ZTa,disabled:XTa,readOnly:QTa},tDa={$style:eDa},nDa=Tp(KTa,[["__cssModules",tDa]]),rDa=["404","ClickChart","ClickToCreate","NoAccess1","NoActivity","NoAssignedComment","NoAssignedScene","NoComment","NoData","NoData2","NoRendition1","NoRendition2","PrivateComment","PrivateScene","ReportAchievement","ReportCompletedScenes","ReportInvolvement","ReportMetric","ReportOverdueScenes","ReportProfessionalName","ReportSceneAssignment","ReportSceneStatus","ReportSceneStatusType","Successful1","Unsuccessful1","ConfirmDeletion","Waiting1","DefaultThumbnail","UploadReviewFile","ClickToSearch","NoDataSearchFilter"],aDa=["UploadInProgress"],Ese={},cA={},DLt=(e,t,n,r,a="base64")=>{const i=W(""),o=W(""),s=W(!0),l=z(()=>`${t}:${e.value.name}`),u=v=>new Promise((b,_)=>{const C=new FileReader;C.onload=()=>b(C.result),C.onerror=_,C.readAsDataURL(v)}),c=v=>`data:image/svg+xml;charset=utf-8,${encodeURIComponent(v)}`,d=async(v,b)=>{if(cA[b])return cA[b];if(b in Ese){const S=await Ese[b];return S&&(cA[b]=S),S}const _=await r(l.value);if(_&&typeof _=="string")return cA[b]=_,_;const C=(async()=>{try{const S=await fetch(v,{cache:"no-cache"});if(!S.ok)throw new Error("Failed to fetch visual");const y=S.headers.get("Content-Type")||"";let T;if(y.includes("svg")||y.includes("xml")){const k=await S.text();if(!k.trim())throw new Error("Empty SVG content");T=a==="svg"?k:c(k),cA[b]=T}else if(y.match(/image\/(jpeg|jpg|png|gif|webp)/)){const k=await S.blob();if(!k.size)throw new Error("Empty image blob");T=await u(k),cA[b]=T}else throw new Error(`Unsupported content type: ${y}`);return await n(l.value,T),T}catch(S){return console.error("Error fetching visual:",S),""}})();return Ese[b]=C,C.finally(()=>{delete Ese[b]}),await C},p=async v=>{s.value=!0;try{if(cA[l.value]){const T=cA[l.value];i.value=T,T.startsWith("data:image/svg+xml")?o.value=decodeURIComponent(T.split(",")[1]):(T.startsWith("<svg")||T.includes("<svg"))&&(o.value=T),s.value=!1;return}const b=oRe.getInstance().getItem("ASSET_URL")||"",_={icon:`${b}/icon/tess/TESSRAPP_Icon_${v}`,visual:`${b}/icon/visual/TESSRAPP_Visual_${v}`,ratting:`${b}/icon/tess/rating/TESSRAPP_Icon_${v}_Outline`,flag:`${b}/icon/flags/4x3/${v}`},C=rDa.includes(v)?"png":aDa.includes(v)?"gif":"svg",S=`${_[t]}.${C}`,y=await d(S,l.value);y&&(i.value=y,y.startsWith("data:image/svg+xml")?o.value=decodeURIComponent(y.split(",")[1]):(y.startsWith("<svg")||y.includes("<svg"))&&(o.value=y))}catch(b){console.error("Error fetching remote visual:",b)}finally{s.value=!1}},h=async()=>{i.value="",o.value="",e.value.name&&(s.value=!0,await p(e.value.name),s.value=!1)},g=z(()=>o.value?o.value:"");return lt(()=>e,()=>{h()},{deep:!0,immediate:!0}),{svgContent:g,url:i,loading:s}},iDa=["innerHTML","about"],oDa="IconCache",sDa="icons",lDa=ct({__name:"Icon",props:{src:{},source:{default:"remote"},size:{default:14},color:{default:"currentColor"}},setup(e){const t=e,n=d=>{if(typeof d=="number")return d;switch(d){case"small":return 14;case"medium":return 14;case"large":return 20;default:return typeof d=="string"?Number.parseInt(d,10):14}},r=z(()=>n(t.size));z(()=>({width:r.value+"px",height:r.value+"px",color:t.color}));const{getCachedValue:a,setCachedValue:i}=nRe({dbName:oDa,storeName:sDa}),o=async d=>{const p=await a(d);if(typeof p=="string")return p},s=async(d,p)=>{await i(d,p)},l=z(()=>t.source==="rating"?"ratting":"icon"),u=z(()=>({name:t.src,size:r.value,color:t.color||"currentColor"})),{svgContent:c}=DLt(u,l.value,s,o,"svg");return(d,p)=>(L(),re("div",{class:"icon-wrapper",style:Yt({"--icon-size":r.value+"px",color:t.color}),innerHTML:F(c),about:t.src,"data-icon":"true"},null,12,iDa))}}),Dp=Tp(lDa,[["__scopeId","data-v-54eccaa1"]]);var uDa=typeof global=="object"&&global&&global.Object===Object&&global,cDa=typeof self=="object"&&self&&self.Object===Object&&self,ALt=uDa||cDa||Function("return this")(),xse=ALt.Symbol,OLt=Object.prototype,dDa=OLt.hasOwnProperty,fDa=OLt.toString,K9=xse?xse.toStringTag:void 0;function hDa(e){var t=dDa.call(e,K9),n=e[K9];try{e[K9]=void 0;var r=!0}catch{}var a=fDa.call(e);return r&&(t?e[K9]=n:delete e[K9]),a}var pDa=Object.prototype,mDa=pDa.toString;function gDa(e){return mDa.call(e)}var vDa="[object Null]",yDa="[object Undefined]",ILt=xse?xse.toStringTag:void 0;function bDa(e){return e==null?e===void 0?yDa:vDa:ILt&&ILt in Object(e)?hDa(e):gDa(e)}function wDa(e){return e!=null&&typeof e=="object"}var _Da="[object Symbol]";function CDa(e){return typeof e=="symbol"||wDa(e)&&bDa(e)==_Da}var SDa=/\s/;function kDa(e){for(var t=e.length;t--&&SDa.test(e.charAt(t)););return t}var EDa=/^\s+/;function xDa(e){return e&&e.slice(0,kDa(e)+1).replace(EDa,"")}function sRe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var RLt=NaN,TDa=/^[-+]0x[0-9a-f]+$/i,DDa=/^0b[01]+$/i,ADa=/^0o[0-7]+$/i,ODa=parseInt;function $Lt(e){if(typeof e=="number")return e;if(CDa(e))return RLt;if(sRe(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=sRe(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=xDa(e);var n=DDa.test(e);return n||ADa.test(e)?ODa(e.slice(2),n?2:8):TDa.test(e)?RLt:+e}var lRe=function(){return ALt.Date.now()},IDa="Expected a function",RDa=Math.max,$Da=Math.min;function uRe(e,t,n){var r,a,i,o,s,l,u=0,c=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(IDa);t=$Lt(t)||0,sRe(n)&&(c=!!n.leading,d="maxWait"in n,i=d?RDa($Lt(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p);function h(k){var E=r,I=a;return r=a=void 0,u=k,o=e.apply(I,E),o}function g(k){return u=k,s=setTimeout(_,t),c?h(k):o}function v(k){var E=k-l,I=k-u,D=t-E;return d?$Da(D,i-I):D}function b(k){var E=k-l,I=k-u;return l===void 0||E>=t||E<0||d&&I>=i}function _(){var k=lRe();if(b(k))return C(k);s=setTimeout(_,v(k))}function C(k){return s=void 0,p&&r?h(k):(r=a=void 0,o)}function S(){s!==void 0&&clearTimeout(s),u=0,r=l=a=s=void 0}function y(){return s===void 0?o:C(lRe())}function T(){var k=lRe(),E=b(k);if(r=arguments,a=this,l=k,E){if(s===void 0)return g(l);if(d)return clearTimeout(s),s=setTimeout(_,t),h(l)}return s===void 0&&(s=setTimeout(_,t)),o}return T.cancel=S,T.flush=y,T}const cRe=(e,t)=>{const n=_a();return{apiServices:z(()=>{var r;const a=n==null?void 0:n.appContext.config.globalProperties,i=(r=t.params)==null?void 0:r.context;if(a!=null&&a.apiServices)return a.apiServices;if(e&&i!=null&&i.apiServices)return i.apiServices})}},PDa=e=>{const t=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return t?decodeURIComponent(t[2]):null};let YR=class extends Error{};class MDa extends YR{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class NDa extends YR{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class LDa extends YR{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Y3 extends YR{}class PLt extends YR{constructor(t){super(`Invalid unit ${t}`)}}class Ap extends YR{}let dA=class extends YR{constructor(){super("Zone is an abstract class")}};const Tr="numeric",T_="short",my="long",Tse={year:Tr,month:Tr,day:Tr},MLt={year:Tr,month:T_,day:Tr},FDa={year:Tr,month:T_,day:Tr,weekday:T_},NLt={year:Tr,month:my,day:Tr},LLt={year:Tr,month:my,day:Tr,weekday:my},FLt={hour:Tr,minute:Tr},BLt={hour:Tr,minute:Tr,second:Tr},VLt={hour:Tr,minute:Tr,second:Tr,timeZoneName:T_},ULt={hour:Tr,minute:Tr,second:Tr,timeZoneName:my},HLt={hour:Tr,minute:Tr,hourCycle:"h23"},jLt={hour:Tr,minute:Tr,second:Tr,hourCycle:"h23"},zLt={hour:Tr,minute:Tr,second:Tr,hourCycle:"h23",timeZoneName:T_},WLt={hour:Tr,minute:Tr,second:Tr,hourCycle:"h23",timeZoneName:my},GLt={year:Tr,month:Tr,day:Tr,hour:Tr,minute:Tr},qLt={year:Tr,month:Tr,day:Tr,hour:Tr,minute:Tr,second:Tr},KLt={year:Tr,month:T_,day:Tr,hour:Tr,minute:Tr},YLt={year:Tr,month:T_,day:Tr,hour:Tr,minute:Tr,second:Tr},BDa={year:Tr,month:T_,day:Tr,weekday:T_,hour:Tr,minute:Tr},JLt={year:Tr,month:my,day:Tr,hour:Tr,minute:Tr,timeZoneName:T_},ZLt={year:Tr,month:my,day:Tr,hour:Tr,minute:Tr,second:Tr,timeZoneName:T_},XLt={year:Tr,month:my,day:Tr,weekday:my,hour:Tr,minute:Tr,timeZoneName:my},QLt={year:Tr,month:my,day:Tr,weekday:my,hour:Tr,minute:Tr,second:Tr,timeZoneName:my};let Y9=class{get type(){throw new dA}get name(){throw new dA}get ianaName(){return this.name}get isUniversal(){throw new dA}offsetName(e,t){throw new dA}formatOffset(e,t){throw new dA}offset(e){throw new dA}equals(e){throw new dA}get isValid(){throw new dA}},dRe=null;class Dse extends Y9{static get instance(){return dRe===null&&(dRe=new Dse),dRe}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return EFt(t,n,r)}formatOffset(t,n){return X9(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const fRe=new Map;function VDa(e){let t=fRe.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),fRe.set(e,t)),t}const UDa={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function HDa(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,a,i,o,s,l,u,c]=r;return[o,a,i,s,l,u,c]}function jDa(e,t){const n=e.formatToParts(t),r=[];for(let a=0;a<n.length;a++){const{type:i,value:o}=n[a],s=UDa[i];i==="era"?r[s]=o:ci(s)||(r[s]=parseInt(o,10))}return r}const hRe=new Map;let J3=class XNe extends Y9{static create(t){let n=hRe.get(t);return n===void 0&&hRe.set(t,n=new XNe(t)),n}static resetCache(){hRe.clear(),fRe.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=XNe.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return EFt(t,n,r,this.name)}formatOffset(t,n){return X9(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=VDa(this.name);let[a,i,o,s,l,u,c]=r.formatToParts?jDa(r,n):HDa(r,n);s==="BC"&&(a=-Math.abs(a)+1);const d=Pse({year:a,month:i,day:o,hour:l===24?0:l,minute:u,second:c,millisecond:0});let p=+n;const h=p%1e3;return p-=h>=0?h:1e3+h,(d-p)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},eFt={};function zDa(e,t={}){const n=JSON.stringify([e,t]);let r=eFt[n];return r||(r=new Intl.ListFormat(e,t),eFt[n]=r),r}const pRe=new Map;function mRe(e,t={}){const n=JSON.stringify([e,t]);let r=pRe.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),pRe.set(n,r)),r}const gRe=new Map;function WDa(e,t={}){const n=JSON.stringify([e,t]);let r=gRe.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),gRe.set(n,r)),r}const vRe=new Map;function GDa(e,t={}){const{base:n,...r}=t,a=JSON.stringify([e,r]);let i=vRe.get(a);return i===void 0&&(i=new Intl.RelativeTimeFormat(e,t),vRe.set(a,i)),i}let Ase=null;function qDa(){return Ase||(Ase=new Intl.DateTimeFormat().resolvedOptions().locale,Ase)}const yRe=new Map;function tFt(e){let t=yRe.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),yRe.set(e,t)),t}const bRe=new Map;function KDa(e){let t=bRe.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...nFt,...t}),bRe.set(e,t)}return t}function YDa(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,a;try{r=mRe(e).resolvedOptions(),a=e}catch{const s=e.substring(0,n);r=mRe(s).resolvedOptions(),a=s}const{numberingSystem:i,calendar:o}=r;return[a,i,o]}}function JDa(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function ZDa(e){const t=[];for(let n=1;n<=12;n++){const r=Qr.utc(2009,n,1);t.push(e(r))}return t}function XDa(e){const t=[];for(let n=1;n<=7;n++){const r=Qr.utc(2016,11,13+n);t.push(e(r))}return t}function Ose(e,t,n,r){const a=e.listingMode();return a==="error"?null:a==="en"?n(t):r(t)}function QDa(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||tFt(e.locale).numberingSystem==="latn"}class eAa{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:a,floor:i,...o}=r;if(!n||Object.keys(o).length>0){const s={useGrouping:!1,...r};r.padTo>0&&(s.minimumIntegerDigits=r.padTo),this.inf=WDa(t,s)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):DRe(t,3);return Hd(n,this.padTo)}}}class tAa{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let a;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const o=-1*(t.offset/60),s=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&&J3.create(s).valid?(a=s,this.dt=t):(a="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,a=t.zone.name):(a="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const i={...this.opts};i.timeZone=i.timeZone||a,this.dtf=mRe(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class nAa{constructor(t,n,r){this.opts={style:"long",...r},!n&&_Ft()&&(this.rtf=GDa(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):kAa(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const nFt={firstDay:1,minimalDays:4,weekend:[6,7]};class Fs{static fromOpts(t){return Fs.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,a,i=!1){const o=t||Mc.defaultLocale,s=o||(i?"en-US":qDa()),l=n||Mc.defaultNumberingSystem,u=r||Mc.defaultOutputCalendar,c=xRe(a)||Mc.defaultWeekSettings;return new Fs(s,l,u,c,o)}static resetCache(){Ase=null,pRe.clear(),gRe.clear(),vRe.clear(),yRe.clear(),bRe.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:a}={}){return Fs.create(t,n,r,a)}constructor(t,n,r,a,i){const[o,s,l]=YDa(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||l||null,this.weekSettings=a,this.intl=JDa(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=QDa(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Fs.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,xRe(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Ose(this,t,DFt,()=>{const r=this.intl==="ja"||this.intl.startsWith("ja-");n&=!r;const a=n?{month:t,day:"numeric"}:{month:t},i=n?"format":"standalone";if(!this.monthsCache[i][t]){const o=r?s=>this.dtFormatter(s,a).format():s=>this.extract(s,a,"month");this.monthsCache[i][t]=ZDa(o)}return this.monthsCache[i][t]})}weekdays(t,n=!1){return Ose(this,t,IFt,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},a=n?"format":"standalone";return this.weekdaysCache[a][t]||(this.weekdaysCache[a][t]=XDa(i=>this.extract(i,r,"weekday"))),this.weekdaysCache[a][t]})}meridiems(){return Ose(this,void 0,()=>RFt,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Qr.utc(2016,11,13,9),Qr.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Ose(this,t,$Ft,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[Qr.utc(-40,1,1),Qr.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const a=this.dtFormatter(t,n),i=a.formatToParts(),o=i.find(s=>s.type.toLowerCase()===r);return o?o.value:null}numberFormatter(t={}){return new eAa(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new tAa(t,this.intl,n)}relFormatter(t={}){return new nAa(this.intl,this.isEnglish(),t)}listFormatter(t={}){return zDa(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||tFt(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:CFt()?KDa(this.locale):nFt}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let wRe=null,YC=class V7 extends Y9{static get utcInstance(){return wRe===null&&(wRe=new V7(0)),wRe}static instance(t){return t===0?V7.utcInstance:new V7(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new V7(Mse(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${X9(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${X9(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return X9(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};class rAa extends Y9{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function fA(e,t){if(ci(e)||e===null)return t;if(e instanceof Y9)return e;if(uAa(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Dse.instance:n==="utc"||n==="gmt"?YC.utcInstance:YC.parseSpecifier(n)||J3.create(e)}else return hA(e)?YC.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new rAa(e)}const _Re={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},rFt={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},aAa=_Re.hanidec.replace(/[\[|\]]/g,"").split("");function iAa(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(_Re.hanidec)!==-1)t+=aAa.indexOf(e[n]);else for(const a in rFt){const[i,o]=rFt[a];r>=i&&r<=o&&(t+=r-i)}}return parseInt(t,10)}else return t}const CRe=new Map;function oAa(){CRe.clear()}function D_({numberingSystem:e},t=""){const n=e||"latn";let r=CRe.get(n);r===void 0&&(r=new Map,CRe.set(n,r));let a=r.get(t);return a===void 0&&(a=new RegExp(`${_Re[n]}${t}`),r.set(t,a)),a}let aFt=()=>Date.now(),iFt="system",oFt=null,sFt=null,lFt=null,uFt=60,cFt,dFt=null;class Mc{static get now(){return aFt}static set now(t){aFt=t}static set defaultZone(t){iFt=t}static get defaultZone(){return fA(iFt,Dse.instance)}static get defaultLocale(){return oFt}static set defaultLocale(t){oFt=t}static get defaultNumberingSystem(){return sFt}static set defaultNumberingSystem(t){sFt=t}static get defaultOutputCalendar(){return lFt}static set defaultOutputCalendar(t){lFt=t}static get defaultWeekSettings(){return dFt}static set defaultWeekSettings(t){dFt=xRe(t)}static get twoDigitCutoffYear(){return uFt}static set twoDigitCutoffYear(t){uFt=t%100}static get throwOnInvalid(){return cFt}static set throwOnInvalid(t){cFt=t}static resetCaches(){Fs.resetCache(),J3.resetCache(),Qr.resetCache(),oAa()}}class A_{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const fFt=[0,31,59,90,120,151,181,212,243,273,304,334],hFt=[0,31,60,91,121,152,182,213,244,274,305,335];function E0(e,t){return new A_("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function SRe(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const a=r.getUTCDay();return a===0?7:a}function pFt(e,t,n){return n+(J9(e)?hFt:fFt)[t-1]}function mFt(e,t){const n=J9(e)?hFt:fFt,r=n.findIndex(i=>i<t),a=t-n[r];return{month:r+1,day:a}}function kRe(e,t){return(e-t+7)%7+1}function Ise(e,t=4,n=1){const{year:r,month:a,day:i}=e,o=pFt(r,a,i),s=kRe(SRe(r,a,i),n);let l=Math.floor((o-s+14-t)/7),u;return l<1?(u=r-1,l=Z9(u,t,n)):l>Z9(r,t,n)?(u=r+1,l=1):u=r,{weekYear:u,weekNumber:l,weekday:s,...Lse(e)}}function gFt(e,t=4,n=1){const{weekYear:r,weekNumber:a,weekday:i}=e,o=kRe(SRe(r,1,t),n),s=X3(r);let l=a*7+i-o-7+t,u;l<1?(u=r-1,l+=X3(u)):l>s?(u=r+1,l-=X3(r)):u=r;const{month:c,day:d}=mFt(u,l);return{year:u,month:c,day:d,...Lse(e)}}function ERe(e){const{year:t,month:n,day:r}=e,a=pFt(t,n,r);return{year:t,ordinal:a,...Lse(e)}}function vFt(e){const{year:t,ordinal:n}=e,{month:r,day:a}=mFt(t,n);return{year:t,month:r,day:a,...Lse(e)}}function yFt(e,t){if(!ci(e.localWeekday)||!ci(e.localWeekNumber)||!ci(e.localWeekYear)){if(!ci(e.weekday)||!ci(e.weekNumber)||!ci(e.weekYear))throw new Y3("Cannot mix locale-based week fields with ISO-based week fields");return ci(e.localWeekday)||(e.weekday=e.localWeekday),ci(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),ci(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function sAa(e,t=4,n=1){const r=Rse(e.weekYear),a=x0(e.weekNumber,1,Z9(e.weekYear,t,n)),i=x0(e.weekday,1,7);return r?a?i?!1:E0("weekday",e.weekday):E0("week",e.weekNumber):E0("weekYear",e.weekYear)}function lAa(e){const t=Rse(e.year),n=x0(e.ordinal,1,X3(e.year));return t?n?!1:E0("ordinal",e.ordinal):E0("year",e.year)}function bFt(e){const t=Rse(e.year),n=x0(e.month,1,12),r=x0(e.day,1,$se(e.year,e.month));return t?n?r?!1:E0("day",e.day):E0("month",e.month):E0("year",e.year)}function wFt(e){const{hour:t,minute:n,second:r,millisecond:a}=e,i=x0(t,0,23)||t===24&&n===0&&r===0&&a===0,o=x0(n,0,59),s=x0(r,0,59),l=x0(a,0,999);return i?o?s?l?!1:E0("millisecond",a):E0("second",r):E0("minute",n):E0("hour",t)}function ci(e){return typeof e>"u"}function hA(e){return typeof e=="number"}function Rse(e){return typeof e=="number"&&e%1===0}function uAa(e){return typeof e=="string"}function cAa(e){return Object.prototype.toString.call(e)==="[object Date]"}function _Ft(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function CFt(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function dAa(e){return Array.isArray(e)?e:[e]}function SFt(e,t,n){if(e.length!==0)return e.reduce((r,a)=>{const i=[t(a),a];return r&&n(r[0],i[0])===r[0]?r:i},null)[1]}function fAa(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Z3(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function xRe(e){if(e==null)return null;if(typeof e!="object")throw new Ap("Week settings must be an object");if(!x0(e.firstDay,1,7)||!x0(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!x0(t,1,7)))throw new Ap("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function x0(e,t,n){return Rse(e)&&e>=t&&e<=n}function hAa(e,t){return e-t*Math.floor(e/t)}function Hd(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function pA(e){if(!(ci(e)||e===null||e===""))return parseInt(e,10)}function JR(e){if(!(ci(e)||e===null||e===""))return parseFloat(e)}function TRe(e){if(!(ci(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function DRe(e,t,n="round"){const r=10**t;switch(n){case"expand":return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case"trunc":return Math.trunc(e*r)/r;case"round":return Math.round(e*r)/r;case"floor":return Math.floor(e*r)/r;case"ceil":return Math.ceil(e*r)/r;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function J9(e){return e%4===0&&(e%100!==0||e%400===0)}function X3(e){return J9(e)?366:365}function $se(e,t){const n=hAa(t-1,12)+1,r=e+(t-n)/12;return n===2?J9(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Pse(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function kFt(e,t,n){return-kRe(SRe(e,1,t),n)+t-1}function Z9(e,t=4,n=1){const r=kFt(e,t,n),a=kFt(e+1,t,n);return(X3(e)-r+a)/7}function ARe(e){return e>99?e:e>Mc.twoDigitCutoffYear?1900+e:2e3+e}function EFt(e,t,n,r=null){const a=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(i.timeZone=r);const o={timeZoneName:t,...i},s=new Intl.DateTimeFormat(n,o).formatToParts(a).find(l=>l.type.toLowerCase()==="timezonename");return s?s.value:null}function Mse(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,a=n<0||Object.is(n,-0)?-r:r;return n*60+a}function xFt(e){const t=Number(e);if(typeof e=="boolean"||e===""||!Number.isFinite(t))throw new Ap(`Invalid unit value ${e}`);return t}function Nse(e,t){const n={};for(const r in e)if(Z3(e,r)){const a=e[r];if(a==null)continue;n[t(r)]=xFt(a)}return n}function X9(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),a=e>=0?"+":"-";switch(t){case"short":return`${a}${Hd(n,2)}:${Hd(r,2)}`;case"narrow":return`${a}${n}${r>0?`:${r}`:""}`;case"techie":return`${a}${Hd(n,2)}${Hd(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Lse(e){return fAa(e,["hour","minute","second","millisecond"])}const pAa=["January","February","March","April","May","June","July","August","September","October","November","December"],TFt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],mAa=["J","F","M","A","M","J","J","A","S","O","N","D"];function DFt(e){switch(e){case"narrow":return[...mAa];case"short":return[...TFt];case"long":return[...pAa];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const AFt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],OFt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],gAa=["M","T","W","T","F","S","S"];function IFt(e){switch(e){case"narrow":return[...gAa];case"short":return[...OFt];case"long":return[...AFt];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const RFt=["AM","PM"],vAa=["Before Christ","Anno Domini"],yAa=["BC","AD"],bAa=["B","A"];function $Ft(e){switch(e){case"narrow":return[...bAa];case"short":return[...yAa];case"long":return[...vAa];default:return null}}function wAa(e){return RFt[e.hour<12?0:1]}function _Aa(e,t){return IFt(t)[e.weekday-1]}function CAa(e,t){return DFt(t)[e.month-1]}function SAa(e,t){return $Ft(t)[e.year<0?0:1]}function kAa(e,t,n="always",r=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&i){const d=e==="days";switch(t){case 1:return d?"tomorrow":`next ${a[e][0]}`;case-1:return d?"yesterday":`last ${a[e][0]}`;case 0:return d?"today":`this ${a[e][0]}`}}const o=Object.is(t,-0)||t<0,s=Math.abs(t),l=s===1,u=a[e],c=r?l?u[1]:u[2]||u[1]:l?a[e][0]:e;return o?`${s} ${c} ago`:`in ${s} ${c}`}function PFt(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const EAa={D:Tse,DD:MLt,DDD:NLt,DDDD:LLt,t:FLt,tt:BLt,ttt:VLt,tttt:ULt,T:HLt,TT:jLt,TTT:zLt,TTTT:WLt,f:GLt,ff:KLt,fff:JLt,ffff:XLt,F:qLt,FF:YLt,FFF:ZLt,FFFF:QLt};class Op{static create(t,n={}){return new Op(t,n)}static parseFormat(t){let n=null,r="",a=!1;const i=[];for(let o=0;o<t.length;o++){const s=t.charAt(o);s==="'"?((r.length>0||a)&&i.push({literal:a||/^\s+$/.test(r),val:r===""?"'":r}),n=null,r="",a=!a):a||s===n?r+=s:(r.length>0&&i.push({literal:/^\s+$/.test(r),val:r}),r=s,n=s)}return r.length>0&&i.push({literal:a||/^\s+$/.test(r),val:r}),i}static macroTokenToFormatOpts(t){return EAa[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0,r=void 0){if(this.opts.forceSimple)return Hd(t,n);const a={...this.opts};return n>0&&(a.padTo=n),r&&(a.signDisplay=r),this.loc.numberFormatter(a).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",a=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(h,g)=>this.loc.extract(t,h,g),o=h=>t.isOffsetFixed&&t.offset===0&&h.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,h.format):"",s=()=>r?wAa(t):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(h,g)=>r?CAa(t,h):i(g?{month:h}:{month:h,day:"numeric"},"month"),u=(h,g)=>r?_Aa(t,h):i(g?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),c=h=>{const g=Op.macroTokenToFormatOpts(h);return g?this.formatWithSystemDefault(t,g):h},d=h=>r?SAa(t,h):i({era:h},"era"),p=h=>{switch(h){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return s();case"d":return a?i({day:"numeric"},"day"):this.num(t.day);case"dd":return a?i({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return a?i({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return a?i({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return a?i({month:"numeric"},"month"):this.num(t.month);case"MM":return a?i({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return a?i({year:"numeric"},"year"):this.num(t.year);case"yy":return a?i({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return a?i({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return a?i({year:"numeric"},"year"):this.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(h)}};return PFt(Op.parseFormat(n),p)}formatDurationFromString(t,n){const r=this.opts.signMode==="negativeLargestOnly"?-1:1,a=c=>{switch(c[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},i=(c,d)=>p=>{const h=a(p);if(h){const g=d.isNegativeDuration&&h!==d.largestUnit?r:1;let v;return this.opts.signMode==="negativeLargestOnly"&&h!==d.largestUnit?v="never":this.opts.signMode==="all"?v="always":v="auto",this.num(c.get(h)*g,p.length,v)}else return p},o=Op.parseFormat(n),s=o.reduce((c,{literal:d,val:p})=>d?c:c.concat(p),[]),l=t.shiftTo(...s.map(a).filter(c=>c)),u={isNegativeDuration:l<0,largestUnit:Object.keys(l.values)[0]};return PFt(o,i(l,u))}}const MFt=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Q3(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function eV(...e){return t=>e.reduce(([n,r,a],i)=>{const[o,s,l]=i(t,a);return[{...n,...o},s||r,l]},[{},null,1]).slice(0,2)}function tV(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const a=n.exec(e);if(a)return r(a)}return[null,null]}function NFt(...e){return(t,n)=>{const r={};let a;for(a=0;a<e.length;a++)r[e[a]]=pA(t[n+a]);return[r,null,n+a]}}const LFt=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,xAa=`(?:${LFt.source}?(?:\\[(${MFt.source})\\])?)?`,ORe=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,FFt=RegExp(`${ORe.source}${xAa}`),IRe=RegExp(`(?:[Tt]${FFt.source})?`),TAa=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,DAa=/(\d{4})-?W(\d\d)(?:-?(\d))?/,AAa=/(\d{4})-?(\d{3})/,OAa=NFt("weekYear","weekNumber","weekDay"),IAa=NFt("year","ordinal"),RAa=/(\d{4})-(\d\d)-(\d\d)/,BFt=RegExp(`${ORe.source} ?(?:${LFt.source}|(${MFt.source}))?`),$Aa=RegExp(`(?: ${BFt.source})?`);function nV(e,t,n){const r=e[t];return ci(r)?n:pA(r)}function PAa(e,t){return[{year:nV(e,t),month:nV(e,t+1,1),day:nV(e,t+2,1)},null,t+3]}function rV(e,t){return[{hours:nV(e,t,0),minutes:nV(e,t+1,0),seconds:nV(e,t+2,0),milliseconds:TRe(e[t+3])},null,t+4]}function Q9(e,t){const n=!e[t]&&!e[t+1],r=Mse(e[t+1],e[t+2]),a=n?null:YC.instance(r);return[{},a,t+3]}function eG(e,t){const n=e[t]?J3.create(e[t]):null;return[{},n,t+1]}const MAa=RegExp(`^T?${ORe.source}$`),NAa=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function LAa(e){const[t,n,r,a,i,o,s,l,u]=e,c=t[0]==="-",d=l&&l[0]==="-",p=(h,g=!1)=>h!==void 0&&(g||h&&c)?-h:h;return[{years:p(JR(n)),months:p(JR(r)),weeks:p(JR(a)),days:p(JR(i)),hours:p(JR(o)),minutes:p(JR(s)),seconds:p(JR(l),l==="-0"),milliseconds:p(TRe(u),d)}]}const FAa={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function RRe(e,t,n,r,a,i,o){const s={year:t.length===2?ARe(pA(t)):pA(t),month:TFt.indexOf(n)+1,day:pA(r),hour:pA(a),minute:pA(i)};return o&&(s.second=pA(o)),e&&(s.weekday=e.length>3?AFt.indexOf(e)+1:OFt.indexOf(e)+1),s}const BAa=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function VAa(e){const[,t,n,r,a,i,o,s,l,u,c,d]=e,p=RRe(t,a,r,n,i,o,s);let h;return l?h=FAa[l]:u?h=0:h=Mse(c,d),[p,new YC(h)]}function UAa(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const HAa=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,jAa=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,zAa=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function VFt(e){const[,t,n,r,a,i,o,s]=e;return[RRe(t,a,r,n,i,o,s),YC.utcInstance]}function WAa(e){const[,t,n,r,a,i,o,s]=e;return[RRe(t,s,n,r,a,i,o),YC.utcInstance]}const GAa=Q3(TAa,IRe),qAa=Q3(DAa,IRe),KAa=Q3(AAa,IRe),YAa=Q3(FFt),UFt=eV(PAa,rV,Q9,eG),JAa=eV(OAa,rV,Q9,eG),ZAa=eV(IAa,rV,Q9,eG),XAa=eV(rV,Q9,eG);function QAa(e){return tV(e,[GAa,UFt],[qAa,JAa],[KAa,ZAa],[YAa,XAa])}function eOa(e){return tV(UAa(e),[BAa,VAa])}function tOa(e){return tV(e,[HAa,VFt],[jAa,VFt],[zAa,WAa])}function nOa(e){return tV(e,[NAa,LAa])}const rOa=eV(rV);function aOa(e){return tV(e,[MAa,rOa])}const iOa=Q3(RAa,$Aa),oOa=Q3(BFt),sOa=eV(rV,Q9,eG);function lOa(e){return tV(e,[iOa,UFt],[oOa,sOa])}const HFt="Invalid Duration",jFt={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},uOa={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...jFt},T0=146097/400,aV=146097/4800,cOa={years:{quarters:4,months:12,weeks:T0/7,days:T0,hours:T0*24,minutes:T0*24*60,seconds:T0*24*60*60,milliseconds:T0*24*60*60*1e3},quarters:{months:3,weeks:T0/28,days:T0/4,hours:T0*24/4,minutes:T0*24*60/4,seconds:T0*24*60*60/4,milliseconds:T0*24*60*60*1e3/4},months:{weeks:aV/7,days:aV,hours:aV*24,minutes:aV*24*60,seconds:aV*24*60*60,milliseconds:aV*24*60*60*1e3},...jFt},ZR=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],dOa=ZR.slice(0).reverse();function $E(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Zo(r)}function zFt(e,t){let n=t.milliseconds??0;for(const r of dOa.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function WFt(e,t){const n=zFt(e,t)<0?-1:1;ZR.reduceRight((r,a)=>{if(ci(t[a]))return r;if(r){const i=t[r]*n,o=e[a][r],s=Math.floor(i/o);t[a]+=s*n,t[r]-=s*o*n}return a},null),ZR.reduce((r,a)=>{if(ci(t[a]))return r;if(r){const i=t[r]%1;t[r]-=i,t[a]+=i*e[r][a]}return a},null)}function GFt(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class Zo{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?cOa:uOa;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||Fs.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return Zo.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new Ap(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Zo({values:Nse(t,Zo.normalizeUnit),loc:Fs.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(hA(t))return Zo.fromMillis(t);if(Zo.isDuration(t))return t;if(typeof t=="object")return Zo.fromObject(t);throw new Ap(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=nOa(t);return r?Zo.fromObject(r,n):Zo.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=aOa(t);return r?Zo.fromObject(r,n):Zo.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new Ap("need to specify a reason the Duration is invalid");const r=t instanceof A_?t:new A_(t,n);if(Mc.throwOnInvalid)throw new LDa(r);return new Zo({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new PLt(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Op.create(this.loc,r).formatDurationFromString(this,t):HFt}toHuman(t={}){if(!this.isValid)return HFt;const n=t.showZeros!==!1,r=ZR.map(a=>{const i=this.values[a];return ci(i)||i===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:a.slice(0,-1)}).format(i)}).filter(a=>a);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=DRe(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},Qr.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?zFt(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Zo.fromDurationLike(t),r={};for(const a of ZR)(Z3(n.values,a)||Z3(this.values,a))&&(r[a]=n.get(a)+this.get(a));return $E(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Zo.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=xFt(t(this.values[r],r));return $E(this,{values:n},!0)}get(t){return this[Zo.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...Nse(t,Zo.normalizeUnit)};return $E(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:a}={}){const i={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:a,conversionAccuracy:r};return $E(this,i)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return WFt(this.matrix,t),$E(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=GFt(this.normalize().shiftToAll().toObject());return $E(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>Zo.normalizeUnit(o));const n={},r={},a=this.toObject();let i;for(const o of ZR)if(t.indexOf(o)>=0){i=o;let s=0;for(const u in r)s+=this.matrix[u][o]*r[u],r[u]=0;hA(a[o])&&(s+=a[o]);const l=Math.trunc(s);n[o]=l,r[o]=(s*1e3-l*1e3)/1e3}else hA(a[o])&&(r[o]=a[o]);for(const o in r)r[o]!==0&&(n[i]+=o===i?r[o]:r[o]/this.matrix[i][o]);return WFt(this.matrix,n),$E(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return $E(this,{values:t},!0)}removeZeros(){if(!this.isValid)return this;const t=GFt(this.values);return $E(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,a){return r===void 0||r===0?a===void 0||a===0:r===a}for(const r of ZR)if(!n(this.values[r],t.values[r]))return!1;return!0}}const iV="Invalid Interval";function fOa(e,t){return!e||!e.isValid?Nc.invalid("missing or invalid start"):!t||!t.isValid?Nc.invalid("missing or invalid end"):t<e?Nc.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Nc{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new Ap("need to specify a reason the Interval is invalid");const r=t instanceof A_?t:new A_(t,n);if(Mc.throwOnInvalid)throw new NDa(r);return new Nc({invalid:r})}static fromDateTimes(t,n){const r=rG(t),a=rG(n);return fOa(r,a)??new Nc({start:r,end:a})}static after(t,n){const r=Zo.fromDurationLike(n),a=rG(t);return Nc.fromDateTimes(a,a.plus(r))}static before(t,n){const r=Zo.fromDurationLike(n),a=rG(t);return Nc.fromDateTimes(a.minus(r),a)}static fromISO(t,n){const[r,a]=(t||"").split("/",2);if(r&&a){let i,o;try{i=Qr.fromISO(r,n),o=i.isValid}catch{o=!1}let s,l;try{s=Qr.fromISO(a,n),l=s.isValid}catch{l=!1}if(o&&l)return Nc.fromDateTimes(i,s);if(o){const u=Zo.fromISO(a,n);if(u.isValid)return Nc.after(i,u)}else if(l){const u=Zo.fromISO(r,n);if(u.isValid)return Nc.before(s,u)}}return Nc.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(t,n);let a;return n!=null&&n.useLocaleWeeks?a=this.end.reconfigure({locale:r.locale}):a=this.end,a=a.startOf(t,n),Math.floor(a.diff(r,t).get(t))+(a.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Nc.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(rG).filter(o=>this.contains(o)).sort((o,s)=>o.toMillis()-s.toMillis()),r=[];let{s:a}=this,i=0;for(;a<this.e;){const o=n[i]||this.e,s=+o>+this.e?this.e:o;r.push(Nc.fromDateTimes(a,s)),a=s,i+=1}return r}splitBy(t){const n=Zo.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,a=1,i;const o=[];for(;r<this.e;){const s=this.start.plus(n.mapUnits(l=>l*a));i=+s>+this.e?this.e:s,o.push(Nc.fromDateTimes(r,i)),r=i,a+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:Nc.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return Nc.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((a,i)=>a.s-i.s).reduce(([a,i],o)=>i?i.overlaps(o)||i.abutsStart(o)?[a,i.union(o)]:[a.concat([i]),o]:[a,o],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const a=[],i=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...i),s=o.sort((l,u)=>l.time-u.time);for(const l of s)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&a.push(Nc.fromDateTimes(n,l.time)),n=null);return Nc.merge(a)}difference(...t){return Nc.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:iV}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=Tse,n={}){return this.isValid?Op.create(this.s.loc.clone(n),t).formatInterval(this):iV}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:iV}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:iV}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:iV}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:iV}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Zo.invalid(this.invalidReason)}mapEndpoints(t){return Nc.fromDateTimes(t(this.s),t(this.e))}}class oV{static hasDST(t=Mc.defaultZone){const n=Qr.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return J3.isValidZone(t)}static normalizeZone(t){return fA(t,Mc.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||Fs.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||Fs.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||Fs.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:i="gregory"}={}){return(a||Fs.create(n,r,i)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:i="gregory"}={}){return(a||Fs.create(n,r,i)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||Fs.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||Fs.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Fs.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return Fs.create(n,null,"gregory").eras(t)}static features(){return{relative:_Ft(),localeWeek:CFt()}}}function qFt(e,t){const n=a=>a.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Zo.fromMillis(r).as("days"))}function hOa(e,t,n){const r=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{const c=qFt(l,u);return(c-c%7)/7}],["days",qFt]],a={},i=e;let o,s;for(const[l,u]of r)n.indexOf(l)>=0&&(o=l,a[l]=u(e,t),s=i.plus(a),s>t?(a[l]--,e=i.plus(a),e>t&&(s=e,a[l]--,e=i.plus(a))):e=s);return[e,a,s,o]}function pOa(e,t,n,r){let[a,i,o,s]=hOa(e,t,n);const l=t-a,u=n.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(o<t&&(o=a.plus({[s]:1})),o!==a&&(i[s]=(i[s]||0)+l/(o-a)));const c=Zo.fromObject(i,r);return u.length>0?Zo.fromMillis(l,r).shiftTo(...u).plus(c):c}const mOa="missing Intl.DateTimeFormat.formatToParts support";function Is(e,t=n=>n){return{regex:e,deser:([n])=>t(iAa(n))}}const gOa=" ",KFt=`[ ${gOa}]`,YFt=new RegExp(KFt,"g");function vOa(e){return e.replace(/\./g,"\\.?").replace(YFt,KFt)}function JFt(e){return e.replace(/\./g,"").replace(YFt," ").toLowerCase()}function O_(e,t){return e===null?null:{regex:RegExp(e.map(vOa).join("|")),deser:([n])=>e.findIndex(r=>JFt(n)===JFt(r))+t}}function ZFt(e,t){return{regex:e,deser:([,n,r])=>Mse(n,r),groups:t}}function Fse(e){return{regex:e,deser:([t])=>t}}function yOa(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function bOa(e,t){const n=D_(t),r=D_(t,"{2}"),a=D_(t,"{3}"),i=D_(t,"{4}"),o=D_(t,"{6}"),s=D_(t,"{1,2}"),l=D_(t,"{1,3}"),u=D_(t,"{1,6}"),c=D_(t,"{1,9}"),d=D_(t,"{2,4}"),p=D_(t,"{4,6}"),h=v=>({regex:RegExp(yOa(v.val)),deser:([b])=>b,literal:!0}),g=(v=>{if(e.literal)return h(v);switch(v.val){case"G":return O_(t.eras("short"),0);case"GG":return O_(t.eras("long"),0);case"y":return Is(u);case"yy":return Is(d,ARe);case"yyyy":return Is(i);case"yyyyy":return Is(p);case"yyyyyy":return Is(o);case"M":return Is(s);case"MM":return Is(r);case"MMM":return O_(t.months("short",!0),1);case"MMMM":return O_(t.months("long",!0),1);case"L":return Is(s);case"LL":return Is(r);case"LLL":return O_(t.months("short",!1),1);case"LLLL":return O_(t.months("long",!1),1);case"d":return Is(s);case"dd":return Is(r);case"o":return Is(l);case"ooo":return Is(a);case"HH":return Is(r);case"H":return Is(s);case"hh":return Is(r);case"h":return Is(s);case"mm":return Is(r);case"m":return Is(s);case"q":return Is(s);case"qq":return Is(r);case"s":return Is(s);case"ss":return Is(r);case"S":return Is(l);case"SSS":return Is(a);case"u":return Fse(c);case"uu":return Fse(s);case"uuu":return Is(n);case"a":return O_(t.meridiems(),0);case"kkkk":return Is(i);case"kk":return Is(d,ARe);case"W":return Is(s);case"WW":return Is(r);case"E":case"c":return Is(n);case"EEE":return O_(t.weekdays("short",!1),1);case"EEEE":return O_(t.weekdays("long",!1),1);case"ccc":return O_(t.weekdays("short",!0),1);case"cccc":return O_(t.weekdays("long",!0),1);case"Z":case"ZZ":return ZFt(new RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case"ZZZ":return ZFt(new RegExp(`([+-]${s.source})(${r.source})?`),2);case"z":return Fse(/[a-z_+-/]{1,256}?/i);case" ":return Fse(/[^\S\n\r]/);default:return h(v)}})(e)||{invalidReason:mOa};return g.token=e,g}const wOa={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function _Oa(e,t,n){const{type:r,value:a}=e;if(r==="literal"){const l=/^\s+$/.test(a);return{literal:!l,val:l?" ":a}}const i=t[r];let o=r;r==="hour"&&(t.hour12!=null?o=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?o="hour12":o="hour24":o=n.hour12?"hour12":"hour24");let s=wOa[o];if(typeof s=="object"&&(s=s[i]),s)return{literal:!1,val:s}}function COa(e){return[`^${e.map(t=>t.regex).reduce((t,n)=>`${t}(${n.source})`,"")}$`,e]}function SOa(e,t,n){const r=e.match(t);if(r){const a={};let i=1;for(const o in n)if(Z3(n,o)){const s=n[o],l=s.groups?s.groups+1:1;!s.literal&&s.token&&(a[s.token.val[0]]=s.deser(r.slice(i,i+l))),i+=l}return[r,a]}else return[r,{}]}function kOa(e){const t=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return ci(e.z)||(n=J3.create(e.z)),ci(e.Z)||(n||(n=new YC(e.Z)),r=e.Z),ci(e.q)||(e.M=(e.q-1)*3+1),ci(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),ci(e.u)||(e.S=TRe(e.u)),[Object.keys(e).reduce((a,i)=>{const o=t(i);return o&&(a[o]=e[i]),a},{}),n,r]}let $Re=null;function EOa(){return $Re||($Re=Qr.fromMillis(1555555555555)),$Re}function xOa(e,t){if(e.literal)return e;const n=Op.macroTokenToFormatOpts(e.val),r=tBt(n,t);return r==null||r.includes(void 0)?e:r}function XFt(e,t){return Array.prototype.concat(...e.map(n=>xOa(n,t)))}class QFt{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=XFt(Op.parseFormat(n),t),this.units=this.tokens.map(r=>bOa(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,a]=COa(this.units);this.regex=RegExp(r,"i"),this.handlers=a}}explainFromTokens(t){if(this.isValid){const[n,r]=SOa(t,this.regex,this.handlers),[a,i,o]=r?kOa(r):[null,null,void 0];if(Z3(r,"a")&&Z3(r,"H"))throw new Y3("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:a,zone:i,specificOffset:o}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function eBt(e,t,n){return new QFt(e,n).explainFromTokens(t)}function TOa(e,t,n){const{result:r,zone:a,specificOffset:i,invalidReason:o}=eBt(e,t,n);return[r,a,i,o]}function tBt(e,t){if(!e)return null;const n=Op.create(t,e).dtFormatter(EOa()),r=n.formatToParts(),a=n.resolvedOptions();return r.map(i=>_Oa(i,e,a))}const PRe="Invalid DateTime",nBt=864e13;function tG(e){return new A_("unsupported zone",`the zone "${e.name}" is not supported`)}function MRe(e){return e.weekData===null&&(e.weekData=Ise(e.c)),e.weekData}function NRe(e){return e.localWeekData===null&&(e.localWeekData=Ise(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function XR(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Qr({...n,...t,old:n})}function rBt(e,t,n){let r=e-t*60*1e3;const a=n.offset(r);if(t===a)return[r,t];r-=(a-t)*60*1e3;const i=n.offset(r);return a===i?[r,a]:[e-Math.min(a,i)*60*1e3,Math.max(a,i)]}function Bse(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Vse(e,t,n){return rBt(Pse(e),t,n)}function aBt(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),a=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,i={...e.c,year:r,month:a,day:Math.min(e.c.day,$se(r,a))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=Zo.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=Pse(i);let[l,u]=rBt(s,n,e.zone);return o!==0&&(l+=o,u=e.zone.offset(l)),{ts:l,o:u}}function sV(e,t,n,r,a,i){const{setZone:o,zone:s}=n;if(e&&Object.keys(e).length!==0||t){const l=t||s,u=Qr.fromObject(e,{...n,zone:l,specificOffset:i});return o?u:u.setZone(s)}else return Qr.invalid(new A_("unparsable",`the input "${a}" can't be parsed as ${r}`))}function Use(e,t,n=!0){return e.isValid?Op.create(Fs.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function LRe(e,t,n){const r=e.c.year>9999||e.c.year<0;let a="";if(r&&e.c.year>=0&&(a+="+"),a+=Hd(e.c.year,r?6:4),n==="year")return a;if(t){if(a+="-",a+=Hd(e.c.month),n==="month")return a;a+="-"}else if(a+=Hd(e.c.month),n==="month")return a;return a+=Hd(e.c.day),a}function iBt(e,t,n,r,a,i,o){let s=!n||e.c.millisecond!==0||e.c.second!==0,l="";switch(o){case"day":case"month":case"year":break;default:if(l+=Hd(e.c.hour),o==="hour")break;if(t){if(l+=":",l+=Hd(e.c.minute),o==="minute")break;s&&(l+=":",l+=Hd(e.c.second))}else{if(l+=Hd(e.c.minute),o==="minute")break;s&&(l+=Hd(e.c.second))}if(o==="second")break;s&&(!r||e.c.millisecond!==0)&&(l+=".",l+=Hd(e.c.millisecond,3))}return a&&(e.isOffsetFixed&&e.offset===0&&!i?l+="Z":e.o<0?(l+="-",l+=Hd(Math.trunc(-e.o/60)),l+=":",l+=Hd(Math.trunc(-e.o%60))):(l+="+",l+=Hd(Math.trunc(e.o/60)),l+=":",l+=Hd(Math.trunc(e.o%60)))),i&&(l+="["+e.zone.ianaName+"]"),l}const oBt={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},DOa={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},AOa={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Hse=["year","month","day","hour","minute","second","millisecond"],OOa=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],IOa=["year","ordinal","hour","minute","second","millisecond"];function jse(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new PLt(e);return t}function sBt(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return jse(e)}}function ROa(e){if(nG===void 0&&(nG=Mc.now()),e.type!=="iana")return e.offset(nG);const t=e.name;let n=FRe.get(t);return n===void 0&&(n=e.offset(nG),FRe.set(t,n)),n}function lBt(e,t){const n=fA(t.zone,Mc.defaultZone);if(!n.isValid)return Qr.invalid(tG(n));const r=Fs.fromObject(t);let a,i;if(ci(e.year))a=Mc.now();else{for(const l of Hse)ci(e[l])&&(e[l]=oBt[l]);const o=bFt(e)||wFt(e);if(o)return Qr.invalid(o);const s=ROa(n);[a,i]=Vse(e,s,n)}return new Qr({ts:a,zone:n,loc:r,o:i})}function uBt(e,t,n){const r=ci(n.round)?!0:n.round,a=ci(n.rounding)?"trunc":n.rounding,i=(s,l)=>(s=DRe(s,r||n.calendary?0:2,n.calendary?"round":a),t.loc.clone(n).relFormatter(n).format(s,l)),o=s=>n.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(n.unit)return i(o(n.unit),n.unit);for(const s of n.units){const l=o(s);if(Math.abs(l)>=1)return i(l,s)}return i(e>t?-0:0,n.units[n.units.length-1])}function cBt(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let nG;const FRe=new Map;class Qr{constructor(t){const n=t.zone||Mc.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new A_("invalid input"):null)||(n.isValid?null:tG(n));this.ts=ci(t.ts)?Mc.now():t.ts;let a=null,i=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[a,i]=[t.old.c,t.old.o];else{const o=hA(t.o)&&!t.old?t.o:n.offset(this.ts);a=Bse(this.ts,o),r=Number.isNaN(a.year)?new A_("invalid input"):null,a=r?null:a,i=r?null:o}this._zone=n,this.loc=t.loc||Fs.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=a,this.o=i,this.isLuxonDateTime=!0}static now(){return new Qr({})}static local(){const[t,n]=cBt(arguments),[r,a,i,o,s,l,u]=n;return lBt({year:r,month:a,day:i,hour:o,minute:s,second:l,millisecond:u},t)}static utc(){const[t,n]=cBt(arguments),[r,a,i,o,s,l,u]=n;return t.zone=YC.utcInstance,lBt({year:r,month:a,day:i,hour:o,minute:s,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const r=cAa(t)?t.valueOf():NaN;if(Number.isNaN(r))return Qr.invalid("invalid input");const a=fA(n.zone,Mc.defaultZone);return a.isValid?new Qr({ts:r,zone:a,loc:Fs.fromObject(n)}):Qr.invalid(tG(a))}static fromMillis(t,n={}){if(hA(t))return t<-nBt||t>nBt?Qr.invalid("Timestamp out of range"):new Qr({ts:t,zone:fA(n.zone,Mc.defaultZone),loc:Fs.fromObject(n)});throw new Ap(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(hA(t))return new Qr({ts:t*1e3,zone:fA(n.zone,Mc.defaultZone),loc:Fs.fromObject(n)});throw new Ap("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=fA(n.zone,Mc.defaultZone);if(!r.isValid)return Qr.invalid(tG(r));const a=Fs.fromObject(n),i=Nse(t,sBt),{minDaysInFirstWeek:o,startOfWeek:s}=yFt(i,a),l=Mc.now(),u=ci(n.specificOffset)?r.offset(l):n.specificOffset,c=!ci(i.ordinal),d=!ci(i.year),p=!ci(i.month)||!ci(i.day),h=d||p,g=i.weekYear||i.weekNumber;if((h||c)&&g)throw new Y3("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&c)throw new Y3("Can't mix ordinal dates with month/day");const v=g||i.weekday&&!h;let b,_,C=Bse(l,u);v?(b=OOa,_=DOa,C=Ise(C,o,s)):c?(b=IOa,_=AOa,C=ERe(C)):(b=Hse,_=oBt);let S=!1;for(const A of b){const R=i[A];ci(R)?S?i[A]=_[A]:i[A]=C[A]:S=!0}const y=v?sAa(i,o,s):c?lAa(i):bFt(i),T=y||wFt(i);if(T)return Qr.invalid(T);const k=v?gFt(i,o,s):c?vFt(i):i,[E,I]=Vse(k,u,r),D=new Qr({ts:E,zone:r,o:I,loc:a});return i.weekday&&h&&t.weekday!==D.weekday?Qr.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${D.toISO()}`):D.isValid?D:Qr.invalid(D.invalid)}static fromISO(t,n={}){const[r,a]=QAa(t);return sV(r,a,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,a]=eOa(t);return sV(r,a,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,a]=tOa(t);return sV(r,a,n,"HTTP",n)}static fromFormat(t,n,r={}){if(ci(t)||ci(n))throw new Ap("fromFormat requires an input string and a format");const{locale:a=null,numberingSystem:i=null}=r,o=Fs.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0}),[s,l,u,c]=TOa(o,t,n);return c?Qr.invalid(c):sV(s,l,r,`format ${n}`,t,u)}static fromString(t,n,r={}){return Qr.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,a]=lOa(t);return sV(r,a,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new Ap("need to specify a reason the DateTime is invalid");const r=t instanceof A_?t:new A_(t,n);if(Mc.throwOnInvalid)throw new MDa(r);return new Qr({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=tBt(t,Fs.fromObject(n));return r?r.map(a=>a?a.val:null).join(""):null}static expandFormat(t,n={}){return XFt(Op.parseFormat(t),Fs.fromObject(n)).map(r=>r.val).join("")}static resetCache(){nG=void 0,FRe.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?MRe(this).weekYear:NaN}get weekNumber(){return this.isValid?MRe(this).weekNumber:NaN}get weekday(){return this.isValid?MRe(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?NRe(this).weekday:NaN}get localWeekNumber(){return this.isValid?NRe(this).weekNumber:NaN}get localWeekYear(){return this.isValid?NRe(this).weekYear:NaN}get ordinal(){return this.isValid?ERe(this.c).ordinal:NaN}get monthShort(){return this.isValid?oV.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?oV.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?oV.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?oV.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,r=Pse(this.c),a=this.zone.offset(r-t),i=this.zone.offset(r+t),o=this.zone.offset(r-a*n),s=this.zone.offset(r-i*n);if(o===s)return[this];const l=r-o*n,u=r-s*n,c=Bse(l,o),d=Bse(u,s);return c.hour===d.hour&&c.minute===d.minute&&c.second===d.second&&c.millisecond===d.millisecond?[XR(this,{ts:l}),XR(this,{ts:u})]:[this]}get isInLeapYear(){return J9(this.year)}get daysInMonth(){return $se(this.year,this.month)}get daysInYear(){return this.isValid?X3(this.year):NaN}get weeksInWeekYear(){return this.isValid?Z9(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Z9(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:a}=Op.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:a}}toUTC(t=0,n={}){return this.setZone(YC.instance(t),n)}toLocal(){return this.setZone(Mc.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=fA(t,Mc.defaultZone),t.equals(this.zone))return this;if(t.isValid){let a=this.ts;if(n||r){const i=t.offset(this.ts),o=this.toObject();[a]=Vse(o,i,t)}return XR(this,{ts:a,zone:t})}else return Qr.invalid(tG(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const a=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return XR(this,{loc:a})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=Nse(t,sBt),{minDaysInFirstWeek:r,startOfWeek:a}=yFt(n,this.loc),i=!ci(n.weekYear)||!ci(n.weekNumber)||!ci(n.weekday),o=!ci(n.ordinal),s=!ci(n.year),l=!ci(n.month)||!ci(n.day),u=s||l,c=n.weekYear||n.weekNumber;if((u||o)&&c)throw new Y3("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new Y3("Can't mix ordinal dates with month/day");let d;i?d=gFt({...Ise(this.c,r,a),...n},r,a):ci(n.ordinal)?(d={...this.toObject(),...n},ci(n.day)&&(d.day=Math.min($se(d.year,d.month),d.day))):d=vFt({...ERe(this.c),...n});const[p,h]=Vse(d,this.o,this.zone);return XR(this,{ts:p,o:h})}plus(t){if(!this.isValid)return this;const n=Zo.fromDurationLike(t);return XR(this,aBt(this,n))}minus(t){if(!this.isValid)return this;const n=Zo.fromDurationLike(t).negate();return XR(this,aBt(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},a=Zo.normalizeUnit(t);switch(a){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(a==="weeks")if(n){const i=this.loc.getStartOfWeek(),{weekday:o}=this;o<i&&(r.weekNumber=this.weekNumber-1),r.weekday=i}else r.weekday=1;if(a==="quarters"){const i=Math.ceil(this.month/3);r.month=(i-1)*3+1}return this.set(r)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?Op.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):PRe}toLocaleString(t=Tse,n={}){return this.isValid?Op.create(this.loc.clone(n),t).formatDateTime(this):PRe}toLocaleParts(t={}){return this.isValid?Op.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:a=!0,extendedZone:i=!1,precision:o="milliseconds"}={}){if(!this.isValid)return null;o=jse(o);const s=t==="extended";let l=LRe(this,s,o);return Hse.indexOf(o)>=3&&(l+="T"),l+=iBt(this,s,n,r,a,i,o),l}toISODate({format:t="extended",precision:n="day"}={}){return this.isValid?LRe(this,t==="extended",jse(n)):null}toISOWeekDate(){return Use(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:a=!1,extendedZone:i=!1,format:o="extended",precision:s="milliseconds"}={}){return this.isValid?(s=jse(s),(a&&Hse.indexOf(s)>=3?"T":"")+iBt(this,o==="extended",n,t,r,i,s)):null}toRFC2822(){return Use(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Use(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?LRe(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let a="HH:mm:ss.SSS";return(n||t)&&(r&&(a+=" "),n?a+="z":t&&(a+="ZZ")),Use(this,a,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():PRe}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Zo.invalid("created by diffing an invalid DateTime");const a={locale:this.locale,numberingSystem:this.numberingSystem,...r},i=dAa(n).map(Zo.normalizeUnit),o=t.valueOf()>this.valueOf(),s=o?this:t,l=o?t:this,u=pOa(s,l,i,a);return o?u.negate():u}diffNow(t="milliseconds",n={}){return this.diff(Qr.now(),t,n)}until(t){return this.isValid?Nc.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const a=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n,r)<=a&&a<=i.endOf(n,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||Qr.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let a=["years","months","days","hours","minutes","seconds"],i=t.unit;return Array.isArray(t.unit)&&(a=t.unit,i=void 0),uBt(n,this.plus(r),{...t,numeric:"always",units:a,unit:i})}toRelativeCalendar(t={}){return this.isValid?uBt(t.base||Qr.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(Qr.isDateTime))throw new Ap("min requires all arguments be DateTimes");return SFt(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(Qr.isDateTime))throw new Ap("max requires all arguments be DateTimes");return SFt(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:a=null,numberingSystem:i=null}=r,o=Fs.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0});return eBt(o,t,n)}static fromStringExplain(t,n,r={}){return Qr.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:a=null}=n,i=Fs.fromOpts({locale:r,numberingSystem:a,defaultToEN:!0});return new QFt(i,t)}static fromFormatParser(t,n,r={}){if(ci(t)||ci(n))throw new Ap("fromFormatParser requires an input string and a format parser");const{locale:a=null,numberingSystem:i=null}=r,o=Fs.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0});if(!o.equals(n.locale))throw new Ap(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);const{result:s,zone:l,specificOffset:u,invalidReason:c}=n.explainFromTokens(t);return c?Qr.invalid(c):sV(s,l,r,`format ${n.format}`,t,u)}static get DATE_SHORT(){return Tse}static get DATE_MED(){return MLt}static get DATE_MED_WITH_WEEKDAY(){return FDa}static get DATE_FULL(){return NLt}static get DATE_HUGE(){return LLt}static get TIME_SIMPLE(){return FLt}static get TIME_WITH_SECONDS(){return BLt}static get TIME_WITH_SHORT_OFFSET(){return VLt}static get TIME_WITH_LONG_OFFSET(){return ULt}static get TIME_24_SIMPLE(){return HLt}static get TIME_24_WITH_SECONDS(){return jLt}static get TIME_24_WITH_SHORT_OFFSET(){return zLt}static get TIME_24_WITH_LONG_OFFSET(){return WLt}static get DATETIME_SHORT(){return GLt}static get DATETIME_SHORT_WITH_SECONDS(){return qLt}static get DATETIME_MED(){return KLt}static get DATETIME_MED_WITH_SECONDS(){return YLt}static get DATETIME_MED_WITH_WEEKDAY(){return BDa}static get DATETIME_FULL(){return JLt}static get DATETIME_FULL_WITH_SECONDS(){return ZLt}static get DATETIME_HUGE(){return XLt}static get DATETIME_HUGE_WITH_SECONDS(){return QLt}}function rG(e){if(Qr.isDateTime(e))return e;if(e&&e.valueOf&&hA(e.valueOf()))return Qr.fromJSDate(e);if(e&&typeof e=="object")return Qr.fromObject(e);throw new Ap(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const $Oa="account.last_prefered_timezone",dBt=500,POa=()=>PDa($Oa)||"UTC",fBt={headphone:["headphones","headset"],sofa:["couch"],couch:["sofa"],run:["running","runner"]},BRe=e=>e.toLowerCase().trim(),MOa=e=>BRe(e).split(/\s+/).filter(Boolean),hBt=e=>e.replace(/(ing|ed|s)$/i,"");function NOa(e){const t=new Set;for(const n of e){const r=hBt(n);if(t.add(r),t.add(n),fBt[r])for(const a of fBt[r])t.add(hBt(a))}return Array.from(t)}function LOa(e,t){const n=BRe(e),r=NOa(MOa(t));let a=0;for(const i of r)i&&(n.includes(i)&&(a+=i.length*2),n.startsWith(i)&&(a+=3));return a}function FOa(e,t){const n=i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=t.split(/\s+/).filter(Boolean).map(n);if(!r.length)return e;const a=new RegExp(`(${r.join("|")})`,"ig");return e.replace(a,"<mark>$1</mark>")}const BOa=e=>{if(e!==null){if(Number(e.metric_type.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number(e.metric_type.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number(e.metric_type.id)==3)return"formula"}},VRe=e=>!isNaN(e)&&isFinite(e),URe=(e,t)=>{var n;const{restricted_type:r}=e,a=Math.floor(Number(t)),i=((n=e.restricted_value)==null?void 0:n.split(",").map(Number))||[];if(r=="none")return!0;if(e.restricted_type=="not")return VRe(a)&&!i.includes(a);if(e.restricted_type=="range"){const[o,s]=i;return VRe(Number(t))&&Number(t)>=Number(o)&&Number(t)<=Number(s)}else if(r=="exact")return VRe(a)&&i.includes(a);return!1};/*! js-cookie v3.0.5 | MIT */function zse(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var VOa={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function HRe(e,t){function n(a,i,o){if(!(typeof document>"u")){o=zse({},t,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var l in o)o[l]&&(s+="; "+l,o[l]!==!0&&(s+="="+o[l].split(";")[0]));return document.cookie=a+"="+e.write(i,a)+s}}function r(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var i=document.cookie?document.cookie.split("; "):[],o={},s=0;s<i.length;s++){var l=i[s].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(o[c]=e.read(u,c),a===c)break}catch{}}return a?o[a]:o}}return Object.create({set:n,get:r,remove:function(a,i){n(a,"",zse({},i,{expires:-1}))},withAttributes:function(a){return HRe(this.converter,zse({},this.attributes,a))},withConverter:function(a){return HRe(zse({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var jRe=HRe(VOa,{path:"/"});const pBt=()=>jRe.get("account.last_prefered_timezone")||"UTC",UOa=(e,t,n)=>{const r=W("Copy"),a=()=>{setTimeout(()=>{r.value="Copy"},5e3)};return{copyToClipboard:async i=>{i.stopPropagation(),i.preventDefault(),i.stopImmediatePropagation();try{return await navigator.clipboard.writeText(e),r.value="Copied",t==null||t(),a(),!0}catch(o){return console.error("Failed to copy text to clipboard:",o),r.value="Copy failed",a(),!1}},tooltip:r}},HOa=(e,t,n)=>{const r={truncate:"End date cleared because it was before start. Please pick an end date.",swap:"Dates auto-swapped because start was after end.",...e.messages},a=Wn({startDate:null,endDate:null,timezone:e.timezone||"UTC",format:e.format||"",isSelectingStart:!1,isSelectingEnd:!1,rangeFeedback:{status:"idle",action:null,message:""},cacheStartDate:null,cacheEndDate:null,isDirty:!1});ko(()=>{var A;((A=e.value)==null?void 0:A.length)===2&&(a.startDate=e.value[0],a.endDate=e.value[1]),a.cacheStartDate=a.startDate,a.cacheEndDate=a.endDate,a.isSelectingStart=!1,a.isSelectingEnd=!1,e.timezone&&(a.timezone=e.timezone)});const i=W(!1),o=W(!1),s=()=>{var A,R,B,P,$,V,N,q;const J=i.value||((R=(A=a.startDate)==null?void 0:A.getTime)==null?void 0:R.call(A))!==((P=(B=a.cacheStartDate)==null?void 0:B.getTime)==null?void 0:P.call(B)),ie=o.value||((V=($=a.endDate)==null?void 0:$.getTime)==null?void 0:V.call($))!==((q=(N=a.cacheEndDate)==null?void 0:N.getTime)==null?void 0:q.call(N)),de=a.startDate===null,ee=a.endDate===null;let j,U;J&&ie&&de&&ee?(j=!0,U=!0,t("clearAll")):J&&!ie?(j=!0,de?t("clearStart"):t("update:start",a.startDate)):ie&&!J?(U=!0,ee?t("clearDue"):t("update:end",a.endDate)):J&&ie&&(j=!0,U=!0,t("update",[a.startDate,a.endDate])),!(!j&&!U)&&(j&&!U?t("confirmed",{start:a.startDate}):!j&&U?t("confirmed",{end:a.endDate}):t("confirmed",{start:a.startDate,end:a.endDate}),a.isDirty=J||ie)},l=(A,R)=>{const B=Qr.fromObject({year:A.year,month:A.month,day:A.day},{zone:a.timezone});return(R==="start"?B.startOf("day"):B.endOf("day")).toJSDate()},u=()=>{a.rangeFeedback.status="idle",a.rangeFeedback.action=null,a.rangeFeedback.message=""},c=A=>{e.enableRangeFeedback&&(a.rangeFeedback.status="corrected",a.rangeFeedback.action=A,a.rangeFeedback.message=A==="swap"?r.swap:r.truncate)},d=A=>{if(!(!a.startDate||!a.endDate)){if(a.startDate.getTime()<=a.endDate.getTime()){e.enableRangeFeedback&&u();return}if(A==="select-start"){const R={start:a.startDate,end:a.endDate};a.endDate=null,t("range:invalid",R),t("range:corrected",{start:a.startDate,end:a.endDate,action:"truncate"}),a.isSelectingEnd=!0,c("truncate")}else{const R={start:a.startDate,end:a.endDate},B=a.startDate;a.startDate=a.endDate,a.endDate=B,t("range:invalid",R),t("range:corrected",{start:a.startDate,end:a.endDate,action:"swap"}),c("swap")}}},p=W(!1),h=W(!1),g=(A,R=!0)=>{i.value=!0,p.value=!1,!(e.disabled||e.readOnly)&&(a.startDate=l(A,"start"),R?(a.isSelectingStart=!1,a.isSelectingEnd=!0):(a.isSelectingStart=!0,a.isSelectingEnd=!1),d("select-start"))},v=A=>{o.value=!0,h.value=!1,!(e.disabled||e.readOnly)&&(a.endDate=l(A,"end"),d("select-end"))},b=()=>{i.value=!0,!(e.disabled||e.readOnly)&&(a.startDate=null,u())},_=()=>{o.value=!0,!(e.disabled||e.readOnly)&&(a.endDate=null,u())},C=()=>{i.value=!0,o.value=!0,!(e.disabled||e.readOnly)&&(a.startDate=null,a.endDate=null,u(),y())},S=()=>{e.disabled||e.readOnly||a.isDirty||(a.cacheStartDate=a.startDate,a.cacheEndDate=a.endDate)},y=()=>{e.disabled||e.readOnly||(s(),a.cacheStartDate=a.startDate,a.cacheEndDate=a.endDate,a.isDirty=!1)},T=()=>{e.disabled||e.readOnly||(a.startDate=a.cacheStartDate,a.endDate=a.cacheEndDate,u(),a.isDirty=!1)},k=z(()=>a.startDate?Qr.fromJSDate(a.startDate,{zone:a.timezone}).toFormat(a.format):e.startPlaceholder),E=z(()=>a.endDate?Qr.fromJSDate(a.endDate,{zone:a.timezone}).toFormat(a.format):e.duePlaceholder),I=z(()=>!a.startDate&&!e.disabled?e.startTooltip:!a.startDate&&(e.disabled||e.readOnly)?e.startPlaceholder:a.startDate?Qr.fromJSDate(a.startDate,{zone:a.timezone}).toFormat("LLL dd, yyyy | HH:mm:ss"):e.startTooltip),D=z(()=>!a.endDate&&!e.disabled?e.dueTooltip:!a.endDate&&(e.disabled||e.readOnly)?e.startPlaceholder:a.endDate?Qr.fromJSDate(a.endDate,{zone:a.timezone}).toFormat("LLL dd, yyyy | HH:mm:ss"):e.dueTooltip);return{states:a,displayStartDate:k,displayEndDate:E,tooltipStartDate:I,tooltipEndDate:D,showMultipleDueDates:h,showMultipleStartDates:p,selectEndDate:v,selectStartDate:g,clearDue:_,clearStart:b,clearAll:C,beginInteraction:S,confirmSelection:y,cancelSelection:T}};ze.env.NODE_ENV,ze.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();var mBt;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(mBt||(mBt={})),ze.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Wse(e){const t=W(!1),n=W(!1),r=z(()=>{var u;const c=e.value,d=!!c.readOnly;return{readOnly:d,disabled:!!c.disabled,hovered:n.value,focused:t.value,isEmpty:c.empty??!1,error:!!c.error,actived:!!((u=c.active)!=null&&u.value),clickable:d?!1:c.clickable??!1}}),a=()=>{t.value=!0,Ct(()=>{const u=l(e.value.inputRef);u==null||u.focus()})},i=()=>{t.value=!1},o=()=>{n.value=!0},s=()=>{n.value=!1},l=u=>{if(!u)return null;const c=u.value||u;return(c instanceof HTMLElement?c:c==null?void 0:c.$el)||null};return nn(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.addEventListener("focus",a),u.addEventListener("blur",i)),c&&(c.addEventListener("mouseenter",o),c.addEventListener("mouseleave",s))}),$r(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.removeEventListener("focus",a),u.removeEventListener("blur",i)),c&&(c.removeEventListener("mouseenter",o),c.removeEventListener("mouseleave",s))}),{isFocus:t,isHover:n,argsMain:r,handleFocus:a}}const gBt=e=>{const t=W(!1),n=z(()=>t.value);return nn(()=>{var r,a,i,o;const s=(r=e.params)==null?void 0:r.api,l=(a=e.params)==null?void 0:a.node,u=l==null?void 0:l.rowIndex,c=(o=(i=e.params)==null?void 0:i.colDef)==null?void 0:o.field;return s==null||s.addEventListener("cellEditingStarted",d=>{d.rowIndex===u&&d.colDef.field===c&&(t.value=!0)}),s==null||s.addEventListener("cellEditingStopped",d=>{d.rowIndex===u&&d.colDef.field===c&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}};POa();const jOa=["src","width","height","alt"],zOa=ct({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=RIe,{getCachedValue:n,setCachedValue:r}=nRe({dbName:"visual-cache-db",storeName:"visuals"}),a=p=>{if(p!==void 0)return typeof p=="number"?`${p}px`:typeof p=="string"&&/^\d+$/.test(p)?`${p}px`:p},i=e,o=z(()=>({minWidth:a(i.minWidth),maxWidth:a(i.maxWidth),minHeight:a(i.minHeight),maxHeight:a(i.maxHeight),aspectRatio:i.ratio,width:a(i.size)})),s=async p=>{const h=await n(p);if(typeof h=="string")return h},l=async(p,h)=>{await r(p,h)},u=z(()=>({name:i.src,size:Number(i.size||100),color:""})),{url:c,loading:d}=DLt(u,"visual",l,s);return(p,h)=>ft((L(),re("div",{class:ke([p.$style.visualWrapper,{[p.$style.loading]:F(d)}]),style:Yt(o.value)},[be("img",{src:F(c),width:e.size,height:e.size,alt:"visual-"+e.src,style:Yt(o.value)},null,12,jOa)],6)),[[F(t),{isLoading:F(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),WOa="_visualWrapper_lvp0k_1",GOa="_loading_lvp0k_8",qOa="_pulse_lvp0k_1",KOa={visualWrapper:WOa,loading:GOa,pulse:qOa},YOa={$style:KOa},JOa=Tp(zOa,[["__cssModules",YOa]]),ZOa=["tabindex"],XOa=ct({__name:"DisplayWrapper",props:{prefix:{},suffix:{},inputType:{},readOnly:{type:Boolean},disabled:{type:Boolean},hovered:{type:Boolean},focused:{type:Boolean},error:{type:Boolean},actived:{type:Boolean},clickable:{type:Boolean},size:{},bordered:{type:Boolean},tabIndex:{}},emits:["event","escape"],setup(e,{expose:t,emit:n}){const r=e,a=n;el();const i=Cf(),o=W(null),s=W("default"),l=z(()=>{if(typeof r.size=="number")return`${r.size}px`;switch(r.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),u=z(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),c=z(()=>({[i["display-wrapper"]]:!0,[i.disabled]:r.disabled,[i.readOnly]:r.readOnly,[i.error]:r.error,[i.clickable]:r.clickable,[i.active]:r.actived,[i.hovered]:r.hovered,[i.focused]:!r.readOnly&&!r.disabled&&r.focused,[i.bordered]:r.bordered})),d=()=>{var v,b;const _=((v=o.value)==null?void 0:v.querySelectorAll(":scope > .wrapper-prefix").length)||0,C=((b=o.value)==null?void 0:b.querySelectorAll(":scope > .wrapper-suffix").length)||0,S="var(--icon-size)",y=`calc(var(--gap-size) * ${_+C})`;return _&&!C?`repeat(${_}, ${S}) calc(100% - (${_} * ${S} + ${y}))`:!_&&C?`calc(100% - (${C} * ${S} + ${y})) repeat(${C}, ${S})`:_&&C?`repeat(${_}, ${S}) calc(100% - (${_} * ${S} + ${C} * ${S} + ${y})) repeat(${C}, ${S})`:"100%"},p=W("100%"),h=()=>{p.value=d()};jg(()=>{h()}),nn(()=>{h()});const g=v=>{s.value=v};return t({rootEl:o,updateState:g,componentState:s,focus:()=>{Ct(()=>{var v;(v=o.value)==null||v.focus()})},escape:()=>{a("escape")}}),(v,b)=>(L(),re("div",{ref_key:"rootEl",ref:o,class:ke([F(i)["display-wrapper"],c.value]),tabindex:e.tabIndex,style:Yt({"--grid-template":p.value,"--wrapper-size":l.value,"--loading-overlay-width":u.value})},[at(v.$slots,"prefix",{hovered:r.hovered,focused:r.focused}),at(v.$slots,"default",{hovered:r.hovered,focused:r.focused,updateComponentState:g,disabled:r.disabled}),at(v.$slots,"suffix",{hovered:r.hovered,focused:r.focused})],14,ZOa))}}),QOa="_readOnly_46uq2_26",e2a="_bordered_46uq2_29",t2a="_disabled_46uq2_29",n2a="_active_46uq2_29",r2a="_focused_46uq2_29",a2a="_hovered_46uq2_33",i2a="_error_46uq2_37",o2a="_clickable_46uq2_50",s2a="_suffix_46uq2_56",l2a="_prefix_46uq2_57",u2a={"display-wrapper":"_display-wrapper_46uq2_1",readOnly:QOa,bordered:e2a,disabled:t2a,active:n2a,focused:r2a,hovered:a2a,error:i2a,clickable:o2a,suffix:s2a,prefix:l2a},c2a={$style:u2a},Gse=Tp(XOa,[["__cssModules",c2a]]),d2a=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const f2a=Object.prototype.toString,h2a=e=>f2a.call(e)==="[object Object]",lV=()=>{};function p2a(e,t){function n(...r){return new Promise((a,i)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(a).catch(i)})}return n}function m2a(e,t={}){let n,r,a=lV;const i=s=>{clearTimeout(s),a(),a=lV};let o;return s=>{const l=xn(e),u=xn(t.maxWait);return n&&i(n),l<=0||u!==void 0&&u<=0?(r&&(i(r),r=void 0),Promise.resolve(s())):new Promise((c,d)=>{a=t.rejectOnCancel?d:c,o=s,u&&!r&&(r=setTimeout(()=>{n&&i(n),r=void 0,c(o())},u)),n=setTimeout(()=>{r&&i(r),r=void 0,c(s())},l)})}}function zRe(e){return Array.isArray(e)?e:[e]}function g2a(e,t=200,n={}){return p2a(m2a(t,n),e)}function v2a(e,t,n){return lt(e,t,{...n,immediate:!0})}const vBt=d2a?window:void 0;function aG(e){var t;const n=xn(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function WRe(...e){const t=(r,a,i,o)=>(r.addEventListener(a,i,o),()=>r.removeEventListener(a,i,o)),n=z(()=>{const r=zRe(xn(e[0])).filter(a=>a!=null);return r.every(a=>typeof a!="string")?r:void 0});return v2a(()=>{var r,a;return[(r=(a=n.value)===null||a===void 0?void 0:a.map(i=>aG(i)))!==null&&r!==void 0?r:[vBt].filter(i=>i!=null),zRe(xn(n.value?e[1]:e[0])),zRe(F(n.value?e[2]:e[1])),xn(n.value?e[3]:e[2])]},([r,a,i,o],s,l)=>{if(!(r!=null&&r.length)||!(a!=null&&a.length)||!(i!=null&&i.length))return;const u=h2a(o)?{...o}:o,c=r.flatMap(d=>a.flatMap(p=>i.map(h=>t(d,p,h,u))));l(()=>{c.forEach(d=>d())})},{flush:"post"})}function y2a(e,t,n={}){const{window:r=vBt,ignore:a=[],capture:i=!0,detectIframe:o=!1,controls:s=!1}=n;if(!r)return s?{stop:lV,cancel:lV,trigger:lV}:lV;let l=!0;const u=b=>xn(a).some(_=>{if(typeof _=="string")return Array.from(r.document.querySelectorAll(_)).some(C=>C===b.target||b.composedPath().includes(C));{const C=aG(_);return C&&(b.target===C||b.composedPath().includes(C))}});function c(b){const _=xn(b);return _&&_.$.subTree.shapeFlag===16}function d(b,_){const C=xn(b),S=C.$.subTree&&C.$.subTree.children;return S==null||!Array.isArray(S)?!1:S.some(y=>y.el===_.target||_.composedPath().includes(y.el))}const p=b=>{const _=aG(e);if(b.target!=null&&!(!(_ instanceof Element)&&c(e)&&d(e,b))&&!(!_||_===b.target||b.composedPath().includes(_))){if("detail"in b&&b.detail===0&&(l=!u(b)),!l){l=!0;return}t(b)}};let h=!1;const g=[WRe(r,"click",b=>{h||(h=!0,setTimeout(()=>{h=!1},0),p(b))},{passive:!0,capture:i}),WRe(r,"pointerdown",b=>{const _=aG(e);l=!u(b)&&!!(_&&!b.composedPath().includes(_))},{passive:!0}),o&&WRe(r,"blur",b=>{setTimeout(()=>{var _;const C=aG(e);((_=r.document.activeElement)===null||_===void 0?void 0:_.tagName)==="IFRAME"&&!(C!=null&&C.contains(r.document.activeElement))&&t(b)},0)},{passive:!0})].filter(Boolean),v=()=>g.forEach(b=>b());return s?{stop:v,cancel:()=>{l=!1},trigger:b=>{l=!0,p(b),l=!1}}:v}const b2a=["value","placeholder","disabled","readonly","inputmode","maxlength"],w2a=ct({__name:"InputText",props:{type:{default:"text"},autoEmit:{type:Boolean,default:!1},debounceDelay:{default:300},selectOnFocus:{type:Boolean,default:!1},submitOnEnter:{type:Boolean,default:!0},blurOnEscape:{type:Boolean,default:!0},maxDecimalChar:{},modelValue:{},placeholder:{},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{}},emits:["update:modelValue","input","clear","focus","blur","change","enterValue","enter","escape","cancel","tab","keydown","keyup","paste","cut","select","onValidation"],setup(e,{expose:t,emit:n}){const r=OIe,a=qC,i=e,o=n,s=W(null),l=W(i.modelValue||"");lt(l,()=>{o("onValidation",l.value)});const u=W(!1),c=W(i.modelValue||"");lt(()=>i.modelValue,j=>{l.value=j||"",c.value=j||""});const d=z(()=>{var j;return((j=l.value)==null?void 0:j.length)>0}),p={text:j=>j.slice(0,i.maxLength||255),number:j=>{let U=j.replace(/[^\d.-]/g,"");const Z=U.split(".");Z.length>2&&(U=Z[0]+"."+Z.slice(1).join("")),U=U.replace(/-/g,(ae,G)=>G===0?ae:"");const oe=U.startsWith("-")?"-":"",fe=U.replace("-","").split(".");return fe[0].length>17&&(fe[0]=fe[0].substring(0,17)),i.maxDecimalChar!==void 0&&fe.length>1&&(fe[1]=fe[1].substring(0,i.maxDecimalChar)),U=oe+fe.join("."),U},email:j=>j.replace(/\s/g,"").slice(0,i.maxLength||255),url:j=>j.replace(/\s/g,"").slice(0,i.maxLength||255),tel:j=>j.replace(/[^\d+\-() ]/g,"").slice(0,i.maxLength||20)},h=j=>{const U=p[i.type];return U?U(j):j},g=g2a(j=>{i.autoEmit&&(o("update:modelValue",j),o("input",j))},i.debounceDelay),v=j=>{const U=j;if(i.disabled||i.readOnly){U.preventDefault();return}const Z=U.target,oe=Z.selectionStart||0,fe=l.value,ae=h(Z.value);fe!==ae&&(l.value=ae,o("input",ae),i.autoEmit&&g(ae),Z.value!==ae&&(Z.value=ae,Ct(()=>{let G=oe;if(ae.length<Z.value.length)G=oe;else{const Y=ae.length-fe.length;G=oe+Y}G=Math.max(0,Math.min(G,ae.length)),Z.setSelectionRange(G,G)})))},b=j=>{if(i.disabled||i.readOnly){j.preventDefault();return}u.value=!0;const U=l.value;l.value="",o("update:modelValue",""),o("clear"),U!==""&&o("change",""),j.preventDefault(),j.stopImmediatePropagation(),j.stopPropagation(),Ct(()=>{var Z;(Z=s.value)==null||Z.focus(),setTimeout(()=>{u.value=!1},100)})},_=j=>{i.disabled||i.readOnly||(o("focus",j),i.selectOnFocus&&Ct(()=>{j.target.select()}))},C=j=>{if(u.value)return;const U=j.target.value;i.autoEmit||o("update:modelValue",U),c.value!==U&&(o("change",U),c.value=U),o("blur",U,j)},S=j=>{setTimeout(()=>{Ct(()=>{const U=j.target.value;o("enter",U,j),o("enterValue",U),i.submitOnEnter&&(j.preventDefault(),i.autoEmit||o("update:modelValue",U),c.value!==U&&(o("change",U),c.value=U))})},1e3)},y=j=>{const U=j.target,Z=U.value;if(o("escape",Z,j),j.preventDefault(),j.stopImmediatePropagation(),j.stopPropagation(),i.autoEmit){o("cancel"),i.blurOnEscape&&U.blur();return}l.value=i.modelValue||"",s.value&&(s.value.value=l.value),o("cancel"),i.blurOnEscape&&U.blur()},T=j=>{const U=j.target.value;o("tab",U,j),i.autoEmit||(o("update:modelValue",U),c.value!==U&&(o("change",U),c.value=U))},k=(j,U,Z)=>j===""?!0:j==="."?Z>0:new RegExp(`^\\d{0,${U}}(\\.\\d{0,${Z}})?$`).test(j),E=j=>{if(o("keydown",j),j.key===" "&&j.stopPropagation(),i.type==="number"){if(j.key==="e"||j.key==="E"){j.preventDefault();return}if(!(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"].includes(j.key)||j.ctrlKey||j.metaKey||j.altKey)){if(Number.isNaN(Number(j.key))&&j.key!=="."&&j.key!=="-"){j.preventDefault();return}const U=l.value+j.key;if(!k(U,17,i.maxDecimalChar||2)){j.preventDefault();return}}}j.key==="Escape"?y(j):j.key==="Enter"?S(j):j.key==="Tab"?T(j):(j.key==="ArrowUp"||j.key==="ArrowDown")&&i.type==="number"&&j.preventDefault()},I=j=>{o("keyup",j)},D=j=>{if(i.disabled||i.readOnly){j.preventDefault();return}o("paste",j)},A=j=>{if(i.disabled||i.readOnly){j.preventDefault();return}o("cut",j)},R=j=>{o("select",j)},B=`input-text-${Math.random().toString(36).substr(2,9)}`,P=W(!1),$=z(()=>{switch(i.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});lt(()=>l.value,j=>{i.validatorFnc?P.value=!!j&&!i.validatorFnc(j):P.value=!1});const V=W(null),N=z(()=>({disabled:i.disabled,readOnly:i.readOnly,error:P.value,inputRef:s,clickable:!i.disabled&&!i.readOnly,focused:i.focused,wrapperRef:V,bordered:!0})),{argsMain:q,isHover:J,isFocus:ie}=Wse(N);t({triggerFocus:()=>{Ct(()=>{var j;(j=s.value)==null||j.focus()})},focus:()=>{de()},blur:()=>{Ct(()=>{var j;(j=s.value)==null||j.blur()})},select:()=>{Ct(()=>{var j;(j=s.value)==null||j.select()})},setSelectionRange:(j,U)=>{Ct(()=>{var Z;(Z=s.value)==null||Z.setSelectionRange(j,U)})},getValue:()=>l.value,setValue:j=>{l.value=h(j),s.value&&(s.value.value=l.value)},reset:()=>{l.value=i.modelValue||"",s.value&&(s.value.value=l.value)}});const de=()=>{!i.disabled&&!i.readOnly&&Ct(()=>{var j;(j=s.value)==null||j.focus()})},ee=z(()=>ie.value&&d.value);return(j,U)=>(L(),re("div",{class:ke([j.$style["input-wrapper"],"input-editor"]),onClick:de},[ft((L(),qe(Gse,Zt(F(q),{ref_key:"wrapperRef",ref:V,class:[j.$style["input-box"],{[j.$style["is-hovered"]]:F(J),[j.$style["is-focused"]]:F(ie),[j.$style["has-input"]]:d.value,[j.$style["is-editting"]]:ee.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:i.bordered}),{prefix:Re(()=>[at(j.$slots,"prefix")]),suffix:Re(()=>[d.value&&!i.disabled&&!i.readOnly?at(j.$slots,"clear",{key:0},()=>[ft((L(),qe(ym,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:Ot(b,["prevent","stop"]),size:18,rounded:!0,class:ke(["wrapper-suffix",j.$style["clear-button"]])},{default:Re(()=>[De(Dp,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[F(a),{content:"Clear",contentClass:"extra-padding"}]])]):at(j.$slots,"suffix",{key:1})]),default:Re(()=>[be("input",{tabindex:"-1",ref_key:"inputRef",ref:s,type:"text",value:l.value,placeholder:e.placeholder,class:ke([j.$style["column-config__input"]]),id:B,disabled:e.disabled,readonly:e.readOnly,inputmode:$.value,maxlength:i.maxLength,onInput:v,onFocus:_,onBlur:C,onKeydown:E,onKeyup:I,onPaste:D,onCut:A,onSelect:R},null,42,b2a)]),_:3},16,["class","bordered"])),[[F(r),i.focusIndex]]),P.value?at(j.$slots,"error",{key:0}):Ve("",!0)],2))}}),_2a={"input-box":"_input-box_1p4v0_1","is-disabled":"_is-disabled_1p4v0_16","is-readonly":"_is-readonly_1p4v0_16","is-hovered":"_is-hovered_1p4v0_16","is-focused":"_is-focused_1p4v0_20","column-config__input":"_column-config__input_1p4v0_40","clear-button":"_clear-button_1p4v0_55"},C2a={$style:_2a},yBt=Tp(w2a,[["__cssModules",C2a]]),S2a={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},k2a=ct({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search"},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{default:void 0}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=W(null),o=uRe(u=>{a("update:modelValue",u),a("search",u)},dBt),s=()=>{a("update:modelValue",""),a("clear"),Ct(()=>{var u;(u=i.value)==null||u.focus()})},l=W(r.modelValue);return t({focus:()=>{var u;(u=i.value)==null||u.focus()},setValue(u){l.value=u}}),(u,c)=>(L(),qe(yBt,{focusIndex:r.focusIndex,ref_key:"searchInput",ref:i,modelValue:l.value,"onUpdate:modelValue":c[0]||(c[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:F(o),onClear:s,onCancel:c[1]||(c[1]=d=>a("cancel")),"auto-emit":!0},{prefix:Re(()=>[be("div",S2a,[De(Dp,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),E2a=ct({name:"ListItem",directives:{tooltip:qC,focusable:OIe},__name:"ListItem",props:{itemWidth:{default:"250px"},label:{},value:{},type:{},selected:{type:Boolean},disabled:{type:Boolean},hover:{type:Boolean},clickable:{type:Boolean,default:!0},danger:{type:Boolean},data:{},icon:{},readOnly:{type:Boolean,default:!1},show:{type:Boolean},focusIndex:{}},emits:["click","handleClick","keydown","update:selected","select","escape"],setup(e,{expose:t,emit:n}){const r=OIe,a=e,i=n,o=W(!1),s=W(!1);function l(T){if(!T||typeof T!="object")return!1;const k=T;return typeof k.name=="string"&&typeof k.id=="string"&&typeof k.initial=="string"}const u=z(()=>a.type==="status"||a.type==="assignee"||a.type==="icon"||!!y.prefix),c=z(()=>!!y.suffix||a.danger&&o.value),d=z(()=>{var T;return a.type==="status"&&typeof((T=a.data)==null?void 0:T.color)=="string"?{backgroundColor:a.data.color,border:GTa(a.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),p=Cf(),h=z(()=>({[p.active]:a.selected??!1,[p.disabled]:a.disabled??!1,[p.hover]:a.hover??!1,[p.clickable]:(a.clickable??!0)&&!a.disabled,[p.danger]:a.danger??!1,[p["has-prefix"]]:u.value,[p["has-suffix"]]:c.value,[p.readOnly]:a.readOnly}));z(()=>({content:"Cancel",...S})),z(()=>({content:"Confirm",theme:"warning",...S}));function g(T){return{name:T.name,initial:T.initial,id:T.id,profile_image:T.profile_image??null,color:T.color,size:24}}function v(){o.value=!1}function b(T){T?i("click",T):(a.clickable??!0)&&(i("update:selected",!a.selected),i("select",!a.selected))}function _(T){if(!a.disabled){if(a.danger&&!o.value){o.value=!0;return}else a.danger||b(T);i("handleClick",T)}}const C=()=>{o.value?v():i("escape")},S=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),y=el();return lt(()=>a.show,T=>{T===!1&&(o.value=!1)}),t({select:()=>{_(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(T,k)=>{const E=Ti("tooltip");return ft((L(),qe(ym,{variant:["menu-item",e.danger?"danger":"menu-item"],class:ke([T.$style["list-item"],h.value]),onHandleClick:_,onMouseenter:k[0]||(k[0]=I=>s.value=!0),onMouseleave:k[1]||(k[1]=I=>s.value=!1),onEscape:C,style:Yt({width:a.itemWidth})},{default:Re(()=>[u.value?(L(),re("div",{key:0,class:ke(T.$style["list-item__prefix"])},[at(T.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(L(),qe(Dp,{key:0,src:e.icon,source:"remote",class:ke(T.$style["item-icon"]),color:a.danger?void 0:"#a6a6a6"},null,8,["src","class","color"])):e.type==="status"?(L(),re("div",{key:1,class:ke(T.$style["status-indicator"]),style:Yt(d.value)},null,6)):e.type==="assignee"&&l(e.data)?(L(),qe(nDa,Zt({key:2},g(e.data),{class:T.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Ve("",!0)])],2)):Ve("",!0),be("div",{class:ke(T.$style["list-item__label"])},[at(T.$slots,"label",{selected:e.selected},()=>[Dt(vt(e.label),1)])],2),c.value?(L(),re("div",{key:1,class:ke(T.$style["list-item__suffix"])},[at(T.$slots,"suffix",{item:T.$props,hovered:s.value},()=>[e.danger&&o.value?(L(),re("div",{key:0,class:ke(T.$style["confirm-action"])},[ft((L(),qe(ym,{variant:["tertiary","icon","danger"],size:"small",onClick:Ot(v,["stop","prevent"])},{default:Re(()=>[De(Dp,{src:"Xmark",source:"remote"})]),_:1})),[[F(r),`${a.focusIndex}.0`],[E,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),ft((L(),qe(ym,{variant:["danger","primary","icon"],size:"small",onClick:Ot(b,["stop","prevent"])},{default:Re(()=>[De(Dp,{src:"Check",source:"remote"})]),_:1})),[[F(r),`${a.focusIndex}.1`],[E,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ve("",!0)])],2)):Ve("",!0)]),_:3},8,["variant","class","style"])),[[F(r),a.focusIndex]])}}}),x2a="_disabled_tuyyv_16",T2a="_danger_tuyyv_23",D2a="_clickable_tuyyv_40",A2a="_readOnly_tuyyv_43",O2a="_hover_tuyyv_47",I2a="_active_tuyyv_53",R2a={"list-item":"_list-item_tuyyv_1",disabled:x2a,danger:T2a,"has-prefix":"_has-prefix_tuyyv_26","has-suffix":"_has-suffix_tuyyv_26",clickable:D2a,readOnly:A2a,hover:O2a,active:I2a,"list-item__prefix":"_list-item__prefix_tuyyv_78","list-item__label":"_list-item__label_tuyyv_86","list-item__suffix":"_list-item__suffix_tuyyv_100","status-indicator":"_status-indicator_tuyyv_107","item-icon":"_item-icon_tuyyv_113","arbo-icon-state":"_arbo-icon-state_tuyyv_118","item-avatar":"_item-avatar_tuyyv_121","confirm-action":"_confirm-action_tuyyv_130"},$2a={$style:R2a},bBt=Tp(E2a,[["__cssModules",$2a]]),P2a=["aria-activedescendant"],M2a=["innerHTML"],N2a=10,L2a=ct({__name:"SearchList",props:{options:{default:()=>[]},selectedId:{},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},error:{default:null},params:{},maxHeight:{default:"218px"},width:{default:"250px"},itemWidth:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const r=qC,a={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},i=e,o=n,s=W(""),l=W(-1),u=W(null),c=W(null),d=W(new Map),p=z(()=>BRe(s.value)),h=()=>{const ee=p.value;if(!ee||ee.length<i.minQueryLength)return i.options;if(d.value.has(ee))return d.value.get(ee);const j=i.options.map(U=>({item:U,score:LOa(` ${U.label} `,ee)})).filter(({score:U})=>U>0).sort((U,Z)=>Z.score-U.score).map(({item:U})=>U);return d.value.set(ee,j),j},g=W([]);lt(()=>i.options,()=>{g.value=h()},{immediate:!0,deep:!0});const v=z(()=>i.hasMore&&!i.loading&&!i.loadingMore),b=uRe(ee=>{s.value=ee,l.value=-1,o("search",ee)},dBt),_=async ee=>{ie.value=0,await b(ee||""),ie.value=1},C=ee=>s.value?FOa(ee,s.value):ee,S=ee=>{const j={[a.ARROW_DOWN]:()=>y(ee),[a.ARROW_UP]:()=>T(ee),[a.ENTER]:()=>I(ee),[a.ESCAPE]:()=>D(ee),[a.TAB]:()=>A(ee)}[ee.key];j&&j()},y=ee=>{ee.preventDefault(),k(1)},T=ee=>{ee.preventDefault(),k(-1)},k=ee=>{const j=g.value.length;if(j===0)return;let U;ee>0?U=(l.value+1)%j:l.value>0?U=l.value-1:U=j-1,l.value=U,E()},E=()=>{Ct(()=>{var ee;const j=(ee=c.value)==null?void 0:ee.querySelectorAll('[role="menuitem"]')[l.value];j==null||j.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},I=ee=>{if(ee.preventDefault(),l.value>=0&&l.value<g.value.length){const j=g.value[l.value];R(j,ee)}},D=ee=>{ee.preventDefault(),P()},A=ee=>{o("tab",ee)},R=(ee,j)=>{!ee||ee.disabled||(o("select",ee,j),l.value=-1,P())},B=ee=>{ee>=0&&ee<g.value.length&&(l.value=ee)},P=()=>{o("close")},$=()=>{if(!v.value||!c.value)return;const{scrollTop:ee,clientHeight:j,scrollHeight:U}=c.value;U-(ee+j)<=N2a&&o("loadMore")},V=()=>{var ee,j,U;(ee=c.value)==null||ee.addEventListener("scroll",$),(U=(j=J.value)==null?void 0:j.$el)==null||U.addEventListener("keydown",S)},N=()=>{var ee,j,U;(ee=c.value)==null||ee.removeEventListener("scroll",$),(U=(j=J.value)==null?void 0:j.$el)==null||U.removeEventListener("keydown",S)};nn(()=>{V()}),$r(()=>{N()}),lt(()=>i.loading,ee=>{!ee&&g.value.length>0&&(l.value=-1)});const q=ee=>ee?Array.isArray(i.selectedId)?i.selectedId.includes(String(ee.id)):i.selectedId==ee.id:!1,J=W(null);lt(l,()=>{E()}),t({focus:()=>{Ct(()=>{var ee;(ee=J.value)==null||ee.focus()})},reset:()=>{var ee;(ee=J.value)==null||ee.focus(),l.value=-1},query:s,filteredOptions:g,selectedIndex:l,closeDropdown:P,clearSearch:()=>{s.value=""},scrollTo:ee=>{c.value&&(c.value.scrollTop=ee)},selectIndex:ee=>{ee>=0&&ee<g.value.length&&(l.value=ee,E())}});const ie=W(0);lt([()=>i.loading,()=>s.value,()=>i.options,()=>i.loadingMore],()=>{const ee=i.options.length>0&&g.value.length>0,j=!ee&&s.value.length>0,U=!ee&&s.value.length===0;i.loading?ie.value=0:ee?ie.value=1:j?ie.value=2:U&&(ie.value=3)},{immediate:!0,deep:!0});const de=()=>{o("cancel")};return(ee,j)=>(L(),re("datalist",{ref_key:"searchListRef",ref:u,class:ke([ee.$style["search-list"],ie.value===3||ie.value===2?ee.$style.empty:"",g.value.length>8?ee.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:Yt({width:e.itemWidth||e.width})},[De(k2a,{ref_key:"searchBoxRef",ref:J,modelValue:s.value,"onUpdate:modelValue":j[0]||(j[0]=U=>s.value=U),class:ke(ee.$style["search-box"]),disabled:e.loading,onSearch:_,onClear:j[1]||(j[1]=U=>_("")),onCancel:de},null,8,["modelValue","class","disabled"]),be("div",{ref_key:"popupRef",ref:c,class:ke(ee.$style["list-container"])},[at(ee.$slots,"extra-item",{query:s.value,isEmpty:ie.value===3||ie.value===2,isLoading:i.loading}),(L(!0),re($t,null,rn(g.value,(U,Z)=>ft((L(),re("div",{key:`${U.id}-${Z}`,role:"menuitem"},[at(ee.$slots,"item",{item:U,index:Z,selectedIndex:l.value,isSelected:q,handleSelect:R,handleItemHover:B,getHighlightedLabel:C,query:s.value,idx:Z,focused:l.value==Z},()=>[U.hide?Ve("",!0):(L(),qe(bBt,Zt({key:0,ref_for:!0},U,{hover:Z===l.value,selected:q(U),type:U.type,id:`item-${Z}`,"aria-selected":Z===l.value,onClick:oe=>R(U,oe),onMouseover:oe=>B(Z),onEscape:P,itemWidth:e.itemWidth||e.width}),{prefix:Re(()=>[at(ee.$slots,"prefix-item",{item:U})]),label:Re(()=>[s.value?ft((L(),re("span",{key:0,class:ke(ee.$style.match),innerHTML:C(U.label)},null,10,M2a)),[[F(r),{content:U.label,delay:[1e3,0]}]]):ft((L(),re("span",{key:1,class:ke(ee.$style["item-label"])},[Dt(vt(U.label),1)],2)),[[F(r),{content:U.label,delay:[1e3,0]}]])]),suffix:Re(({hovered:oe})=>[at(ee.$slots,"action",{item:U,isHovered:Z===l.value,hovered:oe,selected:l.value==Z})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover","itemWidth"]))])])),[[Ur,ie.value===1]])),128)),ie.value===0?at(ee.$slots,"loading-more",{key:0},()=>[(L(),re($t,null,rn(8,U=>be("div",{class:ke(ee.$style["loading-more"]),key:U},[be("div",{class:ke(ee.$style["loading-skeleton"])},null,2),be("div",{class:ke(ee.$style["loading-skeleton"])},null,2)],2)),64))]):Ve("",!0),ie.value===2?(L(),re("div",{key:1,class:ke(ee.$style["no-results"])},[at(ee.$slots,"empty",{query:s.value},()=>[be("div",{class:ke(ee.$style["no-results-content"])},[...j[2]||(j[2]=[be("div",null,[Dt(" No results. "),be("br"),Dt(" Try another search. ")],-1)])],2)])],2)):Ve("",!0),ie.value===3?(L(),re("div",{key:2,class:ke(ee.$style["no-results"])},[at(ee.$slots,"empty-list",{},()=>[be("div",{class:ke(ee.$style["no-results-content"])},[...j[3]||(j[3]=[be("div",null,"No items available.",-1)])],2)])],2)):Ve("",!0),at(ee.$slots,"footer")],2)],14,P2a))}}),F2a="_empty_1rcj9_11",B2a="_scrollable_1rcj9_17",V2a="_title_1rcj9_137",U2a="_tips_1rcj9_143",H2a="_match_1rcj9_157",j2a={"search-list":"_search-list_1rcj9_1",empty:F2a,scrollable:B2a,"list-container":"_list-container_1rcj9_24","item-label":"_item-label_1rcj9_45","loading-state":"_loading-state_1rcj9_53","loading-more":"_loading-more_1rcj9_54","loading-skeleton":"_loading-skeleton_1rcj9_65","is-loading":"_is-loading_1rcj9_72","no-results":"_no-results_1rcj9_127","no-results-content":"_no-results-content_1rcj9_134",title:V2a,tips:U2a,match:H2a,"skeleton-loading":"_skeleton-loading_1rcj9_1"},z2a={$style:j2a},W2a=Tp(L2a,[["__cssModules",z2a]]),iG=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],G2a=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),mA=(e,t)=>{const n=r=>{var a,i;if(r.key==="Tab"){const o=r.shiftKey||r.metaKey;r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation();const s=document.activeElement,l=(a=s==null?void 0:s.dataset)==null?void 0:a.index;if(l){let u=iG.indexOf(l);const c=o?-1:1;for(const d of iG){u=(u+c+iG.length)%iG.length;const p=iG[u],h=document.querySelector(`[data-index="${p}"]`);if(h){h.focus();return}}}}else if(r.key==="Enter")(i=r.target)==null||i.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(r.key==="Escape"){r.stopPropagation(),r.stopImmediatePropagation();const o=document.querySelector('[data-index="calendar-wrapper"]');o==null||o.focus()}};if(G2a.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},q2a=["aria-label"],K2a=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],Y2a={style:{flex:"1"}},J2a=ct({__name:"MainCalendar",props:By({year:{},month:{},startDate:{},endDate:{},timezone:{default:"UTC"},activeField:{default:"start"},requireConfirm:{type:Boolean,default:!1},locale:{default:"en-US"},weekdayLabelStyle:{default:"narrow"},weekStart:{default:0},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Confirm"},immediatelyUpdate:{type:Boolean,default:!1},disabled:{type:Boolean},readOnly:{type:Boolean},disableConfirm:{type:Boolean,default:!1}},{tracingCase:{default:()=>({case:"",behavior:""})},tracingCaseModifiers:{}}),emits:By(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{expose:t,emit:n}){const r=qC,a=W(null),i=e,o=z(()=>i.startDate&&i.endDate),s=j$(e,"tracingCase"),l=n,u=W(i.year),c=W(i.month);lt(()=>[i.year,i.month],([j,U])=>{u.value=j,c.value=U});const d=z(()=>Qr.fromObject({year:u.value,month:c.value,day:1},{zone:i.timezone}).setLocale(i.locale||"en-US").toFormat("LLLL yyyy")),p=z(()=>Qr.now().setZone(i.timezone)),h=z(()=>i.startDate?Qr.fromJSDate(i.startDate,{zone:i.timezone}):null),g=z(()=>i.endDate?Qr.fromJSDate(i.endDate,{zone:i.timezone}):null),v=W(h.value),b=W(g.value),_=W(h.value),C=W(g.value);lt([h,g],()=>{i.requireConfirm||(v.value=h.value,b.value=g.value,_.value=h.value,C.value=g.value)},{immediate:!0});const S=z(()=>i.requireConfirm?v.value:h.value),y=z(()=>i.requireConfirm?b.value:g.value);lt(()=>i.activeField,j=>{const U=j==="start"?S.value:y.value;U&&(u.value=U.year,c.value=U.month)}),lt(()=>{var j,U;return[(j=S.value)==null?void 0:j.toISODate(),(U=y.value)==null?void 0:U.toISODate(),i.activeField]},()=>{const j=i.activeField==="start"?S.value:y.value;j&&(j.year!==u.value||j.month!==c.value)&&(u.value=j.year,c.value=j.month)});function T(j){return j.setZone("utc")}const k=W("");function E(j){k.value=j.toISODate()||"",Ct(()=>{const U=document.querySelector(`.arbo-calendar-day[data-date="${k.value}"]`);U==null||U.focus()})}lt(()=>{var j,U;return[u.value,c.value,i.activeField,(j=S.value)==null?void 0:j.toISODate(),(U=y.value)==null?void 0:U.toISODate()]},()=>{const j=i.activeField==="start"?S.value:y.value;let U;j&&j.year===u.value&&j.month===c.value?U=j:S.value&&S.value.year===u.value&&S.value.month===c.value?U=S.value:U=p.value,E(U)});function I(j){return j.toFormat("d")}const D=z(()=>{const j=Qr.fromObject({year:u.value,month:c.value,day:1},{zone:i.timezone}),U=j.weekday,Z=i.weekStart===1?(U+6)%7:U%7;let oe=j.minus({days:Z});const fe=[],ae=oV.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"}),G=Cf();for(let Ee=0;Ee<42;Ee++){const he=[];oe.month!==c.value&&he.push(G["is-outside"]),oe.hasSame(p.value,"day")&&he.push(G["is-today"]),S.value&&oe.hasSame(S.value,"day")&&he.push(G["is-selected-start"]),y.value&&oe.hasSame(y.value,"day")&&he.push(G["is-selected-end"]),S.value&&y.value&&oe>S.value&&oe<y.value&&he.push(G["is-in-range"]);const Pe=I(oe),Te=ae[oe.weekday-1]||"";fe.push({dt:oe,iso:oe.toISODate()||"",label:oe.toFormat("d"),displayLabel:Pe,weekdayLabel:Te,aria:oe.setLocale(i.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:he}),oe=oe.plus({days:1})}const Y=[];for(let Ee=0;Ee<6;Ee++)Y.push(fe.slice(Ee*7,Ee*7+7));return Y}),A=z(()=>{const j=oV.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"});return i.weekStart===1?j:[j[6],...j.slice(0,6)]});function R(j,U,Z){const oe=j==="start"?U.startOf("day"):U.endOf("day"),fe=T(oe),ae={year:oe.year,month:oe.month,day:oe.day,utc:fe.toISO()||""};j==="start"?(l("select-start",ae,Z??!0),l("select-start-utc",ae.utc)):(l("select-end",ae),l("select-end-utc",ae.utc))}function B(j){let U=u.value,Z=c.value+j;for(;Z<1;)Z+=12,U-=1;for(;Z>12;)Z-=12,U+=1;u.value=U,c.value=Z,l("update:year",U),l("update:month",Z)}function P(j){const U=(k.value?Qr.fromISO(k.value,{zone:i.timezone}):p.value).plus({days:j});U.month===c.value&&U.year===u.value&&E(U)}function $(j=!1){const U=(k.value?Qr.fromISO(k.value,{zone:i.timezone}):p.value).weekday%7,Z=j?6-U:-U;P(Z)}const V=j=>{N(j)};function N(j){switch(j.preventDefault(),j.stopPropagation(),j.key){case"ArrowLeft":j.preventDefault(),P(-1);break;case"ArrowRight":j.preventDefault(),P(1);break;case"ArrowUp":j.preventDefault(),P(-7);break;case"ArrowDown":j.preventDefault(),P(7);break;case"Home":j.preventDefault(),$(!1);break;case"End":j.preventDefault(),$(!0);break;case"PageUp":j.preventDefault(),B(j.shiftKey?-12:-1);break;case"PageDown":j.preventDefault(),B(j.shiftKey?12:1);break;case"Enter":case" ":{j.preventDefault();const U=k.value?Qr.fromISO(k.value,{zone:i.timezone}):p.value,Z=D.value.flat().find(oe=>oe.iso===U.toISODate());Z&&J(Z);break}}}const q=j=>{const U=Qr.now().setZone(i.timezone);u.value=U.year,c.value=U.month,l("update:year",U.year),l("update:month",U.month),E(U),l("gotoToday")};function J(j){var U,Z;const oe=!!h.value,fe=!!g.value,ae=i.activeField,G=((U=h.value)==null?void 0:U.toISODate())||"null",Y=((Z=g.value)==null?void 0:Z.toISODate())||"null",Ee=j.dt.toISODate()||"",he=(We,Ye)=>{s.value={case:We,behavior:Ye}},Pe=()=>`Selected start ${Ee} > existing end ${Y} -> reset both to ${Ee}`,Te=()=>`Selected end ${Ee} < existing start ${G} -> reset both to ${Ee}`,Ae=()=>{R("start",j.dt,!0),R("end",j.dt),l("update:activeField","end")},xe=(We=!1)=>{R("start",j.dt,We),We&&l("update:activeField","end")},Je=(We=!1)=>{R("end",j.dt),We&&l("close")};if(oe&&fe){ae==="start"?g.value&&j.dt>g.value?(Ae(),he("INVERT_RANGE_FROM_START",Pe())):(xe(!1),he("UPDATE_START_IN_RANGE",`Updated start from ${G} to ${Ee}; end remains ${Y}`)):h.value&&j.dt<h.value?(Ae(),he("INVERT_RANGE_FROM_END",Te())):(Je(!1),he("UPDATE_END_IN_RANGE",`Updated end from ${Y} to ${Ee}; start remains ${G}`));return}if(!oe&&fe&&ae==="start"&&g.value&&j.dt>g.value){Ae(),he("CREATE_RANGE_FROM_LATE_START",Pe());return}if(oe&&!fe&&ae==="end"&&h.value&&j.dt<h.value){Ae(),he("CREATE_RANGE_FROM_EARLY_END",Te());return}if(!oe&&!fe){if(ae==="start"){xe(!0),he("INIT_START",`Picked start ${Ee}; awaiting end selection`);return}Je(i.immediatelyUpdate),he("INIT_END",`Picked end ${Ee}; awaiting start selection`);return}if(!oe&&fe){if(ae==="start"){xe(!0),he("FILL_MISSING_START",`Inserted start ${Ee}; existing end ${Y}`);return}Je(!1),he("STRICT_UPDATE_END_ONLY",`Updated end to ${Ee}; start still null`);return}if(oe&&!fe){if(ae==="start"){xe(!0),he("RESELECT_START_BEFORE_END",`Replaced start with ${Ee}; end still null, switching to end`);return}Je(i.immediatelyUpdate),he("FILL_MISSING_END",`Picked end ${Ee}; start ${G}`);return}}function ie(){_.value=v.value,C.value=b.value,l("confirm")}function de(){v.value=_.value,b.value=C.value,l("cancel")}function ee(){Ct(()=>{var j;(j=a.value)==null||j.focus()})}return nn(()=>{ee()}),t({focus:ee}),(j,U)=>(L(),re("div",{ref_key:"calendarRef",ref:a,class:ke([j.$style["arbo-calendar"],{[j.$style["arbo-date-range-picker"]]:o.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[be("div",{class:ke([j.$style["arbo-calendar-header"],j.$style["arbo-calendar-week"]]),role:"row"},[(L(!0),re($t,null,rn(A.value,Z=>(L(),re("div",{key:Z,class:ke(j.$style["arbo-calendar-weekday"]),role:"columnheader"},vt(Z),3))),128))],2),be("div",{class:ke(j.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:U[0]||(U[0]=Ot(Z=>F(mA)(Z,V),["prevent","stop"]))},[(L(!0),re($t,null,rn(D.value,(Z,oe)=>(L(),re("div",{key:oe,class:ke(j.$style["arbo-calendar-week"])},[(L(!0),re($t,null,rn(Z,fe=>(L(),re("div",{key:fe.iso,class:ke([j.$style["arbo-calendar-day"],fe.classes,{[j.$style["is-focused"]]:fe.iso===k.value}]),disabled:i.disabled,readOnly:i.readOnly,"aria-label":fe.aria,"data-date":fe.iso,"data-weekday":fe.weekdayLabel,tabindex:fe.iso===k.value?0:-1,onClick:ae=>J(fe)},vt(fe.displayLabel),11,K2a))),128))],2))),128))],34),i.readOnly?Ve("",!0):(L(),re("div",{key:0,class:ke(j.$style["arbo-calendar-actions"])},[be("div",Y2a,[ft((L(),qe(ym,{variant:"secondary",size:"medium",onClick:U[1]||(U[1]=Z=>q()),onKeydown:F(mA),"data-index":"today-btn"},{prefix:Re(()=>[De(Dp,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[F(r),"Today"]])]),De(ym,{disabled:i.disabled,readOnly:i.readOnly,onKeydown:F(mA),variant:"secondary",size:"medium",onClick:de,"data-index":"cancel-btn"},{default:Re(()=>[Dt(vt(i.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),De(ym,{disabled:i.disabled||i.disableConfirm,readOnly:i.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:F(mA),onClick:ie},{default:Re(()=>[Dt(vt(i.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,q2a))}}),Z2a="_cancel_99b61_156",X2a="_confirm_99b61_161",Q2a={"arbo-date-range-picker":"_arbo-date-range-picker_99b61_1","arbo-calendar-day":"_arbo-calendar-day_99b61_2","arbo-calendar-week":"_arbo-calendar-week_99b61_3","arbo-calendar":"_arbo-calendar_99b61_2","arbo-calendar-nav":"_arbo-calendar-nav_99b61_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_99b61_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_99b61_53","arbo-calendar-weekday":"_arbo-calendar-weekday_99b61_58","arbo-calendar-weeks":"_arbo-calendar-weeks_99b61_63","is-today":"_is-today_99b61_92","is-selected-start":"_is-selected-start_99b61_97","is-selected-end":"_is-selected-end_99b61_105","is-outside":"_is-outside_99b61_125","is-focused":"_is-focused_99b61_128","is-in-range":"_is-in-range_99b61_133","arbo-calendar-actions":"_arbo-calendar-actions_99b61_139","arbo-calendar-btn":"_arbo-calendar-btn_99b61_147",cancel:Z2a,confirm:X2a},eIa={$style:Q2a},tIa=Tp(J2a,[["__cssModules",eIa]]),nIa=["onClick"],rIa=["variant","onClick"],aIa=ct({__name:"CalendarNavigationControl",props:{year:{},month:{},minYear:{default:1970},maxYear:{default:2100},yearSpan:{default:12},monthLabels:{},locale:{default:"en-US"},monthLabelStyle:{default:"short"},ariaPrevLabel:{default:"Previous"},ariaNextLabel:{default:"Next"},ariaToolbarLabel:{default:"Calendar navigation"},ariaSelectYearLabel:{default:"Select year"},ariaSelectMonthLabel:{default:"Select month"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["update:year","update:month","mode-change","year-selected","month-selected"],setup(e,{expose:t,emit:n}){const r=e,a=z(()=>{if(r.monthLabels&&r.monthLabels.length===12)return r.monthLabels;const P=r.locale||"en-US",$=r.monthLabelStyle||"short",V=new Intl.DateTimeFormat(P,{month:$,timeZone:"UTC"});return Array.from({length:12},(N,q)=>V.format(new Date(Date.UTC(2020,q,1))))}),i=n,o=W(r.year),s=W(r.month),l=W(r.year);lt(()=>r.year,P=>{P!==o.value&&(o.value=P,l.value=P)}),lt(()=>r.month,P=>{P!==s.value&&(s.value=P)});const u=W("days");function c(P){u.value!==P&&(u.value=P,i("mode-change",P))}const d=z(()=>r.minYear),p=z(()=>r.maxYear),h=z(()=>{const P=r.yearSpan;return l.value-l.value%P}),g=z(()=>h.value+r.yearSpan-1);function v(){const P=r.yearSpan,$=h.value-P;$>=d.value&&(l.value=$)}function b(){const P=r.yearSpan,$=h.value+P;$<=p.value&&(l.value=$)}const _=z(()=>h.value-r.yearSpan<d.value),C=z(()=>g.value+r.yearSpan>p.value),S=z(()=>{const P=r.yearSpan;return Math.ceil(P/3)});function y(P){const $=h.value+(P-1)*3;return Array.from({length:3},(V,N)=>$+N).filter(V=>V<=g.value)}function T(){u.value==="months"?c("days"):c("months")}function k(){u.value==="years"?c("days"):c("years")}function E(P){o.value=P,l.value=P,i("update:year",P),i("year-selected",P),c("months")}function I(P){s.value=P,i("update:month",P),i("month-selected",P),c("days")}function D(){if(u.value==="days"){let P=o.value,$=s.value-1;if($<1&&($=12,P--),P<d.value)return;o.value=P,s.value=$,i("update:year",P),i("update:month",$)}else if(u.value==="months"){if(o.value-1<d.value)return;o.value--,i("update:year",o.value)}else u.value==="years"&&v()}function A(){if(u.value==="days"){let P=o.value,$=s.value+1;if($>12&&($=1,P++),P>p.value)return;o.value=P,s.value=$,i("update:year",P),i("update:month",$)}else if(u.value==="months"){if(o.value+1>p.value)return;o.value++,i("update:year",o.value)}else u.value==="years"&&b()}const R=z(()=>u.value==="days"?o.value===d.value&&s.value===1:u.value==="months"?o.value-1<d.value:_.value),B=z(()=>u.value==="days"?o.value===p.value&&s.value===12:u.value==="months"?o.value+1>p.value:C.value);return t({setNavigation:(P,$)=>{o.value=P,s.value=$}}),(P,$)=>(L(),re("div",{class:ke([P.$style["cal-nav-wrapper"]])},[at(P.$slots,"selection"),u.value==="days"?(L(),re("div",{key:0,class:ke(P.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[De(ym,{variant:"tertiary",class:ke([P.$style["cal-nav-btn"],P.$style.prev]),"aria-label":"Previous",disabled:R.value,label:"",onClick:D,"data-index":"prev-btn",onKeydownCapture:Jn(Ot(D,["prevent","stop"]),["enter"]),onKeydown:F(mA)},{default:Re(({hovered:V})=>[De(Dp,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),be("div",{class:ke(P.$style["cal-nav-center"])},[De(ym,{"data-index":"month-btn",variant:"secondary",onClick:T,onKeydown:F(mA)},{default:Re(()=>[Dt(vt(a.value[s.value-1]),1)]),_:1},8,["onKeydown"]),De(ym,{variant:"secondary",onClick:k,"data-index":"year-btn",onKeydown:F(mA)},{default:Re(()=>[Dt(vt(o.value),1)]),_:1},8,["onKeydown"])],2),De(ym,{"data-index":"next-btn",variant:"tertiary",class:ke([P.$style["cal-nav-btn"],P.$style.next]),"aria-label":"Next",disabled:B.value,label:"",onClick:A,onKeydownCapture:Jn(Ot(A,["prevent","stop"]),["enter"]),onKeydown:F(mA)},{default:Re(({hovered:V})=>[De(Dp,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Ve("",!0),u.value==="years"?(L(),re("div",{key:1,class:ke(P.$style["year-grid"])},[be("div",{class:ke(P.$style["year-grid-header"])},[De(ym,{variant:"tertiary",class:ke([P.$style["cal-nav-btn"],P.$style.prev]),"aria-label":"Next",disabled:_.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:Re(({hovered:V})=>[De(Dp,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),be("div",{class:ke(P.$style["range-label"])},vt(h.value)+" - "+vt(g.value),3),De(ym,{variant:"tertiary",class:ke([P.$style["cal-nav-btn"],P.$style.next]),"aria-label":"Next",disabled:C.value,"prefix-icon":"AnglesRight",label:"",onClick:b},{default:Re(({hovered:V})=>[De(Dp,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),be("div",{class:ke(P.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(L(!0),re($t,null,rn(S.value,V=>(L(),re("div",{key:"yr-row-"+V,class:ke(P.$style["year-grid-row"])},[(L(!0),re($t,null,rn(y(V),N=>(L(),re("a",{key:N,tabindex:"0",class:ke([P.$style["year-cell"],{[P.$style.selected]:N===o.value}]),onClick:q=>E(N)},vt(N),11,nIa))),128))],2))),128))],2)],2)):u.value==="months"?(L(),re("div",{key:2,class:ke(P.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[be("div",{class:ke(P.$style.months)},[(L(!0),re($t,null,rn(a.value,(V,N)=>(L(),re("a",{tabindex:"0",key:V,variant:N+1===s.value?"primary":"text",class:ke([P.$style["month-cell"],{[P.$style.selected]:N+1===s.value}]),onClick:q=>I(N+1)},vt(V),11,rIa))),128))],2)],2)):(L(),re("div",{key:3,class:ke(P.$style["days-slot"])},[at(P.$slots,"default",{year:o.value,month:s.value,mode:u.value})],2))],2))}}),iIa="_prev_mtd4w_33",oIa="_months_mtd4w_75",sIa="_selected_mtd4w_131",lIa={"cal-nav-wrapper":"_cal-nav-wrapper_mtd4w_1","cal-nav-bar":"_cal-nav-bar_mtd4w_12","cal-nav-btn":"_cal-nav-btn_mtd4w_20",prev:iIa,"year-grid-header":"_year-grid-header_mtd4w_37","cal-nav-center":"_cal-nav-center_mtd4w_46","cal-nav-label":"_cal-nav-label_mtd4w_52","month-grid":"_month-grid_mtd4w_66","year-grid":"_year-grid_mtd4w_37",months:oIa,"month-cell":"_month-cell_mtd4w_82","year-cell":"_year-cell_mtd4w_83","pg-btn":"_pg-btn_mtd4w_105","year-grid-body":"_year-grid-body_mtd4w_118","year-grid-row":"_year-grid-row_mtd4w_125",selected:sIa,"days-slot":"_days-slot_mtd4w_137","range-label":"_range-label_mtd4w_141"},uIa={$style:lIa},cIa=Tp(aIa,[["__cssModules",uIa]]);function dIa(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:r,maxDate:a}=e,i=W(""),o=z(()=>{const p=Qr.fromFormat(i.value,t,{zone:n});return p.isValid?p:null}),s=z(()=>{if(!r||!o.value)return!0;const p={year:r.getFullYear(),month:r.getMonth()+1,day:r.getDate()},h={year:o.value.year,month:o.value.month,day:o.value.day};return h.year>p.year?!0:h.year<p.year?!1:h.month>p.month?!0:h.month<p.month?!1:l(h,p)>=0}),l=(p,h)=>{const g=new Date(p.year,p.month-1,p.day),v=new Date(h.year,h.month-1,h.day);return g<v?-1:g>v?1:0},u=z(()=>{if(!a||!o.value)return!0;const p={year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate()},h={year:o.value.year,month:o.value.month,day:o.value.day};return h.year<p.year?!0:h.year>p.year?!1:h.month<p.month?!0:h.month>p.month?!1:l(h,p)<=0}),c=z(()=>i.value.length==0||i.value.length>0&&o.value!==null&&s.value&&u.value),d=z(()=>i.value.length===t.length&&c.value);return{inputValue:i,isValid:c,isComplete:d,clear:()=>{i.value=""},setDate:p=>{let h;p instanceof Date?h=Qr.fromJSDate(p,{zone:n}):h=p.setZone(n),h.isValid?i.value=h.toFormat(t):i.value=""},getDate:()=>c.value?o.value:null}}const fIa={key:0,style:{marginLeft:"8px"}},hIa=["disabled","readonly","placeholder"],pIa=ct({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear","blur","tab"],setup(e,{expose:t,emit:n}){const r=qC,a=e,i=n,o=W(null),s=W(null),{isValid:l,isComplete:u,inputValue:c,clear:d,setDate:p,getDate:h}=dIa({format:a.format,allowPastDates:a.allowPastDates,allowFutureDates:a.allowFutureDates,timezone:a.timezone,minDate:a.minDate,maxDate:a.maxDate}),g=z(()=>a.active),v=z(()=>({disabled:a.disabled,error:!l.value&&c.value.length>0,readOnly:a.readOnly,isEmpty:c.value.length===0,inputRef:o,wrapperRef:s,active:g})),{argsMain:b,isHover:_,isFocus:C}=Wse(v),S=I=>{var D;const A=(D=I.clipboardData)==null?void 0:D.getData("text/plain");A&&(c.value=A.trim())},y=I=>{if(I.key==="Escape"){i("blur"),I.target.blur(),I.preventDefault(),I.stopPropagation(),I.stopImmediatePropagation();return}else I.key==="Tab"&&E(I)},T=()=>{d(),i("clear")};t({clear:T,setDate:p,getDate:h,focus:()=>{var I;return(I=o.value)==null?void 0:I.focus()}}),lt(()=>a.modelValue,I=>{I?p(I):d()},{immediate:!0}),lt([()=>u.value,()=>c.value],()=>{if(c.value.length===0)i("complete",null);else if(l.value&&!a.readOnly&&!a.disabled&&u.value){const I=h();(I||c.value.length===0)&&i("complete",I)}}),lt(()=>l.value,I=>{I||i("invalid","")});const k=z(()=>!!a.isMultipleDate),E=I=>{I.preventDefault(),I.stopImmediatePropagation(),I.stopPropagation(),i("tab",I)};return(I,D)=>(L(),qe(Gse,Zt(F(b),{ref_key:"wrapperRef",ref:s,bordered:!0,actived:g.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:Re(()=>[be("div",{class:ke([I.$style["date-input-wrapper"]])},[k.value?(L(),re("span",fIa," Multiple ")):ft((L(),re("input",{key:1,disabled:a.disabled,readonly:a.readOnly,ref_key:"inputRef",ref:o,type:"text","onUpdate:modelValue":D[0]||(D[0]=A=>Or(c)?c.value=A:null),onPaste:Ot(S,["prevent"]),placeholder:a.placeholder,class:ke([I.$style["date-input"]]),onKeydown:y},null,42,hIa)),[[Jc,F(c)]]),at(I.$slots,"clear",{handleClear:T},()=>[(F(c).length>0||k.value)&&!a.readOnly&&!a.disabled&&(F(_)||F(C))?ft((L(),qe(ym,{key:0,variant:["icon","primary"],onClick:Ot(T,["stop"]),size:16,rounded:!0},{default:Re(()=>[De(Dp,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[F(r),"Clear"]]):(L(),qe(Dp,{key:1,src:"Calendar",source:"remote",class:ke(I.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),mIa="_focus_132fk_12",gIa="_hover_132fk_12",vIa="_active_132fk_12",yIa="_invalid_132fk_38",bIa={"date-input-wrapper":"_date-input-wrapper_132fk_1","icon-calendar":"_icon-calendar_132fk_9",focus:mIa,hover:gIa,active:vIa,"date-input":"_date-input_132fk_1",invalid:yIa},wIa={$style:bIa},wBt=Tp(pIa,[["__cssModules",wIa]]);pBt();const _Ia=["onKeydown"],CIa=["width","height","viewBox"],SIa=["d"],kIa="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",EIa=ct({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change","handleEnter","cancel"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=W(r.modelValue??0),o=W(null),s=z(()=>{var R;return((R=r.params)==null?void 0:R.size)??24}),l=z(()=>{var R;return((R=r.params)==null?void 0:R.iconViewBox)??"0 0 24 24"}),u=z(()=>{var R;return((R=r.params)==null?void 0:R.iconPath)??kIa}),c=z(()=>{var R;return((R=r.params)==null?void 0:R.wrapperTag)??"span"}),d=z(()=>{var R;return r.disabled||((R=r.params)==null?void 0:R.disabled)||!1}),p=z(()=>{var R;return r.readOnly||((R=r.params)==null?void 0:R.readOnly)||!1}),h=z(()=>!d.value&&!p.value),g=z(()=>d.value?"not-allowed":p.value?"default":"pointer");lt(()=>r.modelValue,R=>{typeof R=="number"&&R!==i.value&&(i.value=R)});const v=R=>{var B;return((B=r.params)==null?void 0:B.maxRating)-R+1<=i.value&&!b.value},b=W(!1),_=()=>{b.value=!0},C=()=>{b.value=!1},S=R=>{h.value&&y(R)},y=R=>{var B,P;if(!h.value)return;let $=((B=r.params)==null?void 0:B.maxRating)-R+1;$===i.value&&($=0),i.value=$,a("update:modelValue",$),a("update",$),a("change",$),(P=r.params)!=null&&P.onUpdate&&r.params.onUpdate($)},T=R=>{var B;R!==i.value&&(i.value=R,a("update:modelValue",R),a("update",R),a("change",R),(B=r.params)!=null&&B.onUpdate&&r.params.onUpdate(R),k.value=R)},k=W(i.value),E=R=>{R.preventDefault(),R.stopPropagation(),R.stopImmediatePropagation(),i.value=k.value,a("cancel")},I=R=>{R.preventDefault(),T(i.value),a("handleEnter",i.value)},D=()=>{h.value&&(i.value=Math.min(i.value+1%(r.params.maxRating+1),r.params.maxRating),T(i.value))},A=()=>{h.value&&(i.value=Math.max(i.value-1,0),T(i.value))};return t({focus:()=>{var R;(R=o.value)==null||R.focus()}}),(R,B)=>(L(),re("div",{class:ke(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":p.value}]),style:Yt({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:o,tabindex:"1",onKeydown:[Jn(Ot(A,["prevent"]),["left"]),Jn(Ot(D,["prevent"]),["right"]),Jn(Ot(A,["prevent"]),["down"]),Jn(Ot(D,["prevent"]),["up"]),Jn(Ot(I,["prevent"]),["enter"]),Jn(Ot(I,["prevent"]),["tab"]),Jn(Ot(E,["prevent"]),["escape"])]},[(L(!0),re($t,null,rn(e.params.maxRating,P=>(L(),qe(sc(c.value),{key:P,class:ke(["rating-item",{filled:v(P),"rating-item--disabled":d.value,"rating-item--readOnly":p.value}]),style:Yt({cursor:g.value,order:e.params.maxRating-P,height:s.value+"px",width:s.value+"px"}),"aria-checked":v(P),"aria-disabled":d.value,"aria-readOnly":p.value,title:e.params.maxRating-P+1,tabindex:-1,onClick:Ot($=>S(P),["prevent","stop"]),onMouseenter:_,onMouseleave:C},{default:Re(()=>[at(R.$slots,"icon",{index:P,filled:v(P),size:s.value,iconViewBox:l.value,disabled:d.value,readOnly:p.value,value:P},()=>[(L(),re("svg",{class:"rating-icon",width:s.value,height:s.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[be("path",{d:u.value},null,8,SIa)],8,CIa))]),at(R.$slots,"overlay",{index:P,filled:v(P),disabled:d.value,readOnly:p.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,_Ia))}}),xIa={style:{maxWidth:"180px",lineHeight:"15px"}},TIa=["innerHTML"],DIa=ct({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const r=qC,a=e,i=n,o=()=>{i("handleCancel")},s=()=>{i("close")},l=b=>{var _;if(b.format_type==="dropdown"&&b.format_value)try{const C=JSON.parse(b.format_value);if(Array.isArray(C)){const S=C.map(y=>({label:y.name,value:y.name,id:y.name}));return S.unshift({label:"-",value:void 0,id:"-"}),S}}catch(C){console.error("Failed to parse dropdown options",C)}if(b.format_type=="number"&&b.restricted_type=="exact"){const C=((_=b.restricted_value)==null?void 0:_.split(",").map(S=>({label:b.mapping[`!${S}`]||S,value:S,id:S})))||[];return C.unshift({label:"-",value:void 0,id:"-"}),C}return[]},u=z(()=>l(a.config)),c=W(a.modelValue),d=b=>{c.value=b,i("update:modelValue",b),i("change",b||null)},p=W(u.value),h=W(!1),g=b=>{h.value=!0,b?p.value=u.value.filter(_=>_.label.toLowerCase().includes(b.toLowerCase())):p.value=u.value,setTimeout(()=>{h.value=!1},300)},v=W(null);return nn(()=>{var b;(b=v.value)==null||b.focus()}),t({focus:()=>{var b;(b=v.value)==null||b.focus()}}),(b,_)=>(L(),qe(W2a,{style:{width:326},loading:h.value,options:p.value,"selected-id":e.modelValue||void 0,onSearch:g,onSelect:_[0]||(_[0]=C=>d(C.id)),ref_key:"searchListRef",ref:v,onClose:s,onCancel:o},{item:Re(({item:C,getHighlightedLabel:S,selectedIndex:y,index:T})=>[De(bBt,{hover:y==T,selected:C.value===e.modelValue,label:C.label,onSelect:k=>d(C.value||null),onClick:k=>d(C.value||null)},{label:Re(()=>[be("div",xIa,[ft(be("span",{innerHTML:S(C.label)},null,8,TIa),[[F(r),{content:C.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":Re(()=>[..._[1]||(_[1]=[Dt("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),AIa={class:"metric-input-wrapper"},OIa={key:0,class:"error-text input-2"},IIa=ct({__name:"MetricEditorInput",props:{config:{},modelValue:{},saveOnBlur:{type:Boolean,default:!0},saveOnEscape:{type:Boolean,default:!1},showInlineError:{type:Boolean,default:!1}},emits:["update:modelValue","handleChange","cancel","enter","onValidation"],setup(e,{expose:t,emit:n}){const r=qC,a=e,i=W(a.modelValue),o=W(a.modelValue),s=W(!1),l=W(!0),u=W(""),c=z(()=>{var $;const V=Number.parseInt(String(($=a.config)==null?void 0:$.format_value)||"2",10);return Number.isFinite(V)&&V>=0?V:2}),d=$=>{if(!$)return $;const V=String($).split(".");return V.length>1&&V[1].length>c.value?c.value===0?V[0]:`${V[0]}.${V[1].slice(0,c.value)}`:String($)},p=$=>{const V=d($);V!==$&&S.value?i.value=V:i.value=$},h=$=>{const V=$.target;if(!V)return;const N=V.value||"",q=N.indexOf(".");if($.key==="."&&c.value===0){$.preventDefault();return}q!==-1&&/[0-9]/.test($.key)&&N.slice(q+1).length>=c.value&&$.preventDefault()},g=z(()=>l.value||a.showInlineError?{content:""}:{content:u.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),v=()=>{var $;const V=a.config.restricted_type.trim(),N=(($=a.config.restricted_value)==null?void 0:$.split(",").map(Number))||[],[q,J]=N,ie={range:`Enter a value between ${q} and ${J}`,not:`These values are not allowed: ${N.join(", ")}`,exact:"Value is not allowed"}[V];return l.value?"":ie},b=z(()=>{var $;let V="";return Number(($=a.config)==null?void 0:$.format_value)&&(V+="."+Array.from({length:Number(a.config.format_value)}).map(()=>"0").join("")),`0${V}`});lt(()=>a.modelValue,$=>{i.value=$,o.value=$});const _=$=>URe(a.config,$),C=n,S=W(null),y=$=>{const V=$===""?null:$,N=o.value===""?null:o.value;return V!==N},T=$=>{const V=d($);if(!y(V))return!1;const N=V===""?null:V;return i.value=N,o.value=N,C("update:modelValue",N),C("handleChange",N),!0},k=()=>{i.value=o.value,C("update:modelValue",o.value)},E=($,V)=>{T($),C("enter")},I=($,V)=>{if(s.value){s.value=!1;return}a.saveOnBlur?T($):k()},D=$=>{if($===null||$===""){l.value=!0;return}l.value=URe(a.config,Number($)),u.value=l.value?"":v()},A=($,V)=>{s.value=!0,a.saveOnEscape?T($):k(),C("cancel"),setTimeout(()=>{s.value=!1},100)},R=$=>{D($),C("onValidation",$)},B=()=>{s.value=!0,k(),C("cancel"),setTimeout(()=>{s.value=!1},100)},P=()=>{var $;i.value=null,o.value=null,C("update:modelValue",null),C("handleChange",null),($=S.value)==null||$.focus()};return t({focus:()=>{var $;return($=S.value)==null?void 0:$.focus()},blur:()=>{var $;return($=S.value)==null?void 0:$.blur()},getValue:()=>i.value,getCachedValue:()=>o.value,save:()=>T(i.value),revert:k}),nn(()=>{var $;($=S.value)==null||$.focus()}),($,V)=>ft((L(),re("div",AIa,[De(yBt,{maxDecimalChar:c.value,modelValue:i.value,"onUpdate:modelValue":V[0]||(V[0]=N=>i.value=N),placeholder:b.value,validatorFnc:_,style:{"--bg-input":"#FAFAFA"},onInput:p,onKeydown:h,onEnter:E,onBlur:I,onClear:P,onEscape:A,onCancel:B,onOnValidation:R,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:S},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(L(),re("span",OIa,vt(u.value),1)):Ve("",!0)])),[[F(r),g.value]])}});var uV=(e=>(e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.TOO_EARLY=425]="TOO_EARLY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",e))(uV||{});function _Bt(e,t){return function(){return e.apply(t,arguments)}}const{toString:RIa}=Object.prototype,{getPrototypeOf:GRe}=Object,{iterator:qse,toStringTag:CBt}=Symbol,Kse=(e=>t=>{const n=RIa.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),I_=e=>(e=e.toLowerCase(),t=>Kse(t)===e),Yse=e=>t=>typeof t===e,{isArray:cV}=Array,dV=Yse("undefined");function oG(e){return e!==null&&!dV(e)&&e.constructor!==null&&!dV(e.constructor)&&Ig(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const SBt=I_("ArrayBuffer");function $Ia(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&SBt(e.buffer),t}const PIa=Yse("string"),Ig=Yse("function"),kBt=Yse("number"),sG=e=>e!==null&&typeof e=="object",MIa=e=>e===!0||e===!1,Jse=e=>{if(Kse(e)!=="object")return!1;const t=GRe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(CBt in e)&&!(qse in e)},NIa=e=>{if(!sG(e)||oG(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},LIa=I_("Date"),FIa=I_("File"),BIa=I_("Blob"),VIa=I_("FileList"),UIa=e=>sG(e)&&Ig(e.pipe),HIa=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ig(e.append)&&((t=Kse(e))==="formdata"||t==="object"&&Ig(e.toString)&&e.toString()==="[object FormData]"))},jIa=I_("URLSearchParams"),[zIa,WIa,GIa,qIa]=["ReadableStream","Request","Response","Headers"].map(I_),KIa=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function lG(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),cV(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{if(oG(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let s;for(r=0;r<o;r++)s=i[r],t.call(null,e[s],s,e)}}function EBt(e,t){if(oG(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,a;for(;r-- >0;)if(a=n[r],t===a.toLowerCase())return a;return null}const QR=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xBt=e=>!dV(e)&&e!==QR;function qRe(){const{caseless:e,skipUndefined:t}=xBt(this)&&this||{},n={},r=(a,i)=>{const o=e&&EBt(n,i)||i;Jse(n[o])&&Jse(a)?n[o]=qRe(n[o],a):Jse(a)?n[o]=qRe({},a):cV(a)?n[o]=a.slice():(!t||!dV(a))&&(n[o]=a)};for(let a=0,i=arguments.length;a<i;a++)arguments[a]&&lG(arguments[a],r);return n}const YIa=(e,t,n,{allOwnKeys:r}={})=>(lG(t,(a,i)=>{n&&Ig(a)?e[i]=_Bt(a,n):e[i]=a},{allOwnKeys:r}),e),JIa=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ZIa=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},XIa=(e,t,n,r)=>{let a,i,o;const s={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)o=a[i],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&GRe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},QIa=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},eRa=e=>{if(!e)return null;if(cV(e))return e;let t=e.length;if(!kBt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},tRa=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&GRe(Uint8Array)),nRa=(e,t)=>{const n=(e&&e[qse]).call(e);let r;for(;(r=n.next())&&!r.done;){const a=r.value;t.call(e,a[0],a[1])}},rRa=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},aRa=I_("HTMLFormElement"),iRa=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,r){return n.toUpperCase()+r}),TBt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),oRa=I_("RegExp"),DBt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};lG(n,(a,i)=>{let o;(o=t(a,i,e))!==!1&&(r[i]=o||a)}),Object.defineProperties(e,r)},sRa=e=>{DBt(e,(t,n)=>{if(Ig(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ig(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},lRa=(e,t)=>{const n={},r=a=>{a.forEach(i=>{n[i]=!0})};return cV(e)?r(e):r(String(e).split(t)),n},uRa=()=>{},cRa=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function dRa(e){return!!(e&&Ig(e.append)&&e[CBt]==="FormData"&&e[qse])}const fRa=e=>{const t=new Array(10),n=(r,a)=>{if(sG(r)){if(t.indexOf(r)>=0)return;if(oG(r))return r;if(!("toJSON"in r)){t[a]=r;const i=cV(r)?[]:{};return lG(r,(o,s)=>{const l=n(o,a+1);!dV(l)&&(i[s]=l)}),t[a]=void 0,i}}return r};return n(e,0)},hRa=I_("AsyncFunction"),pRa=e=>e&&(sG(e)||Ig(e))&&Ig(e.then)&&Ig(e.catch),ABt=((e,t)=>e?setImmediate:t?((n,r)=>(QR.addEventListener("message",({source:a,data:i})=>{a===QR&&i===n&&r.length&&r.shift()()},!1),a=>{r.push(a),QR.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ig(QR.postMessage)),mRa=typeof queueMicrotask<"u"?queueMicrotask.bind(QR):typeof ze<"u"&&ze.nextTick||ABt,gRa=e=>e!=null&&Ig(e[qse]),vn={isArray:cV,isArrayBuffer:SBt,isBuffer:oG,isFormData:HIa,isArrayBufferView:$Ia,isString:PIa,isNumber:kBt,isBoolean:MIa,isObject:sG,isPlainObject:Jse,isEmptyObject:NIa,isReadableStream:zIa,isRequest:WIa,isResponse:GIa,isHeaders:qIa,isUndefined:dV,isDate:LIa,isFile:FIa,isBlob:BIa,isRegExp:oRa,isFunction:Ig,isStream:UIa,isURLSearchParams:jIa,isTypedArray:tRa,isFileList:VIa,forEach:lG,merge:qRe,extend:YIa,trim:KIa,stripBOM:JIa,inherits:ZIa,toFlatObject:XIa,kindOf:Kse,kindOfTest:I_,endsWith:QIa,toArray:eRa,forEachEntry:nRa,matchAll:rRa,isHTMLForm:aRa,hasOwnProperty:TBt,hasOwnProp:TBt,reduceDescriptors:DBt,freezeMethods:sRa,toObjectSet:lRa,toCamelCase:iRa,noop:uRa,toFiniteNumber:cRa,findKey:EBt,global:QR,isContextDefined:xBt,isSpecCompliantForm:dRa,toJSONObject:fRa,isAsyncFn:hRa,isThenable:pRa,setImmediate:ABt,asap:mRa,isIterable:gRa};function Fi(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}vn.inherits(Fi,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:vn.toJSONObject(this.config),code:this.code,status:this.status}}});const OBt=Fi.prototype,IBt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{IBt[e]={value:e}}),Object.defineProperties(Fi,IBt),Object.defineProperty(OBt,"isAxiosError",{value:!0}),Fi.from=(e,t,n,r,a,i)=>{const o=Object.create(OBt);vn.toFlatObject(e,o,function(u){return u!==Error.prototype},u=>u!=="isAxiosError");const s=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return Fi.call(o,s,l,n,r,a),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};const vRa=null;function KRe(e){return vn.isPlainObject(e)||vn.isArray(e)}function RBt(e){return vn.endsWith(e,"[]")?e.slice(0,-2):e}function $Bt(e,t,n){return e?e.concat(t).map(function(r,a){return r=RBt(r),!n&&a?"["+r+"]":r}).join(n?".":""):t}function yRa(e){return vn.isArray(e)&&!e.some(KRe)}const bRa=vn.toFlatObject(vn,{},null,function(e){return/^is[A-Z]/.test(e)});function Zse(e,t,n){if(!vn.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=vn.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,g){return!vn.isUndefined(g[h])});const r=n.metaTokens,a=n.visitor||u,i=n.dots,o=n.indexes,s=(n.Blob||typeof Blob<"u"&&Blob)&&vn.isSpecCompliantForm(t);if(!vn.isFunction(a))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(vn.isDate(h))return h.toISOString();if(vn.isBoolean(h))return h.toString();if(!s&&vn.isBlob(h))throw new Fi("Blob is not supported. Use a Buffer instead.");return vn.isArrayBuffer(h)||vn.isTypedArray(h)?s&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,g,v){let b=h;if(h&&!v&&typeof h=="object"){if(vn.endsWith(g,"{}"))g=r?g:g.slice(0,-2),h=JSON.stringify(h);else if(vn.isArray(h)&&yRa(h)||(vn.isFileList(h)||vn.endsWith(g,"[]"))&&(b=vn.toArray(h)))return g=RBt(g),b.forEach(function(_,C){!(vn.isUndefined(_)||_===null)&&t.append(o===!0?$Bt([g],C,i):o===null?g:g+"[]",l(_))}),!1}return KRe(h)?!0:(t.append($Bt(v,g,i),l(h)),!1)}const c=[],d=Object.assign(bRa,{defaultVisitor:u,convertValue:l,isVisitable:KRe});function p(h,g){if(!vn.isUndefined(h)){if(c.indexOf(h)!==-1)throw Error("Circular reference detected in "+g.join("."));c.push(h),vn.forEach(h,function(v,b){(!(vn.isUndefined(v)||v===null)&&a.call(t,v,vn.isString(b)?b.trim():b,g,d))===!0&&p(v,g?g.concat(b):[b])}),c.pop()}}if(!vn.isObject(e))throw new TypeError("data must be an object");return p(e),t}function PBt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function YRe(e,t){this._pairs=[],e&&Zse(e,this,t)}const MBt=YRe.prototype;MBt.append=function(e,t){this._pairs.push([e,t])},MBt.toString=function(e){const t=e?function(n){return e.call(this,n,PBt)}:PBt;return this._pairs.map(function(n){return t(n[0])+"="+t(n[1])},"").join("&")};function wRa(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function NBt(e,t,n){if(!t)return e;const r=n&&n.encode||wRa;vn.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let i;if(a?i=a(t,n):i=vn.isURLSearchParams(t)?t.toString():new YRe(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class LBt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){vn.forEach(this.handlers,function(n){n!==null&&t(n)})}}const FBt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_Ra=typeof URLSearchParams<"u"?URLSearchParams:YRe,CRa=typeof FormData<"u"?FormData:null,SRa=typeof Blob<"u"?Blob:null,kRa={isBrowser:!0,classes:{URLSearchParams:_Ra,FormData:CRa,Blob:SRa},protocols:["http","https","file","blob","url","data"]},JRe=typeof window<"u"&&typeof document<"u",ZRe=typeof navigator=="object"&&navigator||void 0,ERa=JRe&&(!ZRe||["ReactNative","NativeScript","NS"].indexOf(ZRe.product)<0),xRa=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",TRa=JRe&&window.location.href||"http://localhost",DRa=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:JRe,hasStandardBrowserEnv:ERa,hasStandardBrowserWebWorkerEnv:xRa,navigator:ZRe,origin:TRa},Symbol.toStringTag,{value:"Module"})),Ip={...DRa,...kRa};function ARa(e,t){return Zse(e,new Ip.classes.URLSearchParams,{visitor:function(n,r,a,i){return Ip.isNode&&vn.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function ORa(e){return vn.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function IRa(e){const t={},n=Object.keys(e);let r;const a=n.length;let i;for(r=0;r<a;r++)i=n[r],t[i]=e[i];return t}function BBt(e){function t(n,r,a,i){let o=n[i++];if(o==="__proto__")return!0;const s=Number.isFinite(+o),l=i>=n.length;return o=!o&&vn.isArray(a)?a.length:o,l?(vn.hasOwnProp(a,o)?a[o]=[a[o],r]:a[o]=r,!s):((!a[o]||!vn.isObject(a[o]))&&(a[o]=[]),t(n,r,a[o],i)&&vn.isArray(a[o])&&(a[o]=IRa(a[o])),!s)}if(vn.isFormData(e)&&vn.isFunction(e.entries)){const n={};return vn.forEachEntry(e,(r,a)=>{t(ORa(r),a,n,0)}),n}return null}function RRa(e,t,n){if(vn.isString(e))try{return(t||JSON.parse)(e),vn.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const uG={transitional:FBt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,a=vn.isObject(e);if(a&&vn.isHTMLForm(e)&&(e=new FormData(e)),vn.isFormData(e))return r?JSON.stringify(BBt(e)):e;if(vn.isArrayBuffer(e)||vn.isBuffer(e)||vn.isStream(e)||vn.isFile(e)||vn.isBlob(e)||vn.isReadableStream(e))return e;if(vn.isArrayBufferView(e))return e.buffer;if(vn.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return ARa(e,this.formSerializer).toString();if((i=vn.isFileList(e))||n.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return Zse(i?{"files[]":e}:e,o&&new o,this.formSerializer)}}return a||r?(t.setContentType("application/json",!1),RRa(e)):e}],transformResponse:[function(e){const t=this.transitional||uG.transitional,n=t&&t.forcedJSONParsing,r=this.responseType==="json";if(vn.isResponse(e)||vn.isReadableStream(e))return e;if(e&&vn.isString(e)&&(n&&!this.responseType||r)){const a=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(i){if(a)throw i.name==="SyntaxError"?Fi.from(i,Fi.ERR_BAD_RESPONSE,this,null,this.response):i}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ip.classes.FormData,Blob:Ip.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};vn.forEach(["delete","get","head","post","put","patch"],e=>{uG.headers[e]={}});const $Ra=vn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),PRa=e=>{const t={};let n,r,a;return e&&e.split(`
1031
+ `+M:""),this.inner=M||null):typeof O=="object"&&(this.message="".concat(O.name," ").concat(O.message),this.inner=O):(this.message=j[m]||w,this.inner=null)}return v(x).from(G),f[m]=x,f},{});Y.Syntax=SyntaxError,Y.Type=TypeError,Y.Range=RangeError;var Ee=Ke.reduce(function(f,m){return f[m+"Error"]=Y[m],f},{}),he=er.reduce(function(f,m){return["Syntax","Type","Range"].indexOf(m)===-1&&(f[m+"Error"]=Y[m]),f},{});function Pe(){}function Te(f){return f}function Ae(f,m){return f==null||f===Te?m:function(w){return m(f(w))}}function xe(f,m){return function(){f.apply(this,arguments),m.apply(this,arguments)}}function Je(f,m){return f===Pe?m:function(){var w=f.apply(this,arguments);w!==void 0&&(arguments[0]=w);var x=this.onsuccess,O=this.onerror;this.onsuccess=null,this.onerror=null;var M=m.apply(this,arguments);return x&&(this.onsuccess=this.onsuccess?xe(x,this.onsuccess):x),O&&(this.onerror=this.onerror?xe(O,this.onerror):O),M!==void 0?M:w}}function We(f,m){return f===Pe?m:function(){f.apply(this,arguments);var w=this.onsuccess,x=this.onerror;this.onsuccess=this.onerror=null,m.apply(this,arguments),w&&(this.onsuccess=this.onsuccess?xe(w,this.onsuccess):w),x&&(this.onerror=this.onerror?xe(x,this.onerror):x)}}function Ye(f,m){return f===Pe?m:function(w){var x=f.apply(this,arguments);l(w,x);var O=this.onsuccess,M=this.onerror;return this.onsuccess=null,this.onerror=null,w=m.apply(this,arguments),O&&(this.onsuccess=this.onsuccess?xe(O,this.onsuccess):O),M&&(this.onerror=this.onerror?xe(M,this.onerror):M),x===void 0?w===void 0?void 0:w:l(x,w)}}function Ze(f,m){return f===Pe?m:function(){return m.apply(this,arguments)!==!1&&f.apply(this,arguments)}}function ne(f,m){return f===Pe?m:function(){var w=f.apply(this,arguments);if(w&&typeof w.then=="function"){for(var x=this,O=arguments.length,M=new Array(O);O--;)M[O]=arguments[O];return w.then(function(){return m.apply(x,M)})}return m.apply(this,arguments)}}he.ModifyError=oe,he.DexieError=U,he.BulkError=fe;var se=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Ue(f){se=f}var je={},Ge=100,Wr=typeof Promise>"u"?[]:function(){var f=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[f,u(f),f];var m=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[m,u(m),f]}(),Ke=Wr[0],er=Wr[1],Wr=Wr[2],er=er&&er.then,ut=Ke&&Ke.constructor,mt=!!Wr,ht=function(f,m){Xe.push([f,m]),Lt&&(queueMicrotask(wt),Lt=!1)},It=!0,Lt=!0,_t=[],Et=[],qt=Te,le={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Pe,pgp:!1,env:{},finalize:Pe},we=le,Xe=[],rt=0,He=[];function $e(f){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var m=this._PSD=we;if(typeof f!="function"){if(f!==je)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Ut(this,this._value))}this._state=null,this._value=null,++m.ref,function w(x,O){try{O(function(M){if(x._state===null){if(M===x)throw new TypeError("A promise cannot be resolved with itself.");var K=x._lib&&xt();M&&typeof M.then=="function"?w(x,function(te,pe){M instanceof $e?M._then(te,pe):M.then(te,pe)}):(x._state=!0,x._value=M,Jt(x)),K&&Ht()}},Ut.bind(null,x))}catch(M){Ut(x,M)}}(this,f)}var kt={get:function(){var f=we,m=gi;function w(x,O){var M=this,K=!f.global&&(f!==we||m!==gi),te=K&&!ar(),pe=new $e(function(ge,ue){dn(M,new Gt(no(x,f,K,te),no(O,f,K,te),ge,ue,f))});return this._consoleTask&&(pe._consoleTask=this._consoleTask),pe}return w.prototype=je,w},set:function(f){g(this,"then",f&&f.prototype===je?kt:{get:function(){return f},set:kt.set})}};function Gt(f,m,w,x,O){this.onFulfilled=typeof f=="function"?f:null,this.onRejected=typeof m=="function"?m:null,this.resolve=w,this.reject=x,this.psd=O}function Ut(f,m){var w,x;Et.push(m),f._state===null&&(w=f._lib&&xt(),m=qt(m),f._state=!1,f._value=m,x=f,_t.some(function(O){return O._value===x._value})||_t.push(x),Jt(f),w&&Ht())}function Jt(f){var m=f._listeners;f._listeners=[];for(var w=0,x=m.length;w<x;++w)dn(f,m[w]);var O=f._PSD;--O.ref||O.finalize(),rt===0&&(++rt,ht(function(){--rt==0&&wn()},[]))}function dn(f,m){if(f._state!==null){var w=f._state?m.onFulfilled:m.onRejected;if(w===null)return(f._state?m.resolve:m.reject)(f._value);++m.psd.ref,++rt,ht(gt,[w,f,m])}else f._listeners.push(m)}function gt(f,m,w){try{var x,O=m._value;!m._state&&Et.length&&(Et=[]),x=se&&m._consoleTask?m._consoleTask.run(function(){return f(O)}):f(O),m._state||Et.indexOf(O)!==-1||function(M){for(var K=_t.length;K;)if(_t[--K]._value===M._value)return _t.splice(K,1)}(m),w.resolve(x)}catch(M){w.reject(M)}finally{--rt==0&&wn(),--w.psd.ref||w.psd.finalize()}}function wt(){or(le,function(){xt()&&Ht()})}function xt(){var f=It;return Lt=It=!1,f}function Ht(){var f,m,w;do for(;0<Xe.length;)for(f=Xe,Xe=[],w=f.length,m=0;m<w;++m){var x=f[m];x[0].apply(null,x[1])}while(0<Xe.length);Lt=It=!0}function wn(){var f=_t;_t=[],f.forEach(function(x){x._PSD.onunhandled.call(null,x._value,x)});for(var m=He.slice(0),w=m.length;w;)m[--w]()}function An(f){return new $e(je,!1,f)}function Vt(f,m){var w=we;return function(){var x=xt(),O=we;try{return Dr(w,!0),f.apply(this,arguments)}catch(M){m&&m(M)}finally{Dr(O,!1),x&&Ht()}}}p($e.prototype,{then:kt,_then:function(f,m){dn(this,new Gt(null,null,f,m,we))},catch:function(f){if(arguments.length===1)return this.then(null,f);var m=f,w=arguments[1];return typeof m=="function"?this.then(null,function(x){return(x instanceof m?w:An)(x)}):this.then(null,function(x){return(x&&x.name===m?w:An)(x)})},finally:function(f){return this.then(function(m){return $e.resolve(f()).then(function(){return m})},function(m){return $e.resolve(f()).then(function(){return An(m)})})},timeout:function(f,m){var w=this;return f<1/0?new $e(function(x,O){var M=setTimeout(function(){return O(new Y.Timeout(m))},f);w.then(x,O).finally(clearTimeout.bind(null,M))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&g($e.prototype,Symbol.toStringTag,"Dexie.Promise"),le.env=Do(),p($e,{all:function(){var f=de.apply(null,arguments).map(yr);return new $e(function(m,w){f.length===0&&m([]);var x=f.length;f.forEach(function(O,M){return $e.resolve(O).then(function(K){f[M]=K,--x||m(f)},w)})})},resolve:function(f){return f instanceof $e?f:f&&typeof f.then=="function"?new $e(function(m,w){f.then(m,w)}):new $e(je,!0,f)},reject:An,race:function(){var f=de.apply(null,arguments).map(yr);return new $e(function(m,w){f.map(function(x){return $e.resolve(x).then(m,w)})})},PSD:{get:function(){return we},set:function(f){return we=f}},totalEchoes:{get:function(){return gi}},newPSD:Lr,usePSD:or,scheduler:{get:function(){return ht},set:function(f){ht=f}},rejectionMapper:{get:function(){return qt},set:function(f){qt=f}},follow:function(f,m){return new $e(function(w,x){return Lr(function(O,M){var K=we;K.unhandleds=[],K.onunhandled=M,K.finalize=xe(function(){var te,pe=this;te=function(){pe.unhandleds.length===0?O():M(pe.unhandleds[0])},He.push(function ge(){te(),He.splice(He.indexOf(ge),1)}),++rt,ht(function(){--rt==0&&wn()},[])},K.finalize),f()},m,w,x)})}}),ut&&(ut.allSettled&&g($e,"allSettled",function(){var f=de.apply(null,arguments).map(yr);return new $e(function(m){f.length===0&&m([]);var w=f.length,x=new Array(w);f.forEach(function(O,M){return $e.resolve(O).then(function(K){return x[M]={status:"fulfilled",value:K}},function(K){return x[M]={status:"rejected",reason:K}}).then(function(){return--w||m(x)})})})}),ut.any&&typeof AggregateError<"u"&&g($e,"any",function(){var f=de.apply(null,arguments).map(yr);return new $e(function(m,w){f.length===0&&w(new AggregateError([]));var x=f.length,O=new Array(x);f.forEach(function(M,K){return $e.resolve(M).then(function(te){return m(te)},function(te){O[K]=te,--x||w(new AggregateError(O))})})})}),ut.withResolvers&&($e.withResolvers=ut.withResolvers));var ln={awaits:0,echoes:0,id:0},di=0,lr=[],ca=0,gi=0,Zs=0;function Lr(f,m,w,x){var O=we,M=Object.create(O);return M.parent=O,M.ref=0,M.global=!1,M.id=++Zs,le.env,M.env=mt?{Promise:$e,PromiseProp:{value:$e,configurable:!0,writable:!0},all:$e.all,race:$e.race,allSettled:$e.allSettled,any:$e.any,resolve:$e.resolve,reject:$e.reject}:{},m&&l(M,m),++O.ref,M.finalize=function(){--this.parent.ref||this.parent.finalize()},x=or(M,f,w,x),M.ref===0&&M.finalize(),x}function Yn(){return ln.id||(ln.id=++di),++ln.awaits,ln.echoes+=Ge,ln.id}function ar(){return!!ln.awaits&&(--ln.awaits==0&&(ln.id=0),ln.echoes=ln.awaits*Ge,!0)}function yr(f){return ln.echoes&&f&&f.constructor===ut?(Yn(),f.then(function(m){return ar(),m},function(m){return ar(),un(m)})):f}function cs(){var f=lr[lr.length-1];lr.pop(),Dr(f,!1)}function Dr(f,m){var w,x=we;(m?!ln.echoes||ca++&&f===we:!ca||--ca&&f===we)||queueMicrotask(m?(function(O){++gi,ln.echoes&&--ln.echoes!=0||(ln.echoes=ln.awaits=ln.id=0),lr.push(we),Dr(O,!0)}).bind(null,f):cs),f!==we&&(we=f,x===le&&(le.env=Do()),mt&&(w=le.env.Promise,m=f.env,(x.global||f.global)&&(Object.defineProperty(i,"Promise",m.PromiseProp),w.all=m.all,w.race=m.race,w.resolve=m.resolve,w.reject=m.reject,m.allSettled&&(w.allSettled=m.allSettled),m.any&&(w.any=m.any))))}function Do(){var f=i.Promise;return mt?{Promise:f,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:f.all,race:f.race,allSettled:f.allSettled,any:f.any,resolve:f.resolve,reject:f.reject}:{}}function or(f,m,w,x,O){var M=we;try{return Dr(f,!0),m(w,x,O)}finally{Dr(M,!1)}}function no(f,m,w,x){return typeof f!="function"?f:function(){var O=we;w&&Yn(),Dr(m,!0);try{return f.apply(this,arguments)}finally{Dr(O,!1),x&&queueMicrotask(ar)}}}function ia(f){Promise===ut&&ln.echoes===0?ca===0?f():enqueueNativeMicroTask(f):setTimeout(f,0)}(""+er).indexOf("[native code]")===-1&&(Yn=ar=Pe);var un=$e.reject,oa="￿",Ir="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Tu="String expected.",wa=[],ho="__dbnames",Xs="readonly",Qs="readwrite";function Ea(f,m){return f?m?function(){return f.apply(this,arguments)&&m.apply(this,arguments)}:f:m}var Uc={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Mo(f){return typeof f!="string"||/\./.test(f)?function(m){return m}:function(m){return m[f]===void 0&&f in m&&delete(m=P(m))[f],m}}function Du(){throw Y.Type()}function Kt(f,m){try{var w=Hc(f),x=Hc(m);if(w!==x)return w==="Array"?1:x==="Array"?-1:w==="binary"?1:x==="binary"?-1:w==="string"?1:x==="string"?-1:w==="Date"?1:x!=="Date"?NaN:-1;switch(w){case"number":case"Date":case"string":return m<f?1:f<m?-1:0;case"binary":return function(O,M){for(var K=O.length,te=M.length,pe=K<te?K:te,ge=0;ge<pe;++ge)if(O[ge]!==M[ge])return O[ge]<M[ge]?-1:1;return K===te?0:K<te?-1:1}(uu(f),uu(m));case"Array":return function(O,M){for(var K=O.length,te=M.length,pe=K<te?K:te,ge=0;ge<pe;++ge){var ue=Kt(O[ge],M[ge]);if(ue!==0)return ue}return K===te?0:K<te?-1:1}(f,m)}}catch{}return NaN}function Hc(f){var m=typeof f;return m!="object"?m:ArrayBuffer.isView(f)?"binary":(f=V(f),f==="ArrayBuffer"?"binary":f)}function uu(f){return f instanceof Uint8Array?f:ArrayBuffer.isView(f)?new Uint8Array(f.buffer,f.byteOffset,f.byteLength):new Uint8Array(f)}var Vl=(sn.prototype._trans=function(f,m,w){var x=this._tx||we.trans,O=this.name,M=se&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(f==="readonly"?"read":"write"," ").concat(this.name));function K(ge,ue,Q){if(!Q.schema[O])throw new Y.NotFound("Table "+O+" not part of transaction");return m(Q.idbtrans,Q)}var te=xt();try{var pe=x&&x.db._novip===this.db._novip?x===we.trans?x._promise(f,K,w):Lr(function(){return x._promise(f,K,w)},{trans:x,transless:we.transless||we}):function ge(ue,Q,me,ce){if(ue.idbdb&&(ue._state.openComplete||we.letThrough||ue._vip)){var ye=ue._createTransaction(Q,me,ue._dbSchema);try{ye.create(),ue._state.PR1398_maxLoop=3}catch(Se){return Se.name===ae.InvalidState&&ue.isOpen()&&0<--ue._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ue.close({disableAutoOpen:!1}),ue.open().then(function(){return ge(ue,Q,me,ce)})):un(Se)}return ye._promise(Q,function(Se,ve){return Lr(function(){return we.trans=ye,ce(Se,ve,ye)})}).then(function(Se){if(Q==="readwrite")try{ye.idbtrans.commit()}catch{}return Q==="readonly"?Se:ye._completion.then(function(){return Se})})}if(ue._state.openComplete)return un(new Y.DatabaseClosed(ue._state.dbOpenError));if(!ue._state.isBeingOpened){if(!ue._state.autoOpen)return un(new Y.DatabaseClosed);ue.open().catch(Pe)}return ue._state.dbReadyPromise.then(function(){return ge(ue,Q,me,ce)})}(this.db,f,[this.name],K);return M&&(pe._consoleTask=M,pe=pe.catch(function(ge){return console.trace(ge),un(ge)})),pe}finally{te&&Ht()}},sn.prototype.get=function(f,m){var w=this;return f&&f.constructor===Object?this.where(f).first(m):f==null?un(new Y.Type("Invalid argument to Table.get()")):this._trans("readonly",function(x){return w.core.get({trans:x,key:f}).then(function(O){return w.hook.reading.fire(O)})}).then(m)},sn.prototype.where=function(f){if(typeof f=="string")return new this.db.WhereClause(this,f);if(s(f))return new this.db.WhereClause(this,"[".concat(f.join("+"),"]"));var m=o(f);if(m.length===1)return this.where(m[0]).equals(f[m[0]]);var w=this.schema.indexes.concat(this.schema.primKey).filter(function(te){if(te.compound&&m.every(function(ge){return 0<=te.keyPath.indexOf(ge)})){for(var pe=0;pe<m.length;++pe)if(m.indexOf(te.keyPath[pe])===-1)return!1;return!0}return!1}).sort(function(te,pe){return te.keyPath.length-pe.keyPath.length})[0];if(w&&this.db._maxKey!==oa){var M=w.keyPath.slice(0,m.length);return this.where(M).equals(M.map(function(pe){return f[pe]}))}!w&&se&&console.warn("The query ".concat(JSON.stringify(f)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(m.join("+"),"]"));var x=this.schema.idxByName;function O(te,pe){return Kt(te,pe)===0}var K=m.reduce(function(Q,pe){var ge=Q[0],ue=Q[1],Q=x[pe],me=f[pe];return[ge||Q,ge||!Q?Ea(ue,Q&&Q.multi?function(ce){return ce=k(ce,pe),s(ce)&&ce.some(function(ye){return O(me,ye)})}:function(ce){return O(me,k(ce,pe))}):ue]},[null,null]),M=K[0],K=K[1];return M?this.where(M.name).equals(f[M.keyPath]).filter(K):w?this.filter(K):this.where(m).equals("")},sn.prototype.filter=function(f){return this.toCollection().and(f)},sn.prototype.count=function(f){return this.toCollection().count(f)},sn.prototype.offset=function(f){return this.toCollection().offset(f)},sn.prototype.limit=function(f){return this.toCollection().limit(f)},sn.prototype.each=function(f){return this.toCollection().each(f)},sn.prototype.toArray=function(f){return this.toCollection().toArray(f)},sn.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},sn.prototype.orderBy=function(f){return new this.db.Collection(new this.db.WhereClause(this,s(f)?"[".concat(f.join("+"),"]"):f))},sn.prototype.reverse=function(){return this.toCollection().reverse()},sn.prototype.mapToClass=function(f){var m,w=this.db,x=this.name;function O(){return m!==null&&m.apply(this,arguments)||this}(this.schema.mappedClass=f).prototype instanceof Du&&(function(pe,ge){if(typeof ge!="function"&&ge!==null)throw new TypeError("Class extends value "+String(ge)+" is not a constructor or null");function ue(){this.constructor=pe}n(pe,ge),pe.prototype=ge===null?Object.create(ge):(ue.prototype=ge.prototype,new ue)}(O,m=f),Object.defineProperty(O.prototype,"db",{get:function(){return w},enumerable:!1,configurable:!0}),O.prototype.table=function(){return x},f=O);for(var M=new Set,K=f.prototype;K;K=u(K))Object.getOwnPropertyNames(K).forEach(function(pe){return M.add(pe)});function te(pe){if(!pe)return pe;var ge,ue=Object.create(f.prototype);for(ge in pe)if(!M.has(ge))try{ue[ge]=pe[ge]}catch{}return ue}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=te,this.hook("reading",te),f},sn.prototype.defineClass=function(){return this.mapToClass(function(f){l(this,f)})},sn.prototype.add=function(f,m){var w=this,x=this.schema.primKey,O=x.auto,M=x.keyPath,K=f;return M&&O&&(K=Mo(M)(f)),this._trans("readwrite",function(te){return w.core.mutate({trans:te,type:"add",keys:m!=null?[m]:null,values:[K]})}).then(function(te){return te.numFailures?$e.reject(te.failures[0]):te.lastResult}).then(function(te){if(M)try{E(f,M,te)}catch{}return te})},sn.prototype.update=function(f,m){return typeof f!="object"||s(f)?this.where(":id").equals(f).modify(m):(f=k(f,this.schema.primKey.keyPath),f===void 0?un(new Y.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(f).modify(m))},sn.prototype.put=function(f,m){var w=this,x=this.schema.primKey,O=x.auto,M=x.keyPath,K=f;return M&&O&&(K=Mo(M)(f)),this._trans("readwrite",function(te){return w.core.mutate({trans:te,type:"put",values:[K],keys:m!=null?[m]:null})}).then(function(te){return te.numFailures?$e.reject(te.failures[0]):te.lastResult}).then(function(te){if(M)try{E(f,M,te)}catch{}return te})},sn.prototype.delete=function(f){var m=this;return this._trans("readwrite",function(w){return m.core.mutate({trans:w,type:"delete",keys:[f]})}).then(function(w){return w.numFailures?$e.reject(w.failures[0]):void 0})},sn.prototype.clear=function(){var f=this;return this._trans("readwrite",function(m){return f.core.mutate({trans:m,type:"deleteRange",range:Uc})}).then(function(m){return m.numFailures?$e.reject(m.failures[0]):void 0})},sn.prototype.bulkGet=function(f){var m=this;return this._trans("readonly",function(w){return m.core.getMany({keys:f,trans:w}).then(function(x){return x.map(function(O){return m.hook.reading.fire(O)})})})},sn.prototype.bulkAdd=function(f,m,w){var x=this,O=Array.isArray(m)?m:void 0,M=(w=w||(O?void 0:m))?w.allKeys:void 0;return this._trans("readwrite",function(K){var ge=x.schema.primKey,te=ge.auto,ge=ge.keyPath;if(ge&&O)throw new Y.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(O&&O.length!==f.length)throw new Y.InvalidArgument("Arguments objects and keys must have the same length");var pe=f.length,ge=ge&&te?f.map(Mo(ge)):f;return x.core.mutate({trans:K,type:"add",keys:O,values:ge,wantResults:M}).then(function(ye){var Q=ye.numFailures,me=ye.results,ce=ye.lastResult,ye=ye.failures;if(Q===0)return M?me:ce;throw new fe("".concat(x.name,".bulkAdd(): ").concat(Q," of ").concat(pe," operations failed"),ye)})})},sn.prototype.bulkPut=function(f,m,w){var x=this,O=Array.isArray(m)?m:void 0,M=(w=w||(O?void 0:m))?w.allKeys:void 0;return this._trans("readwrite",function(K){var ge=x.schema.primKey,te=ge.auto,ge=ge.keyPath;if(ge&&O)throw new Y.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(O&&O.length!==f.length)throw new Y.InvalidArgument("Arguments objects and keys must have the same length");var pe=f.length,ge=ge&&te?f.map(Mo(ge)):f;return x.core.mutate({trans:K,type:"put",keys:O,values:ge,wantResults:M}).then(function(ye){var Q=ye.numFailures,me=ye.results,ce=ye.lastResult,ye=ye.failures;if(Q===0)return M?me:ce;throw new fe("".concat(x.name,".bulkPut(): ").concat(Q," of ").concat(pe," operations failed"),ye)})})},sn.prototype.bulkUpdate=function(f){var m=this,w=this.core,x=f.map(function(K){return K.key}),O=f.map(function(K){return K.changes}),M=[];return this._trans("readwrite",function(K){return w.getMany({trans:K,keys:x,cache:"clone"}).then(function(te){var pe=[],ge=[];f.forEach(function(Q,me){var ce=Q.key,ye=Q.changes,Se=te[me];if(Se){for(var ve=0,Oe=Object.keys(ye);ve<Oe.length;ve++){var Me=Oe[ve],Ne=ye[Me];if(Me===m.schema.primKey.keyPath){if(Kt(Ne,ce)!==0)throw new Y.Constraint("Cannot update primary key in bulkUpdate()")}else E(Se,Me,Ne)}M.push(me),pe.push(ce),ge.push(Se)}});var ue=pe.length;return w.mutate({trans:K,type:"put",keys:pe,values:ge,updates:{keys:x,changeSpecs:O}}).then(function(Q){var me=Q.numFailures,ce=Q.failures;if(me===0)return ue;for(var ye=0,Se=Object.keys(ce);ye<Se.length;ye++){var ve,Oe=Se[ye],Me=M[Number(Oe)];Me!=null&&(ve=ce[Oe],delete ce[Oe],ce[Me]=ve)}throw new fe("".concat(m.name,".bulkUpdate(): ").concat(me," of ").concat(ue," operations failed"),ce)})})})},sn.prototype.bulkDelete=function(f){var m=this,w=f.length;return this._trans("readwrite",function(x){return m.core.mutate({trans:x,type:"delete",keys:f})}).then(function(K){var O=K.numFailures,M=K.lastResult,K=K.failures;if(O===0)return M;throw new fe("".concat(m.name,".bulkDelete(): ").concat(O," of ").concat(w," operations failed"),K)})},sn);function sn(){}function wi(f){function m(K,te){if(te){for(var pe=arguments.length,ge=new Array(pe-1);--pe;)ge[pe-1]=arguments[pe];return w[K].subscribe.apply(null,ge),f}if(typeof K=="string")return w[K]}var w={};m.addEventType=M;for(var x=1,O=arguments.length;x<O;++x)M(arguments[x]);return m;function M(K,te,pe){if(typeof K!="object"){var ge;te=te||Ze;var ue={subscribers:[],fire:pe=pe||Pe,subscribe:function(Q){ue.subscribers.indexOf(Q)===-1&&(ue.subscribers.push(Q),ue.fire=te(ue.fire,Q))},unsubscribe:function(Q){ue.subscribers=ue.subscribers.filter(function(me){return me!==Q}),ue.fire=ue.subscribers.reduce(te,pe)}};return w[K]=m[K]=ue}o(ge=K).forEach(function(Q){var me=ge[Q];if(s(me))M(Q,ge[Q][0],ge[Q][1]);else{if(me!=="asap")throw new Y.InvalidArgument("Invalid event config");var ce=M(Q,Te,function(){for(var ye=arguments.length,Se=new Array(ye);ye--;)Se[ye]=arguments[ye];ce.subscribers.forEach(function(ve){T(function(){ve.apply(null,Se)})})})}})}}function ji(f,m){return v(m).from({prototype:f}),m}function vi(f,m){return!(f.filter||f.algorithm||f.or)&&(m?f.justLimit:!f.replayFilter)}function cl(f,m){f.filter=Ea(f.filter,m)}function Us(f,m,w){var x=f.replayFilter;f.replayFilter=x?function(){return Ea(x(),m())}:m,f.justLimit=w&&!x}function zi(f,m){if(f.isPrimKey)return m.primaryKey;var w=m.getIndexByKeyPath(f.index);if(!w)throw new Y.Schema("KeyPath "+f.index+" on object store "+m.name+" is not indexed");return w}function Au(f,m,w){var x=zi(f,m.schema);return m.openCursor({trans:w,values:!f.keysOnly,reverse:f.dir==="prev",unique:!!f.unique,query:{index:x,range:f.range}})}function No(f,m,w,x){var O=f.replayFilter?Ea(f.filter,f.replayFilter()):f.filter;if(f.or){var M={},K=function(te,pe,ge){var ue,Q;O&&!O(pe,ge,function(me){return pe.stop(me)},function(me){return pe.fail(me)})||((Q=""+(ue=pe.primaryKey))=="[object ArrayBuffer]"&&(Q=""+new Uint8Array(ue)),d(M,Q)||(M[Q]=!0,m(te,pe,ge)))};return Promise.all([f.or._iterate(K,w),Ou(Au(f,x,w),f.algorithm,K,!f.keysOnly&&f.valueMapper)])}return Ou(Au(f,x,w),Ea(f.algorithm,O),m,!f.keysOnly&&f.valueMapper)}function Ou(f,m,w,x){var O=Vt(x?function(M,K,te){return w(x(M),K,te)}:w);return f.then(function(M){if(M)return M.start(function(){var K=function(){return M.continue()};m&&!m(M,function(te){return K=te},function(te){M.stop(te),K=Pe},function(te){M.fail(te),K=Pe})||O(M.value,M,function(te){return K=te}),K()})})}var Wr=Symbol(),za=(jc.prototype.execute=function(f){if(this.add!==void 0){var m=this.add;if(s(m))return a(a([],s(f)?f:[],!0),m).sort();if(typeof m=="number")return(Number(f)||0)+m;if(typeof m=="bigint")try{return BigInt(f)+m}catch{return BigInt(0)+m}throw new TypeError("Invalid term ".concat(m))}if(this.remove!==void 0){var w=this.remove;if(s(w))return s(f)?f.filter(function(x){return!w.includes(x)}).sort():[];if(typeof w=="number")return Number(f)-w;if(typeof w=="bigint")try{return BigInt(f)-w}catch{return BigInt(0)-w}throw new TypeError("Invalid subtrahend ".concat(w))}return m=(m=this.replacePrefix)===null||m===void 0?void 0:m[0],m&&typeof f=="string"&&f.startsWith(m)?this.replacePrefix[1]+f.substring(m.length):f},jc);function jc(f){Object.assign(this,f)}var Wd=(Qt.prototype._read=function(f,m){var w=this._ctx;return w.error?w.table._trans(null,un.bind(null,w.error)):w.table._trans("readonly",f).then(m)},Qt.prototype._write=function(f){var m=this._ctx;return m.error?m.table._trans(null,un.bind(null,m.error)):m.table._trans("readwrite",f,"locked")},Qt.prototype._addAlgorithm=function(f){var m=this._ctx;m.algorithm=Ea(m.algorithm,f)},Qt.prototype._iterate=function(f,m){return No(this._ctx,f,m,this._ctx.table.core)},Qt.prototype.clone=function(f){var m=Object.create(this.constructor.prototype),w=Object.create(this._ctx);return f&&l(w,f),m._ctx=w,m},Qt.prototype.raw=function(){return this._ctx.valueMapper=null,this},Qt.prototype.each=function(f){var m=this._ctx;return this._read(function(w){return No(m,f,w,m.table.core)})},Qt.prototype.count=function(f){var m=this;return this._read(function(w){var x=m._ctx,O=x.table.core;if(vi(x,!0))return O.count({trans:w,query:{index:zi(x,O.schema),range:x.range}}).then(function(K){return Math.min(K,x.limit)});var M=0;return No(x,function(){return++M,!1},w,O).then(function(){return M})}).then(f)},Qt.prototype.sortBy=function(f,m){var w=f.split(".").reverse(),x=w[0],O=w.length-1;function M(pe,ge){return ge?M(pe[w[ge]],ge-1):pe[x]}var K=this._ctx.dir==="next"?1:-1;function te(pe,ge){return Kt(M(pe,O),M(ge,O))*K}return this.toArray(function(pe){return pe.sort(te)}).then(m)},Qt.prototype.toArray=function(f){var m=this;return this._read(function(w){var x=m._ctx;if(x.dir==="next"&&vi(x,!0)&&0<x.limit){var O=x.valueMapper,M=zi(x,x.table.core.schema);return x.table.core.query({trans:w,limit:x.limit,values:!0,query:{index:M,range:x.range}}).then(function(te){return te=te.result,O?te.map(O):te})}var K=[];return No(x,function(te){return K.push(te)},w,x.table.core).then(function(){return K})},f)},Qt.prototype.offset=function(f){var m=this._ctx;return f<=0||(m.offset+=f,vi(m)?Us(m,function(){var w=f;return function(x,O){return w===0||(w===1?--w:O(function(){x.advance(w),w=0}),!1)}}):Us(m,function(){var w=f;return function(){return--w<0}})),this},Qt.prototype.limit=function(f){return this._ctx.limit=Math.min(this._ctx.limit,f),Us(this._ctx,function(){var m=f;return function(w,x,O){return--m<=0&&x(O),0<=m}},!0),this},Qt.prototype.until=function(f,m){return cl(this._ctx,function(w,x,O){return!f(w.value)||(x(O),m)}),this},Qt.prototype.first=function(f){return this.limit(1).toArray(function(m){return m[0]}).then(f)},Qt.prototype.last=function(f){return this.reverse().first(f)},Qt.prototype.filter=function(f){var m;return cl(this._ctx,function(w){return f(w.value)}),(m=this._ctx).isMatch=Ea(m.isMatch,f),this},Qt.prototype.and=function(f){return this.filter(f)},Qt.prototype.or=function(f){return new this.db.WhereClause(this._ctx.table,f,this)},Qt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Qt.prototype.desc=function(){return this.reverse()},Qt.prototype.eachKey=function(f){var m=this._ctx;return m.keysOnly=!m.isMatch,this.each(function(w,x){f(x.key,x)})},Qt.prototype.eachUniqueKey=function(f){return this._ctx.unique="unique",this.eachKey(f)},Qt.prototype.eachPrimaryKey=function(f){var m=this._ctx;return m.keysOnly=!m.isMatch,this.each(function(w,x){f(x.primaryKey,x)})},Qt.prototype.keys=function(f){var m=this._ctx;m.keysOnly=!m.isMatch;var w=[];return this.each(function(x,O){w.push(O.key)}).then(function(){return w}).then(f)},Qt.prototype.primaryKeys=function(f){var m=this._ctx;if(m.dir==="next"&&vi(m,!0)&&0<m.limit)return this._read(function(x){var O=zi(m,m.table.core.schema);return m.table.core.query({trans:x,values:!1,limit:m.limit,query:{index:O,range:m.range}})}).then(function(x){return x.result}).then(f);m.keysOnly=!m.isMatch;var w=[];return this.each(function(x,O){w.push(O.primaryKey)}).then(function(){return w}).then(f)},Qt.prototype.uniqueKeys=function(f){return this._ctx.unique="unique",this.keys(f)},Qt.prototype.firstKey=function(f){return this.limit(1).keys(function(m){return m[0]}).then(f)},Qt.prototype.lastKey=function(f){return this.reverse().firstKey(f)},Qt.prototype.distinct=function(){var f=this._ctx,f=f.index&&f.table.schema.idxByName[f.index];if(!f||!f.multi)return this;var m={};return cl(this._ctx,function(O){var x=O.primaryKey.toString(),O=d(m,x);return m[x]=!0,!O}),this},Qt.prototype.modify=function(f){var m=this,w=this._ctx;return this._write(function(x){var O,M,K;K=typeof f=="function"?f:(O=o(f),M=O.length,function(ve){for(var Oe=!1,Me=0;Me<M;++Me){var Ne=O[Me],Fe=f[Ne],nt=k(ve,Ne);Fe instanceof za?(E(ve,Ne,Fe.execute(nt)),Oe=!0):nt!==Fe&&(E(ve,Ne,Fe),Oe=!0)}return Oe});var te=w.table.core,Q=te.schema.primaryKey,pe=Q.outbound,ge=Q.extractKey,ue=200,Q=m.db._options.modifyChunkSize;Q&&(ue=typeof Q=="object"?Q[te.name]||Q["*"]||200:Q);function me(ve,Ne){var Me=Ne.failures,Ne=Ne.numFailures;ye+=ve-Ne;for(var Fe=0,nt=o(Me);Fe<nt.length;Fe++){var dt=nt[Fe];ce.push(Me[dt])}}var ce=[],ye=0,Se=[];return m.clone().primaryKeys().then(function(ve){function Oe(Ne){var Fe=Math.min(ue,ve.length-Ne);return te.getMany({trans:x,keys:ve.slice(Ne,Ne+Fe),cache:"immutable"}).then(function(nt){for(var dt=[],tt=[],ot=pe?[]:null,pt=[],it=0;it<Fe;++it){var bt=nt[it],Nt={value:P(bt),primKey:ve[Ne+it]};K.call(Nt,Nt.value,Nt)!==!1&&(Nt.value==null?pt.push(ve[Ne+it]):pe||Kt(ge(bt),ge(Nt.value))===0?(tt.push(Nt.value),pe&&ot.push(ve[Ne+it])):(pt.push(ve[Ne+it]),dt.push(Nt.value)))}return Promise.resolve(0<dt.length&&te.mutate({trans:x,type:"add",values:dt}).then(function(jt){for(var Wt in jt.failures)pt.splice(parseInt(Wt),1);me(dt.length,jt)})).then(function(){return(0<tt.length||Me&&typeof f=="object")&&te.mutate({trans:x,type:"put",keys:ot,values:tt,criteria:Me,changeSpec:typeof f!="function"&&f,isAdditionalChunk:0<Ne}).then(function(jt){return me(tt.length,jt)})}).then(function(){return(0<pt.length||Me&&f===Ao)&&te.mutate({trans:x,type:"delete",keys:pt,criteria:Me,isAdditionalChunk:0<Ne}).then(function(jt){return me(pt.length,jt)})}).then(function(){return ve.length>Ne+Fe&&Oe(Ne+ue)})})}var Me=vi(w)&&w.limit===1/0&&(typeof f!="function"||f===Ao)&&{index:w.index,range:w.range};return Oe(0).then(function(){if(0<ce.length)throw new oe("Error modifying one or more objects",ce,ye,Se);return ve.length})})})},Qt.prototype.delete=function(){var f=this._ctx,m=f.range;return vi(f)&&(f.isPrimKey||m.type===3)?this._write(function(w){var x=f.table.core.schema.primaryKey,O=m;return f.table.core.count({trans:w,query:{index:x,range:O}}).then(function(M){return f.table.core.mutate({trans:w,type:"deleteRange",range:O}).then(function(K){var te=K.failures;if(K.lastResult,K.results,K=K.numFailures,K)throw new oe("Could not delete some values",Object.keys(te).map(function(pe){return te[pe]}),M-K);return M-K})})}):this.modify(Ao)},Qt);function Qt(){}var Ao=function(f,m){return m.value=null};function gd(f,m){return f<m?-1:f===m?0:1}function Gf(f,m){return m<f?-1:f===m?0:1}function Zn(f,m,w){return f=f instanceof Iu?new f.Collection(f):f,f._ctx.error=new(w||TypeError)(m),f}function ti(f){return new f.Collection(f,function(){return zc("")}).limit(0)}function Lo(f,m,w,x){var O,M,K,te,pe,ge,ue,Q=w.length;if(!w.every(function(ye){return typeof ye=="string"}))return Zn(f,Tu);function me(ye){O=ye==="next"?function(ve){return ve.toUpperCase()}:function(ve){return ve.toLowerCase()},M=ye==="next"?function(ve){return ve.toLowerCase()}:function(ve){return ve.toUpperCase()},K=ye==="next"?gd:Gf;var Se=w.map(function(ve){return{lower:M(ve),upper:O(ve)}}).sort(function(ve,Oe){return K(ve.lower,Oe.lower)});te=Se.map(function(ve){return ve.upper}),pe=Se.map(function(ve){return ve.lower}),ue=(ge=ye)==="next"?"":x}me("next"),f=new f.Collection(f,function(){return fa(te[0],pe[Q-1]+x)}),f._ondirectionchange=function(ye){me(ye)};var ce=0;return f._addAlgorithm(function(ye,Se,ve){var Oe=ye.key;if(typeof Oe!="string")return!1;var Me=M(Oe);if(m(Me,pe,ce))return!0;for(var Ne=null,Fe=ce;Fe<Q;++Fe){var nt=function(dt,tt,ot,pt,it,bt){for(var Nt=Math.min(dt.length,pt.length),jt=-1,Wt=0;Wt<Nt;++Wt){var Xn=tt[Wt];if(Xn!==pt[Wt])return it(dt[Wt],ot[Wt])<0?dt.substr(0,Wt)+ot[Wt]+ot.substr(Wt+1):it(dt[Wt],pt[Wt])<0?dt.substr(0,Wt)+pt[Wt]+ot.substr(Wt+1):0<=jt?dt.substr(0,jt)+tt[jt]+ot.substr(jt+1):null;it(dt[Wt],Xn)<0&&(jt=Wt)}return Nt<pt.length&&bt==="next"?dt+ot.substr(dt.length):Nt<dt.length&&bt==="prev"?dt.substr(0,ot.length):jt<0?null:dt.substr(0,jt)+pt[jt]+ot.substr(jt+1)}(Oe,Me,te[Fe],pe[Fe],K,ge);nt===null&&Ne===null?ce=Fe+1:(Ne===null||0<K(Ne,nt))&&(Ne=nt)}return Se(Ne!==null?function(){ye.continue(Ne+ue)}:ve),!1}),f}function fa(f,m,w,x){return{type:2,lower:f,upper:m,lowerOpen:w,upperOpen:x}}function zc(f){return{type:1,lower:f,upper:f}}var Iu=(Object.defineProperty(Tn.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Tn.prototype.between=function(f,m,w,x){w=w!==!1,x=x===!0;try{return 0<this._cmp(f,m)||this._cmp(f,m)===0&&(w||x)&&(!w||!x)?ti(this):new this.Collection(this,function(){return fa(f,m,!w,!x)})}catch{return Zn(this,Ir)}},Tn.prototype.equals=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return zc(f)})},Tn.prototype.above=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return fa(f,void 0,!0)})},Tn.prototype.aboveOrEqual=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return fa(f,void 0,!1)})},Tn.prototype.below=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return fa(void 0,f,!1,!0)})},Tn.prototype.belowOrEqual=function(f){return f==null?Zn(this,Ir):new this.Collection(this,function(){return fa(void 0,f)})},Tn.prototype.startsWith=function(f){return typeof f!="string"?Zn(this,Tu):this.between(f,f+oa,!0,!0)},Tn.prototype.startsWithIgnoreCase=function(f){return f===""?this.startsWith(f):Lo(this,function(m,w){return m.indexOf(w[0])===0},[f],oa)},Tn.prototype.equalsIgnoreCase=function(f){return Lo(this,function(m,w){return m===w[0]},[f],"")},Tn.prototype.anyOfIgnoreCase=function(){var f=de.apply(ie,arguments);return f.length===0?ti(this):Lo(this,function(m,w){return w.indexOf(m)!==-1},f,"")},Tn.prototype.startsWithAnyOfIgnoreCase=function(){var f=de.apply(ie,arguments);return f.length===0?ti(this):Lo(this,function(m,w){return w.some(function(x){return m.indexOf(x)===0})},f,oa)},Tn.prototype.anyOf=function(){var f=this,m=de.apply(ie,arguments),w=this._cmp;try{m.sort(w)}catch{return Zn(this,Ir)}if(m.length===0)return ti(this);var x=new this.Collection(this,function(){return fa(m[0],m[m.length-1])});x._ondirectionchange=function(M){w=M==="next"?f._ascending:f._descending,m.sort(w)};var O=0;return x._addAlgorithm(function(M,K,te){for(var pe=M.key;0<w(pe,m[O]);)if(++O===m.length)return K(te),!1;return w(pe,m[O])===0||(K(function(){M.continue(m[O])}),!1)}),x},Tn.prototype.notEqual=function(f){return this.inAnyRange([[-1/0,f],[f,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Tn.prototype.noneOf=function(){var f=de.apply(ie,arguments);if(f.length===0)return new this.Collection(this);try{f.sort(this._ascending)}catch{return Zn(this,Ir)}var m=f.reduce(function(w,x){return w?w.concat([[w[w.length-1][1],x]]):[[-1/0,x]]},null);return m.push([f[f.length-1],this.db._maxKey]),this.inAnyRange(m,{includeLowers:!1,includeUppers:!1})},Tn.prototype.inAnyRange=function(Oe,m){var w=this,x=this._cmp,O=this._ascending,M=this._descending,K=this._min,te=this._max;if(Oe.length===0)return ti(this);if(!Oe.every(function(Me){return Me[0]!==void 0&&Me[1]!==void 0&&O(Me[0],Me[1])<=0}))return Zn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Y.InvalidArgument);var pe=!m||m.includeLowers!==!1,ge=m&&m.includeUppers===!0,ue,Q=O;function me(Me,Ne){return Q(Me[0],Ne[0])}try{(ue=Oe.reduce(function(Me,Ne){for(var Fe=0,nt=Me.length;Fe<nt;++Fe){var dt=Me[Fe];if(x(Ne[0],dt[1])<0&&0<x(Ne[1],dt[0])){dt[0]=K(dt[0],Ne[0]),dt[1]=te(dt[1],Ne[1]);break}}return Fe===nt&&Me.push(Ne),Me},[])).sort(me)}catch{return Zn(this,Ir)}var ce=0,ye=ge?function(Me){return 0<O(Me,ue[ce][1])}:function(Me){return 0<=O(Me,ue[ce][1])},Se=pe?function(Me){return 0<M(Me,ue[ce][0])}:function(Me){return 0<=M(Me,ue[ce][0])},ve=ye,Oe=new this.Collection(this,function(){return fa(ue[0][0],ue[ue.length-1][1],!pe,!ge)});return Oe._ondirectionchange=function(Me){Q=Me==="next"?(ve=ye,O):(ve=Se,M),ue.sort(me)},Oe._addAlgorithm(function(Me,Ne,Fe){for(var nt,dt=Me.key;ve(dt);)if(++ce===ue.length)return Ne(Fe),!1;return!ye(nt=dt)&&!Se(nt)||(w._cmp(dt,ue[ce][1])===0||w._cmp(dt,ue[ce][0])===0||Ne(function(){Q===O?Me.continue(ue[ce][0]):Me.continue(ue[ce][1])}),!1)}),Oe},Tn.prototype.startsWithAnyOf=function(){var f=de.apply(ie,arguments);return f.every(function(m){return typeof m=="string"})?f.length===0?ti(this):this.inAnyRange(f.map(function(m){return[m,m+oa]})):Zn(this,"startsWithAnyOf() only works with strings")},Tn);function Tn(){}function Vr(f){return Vt(function(m){return Wi(m),f(m.target.error),!1})}function Wi(f){f.stopPropagation&&f.stopPropagation(),f.preventDefault&&f.preventDefault()}var ro="storagemutated",dl="x-storagemutated-1",pa=wi(null,ro),qf=(Rr.prototype._lock=function(){return y(!we.global),++this._reculock,this._reculock!==1||we.global||(we.lockOwnerFor=this),this},Rr.prototype._unlock=function(){if(y(!we.global),--this._reculock==0)for(we.global||(we.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var f=this._blockedFuncs.shift();try{or(f[1],f[0])}catch{}}return this},Rr.prototype._locked=function(){return this._reculock&&we.lockOwnerFor!==this},Rr.prototype.create=function(f){var m=this;if(!this.mode)return this;var w=this.db.idbdb,x=this.db._state.dbOpenError;if(y(!this.idbtrans),!f&&!w)switch(x&&x.name){case"DatabaseClosedError":throw new Y.DatabaseClosed(x);case"MissingAPIError":throw new Y.MissingAPI(x.message,x);default:throw new Y.OpenFailed(x)}if(!this.active)throw new Y.TransactionInactive;return y(this._completion._state===null),(f=this.idbtrans=f||(this.db.core||w).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Vt(function(O){Wi(O),m._reject(f.error)}),f.onabort=Vt(function(O){Wi(O),m.active&&m._reject(new Y.Abort(f.error)),m.active=!1,m.on("abort").fire(O)}),f.oncomplete=Vt(function(){m.active=!1,m._resolve(),"mutatedParts"in f&&pa.storagemutated.fire(f.mutatedParts)}),this},Rr.prototype._promise=function(f,m,w){var x=this;if(f==="readwrite"&&this.mode!=="readwrite")return un(new Y.ReadOnly("Transaction is readonly"));if(!this.active)return un(new Y.TransactionInactive);if(this._locked())return new $e(function(M,K){x._blockedFuncs.push([function(){x._promise(f,m,w).then(M,K)},we])});if(w)return Lr(function(){var M=new $e(function(K,te){x._lock();var pe=m(K,te,x);pe&&pe.then&&pe.then(K,te)});return M.finally(function(){return x._unlock()}),M._lib=!0,M});var O=new $e(function(M,K){var te=m(M,K,x);te&&te.then&&te.then(M,K)});return O._lib=!0,O},Rr.prototype._root=function(){return this.parent?this.parent._root():this},Rr.prototype.waitFor=function(f){var m,w=this._root(),x=$e.resolve(f);w._waitingFor?w._waitingFor=w._waitingFor.then(function(){return x}):(w._waitingFor=x,w._waitingQueue=[],m=w.idbtrans.objectStore(w.storeNames[0]),function M(){for(++w._spinCount;w._waitingQueue.length;)w._waitingQueue.shift()();w._waitingFor&&(m.get(-1/0).onsuccess=M)}());var O=w._waitingFor;return new $e(function(M,K){x.then(function(te){return w._waitingQueue.push(Vt(M.bind(null,te)))},function(te){return w._waitingQueue.push(Vt(K.bind(null,te)))}).finally(function(){w._waitingFor===O&&(w._waitingFor=null)})})},Rr.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Y.Abort))},Rr.prototype.table=function(f){var m=this._memoizedTables||(this._memoizedTables={});if(d(m,f))return m[f];var w=this.schema[f];if(!w)throw new Y.NotFound("Table "+f+" not part of transaction");return w=new this.db.Table(f,w,this),w.core=this.db.core.table(f),m[f]=w},Rr);function Rr(){}function fl(f,m,w,x,O,M,K){return{name:f,keyPath:m,unique:w,multi:x,auto:O,compound:M,src:(w&&!K?"&":"")+(x?"*":"")+(O?"++":"")+vd(m)}}function vd(f){return typeof f=="string"?f:f?"["+[].join.call(f,"+")+"]":""}function Sl(f,m,w){return{name:f,primKey:m,indexes:w,mappedClass:null,idxByName:(x=function(O){return[O.name,O]},w.reduce(function(O,M,K){return K=x(M,K),K&&(O[K[0]]=K[1]),O},{}))};var x}var Ji=function(f){try{return f.only([[]]),Ji=function(){return[[]]},[[]]}catch{return Ji=function(){return oa},oa}};function hl(f){return f==null?function(){}:typeof f=="string"?(m=f).split(".").length===1?function(w){return w[m]}:function(w){return k(w,m)}:function(w){return k(w,f)};var m}function yi(f){return[].slice.call(f)}var Gi=0;function ao(f){return f==null?":id":typeof f=="string"?f:"[".concat(f.join("+"),"]")}function km(f,m,pe){function x(ve){if(ve.type===3)return null;if(ve.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var ce=ve.lower,ye=ve.upper,Se=ve.lowerOpen,ve=ve.upperOpen;return ce===void 0?ye===void 0?null:m.upperBound(ye,!!ve):ye===void 0?m.lowerBound(ce,!!Se):m.bound(ce,ye,!!Se,!!ve)}function O(me){var ce,ye=me.name;return{name:ye,schema:me,mutate:function(Se){var ve=Se.trans,Oe=Se.type,Me=Se.keys,Ne=Se.values,Fe=Se.range;return new Promise(function(nt,dt){nt=Vt(nt);var tt=ve.objectStore(ye),ot=tt.keyPath==null,pt=Oe==="put"||Oe==="add";if(!pt&&Oe!=="delete"&&Oe!=="deleteRange")throw new Error("Invalid operation type: "+Oe);var it,bt=(Me||Ne||{length:1}).length;if(Me&&Ne&&Me.length!==Ne.length)throw new Error("Given keys array must have same length as given values array.");if(bt===0)return nt({numFailures:0,failures:{},results:[],lastResult:void 0});function Nt(zn){++Xn,Wi(zn)}var jt=[],Wt=[],Xn=0;if(Oe==="deleteRange"){if(Fe.type===4)return nt({numFailures:Xn,failures:Wt,results:[],lastResult:void 0});Fe.type===3?jt.push(it=tt.clear()):jt.push(it=tt.delete(x(Fe)))}else{var ot=pt?ot?[Ne,Me]:[Ne,null]:[Me,null],Pt=ot[0],Pn=ot[1];if(pt)for(var Rn=0;Rn<bt;++Rn)jt.push(it=Pn&&Pn[Rn]!==void 0?tt[Oe](Pt[Rn],Pn[Rn]):tt[Oe](Pt[Rn])),it.onerror=Nt;else for(Rn=0;Rn<bt;++Rn)jt.push(it=tt[Oe](Pt[Rn])),it.onerror=Nt}function Co(zn){zn=zn.target.result,jt.forEach(function(Sa,vl){return Sa.error!=null&&(Wt[vl]=Sa.error)}),nt({numFailures:Xn,failures:Wt,results:Oe==="delete"?Me:jt.map(function(Sa){return Sa.result}),lastResult:zn})}it.onerror=function(zn){Nt(zn),Co(zn)},it.onsuccess=Co})},getMany:function(Se){var ve=Se.trans,Oe=Se.keys;return new Promise(function(Me,Ne){Me=Vt(Me);for(var Fe,nt=ve.objectStore(ye),dt=Oe.length,tt=new Array(dt),ot=0,pt=0,it=function(jt){jt=jt.target,tt[jt._pos]=jt.result,++pt===ot&&Me(tt)},bt=Vr(Ne),Nt=0;Nt<dt;++Nt)Oe[Nt]!=null&&((Fe=nt.get(Oe[Nt]))._pos=Nt,Fe.onsuccess=it,Fe.onerror=bt,++ot);ot===0&&Me(tt)})},get:function(Se){var ve=Se.trans,Oe=Se.key;return new Promise(function(Me,Ne){Me=Vt(Me);var Fe=ve.objectStore(ye).get(Oe);Fe.onsuccess=function(nt){return Me(nt.target.result)},Fe.onerror=Vr(Ne)})},query:(ce=ge,function(Se){return new Promise(function(ve,Oe){ve=Vt(ve);var Me,Ne,Fe,ot=Se.trans,nt=Se.values,dt=Se.limit,it=Se.query,tt=dt===1/0?void 0:dt,pt=it.index,it=it.range,ot=ot.objectStore(ye),pt=pt.isPrimaryKey?ot:ot.index(pt.name),it=x(it);if(dt===0)return ve({result:[]});ce?((tt=nt?pt.getAll(it,tt):pt.getAllKeys(it,tt)).onsuccess=function(bt){return ve({result:bt.target.result})},tt.onerror=Vr(Oe)):(Me=0,Ne=!nt&&"openKeyCursor"in pt?pt.openKeyCursor(it):pt.openCursor(it),Fe=[],Ne.onsuccess=function(bt){var Nt=Ne.result;return Nt?(Fe.push(nt?Nt.value:Nt.primaryKey),++Me===dt?ve({result:Fe}):void Nt.continue()):ve({result:Fe})},Ne.onerror=Vr(Oe))})}),openCursor:function(Se){var ve=Se.trans,Oe=Se.values,Me=Se.query,Ne=Se.reverse,Fe=Se.unique;return new Promise(function(nt,dt){nt=Vt(nt);var pt=Me.index,tt=Me.range,ot=ve.objectStore(ye),ot=pt.isPrimaryKey?ot:ot.index(pt.name),pt=Ne?Fe?"prevunique":"prev":Fe?"nextunique":"next",it=!Oe&&"openKeyCursor"in ot?ot.openKeyCursor(x(tt),pt):ot.openCursor(x(tt),pt);it.onerror=Vr(dt),it.onsuccess=Vt(function(bt){var Nt,jt,Wt,Xn,Pt=it.result;Pt?(Pt.___id=++Gi,Pt.done=!1,Nt=Pt.continue.bind(Pt),jt=(jt=Pt.continuePrimaryKey)&&jt.bind(Pt),Wt=Pt.advance.bind(Pt),Xn=function(){throw new Error("Cursor not stopped")},Pt.trans=ve,Pt.stop=Pt.continue=Pt.continuePrimaryKey=Pt.advance=function(){throw new Error("Cursor not started")},Pt.fail=Vt(dt),Pt.next=function(){var Pn=this,Rn=1;return this.start(function(){return Rn--?Pn.continue():Pn.stop()}).then(function(){return Pn})},Pt.start=function(Pn){function Rn(){if(it.result)try{Pn()}catch(zn){Pt.fail(zn)}else Pt.done=!0,Pt.start=function(){throw new Error("Cursor behind last entry")},Pt.stop()}var Co=new Promise(function(zn,Sa){zn=Vt(zn),it.onerror=Vr(Sa),Pt.fail=Sa,Pt.stop=function(vl){Pt.stop=Pt.continue=Pt.continuePrimaryKey=Pt.advance=Xn,zn(vl)}});return it.onsuccess=Vt(function(zn){it.onsuccess=Rn,Rn()}),Pt.continue=Nt,Pt.continuePrimaryKey=jt,Pt.advance=Wt,Rn(),Co},nt(Pt)):nt(null)},dt)})},count:function(Se){var ve=Se.query,Oe=Se.trans,Me=ve.index,Ne=ve.range;return new Promise(function(Fe,nt){var dt=Oe.objectStore(ye),tt=Me.isPrimaryKey?dt:dt.index(Me.name),dt=x(Ne),tt=dt?tt.count(dt):tt.count();tt.onsuccess=Vt(function(ot){return Fe(ot.target.result)}),tt.onerror=Vr(nt)})}}}var M,K,te,ue=(K=pe,te=yi((M=f).objectStoreNames),{schema:{name:M.name,tables:te.map(function(me){return K.objectStore(me)}).map(function(me){var ce=me.keyPath,ve=me.autoIncrement,ye=s(ce),Se={},ve={name:me.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ce==null,compound:ye,keyPath:ce,autoIncrement:ve,unique:!0,extractKey:hl(ce)},indexes:yi(me.indexNames).map(function(Oe){return me.index(Oe)}).map(function(Fe){var Me=Fe.name,Ne=Fe.unique,nt=Fe.multiEntry,Fe=Fe.keyPath,nt={name:Me,compound:s(Fe),keyPath:Fe,unique:Ne,multiEntry:nt,extractKey:hl(Fe)};return Se[ao(Fe)]=nt}),getIndexByKeyPath:function(Oe){return Se[ao(Oe)]}};return Se[":id"]=ve.primaryKey,ce!=null&&(Se[ao(ce)]=ve.primaryKey),ve})},hasGetAll:0<te.length&&"getAll"in K.objectStore(te[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),pe=ue.schema,ge=ue.hasGetAll,ue=pe.tables.map(O),Q={};return ue.forEach(function(me){return Q[me.name]=me}),{stack:"dbcore",transaction:f.transaction.bind(f),table:function(me){if(!Q[me])throw new Error("Table '".concat(me,"' not found"));return Q[me]},MIN_KEY:-1/0,MAX_KEY:Ji(m),schema:pe}}function Em(f,m,w,x){var O=w.IDBKeyRange;return w.indexedDB,{dbcore:(x=km(m,O,x),f.dbcore.reduce(function(M,K){return K=K.create,r(r({},M),K(M))},x))}}function Qo(f,x){var w=x.db,x=Em(f._middlewares,w,f._deps,x);f.core=x.dbcore,f.tables.forEach(function(O){var M=O.name;f.core.schema.tables.some(function(K){return K.name===M})&&(O.core=f.core.table(M),f[M]instanceof f.Table&&(f[M].core=O.core))})}function es(f,m,w,x){w.forEach(function(O){var M=x[O];m.forEach(function(K){var te=function pe(ge,ue){return b(ge,ue)||(ge=u(ge))&&pe(ge,ue)}(K,O);(!te||"value"in te&&te.value===void 0)&&(K===f.Transaction.prototype||K instanceof f.Transaction?g(K,O,{get:function(){return this.table(O)},set:function(pe){h(this,O,{value:pe,writable:!0,configurable:!0,enumerable:!0})}}):K[O]=new f.Table(O,M))})})}function kl(f,m){m.forEach(function(w){for(var x in w)w[x]instanceof f.Table&&delete w[x]})}function Kf(f,m){return f._cfg.version-m._cfg.version}function xm(f,m,w,x){var O=f._dbSchema;w.objectStoreNames.contains("$meta")&&!O.$meta&&(O.$meta=Sl("$meta",cu("")[0],[]),f._storeNames.push("$meta"));var M=f._createTransaction("readwrite",f._storeNames,O);M.create(w),M._completion.catch(x);var K=M._reject.bind(M),te=we.transless||we;Lr(function(){return we.trans=M,we.transless=te,m!==0?(Qo(f,w),ge=m,((pe=M).storeNames.includes("$meta")?pe.table("$meta").get("version").then(function(ue){return ue??ge}):$e.resolve(ge)).then(function(ue){return me=ue,ce=M,ye=w,Se=[],ue=(Q=f)._versions,ve=Q._dbSchema=_i(0,Q.idbdb,ye),(ue=ue.filter(function(Oe){return Oe._cfg.version>=me})).length!==0?(ue.forEach(function(Oe){Se.push(function(){var Me=ve,Ne=Oe._cfg.dbschema;Fo(Q,Me,ye),Fo(Q,Ne,ye),ve=Q._dbSchema=Ne;var Fe=fs(Me,Ne);Fe.add.forEach(function(pt){ts(ye,pt[0],pt[1].primKey,pt[1].indexes)}),Fe.change.forEach(function(pt){if(pt.recreate)throw new Y.Upgrade("Not yet support for changing primary key");var it=ye.objectStore(pt.name);pt.add.forEach(function(bt){return Oo(it,bt)}),pt.change.forEach(function(bt){it.deleteIndex(bt.name),Oo(it,bt)}),pt.del.forEach(function(bt){return it.deleteIndex(bt)})});var nt=Oe._cfg.contentUpgrade;if(nt&&Oe._cfg.version>me){Qo(Q,ye),ce._memoizedTables={};var dt=I(Ne);Fe.del.forEach(function(pt){dt[pt]=Me[pt]}),kl(Q,[Q.Transaction.prototype]),es(Q,[Q.Transaction.prototype],o(dt),dt),ce.schema=dt;var tt,ot=ee(nt);return ot&&Yn(),Fe=$e.follow(function(){var pt;(tt=nt(ce))&&ot&&(pt=ar.bind(null,null),tt.then(pt,pt))}),tt&&typeof tt.then=="function"?$e.resolve(tt):Fe.then(function(){return tt})}}),Se.push(function(Me){var Ne,Fe,nt=Oe._cfg.dbschema;Ne=nt,Fe=Me,[].slice.call(Fe.db.objectStoreNames).forEach(function(dt){return Ne[dt]==null&&Fe.db.deleteObjectStore(dt)}),kl(Q,[Q.Transaction.prototype]),es(Q,[Q.Transaction.prototype],Q._storeNames,Q._dbSchema),ce.schema=Q._dbSchema}),Se.push(function(Me){Q.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(Q.idbdb.version/10)===Oe._cfg.version?(Q.idbdb.deleteObjectStore("$meta"),delete Q._dbSchema.$meta,Q._storeNames=Q._storeNames.filter(function(Ne){return Ne!=="$meta"})):Me.objectStore("$meta").put(Oe._cfg.version,"version"))})}),function Oe(){return Se.length?$e.resolve(Se.shift()(ce.idbtrans)).then(Oe):$e.resolve()}().then(function(){Wc(ve,ye)})):$e.resolve();var Q,me,ce,ye,Se,ve}).catch(K)):(o(O).forEach(function(ue){ts(w,ue,O[ue].primKey,O[ue].indexes)}),Qo(f,w),void $e.follow(function(){return f.on.populate.fire(M)}).catch(K));var pe,ge})}function ds(f,m){Wc(f._dbSchema,m),m.db.version%10!=0||m.objectStoreNames.contains("$meta")||m.db.createObjectStore("$meta").add(Math.ceil(m.db.version/10-1),"version");var w=_i(0,f.idbdb,m);Fo(f,f._dbSchema,m);for(var x=0,O=fs(w,f._dbSchema).change;x<O.length;x++){var M=function(K){if(K.change.length||K.recreate)return console.warn("Unable to patch indexes of table ".concat(K.name," because it has changes on the type of index or primary key.")),{value:void 0};var te=m.objectStore(K.name);K.add.forEach(function(pe){se&&console.debug("Dexie upgrade patch: Creating missing index ".concat(K.name,".").concat(pe.src)),Oo(te,pe)})}(O[x]);if(typeof M=="object")return M.value}}function fs(f,m){var w,x={del:[],add:[],change:[]};for(w in f)m[w]||x.del.push(w);for(w in m){var O=f[w],M=m[w];if(O){var K={name:w,def:M,recreate:!1,del:[],add:[],change:[]};if(""+(O.primKey.keyPath||"")!=""+(M.primKey.keyPath||"")||O.primKey.auto!==M.primKey.auto)K.recreate=!0,x.change.push(K);else{var te=O.idxByName,pe=M.idxByName,ge=void 0;for(ge in te)pe[ge]||K.del.push(ge);for(ge in pe){var ue=te[ge],Q=pe[ge];ue?ue.src!==Q.src&&K.change.push(Q):K.add.push(Q)}(0<K.del.length||0<K.add.length||0<K.change.length)&&x.change.push(K)}}else x.add.push([w,M])}return x}function ts(f,m,w,x){var O=f.db.createObjectStore(m,w.keyPath?{keyPath:w.keyPath,autoIncrement:w.auto}:{autoIncrement:w.auto});return x.forEach(function(M){return Oo(O,M)}),O}function Wc(f,m){o(f).forEach(function(w){m.db.objectStoreNames.contains(w)||(se&&console.debug("Dexie: Creating missing table",w),ts(m,w,f[w].primKey,f[w].indexes))})}function Oo(f,m){f.createIndex(m.name,m.keyPath,{unique:m.unique,multiEntry:m.multi})}function _i(f,m,w){var x={};return C(m.objectStoreNames,0).forEach(function(O){for(var M=w.objectStore(O),K=fl(vd(ge=M.keyPath),ge||"",!0,!1,!!M.autoIncrement,ge&&typeof ge!="string",!0),te=[],pe=0;pe<M.indexNames.length;++pe){var ue=M.index(M.indexNames[pe]),ge=ue.keyPath,ue=fl(ue.name,ge,!!ue.unique,!!ue.multiEntry,!1,ge&&typeof ge!="string",!1);te.push(ue)}x[O]=Sl(O,K,te)}),x}function Fo(f,m,w){for(var x=w.db.objectStoreNames,O=0;O<x.length;++O){var M=x[O],K=w.objectStore(M);f._hasGetAll="getAll"in K;for(var te=0;te<K.indexNames.length;++te){var pe=K.indexNames[te],ge=K.index(pe).keyPath,ue=typeof ge=="string"?ge:"["+C(ge).join("+")+"]";!m[M]||(ge=m[M].idxByName[ue])&&(ge.name=pe,delete m[M].idxByName[ue],m[M].idxByName[pe]=ge)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(f._hasGetAll=!1)}function cu(f){return f.split(",").map(function(m,w){var x=(m=m.trim()).replace(/([&*]|\+\+)/g,""),O=/^\[/.test(x)?x.match(/^\[(.*)\]$/)[1].split("+"):x;return fl(x,O||null,/\&/.test(m),/\*/.test(m),/\+\+/.test(m),s(O),w===0)})}var Gd=(lo.prototype._parseStoresSpec=function(f,m){o(f).forEach(function(w){if(f[w]!==null){var x=cu(f[w]),O=x.shift();if(O.unique=!0,O.multi)throw new Y.Schema("Primary key cannot be multi-valued");x.forEach(function(M){if(M.auto)throw new Y.Schema("Only primary key can be marked as autoIncrement (++)");if(!M.keyPath)throw new Y.Schema("Index must have a name and cannot be an empty string")}),m[w]=Sl(w,O,x)}})},lo.prototype.stores=function(w){var m=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,w):w;var w=m._versions,x={},O={};return w.forEach(function(M){l(x,M._cfg.storesSource),O=M._cfg.dbschema={},M._parseStoresSpec(x,O)}),m._dbSchema=O,kl(m,[m._allTables,m,m.Transaction.prototype]),es(m,[m._allTables,m,m.Transaction.prototype,this._cfg.tables],o(O),O),m._storeNames=o(O),this},lo.prototype.upgrade=function(f){return this._cfg.contentUpgrade=ne(this._cfg.contentUpgrade||Pe,f),this},lo);function lo(){}function $s(f,m){var w=f._dbNamesDB;return w||(w=f._dbNamesDB=new ea(ho,{addons:[],indexedDB:f,IDBKeyRange:m})).version(1).stores({dbnames:"name"}),w.table("dbnames")}function uo(f){return f&&typeof f.databases=="function"}function fi(f){return Lr(function(){return we.letThrough=!0,f()})}function Hs(f){return!("from"in f)}var Dn=function(f,m){if(!this){var w=new Dn;return f&&"d"in f&&l(w,f),w}l(this,arguments.length?{d:1,from:f,to:1<arguments.length?m:f}:{d:0})};function io(f,m,w){var x=Kt(m,w);if(!isNaN(x)){if(0<x)throw RangeError();if(Hs(f))return l(f,{from:m,to:w,d:1});var O=f.l,x=f.r;if(Kt(w,f.from)<0)return O?io(O,m,w):f.l={from:m,to:w,d:1,l:null,r:null},Ru(f);if(0<Kt(m,f.to))return x?io(x,m,w):f.r={from:m,to:w,d:1,l:null,r:null},Ru(f);Kt(m,f.from)<0&&(f.from=m,f.l=null,f.d=x?x.d+1:1),0<Kt(w,f.to)&&(f.to=w,f.r=null,f.d=f.l?f.l.d+1:1),w=!f.r,O&&!f.l&&Zi(f,O),x&&w&&Zi(f,x)}}function Zi(f,m){Hs(m)||function w(x,pe){var M=pe.from,K=pe.to,te=pe.l,pe=pe.r;io(x,M,K),te&&w(x,te),pe&&w(x,pe)}(f,m)}function pl(f,m){var w=_o(m),x=w.next();if(x.done)return!1;for(var O=x.value,M=_o(f),K=M.next(O.from),te=K.value;!x.done&&!K.done;){if(Kt(te.from,O.to)<=0&&0<=Kt(te.to,O.from))return!0;Kt(O.from,te.from)<0?O=(x=w.next(te.from)).value:te=(K=M.next(O.from)).value}return!1}function _o(f){var m=Hs(f)?null:{s:0,n:f};return{next:function(w){for(var x=0<arguments.length;m;)switch(m.s){case 0:if(m.s=1,x)for(;m.n.l&&Kt(w,m.n.from)<0;)m={up:m,n:m.n.l,s:1};else for(;m.n.l;)m={up:m,n:m.n.l,s:1};case 1:if(m.s=2,!x||Kt(w,m.n.to)<=0)return{value:m.n,done:!1};case 2:if(m.n.r){m.s=3,m={up:m,n:m.n.r,s:0};continue}case 3:m=m.up}return{done:!0}}}}function Ru(f){var m,w,x=(((m=f.r)===null||m===void 0?void 0:m.d)||0)-(((w=f.l)===null||w===void 0?void 0:w.d)||0),O=1<x?"r":x<-1?"l":"";O&&(m=O=="r"?"l":"r",w=r({},f),x=f[O],f.from=x.from,f.to=x.to,f[O]=x[O],w[O]=x[m],(f[m]=w).d=bi(w)),f.d=bi(f)}function bi(w){var m=w.r,w=w.l;return(m?w?Math.max(m.d,w.d):m.d:w?w.d:0)+1}function ki(f,m){return o(m).forEach(function(w){f[w]?Zi(f[w],m[w]):f[w]=function x(O){var M,K,te={};for(M in O)d(O,M)&&(K=O[M],te[M]=!K||typeof K!="object"||R.has(K.constructor)?K:x(K));return te}(m[w])}),f}function ns(f,m){return f.all||m.all||Object.keys(f).some(function(w){return m[w]&&pl(m[w],f[w])})}p(Dn.prototype,((er={add:function(f){return Zi(this,f),this},addKey:function(f){return io(this,f,f),this},addKeys:function(f){var m=this;return f.forEach(function(w){return io(m,w,w)}),this},hasKey:function(f){var m=_o(this).next(f).value;return m&&Kt(m.from,f)<=0&&0<=Kt(m.to,f)}})[N]=function(){return _o(this)},er));var Ca={},Io={},El=!1;function Bo(f){ki(Io,f),El||(El=!0,setTimeout(function(){El=!1,ml(Io,!(Io={}))},0))}function ml(f,m){m===void 0&&(m=!1);var w=new Set;if(f.all)for(var x=0,O=Object.values(Ca);x<O.length;x++)tc(K=O[x],f,w,m);else for(var M in f){var K,te=/^idb\:\/\/(.*)\/(.*)\//.exec(M);te&&(M=te[1],te=te[2],(K=Ca["idb://".concat(M,"/").concat(te)])&&tc(K,f,w,m))}w.forEach(function(pe){return pe()})}function tc(f,m,w,x){for(var O=[],M=0,K=Object.entries(f.queries.query);M<K.length;M++){for(var te=K[M],pe=te[0],ge=[],ue=0,Q=te[1];ue<Q.length;ue++){var me=Q[ue];ns(m,me.obsSet)?me.subscribers.forEach(function(ve){return w.add(ve)}):x&&ge.push(me)}x&&O.push([pe,ge])}if(x)for(var ce=0,ye=O;ce<ye.length;ce++){var Se=ye[ce],pe=Se[0],ge=Se[1];f.queries.query[pe]=ge}}function Yf(f){var m=f._state,w=f._deps.indexedDB;if(m.isBeingOpened||f.idbdb)return m.dbReadyPromise.then(function(){return m.dbOpenError?un(m.dbOpenError):f});m.isBeingOpened=!0,m.dbOpenError=null,m.openComplete=!1;var x=m.openCanceller,O=Math.round(10*f.verno),M=!1;function K(){if(m.openCanceller!==x)throw new Y.DatabaseClosed("db.open() was cancelled")}function te(){return new $e(function(me,ce){if(K(),!w)throw new Y.MissingAPI;var ye=f.name,Se=m.autoSchema||!O?w.open(ye):w.open(ye,O);if(!Se)throw new Y.MissingAPI;Se.onerror=Vr(ce),Se.onblocked=Vt(f._fireOnBlocked),Se.onupgradeneeded=Vt(function(ve){var Oe;ue=Se.transaction,m.autoSchema&&!f._options.allowEmptyDB?(Se.onerror=Wi,ue.abort(),Se.result.close(),(Oe=w.deleteDatabase(ye)).onsuccess=Oe.onerror=Vt(function(){ce(new Y.NoSuchDatabase("Database ".concat(ye," doesnt exist")))})):(ue.onerror=Vr(ce),ve=ve.oldVersion>Math.pow(2,62)?0:ve.oldVersion,Q=ve<1,f.idbdb=Se.result,M&&ds(f,ue),xm(f,ve/10,ue,ce))},ce),Se.onsuccess=Vt(function(){ue=null;var ve,Oe,Me,Ne,Fe,nt=f.idbdb=Se.result,dt=C(nt.objectStoreNames);if(0<dt.length)try{var tt=nt.transaction((Ne=dt).length===1?Ne[0]:Ne,"readonly");if(m.autoSchema)Oe=nt,Me=tt,(ve=f).verno=Oe.version/10,Me=ve._dbSchema=_i(0,Oe,Me),ve._storeNames=C(Oe.objectStoreNames,0),es(ve,[ve._allTables],o(Me),Me);else if(Fo(f,f._dbSchema,tt),((Fe=fs(_i(0,(Fe=f).idbdb,tt),Fe._dbSchema)).add.length||Fe.change.some(function(ot){return ot.add.length||ot.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."),nt.close(),O=nt.version+1,M=!0,me(te());Qo(f,tt)}catch{}wa.push(f),nt.onversionchange=Vt(function(ot){m.vcFired=!0,f.on("versionchange").fire(ot)}),nt.onclose=Vt(function(ot){f.on("close").fire(ot)}),Q&&(Fe=f._deps,tt=ye,nt=Fe.indexedDB,Fe=Fe.IDBKeyRange,uo(nt)||tt===ho||$s(nt,Fe).put({name:tt}).catch(Pe)),me()},ce)}).catch(function(me){switch(me==null?void 0:me.name){case"UnknownError":if(0<m.PR1398_maxLoop)return m.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),te();break;case"VersionError":if(0<O)return O=0,te()}return $e.reject(me)})}var pe,ge=m.dbReadyResolve,ue=null,Q=!1;return $e.race([x,(typeof navigator>"u"?$e.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(me){function ce(){return indexedDB.databases().finally(me)}pe=setInterval(ce,100),ce()}).finally(function(){return clearInterval(pe)}):Promise.resolve()).then(te)]).then(function(){return K(),m.onReadyBeingFired=[],$e.resolve(fi(function(){return f.on.ready.fire(f.vip)})).then(function me(){if(0<m.onReadyBeingFired.length){var ce=m.onReadyBeingFired.reduce(ne,Pe);return m.onReadyBeingFired=[],$e.resolve(fi(function(){return ce(f.vip)})).then(me)}})}).finally(function(){m.openCanceller===x&&(m.onReadyBeingFired=null,m.isBeingOpened=!1)}).catch(function(me){m.dbOpenError=me;try{ue&&ue.abort()}catch{}return x===m.openCanceller&&f._close(),un(me)}).finally(function(){m.openComplete=!0,ge()}).then(function(){var me;return Q&&(me={},f.tables.forEach(function(ce){ce.schema.indexes.forEach(function(ye){ye.name&&(me["idb://".concat(f.name,"/").concat(ce.name,"/").concat(ye.name)]=new Dn(-1/0,[[[]]]))}),me["idb://".concat(f.name,"/").concat(ce.name,"/")]=me["idb://".concat(f.name,"/").concat(ce.name,"/:dels")]=new Dn(-1/0,[[[]]])}),pa(ro).fire(me),ml(me,!0)),f})}function hs(f){function m(M){return f.next(M)}var w=O(m),x=O(function(M){return f.throw(M)});function O(M){return function(pe){var te=M(pe),pe=te.value;return te.done?pe:pe&&typeof pe.then=="function"?pe.then(w,x):s(pe)?Promise.all(pe).then(w,x):w(pe)}}return O(m)()}function rs(f,m,w){for(var x=s(f)?f.slice():[f],O=0;O<w;++O)x.push(m);return x}var bf={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(f){return r(r({},f),{table:function(m){var w=f.table(m),x=w.schema,O={},M=[];function K(Q,me,ce){var ye=ao(Q),Se=O[ye]=O[ye]||[],ve=Q==null?0:typeof Q=="string"?1:Q.length,Oe=0<me,Oe=r(r({},ce),{name:Oe?"".concat(ye,"(virtual-from:").concat(ce.name,")"):ce.name,lowLevelIndex:ce,isVirtual:Oe,keyTail:me,keyLength:ve,extractKey:hl(Q),unique:!Oe&&ce.unique});return Se.push(Oe),Oe.isPrimaryKey||M.push(Oe),1<ve&&K(ve===2?Q[0]:Q.slice(0,ve-1),me+1,ce),Se.sort(function(Me,Ne){return Me.keyTail-Ne.keyTail}),Oe}m=K(x.primaryKey.keyPath,0,x.primaryKey),O[":id"]=[m];for(var te=0,pe=x.indexes;te<pe.length;te++){var ge=pe[te];K(ge.keyPath,0,ge)}function ue(Q){var me,ce=Q.query.index;return ce.isVirtual?r(r({},Q),{query:{index:ce.lowLevelIndex,range:(me=Q.query.range,ce=ce.keyTail,{type:me.type===1?2:me.type,lower:rs(me.lower,me.lowerOpen?f.MAX_KEY:f.MIN_KEY,ce),lowerOpen:!0,upper:rs(me.upper,me.upperOpen?f.MIN_KEY:f.MAX_KEY,ce),upperOpen:!0})}}):Q}return r(r({},w),{schema:r(r({},x),{primaryKey:m,indexes:M,getIndexByKeyPath:function(Q){return(Q=O[ao(Q)])&&Q[0]}}),count:function(Q){return w.count(ue(Q))},query:function(Q){return w.query(ue(Q))},openCursor:function(Q){var me=Q.query.index,ce=me.keyTail,ye=me.isVirtual,Se=me.keyLength;return ye?w.openCursor(ue(Q)).then(function(Oe){return Oe&&ve(Oe)}):w.openCursor(Q);function ve(Oe){return Object.create(Oe,{continue:{value:function(Me){Me!=null?Oe.continue(rs(Me,Q.reverse?f.MAX_KEY:f.MIN_KEY,ce)):Q.unique?Oe.continue(Oe.key.slice(0,Se).concat(Q.reverse?f.MIN_KEY:f.MAX_KEY,ce)):Oe.continue()}},continuePrimaryKey:{value:function(Me,Ne){Oe.continuePrimaryKey(rs(Me,f.MAX_KEY,ce),Ne)}},primaryKey:{get:function(){return Oe.primaryKey}},key:{get:function(){var Me=Oe.key;return Se===1?Me[0]:Me.slice(0,Se)}},value:{get:function(){return Oe.value}}})}}})}})}};function gl(f,m,w,x){return w=w||{},x=x||"",o(f).forEach(function(O){var M,K,te;d(m,O)?(M=f[O],K=m[O],typeof M=="object"&&typeof K=="object"&&M&&K?(te=V(M))!==V(K)?w[x+O]=m[O]:te==="Object"?gl(M,K,w,x+O+"."):M!==K&&(w[x+O]=m[O]):M!==K&&(w[x+O]=m[O])):w[x+O]=void 0}),o(m).forEach(function(O){d(f,O)||(w[x+O]=m[O])}),w}function js(f,m){return m.type==="delete"?m.keys:m.keys||m.values.map(f.extractKey)}var xh={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(f){return r(r({},f),{table:function(m){var w=f.table(m),x=w.schema.primaryKey;return r(r({},w),{mutate:function(O){var M=we.trans,K=M.table(m).hook,te=K.deleting,pe=K.creating,ge=K.updating;switch(O.type){case"add":if(pe.fire===Pe)break;return M._promise("readwrite",function(){return ue(O)},!0);case"put":if(pe.fire===Pe&&ge.fire===Pe)break;return M._promise("readwrite",function(){return ue(O)},!0);case"delete":if(te.fire===Pe)break;return M._promise("readwrite",function(){return ue(O)},!0);case"deleteRange":if(te.fire===Pe)break;return M._promise("readwrite",function(){return function Q(me,ce,ye){return w.query({trans:me,values:!1,query:{index:x,range:ce},limit:ye}).then(function(Se){var ve=Se.result;return ue({type:"delete",keys:ve,trans:me}).then(function(Oe){return 0<Oe.numFailures?Promise.reject(Oe.failures[0]):ve.length<ye?{failures:[],numFailures:0,lastResult:void 0}:Q(me,r(r({},ce),{lower:ve[ve.length-1],lowerOpen:!0}),ye)})})}(O.trans,O.range,1e4)},!0)}return w.mutate(O);function ue(Q){var me,ce,ye,Se=we.trans,ve=Q.keys||js(x,Q);if(!ve)throw new Error("Keys missing");return(Q=Q.type==="add"||Q.type==="put"?r(r({},Q),{keys:ve}):r({},Q)).type!=="delete"&&(Q.values=a([],Q.values)),Q.keys&&(Q.keys=a([],Q.keys)),me=w,ye=ve,((ce=Q).type==="add"?Promise.resolve([]):me.getMany({trans:ce.trans,keys:ye,cache:"immutable"})).then(function(Oe){var Me=ve.map(function(Ne,Fe){var nt,dt,tt,ot=Oe[Fe],pt={onerror:null,onsuccess:null};return Q.type==="delete"?te.fire.call(pt,Ne,ot,Se):Q.type==="add"||ot===void 0?(nt=pe.fire.call(pt,Ne,Q.values[Fe],Se),Ne==null&&nt!=null&&(Q.keys[Fe]=Ne=nt,x.outbound||E(Q.values[Fe],x.keyPath,Ne))):(nt=gl(ot,Q.values[Fe]),(dt=ge.fire.call(pt,nt,Ne,ot,Se))&&(tt=Q.values[Fe],Object.keys(dt).forEach(function(it){d(tt,it)?tt[it]=dt[it]:E(tt,it,dt[it])}))),pt});return w.mutate(Q).then(function(Ne){for(var Fe=Ne.failures,nt=Ne.results,dt=Ne.numFailures,Ne=Ne.lastResult,tt=0;tt<ve.length;++tt){var ot=(nt||ve)[tt],pt=Me[tt];ot==null?pt.onerror&&pt.onerror(Fe[tt]):pt.onsuccess&&pt.onsuccess(Q.type==="put"&&Oe[tt]?Q.values[tt]:ot)}return{failures:Fe,results:nt,numFailures:dt,lastResult:Ne}}).catch(function(Ne){return Me.forEach(function(Fe){return Fe.onerror&&Fe.onerror(Ne)}),Promise.reject(Ne)})})}}})}})}};function Gc(f,m,w){try{if(!m||m.keys.length<f.length)return null;for(var x=[],O=0,M=0;O<m.keys.length&&M<f.length;++O)Kt(m.keys[O],f[M])===0&&(x.push(w?P(m.values[O]):m.values[O]),++M);return x.length===f.length?x:null}catch{return null}}var Np={stack:"dbcore",level:-1,create:function(f){return{table:function(m){var w=f.table(m);return r(r({},w),{getMany:function(x){if(!x.cache)return w.getMany(x);var O=Gc(x.keys,x.trans._cache,x.cache==="clone");return O?$e.resolve(O):w.getMany(x).then(function(M){return x.trans._cache={keys:x.keys,values:x.cache==="clone"?P(M):M},M})},mutate:function(x){return x.type!=="add"&&(x.trans._cache=null),w.mutate(x)}})}}}};function du(f,m){return f.trans.mode==="readonly"&&!!f.subscr&&!f.trans.explicit&&f.trans.db._options.cache!=="disabled"&&!m.schema.primaryKey.outbound}function nc(f,m){switch(f){case"query":return m.values&&!m.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Tm={stack:"dbcore",level:0,name:"Observability",create:function(f){var m=f.schema.name,w=new Dn(f.MIN_KEY,f.MAX_KEY);return r(r({},f),{transaction:function(x,O,M){if(we.subscr&&O!=="readonly")throw new Y.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(we.querier));return f.transaction(x,O,M)},table:function(x){var O=f.table(x),M=O.schema,K=M.primaryKey,Q=M.indexes,te=K.extractKey,pe=K.outbound,ge=K.autoIncrement&&Q.filter(function(ce){return ce.compound&&ce.keyPath.includes(K.keyPath)}),ue=r(r({},O),{mutate:function(ce){function ye(it){return it="idb://".concat(m,"/").concat(x,"/").concat(it),Ne[it]||(Ne[it]=new Dn)}var Se,ve,Oe,Me=ce.trans,Ne=ce.mutatedParts||(ce.mutatedParts={}),Fe=ye(""),nt=ye(":dels"),dt=ce.type,pt=ce.type==="deleteRange"?[ce.range]:ce.type==="delete"?[ce.keys]:ce.values.length<50?[js(K,ce).filter(function(it){return it}),ce.values]:[],tt=pt[0],ot=pt[1],pt=ce.trans._cache;return s(tt)?(Fe.addKeys(tt),(pt=dt==="delete"||tt.length===ot.length?Gc(tt,pt):null)||nt.addKeys(tt),(pt||ot)&&(Se=ye,ve=pt,Oe=ot,M.indexes.forEach(function(it){var bt=Se(it.name||"");function Nt(Wt){return Wt!=null?it.extractKey(Wt):null}function jt(Wt){return it.multiEntry&&s(Wt)?Wt.forEach(function(Xn){return bt.addKey(Xn)}):bt.addKey(Wt)}(ve||Oe).forEach(function(Wt,Pn){var Pt=ve&&Nt(ve[Pn]),Pn=Oe&&Nt(Oe[Pn]);Kt(Pt,Pn)!==0&&(Pt!=null&&jt(Pt),Pn!=null&&jt(Pn))})}))):tt?(ot={from:(ot=tt.lower)!==null&&ot!==void 0?ot:f.MIN_KEY,to:(ot=tt.upper)!==null&&ot!==void 0?ot:f.MAX_KEY},nt.add(ot),Fe.add(ot)):(Fe.add(w),nt.add(w),M.indexes.forEach(function(it){return ye(it.name).add(w)})),O.mutate(ce).then(function(it){return!tt||ce.type!=="add"&&ce.type!=="put"||(Fe.addKeys(it.results),ge&&ge.forEach(function(bt){for(var Nt=ce.values.map(function(Pt){return bt.extractKey(Pt)}),jt=bt.keyPath.findIndex(function(Pt){return Pt===K.keyPath}),Wt=0,Xn=it.results.length;Wt<Xn;++Wt)Nt[Wt][jt]=it.results[Wt];ye(bt.name).addKeys(Nt)})),Me.mutatedParts=ki(Me.mutatedParts||{},Ne),it})}}),Q=function(ye){var Se=ye.query,ye=Se.index,Se=Se.range;return[ye,new Dn((ye=Se.lower)!==null&&ye!==void 0?ye:f.MIN_KEY,(Se=Se.upper)!==null&&Se!==void 0?Se:f.MAX_KEY)]},me={get:function(ce){return[K,new Dn(ce.key)]},getMany:function(ce){return[K,new Dn().addKeys(ce.keys)]},count:Q,query:Q,openCursor:Q};return o(me).forEach(function(ce){ue[ce]=function(ye){var Se=we.subscr,ve=!!Se,Oe=du(we,O)&&nc(ce,ye)?ye.obsSet={}:Se;if(ve){var Me=function(ot){return ot="idb://".concat(m,"/").concat(x,"/").concat(ot),Oe[ot]||(Oe[ot]=new Dn)},Ne=Me(""),Fe=Me(":dels"),Se=me[ce](ye),ve=Se[0],Se=Se[1];if((ce==="query"&&ve.isPrimaryKey&&!ye.values?Fe:Me(ve.name||"")).add(Se),!ve.isPrimaryKey){if(ce!=="count"){var nt=ce==="query"&&pe&&ye.values&&O.query(r(r({},ye),{values:!1}));return O[ce].apply(this,arguments).then(function(ot){if(ce==="query"){if(pe&&ye.values)return nt.then(function(Nt){return Nt=Nt.result,Ne.addKeys(Nt),ot});var pt=ye.values?ot.result.map(te):ot.result;(ye.values?Ne:Fe).addKeys(pt)}else if(ce==="openCursor"){var it=ot,bt=ye.values;return it&&Object.create(it,{key:{get:function(){return Fe.addKey(it.primaryKey),it.key}},primaryKey:{get:function(){var Nt=it.primaryKey;return Fe.addKey(Nt),Nt}},value:{get:function(){return bt&&Ne.addKey(it.primaryKey),it.value}}})}return ot})}Fe.add(w)}}return O[ce].apply(this,arguments)}}),ue}})}};function qc(f,m,w){if(w.numFailures===0)return m;if(m.type==="deleteRange")return null;var x=m.keys?m.keys.length:"values"in m&&m.values?m.values.length:1;return w.numFailures===x?null:(m=r({},m),s(m.keys)&&(m.keys=m.keys.filter(function(O,M){return!(M in w.failures)})),"values"in m&&s(m.values)&&(m.values=m.values.filter(function(O,M){return!(M in w.failures)})),m)}function qi(f,m){return w=f,((x=m).lower===void 0||(x.lowerOpen?0<Kt(w,x.lower):0<=Kt(w,x.lower)))&&(f=f,(m=m).upper===void 0||(m.upperOpen?Kt(f,m.upper)<0:Kt(f,m.upper)<=0));var w,x}function rc(f,m,me,x,O,M){if(!me||me.length===0)return f;var K=m.query.index,te=K.multiEntry,pe=m.query.range,ge=x.schema.primaryKey.extractKey,ue=K.extractKey,Q=(K.lowLevelIndex||K).extractKey,me=me.reduce(function(ce,ye){var Se=ce,ve=[];if(ye.type==="add"||ye.type==="put")for(var Oe=new Dn,Me=ye.values.length-1;0<=Me;--Me){var Ne,Fe=ye.values[Me],nt=ge(Fe);Oe.hasKey(nt)||(Ne=ue(Fe),(te&&s(Ne)?Ne.some(function(it){return qi(it,pe)}):qi(Ne,pe))&&(Oe.addKey(nt),ve.push(Fe)))}switch(ye.type){case"add":var dt=new Dn().addKeys(m.values?ce.map(function(bt){return ge(bt)}):ce),Se=ce.concat(m.values?ve.filter(function(bt){return bt=ge(bt),!dt.hasKey(bt)&&(dt.addKey(bt),!0)}):ve.map(function(bt){return ge(bt)}).filter(function(bt){return!dt.hasKey(bt)&&(dt.addKey(bt),!0)}));break;case"put":var tt=new Dn().addKeys(ye.values.map(function(bt){return ge(bt)}));Se=ce.filter(function(bt){return!tt.hasKey(m.values?ge(bt):bt)}).concat(m.values?ve:ve.map(function(bt){return ge(bt)}));break;case"delete":var ot=new Dn().addKeys(ye.keys);Se=ce.filter(function(bt){return!ot.hasKey(m.values?ge(bt):bt)});break;case"deleteRange":var pt=ye.range;Se=ce.filter(function(bt){return!qi(ge(bt),pt)})}return Se},f);return me===f?f:(me.sort(function(ce,ye){return Kt(Q(ce),Q(ye))||Kt(ge(ce),ge(ye))}),m.limit&&m.limit<1/0&&(me.length>m.limit?me.length=m.limit:f.length===m.limit&&me.length<m.limit&&(O.dirty=!0)),M?Object.freeze(me):me)}function Ul(f,m){return Kt(f.lower,m.lower)===0&&Kt(f.upper,m.upper)===0&&!!f.lowerOpen==!!m.lowerOpen&&!!f.upperOpen==!!m.upperOpen}function Lp(f,m){return function(w,x,O,M){if(w===void 0)return x!==void 0?-1:0;if(x===void 0)return 1;if((x=Kt(w,x))===0){if(O&&M)return 0;if(O)return 1;if(M)return-1}return x}(f.lower,m.lower,f.lowerOpen,m.lowerOpen)<=0&&0<=function(w,x,O,M){if(w===void 0)return x!==void 0?1:0;if(x===void 0)return-1;if((x=Kt(w,x))===0){if(O&&M)return 0;if(O)return-1;if(M)return 1}return x}(f.upper,m.upper,f.upperOpen,m.upperOpen)}function Fp(f,m,w,x){f.subscribers.add(w),x.addEventListener("abort",function(){var O,M;f.subscribers.delete(w),f.subscribers.size===0&&(O=f,M=m,setTimeout(function(){O.subscribers.size===0&&J(M,O)},3e3))})}var Bp={stack:"dbcore",level:0,name:"Cache",create:function(f){var m=f.schema.name;return r(r({},f),{transaction:function(w,x,O){var M,K,te=f.transaction(w,x,O);return x==="readwrite"&&(K=(M=new AbortController).signal,O=function(pe){return function(){if(M.abort(),x==="readwrite"){for(var ge=new Set,ue=0,Q=w;ue<Q.length;ue++){var me=Q[ue],ce=Ca["idb://".concat(m,"/").concat(me)];if(ce){var ye=f.table(me),Se=ce.optimisticOps.filter(function(bt){return bt.trans===te});if(te._explicit&&pe&&te.mutatedParts)for(var ve=0,Oe=Object.values(ce.queries.query);ve<Oe.length;ve++)for(var Me=0,Ne=(dt=Oe[ve]).slice();Me<Ne.length;Me++)ns((tt=Ne[Me]).obsSet,te.mutatedParts)&&(J(dt,tt),tt.subscribers.forEach(function(bt){return ge.add(bt)}));else if(0<Se.length){ce.optimisticOps=ce.optimisticOps.filter(function(bt){return bt.trans!==te});for(var Fe=0,nt=Object.values(ce.queries.query);Fe<nt.length;Fe++)for(var dt,tt,ot,pt=0,it=(dt=nt[Fe]).slice();pt<it.length;pt++)(tt=it[pt]).res!=null&&te.mutatedParts&&(pe&&!tt.dirty?(ot=Object.isFrozen(tt.res),ot=rc(tt.res,tt.req,Se,ye,tt,ot),tt.dirty?(J(dt,tt),tt.subscribers.forEach(function(bt){return ge.add(bt)})):ot!==tt.res&&(tt.res=ot,tt.promise=$e.resolve({result:ot}))):(tt.dirty&&J(dt,tt),tt.subscribers.forEach(function(bt){return ge.add(bt)})))}}}ge.forEach(function(bt){return bt()})}}},te.addEventListener("abort",O(!1),{signal:K}),te.addEventListener("error",O(!1),{signal:K}),te.addEventListener("complete",O(!0),{signal:K})),te},table:function(w){var x=f.table(w),O=x.schema.primaryKey;return r(r({},x),{mutate:function(M){var K=we.trans;if(O.outbound||K.db._options.cache==="disabled"||K.explicit||K.idbtrans.mode!=="readwrite")return x.mutate(M);var te=Ca["idb://".concat(m,"/").concat(w)];return te?(K=x.mutate(M),M.type!=="add"&&M.type!=="put"||!(50<=M.values.length||js(O,M).some(function(pe){return pe==null}))?(te.optimisticOps.push(M),M.mutatedParts&&Bo(M.mutatedParts),K.then(function(pe){0<pe.numFailures&&(J(te.optimisticOps,M),(pe=qc(0,M,pe))&&te.optimisticOps.push(pe),M.mutatedParts&&Bo(M.mutatedParts))}),K.catch(function(){J(te.optimisticOps,M),M.mutatedParts&&Bo(M.mutatedParts)})):K.then(function(pe){var ge=qc(0,r(r({},M),{values:M.values.map(function(ue,Q){var me;return pe.failures[Q]||(ue=(me=O.keyPath)!==null&&me!==void 0&&me.includes(".")?P(ue):r({},ue),E(ue,O.keyPath,pe.results[Q])),ue})}),pe);te.optimisticOps.push(ge),queueMicrotask(function(){return M.mutatedParts&&Bo(M.mutatedParts)})}),K):x.mutate(M)},query:function(M){if(!du(we,x)||!nc("query",M))return x.query(M);var K=((ge=we.trans)===null||ge===void 0?void 0:ge.db._options.cache)==="immutable",Q=we,te=Q.requery,pe=Q.signal,ge=function(ye,Se,ve,Oe){var Me=Ca["idb://".concat(ye,"/").concat(Se)];if(!Me)return[];if(!(Se=Me.queries[ve]))return[null,!1,Me,null];var Ne=Se[(Oe.query?Oe.query.index.name:null)||""];if(!Ne)return[null,!1,Me,null];switch(ve){case"query":var Fe=Ne.find(function(nt){return nt.req.limit===Oe.limit&&nt.req.values===Oe.values&&Ul(nt.req.query.range,Oe.query.range)});return Fe?[Fe,!0,Me,Ne]:[Ne.find(function(nt){return("limit"in nt.req?nt.req.limit:1/0)>=Oe.limit&&(!Oe.values||nt.req.values)&&Lp(nt.req.query.range,Oe.query.range)}),!1,Me,Ne];case"count":return Fe=Ne.find(function(nt){return Ul(nt.req.query.range,Oe.query.range)}),[Fe,!!Fe,Me,Ne]}}(m,w,"query",M),ue=ge[0],Q=ge[1],me=ge[2],ce=ge[3];return ue&&Q?ue.obsSet=M.obsSet:(Q=x.query(M).then(function(ye){var Se=ye.result;if(ue&&(ue.res=Se),K){for(var ve=0,Oe=Se.length;ve<Oe;++ve)Object.freeze(Se[ve]);Object.freeze(Se)}else ye.result=P(Se);return ye}).catch(function(ye){return ce&&ue&&J(ce,ue),Promise.reject(ye)}),ue={obsSet:M.obsSet,promise:Q,subscribers:new Set,type:"query",req:M,dirty:!1},ce?ce.push(ue):(ce=[ue],(me=me||(Ca["idb://".concat(m,"/").concat(w)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[M.query.index.name||""]=ce)),Fp(ue,ce,te,pe),ue.promise.then(function(ye){return{result:rc(ye.result,M,me==null?void 0:me.optimisticOps,x,ue,K)}})}})}})}};function as(f,m){return new Proxy(f,{get:function(w,x,O){return x==="db"?m:Reflect.get(w,x,O)}})}var ea=(bn.prototype.version=function(f){if(isNaN(f)||f<.1)throw new Y.Type("Given version is not a positive number");if(f=Math.round(10*f)/10,this.idbdb||this._state.isBeingOpened)throw new Y.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,f);var m=this._versions,w=m.filter(function(x){return x._cfg.version===f})[0];return w||(w=new this.Version(f),m.push(w),m.sort(Kf),w.stores({}),this._state.autoSchema=!1,w)},bn.prototype._whenReady=function(f){var m=this;return this.idbdb&&(this._state.openComplete||we.letThrough||this._vip)?f():new $e(function(w,x){if(m._state.openComplete)return x(new Y.DatabaseClosed(m._state.dbOpenError));if(!m._state.isBeingOpened){if(!m._state.autoOpen)return void x(new Y.DatabaseClosed);m.open().catch(Pe)}m._state.dbReadyPromise.then(w,x)}).then(f)},bn.prototype.use=function(f){var m=f.stack,w=f.create,x=f.level,O=f.name;return O&&this.unuse({stack:m,name:O}),f=this._middlewares[m]||(this._middlewares[m]=[]),f.push({stack:m,create:w,level:x??10,name:O}),f.sort(function(M,K){return M.level-K.level}),this},bn.prototype.unuse=function(f){var m=f.stack,w=f.name,x=f.create;return m&&this._middlewares[m]&&(this._middlewares[m]=this._middlewares[m].filter(function(O){return x?O.create!==x:!!w&&O.name!==w})),this},bn.prototype.open=function(){var f=this;return or(le,function(){return Yf(f)})},bn.prototype._close=function(){var f=this._state,m=wa.indexOf(this);if(0<=m&&wa.splice(m,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}f.isBeingOpened||(f.dbReadyPromise=new $e(function(w){f.dbReadyResolve=w}),f.openCanceller=new $e(function(w,x){f.cancelOpen=x}))},bn.prototype.close=function(w){var m=(w===void 0?{disableAutoOpen:!0}:w).disableAutoOpen,w=this._state;m?(w.isBeingOpened&&w.cancelOpen(new Y.DatabaseClosed),this._close(),w.autoOpen=!1,w.dbOpenError=new Y.DatabaseClosed):(this._close(),w.autoOpen=this._options.autoOpen||w.isBeingOpened,w.openComplete=!1,w.dbOpenError=null)},bn.prototype.delete=function(f){var m=this;f===void 0&&(f={disableAutoOpen:!0});var w=0<arguments.length&&typeof arguments[0]!="object",x=this._state;return new $e(function(O,M){function K(){m.close(f);var te=m._deps.indexedDB.deleteDatabase(m.name);te.onsuccess=Vt(function(){var pe,ge,ue;pe=m._deps,ge=m.name,ue=pe.indexedDB,pe=pe.IDBKeyRange,uo(ue)||ge===ho||$s(ue,pe).delete(ge).catch(Pe),O()}),te.onerror=Vr(M),te.onblocked=m._fireOnBlocked}if(w)throw new Y.InvalidArgument("Invalid closeOptions argument to db.delete()");x.isBeingOpened?x.dbReadyPromise.then(K):K()})},bn.prototype.backendDB=function(){return this.idbdb},bn.prototype.isOpen=function(){return this.idbdb!==null},bn.prototype.hasBeenClosed=function(){var f=this._state.dbOpenError;return f&&f.name==="DatabaseClosed"},bn.prototype.hasFailed=function(){return this._state.dbOpenError!==null},bn.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(bn.prototype,"tables",{get:function(){var f=this;return o(this._allTables).map(function(m){return f._allTables[m]})},enumerable:!1,configurable:!0}),bn.prototype.transaction=function(){var f=(function(m,w,x){var O=arguments.length;if(O<2)throw new Y.InvalidArgument("Too few arguments");for(var M=new Array(O-1);--O;)M[O-1]=arguments[O];return x=M.pop(),[m,A(M),x]}).apply(this,arguments);return this._transaction.apply(this,f)},bn.prototype._transaction=function(f,m,w){var x=this,O=we.trans;O&&O.db===this&&f.indexOf("!")===-1||(O=null);var M,K,te=f.indexOf("?")!==-1;f=f.replace("!","").replace("?","");try{if(K=m.map(function(ge){if(ge=ge instanceof x.Table?ge.name:ge,typeof ge!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return ge}),f=="r"||f===Xs)M=Xs;else{if(f!="rw"&&f!=Qs)throw new Y.InvalidArgument("Invalid transaction mode: "+f);M=Qs}if(O){if(O.mode===Xs&&M===Qs){if(!te)throw new Y.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");O=null}O&&K.forEach(function(ge){if(O&&O.storeNames.indexOf(ge)===-1){if(!te)throw new Y.SubTransaction("Table "+ge+" not included in parent transaction.");O=null}}),te&&O&&!O.active&&(O=null)}}catch(ge){return O?O._promise(null,function(ue,Q){Q(ge)}):un(ge)}var pe=(function ge(ue,Q,me,ce,ye){return $e.resolve().then(function(){var Se=we.transless||we,ve=ue._createTransaction(Q,me,ue._dbSchema,ce);if(ve.explicit=!0,Se={trans:ve,transless:Se},ce)ve.idbtrans=ce.idbtrans;else try{ve.create(),ve.idbtrans._explicit=!0,ue._state.PR1398_maxLoop=3}catch(Ne){return Ne.name===ae.InvalidState&&ue.isOpen()&&0<--ue._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ue.close({disableAutoOpen:!1}),ue.open().then(function(){return ge(ue,Q,me,null,ye)})):un(Ne)}var Oe,Me=ee(ye);return Me&&Yn(),Se=$e.follow(function(){var Ne;(Oe=ye.call(ve,ve))&&(Me?(Ne=ar.bind(null,null),Oe.then(Ne,Ne)):typeof Oe.next=="function"&&typeof Oe.throw=="function"&&(Oe=hs(Oe)))},Se),(Oe&&typeof Oe.then=="function"?$e.resolve(Oe).then(function(Ne){return ve.active?Ne:un(new Y.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):Se.then(function(){return Oe})).then(function(Ne){return ce&&ve._resolve(),ve._completion.then(function(){return Ne})}).catch(function(Ne){return ve._reject(Ne),un(Ne)})})}).bind(null,this,M,K,O,w);return O?O._promise(M,pe,"lock"):we.trans?or(we.transless,function(){return x._whenReady(pe)}):this._whenReady(pe)},bn.prototype.table=function(f){if(!d(this._allTables,f))throw new Y.InvalidTable("Table ".concat(f," does not exist"));return this._allTables[f]},bn);function bn(f,m){var w=this;this._middlewares={},this.verno=0;var x=bn.dependencies;this._options=m=r({addons:bn.addons,autoOpen:!0,indexedDB:x.indexedDB,IDBKeyRange:x.IDBKeyRange,cache:"cloned"},m),this._deps={indexedDB:m.indexedDB,IDBKeyRange:m.IDBKeyRange},x=m.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var O,M,K,te,pe,ge={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Pe,dbReadyPromise:null,cancelOpen:Pe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:m.autoOpen};ge.dbReadyPromise=new $e(function(Q){ge.dbReadyResolve=Q}),ge.openCanceller=new $e(function(Q,me){ge.cancelOpen=me}),this._state=ge,this.name=f,this.on=wi(this,"populate","blocked","versionchange","close",{ready:[ne,Pe]}),this.on.ready.subscribe=S(this.on.ready.subscribe,function(Q){return function(me,ce){bn.vip(function(){var ye,Se=w._state;Se.openComplete?(Se.dbOpenError||$e.resolve().then(me),ce&&Q(me)):Se.onReadyBeingFired?(Se.onReadyBeingFired.push(me),ce&&Q(me)):(Q(me),ye=w,ce||Q(function ve(){ye.on.ready.unsubscribe(me),ye.on.ready.unsubscribe(ve)}))})}}),this.Collection=(O=this,ji(Wd.prototype,function(Oe,ve){this.db=O;var ce=Uc,ye=null;if(ve)try{ce=ve()}catch(Me){ye=Me}var Se=Oe._ctx,ve=Se.table,Oe=ve.hook.reading.fire;this._ctx={table:ve,index:Se.index,isPrimKey:!Se.index||ve.schema.primKey.keyPath&&Se.index===ve.schema.primKey.name,range:ce,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:ye,or:Se.or,valueMapper:Oe!==Te?Oe:null}})),this.Table=(M=this,ji(Vl.prototype,function(Q,me,ce){this.db=M,this._tx=ce,this.name=Q,this.schema=me,this.hook=M._allTables[Q]?M._allTables[Q].hook:wi(null,{creating:[Je,Pe],reading:[Ae,Te],updating:[Ye,Pe],deleting:[We,Pe]})})),this.Transaction=(K=this,ji(qf.prototype,function(Q,me,ce,ye,Se){var ve=this;this.db=K,this.mode=Q,this.storeNames=me,this.schema=ce,this.chromeTransactionDurability=ye,this.idbtrans=null,this.on=wi(this,"complete","error","abort"),this.parent=Se||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 $e(function(Oe,Me){ve._resolve=Oe,ve._reject=Me}),this._completion.then(function(){ve.active=!1,ve.on.complete.fire()},function(Oe){var Me=ve.active;return ve.active=!1,ve.on.error.fire(Oe),ve.parent?ve.parent._reject(Oe):Me&&ve.idbtrans&&ve.idbtrans.abort(),un(Oe)})})),this.Version=(te=this,ji(Gd.prototype,function(Q){this.db=te,this._cfg={version:Q,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(pe=this,ji(Iu.prototype,function(Q,me,ce){if(this.db=pe,this._ctx={table:Q,index:me===":id"?null:me,or:ce},this._cmp=this._ascending=Kt,this._descending=function(ye,Se){return Kt(Se,ye)},this._max=function(ye,Se){return 0<Kt(ye,Se)?ye:Se},this._min=function(ye,Se){return Kt(ye,Se)<0?ye:Se},this._IDBKeyRange=pe._deps.IDBKeyRange,!this._IDBKeyRange)throw new Y.MissingAPI})),this.on("versionchange",function(Q){0<Q.newVersion?console.warn("Another connection wants to upgrade database '".concat(w.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(w.name,"'. Closing db now to resume the delete request.")),w.close({disableAutoOpen:!1})}),this.on("blocked",function(Q){!Q.newVersion||Q.newVersion<Q.oldVersion?console.warn("Dexie.delete('".concat(w.name,"') was blocked")):console.warn("Upgrade '".concat(w.name,"' blocked by other connection holding version ").concat(Q.oldVersion/10))}),this._maxKey=Ji(m.IDBKeyRange),this._createTransaction=function(Q,me,ce,ye){return new w.Transaction(Q,me,ce,w._options.chromeTransactionDurability,ye)},this._fireOnBlocked=function(Q){w.on("blocked").fire(Q),wa.filter(function(me){return me.name===w.name&&me!==w&&!me._state.vcFired}).map(function(me){return me.on("versionchange").fire(Q)})},this.use(Np),this.use(Bp),this.use(Tm),this.use(bf),this.use(xh);var ue=new Proxy(this,{get:function(Q,me,ce){if(me==="_vip")return!0;if(me==="table")return function(Se){return as(w.table(Se),ue)};var ye=Reflect.get(Q,me,ce);return ye instanceof Vl?as(ye,ue):me==="tables"?ye.map(function(Se){return as(Se,ue)}):me==="_createTransaction"?function(){return as(ye.apply(this,arguments),ue)}:ye}});this.vip=ue,x.forEach(function(Q){return Q(w)})}var Vo,er=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Dm=(zs.prototype.subscribe=function(f,m,w){return this._subscribe(f&&typeof f!="function"?f:{next:f,error:m,complete:w})},zs.prototype[er]=function(){return this},zs);function zs(f){this._subscribe=f}try{Vo={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch{Vo={indexedDB:null,IDBKeyRange:null}}function ac(f){var m,w=!1,x=new Dm(function(O){var M=ee(f),K,te=!1,pe={},ge={},ue={get closed(){return te},unsubscribe:function(){te||(te=!0,K&&K.abort(),Q&&pa.storagemutated.unsubscribe(ce))}};O.start&&O.start(ue);var Q=!1,me=function(){return ia(ye)},ce=function(Se){ki(pe,Se),ns(ge,pe)&&me()},ye=function(){var Se,ve,Oe;!te&&Vo.indexedDB&&(pe={},Se={},K&&K.abort(),K=new AbortController,Oe=function(Me){var Ne=xt();try{M&&Yn();var Fe=Lr(f,Me);return Fe=M?Fe.finally(ar):Fe}finally{Ne&&Ht()}}(ve={subscr:Se,signal:K.signal,requery:me,querier:f,trans:null}),Promise.resolve(Oe).then(function(Me){w=!0,m=Me,te||ve.signal.aborted||(pe={},function(Ne){for(var Fe in Ne)if(d(Ne,Fe))return;return 1}(ge=Se)||Q||(pa(ro,ce),Q=!0),ia(function(){return!te&&O.next&&O.next(Me)}))},function(Me){w=!1,["DatabaseClosedError","AbortError"].includes(Me==null?void 0:Me.name)||te||ia(function(){te||O.error&&O.error(Me)})}))};return setTimeout(me,0),ue});return x.hasValue=function(){return w},x.getValue=function(){return m},x}var Ta=ea;function Uo(f){var m=ha;try{ha=!0,pa.storagemutated.fire(f),ml(f,!0)}finally{ha=m}}p(Ta,r(r({},he),{delete:function(f){return new Ta(f,{addons:[]}).delete()},exists:function(f){return new Ta(f,{addons:[]}).open().then(function(m){return m.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(f){try{return m=Ta.dependencies,w=m.indexedDB,m=m.IDBKeyRange,(uo(w)?Promise.resolve(w.databases()).then(function(x){return x.map(function(O){return O.name}).filter(function(O){return O!==ho})}):$s(w,m).toCollection().primaryKeys()).then(f)}catch{return un(new Y.MissingAPI)}var m,w},defineClass:function(){return function(f){l(this,f)}},ignoreTransaction:function(f){return we.trans?or(we.transless,f):f()},vip:fi,async:function(f){return function(){try{var m=hs(f.apply(this,arguments));return m&&typeof m.then=="function"?m:$e.resolve(m)}catch(w){return un(w)}}},spawn:function(f,m,w){try{var x=hs(f.apply(w,m||[]));return x&&typeof x.then=="function"?x:$e.resolve(x)}catch(O){return un(O)}},currentTransaction:{get:function(){return we.trans||null}},waitFor:function(f,m){return m=$e.resolve(typeof f=="function"?Ta.ignoreTransaction(f):f).timeout(m||6e4),we.trans?we.trans.waitFor(m):m},Promise:$e,debug:{get:function(){return se},set:function(f){Ue(f)}},derive:v,extend:l,props:p,override:S,Events:wi,on:pa,liveQuery:ac,extendObservabilitySet:ki,getByKeyPath:k,setByKeyPath:E,delByKeyPath:function(f,m){typeof m=="string"?E(f,m,void 0):"length"in m&&[].map.call(m,function(w){E(f,w,void 0)})},shallowClone:I,deepClone:P,getObjectDiff:gl,cmp:Kt,asap:T,minKey:-1/0,addons:[],connections:wa,errnames:ae,dependencies:Vo,cache:Ca,semVer:"4.0.10",version:"4.0.10".split(".").map(function(f){return parseInt(f)}).reduce(function(f,m,w){return f+m/Math.pow(10,2*w)})})),Ta.maxKey=Ji(Ta.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(pa(ro,function(f){ha||(f=new CustomEvent(dl,{detail:f}),ha=!0,dispatchEvent(f),ha=!1)}),addEventListener(dl,function(f){f=f.detail,ha||Uo(f)}));var Ba,ha=!1,yd=function(){};return typeof BroadcastChannel<"u"&&((yd=function(){(Ba=new BroadcastChannel(dl)).onmessage=function(f){return f.data&&Uo(f.data)}})(),typeof Ba.unref=="function"&&Ba.unref(),pa(ro,function(f){ha||Ba.postMessage(f)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(f){if(!ea.disableBfCache&&f.persisted){se&&console.debug("Dexie: handling persisted pagehide"),Ba!=null&&Ba.close();for(var m=0,w=wa;m<w.length;m++)w[m].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(f){!ea.disableBfCache&&f.persisted&&(se&&console.debug("Dexie: handling persisted pageshow"),yd(),Uo({all:new Dn(-1/0,[[]])}))})),$e.rejectionMapper=function(f,m){return!f||f instanceof U||f instanceof TypeError||f instanceof SyntaxError||!f.name||!Ee[f.name]?f:(m=new Ee[f.name](m||f.message,f),"stack"in f&&g(m,"stack",{get:function(){return this.inner.stack}}),m)},Ue(se),r(ea,Object.freeze({__proto__:null,Dexie:ea,liveQuery:ac,Entity:Du,cmp:Kt,PropModSymbol:Wr,PropModification:za,replacePrefix:function(f,m){return new za({replacePrefix:[f,m]})},add:function(f){return new za({add:f})},remove:function(f){return new za({remove:f})},default:ea,RangeSet:Dn,mergeRanges:Zi,rangesOverlap:pl}),{default:ea}),ea})})(gLt);var CTa=gLt.exports;const tRe=_Ta(CTa),vLt=Symbol.for("Dexie"),G9=globalThis[vLt]||(globalThis[vLt]=tRe);if(tRe.semVer!==G9.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${tRe.semVer} and ${G9.semVer}`);const{liveQuery:vqa,mergeRanges:yqa,rangesOverlap:bqa,RangeSet:wqa,cmp:_qa,Entity:Cqa,PropModSymbol:Sqa,PropModification:kqa,replacePrefix:Eqa,add:xqa,remove:Tqa}=G9;class yLt extends G9{constructor(t){super(t),Ud(this,"icons"),Ud(this,"visuals"),Ud(this,"users"),Ud(this,"columns"),Ud(this,"general"),this.version(1).stores({icons:"key",visuals:"key",users:"key",columns:"key",general:"key"})}getTable(t){return this[t]?this[t]:this.general}}const wse=new Map,STa=async e=>{if(!wse.has(e)){const t=new yLt(e);try{await t.open(),wse.set(e,t)}catch(n){console.error("Failed to open database, attempting to delete and recreate:",n);try{await G9.delete(e);const r=new yLt(e);await r.open(),wse.set(e,r)}catch(r){throw console.error("Failed to delete and recreate database:",r),r}}}return wse.get(e)},nRe=({dbName:e,storeName:t})=>{const n=async()=>(await STa(e)).getTable(t);return{getCachedValue:async r=>{try{const a=await n();if(!a){console.error(`Store is undefined for key: ${r}`);return}const i=await a.get(r);return i==null?void 0:i.value}catch(a){console.error("Failed to get cached value:",a);return}},setCachedValue:async(r,a)=>{try{const i=await n();if(!i){console.error(`Store is undefined, cannot cache key: ${r}`);return}await i.put({key:r,value:a,timestamp:Date.now()})}catch(i){console.error("Failed to cache value:",i)}},deleteCachedValue:async r=>{try{const a=await n();if(!a){console.error(`Store is undefined, cannot delete key: ${r}`);return}await a.delete(r)}catch(a){console.error("Failed to delete cached value:",a)}},clearCache:async()=>{try{const r=await n();if(!r){console.error("Store is undefined, cannot clear cache");return}await r.clear()}catch(r){console.error("Failed to clear cache:",r)}},getAllKeys:async()=>{try{const r=await n();return r?(await r.toArray()).map(a=>a.key):(console.error("Store is undefined, cannot get all keys"),[])}catch(r){return console.error("Failed to get all keys:",r),[]}},getCachedValueWithTimestamp:async r=>{try{const a=await n();if(!a){console.error(`Store is undefined for key: ${r}`);return}return await a.get(r)}catch(a){console.error("Failed to get cached value with timestamp:",a);return}}}},kTa="AvatarCache",ETa="images",qR={},_se={},xTa=()=>{const{getCachedValue:e,setCachedValue:t}=nRe({dbName:kTa,storeName:ETa}),n=i=>new Promise((o,s)=>{const l=new FileReader;l.onloadend=()=>o(l.result),l.onerror=s,l.readAsDataURL(i)}),r=async i=>{try{if(qR[i])return qR[i];if(_se[i])return await _se[i];const o=(async()=>{try{const s=await e(i);if(!s||!(s instanceof Blob))return null;const l=await n(s);return qR[i]=l,l}catch(s){return console.warn(`Failed to get cached image for key: ${i}`,s),null}})();return _se[i]=o,o.finally(()=>{delete _se[i]}),await o}catch(o){return console.error(`Error in getCachedImage for key: ${i}`,o),null}},a=i=>new Promise((o,s)=>{new wTa(i,{width:96,height:96,quality:1,success(l){o(l)},error(l){console.error("Image compression failed:",l.message),s(l)}})});return{getCachedImage:r,setCachedImage:async(i,o)=>{try{const s=await a(o);await t(i,s);const l=await n(s);qR[i]=l}catch(s){throw console.error(`Failed to cache image for key: ${i}`,s),s}},clearMemoryCache:i=>{try{i?delete qR[i]:Object.keys(qR).forEach(o=>delete qR[o])}catch(o){console.error("Error clearing memory cache:",o)}}}},q9=new Map,KC=new Map,K3=new Map,TTa=5*60*1e3,bLt=100;function DTa(){const e=Date.now(),t=[];K3.forEach((n,r)=>{e-n>TTa&&t.push(r)}),t.forEach(n=>{q9.delete(n),K3.delete(n),KC.delete(n)})}function ATa(){if(K3.size<=bLt)return;const e=Array.from(K3.entries()).sort((t,n)=>t[1]-n[1]);e.slice(0,e.length-bLt).forEach(([t])=>{q9.delete(t),K3.delete(t),KC.delete(t)})}const OTa=(e,t)=>{const n=KC.get(e);return n==null||n.forEach(r=>r(t)),KC.delete(e),t};async function ITa({userId:e,avatarUrl:t,cacheInterface:n,onLoadingChange:r}){let a=e;if(t)try{const c=new URL(t,"http://localhost").pathname.split("/").pop();c?a=`${e}_${c}`:a=t}catch{a=t||e}const i=await n.getCachedImage(a),o=q9.has(a),s=KC.has(a);if(i)return OTa(a,i);if(DTa(),o)return new Promise(c=>{s||KC.set(a,[]),KC.get(a).push(c)});const l=(async()=>{let c=null,d=null;try{const p=Math.random()*300;await new Promise(g=>setTimeout(g,p)),r==null||r(!0);const h=await fetch(t,{cache:"no-cache"});if(!h.ok)throw new Error("Failed to fetch image");return c=await h.blob(),await n.setCachedImage(a,c),d=URL.createObjectURL(c),d}catch(p){throw console.error("Error loading avatar image:",p),p}finally{c=null,r==null||r(!1),K3.set(a,Date.now()),setTimeout(()=>{q9.delete(a),ATa()},100)}})();q9.set(a,l);const u=await l;return KC.has(a)&&(KC.get(a).forEach(c=>c(u)),KC.delete(a)),u}const RTa=(e,t=3,n=1e3)=>{const r=W(0),a=W(!1),i=W(!1),o=async()=>{try{await e()}catch(s){if(r.value<t)return r.value++,i.value=!0,await new Promise(l=>setTimeout(l,n)),o();throw a.value=!0,s}};return{retry:o,currentAttempt:r,errorRetry:a,isRetrying:i}};function Sh(e,t){$Ta(e)&&(e="100%");const n=PTa(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Cse(e){return Math.min(1,Math.max(0,e))}function $Ta(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function PTa(e){return typeof e=="string"&&e.indexOf("%")!==-1}function wLt(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Sse(e){return Number(e)<=1?`${Number(e)*100}%`:e}function KR(e){return e.length===1?"0"+e:String(e)}function MTa(e,t,n){return{r:Sh(e,255)*255,g:Sh(t,255)*255,b:Sh(n,255)*255}}function _Lt(e,t,n){e=Sh(e,255),t=Sh(t,255),n=Sh(n,255);const r=Math.max(e,t,n),a=Math.min(e,t,n);let i=0,o=0;const s=(r+a)/2;if(r===a)o=0,i=0;else{const l=r-a;switch(o=s>.5?l/(2-r-a):l/(r+a),r){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break}i/=6}return{h:i,s:o,l:s}}function rRe(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function NTa(e,t,n){let r,a,i;if(e=Sh(e,360),t=Sh(t,100),n=Sh(n,100),t===0)a=n,i=n,r=n;else{const o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;r=rRe(s,o,e+1/3),a=rRe(s,o,e),i=rRe(s,o,e-1/3)}return{r:r*255,g:a*255,b:i*255}}function CLt(e,t,n){e=Sh(e,255),t=Sh(t,255),n=Sh(n,255);const r=Math.max(e,t,n),a=Math.min(e,t,n);let i=0;const o=r,s=r-a,l=r===0?0:s/r;if(r===a)i=0;else{switch(r){case e:i=(t-n)/s+(t<n?6:0);break;case t:i=(n-e)/s+2;break;case n:i=(e-t)/s+4;break}i/=6}return{h:i,s:l,v:o}}function LTa(e,t,n){e=Sh(e,360)*6,t=Sh(t,100),n=Sh(n,100);const r=Math.floor(e),a=e-r,i=n*(1-t),o=n*(1-a*t),s=n*(1-(1-a)*t),l=r%6,u=[n,o,i,i,s,n][l],c=[s,n,n,o,i,i][l],d=[i,i,s,n,n,o][l];return{r:u*255,g:c*255,b:d*255}}function SLt(e,t,n,r){const a=[KR(Math.round(e).toString(16)),KR(Math.round(t).toString(16)),KR(Math.round(n).toString(16))];return r&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function FTa(e,t,n,r,a){const i=[KR(Math.round(e).toString(16)),KR(Math.round(t).toString(16)),KR(Math.round(n).toString(16)),KR(VTa(r))];return a&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function BTa(e,t,n,r){const a=e/100,i=t/100,o=n/100,s=r/100,l=255*(1-a)*(1-s),u=255*(1-i)*(1-s),c=255*(1-o)*(1-s);return{r:l,g:u,b:c}}function kLt(e,t,n){let r=1-e/255,a=1-t/255,i=1-n/255,o=Math.min(r,a,i);return o===1?(r=0,a=0,i=0):(r=(r-o)/(1-o)*100,a=(a-o)/(1-o)*100,i=(i-o)/(1-o)*100),o*=100,{c:Math.round(r),m:Math.round(a),y:Math.round(i),k:Math.round(o)}}function VTa(e){return Math.round(parseFloat(e)*255).toString(16)}function ELt(e){return hy(e)/255}function hy(e){return parseInt(e,16)}function UTa(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const aRe={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function HTa(e){let t={r:0,g:0,b:0},n=1,r=null,a=null,i=null,o=!1,s=!1;return typeof e=="string"&&(e=WTa(e)),typeof e=="object"&&(py(e.r)&&py(e.g)&&py(e.b)?(t=MTa(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):py(e.h)&&py(e.s)&&py(e.v)?(r=Sse(e.s),a=Sse(e.v),t=LTa(e.h,r,a),o=!0,s="hsv"):py(e.h)&&py(e.s)&&py(e.l)?(r=Sse(e.s),i=Sse(e.l),t=NTa(e.h,r,i),o=!0,s="hsl"):py(e.c)&&py(e.m)&&py(e.y)&&py(e.k)&&(t=BTa(e.c,e.m,e.y,e.k),o=!0,s="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=wLt(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}const jTa="[-\\+]?\\d+%?",zTa="[-\\+]?\\d*\\.\\d+%?",uA="(?:"+zTa+")|(?:"+jTa+")",iRe="[\\s|\\(]+("+uA+")[,|\\s]+("+uA+")[,|\\s]+("+uA+")\\s*\\)?",kse="[\\s|\\(]+("+uA+")[,|\\s]+("+uA+")[,|\\s]+("+uA+")[,|\\s]+("+uA+")\\s*\\)?",k0={CSS_UNIT:new RegExp(uA),rgb:new RegExp("rgb"+iRe),rgba:new RegExp("rgba"+kse),hsl:new RegExp("hsl"+iRe),hsla:new RegExp("hsla"+kse),hsv:new RegExp("hsv"+iRe),hsva:new RegExp("hsva"+kse),cmyk:new RegExp("cmyk"+kse),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function WTa(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(aRe[e])e=aRe[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let n=k0.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=k0.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=k0.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=k0.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=k0.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=k0.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=k0.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:(n=k0.hex8.exec(e),n?{r:hy(n[1]),g:hy(n[2]),b:hy(n[3]),a:ELt(n[4]),format:t?"name":"hex8"}:(n=k0.hex6.exec(e),n?{r:hy(n[1]),g:hy(n[2]),b:hy(n[3]),format:t?"name":"hex"}:(n=k0.hex4.exec(e),n?{r:hy(n[1]+n[1]),g:hy(n[2]+n[2]),b:hy(n[3]+n[3]),a:ELt(n[4]+n[4]),format:t?"name":"hex8"}:(n=k0.hex3.exec(e),n?{r:hy(n[1]+n[1]),g:hy(n[2]+n[2]),b:hy(n[3]+n[3]),format:t?"name":"hex"}:!1))))))))))}function py(e){return typeof e=="number"?!Number.isNaN(e):k0.CSS_UNIT.test(e)}class Xu{constructor(t="",n={}){if(t instanceof Xu)return t;typeof t=="number"&&(t=UTa(t)),this.originalInput=t;const r=HTa(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3}getLuminance(){const t=this.toRgb();let n,r,a;const i=t.r/255,o=t.g/255,s=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),o<=.03928?r=o/12.92:r=Math.pow((o+.055)/1.055,2.4),s<=.03928?a=s/12.92:a=Math.pow((s+.055)/1.055,2.4),.2126*n+.7152*r+.0722*a}getAlpha(){return this.a}setAlpha(t){return this.a=wLt(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return t===0}toHsv(){const t=CLt(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=CLt(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),a=Math.round(t.v*100);return this.a===1?`hsv(${n}, ${r}%, ${a}%)`:`hsva(${n}, ${r}%, ${a}%, ${this.roundA})`}toHsl(){const t=_Lt(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=_Lt(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),a=Math.round(t.l*100);return this.a===1?`hsl(${n}, ${r}%, ${a}%)`:`hsla(${n}, ${r}%, ${a}%, ${this.roundA})`}toHex(t=!1){return SLt(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return FTa(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return this.a===1?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?`rgb(${t}, ${n}, ${r})`:`rgba(${t}, ${n}, ${r}, ${this.roundA})`}toPercentageRgb(){const t=n=>`${Math.round(Sh(n,255)*100)}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=n=>Math.round(Sh(n,255)*100);return this.a===1?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toCmyk(){return{...kLt(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:n,y:r,k:a}=kLt(this.r,this.g,this.b);return`cmyk(${t}, ${n}, ${r}, ${a})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const t="#"+SLt(this.r,this.g,this.b,!1);for(const[n,r]of Object.entries(aRe))if(t===r)return n;return!1}toString(t){const n=!!t;t=t??this.format;let r=!1;const a=this.a<1&&this.a>=0;return!n&&a&&(t.startsWith("hex")||t==="name")?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),t==="cmyk"&&(r=this.toCmykString()),r||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new Xu(this.toString())}lighten(t=10){const n=this.toHsl();return n.l+=t/100,n.l=Cse(n.l),new Xu(n)}brighten(t=10){const n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new Xu(n)}darken(t=10){const n=this.toHsl();return n.l-=t/100,n.l=Cse(n.l),new Xu(n)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const n=this.toHsl();return n.s-=t/100,n.s=Cse(n.s),new Xu(n)}saturate(t=10){const n=this.toHsl();return n.s+=t/100,n.s=Cse(n.s),new Xu(n)}greyscale(){return this.desaturate(100)}spin(t){const n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new Xu(n)}mix(t,n=50){const r=this.toRgb(),a=new Xu(t).toRgb(),i=n/100,o={r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a};return new Xu(o)}analogous(t=6,n=30){const r=this.toHsl(),a=360/n,i=[this];for(r.h=(r.h-(a*t>>1)+720)%360;--t;)r.h=(r.h+a)%360,i.push(new Xu(r));return i}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new Xu(t)}monochromatic(t=6){const n=this.toHsv(),{h:r}=n,{s:a}=n;let{v:i}=n;const o=[],s=1/t;for(;t--;)o.push(new Xu({h:r,s:a,v:i})),i=(i+s)%1;return o}splitcomplement(){const t=this.toHsl(),{h:n}=t;return[this,new Xu({h:(n+72)%360,s:t.s,l:t.l}),new Xu({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){const n=this.toRgb(),r=new Xu(t).toRgb(),a=n.a+r.a*(1-n.a);return new Xu({r:(n.r*n.a+r.r*r.a*(1-n.a))/a,g:(n.g*n.a+r.g*r.a*(1-n.a))/a,b:(n.b*n.a+r.b*r.a*(1-n.a))/a,a})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const n=this.toHsl(),{h:r}=n,a=[this],i=360/t;for(let o=1;o<t;o++)a.push(new Xu({h:(r+o*i)%360,s:n.s,l:n.l}));return a}equals(t){const n=new Xu(t);return this.format==="cmyk"||n.format==="cmyk"?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}function xLt(e){return new Xu(e||"").isValid}function GTa(e,t){const{c1:n,c2:r}={c1:new Xu(e),c2:new Xu(t)};return n.equals(r)}const TLt=class B7{constructor(){Ud(this,"KEY_PAIR",{workspaceCode:"ws.code",apiBaseUrl:"API_BASE_URL",assetUrl:"ASSET_URL",baseUrl:"BASE_URL",baseReviewUrl:"BASE_REVIEW_URL"}),Object.values(this.KEY_PAIR).every(t=>{const n=sessionStorage.getItem(t);return(n==null||n==="")&&console.error(`[SessionStorageHelper] Key "${t}" is not set in sessionStorage.`),!0})||console.error("[SessionStorageHelper] Some expected keys are missing in sessionStorage. Please ensure all required keys are set.")}static getInstance(){return B7.instance||(B7.instance=new B7),B7.instance}setItem(t,n){try{sessionStorage.setItem(t,n)}catch(r){console.error("Error setting sessionStorage item:",r)}}getItem(t){try{const n=sessionStorage.getItem(t);return n===null?"":n}catch(n){throw console.error("Error getting sessionStorage item:",n),n}}};Ud(TLt,"instance");let oRe=TLt;const qTa=["src","alt"],KTa=ct({__name:"Avatar",props:{name:{},id:{},profile_image:{},color:{},initial:{},isMe:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},size:{default:24},isUseShortLabel:{type:Boolean,default:!0},borderRadius:{default:void 0}},setup(e){const t=e,n=z(()=>t.isMe||t.id===p.value),r=W(""),a=W(!1),i=W(null),o=W(!1),s=z(()=>({name:t.name||"",id:t.id||"",profile_image:t.profile_image||null,color:t.color||{bgColor:"#CCCCCC",textColor:"var(--background-color)"},initial:t.initial})),l=z(()=>{var k;const E=((k=s.value.color)==null?void 0:k.bgColor)||"#CCCCCC";return xLt(E)?E:"#CCCCCC"}),u=z(()=>{var k;const E=((k=s.value.color)==null?void 0:k.textColor)||"var(--background-color)";return xLt(E)?E:"var(--background-color)"}),c=z(()=>{if(!t.isUseShortLabel)return"";const{initial:k,name:E}=s.value;if(typeof k=="string"&&k.trim())return k.trim();if(!(E!=null&&E.trim()))return"";const I=E.trim().split(/\s+/).filter(Boolean);return I.length===1?I[0].slice(0,2).toUpperCase():(I[0][0]+I[1][0]).toUpperCase()}),d=z(()=>s.value.profile_image?"image":"text"),p=z(()=>oRe.getInstance().getItem("user.ws_user_role_id")),h=z(()=>({"--avatar-size":`${t.size}px`,"--avatar-bg":l.value,"--avatar-border":t.isMe?"var(--primary-color)":"#f3f5f8","--text-color":u.value,"--font-size":`${Math.floor(t.size/2)}px`,"--border-radius":t.borderRadius?typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius:"4px"})),g=()=>{r.value="",o.value=!0},{getCachedImage:v,setCachedImage:b}=xTa(),_=async()=>{if(i.value&&i.value.abort(),r.value.startsWith("blob:")&&URL.revokeObjectURL(r.value),!s.value.id||!s.value.profile_image){r.value="";return}i.value=new AbortController;const k=i.value;try{const E=await ITa({userId:s.value.id,avatarUrl:s.value.profile_image,cacheInterface:{getCachedImage:v,setCachedImage:b},onLoadingChange:I=>{k.signal.aborted||(a.value=I)}});if(!k.signal.aborted&&(r.value=E,E.length===0))throw console.warn("Loaded avatar image is empty, displaying initials instead."),g(),new Error("Empty image source")}catch(E){k.signal.aborted||(console.error("Failed to load avatar:",E),r.value="")}},{retry:C,errorRetry:S,isRetrying:y}=RTa(_,3,2e3),T=lt(()=>[s.value.id,s.value.profile_image],C,{immediate:!0});return $r(()=>{T(),i.value&&(i.value.abort(),i.value=null),r.value.startsWith("blob:")&&URL.revokeObjectURL(r.value),r.value="",a.value=!1}),(k,E)=>(L(),re("div",{class:ke([k.$style["avatar-wrapper"],{[k.$style.me]:n.value,[k.$style.loading]:a.value,[k.$style.disabled]:e.disabled,[k.$style.readOnly]:t.readOnly}]),style:Yt(h.value)},[a.value||F(y)?(L(),re("div",{key:0,class:ke(k.$style["skeleton-loader"])},null,2)):(L(),re($t,{key:1},[d.value==="text"||F(S)||o.value?(L(),re("div",{key:0,class:ke(k.$style["short-label"])},vt(c.value),3)):r.value.length>0||s.value.profile_image?(L(),re("img",{key:1,src:r.value||s.value.profile_image||"",alt:s.value.name||"Avatar",loading:"lazy"},null,8,qTa)):Ve("",!0)],64))],6))}}),YTa="_me_1dygt_18",JTa="_action_1dygt_40",ZTa="_loading_1dygt_58",XTa="_disabled_1dygt_61",QTa="_readOnly_1dygt_64",eDa={"avatar-wrapper":"_avatar-wrapper_1dygt_1",me:YTa,"short-label":"_short-label_1dygt_22",action:JTa,loading:ZTa,disabled:XTa,readOnly:QTa},tDa={$style:eDa},nDa=Tp(KTa,[["__cssModules",tDa]]),rDa=["404","ClickChart","ClickToCreate","NoAccess1","NoActivity","NoAssignedComment","NoAssignedScene","NoComment","NoData","NoData2","NoRendition1","NoRendition2","PrivateComment","PrivateScene","ReportAchievement","ReportCompletedScenes","ReportInvolvement","ReportMetric","ReportOverdueScenes","ReportProfessionalName","ReportSceneAssignment","ReportSceneStatus","ReportSceneStatusType","Successful1","Unsuccessful1","ConfirmDeletion","Waiting1","DefaultThumbnail","UploadReviewFile","ClickToSearch","NoDataSearchFilter"],aDa=["UploadInProgress"],Ese={},cA={},DLt=(e,t,n,r,a="base64")=>{const i=W(""),o=W(""),s=W(!0),l=z(()=>`${t}:${e.value.name}`),u=v=>new Promise((b,_)=>{const C=new FileReader;C.onload=()=>b(C.result),C.onerror=_,C.readAsDataURL(v)}),c=v=>`data:image/svg+xml;charset=utf-8,${encodeURIComponent(v)}`,d=async(v,b)=>{if(cA[b])return cA[b];if(b in Ese){const S=await Ese[b];return S&&(cA[b]=S),S}const _=await r(l.value);if(_&&typeof _=="string")return cA[b]=_,_;const C=(async()=>{try{const S=await fetch(v,{cache:"no-cache"});if(!S.ok)throw new Error("Failed to fetch visual");const y=S.headers.get("Content-Type")||"";let T;if(y.includes("svg")||y.includes("xml")){const k=await S.text();if(!k.trim())throw new Error("Empty SVG content");T=a==="svg"?k:c(k),cA[b]=T}else if(y.match(/image\/(jpeg|jpg|png|gif|webp)/)){const k=await S.blob();if(!k.size)throw new Error("Empty image blob");T=await u(k),cA[b]=T}else throw new Error(`Unsupported content type: ${y}`);return await n(l.value,T),T}catch(S){return console.error("Error fetching visual:",S),""}})();return Ese[b]=C,C.finally(()=>{delete Ese[b]}),await C},p=async v=>{s.value=!0;try{if(cA[l.value]){const T=cA[l.value];i.value=T,T.startsWith("data:image/svg+xml")?o.value=decodeURIComponent(T.split(",")[1]):(T.startsWith("<svg")||T.includes("<svg"))&&(o.value=T),s.value=!1;return}const b=oRe.getInstance().getItem("ASSET_URL")||"",_={icon:`${b}/icon/tess/TESSRAPP_Icon_${v}`,visual:`${b}/icon/visual/TESSRAPP_Visual_${v}`,ratting:`${b}/icon/tess/rating/TESSRAPP_Icon_${v}_Outline`,flag:`${b}/icon/flags/4x3/${v}`},C=rDa.includes(v)?"png":aDa.includes(v)?"gif":"svg",S=`${_[t]}.${C}`,y=await d(S,l.value);y&&(i.value=y,y.startsWith("data:image/svg+xml")?o.value=decodeURIComponent(y.split(",")[1]):(y.startsWith("<svg")||y.includes("<svg"))&&(o.value=y))}catch(b){console.error("Error fetching remote visual:",b)}finally{s.value=!1}},h=async()=>{i.value="",o.value="",e.value.name&&(s.value=!0,await p(e.value.name),s.value=!1)},g=z(()=>o.value?o.value:"");return lt(()=>e,()=>{h()},{deep:!0,immediate:!0}),{svgContent:g,url:i,loading:s}},iDa=["innerHTML","about"],oDa="IconCache",sDa="icons",lDa=ct({__name:"Icon",props:{src:{},source:{default:"remote"},size:{default:14},color:{default:"currentColor"}},setup(e){const t=e,n=d=>{if(typeof d=="number")return d;switch(d){case"small":return 14;case"medium":return 14;case"large":return 20;default:return typeof d=="string"?Number.parseInt(d,10):14}},r=z(()=>n(t.size));z(()=>({width:r.value+"px",height:r.value+"px",color:t.color}));const{getCachedValue:a,setCachedValue:i}=nRe({dbName:oDa,storeName:sDa}),o=async d=>{const p=await a(d);if(typeof p=="string")return p},s=async(d,p)=>{await i(d,p)},l=z(()=>t.source==="rating"?"ratting":"icon"),u=z(()=>({name:t.src,size:r.value,color:t.color||"currentColor"})),{svgContent:c}=DLt(u,l.value,s,o,"svg");return(d,p)=>(L(),re("div",{class:"icon-wrapper",style:Yt({"--icon-size":r.value+"px",color:t.color}),innerHTML:F(c),about:t.src,"data-icon":"true"},null,12,iDa))}}),Dp=Tp(lDa,[["__scopeId","data-v-54eccaa1"]]);var uDa=typeof global=="object"&&global&&global.Object===Object&&global,cDa=typeof self=="object"&&self&&self.Object===Object&&self,ALt=uDa||cDa||Function("return this")(),xse=ALt.Symbol,OLt=Object.prototype,dDa=OLt.hasOwnProperty,fDa=OLt.toString,K9=xse?xse.toStringTag:void 0;function hDa(e){var t=dDa.call(e,K9),n=e[K9];try{e[K9]=void 0;var r=!0}catch{}var a=fDa.call(e);return r&&(t?e[K9]=n:delete e[K9]),a}var pDa=Object.prototype,mDa=pDa.toString;function gDa(e){return mDa.call(e)}var vDa="[object Null]",yDa="[object Undefined]",ILt=xse?xse.toStringTag:void 0;function bDa(e){return e==null?e===void 0?yDa:vDa:ILt&&ILt in Object(e)?hDa(e):gDa(e)}function wDa(e){return e!=null&&typeof e=="object"}var _Da="[object Symbol]";function CDa(e){return typeof e=="symbol"||wDa(e)&&bDa(e)==_Da}var SDa=/\s/;function kDa(e){for(var t=e.length;t--&&SDa.test(e.charAt(t)););return t}var EDa=/^\s+/;function xDa(e){return e&&e.slice(0,kDa(e)+1).replace(EDa,"")}function sRe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var RLt=NaN,TDa=/^[-+]0x[0-9a-f]+$/i,DDa=/^0b[01]+$/i,ADa=/^0o[0-7]+$/i,ODa=parseInt;function $Lt(e){if(typeof e=="number")return e;if(CDa(e))return RLt;if(sRe(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=sRe(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=xDa(e);var n=DDa.test(e);return n||ADa.test(e)?ODa(e.slice(2),n?2:8):TDa.test(e)?RLt:+e}var lRe=function(){return ALt.Date.now()},IDa="Expected a function",RDa=Math.max,$Da=Math.min;function uRe(e,t,n){var r,a,i,o,s,l,u=0,c=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(IDa);t=$Lt(t)||0,sRe(n)&&(c=!!n.leading,d="maxWait"in n,i=d?RDa($Lt(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p);function h(k){var E=r,I=a;return r=a=void 0,u=k,o=e.apply(I,E),o}function g(k){return u=k,s=setTimeout(_,t),c?h(k):o}function v(k){var E=k-l,I=k-u,D=t-E;return d?$Da(D,i-I):D}function b(k){var E=k-l,I=k-u;return l===void 0||E>=t||E<0||d&&I>=i}function _(){var k=lRe();if(b(k))return C(k);s=setTimeout(_,v(k))}function C(k){return s=void 0,p&&r?h(k):(r=a=void 0,o)}function S(){s!==void 0&&clearTimeout(s),u=0,r=l=a=s=void 0}function y(){return s===void 0?o:C(lRe())}function T(){var k=lRe(),E=b(k);if(r=arguments,a=this,l=k,E){if(s===void 0)return g(l);if(d)return clearTimeout(s),s=setTimeout(_,t),h(l)}return s===void 0&&(s=setTimeout(_,t)),o}return T.cancel=S,T.flush=y,T}const cRe=(e,t)=>{const n=_a();return{apiServices:z(()=>{var r;const a=n==null?void 0:n.appContext.config.globalProperties,i=(r=t.params)==null?void 0:r.context;if(a!=null&&a.apiServices)return a.apiServices;if(e&&i!=null&&i.apiServices)return i.apiServices})}},PDa=e=>{const t=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return t?decodeURIComponent(t[2]):null};let YR=class extends Error{};class MDa extends YR{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class NDa extends YR{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class LDa extends YR{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Y3 extends YR{}class PLt extends YR{constructor(t){super(`Invalid unit ${t}`)}}class Ap extends YR{}let dA=class extends YR{constructor(){super("Zone is an abstract class")}};const Tr="numeric",T_="short",my="long",Tse={year:Tr,month:Tr,day:Tr},MLt={year:Tr,month:T_,day:Tr},FDa={year:Tr,month:T_,day:Tr,weekday:T_},NLt={year:Tr,month:my,day:Tr},LLt={year:Tr,month:my,day:Tr,weekday:my},FLt={hour:Tr,minute:Tr},BLt={hour:Tr,minute:Tr,second:Tr},VLt={hour:Tr,minute:Tr,second:Tr,timeZoneName:T_},ULt={hour:Tr,minute:Tr,second:Tr,timeZoneName:my},HLt={hour:Tr,minute:Tr,hourCycle:"h23"},jLt={hour:Tr,minute:Tr,second:Tr,hourCycle:"h23"},zLt={hour:Tr,minute:Tr,second:Tr,hourCycle:"h23",timeZoneName:T_},WLt={hour:Tr,minute:Tr,second:Tr,hourCycle:"h23",timeZoneName:my},GLt={year:Tr,month:Tr,day:Tr,hour:Tr,minute:Tr},qLt={year:Tr,month:Tr,day:Tr,hour:Tr,minute:Tr,second:Tr},KLt={year:Tr,month:T_,day:Tr,hour:Tr,minute:Tr},YLt={year:Tr,month:T_,day:Tr,hour:Tr,minute:Tr,second:Tr},BDa={year:Tr,month:T_,day:Tr,weekday:T_,hour:Tr,minute:Tr},JLt={year:Tr,month:my,day:Tr,hour:Tr,minute:Tr,timeZoneName:T_},ZLt={year:Tr,month:my,day:Tr,hour:Tr,minute:Tr,second:Tr,timeZoneName:T_},XLt={year:Tr,month:my,day:Tr,weekday:my,hour:Tr,minute:Tr,timeZoneName:my},QLt={year:Tr,month:my,day:Tr,weekday:my,hour:Tr,minute:Tr,second:Tr,timeZoneName:my};let Y9=class{get type(){throw new dA}get name(){throw new dA}get ianaName(){return this.name}get isUniversal(){throw new dA}offsetName(e,t){throw new dA}formatOffset(e,t){throw new dA}offset(e){throw new dA}equals(e){throw new dA}get isValid(){throw new dA}},dRe=null;class Dse extends Y9{static get instance(){return dRe===null&&(dRe=new Dse),dRe}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return EFt(t,n,r)}formatOffset(t,n){return X9(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const fRe=new Map;function VDa(e){let t=fRe.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),fRe.set(e,t)),t}const UDa={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function HDa(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,a,i,o,s,l,u,c]=r;return[o,a,i,s,l,u,c]}function jDa(e,t){const n=e.formatToParts(t),r=[];for(let a=0;a<n.length;a++){const{type:i,value:o}=n[a],s=UDa[i];i==="era"?r[s]=o:ci(s)||(r[s]=parseInt(o,10))}return r}const hRe=new Map;let J3=class XNe extends Y9{static create(t){let n=hRe.get(t);return n===void 0&&hRe.set(t,n=new XNe(t)),n}static resetCache(){hRe.clear(),fRe.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=XNe.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return EFt(t,n,r,this.name)}formatOffset(t,n){return X9(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=VDa(this.name);let[a,i,o,s,l,u,c]=r.formatToParts?jDa(r,n):HDa(r,n);s==="BC"&&(a=-Math.abs(a)+1);const d=Pse({year:a,month:i,day:o,hour:l===24?0:l,minute:u,second:c,millisecond:0});let p=+n;const h=p%1e3;return p-=h>=0?h:1e3+h,(d-p)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},eFt={};function zDa(e,t={}){const n=JSON.stringify([e,t]);let r=eFt[n];return r||(r=new Intl.ListFormat(e,t),eFt[n]=r),r}const pRe=new Map;function mRe(e,t={}){const n=JSON.stringify([e,t]);let r=pRe.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),pRe.set(n,r)),r}const gRe=new Map;function WDa(e,t={}){const n=JSON.stringify([e,t]);let r=gRe.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),gRe.set(n,r)),r}const vRe=new Map;function GDa(e,t={}){const{base:n,...r}=t,a=JSON.stringify([e,r]);let i=vRe.get(a);return i===void 0&&(i=new Intl.RelativeTimeFormat(e,t),vRe.set(a,i)),i}let Ase=null;function qDa(){return Ase||(Ase=new Intl.DateTimeFormat().resolvedOptions().locale,Ase)}const yRe=new Map;function tFt(e){let t=yRe.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),yRe.set(e,t)),t}const bRe=new Map;function KDa(e){let t=bRe.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...nFt,...t}),bRe.set(e,t)}return t}function YDa(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,a;try{r=mRe(e).resolvedOptions(),a=e}catch{const s=e.substring(0,n);r=mRe(s).resolvedOptions(),a=s}const{numberingSystem:i,calendar:o}=r;return[a,i,o]}}function JDa(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function ZDa(e){const t=[];for(let n=1;n<=12;n++){const r=Qr.utc(2009,n,1);t.push(e(r))}return t}function XDa(e){const t=[];for(let n=1;n<=7;n++){const r=Qr.utc(2016,11,13+n);t.push(e(r))}return t}function Ose(e,t,n,r){const a=e.listingMode();return a==="error"?null:a==="en"?n(t):r(t)}function QDa(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||tFt(e.locale).numberingSystem==="latn"}class eAa{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:a,floor:i,...o}=r;if(!n||Object.keys(o).length>0){const s={useGrouping:!1,...r};r.padTo>0&&(s.minimumIntegerDigits=r.padTo),this.inf=WDa(t,s)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):DRe(t,3);return Hd(n,this.padTo)}}}class tAa{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let a;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const o=-1*(t.offset/60),s=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&&J3.create(s).valid?(a=s,this.dt=t):(a="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,a=t.zone.name):(a="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const i={...this.opts};i.timeZone=i.timeZone||a,this.dtf=mRe(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class nAa{constructor(t,n,r){this.opts={style:"long",...r},!n&&_Ft()&&(this.rtf=GDa(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):kAa(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const nFt={firstDay:1,minimalDays:4,weekend:[6,7]};class Fs{static fromOpts(t){return Fs.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,a,i=!1){const o=t||Mc.defaultLocale,s=o||(i?"en-US":qDa()),l=n||Mc.defaultNumberingSystem,u=r||Mc.defaultOutputCalendar,c=xRe(a)||Mc.defaultWeekSettings;return new Fs(s,l,u,c,o)}static resetCache(){Ase=null,pRe.clear(),gRe.clear(),vRe.clear(),yRe.clear(),bRe.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:a}={}){return Fs.create(t,n,r,a)}constructor(t,n,r,a,i){const[o,s,l]=YDa(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||l||null,this.weekSettings=a,this.intl=JDa(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=QDa(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Fs.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,xRe(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Ose(this,t,DFt,()=>{const r=this.intl==="ja"||this.intl.startsWith("ja-");n&=!r;const a=n?{month:t,day:"numeric"}:{month:t},i=n?"format":"standalone";if(!this.monthsCache[i][t]){const o=r?s=>this.dtFormatter(s,a).format():s=>this.extract(s,a,"month");this.monthsCache[i][t]=ZDa(o)}return this.monthsCache[i][t]})}weekdays(t,n=!1){return Ose(this,t,IFt,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},a=n?"format":"standalone";return this.weekdaysCache[a][t]||(this.weekdaysCache[a][t]=XDa(i=>this.extract(i,r,"weekday"))),this.weekdaysCache[a][t]})}meridiems(){return Ose(this,void 0,()=>RFt,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Qr.utc(2016,11,13,9),Qr.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Ose(this,t,$Ft,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[Qr.utc(-40,1,1),Qr.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const a=this.dtFormatter(t,n),i=a.formatToParts(),o=i.find(s=>s.type.toLowerCase()===r);return o?o.value:null}numberFormatter(t={}){return new eAa(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new tAa(t,this.intl,n)}relFormatter(t={}){return new nAa(this.intl,this.isEnglish(),t)}listFormatter(t={}){return zDa(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||tFt(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:CFt()?KDa(this.locale):nFt}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let wRe=null,YC=class V7 extends Y9{static get utcInstance(){return wRe===null&&(wRe=new V7(0)),wRe}static instance(t){return t===0?V7.utcInstance:new V7(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new V7(Mse(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${X9(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${X9(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return X9(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};class rAa extends Y9{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function fA(e,t){if(ci(e)||e===null)return t;if(e instanceof Y9)return e;if(uAa(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Dse.instance:n==="utc"||n==="gmt"?YC.utcInstance:YC.parseSpecifier(n)||J3.create(e)}else return hA(e)?YC.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new rAa(e)}const _Re={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},rFt={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},aAa=_Re.hanidec.replace(/[\[|\]]/g,"").split("");function iAa(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(_Re.hanidec)!==-1)t+=aAa.indexOf(e[n]);else for(const a in rFt){const[i,o]=rFt[a];r>=i&&r<=o&&(t+=r-i)}}return parseInt(t,10)}else return t}const CRe=new Map;function oAa(){CRe.clear()}function D_({numberingSystem:e},t=""){const n=e||"latn";let r=CRe.get(n);r===void 0&&(r=new Map,CRe.set(n,r));let a=r.get(t);return a===void 0&&(a=new RegExp(`${_Re[n]}${t}`),r.set(t,a)),a}let aFt=()=>Date.now(),iFt="system",oFt=null,sFt=null,lFt=null,uFt=60,cFt,dFt=null;class Mc{static get now(){return aFt}static set now(t){aFt=t}static set defaultZone(t){iFt=t}static get defaultZone(){return fA(iFt,Dse.instance)}static get defaultLocale(){return oFt}static set defaultLocale(t){oFt=t}static get defaultNumberingSystem(){return sFt}static set defaultNumberingSystem(t){sFt=t}static get defaultOutputCalendar(){return lFt}static set defaultOutputCalendar(t){lFt=t}static get defaultWeekSettings(){return dFt}static set defaultWeekSettings(t){dFt=xRe(t)}static get twoDigitCutoffYear(){return uFt}static set twoDigitCutoffYear(t){uFt=t%100}static get throwOnInvalid(){return cFt}static set throwOnInvalid(t){cFt=t}static resetCaches(){Fs.resetCache(),J3.resetCache(),Qr.resetCache(),oAa()}}class A_{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const fFt=[0,31,59,90,120,151,181,212,243,273,304,334],hFt=[0,31,60,91,121,152,182,213,244,274,305,335];function E0(e,t){return new A_("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function SRe(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const a=r.getUTCDay();return a===0?7:a}function pFt(e,t,n){return n+(J9(e)?hFt:fFt)[t-1]}function mFt(e,t){const n=J9(e)?hFt:fFt,r=n.findIndex(i=>i<t),a=t-n[r];return{month:r+1,day:a}}function kRe(e,t){return(e-t+7)%7+1}function Ise(e,t=4,n=1){const{year:r,month:a,day:i}=e,o=pFt(r,a,i),s=kRe(SRe(r,a,i),n);let l=Math.floor((o-s+14-t)/7),u;return l<1?(u=r-1,l=Z9(u,t,n)):l>Z9(r,t,n)?(u=r+1,l=1):u=r,{weekYear:u,weekNumber:l,weekday:s,...Lse(e)}}function gFt(e,t=4,n=1){const{weekYear:r,weekNumber:a,weekday:i}=e,o=kRe(SRe(r,1,t),n),s=X3(r);let l=a*7+i-o-7+t,u;l<1?(u=r-1,l+=X3(u)):l>s?(u=r+1,l-=X3(r)):u=r;const{month:c,day:d}=mFt(u,l);return{year:u,month:c,day:d,...Lse(e)}}function ERe(e){const{year:t,month:n,day:r}=e,a=pFt(t,n,r);return{year:t,ordinal:a,...Lse(e)}}function vFt(e){const{year:t,ordinal:n}=e,{month:r,day:a}=mFt(t,n);return{year:t,month:r,day:a,...Lse(e)}}function yFt(e,t){if(!ci(e.localWeekday)||!ci(e.localWeekNumber)||!ci(e.localWeekYear)){if(!ci(e.weekday)||!ci(e.weekNumber)||!ci(e.weekYear))throw new Y3("Cannot mix locale-based week fields with ISO-based week fields");return ci(e.localWeekday)||(e.weekday=e.localWeekday),ci(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),ci(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function sAa(e,t=4,n=1){const r=Rse(e.weekYear),a=x0(e.weekNumber,1,Z9(e.weekYear,t,n)),i=x0(e.weekday,1,7);return r?a?i?!1:E0("weekday",e.weekday):E0("week",e.weekNumber):E0("weekYear",e.weekYear)}function lAa(e){const t=Rse(e.year),n=x0(e.ordinal,1,X3(e.year));return t?n?!1:E0("ordinal",e.ordinal):E0("year",e.year)}function bFt(e){const t=Rse(e.year),n=x0(e.month,1,12),r=x0(e.day,1,$se(e.year,e.month));return t?n?r?!1:E0("day",e.day):E0("month",e.month):E0("year",e.year)}function wFt(e){const{hour:t,minute:n,second:r,millisecond:a}=e,i=x0(t,0,23)||t===24&&n===0&&r===0&&a===0,o=x0(n,0,59),s=x0(r,0,59),l=x0(a,0,999);return i?o?s?l?!1:E0("millisecond",a):E0("second",r):E0("minute",n):E0("hour",t)}function ci(e){return typeof e>"u"}function hA(e){return typeof e=="number"}function Rse(e){return typeof e=="number"&&e%1===0}function uAa(e){return typeof e=="string"}function cAa(e){return Object.prototype.toString.call(e)==="[object Date]"}function _Ft(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function CFt(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function dAa(e){return Array.isArray(e)?e:[e]}function SFt(e,t,n){if(e.length!==0)return e.reduce((r,a)=>{const i=[t(a),a];return r&&n(r[0],i[0])===r[0]?r:i},null)[1]}function fAa(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Z3(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function xRe(e){if(e==null)return null;if(typeof e!="object")throw new Ap("Week settings must be an object");if(!x0(e.firstDay,1,7)||!x0(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!x0(t,1,7)))throw new Ap("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function x0(e,t,n){return Rse(e)&&e>=t&&e<=n}function hAa(e,t){return e-t*Math.floor(e/t)}function Hd(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function pA(e){if(!(ci(e)||e===null||e===""))return parseInt(e,10)}function JR(e){if(!(ci(e)||e===null||e===""))return parseFloat(e)}function TRe(e){if(!(ci(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function DRe(e,t,n="round"){const r=10**t;switch(n){case"expand":return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case"trunc":return Math.trunc(e*r)/r;case"round":return Math.round(e*r)/r;case"floor":return Math.floor(e*r)/r;case"ceil":return Math.ceil(e*r)/r;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function J9(e){return e%4===0&&(e%100!==0||e%400===0)}function X3(e){return J9(e)?366:365}function $se(e,t){const n=hAa(t-1,12)+1,r=e+(t-n)/12;return n===2?J9(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Pse(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function kFt(e,t,n){return-kRe(SRe(e,1,t),n)+t-1}function Z9(e,t=4,n=1){const r=kFt(e,t,n),a=kFt(e+1,t,n);return(X3(e)-r+a)/7}function ARe(e){return e>99?e:e>Mc.twoDigitCutoffYear?1900+e:2e3+e}function EFt(e,t,n,r=null){const a=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(i.timeZone=r);const o={timeZoneName:t,...i},s=new Intl.DateTimeFormat(n,o).formatToParts(a).find(l=>l.type.toLowerCase()==="timezonename");return s?s.value:null}function Mse(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,a=n<0||Object.is(n,-0)?-r:r;return n*60+a}function xFt(e){const t=Number(e);if(typeof e=="boolean"||e===""||!Number.isFinite(t))throw new Ap(`Invalid unit value ${e}`);return t}function Nse(e,t){const n={};for(const r in e)if(Z3(e,r)){const a=e[r];if(a==null)continue;n[t(r)]=xFt(a)}return n}function X9(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),a=e>=0?"+":"-";switch(t){case"short":return`${a}${Hd(n,2)}:${Hd(r,2)}`;case"narrow":return`${a}${n}${r>0?`:${r}`:""}`;case"techie":return`${a}${Hd(n,2)}${Hd(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Lse(e){return fAa(e,["hour","minute","second","millisecond"])}const pAa=["January","February","March","April","May","June","July","August","September","October","November","December"],TFt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],mAa=["J","F","M","A","M","J","J","A","S","O","N","D"];function DFt(e){switch(e){case"narrow":return[...mAa];case"short":return[...TFt];case"long":return[...pAa];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const AFt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],OFt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],gAa=["M","T","W","T","F","S","S"];function IFt(e){switch(e){case"narrow":return[...gAa];case"short":return[...OFt];case"long":return[...AFt];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const RFt=["AM","PM"],vAa=["Before Christ","Anno Domini"],yAa=["BC","AD"],bAa=["B","A"];function $Ft(e){switch(e){case"narrow":return[...bAa];case"short":return[...yAa];case"long":return[...vAa];default:return null}}function wAa(e){return RFt[e.hour<12?0:1]}function _Aa(e,t){return IFt(t)[e.weekday-1]}function CAa(e,t){return DFt(t)[e.month-1]}function SAa(e,t){return $Ft(t)[e.year<0?0:1]}function kAa(e,t,n="always",r=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&i){const d=e==="days";switch(t){case 1:return d?"tomorrow":`next ${a[e][0]}`;case-1:return d?"yesterday":`last ${a[e][0]}`;case 0:return d?"today":`this ${a[e][0]}`}}const o=Object.is(t,-0)||t<0,s=Math.abs(t),l=s===1,u=a[e],c=r?l?u[1]:u[2]||u[1]:l?a[e][0]:e;return o?`${s} ${c} ago`:`in ${s} ${c}`}function PFt(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const EAa={D:Tse,DD:MLt,DDD:NLt,DDDD:LLt,t:FLt,tt:BLt,ttt:VLt,tttt:ULt,T:HLt,TT:jLt,TTT:zLt,TTTT:WLt,f:GLt,ff:KLt,fff:JLt,ffff:XLt,F:qLt,FF:YLt,FFF:ZLt,FFFF:QLt};class Op{static create(t,n={}){return new Op(t,n)}static parseFormat(t){let n=null,r="",a=!1;const i=[];for(let o=0;o<t.length;o++){const s=t.charAt(o);s==="'"?((r.length>0||a)&&i.push({literal:a||/^\s+$/.test(r),val:r===""?"'":r}),n=null,r="",a=!a):a||s===n?r+=s:(r.length>0&&i.push({literal:/^\s+$/.test(r),val:r}),r=s,n=s)}return r.length>0&&i.push({literal:a||/^\s+$/.test(r),val:r}),i}static macroTokenToFormatOpts(t){return EAa[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0,r=void 0){if(this.opts.forceSimple)return Hd(t,n);const a={...this.opts};return n>0&&(a.padTo=n),r&&(a.signDisplay=r),this.loc.numberFormatter(a).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",a=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(h,g)=>this.loc.extract(t,h,g),o=h=>t.isOffsetFixed&&t.offset===0&&h.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,h.format):"",s=()=>r?wAa(t):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(h,g)=>r?CAa(t,h):i(g?{month:h}:{month:h,day:"numeric"},"month"),u=(h,g)=>r?_Aa(t,h):i(g?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),c=h=>{const g=Op.macroTokenToFormatOpts(h);return g?this.formatWithSystemDefault(t,g):h},d=h=>r?SAa(t,h):i({era:h},"era"),p=h=>{switch(h){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return s();case"d":return a?i({day:"numeric"},"day"):this.num(t.day);case"dd":return a?i({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return a?i({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return a?i({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return a?i({month:"numeric"},"month"):this.num(t.month);case"MM":return a?i({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return a?i({year:"numeric"},"year"):this.num(t.year);case"yy":return a?i({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return a?i({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return a?i({year:"numeric"},"year"):this.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(h)}};return PFt(Op.parseFormat(n),p)}formatDurationFromString(t,n){const r=this.opts.signMode==="negativeLargestOnly"?-1:1,a=c=>{switch(c[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},i=(c,d)=>p=>{const h=a(p);if(h){const g=d.isNegativeDuration&&h!==d.largestUnit?r:1;let v;return this.opts.signMode==="negativeLargestOnly"&&h!==d.largestUnit?v="never":this.opts.signMode==="all"?v="always":v="auto",this.num(c.get(h)*g,p.length,v)}else return p},o=Op.parseFormat(n),s=o.reduce((c,{literal:d,val:p})=>d?c:c.concat(p),[]),l=t.shiftTo(...s.map(a).filter(c=>c)),u={isNegativeDuration:l<0,largestUnit:Object.keys(l.values)[0]};return PFt(o,i(l,u))}}const MFt=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Q3(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function eV(...e){return t=>e.reduce(([n,r,a],i)=>{const[o,s,l]=i(t,a);return[{...n,...o},s||r,l]},[{},null,1]).slice(0,2)}function tV(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const a=n.exec(e);if(a)return r(a)}return[null,null]}function NFt(...e){return(t,n)=>{const r={};let a;for(a=0;a<e.length;a++)r[e[a]]=pA(t[n+a]);return[r,null,n+a]}}const LFt=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,xAa=`(?:${LFt.source}?(?:\\[(${MFt.source})\\])?)?`,ORe=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,FFt=RegExp(`${ORe.source}${xAa}`),IRe=RegExp(`(?:[Tt]${FFt.source})?`),TAa=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,DAa=/(\d{4})-?W(\d\d)(?:-?(\d))?/,AAa=/(\d{4})-?(\d{3})/,OAa=NFt("weekYear","weekNumber","weekDay"),IAa=NFt("year","ordinal"),RAa=/(\d{4})-(\d\d)-(\d\d)/,BFt=RegExp(`${ORe.source} ?(?:${LFt.source}|(${MFt.source}))?`),$Aa=RegExp(`(?: ${BFt.source})?`);function nV(e,t,n){const r=e[t];return ci(r)?n:pA(r)}function PAa(e,t){return[{year:nV(e,t),month:nV(e,t+1,1),day:nV(e,t+2,1)},null,t+3]}function rV(e,t){return[{hours:nV(e,t,0),minutes:nV(e,t+1,0),seconds:nV(e,t+2,0),milliseconds:TRe(e[t+3])},null,t+4]}function Q9(e,t){const n=!e[t]&&!e[t+1],r=Mse(e[t+1],e[t+2]),a=n?null:YC.instance(r);return[{},a,t+3]}function eG(e,t){const n=e[t]?J3.create(e[t]):null;return[{},n,t+1]}const MAa=RegExp(`^T?${ORe.source}$`),NAa=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function LAa(e){const[t,n,r,a,i,o,s,l,u]=e,c=t[0]==="-",d=l&&l[0]==="-",p=(h,g=!1)=>h!==void 0&&(g||h&&c)?-h:h;return[{years:p(JR(n)),months:p(JR(r)),weeks:p(JR(a)),days:p(JR(i)),hours:p(JR(o)),minutes:p(JR(s)),seconds:p(JR(l),l==="-0"),milliseconds:p(TRe(u),d)}]}const FAa={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function RRe(e,t,n,r,a,i,o){const s={year:t.length===2?ARe(pA(t)):pA(t),month:TFt.indexOf(n)+1,day:pA(r),hour:pA(a),minute:pA(i)};return o&&(s.second=pA(o)),e&&(s.weekday=e.length>3?AFt.indexOf(e)+1:OFt.indexOf(e)+1),s}const BAa=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function VAa(e){const[,t,n,r,a,i,o,s,l,u,c,d]=e,p=RRe(t,a,r,n,i,o,s);let h;return l?h=FAa[l]:u?h=0:h=Mse(c,d),[p,new YC(h)]}function UAa(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const HAa=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,jAa=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,zAa=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function VFt(e){const[,t,n,r,a,i,o,s]=e;return[RRe(t,a,r,n,i,o,s),YC.utcInstance]}function WAa(e){const[,t,n,r,a,i,o,s]=e;return[RRe(t,s,n,r,a,i,o),YC.utcInstance]}const GAa=Q3(TAa,IRe),qAa=Q3(DAa,IRe),KAa=Q3(AAa,IRe),YAa=Q3(FFt),UFt=eV(PAa,rV,Q9,eG),JAa=eV(OAa,rV,Q9,eG),ZAa=eV(IAa,rV,Q9,eG),XAa=eV(rV,Q9,eG);function QAa(e){return tV(e,[GAa,UFt],[qAa,JAa],[KAa,ZAa],[YAa,XAa])}function eOa(e){return tV(UAa(e),[BAa,VAa])}function tOa(e){return tV(e,[HAa,VFt],[jAa,VFt],[zAa,WAa])}function nOa(e){return tV(e,[NAa,LAa])}const rOa=eV(rV);function aOa(e){return tV(e,[MAa,rOa])}const iOa=Q3(RAa,$Aa),oOa=Q3(BFt),sOa=eV(rV,Q9,eG);function lOa(e){return tV(e,[iOa,UFt],[oOa,sOa])}const HFt="Invalid Duration",jFt={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},uOa={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...jFt},T0=146097/400,aV=146097/4800,cOa={years:{quarters:4,months:12,weeks:T0/7,days:T0,hours:T0*24,minutes:T0*24*60,seconds:T0*24*60*60,milliseconds:T0*24*60*60*1e3},quarters:{months:3,weeks:T0/28,days:T0/4,hours:T0*24/4,minutes:T0*24*60/4,seconds:T0*24*60*60/4,milliseconds:T0*24*60*60*1e3/4},months:{weeks:aV/7,days:aV,hours:aV*24,minutes:aV*24*60,seconds:aV*24*60*60,milliseconds:aV*24*60*60*1e3},...jFt},ZR=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],dOa=ZR.slice(0).reverse();function $E(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Zo(r)}function zFt(e,t){let n=t.milliseconds??0;for(const r of dOa.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function WFt(e,t){const n=zFt(e,t)<0?-1:1;ZR.reduceRight((r,a)=>{if(ci(t[a]))return r;if(r){const i=t[r]*n,o=e[a][r],s=Math.floor(i/o);t[a]+=s*n,t[r]-=s*o*n}return a},null),ZR.reduce((r,a)=>{if(ci(t[a]))return r;if(r){const i=t[r]%1;t[r]-=i,t[a]+=i*e[r][a]}return a},null)}function GFt(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class Zo{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?cOa:uOa;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||Fs.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return Zo.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new Ap(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Zo({values:Nse(t,Zo.normalizeUnit),loc:Fs.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(hA(t))return Zo.fromMillis(t);if(Zo.isDuration(t))return t;if(typeof t=="object")return Zo.fromObject(t);throw new Ap(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=nOa(t);return r?Zo.fromObject(r,n):Zo.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=aOa(t);return r?Zo.fromObject(r,n):Zo.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new Ap("need to specify a reason the Duration is invalid");const r=t instanceof A_?t:new A_(t,n);if(Mc.throwOnInvalid)throw new LDa(r);return new Zo({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new PLt(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Op.create(this.loc,r).formatDurationFromString(this,t):HFt}toHuman(t={}){if(!this.isValid)return HFt;const n=t.showZeros!==!1,r=ZR.map(a=>{const i=this.values[a];return ci(i)||i===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:a.slice(0,-1)}).format(i)}).filter(a=>a);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=DRe(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},Qr.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?zFt(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Zo.fromDurationLike(t),r={};for(const a of ZR)(Z3(n.values,a)||Z3(this.values,a))&&(r[a]=n.get(a)+this.get(a));return $E(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Zo.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=xFt(t(this.values[r],r));return $E(this,{values:n},!0)}get(t){return this[Zo.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...Nse(t,Zo.normalizeUnit)};return $E(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:a}={}){const i={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:a,conversionAccuracy:r};return $E(this,i)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return WFt(this.matrix,t),$E(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=GFt(this.normalize().shiftToAll().toObject());return $E(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>Zo.normalizeUnit(o));const n={},r={},a=this.toObject();let i;for(const o of ZR)if(t.indexOf(o)>=0){i=o;let s=0;for(const u in r)s+=this.matrix[u][o]*r[u],r[u]=0;hA(a[o])&&(s+=a[o]);const l=Math.trunc(s);n[o]=l,r[o]=(s*1e3-l*1e3)/1e3}else hA(a[o])&&(r[o]=a[o]);for(const o in r)r[o]!==0&&(n[i]+=o===i?r[o]:r[o]/this.matrix[i][o]);return WFt(this.matrix,n),$E(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return $E(this,{values:t},!0)}removeZeros(){if(!this.isValid)return this;const t=GFt(this.values);return $E(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,a){return r===void 0||r===0?a===void 0||a===0:r===a}for(const r of ZR)if(!n(this.values[r],t.values[r]))return!1;return!0}}const iV="Invalid Interval";function fOa(e,t){return!e||!e.isValid?Nc.invalid("missing or invalid start"):!t||!t.isValid?Nc.invalid("missing or invalid end"):t<e?Nc.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Nc{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new Ap("need to specify a reason the Interval is invalid");const r=t instanceof A_?t:new A_(t,n);if(Mc.throwOnInvalid)throw new NDa(r);return new Nc({invalid:r})}static fromDateTimes(t,n){const r=rG(t),a=rG(n);return fOa(r,a)??new Nc({start:r,end:a})}static after(t,n){const r=Zo.fromDurationLike(n),a=rG(t);return Nc.fromDateTimes(a,a.plus(r))}static before(t,n){const r=Zo.fromDurationLike(n),a=rG(t);return Nc.fromDateTimes(a.minus(r),a)}static fromISO(t,n){const[r,a]=(t||"").split("/",2);if(r&&a){let i,o;try{i=Qr.fromISO(r,n),o=i.isValid}catch{o=!1}let s,l;try{s=Qr.fromISO(a,n),l=s.isValid}catch{l=!1}if(o&&l)return Nc.fromDateTimes(i,s);if(o){const u=Zo.fromISO(a,n);if(u.isValid)return Nc.after(i,u)}else if(l){const u=Zo.fromISO(r,n);if(u.isValid)return Nc.before(s,u)}}return Nc.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(t,n);let a;return n!=null&&n.useLocaleWeeks?a=this.end.reconfigure({locale:r.locale}):a=this.end,a=a.startOf(t,n),Math.floor(a.diff(r,t).get(t))+(a.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Nc.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(rG).filter(o=>this.contains(o)).sort((o,s)=>o.toMillis()-s.toMillis()),r=[];let{s:a}=this,i=0;for(;a<this.e;){const o=n[i]||this.e,s=+o>+this.e?this.e:o;r.push(Nc.fromDateTimes(a,s)),a=s,i+=1}return r}splitBy(t){const n=Zo.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,a=1,i;const o=[];for(;r<this.e;){const s=this.start.plus(n.mapUnits(l=>l*a));i=+s>+this.e?this.e:s,o.push(Nc.fromDateTimes(r,i)),r=i,a+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:Nc.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return Nc.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((a,i)=>a.s-i.s).reduce(([a,i],o)=>i?i.overlaps(o)||i.abutsStart(o)?[a,i.union(o)]:[a.concat([i]),o]:[a,o],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const a=[],i=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...i),s=o.sort((l,u)=>l.time-u.time);for(const l of s)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&a.push(Nc.fromDateTimes(n,l.time)),n=null);return Nc.merge(a)}difference(...t){return Nc.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:iV}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=Tse,n={}){return this.isValid?Op.create(this.s.loc.clone(n),t).formatInterval(this):iV}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:iV}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:iV}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:iV}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:iV}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Zo.invalid(this.invalidReason)}mapEndpoints(t){return Nc.fromDateTimes(t(this.s),t(this.e))}}class oV{static hasDST(t=Mc.defaultZone){const n=Qr.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return J3.isValidZone(t)}static normalizeZone(t){return fA(t,Mc.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||Fs.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||Fs.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||Fs.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:i="gregory"}={}){return(a||Fs.create(n,r,i)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:i="gregory"}={}){return(a||Fs.create(n,r,i)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||Fs.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||Fs.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Fs.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return Fs.create(n,null,"gregory").eras(t)}static features(){return{relative:_Ft(),localeWeek:CFt()}}}function qFt(e,t){const n=a=>a.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Zo.fromMillis(r).as("days"))}function hOa(e,t,n){const r=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{const c=qFt(l,u);return(c-c%7)/7}],["days",qFt]],a={},i=e;let o,s;for(const[l,u]of r)n.indexOf(l)>=0&&(o=l,a[l]=u(e,t),s=i.plus(a),s>t?(a[l]--,e=i.plus(a),e>t&&(s=e,a[l]--,e=i.plus(a))):e=s);return[e,a,s,o]}function pOa(e,t,n,r){let[a,i,o,s]=hOa(e,t,n);const l=t-a,u=n.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(o<t&&(o=a.plus({[s]:1})),o!==a&&(i[s]=(i[s]||0)+l/(o-a)));const c=Zo.fromObject(i,r);return u.length>0?Zo.fromMillis(l,r).shiftTo(...u).plus(c):c}const mOa="missing Intl.DateTimeFormat.formatToParts support";function Is(e,t=n=>n){return{regex:e,deser:([n])=>t(iAa(n))}}const gOa=" ",KFt=`[ ${gOa}]`,YFt=new RegExp(KFt,"g");function vOa(e){return e.replace(/\./g,"\\.?").replace(YFt,KFt)}function JFt(e){return e.replace(/\./g,"").replace(YFt," ").toLowerCase()}function O_(e,t){return e===null?null:{regex:RegExp(e.map(vOa).join("|")),deser:([n])=>e.findIndex(r=>JFt(n)===JFt(r))+t}}function ZFt(e,t){return{regex:e,deser:([,n,r])=>Mse(n,r),groups:t}}function Fse(e){return{regex:e,deser:([t])=>t}}function yOa(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function bOa(e,t){const n=D_(t),r=D_(t,"{2}"),a=D_(t,"{3}"),i=D_(t,"{4}"),o=D_(t,"{6}"),s=D_(t,"{1,2}"),l=D_(t,"{1,3}"),u=D_(t,"{1,6}"),c=D_(t,"{1,9}"),d=D_(t,"{2,4}"),p=D_(t,"{4,6}"),h=v=>({regex:RegExp(yOa(v.val)),deser:([b])=>b,literal:!0}),g=(v=>{if(e.literal)return h(v);switch(v.val){case"G":return O_(t.eras("short"),0);case"GG":return O_(t.eras("long"),0);case"y":return Is(u);case"yy":return Is(d,ARe);case"yyyy":return Is(i);case"yyyyy":return Is(p);case"yyyyyy":return Is(o);case"M":return Is(s);case"MM":return Is(r);case"MMM":return O_(t.months("short",!0),1);case"MMMM":return O_(t.months("long",!0),1);case"L":return Is(s);case"LL":return Is(r);case"LLL":return O_(t.months("short",!1),1);case"LLLL":return O_(t.months("long",!1),1);case"d":return Is(s);case"dd":return Is(r);case"o":return Is(l);case"ooo":return Is(a);case"HH":return Is(r);case"H":return Is(s);case"hh":return Is(r);case"h":return Is(s);case"mm":return Is(r);case"m":return Is(s);case"q":return Is(s);case"qq":return Is(r);case"s":return Is(s);case"ss":return Is(r);case"S":return Is(l);case"SSS":return Is(a);case"u":return Fse(c);case"uu":return Fse(s);case"uuu":return Is(n);case"a":return O_(t.meridiems(),0);case"kkkk":return Is(i);case"kk":return Is(d,ARe);case"W":return Is(s);case"WW":return Is(r);case"E":case"c":return Is(n);case"EEE":return O_(t.weekdays("short",!1),1);case"EEEE":return O_(t.weekdays("long",!1),1);case"ccc":return O_(t.weekdays("short",!0),1);case"cccc":return O_(t.weekdays("long",!0),1);case"Z":case"ZZ":return ZFt(new RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case"ZZZ":return ZFt(new RegExp(`([+-]${s.source})(${r.source})?`),2);case"z":return Fse(/[a-z_+-/]{1,256}?/i);case" ":return Fse(/[^\S\n\r]/);default:return h(v)}})(e)||{invalidReason:mOa};return g.token=e,g}const wOa={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function _Oa(e,t,n){const{type:r,value:a}=e;if(r==="literal"){const l=/^\s+$/.test(a);return{literal:!l,val:l?" ":a}}const i=t[r];let o=r;r==="hour"&&(t.hour12!=null?o=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?o="hour12":o="hour24":o=n.hour12?"hour12":"hour24");let s=wOa[o];if(typeof s=="object"&&(s=s[i]),s)return{literal:!1,val:s}}function COa(e){return[`^${e.map(t=>t.regex).reduce((t,n)=>`${t}(${n.source})`,"")}$`,e]}function SOa(e,t,n){const r=e.match(t);if(r){const a={};let i=1;for(const o in n)if(Z3(n,o)){const s=n[o],l=s.groups?s.groups+1:1;!s.literal&&s.token&&(a[s.token.val[0]]=s.deser(r.slice(i,i+l))),i+=l}return[r,a]}else return[r,{}]}function kOa(e){const t=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return ci(e.z)||(n=J3.create(e.z)),ci(e.Z)||(n||(n=new YC(e.Z)),r=e.Z),ci(e.q)||(e.M=(e.q-1)*3+1),ci(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),ci(e.u)||(e.S=TRe(e.u)),[Object.keys(e).reduce((a,i)=>{const o=t(i);return o&&(a[o]=e[i]),a},{}),n,r]}let $Re=null;function EOa(){return $Re||($Re=Qr.fromMillis(1555555555555)),$Re}function xOa(e,t){if(e.literal)return e;const n=Op.macroTokenToFormatOpts(e.val),r=tBt(n,t);return r==null||r.includes(void 0)?e:r}function XFt(e,t){return Array.prototype.concat(...e.map(n=>xOa(n,t)))}class QFt{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=XFt(Op.parseFormat(n),t),this.units=this.tokens.map(r=>bOa(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,a]=COa(this.units);this.regex=RegExp(r,"i"),this.handlers=a}}explainFromTokens(t){if(this.isValid){const[n,r]=SOa(t,this.regex,this.handlers),[a,i,o]=r?kOa(r):[null,null,void 0];if(Z3(r,"a")&&Z3(r,"H"))throw new Y3("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:a,zone:i,specificOffset:o}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function eBt(e,t,n){return new QFt(e,n).explainFromTokens(t)}function TOa(e,t,n){const{result:r,zone:a,specificOffset:i,invalidReason:o}=eBt(e,t,n);return[r,a,i,o]}function tBt(e,t){if(!e)return null;const n=Op.create(t,e).dtFormatter(EOa()),r=n.formatToParts(),a=n.resolvedOptions();return r.map(i=>_Oa(i,e,a))}const PRe="Invalid DateTime",nBt=864e13;function tG(e){return new A_("unsupported zone",`the zone "${e.name}" is not supported`)}function MRe(e){return e.weekData===null&&(e.weekData=Ise(e.c)),e.weekData}function NRe(e){return e.localWeekData===null&&(e.localWeekData=Ise(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function XR(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Qr({...n,...t,old:n})}function rBt(e,t,n){let r=e-t*60*1e3;const a=n.offset(r);if(t===a)return[r,t];r-=(a-t)*60*1e3;const i=n.offset(r);return a===i?[r,a]:[e-Math.min(a,i)*60*1e3,Math.max(a,i)]}function Bse(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Vse(e,t,n){return rBt(Pse(e),t,n)}function aBt(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),a=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,i={...e.c,year:r,month:a,day:Math.min(e.c.day,$se(r,a))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=Zo.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=Pse(i);let[l,u]=rBt(s,n,e.zone);return o!==0&&(l+=o,u=e.zone.offset(l)),{ts:l,o:u}}function sV(e,t,n,r,a,i){const{setZone:o,zone:s}=n;if(e&&Object.keys(e).length!==0||t){const l=t||s,u=Qr.fromObject(e,{...n,zone:l,specificOffset:i});return o?u:u.setZone(s)}else return Qr.invalid(new A_("unparsable",`the input "${a}" can't be parsed as ${r}`))}function Use(e,t,n=!0){return e.isValid?Op.create(Fs.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function LRe(e,t,n){const r=e.c.year>9999||e.c.year<0;let a="";if(r&&e.c.year>=0&&(a+="+"),a+=Hd(e.c.year,r?6:4),n==="year")return a;if(t){if(a+="-",a+=Hd(e.c.month),n==="month")return a;a+="-"}else if(a+=Hd(e.c.month),n==="month")return a;return a+=Hd(e.c.day),a}function iBt(e,t,n,r,a,i,o){let s=!n||e.c.millisecond!==0||e.c.second!==0,l="";switch(o){case"day":case"month":case"year":break;default:if(l+=Hd(e.c.hour),o==="hour")break;if(t){if(l+=":",l+=Hd(e.c.minute),o==="minute")break;s&&(l+=":",l+=Hd(e.c.second))}else{if(l+=Hd(e.c.minute),o==="minute")break;s&&(l+=Hd(e.c.second))}if(o==="second")break;s&&(!r||e.c.millisecond!==0)&&(l+=".",l+=Hd(e.c.millisecond,3))}return a&&(e.isOffsetFixed&&e.offset===0&&!i?l+="Z":e.o<0?(l+="-",l+=Hd(Math.trunc(-e.o/60)),l+=":",l+=Hd(Math.trunc(-e.o%60))):(l+="+",l+=Hd(Math.trunc(e.o/60)),l+=":",l+=Hd(Math.trunc(e.o%60)))),i&&(l+="["+e.zone.ianaName+"]"),l}const oBt={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},DOa={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},AOa={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Hse=["year","month","day","hour","minute","second","millisecond"],OOa=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],IOa=["year","ordinal","hour","minute","second","millisecond"];function jse(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new PLt(e);return t}function sBt(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return jse(e)}}function ROa(e){if(nG===void 0&&(nG=Mc.now()),e.type!=="iana")return e.offset(nG);const t=e.name;let n=FRe.get(t);return n===void 0&&(n=e.offset(nG),FRe.set(t,n)),n}function lBt(e,t){const n=fA(t.zone,Mc.defaultZone);if(!n.isValid)return Qr.invalid(tG(n));const r=Fs.fromObject(t);let a,i;if(ci(e.year))a=Mc.now();else{for(const l of Hse)ci(e[l])&&(e[l]=oBt[l]);const o=bFt(e)||wFt(e);if(o)return Qr.invalid(o);const s=ROa(n);[a,i]=Vse(e,s,n)}return new Qr({ts:a,zone:n,loc:r,o:i})}function uBt(e,t,n){const r=ci(n.round)?!0:n.round,a=ci(n.rounding)?"trunc":n.rounding,i=(s,l)=>(s=DRe(s,r||n.calendary?0:2,n.calendary?"round":a),t.loc.clone(n).relFormatter(n).format(s,l)),o=s=>n.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(n.unit)return i(o(n.unit),n.unit);for(const s of n.units){const l=o(s);if(Math.abs(l)>=1)return i(l,s)}return i(e>t?-0:0,n.units[n.units.length-1])}function cBt(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let nG;const FRe=new Map;class Qr{constructor(t){const n=t.zone||Mc.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new A_("invalid input"):null)||(n.isValid?null:tG(n));this.ts=ci(t.ts)?Mc.now():t.ts;let a=null,i=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[a,i]=[t.old.c,t.old.o];else{const o=hA(t.o)&&!t.old?t.o:n.offset(this.ts);a=Bse(this.ts,o),r=Number.isNaN(a.year)?new A_("invalid input"):null,a=r?null:a,i=r?null:o}this._zone=n,this.loc=t.loc||Fs.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=a,this.o=i,this.isLuxonDateTime=!0}static now(){return new Qr({})}static local(){const[t,n]=cBt(arguments),[r,a,i,o,s,l,u]=n;return lBt({year:r,month:a,day:i,hour:o,minute:s,second:l,millisecond:u},t)}static utc(){const[t,n]=cBt(arguments),[r,a,i,o,s,l,u]=n;return t.zone=YC.utcInstance,lBt({year:r,month:a,day:i,hour:o,minute:s,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const r=cAa(t)?t.valueOf():NaN;if(Number.isNaN(r))return Qr.invalid("invalid input");const a=fA(n.zone,Mc.defaultZone);return a.isValid?new Qr({ts:r,zone:a,loc:Fs.fromObject(n)}):Qr.invalid(tG(a))}static fromMillis(t,n={}){if(hA(t))return t<-nBt||t>nBt?Qr.invalid("Timestamp out of range"):new Qr({ts:t,zone:fA(n.zone,Mc.defaultZone),loc:Fs.fromObject(n)});throw new Ap(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(hA(t))return new Qr({ts:t*1e3,zone:fA(n.zone,Mc.defaultZone),loc:Fs.fromObject(n)});throw new Ap("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=fA(n.zone,Mc.defaultZone);if(!r.isValid)return Qr.invalid(tG(r));const a=Fs.fromObject(n),i=Nse(t,sBt),{minDaysInFirstWeek:o,startOfWeek:s}=yFt(i,a),l=Mc.now(),u=ci(n.specificOffset)?r.offset(l):n.specificOffset,c=!ci(i.ordinal),d=!ci(i.year),p=!ci(i.month)||!ci(i.day),h=d||p,g=i.weekYear||i.weekNumber;if((h||c)&&g)throw new Y3("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&c)throw new Y3("Can't mix ordinal dates with month/day");const v=g||i.weekday&&!h;let b,_,C=Bse(l,u);v?(b=OOa,_=DOa,C=Ise(C,o,s)):c?(b=IOa,_=AOa,C=ERe(C)):(b=Hse,_=oBt);let S=!1;for(const A of b){const R=i[A];ci(R)?S?i[A]=_[A]:i[A]=C[A]:S=!0}const y=v?sAa(i,o,s):c?lAa(i):bFt(i),T=y||wFt(i);if(T)return Qr.invalid(T);const k=v?gFt(i,o,s):c?vFt(i):i,[E,I]=Vse(k,u,r),D=new Qr({ts:E,zone:r,o:I,loc:a});return i.weekday&&h&&t.weekday!==D.weekday?Qr.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${D.toISO()}`):D.isValid?D:Qr.invalid(D.invalid)}static fromISO(t,n={}){const[r,a]=QAa(t);return sV(r,a,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,a]=eOa(t);return sV(r,a,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,a]=tOa(t);return sV(r,a,n,"HTTP",n)}static fromFormat(t,n,r={}){if(ci(t)||ci(n))throw new Ap("fromFormat requires an input string and a format");const{locale:a=null,numberingSystem:i=null}=r,o=Fs.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0}),[s,l,u,c]=TOa(o,t,n);return c?Qr.invalid(c):sV(s,l,r,`format ${n}`,t,u)}static fromString(t,n,r={}){return Qr.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,a]=lOa(t);return sV(r,a,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new Ap("need to specify a reason the DateTime is invalid");const r=t instanceof A_?t:new A_(t,n);if(Mc.throwOnInvalid)throw new MDa(r);return new Qr({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=tBt(t,Fs.fromObject(n));return r?r.map(a=>a?a.val:null).join(""):null}static expandFormat(t,n={}){return XFt(Op.parseFormat(t),Fs.fromObject(n)).map(r=>r.val).join("")}static resetCache(){nG=void 0,FRe.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?MRe(this).weekYear:NaN}get weekNumber(){return this.isValid?MRe(this).weekNumber:NaN}get weekday(){return this.isValid?MRe(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?NRe(this).weekday:NaN}get localWeekNumber(){return this.isValid?NRe(this).weekNumber:NaN}get localWeekYear(){return this.isValid?NRe(this).weekYear:NaN}get ordinal(){return this.isValid?ERe(this.c).ordinal:NaN}get monthShort(){return this.isValid?oV.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?oV.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?oV.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?oV.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,r=Pse(this.c),a=this.zone.offset(r-t),i=this.zone.offset(r+t),o=this.zone.offset(r-a*n),s=this.zone.offset(r-i*n);if(o===s)return[this];const l=r-o*n,u=r-s*n,c=Bse(l,o),d=Bse(u,s);return c.hour===d.hour&&c.minute===d.minute&&c.second===d.second&&c.millisecond===d.millisecond?[XR(this,{ts:l}),XR(this,{ts:u})]:[this]}get isInLeapYear(){return J9(this.year)}get daysInMonth(){return $se(this.year,this.month)}get daysInYear(){return this.isValid?X3(this.year):NaN}get weeksInWeekYear(){return this.isValid?Z9(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Z9(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:a}=Op.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:a}}toUTC(t=0,n={}){return this.setZone(YC.instance(t),n)}toLocal(){return this.setZone(Mc.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=fA(t,Mc.defaultZone),t.equals(this.zone))return this;if(t.isValid){let a=this.ts;if(n||r){const i=t.offset(this.ts),o=this.toObject();[a]=Vse(o,i,t)}return XR(this,{ts:a,zone:t})}else return Qr.invalid(tG(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const a=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return XR(this,{loc:a})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=Nse(t,sBt),{minDaysInFirstWeek:r,startOfWeek:a}=yFt(n,this.loc),i=!ci(n.weekYear)||!ci(n.weekNumber)||!ci(n.weekday),o=!ci(n.ordinal),s=!ci(n.year),l=!ci(n.month)||!ci(n.day),u=s||l,c=n.weekYear||n.weekNumber;if((u||o)&&c)throw new Y3("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new Y3("Can't mix ordinal dates with month/day");let d;i?d=gFt({...Ise(this.c,r,a),...n},r,a):ci(n.ordinal)?(d={...this.toObject(),...n},ci(n.day)&&(d.day=Math.min($se(d.year,d.month),d.day))):d=vFt({...ERe(this.c),...n});const[p,h]=Vse(d,this.o,this.zone);return XR(this,{ts:p,o:h})}plus(t){if(!this.isValid)return this;const n=Zo.fromDurationLike(t);return XR(this,aBt(this,n))}minus(t){if(!this.isValid)return this;const n=Zo.fromDurationLike(t).negate();return XR(this,aBt(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},a=Zo.normalizeUnit(t);switch(a){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(a==="weeks")if(n){const i=this.loc.getStartOfWeek(),{weekday:o}=this;o<i&&(r.weekNumber=this.weekNumber-1),r.weekday=i}else r.weekday=1;if(a==="quarters"){const i=Math.ceil(this.month/3);r.month=(i-1)*3+1}return this.set(r)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?Op.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):PRe}toLocaleString(t=Tse,n={}){return this.isValid?Op.create(this.loc.clone(n),t).formatDateTime(this):PRe}toLocaleParts(t={}){return this.isValid?Op.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:a=!0,extendedZone:i=!1,precision:o="milliseconds"}={}){if(!this.isValid)return null;o=jse(o);const s=t==="extended";let l=LRe(this,s,o);return Hse.indexOf(o)>=3&&(l+="T"),l+=iBt(this,s,n,r,a,i,o),l}toISODate({format:t="extended",precision:n="day"}={}){return this.isValid?LRe(this,t==="extended",jse(n)):null}toISOWeekDate(){return Use(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:a=!1,extendedZone:i=!1,format:o="extended",precision:s="milliseconds"}={}){return this.isValid?(s=jse(s),(a&&Hse.indexOf(s)>=3?"T":"")+iBt(this,o==="extended",n,t,r,i,s)):null}toRFC2822(){return Use(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Use(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?LRe(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let a="HH:mm:ss.SSS";return(n||t)&&(r&&(a+=" "),n?a+="z":t&&(a+="ZZ")),Use(this,a,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():PRe}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Zo.invalid("created by diffing an invalid DateTime");const a={locale:this.locale,numberingSystem:this.numberingSystem,...r},i=dAa(n).map(Zo.normalizeUnit),o=t.valueOf()>this.valueOf(),s=o?this:t,l=o?t:this,u=pOa(s,l,i,a);return o?u.negate():u}diffNow(t="milliseconds",n={}){return this.diff(Qr.now(),t,n)}until(t){return this.isValid?Nc.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const a=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n,r)<=a&&a<=i.endOf(n,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||Qr.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let a=["years","months","days","hours","minutes","seconds"],i=t.unit;return Array.isArray(t.unit)&&(a=t.unit,i=void 0),uBt(n,this.plus(r),{...t,numeric:"always",units:a,unit:i})}toRelativeCalendar(t={}){return this.isValid?uBt(t.base||Qr.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(Qr.isDateTime))throw new Ap("min requires all arguments be DateTimes");return SFt(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(Qr.isDateTime))throw new Ap("max requires all arguments be DateTimes");return SFt(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:a=null,numberingSystem:i=null}=r,o=Fs.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0});return eBt(o,t,n)}static fromStringExplain(t,n,r={}){return Qr.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:a=null}=n,i=Fs.fromOpts({locale:r,numberingSystem:a,defaultToEN:!0});return new QFt(i,t)}static fromFormatParser(t,n,r={}){if(ci(t)||ci(n))throw new Ap("fromFormatParser requires an input string and a format parser");const{locale:a=null,numberingSystem:i=null}=r,o=Fs.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0});if(!o.equals(n.locale))throw new Ap(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);const{result:s,zone:l,specificOffset:u,invalidReason:c}=n.explainFromTokens(t);return c?Qr.invalid(c):sV(s,l,r,`format ${n.format}`,t,u)}static get DATE_SHORT(){return Tse}static get DATE_MED(){return MLt}static get DATE_MED_WITH_WEEKDAY(){return FDa}static get DATE_FULL(){return NLt}static get DATE_HUGE(){return LLt}static get TIME_SIMPLE(){return FLt}static get TIME_WITH_SECONDS(){return BLt}static get TIME_WITH_SHORT_OFFSET(){return VLt}static get TIME_WITH_LONG_OFFSET(){return ULt}static get TIME_24_SIMPLE(){return HLt}static get TIME_24_WITH_SECONDS(){return jLt}static get TIME_24_WITH_SHORT_OFFSET(){return zLt}static get TIME_24_WITH_LONG_OFFSET(){return WLt}static get DATETIME_SHORT(){return GLt}static get DATETIME_SHORT_WITH_SECONDS(){return qLt}static get DATETIME_MED(){return KLt}static get DATETIME_MED_WITH_SECONDS(){return YLt}static get DATETIME_MED_WITH_WEEKDAY(){return BDa}static get DATETIME_FULL(){return JLt}static get DATETIME_FULL_WITH_SECONDS(){return ZLt}static get DATETIME_HUGE(){return XLt}static get DATETIME_HUGE_WITH_SECONDS(){return QLt}}function rG(e){if(Qr.isDateTime(e))return e;if(e&&e.valueOf&&hA(e.valueOf()))return Qr.fromJSDate(e);if(e&&typeof e=="object")return Qr.fromObject(e);throw new Ap(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const $Oa="account.last_prefered_timezone",dBt=500,POa=()=>PDa($Oa)||"UTC",fBt={headphone:["headphones","headset"],sofa:["couch"],couch:["sofa"],run:["running","runner"]},BRe=e=>e.toLowerCase().trim(),MOa=e=>BRe(e).split(/\s+/).filter(Boolean),hBt=e=>e.replace(/(ing|ed|s)$/i,"");function NOa(e){const t=new Set;for(const n of e){const r=hBt(n);if(t.add(r),t.add(n),fBt[r])for(const a of fBt[r])t.add(hBt(a))}return Array.from(t)}function LOa(e,t){const n=BRe(e),r=NOa(MOa(t));let a=0;for(const i of r)i&&(n.includes(i)&&(a+=i.length*2),n.startsWith(i)&&(a+=3));return a}function FOa(e,t){const n=i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=t.split(/\s+/).filter(Boolean).map(n);if(!r.length)return e;const a=new RegExp(`(${r.join("|")})`,"ig");return e.replace(a,"<mark>$1</mark>")}const BOa=e=>{if(e!==null){if(Number(e.metric_type.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number(e.metric_type.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number(e.metric_type.id)==3)return"formula"}},VRe=e=>!isNaN(e)&&isFinite(e),URe=(e,t)=>{var n;const{restricted_type:r}=e,a=Math.floor(Number(t)),i=((n=e.restricted_value)==null?void 0:n.split(",").map(Number))||[];if(r=="none")return!0;if(e.restricted_type=="not")return VRe(a)&&!i.includes(a);if(e.restricted_type=="range"){const[o,s]=i;return VRe(Number(t))&&Number(t)>=Number(o)&&Number(t)<=Number(s)}else if(r=="exact")return VRe(a)&&i.includes(a);return!1};/*! js-cookie v3.0.5 | MIT */function zse(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var VOa={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function HRe(e,t){function n(a,i,o){if(!(typeof document>"u")){o=zse({},t,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var l in o)o[l]&&(s+="; "+l,o[l]!==!0&&(s+="="+o[l].split(";")[0]));return document.cookie=a+"="+e.write(i,a)+s}}function r(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var i=document.cookie?document.cookie.split("; "):[],o={},s=0;s<i.length;s++){var l=i[s].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(o[c]=e.read(u,c),a===c)break}catch{}}return a?o[a]:o}}return Object.create({set:n,get:r,remove:function(a,i){n(a,"",zse({},i,{expires:-1}))},withAttributes:function(a){return HRe(this.converter,zse({},this.attributes,a))},withConverter:function(a){return HRe(zse({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var jRe=HRe(VOa,{path:"/"});const pBt=()=>jRe.get("account.last_prefered_timezone")||"UTC",UOa=(e,t,n)=>{const r=W("Copy"),a=()=>{setTimeout(()=>{r.value="Copy"},5e3)};return{copyToClipboard:async i=>{i.stopPropagation(),i.preventDefault(),i.stopImmediatePropagation();try{return await navigator.clipboard.writeText(e),r.value="Copied",t==null||t(),a(),!0}catch(o){return console.error("Failed to copy text to clipboard:",o),r.value="Copy failed",a(),!1}},tooltip:r}},HOa=(e,t,n)=>{const r={truncate:"End date cleared because it was before start. Please pick an end date.",swap:"Dates auto-swapped because start was after end.",...e.messages},a=Wn({startDate:null,endDate:null,timezone:e.timezone||"UTC",format:e.format||"",isSelectingStart:!1,isSelectingEnd:!1,rangeFeedback:{status:"idle",action:null,message:""},cacheStartDate:null,cacheEndDate:null,isDirty:!1});ko(()=>{var A;((A=e.value)==null?void 0:A.length)===2&&(a.startDate=e.value[0],a.endDate=e.value[1]),a.cacheStartDate=a.startDate,a.cacheEndDate=a.endDate,a.isSelectingStart=!1,a.isSelectingEnd=!1,e.timezone&&(a.timezone=e.timezone)});const i=W(!1),o=W(!1),s=()=>{var A,R,B,P,$,V,N,q;const J=i.value||((R=(A=a.startDate)==null?void 0:A.getTime)==null?void 0:R.call(A))!==((P=(B=a.cacheStartDate)==null?void 0:B.getTime)==null?void 0:P.call(B)),ie=o.value||((V=($=a.endDate)==null?void 0:$.getTime)==null?void 0:V.call($))!==((q=(N=a.cacheEndDate)==null?void 0:N.getTime)==null?void 0:q.call(N)),de=a.startDate===null,ee=a.endDate===null;let j,U;J&&ie&&de&&ee?(j=!0,U=!0,t("clearAll")):J&&!ie?(j=!0,de?t("clearStart"):t("update:start",a.startDate)):ie&&!J?(U=!0,ee?t("clearDue"):t("update:end",a.endDate)):J&&ie&&(j=!0,U=!0,t("update",[a.startDate,a.endDate])),!(!j&&!U)&&(j&&!U?t("confirmed",{start:a.startDate}):!j&&U?t("confirmed",{end:a.endDate}):t("confirmed",{start:a.startDate,end:a.endDate}),a.isDirty=J||ie)},l=(A,R)=>{const B=Qr.fromObject({year:A.year,month:A.month,day:A.day},{zone:a.timezone});return(R==="start"?B.startOf("day"):B.endOf("day")).toJSDate()},u=()=>{a.rangeFeedback.status="idle",a.rangeFeedback.action=null,a.rangeFeedback.message=""},c=A=>{e.enableRangeFeedback&&(a.rangeFeedback.status="corrected",a.rangeFeedback.action=A,a.rangeFeedback.message=A==="swap"?r.swap:r.truncate)},d=A=>{if(!(!a.startDate||!a.endDate)){if(a.startDate.getTime()<=a.endDate.getTime()){e.enableRangeFeedback&&u();return}if(A==="select-start"){const R={start:a.startDate,end:a.endDate};a.endDate=null,t("range:invalid",R),t("range:corrected",{start:a.startDate,end:a.endDate,action:"truncate"}),a.isSelectingEnd=!0,c("truncate")}else{const R={start:a.startDate,end:a.endDate},B=a.startDate;a.startDate=a.endDate,a.endDate=B,t("range:invalid",R),t("range:corrected",{start:a.startDate,end:a.endDate,action:"swap"}),c("swap")}}},p=W(!1),h=W(!1),g=(A,R=!0)=>{i.value=!0,p.value=!1,!(e.disabled||e.readOnly)&&(a.startDate=l(A,"start"),R?(a.isSelectingStart=!1,a.isSelectingEnd=!0):(a.isSelectingStart=!0,a.isSelectingEnd=!1),d("select-start"))},v=A=>{o.value=!0,h.value=!1,!(e.disabled||e.readOnly)&&(a.endDate=l(A,"end"),d("select-end"))},b=()=>{i.value=!0,!(e.disabled||e.readOnly)&&(a.startDate=null,u())},_=()=>{o.value=!0,!(e.disabled||e.readOnly)&&(a.endDate=null,u())},C=()=>{i.value=!0,o.value=!0,!(e.disabled||e.readOnly)&&(a.startDate=null,a.endDate=null,u(),y())},S=()=>{e.disabled||e.readOnly||a.isDirty||(a.cacheStartDate=a.startDate,a.cacheEndDate=a.endDate)},y=()=>{e.disabled||e.readOnly||(s(),a.cacheStartDate=a.startDate,a.cacheEndDate=a.endDate,a.isDirty=!1)},T=()=>{e.disabled||e.readOnly||(a.startDate=a.cacheStartDate,a.endDate=a.cacheEndDate,u(),a.isDirty=!1)},k=z(()=>a.startDate?Qr.fromJSDate(a.startDate,{zone:a.timezone}).toFormat(a.format):e.startPlaceholder),E=z(()=>a.endDate?Qr.fromJSDate(a.endDate,{zone:a.timezone}).toFormat(a.format):e.duePlaceholder),I=z(()=>!a.startDate&&!e.disabled?e.startTooltip:!a.startDate&&(e.disabled||e.readOnly)?e.startPlaceholder:a.startDate?Qr.fromJSDate(a.startDate,{zone:a.timezone}).toFormat("LLL dd, yyyy | HH:mm:ss"):e.startTooltip),D=z(()=>!a.endDate&&!e.disabled?e.dueTooltip:!a.endDate&&(e.disabled||e.readOnly)?e.startPlaceholder:a.endDate?Qr.fromJSDate(a.endDate,{zone:a.timezone}).toFormat("LLL dd, yyyy | HH:mm:ss"):e.dueTooltip);return{states:a,displayStartDate:k,displayEndDate:E,tooltipStartDate:I,tooltipEndDate:D,showMultipleDueDates:h,showMultipleStartDates:p,selectEndDate:v,selectStartDate:g,clearDue:_,clearStart:b,clearAll:C,beginInteraction:S,confirmSelection:y,cancelSelection:T}};ze.env.NODE_ENV,ze.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();var mBt;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(mBt||(mBt={})),ze.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Wse(e){const t=W(!1),n=W(!1),r=z(()=>{var u;const c=e.value,d=!!c.readOnly;return{readOnly:d,disabled:!!c.disabled,hovered:n.value,focused:t.value,isEmpty:c.empty??!1,error:!!c.error,actived:!!((u=c.active)!=null&&u.value),clickable:d?!1:c.clickable??!1}}),a=()=>{t.value=!0,Ct(()=>{const u=l(e.value.inputRef);u==null||u.focus()})},i=()=>{t.value=!1},o=()=>{n.value=!0},s=()=>{n.value=!1},l=u=>{if(!u)return null;const c=u.value||u;return(c instanceof HTMLElement?c:c==null?void 0:c.$el)||null};return nn(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.addEventListener("focus",a),u.addEventListener("blur",i)),c&&(c.addEventListener("mouseenter",o),c.addEventListener("mouseleave",s))}),$r(()=>{const u=l(e.value.inputRef),c=l(e.value.wrapperRef);u&&(u.removeEventListener("focus",a),u.removeEventListener("blur",i)),c&&(c.removeEventListener("mouseenter",o),c.removeEventListener("mouseleave",s))}),{isFocus:t,isHover:n,argsMain:r,handleFocus:a}}const gBt=e=>{const t=W(!1),n=z(()=>t.value);return nn(()=>{var r,a,i,o;const s=(r=e.params)==null?void 0:r.api,l=(a=e.params)==null?void 0:a.node,u=l==null?void 0:l.rowIndex,c=(o=(i=e.params)==null?void 0:i.colDef)==null?void 0:o.field;return s==null||s.addEventListener("cellEditingStarted",d=>{d.rowIndex===u&&d.colDef.field===c&&(t.value=!0)}),s==null||s.addEventListener("cellEditingStopped",d=>{d.rowIndex===u&&d.colDef.field===c&&(t.value=!1)}),{isEditing:n}}),{isEditing:n}};POa();const jOa=["src","width","height","alt"],zOa=ct({__name:"Visual",props:{src:{},source:{default:"remote"},size:{},minWidth:{},maxWidth:{},minHeight:{},maxHeight:{},color:{},ratio:{default:"1/1"}},setup(e){const t=RIe,{getCachedValue:n,setCachedValue:r}=nRe({dbName:"visual-cache-db",storeName:"visuals"}),a=p=>{if(p!==void 0)return typeof p=="number"?`${p}px`:typeof p=="string"&&/^\d+$/.test(p)?`${p}px`:p},i=e,o=z(()=>({minWidth:a(i.minWidth),maxWidth:a(i.maxWidth),minHeight:a(i.minHeight),maxHeight:a(i.maxHeight),aspectRatio:i.ratio,width:a(i.size)})),s=async p=>{const h=await n(p);if(typeof h=="string")return h},l=async(p,h)=>{await r(p,h)},u=z(()=>({name:i.src,size:Number(i.size||100),color:""})),{url:c,loading:d}=DLt(u,"visual",l,s);return(p,h)=>ft((L(),re("div",{class:ke([p.$style.visualWrapper,{[p.$style.loading]:F(d)}]),style:Yt(o.value)},[be("img",{src:F(c),width:e.size,height:e.size,alt:"visual-"+e.src,style:Yt(o.value)},null,12,jOa)],6)),[[F(t),{isLoading:F(d),type:"skeleton",size:"cover",fullwidth:!0}]])}}),WOa="_visualWrapper_lvp0k_1",GOa="_loading_lvp0k_8",qOa="_pulse_lvp0k_1",KOa={visualWrapper:WOa,loading:GOa,pulse:qOa},YOa={$style:KOa},JOa=Tp(zOa,[["__cssModules",YOa]]),ZOa=["tabindex"],XOa=ct({__name:"DisplayWrapper",props:{prefix:{},suffix:{},inputType:{},readOnly:{type:Boolean},disabled:{type:Boolean},hovered:{type:Boolean},focused:{type:Boolean},error:{type:Boolean},actived:{type:Boolean},clickable:{type:Boolean},size:{},bordered:{type:Boolean},tabIndex:{}},emits:["event","escape"],setup(e,{expose:t,emit:n}){const r=e,a=n;el();const i=Cf(),o=W(null),s=W("default"),l=z(()=>{if(typeof r.size=="number")return`${r.size}px`;switch(r.size){case"small":return"32px";case"large":return"48px";case"default":default:return"32px"}}),u=z(()=>`${Math.max(50,Math.round(Math.random()*100))}%`),c=z(()=>({[i["display-wrapper"]]:!0,[i.disabled]:r.disabled,[i.readOnly]:r.readOnly,[i.error]:r.error,[i.clickable]:r.clickable,[i.active]:r.actived,[i.hovered]:r.hovered,[i.focused]:!r.readOnly&&!r.disabled&&r.focused,[i.bordered]:r.bordered})),d=()=>{var v,b;const _=((v=o.value)==null?void 0:v.querySelectorAll(":scope > .wrapper-prefix").length)||0,C=((b=o.value)==null?void 0:b.querySelectorAll(":scope > .wrapper-suffix").length)||0,S="var(--icon-size)",y=`calc(var(--gap-size) * ${_+C})`;return _&&!C?`repeat(${_}, ${S}) calc(100% - (${_} * ${S} + ${y}))`:!_&&C?`calc(100% - (${C} * ${S} + ${y})) repeat(${C}, ${S})`:_&&C?`repeat(${_}, ${S}) calc(100% - (${_} * ${S} + ${C} * ${S} + ${y})) repeat(${C}, ${S})`:"100%"},p=W("100%"),h=()=>{p.value=d()};jg(()=>{h()}),nn(()=>{h()});const g=v=>{s.value=v};return t({rootEl:o,updateState:g,componentState:s,focus:()=>{Ct(()=>{var v;(v=o.value)==null||v.focus()})},escape:()=>{a("escape")}}),(v,b)=>(L(),re("div",{ref_key:"rootEl",ref:o,class:ke([F(i)["display-wrapper"],c.value]),tabindex:e.tabIndex,style:Yt({"--grid-template":p.value,"--wrapper-size":l.value,"--loading-overlay-width":u.value})},[at(v.$slots,"prefix",{hovered:r.hovered,focused:r.focused}),at(v.$slots,"default",{hovered:r.hovered,focused:r.focused,updateComponentState:g,disabled:r.disabled}),at(v.$slots,"suffix",{hovered:r.hovered,focused:r.focused})],14,ZOa))}}),QOa="_readOnly_46uq2_26",e2a="_bordered_46uq2_29",t2a="_disabled_46uq2_29",n2a="_active_46uq2_29",r2a="_focused_46uq2_29",a2a="_hovered_46uq2_33",i2a="_error_46uq2_37",o2a="_clickable_46uq2_50",s2a="_suffix_46uq2_56",l2a="_prefix_46uq2_57",u2a={"display-wrapper":"_display-wrapper_46uq2_1",readOnly:QOa,bordered:e2a,disabled:t2a,active:n2a,focused:r2a,hovered:a2a,error:i2a,clickable:o2a,suffix:s2a,prefix:l2a},c2a={$style:u2a},Gse=Tp(XOa,[["__cssModules",c2a]]),d2a=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const f2a=Object.prototype.toString,h2a=e=>f2a.call(e)==="[object Object]",lV=()=>{};function p2a(e,t){function n(...r){return new Promise((a,i)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(a).catch(i)})}return n}function m2a(e,t={}){let n,r,a=lV;const i=s=>{clearTimeout(s),a(),a=lV};let o;return s=>{const l=xn(e),u=xn(t.maxWait);return n&&i(n),l<=0||u!==void 0&&u<=0?(r&&(i(r),r=void 0),Promise.resolve(s())):new Promise((c,d)=>{a=t.rejectOnCancel?d:c,o=s,u&&!r&&(r=setTimeout(()=>{n&&i(n),r=void 0,c(o())},u)),n=setTimeout(()=>{r&&i(r),r=void 0,c(s())},l)})}}function zRe(e){return Array.isArray(e)?e:[e]}function g2a(e,t=200,n={}){return p2a(m2a(t,n),e)}function v2a(e,t,n){return lt(e,t,{...n,immediate:!0})}const vBt=d2a?window:void 0;function aG(e){var t;const n=xn(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function WRe(...e){const t=(r,a,i,o)=>(r.addEventListener(a,i,o),()=>r.removeEventListener(a,i,o)),n=z(()=>{const r=zRe(xn(e[0])).filter(a=>a!=null);return r.every(a=>typeof a!="string")?r:void 0});return v2a(()=>{var r,a;return[(r=(a=n.value)===null||a===void 0?void 0:a.map(i=>aG(i)))!==null&&r!==void 0?r:[vBt].filter(i=>i!=null),zRe(xn(n.value?e[1]:e[0])),zRe(F(n.value?e[2]:e[1])),xn(n.value?e[3]:e[2])]},([r,a,i,o],s,l)=>{if(!(r!=null&&r.length)||!(a!=null&&a.length)||!(i!=null&&i.length))return;const u=h2a(o)?{...o}:o,c=r.flatMap(d=>a.flatMap(p=>i.map(h=>t(d,p,h,u))));l(()=>{c.forEach(d=>d())})},{flush:"post"})}function y2a(e,t,n={}){const{window:r=vBt,ignore:a=[],capture:i=!0,detectIframe:o=!1,controls:s=!1}=n;if(!r)return s?{stop:lV,cancel:lV,trigger:lV}:lV;let l=!0;const u=b=>xn(a).some(_=>{if(typeof _=="string")return Array.from(r.document.querySelectorAll(_)).some(C=>C===b.target||b.composedPath().includes(C));{const C=aG(_);return C&&(b.target===C||b.composedPath().includes(C))}});function c(b){const _=xn(b);return _&&_.$.subTree.shapeFlag===16}function d(b,_){const C=xn(b),S=C.$.subTree&&C.$.subTree.children;return S==null||!Array.isArray(S)?!1:S.some(y=>y.el===_.target||_.composedPath().includes(y.el))}const p=b=>{const _=aG(e);if(b.target!=null&&!(!(_ instanceof Element)&&c(e)&&d(e,b))&&!(!_||_===b.target||b.composedPath().includes(_))){if("detail"in b&&b.detail===0&&(l=!u(b)),!l){l=!0;return}t(b)}};let h=!1;const g=[WRe(r,"click",b=>{h||(h=!0,setTimeout(()=>{h=!1},0),p(b))},{passive:!0,capture:i}),WRe(r,"pointerdown",b=>{const _=aG(e);l=!u(b)&&!!(_&&!b.composedPath().includes(_))},{passive:!0}),o&&WRe(r,"blur",b=>{setTimeout(()=>{var _;const C=aG(e);((_=r.document.activeElement)===null||_===void 0?void 0:_.tagName)==="IFRAME"&&!(C!=null&&C.contains(r.document.activeElement))&&t(b)},0)},{passive:!0})].filter(Boolean),v=()=>g.forEach(b=>b());return s?{stop:v,cancel:()=>{l=!1},trigger:b=>{l=!0,p(b),l=!1}}:v}const b2a=["value","placeholder","disabled","readonly","inputmode","maxlength"],w2a=ct({__name:"InputText",props:{type:{default:"text"},autoEmit:{type:Boolean,default:!1},debounceDelay:{default:300},selectOnFocus:{type:Boolean,default:!1},submitOnEnter:{type:Boolean,default:!0},blurOnEscape:{type:Boolean,default:!0},maxDecimalChar:{},modelValue:{},placeholder:{},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{}},emits:["update:modelValue","input","clear","focus","blur","change","enterValue","enter","escape","cancel","tab","keydown","keyup","paste","cut","select","onValidation"],setup(e,{expose:t,emit:n}){const r=OIe,a=qC,i=e,o=n,s=W(null),l=W(i.modelValue||"");lt(l,()=>{o("onValidation",l.value)});const u=W(!1),c=W(i.modelValue||"");lt(()=>i.modelValue,j=>{l.value=j||"",c.value=j||""});const d=z(()=>{var j;return((j=l.value)==null?void 0:j.length)>0}),p={text:j=>j.slice(0,i.maxLength||255),number:j=>{let U=j.replace(/[^\d.-]/g,"");const Z=U.split(".");Z.length>2&&(U=Z[0]+"."+Z.slice(1).join("")),U=U.replace(/-/g,(ae,G)=>G===0?ae:"");const oe=U.startsWith("-")?"-":"",fe=U.replace("-","").split(".");return fe[0].length>17&&(fe[0]=fe[0].substring(0,17)),i.maxDecimalChar!==void 0&&fe.length>1&&(fe[1]=fe[1].substring(0,i.maxDecimalChar)),U=oe+fe.join("."),U},email:j=>j.replace(/\s/g,"").slice(0,i.maxLength||255),url:j=>j.replace(/\s/g,"").slice(0,i.maxLength||255),tel:j=>j.replace(/[^\d+\-() ]/g,"").slice(0,i.maxLength||20)},h=j=>{const U=p[i.type];return U?U(j):j},g=g2a(j=>{i.autoEmit&&(o("update:modelValue",j),o("input",j))},i.debounceDelay),v=j=>{const U=j;if(i.disabled||i.readOnly){U.preventDefault();return}const Z=U.target,oe=Z.selectionStart||0,fe=l.value,ae=h(Z.value);fe!==ae&&(l.value=ae,o("input",ae),i.autoEmit&&g(ae),Z.value!==ae&&(Z.value=ae,Ct(()=>{let G=oe;if(ae.length<Z.value.length)G=oe;else{const Y=ae.length-fe.length;G=oe+Y}G=Math.max(0,Math.min(G,ae.length)),Z.setSelectionRange(G,G)})))},b=j=>{if(i.disabled||i.readOnly){j.preventDefault();return}u.value=!0;const U=l.value;l.value="",o("update:modelValue",""),o("clear"),U!==""&&o("change",""),j.preventDefault(),j.stopImmediatePropagation(),j.stopPropagation(),Ct(()=>{var Z;(Z=s.value)==null||Z.focus(),setTimeout(()=>{u.value=!1},100)})},_=j=>{i.disabled||i.readOnly||(o("focus",j),i.selectOnFocus&&Ct(()=>{j.target.select()}))},C=j=>{if(u.value)return;const U=j.target.value;i.autoEmit||o("update:modelValue",U),c.value!==U&&(o("change",U),c.value=U),o("blur",U,j)},S=j=>{setTimeout(()=>{Ct(()=>{const U=j.target.value;o("enter",U,j),o("enterValue",U),i.submitOnEnter&&(j.preventDefault(),i.autoEmit||o("update:modelValue",U),c.value!==U&&(o("change",U),c.value=U))})},1e3)},y=j=>{const U=j.target,Z=U.value;if(o("escape",Z,j),j.preventDefault(),j.stopImmediatePropagation(),j.stopPropagation(),i.autoEmit){o("cancel"),i.blurOnEscape&&U.blur();return}l.value=i.modelValue||"",s.value&&(s.value.value=l.value),o("cancel"),i.blurOnEscape&&U.blur()},T=j=>{const U=j.target.value;o("tab",U,j),i.autoEmit||(o("update:modelValue",U),c.value!==U&&(o("change",U),c.value=U))},k=(j,U,Z)=>j===""?!0:j==="."?Z>0:new RegExp(`^\\d{0,${U}}(\\.\\d{0,${Z}})?$`).test(j),E=j=>{if(o("keydown",j),j.key===" "&&j.stopPropagation(),i.type==="number"){if(j.key==="e"||j.key==="E"){j.preventDefault();return}if(!(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Escape","Home","End"].includes(j.key)||j.ctrlKey||j.metaKey||j.altKey)){if(Number.isNaN(Number(j.key))&&j.key!=="."&&j.key!=="-"){j.preventDefault();return}const U=l.value+j.key;if(!k(U,17,i.maxDecimalChar||2)){j.preventDefault();return}}}j.key==="Escape"?y(j):j.key==="Enter"?S(j):j.key==="Tab"?T(j):(j.key==="ArrowUp"||j.key==="ArrowDown")&&i.type==="number"&&j.preventDefault()},I=j=>{o("keyup",j)},D=j=>{if(i.disabled||i.readOnly){j.preventDefault();return}o("paste",j)},A=j=>{if(i.disabled||i.readOnly){j.preventDefault();return}o("cut",j)},R=j=>{o("select",j)},B=`input-text-${Math.random().toString(36).substr(2,9)}`,P=W(!1),$=z(()=>{switch(i.type){case"number":return"decimal";case"email":return"email";case"tel":return"tel";case"url":return"url";default:return"text"}});lt(()=>l.value,j=>{i.validatorFnc?P.value=!!j&&!i.validatorFnc(j):P.value=!1});const V=W(null),N=z(()=>({disabled:i.disabled,readOnly:i.readOnly,error:P.value,inputRef:s,clickable:!i.disabled&&!i.readOnly,focused:i.focused,wrapperRef:V,bordered:!0})),{argsMain:q,isHover:J,isFocus:ie}=Wse(N);t({triggerFocus:()=>{Ct(()=>{var j;(j=s.value)==null||j.focus()})},focus:()=>{de()},blur:()=>{Ct(()=>{var j;(j=s.value)==null||j.blur()})},select:()=>{Ct(()=>{var j;(j=s.value)==null||j.select()})},setSelectionRange:(j,U)=>{Ct(()=>{var Z;(Z=s.value)==null||Z.setSelectionRange(j,U)})},getValue:()=>l.value,setValue:j=>{l.value=h(j),s.value&&(s.value.value=l.value)},reset:()=>{l.value=i.modelValue||"",s.value&&(s.value.value=l.value)}});const de=()=>{!i.disabled&&!i.readOnly&&Ct(()=>{var j;(j=s.value)==null||j.focus()})},ee=z(()=>ie.value&&d.value);return(j,U)=>(L(),re("div",{class:ke([j.$style["input-wrapper"],"input-editor"]),onClick:de},[ft((L(),qe(Gse,Zt(F(q),{ref_key:"wrapperRef",ref:V,class:[j.$style["input-box"],{[j.$style["is-hovered"]]:F(J),[j.$style["is-focused"]]:F(ie),[j.$style["has-input"]]:d.value,[j.$style["is-editting"]]:ee.value}],style:{"--icon-size":"20px","--gap-size":"4px"},bordered:i.bordered}),{prefix:Re(()=>[at(j.$slots,"prefix")]),suffix:Re(()=>[d.value&&!i.disabled&&!i.readOnly?at(j.$slots,"clear",{key:0},()=>[ft((L(),qe(ym,{variant:["icon","tertiary"],"aria-label":"Clear search",onMousedown:Ot(b,["prevent","stop"]),size:18,rounded:!0,class:ke(["wrapper-suffix",j.$style["clear-button"]])},{default:Re(()=>[De(Dp,{src:"CircleXMark",size:"20",color:"var(--primary-color)"})]),_:1},8,["class"])),[[F(a),{content:"Clear",contentClass:"extra-padding"}]])]):at(j.$slots,"suffix",{key:1})]),default:Re(()=>[be("input",{tabindex:"-1",ref_key:"inputRef",ref:s,type:"text",value:l.value,placeholder:e.placeholder,class:ke([j.$style["column-config__input"]]),id:B,disabled:e.disabled,readonly:e.readOnly,inputmode:$.value,maxlength:i.maxLength,onInput:v,onFocus:_,onBlur:C,onKeydown:E,onKeyup:I,onPaste:D,onCut:A,onSelect:R},null,42,b2a)]),_:3},16,["class","bordered"])),[[F(r),i.focusIndex]]),P.value?at(j.$slots,"error",{key:0}):Ve("",!0)],2))}}),_2a={"input-box":"_input-box_1p4v0_1","is-disabled":"_is-disabled_1p4v0_16","is-readonly":"_is-readonly_1p4v0_16","is-hovered":"_is-hovered_1p4v0_16","is-focused":"_is-focused_1p4v0_20","column-config__input":"_column-config__input_1p4v0_40","clear-button":"_clear-button_1p4v0_55"},C2a={$style:_2a},yBt=Tp(w2a,[["__cssModules",C2a]]),S2a={class:"wrapper-prefix",style:{width:"18px",height:"18px"}},k2a=ct({__name:"SearchBox",props:{modelValue:{default:""},placeholder:{default:"Search"},focused:{type:Boolean},validatorFnc:{},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},bordered:{type:Boolean},focusIndex:{default:void 0}},emits:["update:modelValue","search","clear","cancel"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=W(null),o=uRe(u=>{a("update:modelValue",u),a("search",u)},dBt),s=()=>{a("update:modelValue",""),a("clear"),Ct(()=>{var u;(u=i.value)==null||u.focus()})},l=W(r.modelValue);return t({focus:()=>{var u;(u=i.value)==null||u.focus()},setValue(u){l.value=u}}),(u,c)=>(L(),qe(yBt,{focusIndex:r.focusIndex,ref_key:"searchInput",ref:i,modelValue:l.value,"onUpdate:modelValue":c[0]||(c[0]=d=>l.value=d),type:"text",placeholder:e.placeholder,onInput:F(o),onClear:s,onCancel:c[1]||(c[1]=d=>a("cancel")),"auto-emit":!0},{prefix:Re(()=>[be("div",S2a,[De(Dp,{src:"MagnifyingGlass",color:"var(--grey-200)",size:"14"})])]),_:1},8,["focusIndex","modelValue","placeholder","onInput"]))}}),E2a=ct({name:"ListItem",directives:{tooltip:qC,focusable:OIe},__name:"ListItem",props:{itemWidth:{default:"250px"},label:{},value:{},type:{},selected:{type:Boolean},disabled:{type:Boolean},hover:{type:Boolean},clickable:{type:Boolean,default:!0},danger:{type:Boolean},data:{},icon:{},readOnly:{type:Boolean,default:!1},show:{type:Boolean},focusIndex:{}},emits:["click","handleClick","keydown","update:selected","select","escape"],setup(e,{expose:t,emit:n}){const r=OIe,a=e,i=n,o=W(!1),s=W(!1);function l(T){if(!T||typeof T!="object")return!1;const k=T;return typeof k.name=="string"&&typeof k.id=="string"&&typeof k.initial=="string"}const u=z(()=>a.type==="status"||a.type==="assignee"||a.type==="icon"||!!y.prefix),c=z(()=>!!y.suffix||a.danger&&o.value),d=z(()=>{var T;return a.type==="status"&&typeof((T=a.data)==null?void 0:T.color)=="string"?{backgroundColor:a.data.color,border:GTa(a.data.color,"white")?"1px solid #ccc":"1px solid #fff"}:{}}),p=Cf(),h=z(()=>({[p.active]:a.selected??!1,[p.disabled]:a.disabled??!1,[p.hover]:a.hover??!1,[p.clickable]:(a.clickable??!0)&&!a.disabled,[p.danger]:a.danger??!1,[p["has-prefix"]]:u.value,[p["has-suffix"]]:c.value,[p.readOnly]:a.readOnly}));z(()=>({content:"Cancel",...S})),z(()=>({content:"Confirm",theme:"warning",...S}));function g(T){return{name:T.name,initial:T.initial,id:T.id,profile_image:T.profile_image??null,color:T.color,size:24}}function v(){o.value=!1}function b(T){T?i("click",T):(a.clickable??!0)&&(i("update:selected",!a.selected),i("select",!a.selected))}function _(T){if(!a.disabled){if(a.danger&&!o.value){o.value=!0;return}else a.danger||b(T);i("handleClick",T)}}const C=()=>{o.value?v():i("escape")},S=Object.freeze({delay:[300,0],contentClass:["extra-padding"]}),y=el();return lt(()=>a.show,T=>{T===!1&&(o.value=!1)}),t({select:()=>{_(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}),(T,k)=>{const E=Ti("tooltip");return ft((L(),qe(ym,{variant:["menu-item",e.danger?"danger":"menu-item"],class:ke([T.$style["list-item"],h.value]),onHandleClick:_,onMouseenter:k[0]||(k[0]=I=>s.value=!0),onMouseleave:k[1]||(k[1]=I=>s.value=!1),onEscape:C,style:Yt({width:a.itemWidth})},{default:Re(()=>[u.value?(L(),re("div",{key:0,class:ke(T.$style["list-item__prefix"])},[at(T.$slots,"prefix",{},()=>[e.type==="icon"&&e.icon?(L(),qe(Dp,{key:0,src:e.icon,source:"remote",class:ke(T.$style["item-icon"]),color:a.danger?void 0:"#a6a6a6"},null,8,["src","class","color"])):e.type==="status"?(L(),re("div",{key:1,class:ke(T.$style["status-indicator"]),style:Yt(d.value)},null,6)):e.type==="assignee"&&l(e.data)?(L(),qe(nDa,Zt({key:2},g(e.data),{class:T.$style["item-avatar"],readOnly:!0}),null,16,["class"])):Ve("",!0)])],2)):Ve("",!0),be("div",{class:ke(T.$style["list-item__label"])},[at(T.$slots,"label",{selected:e.selected},()=>[Dt(vt(e.label),1)])],2),c.value?(L(),re("div",{key:1,class:ke(T.$style["list-item__suffix"])},[at(T.$slots,"suffix",{item:T.$props,hovered:s.value},()=>[e.danger&&o.value?(L(),re("div",{key:0,class:ke(T.$style["confirm-action"])},[ft((L(),qe(ym,{variant:["tertiary","icon","danger"],size:"small",onClick:Ot(v,["stop","prevent"])},{default:Re(()=>[De(Dp,{src:"Xmark",source:"remote"})]),_:1})),[[F(r),`${a.focusIndex}.0`],[E,{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),ft((L(),qe(ym,{variant:["danger","primary","icon"],size:"small",onClick:Ot(b,["stop","prevent"])},{default:Re(()=>[De(Dp,{src:"Check",source:"remote"})]),_:1})),[[F(r),`${a.focusIndex}.1`],[E,{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ve("",!0)])],2)):Ve("",!0)]),_:3},8,["variant","class","style"])),[[F(r),a.focusIndex]])}}}),x2a="_disabled_tuyyv_16",T2a="_danger_tuyyv_23",D2a="_clickable_tuyyv_40",A2a="_readOnly_tuyyv_43",O2a="_hover_tuyyv_47",I2a="_active_tuyyv_53",R2a={"list-item":"_list-item_tuyyv_1",disabled:x2a,danger:T2a,"has-prefix":"_has-prefix_tuyyv_26","has-suffix":"_has-suffix_tuyyv_26",clickable:D2a,readOnly:A2a,hover:O2a,active:I2a,"list-item__prefix":"_list-item__prefix_tuyyv_78","list-item__label":"_list-item__label_tuyyv_86","list-item__suffix":"_list-item__suffix_tuyyv_100","status-indicator":"_status-indicator_tuyyv_107","item-icon":"_item-icon_tuyyv_113","arbo-icon-state":"_arbo-icon-state_tuyyv_118","item-avatar":"_item-avatar_tuyyv_121","confirm-action":"_confirm-action_tuyyv_130"},$2a={$style:R2a},bBt=Tp(E2a,[["__cssModules",$2a]]),P2a=["aria-activedescendant"],M2a=["innerHTML"],N2a=10,L2a=ct({__name:"SearchList",props:{options:{default:()=>[]},selectedId:{},loading:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},error:{default:null},params:{},maxHeight:{default:"218px"},width:{default:"250px"},itemWidth:{default:"250px"},minQueryLength:{default:0}},emits:["select","close","search","loadMore","cancel","tab"],setup(e,{expose:t,emit:n}){const r=qC,a={ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ENTER:"Enter",ESCAPE:"Escape",TAB:"Tab"},i=e,o=n,s=W(""),l=W(-1),u=W(null),c=W(null),d=W(new Map),p=z(()=>BRe(s.value)),h=()=>{const ee=p.value;if(!ee||ee.length<i.minQueryLength)return i.options;if(d.value.has(ee))return d.value.get(ee);const j=i.options.map(U=>({item:U,score:LOa(` ${U.label} `,ee)})).filter(({score:U})=>U>0).sort((U,Z)=>Z.score-U.score).map(({item:U})=>U);return d.value.set(ee,j),j},g=W([]);lt(()=>i.options,()=>{g.value=h()},{immediate:!0,deep:!0});const v=z(()=>i.hasMore&&!i.loading&&!i.loadingMore),b=uRe(ee=>{s.value=ee,l.value=-1,o("search",ee)},dBt),_=async ee=>{ie.value=0,await b(ee||""),ie.value=1},C=ee=>s.value?FOa(ee,s.value):ee,S=ee=>{const j={[a.ARROW_DOWN]:()=>y(ee),[a.ARROW_UP]:()=>T(ee),[a.ENTER]:()=>I(ee),[a.ESCAPE]:()=>D(ee),[a.TAB]:()=>A(ee)}[ee.key];j&&j()},y=ee=>{ee.preventDefault(),k(1)},T=ee=>{ee.preventDefault(),k(-1)},k=ee=>{const j=g.value.length;if(j===0)return;let U;ee>0?U=(l.value+1)%j:l.value>0?U=l.value-1:U=j-1,l.value=U,E()},E=()=>{Ct(()=>{var ee;const j=(ee=c.value)==null?void 0:ee.querySelectorAll('[role="menuitem"]')[l.value];j==null||j.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})},I=ee=>{if(ee.preventDefault(),l.value>=0&&l.value<g.value.length){const j=g.value[l.value];R(j,ee)}},D=ee=>{ee.preventDefault(),P()},A=ee=>{o("tab",ee)},R=(ee,j)=>{!ee||ee.disabled||(o("select",ee,j),l.value=-1,P())},B=ee=>{ee>=0&&ee<g.value.length&&(l.value=ee)},P=()=>{o("close")},$=()=>{if(!v.value||!c.value)return;const{scrollTop:ee,clientHeight:j,scrollHeight:U}=c.value;U-(ee+j)<=N2a&&o("loadMore")},V=()=>{var ee,j,U;(ee=c.value)==null||ee.addEventListener("scroll",$),(U=(j=J.value)==null?void 0:j.$el)==null||U.addEventListener("keydown",S)},N=()=>{var ee,j,U;(ee=c.value)==null||ee.removeEventListener("scroll",$),(U=(j=J.value)==null?void 0:j.$el)==null||U.removeEventListener("keydown",S)};nn(()=>{V()}),$r(()=>{N()}),lt(()=>i.loading,ee=>{!ee&&g.value.length>0&&(l.value=-1)});const q=ee=>ee?Array.isArray(i.selectedId)?i.selectedId.includes(String(ee.id)):i.selectedId==ee.id:!1,J=W(null);lt(l,()=>{E()}),t({focus:()=>{Ct(()=>{var ee;(ee=J.value)==null||ee.focus()})},reset:()=>{var ee;(ee=J.value)==null||ee.focus(),l.value=-1},query:s,filteredOptions:g,selectedIndex:l,closeDropdown:P,clearSearch:()=>{s.value=""},scrollTo:ee=>{c.value&&(c.value.scrollTop=ee)},selectIndex:ee=>{ee>=0&&ee<g.value.length&&(l.value=ee,E())}});const ie=W(0);lt([()=>i.loading,()=>s.value,()=>i.options,()=>i.loadingMore],()=>{const ee=i.options.length>0&&g.value.length>0,j=!ee&&s.value.length>0,U=!ee&&s.value.length===0;i.loading?ie.value=0:ee?ie.value=1:j?ie.value=2:U&&(ie.value=3)},{immediate:!0,deep:!0});const de=()=>{o("cancel")};return(ee,j)=>(L(),re("datalist",{ref_key:"searchListRef",ref:u,class:ke([ee.$style["search-list"],ie.value===3||ie.value===2?ee.$style.empty:"",g.value.length>8?ee.$style.scrollable:""]),"aria-activedescendant":l.value>=0?`item-${l.value}`:void 0,style:Yt({width:e.itemWidth||e.width})},[De(k2a,{ref_key:"searchBoxRef",ref:J,modelValue:s.value,"onUpdate:modelValue":j[0]||(j[0]=U=>s.value=U),class:ke(ee.$style["search-box"]),disabled:e.loading,onSearch:_,onClear:j[1]||(j[1]=U=>_("")),onCancel:de},null,8,["modelValue","class","disabled"]),be("div",{ref_key:"popupRef",ref:c,class:ke(ee.$style["list-container"])},[at(ee.$slots,"extra-item",{query:s.value,isEmpty:ie.value===3||ie.value===2,isLoading:i.loading}),(L(!0),re($t,null,rn(g.value,(U,Z)=>ft((L(),re("div",{key:`${U.id}-${Z}`,role:"menuitem"},[at(ee.$slots,"item",{item:U,index:Z,selectedIndex:l.value,isSelected:q,handleSelect:R,handleItemHover:B,getHighlightedLabel:C,query:s.value,idx:Z,focused:l.value==Z},()=>[U.hide?Ve("",!0):(L(),qe(bBt,Zt({key:0,ref_for:!0},U,{hover:Z===l.value,selected:q(U),type:U.type,id:`item-${Z}`,"aria-selected":Z===l.value,onClick:oe=>R(U,oe),onMouseover:oe=>B(Z),onEscape:P,itemWidth:e.itemWidth||e.width}),{prefix:Re(()=>[at(ee.$slots,"prefix-item",{item:U})]),label:Re(()=>[s.value?ft((L(),re("span",{key:0,class:ke(ee.$style.match),innerHTML:C(U.label)},null,10,M2a)),[[F(r),{content:U.label,delay:[1e3,0]}]]):ft((L(),re("span",{key:1,class:ke(ee.$style["item-label"])},[Dt(vt(U.label),1)],2)),[[F(r),{content:U.label,delay:[1e3,0]}]])]),suffix:Re(({hovered:oe})=>[at(ee.$slots,"action",{item:U,isHovered:Z===l.value,hovered:oe,selected:l.value==Z})]),_:2},1040,["hover","selected","type","id","aria-selected","onClick","onMouseover","itemWidth"]))])])),[[Ur,ie.value===1]])),128)),ie.value===0?at(ee.$slots,"loading-more",{key:0},()=>[(L(),re($t,null,rn(8,U=>be("div",{class:ke(ee.$style["loading-more"]),key:U},[be("div",{class:ke(ee.$style["loading-skeleton"])},null,2),be("div",{class:ke(ee.$style["loading-skeleton"])},null,2)],2)),64))]):Ve("",!0),ie.value===2?(L(),re("div",{key:1,class:ke(ee.$style["no-results"])},[at(ee.$slots,"empty",{query:s.value},()=>[be("div",{class:ke(ee.$style["no-results-content"])},[...j[2]||(j[2]=[be("div",null,[Dt(" No results. "),be("br"),Dt(" Try another search. ")],-1)])],2)])],2)):Ve("",!0),ie.value===3?(L(),re("div",{key:2,class:ke(ee.$style["no-results"])},[at(ee.$slots,"empty-list",{},()=>[be("div",{class:ke(ee.$style["no-results-content"])},[...j[3]||(j[3]=[be("div",null,"No items available.",-1)])],2)])],2)):Ve("",!0),at(ee.$slots,"footer")],2)],14,P2a))}}),F2a="_empty_1rcj9_11",B2a="_scrollable_1rcj9_17",V2a="_title_1rcj9_137",U2a="_tips_1rcj9_143",H2a="_match_1rcj9_157",j2a={"search-list":"_search-list_1rcj9_1",empty:F2a,scrollable:B2a,"list-container":"_list-container_1rcj9_24","item-label":"_item-label_1rcj9_45","loading-state":"_loading-state_1rcj9_53","loading-more":"_loading-more_1rcj9_54","loading-skeleton":"_loading-skeleton_1rcj9_65","is-loading":"_is-loading_1rcj9_72","no-results":"_no-results_1rcj9_127","no-results-content":"_no-results-content_1rcj9_134",title:V2a,tips:U2a,match:H2a,"skeleton-loading":"_skeleton-loading_1rcj9_1"},z2a={$style:j2a},W2a=Tp(L2a,[["__cssModules",z2a]]),iG=["start-input","due-input","prev-btn","month-btn","year-btn","next-btn","month-selection","year-selection","date-selection","today-btn","cancel-btn","save-btn"],G2a=new Set(["Tab","Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]),mA=(e,t)=>{const n=r=>{var a,i;if(r.key==="Tab"){const o=r.shiftKey||r.metaKey;r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation();const s=document.activeElement,l=(a=s==null?void 0:s.dataset)==null?void 0:a.index;if(l){let u=iG.indexOf(l);const c=o?-1:1;for(const d of iG){u=(u+c+iG.length)%iG.length;const p=iG[u],h=document.querySelector(`[data-index="${p}"]`);if(h){h.focus();return}}}}else if(r.key==="Enter")(i=r.target)==null||i.dispatchEvent(new MouseEvent("click",{bubbles:!0}));else if(r.key==="Escape"){r.stopPropagation(),r.stopImmediatePropagation();const o=document.querySelector('[data-index="calendar-wrapper"]');o==null||o.focus()}};if(G2a.has(e.key))e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),n(e),t&&t(e);else return},q2a=["aria-label"],K2a=["disabled","readOnly","aria-label","data-date","data-weekday","tabindex","onClick"],Y2a={style:{flex:"1"}},J2a=ct({__name:"MainCalendar",props:By({year:{},month:{},startDate:{},endDate:{},timezone:{default:"UTC"},activeField:{default:"start"},requireConfirm:{type:Boolean,default:!1},locale:{default:"en-US"},weekdayLabelStyle:{default:"narrow"},weekStart:{default:0},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Confirm"},immediatelyUpdate:{type:Boolean,default:!1},disabled:{type:Boolean},readOnly:{type:Boolean},disableConfirm:{type:Boolean,default:!1}},{tracingCase:{default:()=>({case:"",behavior:""})},tracingCaseModifiers:{}}),emits:By(["select-start","select-end","select-start-utc","select-end-utc","update:activeField","update:tracingCase","update:month","update:year","close","confirm","cancel","gotoToday"],["update:tracingCase"]),setup(e,{expose:t,emit:n}){const r=qC,a=W(null),i=e,o=z(()=>i.startDate&&i.endDate),s=j$(e,"tracingCase"),l=n,u=W(i.year),c=W(i.month);lt(()=>[i.year,i.month],([j,U])=>{u.value=j,c.value=U});const d=z(()=>Qr.fromObject({year:u.value,month:c.value,day:1},{zone:i.timezone}).setLocale(i.locale||"en-US").toFormat("LLLL yyyy")),p=z(()=>Qr.now().setZone(i.timezone)),h=z(()=>i.startDate?Qr.fromJSDate(i.startDate,{zone:i.timezone}):null),g=z(()=>i.endDate?Qr.fromJSDate(i.endDate,{zone:i.timezone}):null),v=W(h.value),b=W(g.value),_=W(h.value),C=W(g.value);lt([h,g],()=>{i.requireConfirm||(v.value=h.value,b.value=g.value,_.value=h.value,C.value=g.value)},{immediate:!0});const S=z(()=>i.requireConfirm?v.value:h.value),y=z(()=>i.requireConfirm?b.value:g.value);lt(()=>i.activeField,j=>{const U=j==="start"?S.value:y.value;U&&(u.value=U.year,c.value=U.month)}),lt(()=>{var j,U;return[(j=S.value)==null?void 0:j.toISODate(),(U=y.value)==null?void 0:U.toISODate(),i.activeField]},()=>{const j=i.activeField==="start"?S.value:y.value;j&&(j.year!==u.value||j.month!==c.value)&&(u.value=j.year,c.value=j.month)});function T(j){return j.setZone("utc")}const k=W("");function E(j){k.value=j.toISODate()||"",Ct(()=>{const U=document.querySelector(`.arbo-calendar-day[data-date="${k.value}"]`);U==null||U.focus()})}lt(()=>{var j,U;return[u.value,c.value,i.activeField,(j=S.value)==null?void 0:j.toISODate(),(U=y.value)==null?void 0:U.toISODate()]},()=>{const j=i.activeField==="start"?S.value:y.value;let U;j&&j.year===u.value&&j.month===c.value?U=j:S.value&&S.value.year===u.value&&S.value.month===c.value?U=S.value:U=p.value,E(U)});function I(j){return j.toFormat("d")}const D=z(()=>{const j=Qr.fromObject({year:u.value,month:c.value,day:1},{zone:i.timezone}),U=j.weekday,Z=i.weekStart===1?(U+6)%7:U%7;let oe=j.minus({days:Z});const fe=[],ae=oV.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"}),G=Cf();for(let Ee=0;Ee<42;Ee++){const he=[];oe.month!==c.value&&he.push(G["is-outside"]),oe.hasSame(p.value,"day")&&he.push(G["is-today"]),S.value&&oe.hasSame(S.value,"day")&&he.push(G["is-selected-start"]),y.value&&oe.hasSame(y.value,"day")&&he.push(G["is-selected-end"]),S.value&&y.value&&oe>S.value&&oe<y.value&&he.push(G["is-in-range"]);const Pe=I(oe),Te=ae[oe.weekday-1]||"";fe.push({dt:oe,iso:oe.toISODate()||"",label:oe.toFormat("d"),displayLabel:Pe,weekdayLabel:Te,aria:oe.setLocale(i.locale||"en-US").toFormat("cccc, d LLLL yyyy"),classes:he}),oe=oe.plus({days:1})}const Y=[];for(let Ee=0;Ee<6;Ee++)Y.push(fe.slice(Ee*7,Ee*7+7));return Y}),A=z(()=>{const j=oV.weekdays(i.weekdayLabelStyle||"short",{locale:i.locale||"en-US"});return i.weekStart===1?j:[j[6],...j.slice(0,6)]});function R(j,U,Z){const oe=j==="start"?U.startOf("day"):U.endOf("day"),fe=T(oe),ae={year:oe.year,month:oe.month,day:oe.day,utc:fe.toISO()||""};j==="start"?(l("select-start",ae,Z??!0),l("select-start-utc",ae.utc)):(l("select-end",ae),l("select-end-utc",ae.utc))}function B(j){let U=u.value,Z=c.value+j;for(;Z<1;)Z+=12,U-=1;for(;Z>12;)Z-=12,U+=1;u.value=U,c.value=Z,l("update:year",U),l("update:month",Z)}function P(j){const U=(k.value?Qr.fromISO(k.value,{zone:i.timezone}):p.value).plus({days:j});U.month===c.value&&U.year===u.value&&E(U)}function $(j=!1){const U=(k.value?Qr.fromISO(k.value,{zone:i.timezone}):p.value).weekday%7,Z=j?6-U:-U;P(Z)}const V=j=>{N(j)};function N(j){switch(j.preventDefault(),j.stopPropagation(),j.key){case"ArrowLeft":j.preventDefault(),P(-1);break;case"ArrowRight":j.preventDefault(),P(1);break;case"ArrowUp":j.preventDefault(),P(-7);break;case"ArrowDown":j.preventDefault(),P(7);break;case"Home":j.preventDefault(),$(!1);break;case"End":j.preventDefault(),$(!0);break;case"PageUp":j.preventDefault(),B(j.shiftKey?-12:-1);break;case"PageDown":j.preventDefault(),B(j.shiftKey?12:1);break;case"Enter":case" ":{j.preventDefault();const U=k.value?Qr.fromISO(k.value,{zone:i.timezone}):p.value,Z=D.value.flat().find(oe=>oe.iso===U.toISODate());Z&&J(Z);break}}}const q=j=>{const U=Qr.now().setZone(i.timezone);u.value=U.year,c.value=U.month,l("update:year",U.year),l("update:month",U.month),E(U),l("gotoToday")};function J(j){var U,Z;const oe=!!h.value,fe=!!g.value,ae=i.activeField,G=((U=h.value)==null?void 0:U.toISODate())||"null",Y=((Z=g.value)==null?void 0:Z.toISODate())||"null",Ee=j.dt.toISODate()||"",he=(We,Ye)=>{s.value={case:We,behavior:Ye}},Pe=()=>`Selected start ${Ee} > existing end ${Y} -> reset both to ${Ee}`,Te=()=>`Selected end ${Ee} < existing start ${G} -> reset both to ${Ee}`,Ae=()=>{R("start",j.dt,!0),R("end",j.dt),l("update:activeField","end")},xe=(We=!1)=>{R("start",j.dt,We),We&&l("update:activeField","end")},Je=(We=!1)=>{R("end",j.dt),We&&l("close")};if(oe&&fe){ae==="start"?g.value&&j.dt>g.value?(Ae(),he("INVERT_RANGE_FROM_START",Pe())):(xe(!1),he("UPDATE_START_IN_RANGE",`Updated start from ${G} to ${Ee}; end remains ${Y}`)):h.value&&j.dt<h.value?(Ae(),he("INVERT_RANGE_FROM_END",Te())):(Je(!1),he("UPDATE_END_IN_RANGE",`Updated end from ${Y} to ${Ee}; start remains ${G}`));return}if(!oe&&fe&&ae==="start"&&g.value&&j.dt>g.value){Ae(),he("CREATE_RANGE_FROM_LATE_START",Pe());return}if(oe&&!fe&&ae==="end"&&h.value&&j.dt<h.value){Ae(),he("CREATE_RANGE_FROM_EARLY_END",Te());return}if(!oe&&!fe){if(ae==="start"){xe(!0),he("INIT_START",`Picked start ${Ee}; awaiting end selection`);return}Je(i.immediatelyUpdate),he("INIT_END",`Picked end ${Ee}; awaiting start selection`);return}if(!oe&&fe){if(ae==="start"){xe(!0),he("FILL_MISSING_START",`Inserted start ${Ee}; existing end ${Y}`);return}Je(!1),he("STRICT_UPDATE_END_ONLY",`Updated end to ${Ee}; start still null`);return}if(oe&&!fe){if(ae==="start"){xe(!0),he("RESELECT_START_BEFORE_END",`Replaced start with ${Ee}; end still null, switching to end`);return}Je(i.immediatelyUpdate),he("FILL_MISSING_END",`Picked end ${Ee}; start ${G}`);return}}function ie(){_.value=v.value,C.value=b.value,l("confirm")}function de(){v.value=_.value,b.value=C.value,l("cancel")}function ee(){Ct(()=>{var j;(j=a.value)==null||j.focus()})}return nn(()=>{ee()}),t({focus:ee}),(j,U)=>(L(),re("div",{ref_key:"calendarRef",ref:a,class:ke([j.$style["arbo-calendar"],{[j.$style["arbo-date-range-picker"]]:o.value}]),role:"grid","aria-label":d.value,tabindex:"0"},[be("div",{class:ke([j.$style["arbo-calendar-header"],j.$style["arbo-calendar-week"]]),role:"row"},[(L(!0),re($t,null,rn(A.value,Z=>(L(),re("div",{key:Z,class:ke(j.$style["arbo-calendar-weekday"]),role:"columnheader"},vt(Z),3))),128))],2),be("div",{class:ke(j.$style["arbo-calendar-weeks"]),"data-index":"date-selection",tabindex:"0",onKeydownCapture:U[0]||(U[0]=Ot(Z=>F(mA)(Z,V),["prevent","stop"]))},[(L(!0),re($t,null,rn(D.value,(Z,oe)=>(L(),re("div",{key:oe,class:ke(j.$style["arbo-calendar-week"])},[(L(!0),re($t,null,rn(Z,fe=>(L(),re("div",{key:fe.iso,class:ke([j.$style["arbo-calendar-day"],fe.classes,{[j.$style["is-focused"]]:fe.iso===k.value}]),disabled:i.disabled,readOnly:i.readOnly,"aria-label":fe.aria,"data-date":fe.iso,"data-weekday":fe.weekdayLabel,tabindex:fe.iso===k.value?0:-1,onClick:ae=>J(fe)},vt(fe.displayLabel),11,K2a))),128))],2))),128))],34),i.readOnly?Ve("",!0):(L(),re("div",{key:0,class:ke(j.$style["arbo-calendar-actions"])},[be("div",Y2a,[ft((L(),qe(ym,{variant:"secondary",size:"medium",onClick:U[1]||(U[1]=Z=>q()),onKeydown:F(mA),"data-index":"today-btn"},{prefix:Re(()=>[De(Dp,{src:"CalendarDay"})]),_:1},8,["onKeydown"])),[[F(r),"Today"]])]),De(ym,{disabled:i.disabled,readOnly:i.readOnly,onKeydown:F(mA),variant:"secondary",size:"medium",onClick:de,"data-index":"cancel-btn"},{default:Re(()=>[Dt(vt(i.cancelLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"]),De(ym,{disabled:i.disabled||i.disableConfirm,readOnly:i.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:F(mA),onClick:ie},{default:Re(()=>[Dt(vt(i.confirmLabel),1)]),_:1},8,["disabled","readOnly","onKeydown"])],2))],10,q2a))}}),Z2a="_cancel_99b61_156",X2a="_confirm_99b61_161",Q2a={"arbo-date-range-picker":"_arbo-date-range-picker_99b61_1","arbo-calendar-day":"_arbo-calendar-day_99b61_2","arbo-calendar-week":"_arbo-calendar-week_99b61_3","arbo-calendar":"_arbo-calendar_99b61_2","arbo-calendar-nav":"_arbo-calendar-nav_99b61_38","arbo-calendar-nav-btn":"_arbo-calendar-nav-btn_99b61_46","arbo-calendar-nav-label":"_arbo-calendar-nav-label_99b61_53","arbo-calendar-weekday":"_arbo-calendar-weekday_99b61_58","arbo-calendar-weeks":"_arbo-calendar-weeks_99b61_63","is-today":"_is-today_99b61_92","is-selected-start":"_is-selected-start_99b61_97","is-selected-end":"_is-selected-end_99b61_105","is-outside":"_is-outside_99b61_125","is-focused":"_is-focused_99b61_128","is-in-range":"_is-in-range_99b61_133","arbo-calendar-actions":"_arbo-calendar-actions_99b61_139","arbo-calendar-btn":"_arbo-calendar-btn_99b61_147",cancel:Z2a,confirm:X2a},eIa={$style:Q2a},tIa=Tp(J2a,[["__cssModules",eIa]]),nIa=["onClick"],rIa=["variant","onClick"],aIa=ct({__name:"CalendarNavigationControl",props:{year:{},month:{},minYear:{default:1970},maxYear:{default:2100},yearSpan:{default:12},monthLabels:{},locale:{default:"en-US"},monthLabelStyle:{default:"short"},ariaPrevLabel:{default:"Previous"},ariaNextLabel:{default:"Next"},ariaToolbarLabel:{default:"Calendar navigation"},ariaSelectYearLabel:{default:"Select year"},ariaSelectMonthLabel:{default:"Select month"},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["update:year","update:month","mode-change","year-selected","month-selected"],setup(e,{expose:t,emit:n}){const r=e,a=z(()=>{if(r.monthLabels&&r.monthLabels.length===12)return r.monthLabels;const P=r.locale||"en-US",$=r.monthLabelStyle||"short",V=new Intl.DateTimeFormat(P,{month:$,timeZone:"UTC"});return Array.from({length:12},(N,q)=>V.format(new Date(Date.UTC(2020,q,1))))}),i=n,o=W(r.year),s=W(r.month),l=W(r.year);lt(()=>r.year,P=>{P!==o.value&&(o.value=P,l.value=P)}),lt(()=>r.month,P=>{P!==s.value&&(s.value=P)});const u=W("days");function c(P){u.value!==P&&(u.value=P,i("mode-change",P))}const d=z(()=>r.minYear),p=z(()=>r.maxYear),h=z(()=>{const P=r.yearSpan;return l.value-l.value%P}),g=z(()=>h.value+r.yearSpan-1);function v(){const P=r.yearSpan,$=h.value-P;$>=d.value&&(l.value=$)}function b(){const P=r.yearSpan,$=h.value+P;$<=p.value&&(l.value=$)}const _=z(()=>h.value-r.yearSpan<d.value),C=z(()=>g.value+r.yearSpan>p.value),S=z(()=>{const P=r.yearSpan;return Math.ceil(P/3)});function y(P){const $=h.value+(P-1)*3;return Array.from({length:3},(V,N)=>$+N).filter(V=>V<=g.value)}function T(){u.value==="months"?c("days"):c("months")}function k(){u.value==="years"?c("days"):c("years")}function E(P){o.value=P,l.value=P,i("update:year",P),i("year-selected",P),c("months")}function I(P){s.value=P,i("update:month",P),i("month-selected",P),c("days")}function D(){if(u.value==="days"){let P=o.value,$=s.value-1;if($<1&&($=12,P--),P<d.value)return;o.value=P,s.value=$,i("update:year",P),i("update:month",$)}else if(u.value==="months"){if(o.value-1<d.value)return;o.value--,i("update:year",o.value)}else u.value==="years"&&v()}function A(){if(u.value==="days"){let P=o.value,$=s.value+1;if($>12&&($=1,P++),P>p.value)return;o.value=P,s.value=$,i("update:year",P),i("update:month",$)}else if(u.value==="months"){if(o.value+1>p.value)return;o.value++,i("update:year",o.value)}else u.value==="years"&&b()}const R=z(()=>u.value==="days"?o.value===d.value&&s.value===1:u.value==="months"?o.value-1<d.value:_.value),B=z(()=>u.value==="days"?o.value===p.value&&s.value===12:u.value==="months"?o.value+1>p.value:C.value);return t({setNavigation:(P,$)=>{o.value=P,s.value=$}}),(P,$)=>(L(),re("div",{class:ke([P.$style["cal-nav-wrapper"]])},[at(P.$slots,"selection"),u.value==="days"?(L(),re("div",{key:0,class:ke(P.$style["cal-nav-bar"]),"aria-label":"Calendar navigation"},[De(ym,{variant:"tertiary",class:ke([P.$style["cal-nav-btn"],P.$style.prev]),"aria-label":"Previous",disabled:R.value,label:"",onClick:D,"data-index":"prev-btn",onKeydownCapture:Jn(Ot(D,["prevent","stop"]),["enter"]),onKeydown:F(mA)},{default:Re(({hovered:V})=>[De(Dp,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"]),be("div",{class:ke(P.$style["cal-nav-center"])},[De(ym,{"data-index":"month-btn",variant:"secondary",onClick:T,onKeydown:F(mA)},{default:Re(()=>[Dt(vt(a.value[s.value-1]),1)]),_:1},8,["onKeydown"]),De(ym,{variant:"secondary",onClick:k,"data-index":"year-btn",onKeydown:F(mA)},{default:Re(()=>[Dt(vt(o.value),1)]),_:1},8,["onKeydown"])],2),De(ym,{"data-index":"next-btn",variant:"tertiary",class:ke([P.$style["cal-nav-btn"],P.$style.next]),"aria-label":"Next",disabled:B.value,label:"",onClick:A,onKeydownCapture:Jn(Ot(A,["prevent","stop"]),["enter"]),onKeydown:F(mA)},{default:Re(({hovered:V})=>[De(Dp,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture","onKeydown"])],2)):Ve("",!0),u.value==="years"?(L(),re("div",{key:1,class:ke(P.$style["year-grid"])},[be("div",{class:ke(P.$style["year-grid-header"])},[De(ym,{variant:"tertiary",class:ke([P.$style["cal-nav-btn"],P.$style.prev]),"aria-label":"Next",disabled:_.value,"prefix-icon":"AnglesRight",label:"",onClick:v},{default:Re(({hovered:V})=>[De(Dp,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"]),be("div",{class:ke(P.$style["range-label"])},vt(h.value)+" - "+vt(g.value),3),De(ym,{variant:"tertiary",class:ke([P.$style["cal-nav-btn"],P.$style.next]),"aria-label":"Next",disabled:C.value,"prefix-icon":"AnglesRight",label:"",onClick:b},{default:Re(({hovered:V})=>[De(Dp,{src:"AnglesRight",source:"remote",color:V?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled"])],2),be("div",{class:ke(P.$style["year-grid-body"]),role:"grid","data-index":"year-selection"},[(L(!0),re($t,null,rn(S.value,V=>(L(),re("div",{key:"yr-row-"+V,class:ke(P.$style["year-grid-row"])},[(L(!0),re($t,null,rn(y(V),N=>(L(),re("a",{key:N,tabindex:"0",class:ke([P.$style["year-cell"],{[P.$style.selected]:N===o.value}]),onClick:q=>E(N)},vt(N),11,nIa))),128))],2))),128))],2)],2)):u.value==="months"?(L(),re("div",{key:2,class:ke(P.$style["month-grid"]),"aria-label":"Select month","data-index":"month-selection"},[be("div",{class:ke(P.$style.months)},[(L(!0),re($t,null,rn(a.value,(V,N)=>(L(),re("a",{tabindex:"0",key:V,variant:N+1===s.value?"primary":"text",class:ke([P.$style["month-cell"],{[P.$style.selected]:N+1===s.value}]),onClick:q=>I(N+1)},vt(V),11,rIa))),128))],2)],2)):(L(),re("div",{key:3,class:ke(P.$style["days-slot"])},[at(P.$slots,"default",{year:o.value,month:s.value,mode:u.value})],2))],2))}}),iIa="_prev_mtd4w_33",oIa="_months_mtd4w_75",sIa="_selected_mtd4w_131",lIa={"cal-nav-wrapper":"_cal-nav-wrapper_mtd4w_1","cal-nav-bar":"_cal-nav-bar_mtd4w_12","cal-nav-btn":"_cal-nav-btn_mtd4w_20",prev:iIa,"year-grid-header":"_year-grid-header_mtd4w_37","cal-nav-center":"_cal-nav-center_mtd4w_46","cal-nav-label":"_cal-nav-label_mtd4w_52","month-grid":"_month-grid_mtd4w_66","year-grid":"_year-grid_mtd4w_37",months:oIa,"month-cell":"_month-cell_mtd4w_82","year-cell":"_year-cell_mtd4w_83","pg-btn":"_pg-btn_mtd4w_105","year-grid-body":"_year-grid-body_mtd4w_118","year-grid-row":"_year-grid-row_mtd4w_125",selected:sIa,"days-slot":"_days-slot_mtd4w_137","range-label":"_range-label_mtd4w_141"},uIa={$style:lIa},cIa=Tp(aIa,[["__cssModules",uIa]]);function dIa(e){const{format:t="dd/MM/yyyy",timezone:n="local",minDate:r,maxDate:a}=e,i=W(""),o=z(()=>{const p=Qr.fromFormat(i.value,t,{zone:n});return p.isValid?p:null}),s=z(()=>{if(!r||!o.value)return!0;const p={year:r.getFullYear(),month:r.getMonth()+1,day:r.getDate()},h={year:o.value.year,month:o.value.month,day:o.value.day};return h.year>p.year?!0:h.year<p.year?!1:h.month>p.month?!0:h.month<p.month?!1:l(h,p)>=0}),l=(p,h)=>{const g=new Date(p.year,p.month-1,p.day),v=new Date(h.year,h.month-1,h.day);return g<v?-1:g>v?1:0},u=z(()=>{if(!a||!o.value)return!0;const p={year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate()},h={year:o.value.year,month:o.value.month,day:o.value.day};return h.year<p.year?!0:h.year>p.year?!1:h.month<p.month?!0:h.month>p.month?!1:l(h,p)<=0}),c=z(()=>i.value.length==0||i.value.length>0&&o.value!==null&&s.value&&u.value),d=z(()=>i.value.length===t.length&&c.value);return{inputValue:i,isValid:c,isComplete:d,clear:()=>{i.value=""},setDate:p=>{let h;p instanceof Date?h=Qr.fromJSDate(p,{zone:n}):h=p.setZone(n),h.isValid?i.value=h.toFormat(t):i.value=""},getDate:()=>c.value?o.value:null}}const fIa={key:0,style:{marginLeft:"8px"}},hIa=["disabled","readonly","placeholder"],pIa=ct({__name:"DateInput",props:{modelValue:{},format:{default:"dd/MM/yyyy"},showDebug:{type:Boolean,default:!0},allowPastDates:{type:Boolean,default:!0},allowFutureDates:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},timezone:{default:""},placeholder:{default:""},size:{},minDate:{default:void 0},maxDate:{default:void 0},isMultipleDate:{type:Boolean,default:!1}},emits:["complete","invalid","clear","blur","tab"],setup(e,{expose:t,emit:n}){const r=qC,a=e,i=n,o=W(null),s=W(null),{isValid:l,isComplete:u,inputValue:c,clear:d,setDate:p,getDate:h}=dIa({format:a.format,allowPastDates:a.allowPastDates,allowFutureDates:a.allowFutureDates,timezone:a.timezone,minDate:a.minDate,maxDate:a.maxDate}),g=z(()=>a.active),v=z(()=>({disabled:a.disabled,error:!l.value&&c.value.length>0,readOnly:a.readOnly,isEmpty:c.value.length===0,inputRef:o,wrapperRef:s,active:g})),{argsMain:b,isHover:_,isFocus:C}=Wse(v),S=I=>{var D;const A=(D=I.clipboardData)==null?void 0:D.getData("text/plain");A&&(c.value=A.trim())},y=I=>{if(I.key==="Escape"){i("blur"),I.target.blur(),I.preventDefault(),I.stopPropagation(),I.stopImmediatePropagation();return}else I.key==="Tab"&&E(I)},T=()=>{d(),i("clear")};t({clear:T,setDate:p,getDate:h,focus:()=>{var I;return(I=o.value)==null?void 0:I.focus()}}),lt(()=>a.modelValue,I=>{I?p(I):d()},{immediate:!0}),lt([()=>u.value,()=>c.value],()=>{if(c.value.length===0)i("complete",null);else if(l.value&&!a.readOnly&&!a.disabled&&u.value){const I=h();(I||c.value.length===0)&&i("complete",I)}}),lt(()=>l.value,I=>{I||i("invalid","")});const k=z(()=>!!a.isMultipleDate),E=I=>{I.preventDefault(),I.stopImmediatePropagation(),I.stopPropagation(),i("tab",I)};return(I,D)=>(L(),qe(Gse,Zt(F(b),{ref_key:"wrapperRef",ref:s,bordered:!0,actived:g.value,size:32,style:{padding:"0 4px 0 0",background:"#FAFAFA"}}),{default:Re(()=>[be("div",{class:ke([I.$style["date-input-wrapper"]])},[k.value?(L(),re("span",fIa," Multiple ")):ft((L(),re("input",{key:1,disabled:a.disabled,readonly:a.readOnly,ref_key:"inputRef",ref:o,type:"text","onUpdate:modelValue":D[0]||(D[0]=A=>Or(c)?c.value=A:null),onPaste:Ot(S,["prevent"]),placeholder:a.placeholder,class:ke([I.$style["date-input"]]),onKeydown:y},null,42,hIa)),[[Jc,F(c)]]),at(I.$slots,"clear",{handleClear:T},()=>[(F(c).length>0||k.value)&&!a.readOnly&&!a.disabled&&(F(_)||F(C))?ft((L(),qe(ym,{key:0,variant:["icon","primary"],onClick:Ot(T,["stop"]),size:16,rounded:!0},{default:Re(()=>[De(Dp,{src:"XMarkSolid",source:"remote",size:"8",color:"white"})]),_:1})),[[F(r),"Clear"]]):(L(),qe(Dp,{key:1,src:"Calendar",source:"remote",class:ke(I.$style["icon-calendar"]),color:"var(--grey-200)"},null,8,["class"]))])],2)]),_:3},16,["actived"]))}}),mIa="_focus_132fk_12",gIa="_hover_132fk_12",vIa="_active_132fk_12",yIa="_invalid_132fk_38",bIa={"date-input-wrapper":"_date-input-wrapper_132fk_1","icon-calendar":"_icon-calendar_132fk_9",focus:mIa,hover:gIa,active:vIa,"date-input":"_date-input_132fk_1",invalid:yIa},wIa={$style:bIa},wBt=Tp(pIa,[["__cssModules",wIa]]);pBt();const _Ia=["onKeydown"],CIa=["width","height","viewBox"],SIa=["d"],kIa="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",EIa=ct({__name:"RatingComponent",props:{params:{default:()=>({maxRating:5,readOnly:!1,disabled:!1})},modelValue:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},emits:["update","update:modelValue","change","handleEnter","cancel"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=W(r.modelValue??0),o=W(null),s=z(()=>{var R;return((R=r.params)==null?void 0:R.size)??24}),l=z(()=>{var R;return((R=r.params)==null?void 0:R.iconViewBox)??"0 0 24 24"}),u=z(()=>{var R;return((R=r.params)==null?void 0:R.iconPath)??kIa}),c=z(()=>{var R;return((R=r.params)==null?void 0:R.wrapperTag)??"span"}),d=z(()=>{var R;return r.disabled||((R=r.params)==null?void 0:R.disabled)||!1}),p=z(()=>{var R;return r.readOnly||((R=r.params)==null?void 0:R.readOnly)||!1}),h=z(()=>!d.value&&!p.value),g=z(()=>d.value?"not-allowed":p.value?"default":"pointer");lt(()=>r.modelValue,R=>{typeof R=="number"&&R!==i.value&&(i.value=R)});const v=R=>{var B;return((B=r.params)==null?void 0:B.maxRating)-R+1<=i.value&&!b.value},b=W(!1),_=()=>{b.value=!0},C=()=>{b.value=!1},S=R=>{h.value&&y(R)},y=R=>{var B,P;if(!h.value)return;let $=((B=r.params)==null?void 0:B.maxRating)-R+1;$===i.value&&($=0),i.value=$,a("update:modelValue",$),a("update",$),a("change",$),(P=r.params)!=null&&P.onUpdate&&r.params.onUpdate($)},T=R=>{var B;R!==i.value&&(i.value=R,a("update:modelValue",R),a("update",R),a("change",R),(B=r.params)!=null&&B.onUpdate&&r.params.onUpdate(R),k.value=R)},k=W(i.value),E=R=>{R.preventDefault(),R.stopPropagation(),R.stopImmediatePropagation(),i.value=k.value,a("cancel")},I=R=>{R.preventDefault(),T(i.value),a("handleEnter",i.value)},D=()=>{h.value&&(i.value=Math.min(i.value+1%(r.params.maxRating+1),r.params.maxRating),T(i.value))},A=()=>{h.value&&(i.value=Math.max(i.value-1,0),T(i.value))};return t({focus:()=>{var R;(R=o.value)==null||R.focus()}}),(R,B)=>(L(),re("div",{class:ke(["rating-component",{"rating-component--disabled":d.value,"rating-component--readOnly":p.value}]),style:Yt({"--max-rating":e.params.maxRating}),ref_key:"ratingRef",ref:o,tabindex:"1",onKeydown:[Jn(Ot(A,["prevent"]),["left"]),Jn(Ot(D,["prevent"]),["right"]),Jn(Ot(A,["prevent"]),["down"]),Jn(Ot(D,["prevent"]),["up"]),Jn(Ot(I,["prevent"]),["enter"]),Jn(Ot(I,["prevent"]),["tab"]),Jn(Ot(E,["prevent"]),["escape"])]},[(L(!0),re($t,null,rn(e.params.maxRating,P=>(L(),qe(sc(c.value),{key:P,class:ke(["rating-item",{filled:v(P),"rating-item--disabled":d.value,"rating-item--readOnly":p.value}]),style:Yt({cursor:g.value,order:e.params.maxRating-P,height:s.value+"px",width:s.value+"px"}),"aria-checked":v(P),"aria-disabled":d.value,"aria-readOnly":p.value,title:e.params.maxRating-P+1,tabindex:-1,onClick:Ot($=>S(P),["prevent","stop"]),onMouseenter:_,onMouseleave:C},{default:Re(()=>[at(R.$slots,"icon",{index:P,filled:v(P),size:s.value,iconViewBox:l.value,disabled:d.value,readOnly:p.value,value:P},()=>[(L(),re("svg",{class:"rating-icon",width:s.value,height:s.value,viewBox:l.value,"aria-hidden":"true",focusable:"false"},[be("path",{d:u.value},null,8,SIa)],8,CIa))]),at(R.$slots,"overlay",{index:P,filled:v(P),disabled:d.value,readOnly:p.value})]),_:2},1064,["class","style","aria-checked","aria-disabled","aria-readOnly","title","onClick"]))),128))],46,_Ia))}}),xIa={style:{maxWidth:"180px",lineHeight:"15px"}},TIa=["innerHTML"],DIa=ct({__name:"MetricEditorDropdown",props:{config:{},modelValue:{}},emits:["update:modelValue","change","close","handleCancel"],setup(e,{expose:t,emit:n}){const r=qC,a=e,i=n,o=()=>{i("handleCancel")},s=()=>{i("close")},l=b=>{var _;if(b.format_type==="dropdown"&&b.format_value)try{const C=JSON.parse(b.format_value);if(Array.isArray(C)){const S=C.map(y=>({label:y.name,value:y.name,id:y.name}));return S.unshift({label:"-",value:void 0,id:"-"}),S}}catch(C){console.error("Failed to parse dropdown options",C)}if(b.format_type=="number"&&b.restricted_type=="exact"){const C=((_=b.restricted_value)==null?void 0:_.split(",").map(S=>({label:b.mapping[`!${S}`]||S,value:S,id:S})))||[];return C.unshift({label:"-",value:void 0,id:"-"}),C}return[]},u=z(()=>l(a.config)),c=W(a.modelValue),d=b=>{c.value=b,i("update:modelValue",b),i("change",b||null)},p=W(u.value),h=W(!1),g=b=>{h.value=!0,b?p.value=u.value.filter(_=>_.label.toLowerCase().includes(b.toLowerCase())):p.value=u.value,setTimeout(()=>{h.value=!1},300)},v=W(null);return nn(()=>{var b;(b=v.value)==null||b.focus()}),t({focus:()=>{var b;(b=v.value)==null||b.focus()}}),(b,_)=>(L(),qe(W2a,{style:{width:326},loading:h.value,options:p.value,"selected-id":e.modelValue||void 0,onSearch:g,onSelect:_[0]||(_[0]=C=>d(C.id)),ref_key:"searchListRef",ref:v,onClose:s,onCancel:o},{item:Re(({item:C,getHighlightedLabel:S,selectedIndex:y,index:T})=>[De(bBt,{hover:y==T,selected:C.value===e.modelValue,label:C.label,onSelect:k=>d(C.value||null),onClick:k=>d(C.value||null)},{label:Re(()=>[be("div",xIa,[ft(be("span",{innerHTML:S(C.label)},null,8,TIa),[[F(r),{content:C.label}]])])]),_:2},1032,["hover","selected","label","onSelect","onClick"])]),"empty-list":Re(()=>[..._[1]||(_[1]=[Dt("No options available.",-1)])]),_:1},8,["loading","options","selected-id"]))}}),AIa={class:"metric-input-wrapper"},OIa={key:0,class:"error-text input-2"},IIa=ct({__name:"MetricEditorInput",props:{config:{},modelValue:{},saveOnBlur:{type:Boolean,default:!0},saveOnEscape:{type:Boolean,default:!1},showInlineError:{type:Boolean,default:!1}},emits:["update:modelValue","handleChange","cancel","enter","onValidation"],setup(e,{expose:t,emit:n}){const r=qC,a=e,i=W(a.modelValue),o=W(a.modelValue),s=W(!1),l=W(!0),u=W(""),c=z(()=>{var $;const V=Number.parseInt(String(($=a.config)==null?void 0:$.format_value)||"2",10);return Number.isFinite(V)&&V>=0?V:2}),d=$=>{if(!$)return $;const V=String($).split(".");return V.length>1&&V[1].length>c.value?c.value===0?V[0]:`${V[0]}.${V[1].slice(0,c.value)}`:String($)},p=$=>{const V=d($);V!==$&&S.value?i.value=V:i.value=$},h=$=>{const V=$.target;if(!V)return;const N=V.value||"",q=N.indexOf(".");if($.key==="."&&c.value===0){$.preventDefault();return}q!==-1&&/[0-9]/.test($.key)&&N.slice(q+1).length>=c.value&&$.preventDefault()},g=z(()=>l.value||a.showInlineError?{content:""}:{content:u.value,placement:"top",theme:"error",trigger:"mouseenter focus",hideOnClick:!1,interactive:!0,showOnCreate:!0,alwayShow:!0,maxWidth:"200px"}),v=()=>{var $;const V=a.config.restricted_type.trim(),N=(($=a.config.restricted_value)==null?void 0:$.split(",").map(Number))||[],[q,J]=N,ie={range:`Enter a value between ${q} and ${J}`,not:`These values are not allowed: ${N.join(", ")}`,exact:"Value is not allowed"}[V];return l.value?"":ie},b=z(()=>{var $;let V="";return Number(($=a.config)==null?void 0:$.format_value)&&(V+="."+Array.from({length:Number(a.config.format_value)}).map(()=>"0").join("")),`0${V}`});lt(()=>a.modelValue,$=>{i.value=$,o.value=$});const _=$=>URe(a.config,$),C=n,S=W(null),y=$=>{const V=$===""?null:$,N=o.value===""?null:o.value;return V!==N},T=$=>{const V=d($);if(!y(V))return!1;const N=V===""?null:V;return i.value=N,o.value=N,C("update:modelValue",N),C("handleChange",N),!0},k=()=>{i.value=o.value,C("update:modelValue",o.value)},E=($,V)=>{T($),C("enter")},I=($,V)=>{if(s.value){s.value=!1;return}a.saveOnBlur?T($):k()},D=$=>{if($===null||$===""){l.value=!0;return}l.value=URe(a.config,Number($)),u.value=l.value?"":v()},A=($,V)=>{s.value=!0,a.saveOnEscape?T($):k(),C("cancel"),setTimeout(()=>{s.value=!1},100)},R=$=>{D($),C("onValidation",$)},B=()=>{s.value=!0,k(),C("cancel"),setTimeout(()=>{s.value=!1},100)},P=()=>{var $;i.value=null,o.value=null,C("update:modelValue",null),C("handleChange",null),($=S.value)==null||$.focus()};return t({focus:()=>{var $;return($=S.value)==null?void 0:$.focus()},blur:()=>{var $;return($=S.value)==null?void 0:$.blur()},getValue:()=>i.value,getCachedValue:()=>o.value,save:()=>T(i.value),revert:k}),nn(()=>{var $;($=S.value)==null||$.focus()}),($,V)=>ft((L(),re("div",AIa,[De(yBt,{maxDecimalChar:c.value,modelValue:i.value,"onUpdate:modelValue":V[0]||(V[0]=N=>i.value=N),placeholder:b.value,validatorFnc:_,style:{"--bg-input":"#FAFAFA"},onInput:p,onKeydown:h,onEnter:E,onBlur:I,onClear:P,onEscape:A,onCancel:B,onOnValidation:R,type:"number",autoEmit:!1,submitOnEnter:!0,blurOnEscape:!1,ref_key:"inputRef",ref:S},null,8,["maxDecimalChar","modelValue","placeholder"]),!l.value&&e.showInlineError?(L(),re("span",OIa,vt(u.value),1)):Ve("",!0)])),[[F(r),g.value]])}});var uV=(e=>(e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.TOO_EARLY=425]="TOO_EARLY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",e))(uV||{});function _Bt(e,t){return function(){return e.apply(t,arguments)}}const{toString:RIa}=Object.prototype,{getPrototypeOf:GRe}=Object,{iterator:qse,toStringTag:CBt}=Symbol,Kse=(e=>t=>{const n=RIa.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),I_=e=>(e=e.toLowerCase(),t=>Kse(t)===e),Yse=e=>t=>typeof t===e,{isArray:cV}=Array,dV=Yse("undefined");function oG(e){return e!==null&&!dV(e)&&e.constructor!==null&&!dV(e.constructor)&&Ig(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const SBt=I_("ArrayBuffer");function $Ia(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&SBt(e.buffer),t}const PIa=Yse("string"),Ig=Yse("function"),kBt=Yse("number"),sG=e=>e!==null&&typeof e=="object",MIa=e=>e===!0||e===!1,Jse=e=>{if(Kse(e)!=="object")return!1;const t=GRe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(CBt in e)&&!(qse in e)},NIa=e=>{if(!sG(e)||oG(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},LIa=I_("Date"),FIa=I_("File"),BIa=I_("Blob"),VIa=I_("FileList"),UIa=e=>sG(e)&&Ig(e.pipe),HIa=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ig(e.append)&&((t=Kse(e))==="formdata"||t==="object"&&Ig(e.toString)&&e.toString()==="[object FormData]"))},jIa=I_("URLSearchParams"),[zIa,WIa,GIa,qIa]=["ReadableStream","Request","Response","Headers"].map(I_),KIa=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function lG(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),cV(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{if(oG(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let s;for(r=0;r<o;r++)s=i[r],t.call(null,e[s],s,e)}}function EBt(e,t){if(oG(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,a;for(;r-- >0;)if(a=n[r],t===a.toLowerCase())return a;return null}const QR=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xBt=e=>!dV(e)&&e!==QR;function qRe(){const{caseless:e,skipUndefined:t}=xBt(this)&&this||{},n={},r=(a,i)=>{const o=e&&EBt(n,i)||i;Jse(n[o])&&Jse(a)?n[o]=qRe(n[o],a):Jse(a)?n[o]=qRe({},a):cV(a)?n[o]=a.slice():(!t||!dV(a))&&(n[o]=a)};for(let a=0,i=arguments.length;a<i;a++)arguments[a]&&lG(arguments[a],r);return n}const YIa=(e,t,n,{allOwnKeys:r}={})=>(lG(t,(a,i)=>{n&&Ig(a)?e[i]=_Bt(a,n):e[i]=a},{allOwnKeys:r}),e),JIa=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ZIa=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},XIa=(e,t,n,r)=>{let a,i,o;const s={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)o=a[i],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&GRe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},QIa=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},eRa=e=>{if(!e)return null;if(cV(e))return e;let t=e.length;if(!kBt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},tRa=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&GRe(Uint8Array)),nRa=(e,t)=>{const n=(e&&e[qse]).call(e);let r;for(;(r=n.next())&&!r.done;){const a=r.value;t.call(e,a[0],a[1])}},rRa=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},aRa=I_("HTMLFormElement"),iRa=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,r){return n.toUpperCase()+r}),TBt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),oRa=I_("RegExp"),DBt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};lG(n,(a,i)=>{let o;(o=t(a,i,e))!==!1&&(r[i]=o||a)}),Object.defineProperties(e,r)},sRa=e=>{DBt(e,(t,n)=>{if(Ig(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ig(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},lRa=(e,t)=>{const n={},r=a=>{a.forEach(i=>{n[i]=!0})};return cV(e)?r(e):r(String(e).split(t)),n},uRa=()=>{},cRa=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function dRa(e){return!!(e&&Ig(e.append)&&e[CBt]==="FormData"&&e[qse])}const fRa=e=>{const t=new Array(10),n=(r,a)=>{if(sG(r)){if(t.indexOf(r)>=0)return;if(oG(r))return r;if(!("toJSON"in r)){t[a]=r;const i=cV(r)?[]:{};return lG(r,(o,s)=>{const l=n(o,a+1);!dV(l)&&(i[s]=l)}),t[a]=void 0,i}}return r};return n(e,0)},hRa=I_("AsyncFunction"),pRa=e=>e&&(sG(e)||Ig(e))&&Ig(e.then)&&Ig(e.catch),ABt=((e,t)=>e?setImmediate:t?((n,r)=>(QR.addEventListener("message",({source:a,data:i})=>{a===QR&&i===n&&r.length&&r.shift()()},!1),a=>{r.push(a),QR.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ig(QR.postMessage)),mRa=typeof queueMicrotask<"u"?queueMicrotask.bind(QR):typeof ze<"u"&&ze.nextTick||ABt,gRa=e=>e!=null&&Ig(e[qse]),vn={isArray:cV,isArrayBuffer:SBt,isBuffer:oG,isFormData:HIa,isArrayBufferView:$Ia,isString:PIa,isNumber:kBt,isBoolean:MIa,isObject:sG,isPlainObject:Jse,isEmptyObject:NIa,isReadableStream:zIa,isRequest:WIa,isResponse:GIa,isHeaders:qIa,isUndefined:dV,isDate:LIa,isFile:FIa,isBlob:BIa,isRegExp:oRa,isFunction:Ig,isStream:UIa,isURLSearchParams:jIa,isTypedArray:tRa,isFileList:VIa,forEach:lG,merge:qRe,extend:YIa,trim:KIa,stripBOM:JIa,inherits:ZIa,toFlatObject:XIa,kindOf:Kse,kindOfTest:I_,endsWith:QIa,toArray:eRa,forEachEntry:nRa,matchAll:rRa,isHTMLForm:aRa,hasOwnProperty:TBt,hasOwnProp:TBt,reduceDescriptors:DBt,freezeMethods:sRa,toObjectSet:lRa,toCamelCase:iRa,noop:uRa,toFiniteNumber:cRa,findKey:EBt,global:QR,isContextDefined:xBt,isSpecCompliantForm:dRa,toJSONObject:fRa,isAsyncFn:hRa,isThenable:pRa,setImmediate:ABt,asap:mRa,isIterable:gRa};function Fi(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}vn.inherits(Fi,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:vn.toJSONObject(this.config),code:this.code,status:this.status}}});const OBt=Fi.prototype,IBt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{IBt[e]={value:e}}),Object.defineProperties(Fi,IBt),Object.defineProperty(OBt,"isAxiosError",{value:!0}),Fi.from=(e,t,n,r,a,i)=>{const o=Object.create(OBt);vn.toFlatObject(e,o,function(u){return u!==Error.prototype},u=>u!=="isAxiosError");const s=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return Fi.call(o,s,l,n,r,a),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};const vRa=null;function KRe(e){return vn.isPlainObject(e)||vn.isArray(e)}function RBt(e){return vn.endsWith(e,"[]")?e.slice(0,-2):e}function $Bt(e,t,n){return e?e.concat(t).map(function(r,a){return r=RBt(r),!n&&a?"["+r+"]":r}).join(n?".":""):t}function yRa(e){return vn.isArray(e)&&!e.some(KRe)}const bRa=vn.toFlatObject(vn,{},null,function(e){return/^is[A-Z]/.test(e)});function Zse(e,t,n){if(!vn.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=vn.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,g){return!vn.isUndefined(g[h])});const r=n.metaTokens,a=n.visitor||u,i=n.dots,o=n.indexes,s=(n.Blob||typeof Blob<"u"&&Blob)&&vn.isSpecCompliantForm(t);if(!vn.isFunction(a))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(vn.isDate(h))return h.toISOString();if(vn.isBoolean(h))return h.toString();if(!s&&vn.isBlob(h))throw new Fi("Blob is not supported. Use a Buffer instead.");return vn.isArrayBuffer(h)||vn.isTypedArray(h)?s&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,g,v){let b=h;if(h&&!v&&typeof h=="object"){if(vn.endsWith(g,"{}"))g=r?g:g.slice(0,-2),h=JSON.stringify(h);else if(vn.isArray(h)&&yRa(h)||(vn.isFileList(h)||vn.endsWith(g,"[]"))&&(b=vn.toArray(h)))return g=RBt(g),b.forEach(function(_,C){!(vn.isUndefined(_)||_===null)&&t.append(o===!0?$Bt([g],C,i):o===null?g:g+"[]",l(_))}),!1}return KRe(h)?!0:(t.append($Bt(v,g,i),l(h)),!1)}const c=[],d=Object.assign(bRa,{defaultVisitor:u,convertValue:l,isVisitable:KRe});function p(h,g){if(!vn.isUndefined(h)){if(c.indexOf(h)!==-1)throw Error("Circular reference detected in "+g.join("."));c.push(h),vn.forEach(h,function(v,b){(!(vn.isUndefined(v)||v===null)&&a.call(t,v,vn.isString(b)?b.trim():b,g,d))===!0&&p(v,g?g.concat(b):[b])}),c.pop()}}if(!vn.isObject(e))throw new TypeError("data must be an object");return p(e),t}function PBt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function YRe(e,t){this._pairs=[],e&&Zse(e,this,t)}const MBt=YRe.prototype;MBt.append=function(e,t){this._pairs.push([e,t])},MBt.toString=function(e){const t=e?function(n){return e.call(this,n,PBt)}:PBt;return this._pairs.map(function(n){return t(n[0])+"="+t(n[1])},"").join("&")};function wRa(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function NBt(e,t,n){if(!t)return e;const r=n&&n.encode||wRa;vn.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let i;if(a?i=a(t,n):i=vn.isURLSearchParams(t)?t.toString():new YRe(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class LBt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){vn.forEach(this.handlers,function(n){n!==null&&t(n)})}}const FBt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_Ra=typeof URLSearchParams<"u"?URLSearchParams:YRe,CRa=typeof FormData<"u"?FormData:null,SRa=typeof Blob<"u"?Blob:null,kRa={isBrowser:!0,classes:{URLSearchParams:_Ra,FormData:CRa,Blob:SRa},protocols:["http","https","file","blob","url","data"]},JRe=typeof window<"u"&&typeof document<"u",ZRe=typeof navigator=="object"&&navigator||void 0,ERa=JRe&&(!ZRe||["ReactNative","NativeScript","NS"].indexOf(ZRe.product)<0),xRa=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",TRa=JRe&&window.location.href||"http://localhost",DRa=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:JRe,hasStandardBrowserEnv:ERa,hasStandardBrowserWebWorkerEnv:xRa,navigator:ZRe,origin:TRa},Symbol.toStringTag,{value:"Module"})),Ip={...DRa,...kRa};function ARa(e,t){return Zse(e,new Ip.classes.URLSearchParams,{visitor:function(n,r,a,i){return Ip.isNode&&vn.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function ORa(e){return vn.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function IRa(e){const t={},n=Object.keys(e);let r;const a=n.length;let i;for(r=0;r<a;r++)i=n[r],t[i]=e[i];return t}function BBt(e){function t(n,r,a,i){let o=n[i++];if(o==="__proto__")return!0;const s=Number.isFinite(+o),l=i>=n.length;return o=!o&&vn.isArray(a)?a.length:o,l?(vn.hasOwnProp(a,o)?a[o]=[a[o],r]:a[o]=r,!s):((!a[o]||!vn.isObject(a[o]))&&(a[o]=[]),t(n,r,a[o],i)&&vn.isArray(a[o])&&(a[o]=IRa(a[o])),!s)}if(vn.isFormData(e)&&vn.isFunction(e.entries)){const n={};return vn.forEachEntry(e,(r,a)=>{t(ORa(r),a,n,0)}),n}return null}function RRa(e,t,n){if(vn.isString(e))try{return(t||JSON.parse)(e),vn.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const uG={transitional:FBt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,a=vn.isObject(e);if(a&&vn.isHTMLForm(e)&&(e=new FormData(e)),vn.isFormData(e))return r?JSON.stringify(BBt(e)):e;if(vn.isArrayBuffer(e)||vn.isBuffer(e)||vn.isStream(e)||vn.isFile(e)||vn.isBlob(e)||vn.isReadableStream(e))return e;if(vn.isArrayBufferView(e))return e.buffer;if(vn.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return ARa(e,this.formSerializer).toString();if((i=vn.isFileList(e))||n.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return Zse(i?{"files[]":e}:e,o&&new o,this.formSerializer)}}return a||r?(t.setContentType("application/json",!1),RRa(e)):e}],transformResponse:[function(e){const t=this.transitional||uG.transitional,n=t&&t.forcedJSONParsing,r=this.responseType==="json";if(vn.isResponse(e)||vn.isReadableStream(e))return e;if(e&&vn.isString(e)&&(n&&!this.responseType||r)){const a=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(i){if(a)throw i.name==="SyntaxError"?Fi.from(i,Fi.ERR_BAD_RESPONSE,this,null,this.response):i}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ip.classes.FormData,Blob:Ip.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};vn.forEach(["delete","get","head","post","put","patch"],e=>{uG.headers[e]={}});const $Ra=vn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),PRa=e=>{const t={};let n,r,a;return e&&e.split(`
1032
1032
  `).forEach(function(i){a=i.indexOf(":"),n=i.substring(0,a).trim().toLowerCase(),r=i.substring(a+1).trim(),!(!n||t[n]&&$Ra[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},VBt=Symbol("internals");function cG(e){return e&&String(e).trim().toLowerCase()}function Xse(e){return e===!1||e==null?e:vn.isArray(e)?e.map(Xse):String(e)}function MRa(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const NRa=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function XRe(e,t,n,r,a){if(vn.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!vn.isString(t)){if(vn.isString(r))return t.indexOf(r)!==-1;if(vn.isRegExp(r))return r.test(t)}}function LRa(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function FRa(e,t){const n=vn.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,i,o){return this[r].call(this,t,a,i,o)},configurable:!0})})}let Rg=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function a(o,s,l){const u=cG(s);if(!u)throw new Error("header name must be a non-empty string");const c=vn.findKey(r,u);(!c||r[c]===void 0||l===!0||l===void 0&&r[c]!==!1)&&(r[c||s]=Xse(o))}const i=(o,s)=>vn.forEach(o,(l,u)=>a(l,u,s));if(vn.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(vn.isString(e)&&(e=e.trim())&&!NRa(e))i(PRa(e),t);else if(vn.isObject(e)&&vn.isIterable(e)){let o={},s,l;for(const u of e){if(!vn.isArray(u))throw TypeError("Object iterator must return a key-value pair");o[l=u[0]]=(s=o[l])?vn.isArray(s)?[...s,u[1]]:[s,u[1]]:u[1]}i(o,t)}else e!=null&&a(t,e,n);return this}get(e,t){if(e=cG(e),e){const n=vn.findKey(this,e);if(n){const r=this[n];if(!t)return r;if(t===!0)return MRa(r);if(vn.isFunction(t))return t.call(this,r,n);if(vn.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=cG(e),e){const n=vn.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||XRe(this,this[n],n,t)))}return!1}delete(e,t){const n=this;let r=!1;function a(i){if(i=cG(i),i){const o=vn.findKey(n,i);o&&(!t||XRe(n,n[o],o,t))&&(delete n[o],r=!0)}}return vn.isArray(e)?e.forEach(a):a(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const a=t[n];(!e||XRe(this,this[a],a,e,!0))&&(delete this[a],r=!0)}return r}normalize(e){const t=this,n={};return vn.forEach(this,(r,a)=>{const i=vn.findKey(n,a);if(i){t[i]=Xse(r),delete t[a];return}const o=e?LRa(a):String(a).trim();o!==a&&delete t[a],t[o]=Xse(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return vn.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&vn.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
1033
1033
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(r=>n.set(r)),n}static accessor(e){const t=(this[VBt]=this[VBt]={accessors:{}}).accessors,n=this.prototype;function r(a){const i=cG(a);t[i]||(FRa(n,a),t[i]=!0)}return vn.isArray(e)?e.forEach(r):r(e),this}};Rg.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),vn.reduceDescriptors(Rg.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),vn.freezeMethods(Rg);function QRe(e,t){const n=this||uG,r=t||n,a=Rg.from(r.headers);let i=r.data;return vn.forEach(e,function(o){i=o.call(n,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function UBt(e){return!!(e&&e.__CANCEL__)}function fV(e,t,n){Fi.call(this,e??"canceled",Fi.ERR_CANCELED,t,n),this.name="CanceledError"}vn.inherits(fV,Fi,{__CANCEL__:!0});function HBt(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Fi("Request failed with status code "+n.status,[Fi.ERR_BAD_REQUEST,Fi.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function BRa(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function VRa(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,i=0,o;return t=t!==void 0?t:1e3,function(s){const l=Date.now(),u=r[i];o||(o=l),n[a]=s,r[a]=l;let c=i,d=0;for(;c!==a;)d+=n[c++],c=c%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),l-o<t)return;const p=u&&l-u;return p?Math.round(d*1e3/p):void 0}}function URa(e,t){let n=0,r=1e3/t,a,i;const o=(s,l=Date.now())=>{n=l,a=null,i&&(clearTimeout(i),i=null),e(...s)};return[(...s)=>{const l=Date.now(),u=l-n;u>=r?o(s,l):(a=s,i||(i=setTimeout(()=>{i=null,o(a)},r-u)))},()=>a&&o(a)]}const Qse=(e,t,n=3)=>{let r=0;const a=VRa(50,250);return URa(i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,l=o-r,u=a(l),c=o<=s;r=o;const d={loaded:o,total:s,progress:s?o/s:void 0,bytes:l,rate:u||void 0,estimated:u&&s&&c?(s-o)/u:void 0,event:i,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(d)},n)},jBt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},zBt=e=>(...t)=>vn.asap(()=>e(...t)),HRa=Ip.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ip.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ip.origin),Ip.navigator&&/(msie|trident)/i.test(Ip.navigator.userAgent)):()=>!0,jRa=Ip.hasStandardBrowserEnv?{write(e,t,n,r,a,i,o){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];vn.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),vn.isString(r)&&s.push(`path=${r}`),vn.isString(a)&&s.push(`domain=${a}`),i===!0&&s.push("secure"),vn.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function zRa(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function WRa(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function WBt(e,t,n){let r=!zRa(t);return e&&(r||n==!1)?WRa(e,t):t}const GBt=e=>e instanceof Rg?{...e}:e;function e$(e,t){t=t||{};const n={};function r(u,c,d,p){return vn.isPlainObject(u)&&vn.isPlainObject(c)?vn.merge.call({caseless:p},u,c):vn.isPlainObject(c)?vn.merge({},c):vn.isArray(c)?c.slice():c}function a(u,c,d,p){if(vn.isUndefined(c)){if(!vn.isUndefined(u))return r(void 0,u,d,p)}else return r(u,c,d,p)}function i(u,c){if(!vn.isUndefined(c))return r(void 0,c)}function o(u,c){if(vn.isUndefined(c)){if(!vn.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function s(u,c,d){if(d in t)return r(u,c);if(d in e)return r(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(u,c,d)=>a(GBt(u),GBt(c),d,!0)};return vn.forEach(Object.keys({...e,...t}),function(u){const c=l[u]||a,d=c(e[u],t[u],u);vn.isUndefined(d)&&c!==s||(n[u]=d)}),n}const qBt=e=>{const t=e$({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:i,headers:o,auth:s}=t;if(t.headers=o=Rg.from(o),t.url=NBt(WBt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),vn.isFormData(n)){if(Ip.hasStandardBrowserEnv||Ip.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(vn.isFunction(n.getHeaders)){const l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([c,d])=>{u.includes(c.toLowerCase())&&o.set(c,d)})}}if(Ip.hasStandardBrowserEnv&&(r&&vn.isFunction(r)&&(r=r(t)),r||r!==!1&&HRa(t.url))){const l=a&&i&&jRa.read(i);l&&o.set(a,l)}return t},GRa=typeof XMLHttpRequest<"u",qRa=GRa&&function(e){return new Promise(function(t,n){const r=qBt(e);let a=r.data;const i=Rg.from(r.headers).normalize();let{responseType:o,onUploadProgress:s,onDownloadProgress:l}=r,u,c,d,p,h;function g(){p&&p(),h&&h(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(r.method.toUpperCase(),r.url,!0),v.timeout=r.timeout;function b(){if(!v)return;const C=Rg.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),S={data:!o||o==="text"||o==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:C,config:e,request:v};HBt(function(y){t(y),g()},function(y){n(y),g()},S),v=null}"onloadend"in v?v.onloadend=b:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(b)},v.onabort=function(){v&&(n(new Fi("Request aborted",Fi.ECONNABORTED,e,v)),v=null)},v.onerror=function(C){const S=C&&C.message?C.message:"Network Error",y=new Fi(S,Fi.ERR_NETWORK,e,v);y.event=C||null,n(y),v=null},v.ontimeout=function(){let C=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const S=r.transitional||FBt;r.timeoutErrorMessage&&(C=r.timeoutErrorMessage),n(new Fi(C,S.clarifyTimeoutError?Fi.ETIMEDOUT:Fi.ECONNABORTED,e,v)),v=null},a===void 0&&i.setContentType(null),"setRequestHeader"in v&&vn.forEach(i.toJSON(),function(C,S){v.setRequestHeader(S,C)}),vn.isUndefined(r.withCredentials)||(v.withCredentials=!!r.withCredentials),o&&o!=="json"&&(v.responseType=r.responseType),l&&([d,h]=Qse(l,!0),v.addEventListener("progress",d)),s&&v.upload&&([c,p]=Qse(s),v.upload.addEventListener("progress",c),v.upload.addEventListener("loadend",p)),(r.cancelToken||r.signal)&&(u=C=>{v&&(n(!C||C.type?new fV(null,e,v):C),v.abort(),v=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const _=BRa(r.url);if(_&&Ip.protocols.indexOf(_)===-1){n(new Fi("Unsupported protocol "+_+":",Fi.ERR_BAD_REQUEST,e));return}v.send(a||null)})},KRa=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const i=function(u){if(!a){a=!0,s();const c=u instanceof Error?u:this.reason;r.abort(c instanceof Fi?c:new fV(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{o=null,i(new Fi(`timeout ${t} of ms exceeded`,Fi.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:l}=r;return l.unsubscribe=()=>vn.asap(s),l}},YRa=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,a;for(;r<n;)a=r+t,yield e.slice(r,a),r=a},JRa=async function*(e,t){for await(const n of ZRa(e))yield*YRa(n,t)},ZRa=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},KBt=(e,t,n,r)=>{const a=JRa(e,t);let i=0,o,s=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await a.next();if(u){s(),l.close();return}let d=c.byteLength;if(n){let p=i+=d;n(p)}l.enqueue(new Uint8Array(c))}catch(u){throw s(u),u}},cancel(l){return s(l),a.return()}},{highWaterMark:2})},YBt=64*1024,{isFunction:ele}=vn,XRa=(({Request:e,Response:t})=>({Request:e,Response:t}))(vn.global),{ReadableStream:JBt,TextEncoder:ZBt}=vn.global,XBt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},QRa=e=>{e=vn.merge.call({skipUndefined:!0},XRa,e);const{fetch:t,Request:n,Response:r}=e,a=t?ele(t):typeof fetch=="function",i=ele(n),o=ele(r);if(!a)return!1;const s=a&&ele(JBt),l=a&&(typeof ZBt=="function"?(g=>v=>g.encode(v))(new ZBt):async g=>new Uint8Array(await new n(g).arrayBuffer())),u=i&&s&&XBt(()=>{let g=!1;const v=new n(Ip.origin,{body:new JBt,method:"POST",get duplex(){return g=!0,"half"}}).headers.has("Content-Type");return g&&!v}),c=o&&s&&XBt(()=>vn.isReadableStream(new r("").body)),d={stream:c&&(g=>g.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(g=>{!d[g]&&(d[g]=(v,b)=>{let _=v&&v[g];if(_)return _.call(v);throw new Fi(`Response type '${g}' is not supported`,Fi.ERR_NOT_SUPPORT,b)})});const p=async g=>{if(g==null)return 0;if(vn.isBlob(g))return g.size;if(vn.isSpecCompliantForm(g))return(await new n(Ip.origin,{method:"POST",body:g}).arrayBuffer()).byteLength;if(vn.isArrayBufferView(g)||vn.isArrayBuffer(g))return g.byteLength;if(vn.isURLSearchParams(g)&&(g=g+""),vn.isString(g))return(await l(g)).byteLength},h=async(g,v)=>vn.toFiniteNumber(g.getContentLength())??p(v);return async g=>{let{url:v,method:b,data:_,signal:C,cancelToken:S,timeout:y,onDownloadProgress:T,onUploadProgress:k,responseType:E,headers:I,withCredentials:D="same-origin",fetchOptions:A}=qBt(g),R=t||fetch;E=E?(E+"").toLowerCase():"text";let B=KRa([C,S&&S.toAbortSignal()],y),P=null;const $=B&&B.unsubscribe&&(()=>{B.unsubscribe()});let V;try{if(k&&u&&b!=="get"&&b!=="head"&&(V=await h(I,_))!==0){let ee=new n(v,{method:"POST",body:_,duplex:"half"}),j;if(vn.isFormData(_)&&(j=ee.headers.get("content-type"))&&I.setContentType(j),ee.body){const[U,Z]=jBt(V,Qse(zBt(k)));_=KBt(ee.body,YBt,U,Z)}}vn.isString(D)||(D=D?"include":"omit");const N=i&&"credentials"in n.prototype,q={...A,signal:B,method:b.toUpperCase(),headers:I.normalize().toJSON(),body:_,duplex:"half",credentials:N?D:void 0};P=i&&new n(v,q);let J=await(i?R(P,A):R(v,q));const ie=c&&(E==="stream"||E==="response");if(c&&(T||ie&&$)){const ee={};["status","statusText","headers"].forEach(oe=>{ee[oe]=J[oe]});const j=vn.toFiniteNumber(J.headers.get("content-length")),[U,Z]=T&&jBt(j,Qse(zBt(T),!0))||[];J=new r(KBt(J.body,YBt,U,()=>{Z&&Z(),$&&$()}),ee)}E=E||"text";let de=await d[vn.findKey(d,E)||"text"](J,g);return!ie&&$&&$(),await new Promise((ee,j)=>{HBt(ee,j,{data:de,headers:Rg.from(J.headers),status:J.status,statusText:J.statusText,config:g,request:P})})}catch(N){throw $&&$(),N&&N.name==="TypeError"&&/Load failed|fetch/i.test(N.message)?Object.assign(new Fi("Network Error",Fi.ERR_NETWORK,g,P),{cause:N.cause||N}):Fi.from(N,N&&N.code,g,P)}}},e$a=new Map,QBt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,i=[r,a,n];let o=i.length,s=o,l,u,c=e$a;for(;s--;)l=i[s],u=c.get(l),u===void 0&&c.set(l,u=s?new Map:QRa(t)),c=u;return u};QBt();const e$e={http:vRa,xhr:qRa,fetch:{get:QBt}};vn.forEach(e$e,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const e3t=e=>`- ${e}`,t$a=e=>vn.isFunction(e)||e===null||e===!1;function n$a(e,t){e=vn.isArray(e)?e:[e];const{length:n}=e;let r,a;const i={};for(let o=0;o<n;o++){r=e[o];let s;if(a=r,!t$a(r)&&(a=e$e[(s=String(r)).toLowerCase()],a===void 0))throw new Fi(`Unknown adapter '${s}'`);if(a&&(vn.isFunction(a)||(a=a.get(t))))break;i[s||"#"+o]=a}if(!a){const o=Object.entries(i).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=n?o.length>1?`since :
1034
1034
  `+o.map(e3t).join(`
1035
1035
  `):" "+e3t(o[0]):"as no adapter specified";throw new Fi("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return a}const t3t={getAdapter:n$a,adapters:e$e};function t$e(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new fV(null,e)}function n3t(e){return t$e(e),e.headers=Rg.from(e.headers),e.data=QRe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),t3t.getAdapter(e.adapter||uG.adapter,e)(e).then(function(t){return t$e(e),t.data=QRe.call(e,e.transformResponse,t),t.headers=Rg.from(t.headers),t},function(t){return UBt(t)||(t$e(e),t&&t.response&&(t.response.data=QRe.call(e,e.transformResponse,t.response),t.response.headers=Rg.from(t.response.headers))),Promise.reject(t)})}const r3t="1.13.2",tle={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{tle[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const a3t={};tle.transitional=function(e,t,n){function r(a,i){return"[Axios v"+r3t+"] Transitional option '"+a+"'"+i+(n?". "+n:"")}return(a,i,o)=>{if(e===!1)throw new Fi(r(i," has been removed"+(t?" in "+t:"")),Fi.ERR_DEPRECATED);return t&&!a3t[i]&&(a3t[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(a,i,o):!0}},tle.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function r$a(e,t,n){if(typeof e!="object")throw new Fi("options must be an object",Fi.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const i=r[a],o=t[i];if(o){const s=e[i],l=s===void 0||o(s,i,e);if(l!==!0)throw new Fi("option "+i+" must be "+l,Fi.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Fi("Unknown option "+i,Fi.ERR_BAD_OPTION)}}const nle={assertOptions:r$a,validators:tle},JC=nle.validators;let t$=class{constructor(e){this.defaults=e||{},this.interceptors={request:new LBt,response:new LBt}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const a=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=`
1036
1036
  `+a):n.stack=a}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=e$(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:a}=t;n!==void 0&&nle.assertOptions(n,{silentJSONParsing:JC.transitional(JC.boolean),forcedJSONParsing:JC.transitional(JC.boolean),clarifyTimeoutError:JC.transitional(JC.boolean)},!1),r!=null&&(vn.isFunction(r)?t.paramsSerializer={serialize:r}:nle.assertOptions(r,{encode:JC.function,serialize:JC.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),nle.assertOptions(t,{baseUrl:JC.spelling("baseURL"),withXsrfToken:JC.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=a&&vn.merge(a.common,a[t.method]);a&&vn.forEach(["delete","get","head","post","put","patch","common"],h=>{delete a[h]}),t.headers=Rg.concat(i,a);const o=[];let s=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(t)===!1||(s=s&&h.synchronous,o.unshift(h.fulfilled,h.rejected))});const l=[];this.interceptors.response.forEach(function(h){l.push(h.fulfilled,h.rejected)});let u,c=0,d;if(!s){const h=[n3t.bind(this),void 0];for(h.unshift(...o),h.push(...l),d=h.length,u=Promise.resolve(t);c<d;)u=u.then(h[c++],h[c++]);return u}d=o.length;let p=t;for(;c<d;){const h=o[c++],g=o[c++];try{p=h(p)}catch(v){g.call(this,v);break}}try{u=n3t.call(this,p)}catch(h){return Promise.reject(h)}for(c=0,d=l.length;c<d;)u=u.then(l[c++],l[c++]);return u}getUri(e){e=e$(this.defaults,e);const t=WBt(e.baseURL,e.url,e.allowAbsoluteUrls);return NBt(t,e.params,e.paramsSerializer)}};vn.forEach(["delete","get","head","options"],function(e){t$.prototype[e]=function(t,n){return this.request(e$(n||{},{method:e,url:t,data:(n||{}).data}))}}),vn.forEach(["post","put","patch"],function(e){function t(n){return function(r,a,i){return this.request(e$(i||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}t$.prototype[e]=t(),t$.prototype[e+"Form"]=t(!0)});let a$a=class F5t{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(a=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](a);r._listeners=null}),this.promise.then=a=>{let i;const o=new Promise(s=>{r.subscribe(s),i=s}).then(a);return o.cancel=function(){r.unsubscribe(i)},o},t(function(a,i,o){r.reason||(r.reason=new fV(a,i,o),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new F5t(function(n){t=n}),cancel:t}}};function i$a(e){return function(t){return e.apply(null,t)}}function o$a(e){return vn.isObject(e)&&e.isAxiosError===!0}const n$e={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(n$e).forEach(([e,t])=>{n$e[t]=e});function i3t(e){const t=new t$(e),n=_Bt(t$.prototype.request,t);return vn.extend(n,t$.prototype,t,{allOwnKeys:!0}),vn.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return i3t(e$(e,r))},n}const Lc=i3t(uG);Lc.Axios=t$,Lc.CanceledError=fV,Lc.CancelToken=a$a,Lc.isCancel=UBt,Lc.VERSION=r3t,Lc.toFormData=Zse,Lc.AxiosError=Fi,Lc.Cancel=Lc.CanceledError,Lc.all=function(e){return Promise.all(e)},Lc.spread=i$a,Lc.isAxiosError=o$a,Lc.mergeConfig=e$,Lc.AxiosHeaders=Rg,Lc.formToJSON=e=>BBt(vn.isHTMLForm(e)?new FormData(e):e),Lc.getAdapter=t3t.getAdapter,Lc.HttpStatusCode=n$e,Lc.default=Lc;const{Axios:Dqa,AxiosError:Aqa,CanceledError:Oqa,isCancel:Iqa,CancelToken:Rqa,VERSION:$qa,all:Pqa,Cancel:Mqa,isAxiosError:s$a,spread:Nqa,toFormData:Lqa,AxiosHeaders:Fqa,HttpStatusCode:Bqa,formToJSON:Vqa,getAdapter:Uqa,mergeConfig:Hqa}=Lc;class dG extends Error{constructor(t,n,r,a,i){super(t),this.name="ApiError",this.statusCode=n,this.code=r,this.details=a,this.type=i,Object.setPrototypeOf(this,dG.prototype)}}const l$a=e=>{var t,n;if(s$a(e)){const r=(t=e.response)==null?void 0:t.status,a=(n=e.response)==null?void 0:n.data,i=(a==null?void 0:a.message)||e.message||"An unexpected error occurred",o=(a==null?void 0:a.code)||e.code,s=(a==null?void 0:a.details)||a;let l="UNKNOWN";return!r||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":r>=500?l="SERVER":r===uV.UNAUTHORIZED||r===uV.FORBIDDEN?l="AUTH":r===uV.UNPROCESSABLE_ENTITY||r===uV.BAD_REQUEST?l="VALIDATION":r>=uV.BAD_REQUEST&&(l="CLIENT"),new dG(i,r,o,s,l)}return e instanceof Error?new dG(e.message,void 0,void 0,void 0,"UNKNOWN"):new dG("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};let u$a=class extends Error{},gA=class extends u$a{constructor(){super("Zone is an abstract class")}},o3t=class{get type(){throw new gA}get name(){throw new gA}get ianaName(){return this.name}get isUniversal(){throw new gA}offsetName(e,t){throw new gA}formatOffset(e,t){throw new gA}offset(e){throw new gA}equals(e){throw new gA}get isValid(){throw new gA}};const r$e=new Map;function c$a(e){let t=r$e.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),r$e.set(e,t)),t}const d$a={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function f$a(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,a,i,o,s,l,u,c]=r;return[o,a,i,s,l,u,c]}function h$a(e,t){const n=e.formatToParts(t),r=[];for(let a=0;a<n.length;a++){const{type:i,value:o}=n[a],s=d$a[i];i==="era"?r[s]=o:rle(s)||(r[s]=parseInt(o,10))}return r}const a$e=new Map;let p$a=class QNe extends o3t{static create(t){let n=a$e.get(t);return n===void 0&&a$e.set(t,n=new QNe(t)),n}static resetCache(){a$e.clear(),r$e.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=QNe.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return y$a(t,n,r,this.name)}formatOffset(t,n){return ile(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=c$a(this.name);let[a,i,o,s,l,u,c]=r.formatToParts?h$a(r,n):f$a(r,n);s==="BC"&&(a=-Math.abs(a)+1);const d=v$a({year:a,month:i,day:o,hour:l===24?0:l,minute:u,second:c,millisecond:0});let p=+n;const h=p%1e3;return p-=h>=0?h:1e3+h,(d-p)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},i$e=null,m$a=class U7 extends o3t{static get utcInstance(){return i$e===null&&(i$e=new U7(0)),i$e}static instance(t){return t===0?U7.utcInstance:new U7(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new U7(l3t(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ile(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ile(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return ile(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};function rle(e){return typeof e>"u"}function ale(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function s3t(e){if(!(rle(e)||e===null||e===""))return parseInt(e,10)}function g$a(e){if(!(rle(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function v$a(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function y$a(e,t,n,r=null){const a=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(i.timeZone=r);const o={timeZoneName:t,...i},s=new Intl.DateTimeFormat(n,o).formatToParts(a).find(l=>l.type.toLowerCase()==="timezonename");return s?s.value:null}function l3t(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,a=n<0||Object.is(n,-0)?-r:r;return n*60+a}function ile(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),a=e>=0?"+":"-";switch(t){case"short":return`${a}${ale(n,2)}:${ale(r,2)}`;case"narrow":return`${a}${n}${r>0?`:${r}`:""}`;case"techie":return`${a}${ale(n,2)}${ale(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const u3t=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function hV(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function pV(...e){return t=>e.reduce(([n,r,a],i)=>{const[o,s,l]=i(t,a);return[{...n,...o},s||r,l]},[{},null,1]).slice(0,2)}function c3t(...e){return(t,n)=>{const r={};let a;for(a=0;a<e.length;a++)r[e[a]]=s3t(t[n+a]);return[r,null,n+a]}}const d3t=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,b$a=`(?:${d3t.source}?(?:\\[(${u3t.source})\\])?)?`,f3t=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,h3t=RegExp(`${f3t.source}${b$a}`),o$e=RegExp(`(?:[Tt]${h3t.source})?`),w$a=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,_$a=/(\d{4})-?W(\d\d)(?:-?(\d))?/,C$a=/(\d{4})-?(\d{3})/,S$a=c3t("weekYear","weekNumber","weekDay"),k$a=c3t("year","ordinal"),E$a=/(\d{4})-(\d\d)-(\d\d)/,p3t=RegExp(`${f3t.source} ?(?:${d3t.source}|(${u3t.source}))?`),x$a=RegExp(`(?: ${p3t.source})?`);function mV(e,t,n){const r=e[t];return rle(r)?n:s3t(r)}function T$a(e,t){return[{year:mV(e,t),month:mV(e,t+1,1),day:mV(e,t+2,1)},null,t+3]}function gV(e,t){return[{hours:mV(e,t,0),minutes:mV(e,t+1,0),seconds:mV(e,t+2,0),milliseconds:g$a(e[t+3])},null,t+4]}function fG(e,t){const n=!e[t]&&!e[t+1],r=l3t(e[t+1],e[t+2]),a=n?null:m$a.instance(r);return[{},a,t+3]}function hG(e,t){const n=e[t]?p$a.create(e[t]):null;return[{},n,t+1]}hV(w$a,o$e),hV(_$a,o$e),hV(C$a,o$e),hV(h3t),pV(T$a,gV,fG,hG),pV(S$a,gV,fG,hG),pV(k$a,gV,fG,hG),pV(gV,fG,hG),pV(gV),hV(E$a,x$a),hV(p3t),pV(gV,fG,hG);function m3t(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function g3t(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(u){return void n(u)}s.done?t(l):Promise.resolve(l).then(r,a)}function s$e(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(l){g3t(i,r,a,o,s,"next",l)}function s(l){g3t(i,r,a,o,s,"throw",l)}o(void 0)})}}function l$e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D$a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,b3t(r.key),r)}}function u$e(e,t,n){return t&&D$a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function A$a(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=$$a(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1037
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return o=l.done,l},e:function(l){s=!0,i=l},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw i}}}}function c$e(e,t,n){return(t=b3t(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v3t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function y3t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v3t(Object(n),!0).forEach(function(r){c$e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v3t(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function O$a(e,t){if(e==null)return{};var n,r,a=I$a(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function I$a(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function n$(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function i(h,g,v,b){var _=g&&g.prototype instanceof s?g:s,C=Object.create(_.prototype);return gy(C,"_invoke",function(S,y,T){var k,E,I,D=0,A=T||[],R=!1,B={p:0,n:0,v:e,a:P,f:P.bind(e,4),d:function($,V){return k=$,E=0,I=e,B.n=V,o}};function P($,V){for(E=$,I=V,t=0;!R&&D&&!N&&t<A.length;t++){var N,q=A[t],J=B.p,ie=q[2];$>3?(N=ie===V)&&(I=q[(E=q[4])?5:(E=3,3)],q[4]=q[5]=e):q[0]<=J&&((N=$<2&&J<q[1])?(E=0,B.v=V,B.n=q[1]):J<ie&&(N=$<3||q[0]>V||V>ie)&&(q[4]=$,q[5]=V,B.n=ie,E=0))}if(N||$>1)return o;throw R=!0,V}return function($,V,N){if(D>1)throw TypeError("Generator is already running");for(R&&V===1&&P(V,N),E=V,I=N;(t=E<2?e:I)||!R;){k||(E?E<3?(E>1&&(B.n=-1),P(E,I)):B.n=I:B.v=I);try{if(D=2,k){if(E||($="next"),t=k[$]){if(!(t=t.call(k,I)))throw TypeError("iterator result is not an object");if(!t.done)return t;I=t.value,E<2&&(E=0)}else E===1&&(t=k.return)&&t.call(k),E<2&&(I=TypeError("The iterator does not provide a '"+$+"' method"),E=1);k=e}else if((t=(R=B.n<0)?I:S.call(y,B))!==o)break}catch(q){k=e,E=1,I=q}finally{D=1}}return{value:t,done:R}}}(h,v,b),!0),C}var o={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(gy(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,gy(h,a,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,gy(d,"constructor",u),gy(u,"constructor",l),l.displayName="GeneratorFunction",gy(u,a,"GeneratorFunction"),gy(d),gy(d,a,"Generator"),gy(d,r,function(){return this}),gy(d,"toString",function(){return"[object Generator]"}),(n$=function(){return{w:i,m:p}})()}function gy(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch{a=0}gy=function(i,o,s,l){function u(c,d){gy(i,c,function(p){return this._invoke(c,d,p)})}o?a?a(i,o,{value:s,enumerable:!l,configurable:!l,writable:!l}):i[o]=s:(u("next",0),u("throw",1),u("return",2))},gy(e,t,n,r)}function R$a(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function b3t(e){var t=R$a(e,"string");return typeof t=="symbol"?t:t+""}function $$a(e,t){if(e){if(typeof e=="string")return m3t(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m3t(e,t):void 0}}var P$a=["accessTokenKey","refreshTokenKey","domain","path","secure","sameSite","canSetTokens","cookieParser"],M$a=function(){function e(){var t,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};l$e(this,e),this.accessTokenKey=r.accessTokenKey||"access_token",this.refreshTokenKey=r.refreshTokenKey||"refresh_token",this.domain=r.domain,this.path=r.path||"/",this.secure=(t=r.secure)!==null&&t!==void 0?t:!0,this.sameSite=r.sameSite||"lax",this.canSetTokens=(n=r.canSetTokens)!==null&&n!==void 0?n:!0,this.cookieParser=r.cookieParser}return u$e(e,[{key:"getCookieValue",value:function(t){if(typeof document>"u")return null;var n=document.cookie.split(";"),r=A$a(n),a;try{for(r.s();!(a=r.n()).done;){var i=a.value;if(i=i.trim(),i.startsWith(t+"=")){var o=i.substring(t.length+1);return this.cookieParser?this.cookieParser(o,t):decodeURIComponent(o)}}}catch(s){r.e(s)}finally{r.f()}return null}},{key:"getAccessToken",value:function(){return this.getCookieValue(this.accessTokenKey)}},{key:"getRefreshToken",value:function(){return this.getCookieValue(this.refreshTokenKey)}},{key:"getExpiresInRefreshToken",value:function(){return this.getCookieValue("account.expires_in_refresh_token")}},{key:"setTokens",value:function(t){if(!this.canSetTokens||typeof document>"u"){console.warn("CookieTokenStorage: Token setting is disabled or running in a non-browser environment");return}var n=this.domain?"; domain=".concat(this.domain):"",r=this.secure?"; secure":"",a="; samesite=".concat(this.sameSite),i="",o="";if(t.expires_in&&typeof t.expires_in=="number"){var s=new Date;s.setTime(s.getTime()+t.expires_in*1e3),i=";expires=".concat(s.toUTCString())}var l=this.getExpiresInRefreshToken();if(sessionStorage.getItem("APP_DEBUG")&&(console.log("[DEBUG] refresh token",t),console.log("[DEBUG] refresh token expires_in value",l)),l){var u=new Date;u.setTime(u.getTime()+Number(l)*1e3),o=";expires=".concat(u.toUTCString())}if(t.access_token||t.token){var c=t.access_token||t.token,d="".concat(this.accessTokenKey,"=").concat(encodeURIComponent(c),"; path=").concat(this.path).concat(n).concat(r).concat(a).concat(i);document.cookie=d}if(t.refresh_token_expires_in&&typeof t.refresh_token_expires_in=="number"){var p=new Date;p.setTime(p.getTime()+t.refresh_token_expires_in*1e3),i=";expires=".concat(p.toUTCString())}if(t.refresh_token){sessionStorage.getItem("APP_DEBUG")&&(console.log("[DEBUG] refesh token set to",t.refresh_token),console.log("[DEBUG] refresh token expires_in set to",o));var h="".concat(this.refreshTokenKey,"=").concat(encodeURIComponent(t.refresh_token),"; path=").concat(this.path).concat(n).concat(r).concat(a).concat(o);document.cookie=h}}},{key:"hasTokens",value:function(){return!!this.getAccessToken()&&!!this.getRefreshToken()}}])}(),N$a=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auth_state_channel",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auth_state_event";l$e(this,e),c$e(this,"channel",null),this.channelName=t,this.storageKey=n,this.initChannel()}return u$e(e,[{key:"initChannel",value:function(){if(typeof BroadcastChannel<"u")try{this.channel=new BroadcastChannel(this.channelName)}catch(t){console.error("Failed to create BroadcastChannel, falling back to storage events:",t),this.channel=null}}},{key:"broadcastEvent",value:function(t){var n=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a={type:t,data:r,timestamp:Date.now()};this.channel?this.channel.postMessage(a):typeof localStorage<"u"&&(localStorage.setItem(this.storageKey,JSON.stringify(a)),setTimeout(function(){return localStorage.removeItem(n.storageKey)},100))}},{key:"onEvent",value:function(t){var n=this;return this.channel?this.channel.onmessage=function(r){t(r.data)}:typeof window<"u"&&window.addEventListener("storage",function(r){if(r.key===n.storageKey&&r.newValue)try{var a=JSON.parse(r.newValue);t(a)}catch(i){console.error("Failed to parse auth event:",i)}}),function(){n.channel?n.channel.onmessage=null:typeof window<"u"&&window.removeEventListener("storage",function(){})}}},{key:"destroy",value:function(){this.channel&&(this.channel.close(),this.channel=null)}}])}(),L$a=function(){function e(t){var n=this;l$e(this,e),c$e(this,"currentAttempt",0),this.instanceId=Math.random().toString(36).substring(2,15),this.refreshTokenFn=t.refreshTokenFn,this.tokenStorage=t.storage,this.maxRetries=t.maxRetries||3,this.retryDelay=t.retryDelay||1e3,this.backoffFactor=t.backoffFactor||2,this.onCrossTabLogout=t.onCrossTabLogout,this.authStateManager=new N$a,this.initCrossTabListener(),this.onRefreshSuccess=t.onRefreshSuccess||function(){console.log("Token refresh successful")},this.onRefreshFailure=t.onRefreshFailure||function(r){console.error("Token refresh failed:",r)},this.onTokenInvalid=t.onTokenInvalid||function(){console.log("Token is invalid or cannot be refreshed");var r=new Error("No refresh token available");n.onRefreshFailure(r),n.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:n.instanceId,reason:"no_refresh_token",error:"No refresh token available"})}}return u$e(e,[{key:"initCrossTabListener",value:function(){var t=this;this.authStateManager.onEvent(function(n){n.type==="auth:logout"&&(console.log("Received logout event:",n.data),n.data&&n.data.sourceInstanceId!==t.instanceId?(console.log("Logout event from different tab, executing logout handlers"),t.onCrossTabLogout?(console.log("Executing onCrossTabLogout with reason: ".concat(n.data.reason||"cross_tab_logout")),t.onCrossTabLogout(n.data.reason||"cross_tab_logout")):typeof t.onLogout=="function"?(console.log("Executing legacy onLogout with reason: ".concat(n.data.reason)),t.onLogout(n.data.reason)):console.warn("No logout handler defined for cross-tab events")):console.log("Ignoring self-generated logout event"))})}},{key:"handleTokenRefresh",value:function(){var t=s$e(n$().m(function r(){var a=this,i,o,s,l;return n$().w(function(u){for(;;)switch(u.p=u.n){case 0:if(i=this.tokenStorage.getRefreshToken(),sessionStorage.getItem("APP_DEBUG")&&console.log("[DEBUG] on handle token refresh",i),i){u.n=1;break}return console.log("No refresh token available"),this.onTokenInvalid(),u.a(2,!1);case 1:return this.currentAttempt=0,u.p=2,u.n=3,this.executeWithRetry(function(){return console.log("Refresh attempt ".concat(a.currentAttempt+1,"/").concat(a.maxRetries)),a.refreshTokenFn(a.tokenStorage.getRefreshToken())});case 3:if(o=u.v,!(!o||!o.access_token&&!o.token)){u.n=4;break}throw console.error("Invalid token response received"),new Error("Invalid token response");case 4:return o.token&&!o.access_token&&(o.access_token=o.token),console.log("Token refresh successful, saving new tokens"),this.tokenStorage.setTokens(o),this.onRefreshSuccess(o),u.a(2,!0);case 5:return u.p=5,l=u.v,console.error("Token refresh failed after all attempts:",l),l===void 0&&(l=new Error("Undefined error during token refresh")),this.onRefreshFailure(l),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:"max_retry_reached",error:((s=l)===null||s===void 0?void 0:s.message)||"Token refresh failed after maximum retries"}),u.a(2,!1)}},r,this,[[2,5]])}));function n(){return t.apply(this,arguments)}return n}()},{key:"executeWithRetry",value:function(){var t=s$e(n$().m(function r(a){var i,o,s;return n$().w(function(l){for(;;)switch(l.p=l.n){case 0:return l.p=0,l.n=1,a();case 1:return l.a(2,l.v);case 2:if(l.p=2,s=l.v,this.currentAttempt++,!(this.currentAttempt>=this.maxRetries)){l.n=3;break}throw console.log("Maximum retry attempts (".concat(this.maxRetries,") reached")),s;case 3:return i=s.response&&s.response.status===425,o=i?this.getRetryAfterDelay(s):this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1),console.log("Retry in ".concat(o,"ms, attempt ").concat(this.currentAttempt,"/").concat(this.maxRetries)),l.n=4,new Promise(function(u){return setTimeout(u,o)});case 4:return l.a(2,this.executeWithRetry(a))}},r,this,[[0,2]])}));function n(r){return t.apply(this,arguments)}return n}()},{key:"getRetryAfterDelay",value:function(t){if(t.response&&t.response.headers){var n=t.response.headers["retry-after"];if(n){var r=parseInt(n,10);if(!isNaN(r))return r*1e3;var a=new Date(n);if(!isNaN(a.getTime()))return a.getTime()-Date.now()}}return this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1)}},{key:"broadcastLogout",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"manual_logout";console.log("Broadcasting logout event with reason: ".concat(t)),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:t,timestamp:Date.now()})}}])}();function F$a(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.tokenExpiredDetection,a=r===void 0?function(c){var d;return((d=c.response)===null||d===void 0?void 0:d.status)===401}:r,i=n.retryStatusCodes,o=i===void 0?[401,425]:i,s=n.tokenHeaderFormatter,l=s===void 0?function(c){return"Bearer ".concat(c)}:s,u=null;e.interceptors.response.use(function(c){return c},function(){var c=s$e(n$().m(function d(p){var h,g,v,b,_,C,S,y,T;return n$().w(function(k){for(;;)switch(k.p=k.n){case 0:if(b=p.config,b){k.n=1;break}return k.a(2,Promise.reject(p));case 1:if(!b._retry){k.n=2;break}return k.a(2,Promise.reject(p));case 2:if(_=(h=p.response)===null||h===void 0?void 0:h.status,!(!_||!o.includes(_)||!a(p))){k.n=3;break}return k.a(2,Promise.reject(p));case 3:if(C=((g=b.url)===null||g===void 0?void 0:g.includes("refresh-token"))||((v=b.url)===null||v===void 0?void 0:v.includes("refreshToken")),!C){k.n=4;break}return k.a(2,Promise.reject(p));case 4:return b._retry=!0,k.p=5,u?console.log("Using existing refresh promise"):(console.log("Starting token refresh"),u=t.handleTokenRefresh()),k.n=6,u;case 6:if(S=k.v,u=null,S){k.n=7;break}return console.log("Token refresh failed"),k.a(2,Promise.reject(p));case 7:return y=t.tokenStorage.getAccessToken(),y&&(b.headers.Authorization=l(y)),console.log("Retrying original request with new token"),k.a(2,e(b));case 8:return k.p=8,T=k.v,console.error("Error during refresh:",T),u=null,k.a(2,Promise.reject(p))}},d,null,[[5,8]])}));return function(d){return c.apply(this,arguments)}}()),e.interceptors.request.use(function(c){if(c.headers.Authorization)return c;var d=t.tokenStorage.getAccessToken();return d&&(c.headers.Authorization=l(d)),c},function(c){return Promise.reject(c)})}function B$a(e){var t=e.accessTokenKey,n=e.refreshTokenKey,r=e.domain,a=e.path,i=e.secure,o=e.sameSite,s=e.canSetTokens,l=e.cookieParser,u=O$a(e,P$a),c=new M$a({accessTokenKey:t,refreshTokenKey:n,domain:r,path:a,secure:i,sameSite:o,canSetTokens:s,cookieParser:l});return new L$a(y3t(y3t({},u),{},{storage:c}))}var Uf=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Uf||{});Uf.review,Uf.review_take,Uf.review_scene,Uf.review_rendition,Uf.review_frame,Uf.review_rendition_comment,Uf.review_comment,Uf.scene_hub,Uf.hub_rendition,Uf.hub_comment,Uf.people_insight,Uf.people_detail,Uf.project,Uf.woohoo,Uf.update,Uf.core,Uf.project_focusMode;const ole={accessToken:"account.token",refreshToken:"account.refresh_token"},w3t={baseUrl:"BASE_URL",cookieDomain:"BASE_DOMAIN_COOKIE"},_3t="/refresh-token",V$a=3e5,U$a="*",C3t={Accept:"application/json","Content-Type":"application/json"},H$a="undefined",j$a="No access token found",r$={badRequest:400,unauthorized:401,tooEarly:425},z$a=[r$.unauthorized,r$.tooEarly,r$.badRequest],W$a={maxRetries:5,retryDelay:500,backoffFactor:1.5},G$a="unauthenticated",q$a="invalid_token",K$a="refresh_token_expired",Y$a={type:"TOKEN_EXPIRED",message:"Authentication token has expired"},J$a="Session refreshed successfully",Z$a="Session expired. Please log in again.",X$a=e=>{const{error:t}=e??{};return typeof t=="string"?t:t==null?void 0:t.key},Q$a=e=>{var t,n;return((t=e==null?void 0:e.response)==null?void 0:t.status)!==r$.badRequest?!1:X$a((n=e.response)==null?void 0:n.data)===q$a},ePa=()=>{},S3t=e=>sessionStorage.getItem(e)||"",d$e=()=>{const e=jRe.get(ole.accessToken);return e&&e!==H$a?e:null},tPa=()=>!!jRe.get(ole.refreshToken),nPa=()=>{const e=window.location.origin,t=S3t(w3t.baseUrl);if(!t)return e;try{return new URL(t,e).origin}catch{return e}};class f$e{constructor(t,n=ePa,r){this.client=t,this.showMessage=n,this.onAuthExpired=r}attach(){const t=B$a({accessTokenKey:ole.accessToken,refreshTokenKey:ole.refreshToken,domain:S3t(w3t.cookieDomain)||void 0,secure:window.location.protocol==="https:",sameSite:"lax",refreshTokenFn:n=>this.refresh(n),onRefreshSuccess:n=>{this.showMessage(J$a,"success"),this.client.defaults.headers.common.Authorization=`Bearer ${n.access_token}`},onRefreshFailure:()=>{this.showMessage(Z$a,"error"),this.handleAuthExpired()},onCrossTabLogout:()=>this.handleAuthExpired(),...W$a});this.handler=t,F$a(this.client,t,{retryStatusCodes:[...z$a],tokenExpiredDetection:f$e.isTokenExpired})}refreshAccessToken(){return!this.handler||!tPa()?Promise.resolve(!1):(this.pendingRefresh??(this.pendingRefresh=this.handler.handleTokenRefresh().catch(()=>!1).finally(()=>{this.pendingRefresh=void 0})),this.pendingRefresh)}static isTokenExpired(t){var n,r;const a=(n=t==null?void 0:t.response)==null?void 0:n.status;if(a===r$.tooEarly)return!0;const{error:i,details:o={}}=((r=t==null?void 0:t.response)==null?void 0:r.data)??{},s=typeof i=="string"?i:i==null?void 0:i.key;return a===r$.badRequest||a!==r$.unauthorized||typeof i=="string"||s!==G$a?!1:Object.keys(o).length===0||o.reason===K$a}async refresh(t){const n=await this.client.post(_3t,{refresh_token:t}),r="data"in n&&n.data?n.data:n;return console.log("Refreshing tokens:",{tokens:r,res:n}),{access_token:r.access_token,refresh_token:r.refresh_token,expires_in:r.expires_in}}handleAuthExpired(){var t;if(window.self===window.top){(t=this.onAuthExpired)==null||t.call(this);return}window.parent.postMessage(Y$a,nPa())}}class rPa{constructor(t={}){this.options={unwrapResponse:!0,withRefreshToken:!0,requireToken:!0,...t},this.client=Lc.create({baseURL:typeof t.baseURL=="string"?t.baseURL:"",timeout:t.timeout??V$a,headers:{...C3t,...t.headers}}),this.setupRequestInterceptor(),this.setupResponseInterceptor(),this.setupErrorHandling()}get(t,n){return this.request({...n,method:"GET",url:t})}post(t,n,r){return this.request({...r,method:"POST",url:t,data:n})}put(t,n,r){return this.request({...r,method:"PUT",url:t,data:n})}patch(t,n,r){return this.request({...r,method:"PATCH",url:t,data:n})}delete(t,n){return this.request({...n,method:"DELETE",url:t})}request(t){return this.client.request(t)}setupRequestInterceptor(){this.client.interceptors.request.use(async t=>{const{baseURL:n,dynamicHeaders:r,requireToken:a}=this.options;typeof n=="function"&&(t.baseURL=n());const i=t.url===_3t,o=i?d$e():await this.resolveAccessToken();if(!o&&a&&!i)throw new Error(j$a);t.headers.set("Accept-Language",U$a),t.headers.has("Content-Type")||t.headers.set("Content-Type",C3t["Content-Type"]),t.headers.has("Content-Type")&&t.headers.get("Content-Type")==="multipart/form-data"&&t.headers.delete("Content-Type"),o&&t.headers.set("Authorization",`Bearer ${o}`);for(const[s,l]of Object.entries((r==null?void 0:r(t))??{}))t.headers.set(s,l);return t})}async resolveAccessToken(){const t=d$e();return t||!this.tokenRefresher?t:(await this.tokenRefresher.refreshAccessToken(),d$e())}setupResponseInterceptor(){this.client.interceptors.response.use(t=>this.options.unwrapResponse?t.data:t)}setupErrorHandling(){const{withRefreshToken:t,showMessage:n,onAuthExpired:r,onError:a}=this.options;t&&(this.tokenRefresher=new f$e(this.client,n,r),this.tokenRefresher.attach()),this.client.interceptors.response.use(void 0,i=>(Q$a(i)&&(r==null||r("/sw?redirect=1")),Promise.reject(i))),a&&this.client.interceptors.response.use(void 0,a)}}const aPa=5,iPa=1e3,oPa=3,sPa="default",lPa=e=>new URL(e,"http://localhost").pathname;class uPa{constructor(t={}){this.groups=new Map,this.defaultLimit=t.defaultLimit??aPa,this.rules=t.rules??[],this.releaseDelayMs=t.releaseDelayMs??iPa}async run(t,n){const r=this.resolveGroup(t);await this.acquire(r);try{return await n()}finally{this.release(r)}}resolveGroup(t){const n=lPa(t),r=this.rules.find(o=>o.pattern.test(n)),a=r?r.pattern.source:sPa;let i=this.groups.get(a);return i||(i={limit:(r==null?void 0:r.limit)??this.defaultLimit,ongoing:0,queue:[]},this.groups.set(a,i)),i}acquire(t){return new Promise(n=>{const r=()=>{t.ongoing++,n()};t.ongoing<t.limit?r():t.queue.push(r)})}release(t){t.ongoing--;const n=t.queue.shift();n&&setTimeout(n,this.releaseDelayMs)}}const cPa=(e,t)=>{const n=new uPa(t),r=Lc.getAdapter(e.defaults.adapter);return e.defaults.adapter=a=>n.run(a.url??"",()=>r(a)),n},dPa=(e,{maxRetries:t=oPa}={})=>{e.interceptors.response.use(void 0,async n=>{var r,a;const i=n.config;if(((r=n.response)==null?void 0:r.status)!==429||!i)return Promise.reject(n);const o=(i._retryCount??0)+1;if(o>t)return Promise.reject(n);i._retryCount=o;const s=Number.parseInt(String(((a=n.response.headers)==null?void 0:a["retry-after"])??""),10),l=Number.isNaN(s)?2**o*1e3:s*1e3;return await new Promise(u=>setTimeout(u,l)),e.request(i)})},fPa=6e4,hPa="/start",pPa=(e=hPa)=>{const t=`${sessionStorage.getItem("BASE_URL")||""}${e}`;console.log("Redirecting to auth URL:",t),window.location.replace(t)};function mPa(e,t){const n=sessionStorage.getItem(e)||"";return(n==null?void 0:n.length)>0?n:t}class gPa{constructor(t,n={}){const{concurrency:r,rateLimitRetry:a,...i}=n,o=()=>mPa("API_BASE_URL","");this.callbackFunc=t,this.api=new rPa({baseURL:o,timeout:fPa,requireToken:!0,onAuthExpired:pPa,...i,unwrapResponse:!1,showMessage:t}),this.axios=this.api.client,r!==!1&&cPa(this.axios,r),a!==!1&&dPa(this.axios,a)}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([a,i])=>{i!=null&&i!==""&&(Array.isArray(i)?i.forEach(o=>n.append(a,String(o))):typeof i=="object"?n.append(a,JSON.stringify(i)):n.append(a,String(i)))});const r=n.toString();return r?`?${r}`:""}async send(t,n,{params:r,data:a,options:i}={}){try{const o=r?this.buildQueryParams(r):"",s={...i,method:t,url:`${this.buildUrl(n)}${o}`};return a!==void 0&&(s.data=a),(await this.axios.request(s)).data}catch(o){throw l$a(o)}}get(t="",n,r){return this.send("GET",t,{params:n,options:r})}post(t="",n,r,a){return this.send("POST",t,{params:n,data:r,options:a})}put(t="",n,r){return this.send("PUT",t,{data:n,options:r})}patch(t="",n,r){return this.send("PATCH",t,{data:n,options:r})}delete(t="",n,r){return this.send("DELETE",t,{data:n,options:r})}}const vPa=({domainApi:e,wsCode:t,sceneId:n})=>({getMetrics:{url:`${e}/v1/workspace/${t}/items/${n}/metrics`,method:"get",code:"getMetrics"},updateMetrics:{url:`${e}/v1/workspace/${t}/items/${n}/metrics`,method:"put",code:"updateMetrics"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"}}),yPa=10;class bPa extends gPa{constructor(t,n,r){const a=n==null?void 0:n.domainApi,i=n==null?void 0:n.wsCode,o=(n==null?void 0:n.sceneId)||"";super(r),this.events=Object.create(null);const s=vPa({domainApi:a,wsCode:i,sceneId:o}),l={};Object.entries(s).forEach(([u,c])=>{const d=u;t[d]?l[d]=t[d]:(console.warn(`API config for ${d} is missing, using base config.`),l[d]=c)}),this.apiConfig=l}on(t,n){var r;((r=this.events)[t]??(r[t]=[])).push(n)}off(t,n){const r=this.events[t];r&&(this.events[t]=r.filter(a=>a!==n))}emit(t,...n){const r=this.events[t];r!=null&&r.length&&r.forEach(a=>{try{a(...n)}catch(i){console.error(`Error in event listener for ${t}:`,i)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:r,payload:a,code:i,responseType:o}){var s,l;const u=this.buildHeaders(a);let c;try{if(c=await this.axios.request({method:t,url:n,params:r,data:a,headers:u,responseType:o}),(((s=c.headers)==null?void 0:s["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const d=((l=c.headers)==null?void 0:l["content-disposition"])||"",p=d.includes("filename=")?d.split("filename=")[1]:"exported_items.xlsx"}if(c.status>=400&&c.status<=500)throw new Error(`Client error (${c.status}): ${c.statusText}`);return this.emit("call-api",{apiCode:i,path:n,params:r,payload:a,res:c,success:!0}),c.data}catch(d){throw console.error("API Request Error:",d),d.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:r,payload:a,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:r,payload:a,error:d,success:!1,apiCode:i,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let r=t;return Object.entries(n).forEach(([a,i])=>{r=r.replace(`{${a}}`,String(i))}),r}async request(t,n,r={}){const{url:a,code:i,method:o}=this.apiConfig[t],s=this.generateUrl(a,n);return this._requestHandler({method:o,path:s,params:r.params,payload:r.payload,code:i,responseType:r.responseType})}getMetrics(t,n=1,r=yPa){return this.request("getMetrics",{itemId:t},{params:{page:n,per_page:r}})}updateMetrics(t){return this.request("updateMetrics",{},{payload:t})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:r,metricId:a,value:i,clear:o}=t,s={item_ids:r,metric_id:a,metric_value:i,clear:o??(i==null||i==0?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete s.item_ids,s.entity_id=String(t.entityId)):(s.item_ids=r,s.entity_id=void 0),s.clear===1&&delete s.metric_value,this.request("bulkMetricUpdate",{workspaceId:n},{payload:s,params:t.filterParams})}}pBt();const k3t=(e,t)=>{const n=W(Number(e.value.value)),r=z(()=>e.value.metricConfig),a=z(()=>{var s,l;const u=r.value,c=t.value,d=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,p=!!e.value.error,h=(u==null?void 0:u.format_type)==="icon",{disabled:g}=e.value;return{pendingCalculation:e.value.value=="N/A"||d&&((s=u==null?void 0:u.metric_type)==null?void 0:s.code)==="formula",isEmpty:d,isError:p,hasPrefix:!d&&!p&&(u==null?void 0:u.morpheme_type)==="prefix",hasSuffix:!d&&!p&&(u==null?void 0:u.morpheme_type)==="suffix",isDropdown:(u==null?void 0:u.format_type)==="dropdown",isFormula:((l=u==null?void 0:u.metric_type)==null?void 0:l.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:c&&!d&&!g}}),i=17,o=z(()=>{var s;return{maxRating:((s=r.value)==null?void 0:s.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:i}});return{componentState:a,metricConfig:r,ICON_SIZE:i,ratingParams:o,standardNameforIcon:()=>{var s;return(((s=r.value)==null?void 0:s.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},wPa=["aria-label"],_Pa=ct({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=RIe,r=qC,a=e,i=Hl(!1),o=W(null),s=W(null),{isEditing:l}=gBt(a),u=z(()=>{var $,V;return{value:a.value,metricConfig:((V=($=a.params)==null?void 0:$.colDef)==null?void 0:V.context)||a.config,error:a.error,hovered:i.value,readOnly:a.readOnly,disabled:a.disabled,active:l}}),{componentState:c,metricConfig:d,internalValue:p}=k3t(u,i),h=z(()=>{var $,V;let N=!1;if(["number","formula"].includes(d.value.metric_type.code)){const q=Number(a.value),J=Number(($=d.value)==null?void 0:$.format_value);Number.isFinite(J)&&J>=0&&(N=(((V=q.toString().split(".")[1])==null?void 0:V.length)||0)>J)}return N}),g=z(()=>{var $;return!!(($=d.value)!=null&&$.morpheme_value)||c.value.isEmpty||h.value}),v=z(()=>{var $,V,N;if(c.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(c.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(c.value.isEmpty)return;const q=D.value,J=($=d.value)==null?void 0:$.morpheme_type;return J==="prefix"?`${((V=d.value)==null?void 0:V.morpheme_value)||""} ${q}`.trim():J==="suffix"?`${q} ${((N=d.value)==null?void 0:N.morpheme_value)||""}`.trim():q}),b=z(()=>{const{format_type:$,format_value:V}=d.value;if($==="dropdown"&&typeof V=="string"&&V.startsWith("["))try{return JSON.parse(V)}catch{return[]}return[]}),_=z(()=>({disabled:a.disabled,error:c.value.isError,inputRef:o,wrapperRef:s,clickable:!I.value,readOnly:a.readOnly||I.value,isEmpty:c.value.isEmpty})),{argsMain:C,isHover:S}=Wse(_),y=($,V,N="en-US")=>new Intl.NumberFormat(N,{minimumFractionDigits:V,maximumFractionDigits:V}).format($),T=z(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const $=a.value,{format_type:V,format_value:N,mapping:q}=d.value;if(q&&typeof q=="object"&&!Array.isArray(q)){const J=q[`!${$}`];if(J)return J}if(V==="dropdown"){const J=b.value.find(ie=>String(ie.name)===String($));if(J)return J.name}if(typeof $=="string"){const J=Number($);return Number.isNaN(J)?$:$.replace(/[.-]/g,"").length>16?k($,N):k(J,N)}return typeof $=="number"?k($,N):String($)}),k=($,V)=>{const N=Number.parseInt(String(V)||"2",10),q=Number.isFinite(N)&&N>=0?N:2;try{if(typeof $=="string"){const J=$.split("."),ie=J[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),de=J[1]?J[1].substring(0,q).padEnd(q,"0"):"0".repeat(q);return q>0?`${ie}.${de}`:ie}return y($,q)}catch(J){return console.error("Error formatting metric value:",J,{num:$,decimals:q}),String($)}},E=($,V)=>{const N=Number.parseInt(String(V)||"2",10),q=Number.isFinite(N)&&N>=0?N:2;try{if(typeof $=="string"){const J=$.split("."),ie=J[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),de=J[1]?J[1].length:0,ee=Math.max(q,de),j=J[1]?J[1].padEnd(ee,"0"):"0".repeat(ee);return ee>0?`${ie}.${j}`:ie}return new Intl.NumberFormat("en-US",{minimumFractionDigits:q,maximumFractionDigits:20}).format($)}catch(J){return console.error("Error formatting exact metric value:",J,{num:$,decimals:q}),String($)}},I=z(()=>{var $;return(($=d.value)==null?void 0:$.metric_type.code)==="formula"}),D=z(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const $=a.value,{format_type:V,format_value:N,mapping:q}=d.value;if(q&&typeof q=="object"&&!Array.isArray(q)){const J=q[`!${$}`];if(J)return J}if(V==="dropdown"){const J=b.value.find(ie=>String(ie.name)===String($));if(J)return J.name}if(typeof $=="string"){const J=Number($);return Number.isNaN(J)?$:$.replace(/[.-]/g,"").length>16?E($,N):E(J,N)}return typeof $=="number"?E($,N):String($)}),{tooltip:A}=UOa(""),R=async $=>{$.stopPropagation(),$.preventDefault(),$.stopImmediatePropagation();try{await navigator.clipboard.writeText(D.value),A.value="Copied",setTimeout(()=>{A.value="Copy"},3e3)}catch(V){console.error("Failed to copy text:",V),A.value="Copy failed",setTimeout(()=>{A.value="Copy"},3e3)}};lt(()=>a.value,($,V)=>{const N=Number($);Number.isFinite(N)&&N!==p.value?p.value=N:$==null&&p.value!==0&&(p.value=0)},{immediate:!0,deep:!0});const B=()=>{i.value=!0},P=()=>{i.value=!1};return($,V)=>ft((L(),qe(Gse,Zt(F(C),{onMouseenter:B,style:{"--icon-size":"24px"},onMouseleave:P,ref_key:"wrapperRef",ref:s,actived:F(l),bordered:!0}),{suffix:Re(()=>[a.disabled?Ve("",!0):(L(),re("div",{key:0,class:ke([$.$style.suffix,"wrapper-suffix"])},[i.value&&!F(c).isEmpty&&!F(c).isError?ft((L(),qe(ym,{key:0,variant:["icon","secondary"],size:24,onClick:Ot(R,["prevent","stop"])},{default:Re(()=>[De(Dp,{src:"Copy",source:"remote",size:12})]),_:1})),[[F(r),{content:F(A),hideOnClick:!1,contentClass:"extra-padding"}]]):Ve("",!0)],2))]),default:Re(()=>[be("div",{class:ke($.$style["metric-wrapper"]),"aria-label":F(d).format_value||void 0},[be("div",{class:ke([$.$style["metric-content"],a.disabled?$.$style.disabled:""])},[!F(c).isError&&F(c).isEmpty?(L(),re($t,{key:0},[F(c).pendingCalculation?ft((L(),re("span",{key:0,class:ke($.$style["metric-empty"])},[...V[0]||(V[0]=[Dt(" - ",-1)])],2)),[[F(r),"Can’t calculate yet. Complete required fields."]]):F(c).isEmpty?(L(),re("span",{key:1,class:ke($.$style["metric-empty"])}," - ",2)):Ve("",!0)],64)):Ve("",!0),F(c).isError?ft((L(),re("div",{key:1,class:ke($.$style["metric-error"])},[...V[1]||(V[1]=[Dt(" Error ",-1)])],2)),[[F(r),"Something went wrong. Review formula, inputs and retry."]]):Ve("",!0),!F(c).isEmpty&&!F(c).isError?ft((L(),re("span",{key:2,class:ke([$.$style["metric-value"],F(S)?$.$style.hovered:"",{[$.$style.disabled]:a.disabled}])},[Dt(vt(T.value),1)],2)),[[F(r),{content:v.value,bypassOverflowCheck:g.value}]]):Ve("",!0)],2)],10,wPa)]),_:1},16,["actived"])),[[F(n),{isLoading:F(c).isLoading}]])}}),CPa="_disabled_7otc0_15",SPa="_hovered_7otc0_19",kPa={"metric-wrapper":"_metric-wrapper_7otc0_1","metric-content":"_metric-content_7otc0_5",disabled:CPa,"metric-value":"_metric-value_7otc0_19",hovered:SPa,"metric-error":"_metric-error_7otc0_23","with-morpheme":"_with-morpheme_7otc0_38","with-formula-icon":"_with-formula-icon_7otc0_41","metric-value--number":"_metric-value--number_7otc0_47","metric-value--currency":"_metric-value--currency_7otc0_47","metric-value--percentage":"_metric-value--percentage_7otc0_47","metric-morpheme":"_metric-morpheme_7otc0_51","metric-empty":"_metric-empty_7otc0_64","metric-icon":"_metric-icon_7otc0_71"},EPa={$style:kPa},E3t=Tp(_Pa,[["__cssModules",EPa]]);class xPa extends Error{}class vA extends xPa{constructor(){super("Zone is an abstract class")}}class x3t{get type(){throw new vA}get name(){throw new vA}get ianaName(){return this.name}get isUniversal(){throw new vA}offsetName(t,n){throw new vA}formatOffset(t,n){throw new vA}offset(t){throw new vA}equals(t){throw new vA}get isValid(){throw new vA}}const h$e=new Map;function TPa(e){let t=h$e.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),h$e.set(e,t)),t}const DPa={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function APa(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,a,i,o,s,l,u,c]=r;return[o,a,i,s,l,u,c]}function OPa(e,t){const n=e.formatToParts(t),r=[];for(let a=0;a<n.length;a++){const{type:i,value:o}=n[a],s=DPa[i];i==="era"?r[s]=o:lle(s)||(r[s]=parseInt(o,10))}return r}const p$e=new Map;class sle extends x3t{static create(t){let n=p$e.get(t);return n===void 0&&p$e.set(t,n=new sle(t)),n}static resetCache(){p$e.clear(),h$e.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=sle.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return $Pa(t,n,r,this.name)}formatOffset(t,n){return cle(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=TPa(this.name);let[a,i,o,s,l,u,c]=r.formatToParts?OPa(r,n):APa(r,n);s==="BC"&&(a=-Math.abs(a)+1);const d=RPa({year:a,month:i,day:o,hour:l===24?0:l,minute:u,second:c,millisecond:0});let p=+n;const h=p%1e3;return p-=h>=0?h:1e3+h,(d-p)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let m$e=null;class vV extends x3t{static get utcInstance(){return m$e===null&&(m$e=new vV(0)),m$e}static instance(t){return t===0?vV.utcInstance:new vV(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new vV(D3t(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${cle(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${cle(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return cle(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function lle(e){return typeof e>"u"}function ule(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function T3t(e){if(!(lle(e)||e===null||e===""))return parseInt(e,10)}function IPa(e){if(!(lle(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function RPa(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function $Pa(e,t,n,r=null){const a=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(i.timeZone=r);const o={timeZoneName:t,...i},s=new Intl.DateTimeFormat(n,o).formatToParts(a).find(l=>l.type.toLowerCase()==="timezonename");return s?s.value:null}function D3t(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,a=n<0||Object.is(n,-0)?-r:r;return n*60+a}function cle(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),a=e>=0?"+":"-";switch(t){case"short":return`${a}${ule(n,2)}:${ule(r,2)}`;case"narrow":return`${a}${n}${r>0?`:${r}`:""}`;case"techie":return`${a}${ule(n,2)}${ule(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const A3t=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function yV(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function bV(...e){return t=>e.reduce(([n,r,a],i)=>{const[o,s,l]=i(t,a);return[{...n,...o},s||r,l]},[{},null,1]).slice(0,2)}function O3t(...e){return(t,n)=>{const r={};let a;for(a=0;a<e.length;a++)r[e[a]]=T3t(t[n+a]);return[r,null,n+a]}}const I3t=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,PPa=`(?:${I3t.source}?(?:\\[(${A3t.source})\\])?)?`,R3t=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,$3t=RegExp(`${R3t.source}${PPa}`),g$e=RegExp(`(?:[Tt]${$3t.source})?`),MPa=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,NPa=/(\d{4})-?W(\d\d)(?:-?(\d))?/,LPa=/(\d{4})-?(\d{3})/,FPa=O3t("weekYear","weekNumber","weekDay"),BPa=O3t("year","ordinal"),VPa=/(\d{4})-(\d\d)-(\d\d)/,P3t=RegExp(`${R3t.source} ?(?:${I3t.source}|(${A3t.source}))?`),UPa=RegExp(`(?: ${P3t.source})?`);function wV(e,t,n){const r=e[t];return lle(r)?n:T3t(r)}function HPa(e,t){return[{year:wV(e,t),month:wV(e,t+1,1),day:wV(e,t+2,1)},null,t+3]}function _V(e,t){return[{hours:wV(e,t,0),minutes:wV(e,t+1,0),seconds:wV(e,t+2,0),milliseconds:IPa(e[t+3])},null,t+4]}function pG(e,t){const n=!e[t]&&!e[t+1],r=D3t(e[t+1],e[t+2]),a=n?null:vV.instance(r);return[{},a,t+3]}function mG(e,t){const n=e[t]?sle.create(e[t]):null;return[{},n,t+1]}yV(MPa,g$e),yV(NPa,g$e),yV(LPa,g$e),yV($3t),bV(HPa,_V,pG,mG),bV(FPa,_V,pG,mG),bV(BPa,_V,pG,mG),bV(_V,pG,mG),bV(_V),yV(VPa,UPa),yV(P3t),bV(_V,pG,mG);var Hf=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Hf||{});Hf.review,Hf.review_take,Hf.review_scene,Hf.review_rendition,Hf.review_frame,Hf.review_rendition_comment,Hf.review_comment,Hf.scene_hub,Hf.hub_rendition,Hf.hub_comment,Hf.people_insight,Hf.people_detail,Hf.project,Hf.woohoo,Hf.update,Hf.core,Hf.project_focusMode,new Date().getUTCFullYear()-12,new Date().getUTCFullYear()+12;const jPa=ct({name:"EmptyData",__name:"EmptyData",props:{isSearching:{type:Boolean},isFiltering:{type:Boolean}},setup(e){const t=e,n={noData:"No data available.",noSearchResults:"No results. Try another search.",noFilterResults:"No results. Try another filter.",emptySearchFilter:"No results. Try another search or filter."};z(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate");const r=z(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),a=W(!1);return nn(()=>{a.value=!0}),(i,o)=>(L(),re("div",{class:ke(i.$style["no-data-item-table"])},[be("div",{class:ke(i.$style.visual)},[a.value?(L(),qe(JOa,{key:0,source:"remote",src:"NoDataGeneral",ratio:"4/3",maxWidth:500,maxHeight:350})):Ve("",!0)],2),be("div",{class:ke(i.$style.description)},vt(r.value),3)],2))}}),zPa="_visual_oh0wi_12",WPa="_description_oh0wi_19",GPa={"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:zPa,description:WPa},qPa={$style:GPa},KPa=Tp(jPa,[["__cssModules",qPa]]),YPa={ROW_HEIGHT:38},JPa=e=>{var t,n,r;if(e){if(Number((t=e.metric_type)==null?void 0:t.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number((n=e.metric_type)==null?void 0:n.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number((r=e.metric_type)==null?void 0:r.id)==3)return}},v$e=e=>{if(e)return JPa(e)};class ZPa{constructor(){Ud(this,"eGui"),Ud(this,"params")}init(t){this.params=t}getGui(){var t,n,r,a,i;const o=document.createElement("div");return(t=this.params)!=null&&t.height&&o.style.setProperty("--height",(n=this.params)==null?void 0:n.height),(r=this.params)!=null&&r.width?o.style.setProperty("--width",(a=this.params)==null?void 0:a.width):(i=this.params)!=null&&i.fullwidth?o.style.setProperty("--width","100%"):o.style.setProperty("--width",`${Math.floor(Math.random()*50)+50}%`),o.className="ag-cell-skeleton",o.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation()}),this.eGui=o,o}refresh(t){return!1}getValue(){var t;return(t=this.params)==null?void 0:t.value}isPopup(t){return!1}getPopupPosition(){}destroy(){}}const XPa=ct({__name:"Vue3Wrapper",props:{component:{},params:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},tooltip:{},isNoData:{type:Boolean,default:!1},workspaceId:{},entityId:{},axiosService:{},isSearching:{type:Boolean,default:!1},isFiltering:{type:Boolean,default:!1},sortType:{default:"default"},maxRating:{default:5},config:{}},setup(e,{expose:t}){const n=e,r=W(null),a=z(()=>{var s;return((s=n.component)==null?void 0:s.name)||"UnknownComponent"}),i=z(()=>{var s;return((s=n.component)==null?void 0:s.default)||n.component}),o=z(()=>({params:n.params,disabled:n.disabled,readOnly:n.readOnly,value:n.value,maxRating:n.maxRating,data:n.data,id:n.id,workspaceId:n.workspaceId,entityId:n.entityId,axiosService:n.axiosService,tooltip:n.tooltip,isSearching:n.isSearching,isFiltering:n.isFiltering,isNoData:n.isNoData,config:n.config}));return t({focus:()=>{var s;return(s=r.value)!=null&&s.focus?r.value.focus():console.warn(`Component ${a.value} does not have a focus method.`),!0},blur:()=>{var s,l;return(l=(s=r.value)==null?void 0:s.blur)==null||l.call(s),!0},trigger:(s,l)=>{var u;return(u=r.value)==null||u.$emit(s,l),!0}}),(s,l)=>(L(),qe(sc(i.value),Zt(o.value,{ref_key:"componentRef",ref:r}),null,16))}}),QPa="_skeleton_7xde7_1",eMa="_shimmer_7xde7_16",tMa={skeleton:QPa,shimmer:eMa,"skeleton-loading":"_skeleton-loading_7xde7_1"},nMa={$style:tMa},rMa=Tp(XPa,[["__cssModules",nMa]]);function aMa(e){return"stopEditing"in e}const iMa=8,oMa=e=>{if(!e)return;const t=e.__vueParentComponent,n=t==null?void 0:t.exposed;n&&typeof n.triggerFocus=="function"?n.triggerFocus():e.focus()};function M3t(e){return class{constructor(){Ud(this,"container"),Ud(this,"vNode",null),Ud(this,"componentInstance",null),Ud(this,"componsenExposed",null),Ud(this,"params"),Ud(this,"isEditor",!1),Ud(this,"_destroyed",!1)}init(t){var n,r,a,i;if(!t){console.error("[Vue3CellWrapper] Missing params");return}const o=performance.now();this.params=t,this.isEditor=aMa(t),this.container=document.createElement("div"),this.container.classList.add("ag-vue3-cell-wrapper"),this.container.style.width="100%",this.container.style.height="100%";const s=t.context.apiClass,l=t,u={component:e,params:Object.freeze(t),disabled:!1,readOnly:l.readOnly??!1,value:t.value,maxRating:l.maxRating??void 0,data:t.data,id:(n=t==null?void 0:t.data)==null?void 0:n.id,workspaceId:t.context.workspaceId,entityId:t.context.entityId,axiosService:s,tooltip:l.tooltip??void 0,isSearching:l.isSearching??!1,isFiltering:l.isFiltering??!1,isNoData:l.isNoData??!1,config:l.config,sceneId:(l==null?void 0:l.sceneId)||void 0};this.vNode=De(rMa,u),dx(this.vNode,this.container);const c=performance.now()-o;c>iMa&&console.warn(`[Vue3CellWrapper] Slow render (${c.toFixed(1)}ms) for "${(r=t.colDef)==null?void 0:r.field}"`),this.componentInstance=(a=this.vNode.component)==null?void 0:a.proxy,this.componsenExposed=(i=this.vNode.component)==null?void 0:i.exposed}getGui(){return this.container}refresh(t){return!1}focusUi(){var t;(t=this.componsenExposed)!=null&&t.focus?this.componsenExposed.focus():oMa(this.container)}getValue(){var t,n,r;return this.params._editorValue!==void 0?this.params._editorValue:this.componentInstance?((r=(n=this.componentInstance).getValue)==null?void 0:r.call(n))??this.componentInstance.value:(console.warn("[Vue3CellWrapper] getValue() called but component instance not available"),(t=this.params)==null?void 0:t.value)}isPopup(t){var n,r,a,i,o;const s=(a=(r=(n=this.params)==null?void 0:n.colDef)==null?void 0:r.field)==null?void 0:a.includes("metric"),l=((i=this.params)==null?void 0:i.context)&&v$e(this.params.context);return s||l==="number"||l==="rating"||!this.isEditor?!1:(o=this.componentInstance)!=null&&o.isPopup?this.componentInstance.isPopup():!0}getPopupPosition(){var t,n,r;return this.isEditor?(t=this.componentInstance)!=null&&t.getPopupPosition?this.componentInstance.getPopupPosition():((r=(n=this.params)==null?void 0:n.colDef)==null?void 0:r.cellEditorPopupPosition)??"under":void 0}afterGuiAttached(){!this.isEditor||this.componentInstance}destroy(){if(!this._destroyed&&(this._destroyed=!0,!!this.container))try{const t=this.componentInstance;if(t){try{typeof t.$destroy=="function"&&t.$destroy()}catch(n){console.warn("[Vue3CellWrapper] Error during $destroy:",n)}try{typeof t.destroy=="function"&&t.destroy()}catch(n){console.warn("[Vue3CellWrapper] Error during destroy():",n)}}(typeof queueMicrotask=="function"?queueMicrotask:n=>Promise.resolve().then(n))(()=>{try{dx(null,this.container)}catch(n){console.warn("[Vue3CellWrapper] Error during unmount:",n)}finally{this.container.textContent=""}})}catch(t){console.error("[Vue3CellWrapper] Error during cleanup:",t)}finally{this.vNode=null,this.componentInstance=null}}}}function sMa(e){return M3t(e)}function lMa(e){return M3t(e)}let N3t=!1;N3t||(zca.registerModules([Xka,tNt]),N3t=!0);class uMa{constructor(t,n){Ud(this,"gridApi",null),Ud(this,"container"),Ud(this,"config"),Ud(this,"eventListeners",new Map),this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:r,onRowSelected:a,...i}=this.config,o={...i,onGridReady:s=>{this.gridApi=s.api,t&&t(s)},onCellClicked:s=>{n&&n(s)},onCellFocused:s=>{r&&r(s)},onRowSelected:s=>{a&&a(s)}};return this.gridApi=wwa(this.container,o),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const r={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(r),n==="bottom"){const a=this.gridApi.getDisplayedRowCount();a>0&&this.gridApi.ensureIndexVisible(a-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const r={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(r),n==="bottom"){const a=this.gridApi.getDisplayedRowCount();a>0&&this.gridApi.ensureIndexVisible(a-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(r=>{var a;(a=this.gridApi)==null||a.removeEventListener(n,r)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const cMa=UPt.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),dMa=ct({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=W(null);y2a(i,()=>{var v;const b=(v=o.value)==null?void 0:v.getApi();b==null||b.clearFocusedCell()});const o=W(null),s=z(()=>({width:"100%",height:r.height||"500px"})),l=z(()=>({...r,theme:cMa}));function u(){if(!i.value){console.warn("Grid container element not found");return}const v={...l.value,height:r.height};o.value=new uMa(i.value,v),o.value.init(),c()}function c(){var v;const b=((v=o.value)==null?void 0:v.getApi())??null;a("onGridReady",b)}function d(v){var b,_;if(!v)return;(b=o.value)==null||b.updateColumnDefs(v);const C=v.map(S=>S.field&&S.width&&!S.hide?{colId:S.field,width:S.width,flex:null}:null).filter(S=>S!==null);(_=o.value)==null||_.setColumnWidth(C)}function p(){var v;(v=o.value)==null||v.destroy(),o.value=null}function h(){var v;return((v=o.value)==null?void 0:v.getApi())||void 0}function g(){return o.value||null}return lt(()=>r.columnDefs,(v,b)=>{const _=v==null?void 0:v.filter(S=>!S.hide).map(S=>S.field).join(","),C=b==null?void 0:b.filter(S=>!S.hide).map(S=>S.field).join(",");_!==C&&d(v)},{deep:!0}),$r(()=>{p()}),t({gridApi:h,gridManager:g,syncColumnDefs:d}),nn(()=>{u()}),$r(()=>{p()}),(v,b)=>(L(),re("div",{ref_key:"gridContainerRef",ref:i,style:Yt(s.value),class:ke(["ag-theme-quartz",["ag-table-container",r.isSorting?"is-sorting":""]])},null,6))}}),gG=lMa;function L3t(e){return{sceneId:z(()=>{var t;const n=(t=e.params)==null?void 0:t.context;return(n==null?void 0:n.sceneId)||""}),updateCellData:t=>{var n,r,a,i,o;const s=((n=e.params)==null?void 0:n.node.id)||"",l=(a=(r=e.params)==null?void 0:r.api)==null?void 0:a.getRowNode(s);l&&l.setDataValue("metric_value",t),(o=(i=e.params)==null?void 0:i.api)==null||o.refreshCells({rowNodes:l?[l]:[],columns:["metric_value"],force:!0})}}}const fMa={class:"metric-editor-wrapper",ref:"metricEditorWrapperRef"},hMa=ct({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},setup(e){const t=e,n=W(t.value),r=W(!0),a=W(""),i=()=>{var b,_,C;const S=(b=l.value)==null?void 0:b.restricted_type.trim(),y=((C=(_=l.value)==null?void 0:_.restricted_value)==null?void 0:C.split(",").map(Number))||[],[T,k]=y,E={range:`Enter a value between ${T} and ${k}`,not:`These values are not allowed: ${y.join(", ")}`,exact:"Value is not allowed"}[S];return r.value?"":E},o=b=>{if(l.value){if(b===null||b===""){r.value=!0;return}if(s.value!=="number"){r.value=!0;return}r.value=URe(l.value,Number(b)),a.value=i()}},s=z(()=>BOa(l.value)),l=z(()=>{var b;return((b=t.params)==null?void 0:b.data.metric_config)||null}),{apiServices:u}=cRe(!0,t),{sceneId:c,updateCellData:d}=L3t(t),p=W(!1),h=()=>{var b;(b=t.params)==null||b.api.stopEditing()},g=()=>{h()},v=async b=>{var _,C,S;if(h(),p.value=!0,n.value=b||null,b===t.value){p.value=!1;return}const y={itemIds:[c.value],metricId:((_=l.value)==null?void 0:_.id)||"",workspaceId:String(t.workspaceId)};b==null?y.clear=1:y.value=b;const T=b||null,k=t.value;d(T);try{const E=await((C=u.value)==null?void 0:C.bulkUpdateMetric(y));(E==null?void 0:E.message)=="Done"?(d(T),n.value=T):(d(k),console.error("Failed to update metric value:",E),n.value=k)}catch(E){d(k),n.value=k,console.error("Error during bulk metric update:",E)}finally{p.value=!1,(S=t.params)==null||S.api.stopEditing()}};return(b,_)=>(L(),re("div",fMa,[s.value=="dropdown"&&l.value?(L(),qe(F(DIa),{key:0,config:l.value,modelValue:n.value,"onUpdate:modelValue":_[0]||(_[0]=C=>n.value=C),onChange:v,onHandleCancel:g},null,8,["config","modelValue"])):s.value=="number"&&l.value?(L(),qe(F(IIa),{key:1,showInlineError:!1,autoEmit:!0,config:l.value,modelValue:n.value,"onUpdate:modelValue":_[1]||(_[1]=C=>n.value=C),style:{width:"100%"},onHandleChange:v,onCancel:g,onOnValidation:o},null,8,["config","modelValue"])):Ve("",!0)],512))}}),pMa=Tp(hMa,[["__scopeId","data-v-c1be75e1"]]),mMa={key:0,style:{color:"#6b6b6b"}},gMa=ct({__name:"MetricCellRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=qC,n=e,r=z(()=>{var o,s;return(s=(o=n.params)==null?void 0:o.value)==null?void 0:s.morpheme}),a=z(()=>{var o,s;return(s=(o=n.params)==null?void 0:o.value)==null?void 0:s.name}),i=z(()=>{var o;const s=(o=n.params)==null?void 0:o.value;return(s==null?void 0:s.is_primary)==1?"primary":(s==null?void 0:s.is_point_metric)==1?"secondary":""});return(o,s)=>(L(),re("div",{class:ke(o.$style["metric-content"])},[ft((L(),re("span",null,[Dt(vt(a.value),1)])),[[F(t),{content:a.value}]]),r.value?(L(),re("small",mMa," ("+vt(r.value)+") ",1)):Ve("",!0),i.value==="primary"?ft((L(),re("div",{key:1,class:ke(o.$style["icon-metric"])},[De(F(Dp),{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[F(t),"Woohoo metric"]]):Ve("",!0),i.value==="secondary"?ft((L(),re("div",{key:2,class:ke(o.$style["icon-metric"])},[De(F(Dp),{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[F(t),"Point Metric"]]):Ve("",!0)],2))}}),vMa={"icon-metric":"_icon-metric_wflah_1","metric-content":"_metric-content_wflah_10"},yMa={$style:vMa},bMa=Tp(gMa,[["__cssModules",yMa]]),wMa=ct({__name:"MetricRating",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},setup(e,{expose:t}){const n=RIe,r=e,{isEditing:a}=gBt(r),{apiServices:i}=cRe(!0,r),o=z(()=>{var k,E;return{value:s.value,metricConfig:((E=(k=r.params)==null?void 0:k.colDef)==null?void 0:E.context)||r.config,error:r.error,hovered:!1,readOnly:r.disabled,disabled:r.readOnly,apiServices:i.value}}),s=W(Number(r.value)),l=W(!1),{componentState:u,metricConfig:c,ICON_SIZE:d,ratingParams:p,standardNameforIcon:h}=k3t(o,l),{sceneId:g,updateCellData:v}=L3t(r),b=W(s.value),_=async k=>{var E,I;s.value=k,b.value,v(void 0),s.value=NaN;const D={itemIds:[g.value],metricId:((E=c.value)==null?void 0:E.id)||"",workspaceId:String(r.workspaceId)};k==null?D.clear=1:D.value=k;try{const A=await((I=i.value)==null?void 0:I.bulkUpdateMetric(D));(A==null?void 0:A.message)=="Done"?(v(k),s.value=Number(k),b.value=k):(v(b.value),s.value=Number(b.value),console.error("Failed to update metric value:",A))}catch(A){v(b.value),s.value=Number(b.value),console.error("Error during bulk metric update:",A)}},C=uRe(async k=>{Ct(()=>{setTimeout(()=>{_(s.value)},100)})},300),S=z(()=>({disabled:r.disabled,error:u.value.isError,clickable:!0,readOnly:r.readOnly,isEmpty:u.value.isEmpty})),y=W(null),{argsMain:T}=Wse(S);return t({focus:()=>{var k,E;(E=(k=y.value)==null?void 0:k.focus)==null||E.call(k)}}),(k,E)=>(L(),qe(F(Gse),Zt({style:{"--icon-size":"24px","--box-padding":"0 0 0 0"}},F(T),{ref:"wrapperRef",actived:F(a),size:32,tabindex:"0",bordered:!0}),{default:Re(()=>[F(u).isRating&&F(p).maxRating?ft((L(),qe(F(EIa),{key:0,modelValue:s.value,"onUpdate:modelValue":E[0]||(E[0]=I=>s.value=I),ref_key:"ratingComponentRef",ref:y,params:F(p),readOnly:r.readOnly,disabled:r.disabled,onHandleEnter:_},{icon:Re(({value:I})=>[De(F(Dp),{onClick:D=>F(C)(I),source:"rating",src:F(h)()||"Star",size:F(d)},null,8,["onClick","src","size"])]),_:1},8,["modelValue","params","readOnly","disabled"])),[[F(n),{isLoading:F(u).isLoading,fullwidth:!0}]]):Ve("",!0)]),_:1},16,["actived"]))}}),_Ma={id:"metric-table",ref:"tableWrapperRef"},CMa="API_BASE_URL",SMa="formula",dle=10,kMa=!1,EMa=ct({__name:"App",props:{sceneId:{default:"oppkws63"},workspaceId:{default:"w:yngazem"},availableHeight:{},onMessage:{}},emits:["update-success","update-error"],setup(e,{expose:t,emit:n}){const r=e,a=z(()=>r.availableHeight??window.innerHeight-200),i=A=>oRe.getInstance().getItem(A)||"",o=()=>{const A=i(CMa);return A.includes("/v1")?A.slice(0,A.lastIndexOf("/v1")):A},s=A=>{var R;return((R=A==null?void 0:A.metric_type)==null?void 0:R.code)===SMa},l=A=>{var R;return((R=A==null?void 0:A.metric_type)==null?void 0:R.code)==="rating"&&(A==null?void 0:A.format_type)=="icon"},u=A=>(s(A)||l(A),A.input_value??null),c=A=>A.map((R,B)=>({id:String(R.id??B),name:{name:String(R.name??"Untitled metric"),is_primary:R.is_primary,is_point_metric:R.is_point_metric,morpheme:R.morpheme_value},metric_config:R,metric_value:u(R),metric_permission:R.auth_permission})),d=A=>{var R,B;const P=A.data,$=(R=A.node.data)==null?void 0:R.metric_value,V=(B=A.node.data)==null?void 0:B.metric_config,N=v$e(V);return P===void 0?{component:ZPa,params:{}}:N==="rating"?{component:gG(wMa),params:{config:V,value:$,maxRating:V==null?void 0:V.range,sceneId:r.sceneId}}:N==="dropdown"?{component:gG(E3t),params:{config:V,value:$}}:{component:gG(E3t),params:{config:V,value:$}}},p=A=>{var R,B,P,$,V;const N=v$e((R=A.node.data)==null?void 0:R.metric_config);return{component:gG(pMa),params:{config:(B=A.node.data)==null?void 0:B.metric_config,value:(P=A.node.data)==null?void 0:P.metric_value,maxRating:(V=($=A.node.data)==null?void 0:$.metric_config)==null?void 0:V.range},popup:!(N=="number"||N=="rating")}};function h(A){var R;return!A||s(A)||l(A)?!1:((R=A.auth_permission)==null?void 0:R.permission)==2}const g=A=>!!(A.data&&A.node.data&&h(A.data.metric_config)),v=A=>({component:gG(bMa),params:{value:A.value}}),{apiServices:b}=cRe(!1,r),_=z(()=>[{field:"name",headerName:"Metric",minWidth:220,flex:2,cellRendererSelector:v,editable:!1,cellEditorSelector:void 0},{field:"metric_value",headerName:"Value",minWidth:140,flex:1,cellRendererSelector:d,cellEditorSelector:p,editable:g,cellEditorPopupPosition:"under",cellEditorPopup:!0}]),C=n,S=z(()=>({isSearching:!1,isFiltering:!1})),y=z(()=>({headerHeight:32,blockLoadDebounceMillis:300,columnDefs:_.value,rowModelType:"infinite",cacheBlockSize:dle,infiniteInitialRowCount:dle,pagination:!1,rowHeight:YPa.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,suppressScrollOnNewData:!0,rowBuffer:dle,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,stopEditingWhenCellsLoseFocus:!1,noRowsOverlayComponent:sMa(KPa),noRowsOverlayComponentParams:()=>S.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:A=>A.data.id,getRowClass:A=>A.data?["row-highlight"]:["row-empty"],suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:r.workspaceId,sorting:!1,apiServices:b.value,sceneId:r.sceneId},suppressHeaderFocus:!0,navigateToNextCell:()=>null,onCellKeyDown:A=>{var R,B,P;if(((R=A==null?void 0:A.event)==null?void 0:R.key)==="Enter"){const{api:$,node:V,column:N}=A,q=$.getCellRendererInstances({rowNodes:[V],columns:[N]});if(q.length>0){const J=q[0];J&&typeof((B=J.componsenExposed)==null?void 0:B.focus)=="function"&&((P=J.componsenExposed)==null||P.focus())}}},isRowSelectable:A=>!A.group,suppressKeyboardEvent:A=>{var R;if((R=A.data)!=null&&R.isDeleted)return!0;const B=A.event.key,P=A.editing;return P&&B==="Tab"?!0:P&&B==="Enter"?!1:B==="Enter"?(A.event.preventDefault(),A.event.stopPropagation(),!0):B==="ArrowUp"||B==="ArrowDown"||B==="ArrowLeft"||B==="ArrowRight"||B==="Tab"||B==="Enter"},tabToNextCell:A=>{let R=A.nextCellPosition;if(R&&R.column.getColId()==="ag-Grid-SelectionColumn"){const B=A.api.getAllDisplayedColumns(),P=B.indexOf(R.column),$=A.backwards?-1:1,V=B[P+$];if(V)return{rowIndex:R.rowIndex,column:V,rowPinned:R.rowPinned}}return R||!1}})),T=async A=>{var R,B;try{const P=await((R=b.value)==null?void 0:R.getMetrics(r.sceneId,A.page,A.pageSize)),$=Array.isArray(P==null?void 0:P.data)?P.data:[],V=Number(((B=P==null?void 0:P.meta)==null?void 0:B.total)??$.length??0);return{rows:c($),total:V}}catch(P){return console.error("Failed to fetch metrics",P),{rows:[],total:0}}},k=W(-1);function E(A,R){return{async getRows(B){try{const P=Math.floor(B.startRow/R)+1,{rows:$,total:V}=await A({page:P,pageSize:R,sort_by:B.sortModel});k.value=V,B.successCallback($,k.value)}catch(P){console.error("Datasource fetch error",P),B.failCallback()}}}}const I=W(null),D=A=>{var R;return A?(I.value=A,(R=A.setGridOption)==null||R.call(A,"datasource",E(T,dle)),A):null};return ko(()=>{try{const A=_a();if(!A)throw new Error("Current instance is null");const R={domainApi:o(),wsCode:r.workspaceId,sceneId:r.sceneId};if(!R.sceneId||!R.wsCode||!R.domainApi)throw new Error("API configuration is incomplete");const B=new bPa({},{domainApi:R.domainApi,wsCode:R.wsCode,sceneId:R.sceneId},r.onMessage);B.on("call-api",P=>{P.success?C("update-success",P):(console.error("API call failed:",P),C("update-error",P))}),A.appContext.config.globalProperties.apiServices=B}catch(A){console.error("Error getting current instance:",A)}}),t({refreshGrid:()=>{const A=I.value||null;A&&A.refreshInfiniteCache()}}),(A,R)=>(L(),re("div",_Ma,[De(F(dMa),Zt({id:"item_table_main",ref:"agGrid"},y.value,{height:a.value+"px",isSorting:kMa,onOnGridReady:D}),null,16,["height"])],512))}}),xMa=e=>JSON.parse(e).map((t,n)=>({id:String(n),text:t.name})),TMa=()=>{const e=W(),t=W(!1),n=Cl(),r=Di(),a=C=>{r.showMessage(C,"error")},{updateMetric:i}=n,o=async C=>{t.value=!0;const S=await i(C);return setTimeout(()=>{t.value=!1},50),S},s=jh(async(C,S,y,T)=>{const k=I=>{T(y,!1),a(I)},E={...S,metric_value:C};try{const I=await o(E);I!=null&&I.success&&T(C,!0)}catch(I){Qn(I,"updateMetricValue"),k("Update failed.")}},300),l=({params:C,idMetricPayload:S})=>{var I;const y=xMa(C.data.formatValue).map(D=>({value:D.id,label:D.text||""})),T=((I=y.find(D=>D.label==C.data.inputValue))==null?void 0:I.value)??"",k=C.data.auth_permission.permission!==2,E={options:y,scrollerClass:".ag-body-viewport",placeholder:"",morpheme:C.data.morpheme||void 0,limitDecimal:Number(C.data.format_value),value:T,disabled:k,mappingValue:C.data.mapping,"onUpdate:modelValue":D=>{var R;const A=((R=y.find(B=>B.value==D))==null?void 0:R.label)??"";s(A,S,String(T),(B,P)=>{var $;if(P)b(C.data.id,B);else{const V=(($=y.find(N=>N.value==T))==null?void 0:$.label)??"";b(C.data.id,V)}})}};return{childComponent:WQ,childProps:E,isEdit:C.data.isEdit}},u=({params:C,idMetricPayload:S})=>{var D;const y=C.data.restricted_value.split(",").map(A=>({value:A,label:C.data.mapping&&C.data.mapping[`!${A}`]?C.data.mapping[`!${A}`]:A})),T=((D=y.find(A=>A.label==C.data.inputValue))==null?void 0:D.value)??"",k=W(T),E=C.data.auth_permission.permission!==2,I={options:y,scrollerClass:".ag-body-viewport",placeholder:"",disabled:E,morpheme:C.data.morpheme,limitDecimal:Number(C.data.format_value),value:k.value,mappingValue:C.data.mapping,"onUpdate:modelValue":jh(A=>s(A,S,String(T),R=>{var P;const B=((P=y.find($=>$.value==R))==null?void 0:P.label)??"";v(C.data.id,R,B)}),500)};return{childComponent:WQ,childProps:I,isEdit:C.data.isEdit}},c=({params:C,idMetricPayload:S})=>{const y=Number(C.data.inputValue),T=W(y),k=C.data.auth_permission.permission!==2,E={ratingIcon:C.data.format_symbol||"BoltSolid",value:T.value,maxRating:C.data.range,readOnly:k,"onUpdate:modelValue":async I=>s(I,S,Number(T.value),D=>b(C.data.id,D))};return{childComponent:C_e,childProps:E,isEdit:C.data.isEdit}},d=({params:C,idMetricPayload:S})=>{var I;const y=((I=C.data)==null?void 0:I.inputValue)===null?"":String(C.data.inputValue),T=W(y),k=C.data.auth_permission.permission!==2,E={value:T.value,morpheme:C.data.morpheme,disabled:k,limitDecimal:Number(C.data.format_value),inputType:"number",change:D=>{s(D,S,String(T.value),A=>{b(C.data.id,A)})}};return{childComponent:ZQ,childProps:E,isEdit:C.data.isEdit}},p=Gp(),h=C=>{if(!C.data)return;const S={item_ids:[p??""],metric_id:C.data.id},y=C.data.formatType;let T={childComponent:ZQ,childProps:{},isEdit:C.data.isEdit};switch(y){case Vde.dropdown:T=l({params:C,idMetricPayload:S});break;case Vde.rating:T=c({params:C,idMetricPayload:S});break;case Vde.number:C.data.restricted_type==="exact"?(C.data.formatValue=C.data.restricted_value,T=u({params:C,idMetricPayload:S})):C.data.formula?T=g({params:C}):T=d({params:C,idMetricPayload:S});break;default:T=d({params:C,idMetricPayload:S});break}return T},g=({params:C})=>{var y,T,k;const S={formulaValue:((y=C.data)==null?void 0:y.inputValue)||"",morpheme:((T=C.data)==null?void 0:T.morpheme)||"",limitDecimal:Number((k=C.data)==null?void 0:k.format_value),disable:C.data.auth_permission.permission!==2};return{childComponent:zQ,childProps:S,isEdit:C.data.isEdit}},v=(C,S,y)=>{(k=>{e.value.forEachNode(E=>{E.data.id===C&&E.setData({...E.data,value:k||"",inputValue:y})})})(String(S))},b=(C,S)=>{(T=>{e.value.forEachNode(k=>{k.data.id===C&&k.setData({...k.data,inputValue:T})})})(String(S))};return{childComponent:h,updateRows:b,refreshing:t,gridApi:e}},DMa={class:"h-full bg-white metric-log"},AMa={key:0,class:"flex flex-1 p-10 items-center justify-center w-full h-[calc(100%-40px)]"},OMa=Ia(ct({__name:"SceneMetric",emits:["loaded"],setup(e,{emit:t}){const n=Cl(),{sceneId:r,workspaceId:a}=sr(n),{refreshing:i}=TMa(),o=W(!1),s=W(void 0),l=W(null),u=z(()=>o.value&&!i.value),c=lR(),{connectState:d}=sr(c),p=W(!1),h=W(null),g=async()=>{var y;(y=h.value)==null||y.refreshGrid()},v=(y,T="error")=>{Di().showMessage(y,T)},b=y=>{},_=y=>{if(y.apiCode=="offline"){Di().showMessage("You are currently offline. Please check your internet connection.","error");return}else y.res&&y.res.data&&Di().showErrorNetMessage(y.res.data)},C=t,S=()=>{var y;if(l.value){const T=(((y=l.value)==null?void 0:y.offsetHeight)||0)-40;s.value=T}};return nn(()=>{window.addEventListener("resize",S),Ct(()=>{S(),C("loaded")}),C("loaded")}),$r(()=>{window.removeEventListener("resize",S)}),(y,T)=>(L(),qe(kie,{type:"metric","handle-reload":g,class:"scene-metric"},{view:Re(({})=>[be("div",{ref_key:"metricLogRef",ref:l,style:{height:"100%"}},[be("div",null,[De(xae,{title:"Metric","disable-refresh":F(i),onRefresh:g},null,8,["disable-refresh"])]),be("div",DMa,[u.value?(L(),re("div",AMa,[De(Sie,{type:"metric"})])):Ve("",!0),p.value?(L(),qe(dGr,{key:1,class:"loading-indicator"})):Ve("",!0),s.value?(L(),qe(F(EMa),{key:2,sceneId:F(r),workspaceId:F(a),ref_key:"metricTableRef",ref:h,onMessage:v,availableHeight:s.value,onUpdateSuccess:b,onUpdateError:_},null,8,["sceneId","workspaceId","availableHeight"])):Ve("",!0)])],512)]),_:1}))}}),[["__scopeId","data-v-658b2fb2"]]),IMa={class:"rendition-header"},RMa={class:"rendition-main"},$Ma={class:"rendition-list"},PMa={class:"rendition-player"},MMa={class:"rendition-files"},NMa={class:"rendition-description"},LMa=210,a$=300,y$e=100,b$e=255,vG=16,FMa=Ia(ct({__name:"SceneRenditionV2",setup(e){const t=W("layout-vertical"),n=W(),r=Wn({width:0,height:0});return OU(n,()=>{const{width:a,height:i}=n.value.getBoundingClientRect();if(a-a$-vG<i)t.value="layout-vertical",r.width=Math.max(b$e,a-16),r.height=a/(16/9)+32;else{const o=i-16-y$e;o/9*16<=a-a$-vG?(t.value="layout-mixed",r.height=o,r.width=Math.max(b$e,Math.min(o/(9/16),a-a$-vG)-16)):(t.value="layout-horizontal",r.width=Math.max(b$e,a-a$-vG-16),r.height=(a-a$-vG)/(16/9)+32)}}),(a,i)=>(L(),re($t,null,[be("div",{class:"scene-rendition-layout",style:Yt({"--list-width":LMa+"px","--file-width":a$+"px","--description-height":y$e+"px"})},[be("div",IMa,[at(a.$slots,"header",{},void 0,!0)]),be("div",RMa,[be("div",$Ma,[at(a.$slots,"list",{},void 0,!0)]),be("div",{class:ke(["rendition-body",[t.value]]),ref_key:"renditionLayoutBodyRef",ref:n,style:Yt({"--player-width":r.width+"px","--player-height":r.height+"px"})},[be("div",PMa,[at(a.$slots,"player",{height:r.height,width:r.width},void 0,!0)]),be("div",MMa,[at(a.$slots,"files",{width:a$},void 0,!0)]),be("div",NMa,[at(a.$slots,"description",{height:y$e},void 0,!0)])],6)])],4),i[0]||(i[0]=be("div",{class:"scene-rendition-empty"},null,-1))],64))}}),[["__scopeId","data-v-eccc8886"]]),BMa={class:"rendition-wrapper"},VMa=["innerHTML"],UMa=Ia(ct({__name:"RenditionDescription",props:{description:{},updateRenditionDescriptionFnc:{type:Function},height:{}},setup(e){const t=e,n=W(t.description||""),{permission:r}=hm(),a=W(!1),i=u0().getEnvVariable("DELAY_SAVE")||3e3;return lt(()=>t.description,o=>{n.value=o,a.value=!0}),lt(n,jh(async o=>{if(a.value){a.value=!1;return}await t.updateRenditionDescriptionFnc(o)||(a.value=!0,n.value=t.description)},Number(i)),{immediate:!1}),(o,s)=>(L(),re("div",BMa,[F(r).editRendition?(L(),qe(F(fTt),{key:0,modelValue:n.value,"onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l),"max-height":e.height+"px",placeholder:"Enter description"},null,8,["modelValue","max-height"])):(L(),re("div",{key:1,class:"description",innerHTML:n.value||"No description"},null,8,VMa))]))}}),[["__scopeId","data-v-ff803259"]]);function w$e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function HMa(e){if(Array.isArray(e))return w$e(e)}function jMa(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F3t(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(u){return void n(u)}s.done?t(l):Promise.resolve(l).then(r,a)}function CV(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(l){F3t(i,r,a,o,s,"next",l)}function s(l){F3t(i,r,a,o,s,"throw",l)}o(void 0)})}}function B3t(e,t,n){return t=fle(t),qMa(e,z3t()?Reflect.construct(t,n||[],fle(e).constructor):t.apply(e,n))}function V3t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zMa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,G3t(r.key),r)}}function U3t(e,t,n){return t&&zMa(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function H3t(e,t,n){return(t=G3t(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fle(e){return fle=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fle(e)}function j3t(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_$e(e,t)}function z3t(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(z3t=function(){return!!e})()}function WMa(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function GMa(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1037
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return o=l.done,l},e:function(l){s=!0,i=l},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw i}}}}function c$e(e,t,n){return(t=b3t(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v3t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function y3t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v3t(Object(n),!0).forEach(function(r){c$e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v3t(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function O$a(e,t){if(e==null)return{};var n,r,a=I$a(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function I$a(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function n$(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function i(h,g,v,b){var _=g&&g.prototype instanceof s?g:s,C=Object.create(_.prototype);return gy(C,"_invoke",function(S,y,T){var k,E,I,D=0,A=T||[],R=!1,B={p:0,n:0,v:e,a:P,f:P.bind(e,4),d:function($,V){return k=$,E=0,I=e,B.n=V,o}};function P($,V){for(E=$,I=V,t=0;!R&&D&&!N&&t<A.length;t++){var N,q=A[t],J=B.p,ie=q[2];$>3?(N=ie===V)&&(I=q[(E=q[4])?5:(E=3,3)],q[4]=q[5]=e):q[0]<=J&&((N=$<2&&J<q[1])?(E=0,B.v=V,B.n=q[1]):J<ie&&(N=$<3||q[0]>V||V>ie)&&(q[4]=$,q[5]=V,B.n=ie,E=0))}if(N||$>1)return o;throw R=!0,V}return function($,V,N){if(D>1)throw TypeError("Generator is already running");for(R&&V===1&&P(V,N),E=V,I=N;(t=E<2?e:I)||!R;){k||(E?E<3?(E>1&&(B.n=-1),P(E,I)):B.n=I:B.v=I);try{if(D=2,k){if(E||($="next"),t=k[$]){if(!(t=t.call(k,I)))throw TypeError("iterator result is not an object");if(!t.done)return t;I=t.value,E<2&&(E=0)}else E===1&&(t=k.return)&&t.call(k),E<2&&(I=TypeError("The iterator does not provide a '"+$+"' method"),E=1);k=e}else if((t=(R=B.n<0)?I:S.call(y,B))!==o)break}catch(q){k=e,E=1,I=q}finally{D=1}}return{value:t,done:R}}}(h,v,b),!0),C}var o={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(gy(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,gy(h,a,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,gy(d,"constructor",u),gy(u,"constructor",l),l.displayName="GeneratorFunction",gy(u,a,"GeneratorFunction"),gy(d),gy(d,a,"Generator"),gy(d,r,function(){return this}),gy(d,"toString",function(){return"[object Generator]"}),(n$=function(){return{w:i,m:p}})()}function gy(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch{a=0}gy=function(i,o,s,l){function u(c,d){gy(i,c,function(p){return this._invoke(c,d,p)})}o?a?a(i,o,{value:s,enumerable:!l,configurable:!l,writable:!l}):i[o]=s:(u("next",0),u("throw",1),u("return",2))},gy(e,t,n,r)}function R$a(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function b3t(e){var t=R$a(e,"string");return typeof t=="symbol"?t:t+""}function $$a(e,t){if(e){if(typeof e=="string")return m3t(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m3t(e,t):void 0}}var P$a=["accessTokenKey","refreshTokenKey","domain","path","secure","sameSite","canSetTokens","cookieParser"],M$a=function(){function e(){var t,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};l$e(this,e),this.accessTokenKey=r.accessTokenKey||"access_token",this.refreshTokenKey=r.refreshTokenKey||"refresh_token",this.domain=r.domain,this.path=r.path||"/",this.secure=(t=r.secure)!==null&&t!==void 0?t:!0,this.sameSite=r.sameSite||"lax",this.canSetTokens=(n=r.canSetTokens)!==null&&n!==void 0?n:!0,this.cookieParser=r.cookieParser}return u$e(e,[{key:"getCookieValue",value:function(t){if(typeof document>"u")return null;var n=document.cookie.split(";"),r=A$a(n),a;try{for(r.s();!(a=r.n()).done;){var i=a.value;if(i=i.trim(),i.startsWith(t+"=")){var o=i.substring(t.length+1);return this.cookieParser?this.cookieParser(o,t):decodeURIComponent(o)}}}catch(s){r.e(s)}finally{r.f()}return null}},{key:"getAccessToken",value:function(){return this.getCookieValue(this.accessTokenKey)}},{key:"getRefreshToken",value:function(){return this.getCookieValue(this.refreshTokenKey)}},{key:"getExpiresInRefreshToken",value:function(){return this.getCookieValue("account.expires_in_refresh_token")}},{key:"setTokens",value:function(t){if(!this.canSetTokens||typeof document>"u"){console.warn("CookieTokenStorage: Token setting is disabled or running in a non-browser environment");return}var n=this.domain?"; domain=".concat(this.domain):"",r=this.secure?"; secure":"",a="; samesite=".concat(this.sameSite),i="",o="";if(t.expires_in&&typeof t.expires_in=="number"){var s=new Date;s.setTime(s.getTime()+t.expires_in*1e3),i=";expires=".concat(s.toUTCString())}var l=this.getExpiresInRefreshToken();if(sessionStorage.getItem("APP_DEBUG")&&(console.log("[DEBUG] refresh token",t),console.log("[DEBUG] refresh token expires_in value",l)),l){var u=new Date;u.setTime(u.getTime()+Number(l)*1e3),o=";expires=".concat(u.toUTCString())}if(t.access_token||t.token){var c=t.access_token||t.token,d="".concat(this.accessTokenKey,"=").concat(encodeURIComponent(c),"; path=").concat(this.path).concat(n).concat(r).concat(a).concat(i);document.cookie=d}if(t.refresh_token_expires_in&&typeof t.refresh_token_expires_in=="number"){var p=new Date;p.setTime(p.getTime()+t.refresh_token_expires_in*1e3),i=";expires=".concat(p.toUTCString())}if(t.refresh_token){sessionStorage.getItem("APP_DEBUG")&&(console.log("[DEBUG] refesh token set to",t.refresh_token),console.log("[DEBUG] refresh token expires_in set to",o));var h="".concat(this.refreshTokenKey,"=").concat(encodeURIComponent(t.refresh_token),"; path=").concat(this.path).concat(n).concat(r).concat(a).concat(o);document.cookie=h}}},{key:"hasTokens",value:function(){return!!this.getAccessToken()&&!!this.getRefreshToken()}}])}(),N$a=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auth_state_channel",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auth_state_event";l$e(this,e),c$e(this,"channel",null),this.channelName=t,this.storageKey=n,this.initChannel()}return u$e(e,[{key:"initChannel",value:function(){if(typeof BroadcastChannel<"u")try{this.channel=new BroadcastChannel(this.channelName)}catch(t){console.error("Failed to create BroadcastChannel, falling back to storage events:",t),this.channel=null}}},{key:"broadcastEvent",value:function(t){var n=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a={type:t,data:r,timestamp:Date.now()};this.channel?this.channel.postMessage(a):typeof localStorage<"u"&&(localStorage.setItem(this.storageKey,JSON.stringify(a)),setTimeout(function(){return localStorage.removeItem(n.storageKey)},100))}},{key:"onEvent",value:function(t){var n=this;return this.channel?this.channel.onmessage=function(r){t(r.data)}:typeof window<"u"&&window.addEventListener("storage",function(r){if(r.key===n.storageKey&&r.newValue)try{var a=JSON.parse(r.newValue);t(a)}catch(i){console.error("Failed to parse auth event:",i)}}),function(){n.channel?n.channel.onmessage=null:typeof window<"u"&&window.removeEventListener("storage",function(){})}}},{key:"destroy",value:function(){this.channel&&(this.channel.close(),this.channel=null)}}])}(),L$a=function(){function e(t){var n=this;l$e(this,e),c$e(this,"currentAttempt",0),this.instanceId=Math.random().toString(36).substring(2,15),this.refreshTokenFn=t.refreshTokenFn,this.tokenStorage=t.storage,this.maxRetries=t.maxRetries||3,this.retryDelay=t.retryDelay||1e3,this.backoffFactor=t.backoffFactor||2,this.onCrossTabLogout=t.onCrossTabLogout,this.authStateManager=new N$a,this.initCrossTabListener(),this.onRefreshSuccess=t.onRefreshSuccess||function(){console.log("Token refresh successful")},this.onRefreshFailure=t.onRefreshFailure||function(r){console.error("Token refresh failed:",r)},this.onTokenInvalid=t.onTokenInvalid||function(){console.log("Token is invalid or cannot be refreshed");var r=new Error("No refresh token available");n.onRefreshFailure(r),n.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:n.instanceId,reason:"no_refresh_token",error:"No refresh token available"})}}return u$e(e,[{key:"initCrossTabListener",value:function(){var t=this;this.authStateManager.onEvent(function(n){n.type==="auth:logout"&&(console.log("Received logout event:",n.data),n.data&&n.data.sourceInstanceId!==t.instanceId?(console.log("Logout event from different tab, executing logout handlers"),t.onCrossTabLogout?(console.log("Executing onCrossTabLogout with reason: ".concat(n.data.reason||"cross_tab_logout")),t.onCrossTabLogout(n.data.reason||"cross_tab_logout")):typeof t.onLogout=="function"?(console.log("Executing legacy onLogout with reason: ".concat(n.data.reason)),t.onLogout(n.data.reason)):console.warn("No logout handler defined for cross-tab events")):console.log("Ignoring self-generated logout event"))})}},{key:"handleTokenRefresh",value:function(){var t=s$e(n$().m(function r(){var a=this,i,o,s,l;return n$().w(function(u){for(;;)switch(u.p=u.n){case 0:if(i=this.tokenStorage.getRefreshToken(),sessionStorage.getItem("APP_DEBUG")&&console.log("[DEBUG] on handle token refresh",i),i){u.n=1;break}return console.log("No refresh token available"),this.onTokenInvalid(),u.a(2,!1);case 1:return this.currentAttempt=0,u.p=2,u.n=3,this.executeWithRetry(function(){return console.log("Refresh attempt ".concat(a.currentAttempt+1,"/").concat(a.maxRetries)),a.refreshTokenFn(a.tokenStorage.getRefreshToken())});case 3:if(o=u.v,!(!o||!o.access_token&&!o.token)){u.n=4;break}throw console.error("Invalid token response received"),new Error("Invalid token response");case 4:return o.token&&!o.access_token&&(o.access_token=o.token),console.log("Token refresh successful, saving new tokens"),this.tokenStorage.setTokens(o),this.onRefreshSuccess(o),u.a(2,!0);case 5:return u.p=5,l=u.v,console.error("Token refresh failed after all attempts:",l),l===void 0&&(l=new Error("Undefined error during token refresh")),this.onRefreshFailure(l),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:"max_retry_reached",error:((s=l)===null||s===void 0?void 0:s.message)||"Token refresh failed after maximum retries"}),u.a(2,!1)}},r,this,[[2,5]])}));function n(){return t.apply(this,arguments)}return n}()},{key:"executeWithRetry",value:function(){var t=s$e(n$().m(function r(a){var i,o,s;return n$().w(function(l){for(;;)switch(l.p=l.n){case 0:return l.p=0,l.n=1,a();case 1:return l.a(2,l.v);case 2:if(l.p=2,s=l.v,this.currentAttempt++,!(this.currentAttempt>=this.maxRetries)){l.n=3;break}throw console.log("Maximum retry attempts (".concat(this.maxRetries,") reached")),s;case 3:return i=s.response&&s.response.status===425,o=i?this.getRetryAfterDelay(s):this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1),console.log("Retry in ".concat(o,"ms, attempt ").concat(this.currentAttempt,"/").concat(this.maxRetries)),l.n=4,new Promise(function(u){return setTimeout(u,o)});case 4:return l.a(2,this.executeWithRetry(a))}},r,this,[[0,2]])}));function n(r){return t.apply(this,arguments)}return n}()},{key:"getRetryAfterDelay",value:function(t){if(t.response&&t.response.headers){var n=t.response.headers["retry-after"];if(n){var r=parseInt(n,10);if(!isNaN(r))return r*1e3;var a=new Date(n);if(!isNaN(a.getTime()))return a.getTime()-Date.now()}}return this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1)}},{key:"broadcastLogout",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"manual_logout";console.log("Broadcasting logout event with reason: ".concat(t)),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:t,timestamp:Date.now()})}}])}();function F$a(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.tokenExpiredDetection,a=r===void 0?function(c){var d;return((d=c.response)===null||d===void 0?void 0:d.status)===401}:r,i=n.retryStatusCodes,o=i===void 0?[401,425]:i,s=n.tokenHeaderFormatter,l=s===void 0?function(c){return"Bearer ".concat(c)}:s,u=null;e.interceptors.response.use(function(c){return c},function(){var c=s$e(n$().m(function d(p){var h,g,v,b,_,C,S,y,T;return n$().w(function(k){for(;;)switch(k.p=k.n){case 0:if(b=p.config,b){k.n=1;break}return k.a(2,Promise.reject(p));case 1:if(!b._retry){k.n=2;break}return k.a(2,Promise.reject(p));case 2:if(_=(h=p.response)===null||h===void 0?void 0:h.status,!(!_||!o.includes(_)||!a(p))){k.n=3;break}return k.a(2,Promise.reject(p));case 3:if(C=((g=b.url)===null||g===void 0?void 0:g.includes("refresh-token"))||((v=b.url)===null||v===void 0?void 0:v.includes("refreshToken")),!C){k.n=4;break}return k.a(2,Promise.reject(p));case 4:return b._retry=!0,k.p=5,u?console.log("Using existing refresh promise"):(console.log("Starting token refresh"),u=t.handleTokenRefresh()),k.n=6,u;case 6:if(S=k.v,u=null,S){k.n=7;break}return console.log("Token refresh failed"),k.a(2,Promise.reject(p));case 7:return y=t.tokenStorage.getAccessToken(),y&&(b.headers.Authorization=l(y)),console.log("Retrying original request with new token"),k.a(2,e(b));case 8:return k.p=8,T=k.v,console.error("Error during refresh:",T),u=null,k.a(2,Promise.reject(p))}},d,null,[[5,8]])}));return function(d){return c.apply(this,arguments)}}()),e.interceptors.request.use(function(c){if(c.headers.Authorization)return c;var d=t.tokenStorage.getAccessToken();return d&&(c.headers.Authorization=l(d)),c},function(c){return Promise.reject(c)})}function B$a(e){var t=e.accessTokenKey,n=e.refreshTokenKey,r=e.domain,a=e.path,i=e.secure,o=e.sameSite,s=e.canSetTokens,l=e.cookieParser,u=O$a(e,P$a),c=new M$a({accessTokenKey:t,refreshTokenKey:n,domain:r,path:a,secure:i,sameSite:o,canSetTokens:s,cookieParser:l});return new L$a(y3t(y3t({},u),{},{storage:c}))}var Uf=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Uf||{});Uf.review,Uf.review_take,Uf.review_scene,Uf.review_rendition,Uf.review_frame,Uf.review_rendition_comment,Uf.review_comment,Uf.scene_hub,Uf.hub_rendition,Uf.hub_comment,Uf.people_insight,Uf.people_detail,Uf.project,Uf.woohoo,Uf.update,Uf.core,Uf.project_focusMode;const ole={accessToken:"account.token",refreshToken:"account.refresh_token"},w3t={baseUrl:"BASE_URL",cookieDomain:"BASE_DOMAIN_COOKIE"},_3t="/refresh-token",V$a=3e5,U$a="*",C3t={Accept:"application/json","Content-Type":"application/json"},H$a="undefined",j$a="No access token found",r$={badRequest:400,unauthorized:401,tooEarly:425},z$a=[r$.unauthorized,r$.tooEarly,r$.badRequest],W$a={maxRetries:5,retryDelay:500,backoffFactor:1.5},G$a="unauthenticated",q$a="invalid_token",K$a="refresh_token_expired",Y$a={type:"TOKEN_EXPIRED",message:"Authentication token has expired"},J$a="Session refreshed successfully",Z$a="Session expired. Please log in again.",X$a=e=>{const{error:t}=e??{};return typeof t=="string"?t:t==null?void 0:t.key},Q$a=e=>{var t,n;return((t=e==null?void 0:e.response)==null?void 0:t.status)!==r$.badRequest?!1:X$a((n=e.response)==null?void 0:n.data)===q$a},ePa=()=>{},S3t=e=>sessionStorage.getItem(e)||"",d$e=()=>{const e=jRe.get(ole.accessToken);return e&&e!==H$a?e:null},tPa=()=>!!jRe.get(ole.refreshToken),nPa=()=>{const e=window.location.origin,t=S3t(w3t.baseUrl);if(!t)return e;try{return new URL(t,e).origin}catch{return e}};class f$e{constructor(t,n=ePa,r){this.client=t,this.showMessage=n,this.onAuthExpired=r}attach(){const t=B$a({accessTokenKey:ole.accessToken,refreshTokenKey:ole.refreshToken,domain:S3t(w3t.cookieDomain)||void 0,secure:window.location.protocol==="https:",sameSite:"lax",refreshTokenFn:n=>this.refresh(n),onRefreshSuccess:n=>{this.showMessage(J$a,"success"),this.client.defaults.headers.common.Authorization=`Bearer ${n.access_token}`},onRefreshFailure:()=>{this.showMessage(Z$a,"error"),this.handleAuthExpired()},onCrossTabLogout:()=>this.handleAuthExpired(),...W$a});this.handler=t,F$a(this.client,t,{retryStatusCodes:[...z$a],tokenExpiredDetection:f$e.isTokenExpired})}refreshAccessToken(){return!this.handler||!tPa()?Promise.resolve(!1):(this.pendingRefresh??(this.pendingRefresh=this.handler.handleTokenRefresh().catch(()=>!1).finally(()=>{this.pendingRefresh=void 0})),this.pendingRefresh)}static isTokenExpired(t){var n,r;const a=(n=t==null?void 0:t.response)==null?void 0:n.status;if(a===r$.tooEarly)return!0;const{error:i,details:o={}}=((r=t==null?void 0:t.response)==null?void 0:r.data)??{},s=typeof i=="string"?i:i==null?void 0:i.key;return a===r$.badRequest||a!==r$.unauthorized||typeof i=="string"||s!==G$a?!1:Object.keys(o).length===0||o.reason===K$a}async refresh(t){const n=await this.client.post(_3t,{refresh_token:t}),r="data"in n&&n.data?n.data:n;return console.log("Refreshing tokens:",{tokens:r,res:n}),{access_token:r.access_token,refresh_token:r.refresh_token,expires_in:r.expires_in}}handleAuthExpired(){var t;if(window.self===window.top){(t=this.onAuthExpired)==null||t.call(this);return}window.parent.postMessage(Y$a,nPa())}}class rPa{constructor(t={}){this.options={unwrapResponse:!0,withRefreshToken:!0,requireToken:!0,...t},this.client=Lc.create({baseURL:typeof t.baseURL=="string"?t.baseURL:"",timeout:t.timeout??V$a,headers:{...C3t,...t.headers}}),this.setupRequestInterceptor(),this.setupResponseInterceptor(),this.setupErrorHandling()}get(t,n){return this.request({...n,method:"GET",url:t})}post(t,n,r){return this.request({...r,method:"POST",url:t,data:n})}put(t,n,r){return this.request({...r,method:"PUT",url:t,data:n})}patch(t,n,r){return this.request({...r,method:"PATCH",url:t,data:n})}delete(t,n){return this.request({...n,method:"DELETE",url:t})}request(t){return this.client.request(t)}setupRequestInterceptor(){this.client.interceptors.request.use(async t=>{const{baseURL:n,dynamicHeaders:r,requireToken:a}=this.options;typeof n=="function"&&(t.baseURL=n());const i=t.url===_3t,o=i?d$e():await this.resolveAccessToken();if(!o&&a&&!i)throw new Error(j$a);t.headers.set("Accept-Language",U$a),t.headers.has("Content-Type")||t.headers.set("Content-Type",C3t["Content-Type"]),t.headers.has("Content-Type")&&t.headers.get("Content-Type")==="multipart/form-data"&&t.headers.delete("Content-Type"),o&&t.headers.set("Authorization",`Bearer ${o}`);for(const[s,l]of Object.entries((r==null?void 0:r(t))??{}))t.headers.set(s,l);return t})}async resolveAccessToken(){const t=d$e();return t||!this.tokenRefresher?t:(await this.tokenRefresher.refreshAccessToken(),d$e())}setupResponseInterceptor(){this.client.interceptors.response.use(t=>this.options.unwrapResponse?t.data:t)}setupErrorHandling(){const{withRefreshToken:t,showMessage:n,onAuthExpired:r,onError:a}=this.options;t&&(this.tokenRefresher=new f$e(this.client,n,r),this.tokenRefresher.attach()),this.client.interceptors.response.use(void 0,i=>(Q$a(i)&&(r==null||r("/sw?redirect=1")),Promise.reject(i))),a&&this.client.interceptors.response.use(void 0,a)}}const aPa=5,iPa=1e3,oPa=3,sPa="default",lPa=e=>new URL(e,"http://localhost").pathname;class uPa{constructor(t={}){this.groups=new Map,this.defaultLimit=t.defaultLimit??aPa,this.rules=t.rules??[],this.releaseDelayMs=t.releaseDelayMs??iPa}async run(t,n){const r=this.resolveGroup(t);await this.acquire(r);try{return await n()}finally{this.release(r)}}resolveGroup(t){const n=lPa(t),r=this.rules.find(o=>o.pattern.test(n)),a=r?r.pattern.source:sPa;let i=this.groups.get(a);return i||(i={limit:(r==null?void 0:r.limit)??this.defaultLimit,ongoing:0,queue:[]},this.groups.set(a,i)),i}acquire(t){return new Promise(n=>{const r=()=>{t.ongoing++,n()};t.ongoing<t.limit?r():t.queue.push(r)})}release(t){t.ongoing--;const n=t.queue.shift();n&&setTimeout(n,this.releaseDelayMs)}}const cPa=(e,t)=>{const n=new uPa(t),r=Lc.getAdapter(e.defaults.adapter);return e.defaults.adapter=a=>n.run(a.url??"",()=>r(a)),n},dPa=(e,{maxRetries:t=oPa}={})=>{e.interceptors.response.use(void 0,async n=>{var r,a;const i=n.config;if(((r=n.response)==null?void 0:r.status)!==429||!i)return Promise.reject(n);const o=(i._retryCount??0)+1;if(o>t)return Promise.reject(n);i._retryCount=o;const s=Number.parseInt(String(((a=n.response.headers)==null?void 0:a["retry-after"])??""),10),l=Number.isNaN(s)?2**o*1e3:s*1e3;return await new Promise(u=>setTimeout(u,l)),e.request(i)})},fPa=6e4,hPa="/start",pPa=(e=hPa)=>{const t=`${sessionStorage.getItem("BASE_URL")||""}${e}`;console.log("Redirecting to auth URL:",t),window.location.replace(t)};function mPa(e,t){const n=sessionStorage.getItem(e)||"";return(n==null?void 0:n.length)>0?n:t}class gPa{constructor(t,n={}){const{concurrency:r,rateLimitRetry:a,...i}=n,o=()=>mPa("API_BASE_URL","");this.callbackFunc=t,this.api=new rPa({baseURL:o,timeout:fPa,requireToken:!0,onAuthExpired:pPa,...i,unwrapResponse:!1,showMessage:t}),this.axios=this.api.client,r!==!1&&cPa(this.axios,r),a!==!1&&dPa(this.axios,a)}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([a,i])=>{i!=null&&i!==""&&(Array.isArray(i)?i.forEach(o=>n.append(a,String(o))):typeof i=="object"?n.append(a,JSON.stringify(i)):n.append(a,String(i)))});const r=n.toString();return r?`?${r}`:""}async send(t,n,{params:r,data:a,options:i}={}){try{const o=r?this.buildQueryParams(r):"",s={...i,method:t,url:`${this.buildUrl(n)}${o}`};return a!==void 0&&(s.data=a),(await this.axios.request(s)).data}catch(o){throw l$a(o)}}get(t="",n,r){return this.send("GET",t,{params:n,options:r})}post(t="",n,r,a){return this.send("POST",t,{params:n,data:r,options:a})}put(t="",n,r){return this.send("PUT",t,{data:n,options:r})}patch(t="",n,r){return this.send("PATCH",t,{data:n,options:r})}delete(t="",n,r){return this.send("DELETE",t,{data:n,options:r})}}const vPa=({domainApi:e,wsCode:t,sceneId:n})=>({getMetrics:{url:`${e}/v1/workspace/${t}/items/${n}/metrics`,method:"get",code:"getMetrics"},updateMetrics:{url:`${e}/v1/workspace/${t}/items/${n}/metrics`,method:"put",code:"updateMetrics"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"}}),yPa=10;class bPa extends gPa{constructor(t,n,r){const a=n==null?void 0:n.domainApi,i=n==null?void 0:n.wsCode,o=(n==null?void 0:n.sceneId)||"";super(r),this.events=Object.create(null);const s=vPa({domainApi:a,wsCode:i,sceneId:o}),l={};Object.entries(s).forEach(([u,c])=>{const d=u;t[d]?l[d]=t[d]:(console.warn(`API config for ${d} is missing, using base config.`),l[d]=c)}),this.apiConfig=l}on(t,n){var r;((r=this.events)[t]??(r[t]=[])).push(n)}off(t,n){const r=this.events[t];r&&(this.events[t]=r.filter(a=>a!==n))}emit(t,...n){const r=this.events[t];r!=null&&r.length&&r.forEach(a=>{try{a(...n)}catch(i){console.error(`Error in event listener for ${t}:`,i)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:r,payload:a,code:i,responseType:o}){var s,l;const u=this.buildHeaders(a);let c;try{if(c=await this.axios.request({method:t,url:n,params:r,data:a,headers:u,responseType:o}),(((s=c.headers)==null?void 0:s["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const d=((l=c.headers)==null?void 0:l["content-disposition"])||"",p=d.includes("filename=")?d.split("filename=")[1]:"exported_items.xlsx"}if(c.status>=400&&c.status<=500)throw new Error(`Client error (${c.status}): ${c.statusText}`);return this.emit("call-api",{apiCode:i,path:n,params:r,payload:a,res:c,success:!0}),c.data}catch(d){throw console.error("API Request Error:",d),d.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:r,payload:a,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:r,payload:a,error:d,success:!1,apiCode:i,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let r=t;return Object.entries(n).forEach(([a,i])=>{r=r.replace(`{${a}}`,String(i))}),r}async request(t,n,r={}){const{url:a,code:i,method:o}=this.apiConfig[t],s=this.generateUrl(a,n);return this._requestHandler({method:o,path:s,params:r.params,payload:r.payload,code:i,responseType:r.responseType})}getMetrics(t,n=1,r=yPa){return this.request("getMetrics",{itemId:t},{params:{page:n,per_page:r}})}updateMetrics(t){return this.request("updateMetrics",{},{payload:t})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:r,metricId:a,value:i,clear:o}=t,s={item_ids:r,metric_id:a,metric_value:i,clear:o??(i==null||i==0?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete s.item_ids,s.entity_id=String(t.entityId)):(s.item_ids=r,s.entity_id=void 0),s.clear===1&&delete s.metric_value,this.request("bulkMetricUpdate",{workspaceId:n},{payload:s,params:t.filterParams})}}pBt();const k3t=(e,t)=>{const n=W(Number(e.value.value)),r=z(()=>e.value.metricConfig),a=z(()=>{var s,l;const u=r.value,c=t.value,d=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,p=!!e.value.error,h=(u==null?void 0:u.format_type)==="icon",{disabled:g}=e.value;return{pendingCalculation:e.value.value=="N/A"||d&&((s=u==null?void 0:u.metric_type)==null?void 0:s.code)==="formula",isEmpty:d,isError:p,hasPrefix:!d&&!p&&(u==null?void 0:u.morpheme_type)==="prefix",hasSuffix:!d&&!p&&(u==null?void 0:u.morpheme_type)==="suffix",isDropdown:(u==null?void 0:u.format_type)==="dropdown",isFormula:((l=u==null?void 0:u.metric_type)==null?void 0:l.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:c&&!d&&!g}}),i=17,o=z(()=>{var s;return{maxRating:((s=r.value)==null?void 0:s.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:i}});return{componentState:a,metricConfig:r,ICON_SIZE:i,ratingParams:o,standardNameforIcon:()=>{var s;return(((s=r.value)==null?void 0:s.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},wPa=["aria-label"],_Pa=ct({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=RIe,r=qC,a=e,i=Hl(!1),o=W(null),s=W(null),{isEditing:l}=gBt(a),u=z(()=>{var $,V;return{value:a.value,metricConfig:((V=($=a.params)==null?void 0:$.colDef)==null?void 0:V.context)||a.config,error:a.error,hovered:i.value,readOnly:a.readOnly,disabled:a.disabled,active:l}}),{componentState:c,metricConfig:d,internalValue:p}=k3t(u,i),h=z(()=>{var $,V;let N=!1;if(["number","formula"].includes(d.value.metric_type.code)){const q=Number(a.value),J=Number(($=d.value)==null?void 0:$.format_value);Number.isFinite(J)&&J>=0&&(N=(((V=q.toString().split(".")[1])==null?void 0:V.length)||0)>J)}return N}),g=z(()=>{var $;return!!(($=d.value)!=null&&$.morpheme_value)||c.value.isEmpty||h.value}),v=z(()=>{var $,V,N;if(c.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(c.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(c.value.isEmpty)return;const q=D.value,J=($=d.value)==null?void 0:$.morpheme_type;return J==="prefix"?`${((V=d.value)==null?void 0:V.morpheme_value)||""} ${q}`.trim():J==="suffix"?`${q} ${((N=d.value)==null?void 0:N.morpheme_value)||""}`.trim():q}),b=z(()=>{const{format_type:$,format_value:V}=d.value;if($==="dropdown"&&typeof V=="string"&&V.startsWith("["))try{return JSON.parse(V)}catch{return[]}return[]}),_=z(()=>({disabled:a.disabled,error:c.value.isError,inputRef:o,wrapperRef:s,clickable:!I.value,readOnly:a.readOnly||I.value,isEmpty:c.value.isEmpty})),{argsMain:C,isHover:S}=Wse(_),y=($,V,N="en-US")=>new Intl.NumberFormat(N,{minimumFractionDigits:V,maximumFractionDigits:V}).format($),T=z(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const $=a.value,{format_type:V,format_value:N,mapping:q}=d.value;if(q&&typeof q=="object"&&!Array.isArray(q)){const J=q[`!${$}`];if(J)return J}if(V==="dropdown"){const J=b.value.find(ie=>String(ie.name)===String($));if(J)return J.name}if(typeof $=="string"){const J=Number($);return Number.isNaN(J)?$:$.replace(/[.-]/g,"").length>16?k($,N):k(J,N)}return typeof $=="number"?k($,N):String($)}),k=($,V)=>{const N=Number.parseInt(String(V)||"2",10),q=Number.isFinite(N)&&N>=0?N:2;try{if(typeof $=="string"){const J=$.split("."),ie=J[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),de=J[1]?J[1].substring(0,q).padEnd(q,"0"):"0".repeat(q);return q>0?`${ie}.${de}`:ie}return y($,q)}catch(J){return console.error("Error formatting metric value:",J,{num:$,decimals:q}),String($)}},E=($,V)=>{const N=Number.parseInt(String(V)||"2",10),q=Number.isFinite(N)&&N>=0?N:2;try{if(typeof $=="string"){const J=$.split("."),ie=J[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),de=J[1]?J[1].length:0,ee=Math.max(q,de),j=J[1]?J[1].padEnd(ee,"0"):"0".repeat(ee);return ee>0?`${ie}.${j}`:ie}return new Intl.NumberFormat("en-US",{minimumFractionDigits:q,maximumFractionDigits:20}).format($)}catch(J){return console.error("Error formatting exact metric value:",J,{num:$,decimals:q}),String($)}},I=z(()=>{var $;return(($=d.value)==null?void 0:$.metric_type.code)==="formula"}),D=z(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const $=a.value,{format_type:V,format_value:N,mapping:q}=d.value;if(q&&typeof q=="object"&&!Array.isArray(q)){const J=q[`!${$}`];if(J)return J}if(V==="dropdown"){const J=b.value.find(ie=>String(ie.name)===String($));if(J)return J.name}if(typeof $=="string"){const J=Number($);return Number.isNaN(J)?$:$.replace(/[.-]/g,"").length>16?E($,N):E(J,N)}return typeof $=="number"?E($,N):String($)}),{tooltip:A}=UOa(""),R=async $=>{$.stopPropagation(),$.preventDefault(),$.stopImmediatePropagation();try{await navigator.clipboard.writeText(D.value),A.value="Copied",setTimeout(()=>{A.value="Copy"},3e3)}catch(V){console.error("Failed to copy text:",V),A.value="Copy failed",setTimeout(()=>{A.value="Copy"},3e3)}};lt(()=>a.value,($,V)=>{const N=Number($);Number.isFinite(N)&&N!==p.value?p.value=N:$==null&&p.value!==0&&(p.value=0)},{immediate:!0,deep:!0});const B=()=>{i.value=!0},P=()=>{i.value=!1};return($,V)=>ft((L(),qe(Gse,Zt(F(C),{onMouseenter:B,style:{"--icon-size":"24px"},onMouseleave:P,ref_key:"wrapperRef",ref:s,actived:F(l),bordered:!0}),{suffix:Re(()=>[a.disabled?Ve("",!0):(L(),re("div",{key:0,class:ke([$.$style.suffix,"wrapper-suffix"])},[i.value&&!F(c).isEmpty&&!F(c).isError?ft((L(),qe(ym,{key:0,variant:["icon","secondary"],size:24,onClick:Ot(R,["prevent","stop"])},{default:Re(()=>[De(Dp,{src:"Copy",source:"remote",size:12})]),_:1})),[[F(r),{content:F(A),hideOnClick:!1,contentClass:"extra-padding"}]]):Ve("",!0)],2))]),default:Re(()=>[be("div",{class:ke($.$style["metric-wrapper"]),"aria-label":F(d).format_value||void 0},[be("div",{class:ke([$.$style["metric-content"],a.disabled?$.$style.disabled:""])},[!F(c).isError&&F(c).isEmpty?(L(),re($t,{key:0},[F(c).pendingCalculation?ft((L(),re("span",{key:0,class:ke($.$style["metric-empty"])},[...V[0]||(V[0]=[Dt(" - ",-1)])],2)),[[F(r),"Can’t calculate yet. Complete required fields."]]):F(c).isEmpty?(L(),re("span",{key:1,class:ke($.$style["metric-empty"])}," - ",2)):Ve("",!0)],64)):Ve("",!0),F(c).isError?ft((L(),re("div",{key:1,class:ke($.$style["metric-error"])},[...V[1]||(V[1]=[Dt(" Error ",-1)])],2)),[[F(r),"Something went wrong. Review formula, inputs and retry."]]):Ve("",!0),!F(c).isEmpty&&!F(c).isError?ft((L(),re("span",{key:2,class:ke([$.$style["metric-value"],F(S)?$.$style.hovered:"",{[$.$style.disabled]:a.disabled}])},[Dt(vt(T.value),1)],2)),[[F(r),{content:v.value,bypassOverflowCheck:g.value}]]):Ve("",!0)],2)],10,wPa)]),_:1},16,["actived"])),[[F(n),{isLoading:F(c).isLoading}]])}}),CPa="_disabled_lu0ag_15",SPa="_hovered_lu0ag_19",kPa={"metric-wrapper":"_metric-wrapper_lu0ag_1","metric-content":"_metric-content_lu0ag_5",disabled:CPa,"metric-value":"_metric-value_lu0ag_19",hovered:SPa,"metric-error":"_metric-error_lu0ag_23","with-morpheme":"_with-morpheme_lu0ag_38","with-formula-icon":"_with-formula-icon_lu0ag_41","metric-value--number":"_metric-value--number_lu0ag_47","metric-value--currency":"_metric-value--currency_lu0ag_47","metric-value--percentage":"_metric-value--percentage_lu0ag_47","metric-morpheme":"_metric-morpheme_lu0ag_51","metric-empty":"_metric-empty_lu0ag_64","metric-icon":"_metric-icon_lu0ag_71"},EPa={$style:kPa},E3t=Tp(_Pa,[["__cssModules",EPa]]);class xPa extends Error{}class vA extends xPa{constructor(){super("Zone is an abstract class")}}class x3t{get type(){throw new vA}get name(){throw new vA}get ianaName(){return this.name}get isUniversal(){throw new vA}offsetName(t,n){throw new vA}formatOffset(t,n){throw new vA}offset(t){throw new vA}equals(t){throw new vA}get isValid(){throw new vA}}const h$e=new Map;function TPa(e){let t=h$e.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),h$e.set(e,t)),t}const DPa={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function APa(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,a,i,o,s,l,u,c]=r;return[o,a,i,s,l,u,c]}function OPa(e,t){const n=e.formatToParts(t),r=[];for(let a=0;a<n.length;a++){const{type:i,value:o}=n[a],s=DPa[i];i==="era"?r[s]=o:lle(s)||(r[s]=parseInt(o,10))}return r}const p$e=new Map;class sle extends x3t{static create(t){let n=p$e.get(t);return n===void 0&&p$e.set(t,n=new sle(t)),n}static resetCache(){p$e.clear(),h$e.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=sle.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return $Pa(t,n,r,this.name)}formatOffset(t,n){return cle(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=TPa(this.name);let[a,i,o,s,l,u,c]=r.formatToParts?OPa(r,n):APa(r,n);s==="BC"&&(a=-Math.abs(a)+1);const d=RPa({year:a,month:i,day:o,hour:l===24?0:l,minute:u,second:c,millisecond:0});let p=+n;const h=p%1e3;return p-=h>=0?h:1e3+h,(d-p)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let m$e=null;class vV extends x3t{static get utcInstance(){return m$e===null&&(m$e=new vV(0)),m$e}static instance(t){return t===0?vV.utcInstance:new vV(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new vV(D3t(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${cle(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${cle(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return cle(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function lle(e){return typeof e>"u"}function ule(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function T3t(e){if(!(lle(e)||e===null||e===""))return parseInt(e,10)}function IPa(e){if(!(lle(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function RPa(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function $Pa(e,t,n,r=null){const a=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(i.timeZone=r);const o={timeZoneName:t,...i},s=new Intl.DateTimeFormat(n,o).formatToParts(a).find(l=>l.type.toLowerCase()==="timezonename");return s?s.value:null}function D3t(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,a=n<0||Object.is(n,-0)?-r:r;return n*60+a}function cle(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),a=e>=0?"+":"-";switch(t){case"short":return`${a}${ule(n,2)}:${ule(r,2)}`;case"narrow":return`${a}${n}${r>0?`:${r}`:""}`;case"techie":return`${a}${ule(n,2)}${ule(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const A3t=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function yV(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function bV(...e){return t=>e.reduce(([n,r,a],i)=>{const[o,s,l]=i(t,a);return[{...n,...o},s||r,l]},[{},null,1]).slice(0,2)}function O3t(...e){return(t,n)=>{const r={};let a;for(a=0;a<e.length;a++)r[e[a]]=T3t(t[n+a]);return[r,null,n+a]}}const I3t=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,PPa=`(?:${I3t.source}?(?:\\[(${A3t.source})\\])?)?`,R3t=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,$3t=RegExp(`${R3t.source}${PPa}`),g$e=RegExp(`(?:[Tt]${$3t.source})?`),MPa=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,NPa=/(\d{4})-?W(\d\d)(?:-?(\d))?/,LPa=/(\d{4})-?(\d{3})/,FPa=O3t("weekYear","weekNumber","weekDay"),BPa=O3t("year","ordinal"),VPa=/(\d{4})-(\d\d)-(\d\d)/,P3t=RegExp(`${R3t.source} ?(?:${I3t.source}|(${A3t.source}))?`),UPa=RegExp(`(?: ${P3t.source})?`);function wV(e,t,n){const r=e[t];return lle(r)?n:T3t(r)}function HPa(e,t){return[{year:wV(e,t),month:wV(e,t+1,1),day:wV(e,t+2,1)},null,t+3]}function _V(e,t){return[{hours:wV(e,t,0),minutes:wV(e,t+1,0),seconds:wV(e,t+2,0),milliseconds:IPa(e[t+3])},null,t+4]}function pG(e,t){const n=!e[t]&&!e[t+1],r=D3t(e[t+1],e[t+2]),a=n?null:vV.instance(r);return[{},a,t+3]}function mG(e,t){const n=e[t]?sle.create(e[t]):null;return[{},n,t+1]}yV(MPa,g$e),yV(NPa,g$e),yV(LPa,g$e),yV($3t),bV(HPa,_V,pG,mG),bV(FPa,_V,pG,mG),bV(BPa,_V,pG,mG),bV(_V,pG,mG),bV(_V),yV(VPa,UPa),yV(P3t),bV(_V,pG,mG);var Hf=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Hf||{});Hf.review,Hf.review_take,Hf.review_scene,Hf.review_rendition,Hf.review_frame,Hf.review_rendition_comment,Hf.review_comment,Hf.scene_hub,Hf.hub_rendition,Hf.hub_comment,Hf.people_insight,Hf.people_detail,Hf.project,Hf.woohoo,Hf.update,Hf.core,Hf.project_focusMode,new Date().getUTCFullYear()-12,new Date().getUTCFullYear()+12;const jPa=ct({name:"EmptyData",__name:"EmptyData",props:{isSearching:{type:Boolean},isFiltering:{type:Boolean}},setup(e){const t=e,n={noData:"No data available.",noSearchResults:"No results. Try another search.",noFilterResults:"No results. Try another filter.",emptySearchFilter:"No results. Try another search or filter."};z(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate");const r=z(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),a=W(!1);return nn(()=>{a.value=!0}),(i,o)=>(L(),re("div",{class:ke(i.$style["no-data-item-table"])},[be("div",{class:ke(i.$style.visual)},[a.value?(L(),qe(JOa,{key:0,source:"remote",src:"NoDataGeneral",ratio:"4/3",maxWidth:500,maxHeight:350})):Ve("",!0)],2),be("div",{class:ke(i.$style.description)},vt(r.value),3)],2))}}),zPa="_visual_oh0wi_12",WPa="_description_oh0wi_19",GPa={"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:zPa,description:WPa},qPa={$style:GPa},KPa=Tp(jPa,[["__cssModules",qPa]]),YPa={ROW_HEIGHT:38},JPa=e=>{var t,n,r;if(e){if(Number((t=e.metric_type)==null?void 0:t.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number((n=e.metric_type)==null?void 0:n.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number((r=e.metric_type)==null?void 0:r.id)==3)return}},v$e=e=>{if(e)return JPa(e)};class ZPa{constructor(){Ud(this,"eGui"),Ud(this,"params")}init(t){this.params=t}getGui(){var t,n,r,a,i;const o=document.createElement("div");return(t=this.params)!=null&&t.height&&o.style.setProperty("--height",(n=this.params)==null?void 0:n.height),(r=this.params)!=null&&r.width?o.style.setProperty("--width",(a=this.params)==null?void 0:a.width):(i=this.params)!=null&&i.fullwidth?o.style.setProperty("--width","100%"):o.style.setProperty("--width",`${Math.floor(Math.random()*50)+50}%`),o.className="ag-cell-skeleton",o.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation()}),this.eGui=o,o}refresh(t){return!1}getValue(){var t;return(t=this.params)==null?void 0:t.value}isPopup(t){return!1}getPopupPosition(){}destroy(){}}const XPa=ct({__name:"Vue3Wrapper",props:{component:{},params:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},tooltip:{},isNoData:{type:Boolean,default:!1},workspaceId:{},entityId:{},axiosService:{},isSearching:{type:Boolean,default:!1},isFiltering:{type:Boolean,default:!1},sortType:{default:"default"},maxRating:{default:5},config:{}},setup(e,{expose:t}){const n=e,r=W(null),a=z(()=>{var s;return((s=n.component)==null?void 0:s.name)||"UnknownComponent"}),i=z(()=>{var s;return((s=n.component)==null?void 0:s.default)||n.component}),o=z(()=>({params:n.params,disabled:n.disabled,readOnly:n.readOnly,value:n.value,maxRating:n.maxRating,data:n.data,id:n.id,workspaceId:n.workspaceId,entityId:n.entityId,axiosService:n.axiosService,tooltip:n.tooltip,isSearching:n.isSearching,isFiltering:n.isFiltering,isNoData:n.isNoData,config:n.config}));return t({focus:()=>{var s;return(s=r.value)!=null&&s.focus?r.value.focus():console.warn(`Component ${a.value} does not have a focus method.`),!0},blur:()=>{var s,l;return(l=(s=r.value)==null?void 0:s.blur)==null||l.call(s),!0},trigger:(s,l)=>{var u;return(u=r.value)==null||u.$emit(s,l),!0}}),(s,l)=>(L(),qe(sc(i.value),Zt(o.value,{ref_key:"componentRef",ref:r}),null,16))}}),QPa="_skeleton_7xde7_1",eMa="_shimmer_7xde7_16",tMa={skeleton:QPa,shimmer:eMa,"skeleton-loading":"_skeleton-loading_7xde7_1"},nMa={$style:tMa},rMa=Tp(XPa,[["__cssModules",nMa]]);function aMa(e){return"stopEditing"in e}const iMa=8,oMa=e=>{if(!e)return;const t=e.__vueParentComponent,n=t==null?void 0:t.exposed;n&&typeof n.triggerFocus=="function"?n.triggerFocus():e.focus()};function M3t(e){return class{constructor(){Ud(this,"container"),Ud(this,"vNode",null),Ud(this,"componentInstance",null),Ud(this,"componsenExposed",null),Ud(this,"params"),Ud(this,"isEditor",!1),Ud(this,"_destroyed",!1)}init(t){var n,r,a,i;if(!t){console.error("[Vue3CellWrapper] Missing params");return}const o=performance.now();this.params=t,this.isEditor=aMa(t),this.container=document.createElement("div"),this.container.classList.add("ag-vue3-cell-wrapper"),this.container.style.width="100%",this.container.style.height="100%";const s=t.context.apiClass,l=t,u={component:e,params:Object.freeze(t),disabled:!1,readOnly:l.readOnly??!1,value:t.value,maxRating:l.maxRating??void 0,data:t.data,id:(n=t==null?void 0:t.data)==null?void 0:n.id,workspaceId:t.context.workspaceId,entityId:t.context.entityId,axiosService:s,tooltip:l.tooltip??void 0,isSearching:l.isSearching??!1,isFiltering:l.isFiltering??!1,isNoData:l.isNoData??!1,config:l.config,sceneId:(l==null?void 0:l.sceneId)||void 0};this.vNode=De(rMa,u),dx(this.vNode,this.container);const c=performance.now()-o;c>iMa&&console.warn(`[Vue3CellWrapper] Slow render (${c.toFixed(1)}ms) for "${(r=t.colDef)==null?void 0:r.field}"`),this.componentInstance=(a=this.vNode.component)==null?void 0:a.proxy,this.componsenExposed=(i=this.vNode.component)==null?void 0:i.exposed}getGui(){return this.container}refresh(t){return!1}focusUi(){var t;(t=this.componsenExposed)!=null&&t.focus?this.componsenExposed.focus():oMa(this.container)}getValue(){var t,n,r;return this.params._editorValue!==void 0?this.params._editorValue:this.componentInstance?((r=(n=this.componentInstance).getValue)==null?void 0:r.call(n))??this.componentInstance.value:(console.warn("[Vue3CellWrapper] getValue() called but component instance not available"),(t=this.params)==null?void 0:t.value)}isPopup(t){var n,r,a,i,o;const s=(a=(r=(n=this.params)==null?void 0:n.colDef)==null?void 0:r.field)==null?void 0:a.includes("metric"),l=((i=this.params)==null?void 0:i.context)&&v$e(this.params.context);return s||l==="number"||l==="rating"||!this.isEditor?!1:(o=this.componentInstance)!=null&&o.isPopup?this.componentInstance.isPopup():!0}getPopupPosition(){var t,n,r;return this.isEditor?(t=this.componentInstance)!=null&&t.getPopupPosition?this.componentInstance.getPopupPosition():((r=(n=this.params)==null?void 0:n.colDef)==null?void 0:r.cellEditorPopupPosition)??"under":void 0}afterGuiAttached(){!this.isEditor||this.componentInstance}destroy(){if(!this._destroyed&&(this._destroyed=!0,!!this.container))try{const t=this.componentInstance;if(t){try{typeof t.$destroy=="function"&&t.$destroy()}catch(n){console.warn("[Vue3CellWrapper] Error during $destroy:",n)}try{typeof t.destroy=="function"&&t.destroy()}catch(n){console.warn("[Vue3CellWrapper] Error during destroy():",n)}}(typeof queueMicrotask=="function"?queueMicrotask:n=>Promise.resolve().then(n))(()=>{try{dx(null,this.container)}catch(n){console.warn("[Vue3CellWrapper] Error during unmount:",n)}finally{this.container.textContent=""}})}catch(t){console.error("[Vue3CellWrapper] Error during cleanup:",t)}finally{this.vNode=null,this.componentInstance=null}}}}function sMa(e){return M3t(e)}function lMa(e){return M3t(e)}let N3t=!1;N3t||(zca.registerModules([Xka,tNt]),N3t=!0);class uMa{constructor(t,n){Ud(this,"gridApi",null),Ud(this,"container"),Ud(this,"config"),Ud(this,"eventListeners",new Map),this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:r,onRowSelected:a,...i}=this.config,o={...i,onGridReady:s=>{this.gridApi=s.api,t&&t(s)},onCellClicked:s=>{n&&n(s)},onCellFocused:s=>{r&&r(s)},onRowSelected:s=>{a&&a(s)}};return this.gridApi=wwa(this.container,o),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const r={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(r),n==="bottom"){const a=this.gridApi.getDisplayedRowCount();a>0&&this.gridApi.ensureIndexVisible(a-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const r={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(r),n==="bottom"){const a=this.gridApi.getDisplayedRowCount();a>0&&this.gridApi.ensureIndexVisible(a-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(r=>{var a;(a=this.gridApi)==null||a.removeEventListener(n,r)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const cMa=UPt.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),dMa=ct({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected","on-scroll"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=W(null);y2a(i,()=>{var v;const b=(v=o.value)==null?void 0:v.getApi();b==null||b.clearFocusedCell()});const o=W(null),s=z(()=>({width:"100%",height:r.height||"500px"})),l=z(()=>({...r,theme:cMa}));function u(){var v;if(!i.value){console.warn("Grid container element not found");return}const b={...l.value,height:r.height};o.value=new uMa(i.value,b),o.value.init(),(v=o.value.getApi())==null||v.addEventListener("bodyScroll",()=>{a("on-scroll",new Event("scroll"))}),c()}function c(){var v;const b=((v=o.value)==null?void 0:v.getApi())??null;a("onGridReady",b)}function d(v){var b,_;if(!v)return;(b=o.value)==null||b.updateColumnDefs(v);const C=v.map(S=>S.field&&S.width&&!S.hide?{colId:S.field,width:S.width,flex:null}:null).filter(S=>S!==null);(_=o.value)==null||_.setColumnWidth(C)}function p(){var v;(v=o.value)==null||v.destroy(),o.value=null}function h(){var v;return((v=o.value)==null?void 0:v.getApi())||void 0}function g(){return o.value||null}return lt(()=>r.columnDefs,(v,b)=>{const _=v==null?void 0:v.filter(S=>!S.hide).map(S=>S.field).join(","),C=b==null?void 0:b.filter(S=>!S.hide).map(S=>S.field).join(",");_!==C&&d(v)},{deep:!0}),$r(()=>{p()}),t({gridApi:h,gridManager:g,syncColumnDefs:d}),nn(()=>{u()}),$r(()=>{p()}),(v,b)=>(L(),re("div",{ref_key:"gridContainerRef",ref:i,style:Yt(s.value),class:ke(["ag-theme-quartz",["ag-table-container",r.isSorting?"is-sorting":""]])},null,6))}}),gG=lMa;function L3t(e){return{sceneId:z(()=>{var t;const n=(t=e.params)==null?void 0:t.context;return(n==null?void 0:n.sceneId)||""}),updateCellData:t=>{var n,r,a,i,o;const s=((n=e.params)==null?void 0:n.node.id)||"",l=(a=(r=e.params)==null?void 0:r.api)==null?void 0:a.getRowNode(s);l&&l.setDataValue("metric_value",t),(o=(i=e.params)==null?void 0:i.api)==null||o.refreshCells({rowNodes:l?[l]:[],columns:["metric_value"],force:!0})}}}const fMa={class:"metric-editor-wrapper",ref:"metricEditorWrapperRef"},hMa=ct({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},setup(e){const t=e,n=W(t.value),r=W(!0),a=W(""),i=()=>{var b,_,C;const S=(b=l.value)==null?void 0:b.restricted_type.trim(),y=((C=(_=l.value)==null?void 0:_.restricted_value)==null?void 0:C.split(",").map(Number))||[],[T,k]=y,E={range:`Enter a value between ${T} and ${k}`,not:`These values are not allowed: ${y.join(", ")}`,exact:"Value is not allowed"}[S];return r.value?"":E},o=b=>{if(l.value){if(b===null||b===""){r.value=!0;return}if(s.value!=="number"){r.value=!0;return}r.value=URe(l.value,Number(b)),a.value=i()}},s=z(()=>BOa(l.value)),l=z(()=>{var b;return((b=t.params)==null?void 0:b.data.metric_config)||null}),{apiServices:u}=cRe(!0,t),{sceneId:c,updateCellData:d}=L3t(t),p=W(!1),h=()=>{var b;(b=t.params)==null||b.api.stopEditing()},g=()=>{h()},v=async b=>{var _,C,S;if(h(),p.value=!0,n.value=b||null,b===t.value){p.value=!1;return}const y={itemIds:[c.value],metricId:((_=l.value)==null?void 0:_.id)||"",workspaceId:String(t.workspaceId)};b==null?y.clear=1:y.value=b;const T=b||null,k=t.value;d(T);try{const E=await((C=u.value)==null?void 0:C.bulkUpdateMetric(y));(E==null?void 0:E.message)=="Done"?(d(T),n.value=T):(d(k),console.error("Failed to update metric value:",E),n.value=k)}catch(E){d(k),n.value=k,console.error("Error during bulk metric update:",E)}finally{p.value=!1,(S=t.params)==null||S.api.stopEditing()}};return(b,_)=>(L(),re("div",fMa,[s.value=="dropdown"&&l.value?(L(),qe(F(DIa),{key:0,config:l.value,modelValue:n.value,"onUpdate:modelValue":_[0]||(_[0]=C=>n.value=C),onChange:v,onHandleCancel:g},null,8,["config","modelValue"])):s.value=="number"&&l.value?(L(),qe(F(IIa),{key:1,showInlineError:!1,autoEmit:!0,config:l.value,modelValue:n.value,"onUpdate:modelValue":_[1]||(_[1]=C=>n.value=C),style:{width:"100%"},onHandleChange:v,onCancel:g,onOnValidation:o},null,8,["config","modelValue"])):Ve("",!0)],512))}}),pMa=Tp(hMa,[["__scopeId","data-v-c1be75e1"]]),mMa={key:0,style:{color:"#6b6b6b"}},gMa=ct({__name:"MetricCellRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=qC,n=e,r=z(()=>{var o,s;return(s=(o=n.params)==null?void 0:o.value)==null?void 0:s.morpheme}),a=z(()=>{var o,s;return(s=(o=n.params)==null?void 0:o.value)==null?void 0:s.name}),i=z(()=>{var o;const s=(o=n.params)==null?void 0:o.value;return(s==null?void 0:s.is_primary)==1?"primary":(s==null?void 0:s.is_point_metric)==1?"secondary":""});return(o,s)=>(L(),re("div",{class:ke(o.$style["metric-content"])},[ft((L(),re("span",null,[Dt(vt(a.value),1)])),[[F(t),{content:a.value}]]),r.value?(L(),re("small",mMa," ("+vt(r.value)+") ",1)):Ve("",!0),i.value==="primary"?ft((L(),re("div",{key:1,class:ke(o.$style["icon-metric"])},[De(F(Dp),{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[F(t),"Woohoo metric"]]):Ve("",!0),i.value==="secondary"?ft((L(),re("div",{key:2,class:ke(o.$style["icon-metric"])},[De(F(Dp),{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[F(t),"Point Metric"]]):Ve("",!0)],2))}}),vMa={"icon-metric":"_icon-metric_wflah_1","metric-content":"_metric-content_wflah_10"},yMa={$style:vMa},bMa=Tp(gMa,[["__cssModules",yMa]]),wMa=ct({__name:"MetricRating",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},setup(e,{expose:t}){const n=RIe,r=e,{isEditing:a}=gBt(r),{apiServices:i}=cRe(!0,r),o=z(()=>{var k,E;return{value:s.value,metricConfig:((E=(k=r.params)==null?void 0:k.colDef)==null?void 0:E.context)||r.config,error:r.error,hovered:!1,readOnly:r.disabled,disabled:r.readOnly,apiServices:i.value}}),s=W(Number(r.value)),l=W(!1),{componentState:u,metricConfig:c,ICON_SIZE:d,ratingParams:p,standardNameforIcon:h}=k3t(o,l),{sceneId:g,updateCellData:v}=L3t(r),b=W(s.value),_=async k=>{var E,I;s.value=k,b.value,v(void 0),s.value=NaN;const D={itemIds:[g.value],metricId:((E=c.value)==null?void 0:E.id)||"",workspaceId:String(r.workspaceId)};k==null?D.clear=1:D.value=k;try{const A=await((I=i.value)==null?void 0:I.bulkUpdateMetric(D));(A==null?void 0:A.message)=="Done"?(v(k),s.value=Number(k),b.value=k):(v(b.value),s.value=Number(b.value),console.error("Failed to update metric value:",A))}catch(A){v(b.value),s.value=Number(b.value),console.error("Error during bulk metric update:",A)}},C=uRe(async k=>{Ct(()=>{setTimeout(()=>{_(s.value)},100)})},300),S=z(()=>({disabled:r.disabled,error:u.value.isError,clickable:!0,readOnly:r.readOnly,isEmpty:u.value.isEmpty})),y=W(null),{argsMain:T}=Wse(S);return t({focus:()=>{var k,E;(E=(k=y.value)==null?void 0:k.focus)==null||E.call(k)}}),(k,E)=>(L(),qe(F(Gse),Zt({style:{"--icon-size":"24px","--box-padding":"0 0 0 0"}},F(T),{ref:"wrapperRef",actived:F(a),size:32,tabindex:"0",bordered:!0}),{default:Re(()=>[F(u).isRating&&F(p).maxRating?ft((L(),qe(F(EIa),{key:0,modelValue:s.value,"onUpdate:modelValue":E[0]||(E[0]=I=>s.value=I),ref_key:"ratingComponentRef",ref:y,params:F(p),readOnly:r.readOnly,disabled:r.disabled,onHandleEnter:_},{icon:Re(({value:I})=>[De(F(Dp),{onClick:D=>F(C)(I),source:"rating",src:F(h)()||"Star",size:F(d)},null,8,["onClick","src","size"])]),_:1},8,["modelValue","params","readOnly","disabled"])),[[F(n),{isLoading:F(u).isLoading,fullwidth:!0}]]):Ve("",!0)]),_:1},16,["actived"]))}}),_Ma={id:"metric-table",ref:"tableWrapperRef"},CMa="API_BASE_URL",SMa="formula",dle=10,kMa=!1,EMa=ct({__name:"App",props:{sceneId:{},workspaceId:{},availableHeight:{},onMessage:{}},emits:["update-success","update-error"],setup(e,{expose:t,emit:n}){const r=e,a=z(()=>r.availableHeight??window.innerHeight-200),i=A=>oRe.getInstance().getItem(A)||"",o=()=>{const A=i(CMa);return A.includes("/v1")?A.slice(0,A.lastIndexOf("/v1")):A},s=A=>{var R;return((R=A==null?void 0:A.metric_type)==null?void 0:R.code)===SMa},l=A=>{var R;return((R=A==null?void 0:A.metric_type)==null?void 0:R.code)==="rating"&&(A==null?void 0:A.format_type)=="icon"},u=A=>(s(A)||l(A),A.input_value??null),c=A=>A.map((R,B)=>({id:String(R.id??B),name:{name:String(R.name??"Untitled metric"),is_primary:R.is_primary,is_point_metric:R.is_point_metric,morpheme:R.morpheme_value},metric_config:R,metric_value:u(R),metric_permission:R.auth_permission})),d=A=>{var R,B;const P=A.data,$=(R=A.node.data)==null?void 0:R.metric_value,V=(B=A.node.data)==null?void 0:B.metric_config,N=v$e(V);return P===void 0?{component:ZPa,params:{}}:N==="rating"?{component:gG(wMa),params:{config:V,value:$,maxRating:V==null?void 0:V.range,sceneId:r.sceneId}}:N==="dropdown"?{component:gG(E3t),params:{config:V,value:$}}:{component:gG(E3t),params:{config:V,value:$}}},p=A=>{var R,B,P,$,V;const N=v$e((R=A.node.data)==null?void 0:R.metric_config);return{component:gG(pMa),params:{config:(B=A.node.data)==null?void 0:B.metric_config,value:(P=A.node.data)==null?void 0:P.metric_value,maxRating:(V=($=A.node.data)==null?void 0:$.metric_config)==null?void 0:V.range},popup:!(N=="number"||N=="rating")}};function h(A){var R;return!A||s(A)||l(A)?!1:((R=A.auth_permission)==null?void 0:R.permission)==2}const g=A=>!!(A.data&&A.node.data&&h(A.data.metric_config)),v=A=>({component:gG(bMa),params:{value:A.value}}),{apiServices:b}=cRe(!1,r),_=z(()=>[{field:"name",headerName:"Metric",minWidth:220,flex:2,cellRendererSelector:v,editable:!1,cellEditorSelector:void 0},{field:"metric_value",headerName:"Value",minWidth:140,flex:1,cellRendererSelector:d,cellEditorSelector:p,editable:g,cellEditorPopupPosition:"under",cellEditorPopup:!0}]),C=n,S=z(()=>({isSearching:!1,isFiltering:!1})),y=z(()=>({headerHeight:32,blockLoadDebounceMillis:300,columnDefs:_.value,rowModelType:"infinite",cacheBlockSize:dle,infiniteInitialRowCount:dle,pagination:!1,rowHeight:YPa.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,suppressScrollOnNewData:!0,rowBuffer:dle,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,stopEditingWhenCellsLoseFocus:!1,noRowsOverlayComponent:sMa(KPa),noRowsOverlayComponentParams:()=>S.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:A=>A.data.id,getRowClass:A=>A.data?["row-highlight"]:["row-empty"],suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:r.workspaceId,sorting:!1,apiServices:b.value,sceneId:r.sceneId},suppressHeaderFocus:!0,navigateToNextCell:()=>null,onCellKeyDown:A=>{var R,B,P;if(((R=A==null?void 0:A.event)==null?void 0:R.key)==="Enter"){const{api:$,node:V,column:N}=A,q=$.getCellRendererInstances({rowNodes:[V],columns:[N]});if(q.length>0){const J=q[0];J&&typeof((B=J.componsenExposed)==null?void 0:B.focus)=="function"&&((P=J.componsenExposed)==null||P.focus())}}},isRowSelectable:A=>!A.group,suppressKeyboardEvent:A=>{var R;if((R=A.data)!=null&&R.isDeleted)return!0;const B=A.event.key,P=A.editing;return P&&B==="Tab"?!0:P&&B==="Enter"?!1:B==="Enter"?(A.event.preventDefault(),A.event.stopPropagation(),!0):B==="ArrowUp"||B==="ArrowDown"||B==="ArrowLeft"||B==="ArrowRight"||B==="Tab"||B==="Enter"},tabToNextCell:A=>{let R=A.nextCellPosition;if(R&&R.column.getColId()==="ag-Grid-SelectionColumn"){const B=A.api.getAllDisplayedColumns(),P=B.indexOf(R.column),$=A.backwards?-1:1,V=B[P+$];if(V)return{rowIndex:R.rowIndex,column:V,rowPinned:R.rowPinned}}return R||!1}})),T=async A=>{var R,B;try{const P=await((R=b.value)==null?void 0:R.getMetrics(r.sceneId,A.page,A.pageSize)),$=Array.isArray(P==null?void 0:P.data)?P.data:[],V=Number(((B=P==null?void 0:P.meta)==null?void 0:B.total)??$.length??0);return{rows:c($),total:V}}catch(P){return console.error("Failed to fetch metrics",P),{rows:[],total:0}}},k=W(-1);function E(A,R){return{async getRows(B){try{const P=Math.floor(B.startRow/R)+1,{rows:$,total:V}=await A({page:P,pageSize:R,sort_by:B.sortModel});k.value=V,B.successCallback($,k.value)}catch(P){console.error("Datasource fetch error",P),B.failCallback()}}}}const I=W(null),D=A=>{var R;return A?(I.value=A,(R=A.setGridOption)==null||R.call(A,"datasource",E(T,dle)),A):null};return ko(()=>{try{const A=_a();if(!A)throw new Error("Current instance is null");const R={domainApi:o(),wsCode:r.workspaceId,sceneId:r.sceneId};if(!R.sceneId||!R.wsCode||!R.domainApi)throw new Error("API configuration is incomplete");const B=new bPa({},{domainApi:R.domainApi,wsCode:R.wsCode,sceneId:R.sceneId},r.onMessage);B.on("call-api",P=>{P.success?C("update-success",P):(console.error("API call failed:",P),C("update-error",P))}),A.appContext.config.globalProperties.apiServices=B}catch(A){console.error("Error getting current instance:",A)}}),t({refreshGrid:()=>{const A=I.value||null;A&&A.refreshInfiniteCache()}}),(A,R)=>(L(),re("div",_Ma,[De(F(dMa),Zt({id:"item_table_main",ref:"agGrid"},y.value,{height:a.value+"px",isSorting:kMa,onOnGridReady:D}),null,16,["height"])],512))}}),xMa=e=>JSON.parse(e).map((t,n)=>({id:String(n),text:t.name})),TMa=()=>{const e=W(),t=W(!1),n=Cl(),r=Di(),a=C=>{r.showMessage(C,"error")},{updateMetric:i}=n,o=async C=>{t.value=!0;const S=await i(C);return setTimeout(()=>{t.value=!1},50),S},s=jh(async(C,S,y,T)=>{const k=I=>{T(y,!1),a(I)},E={...S,metric_value:C};try{const I=await o(E);I!=null&&I.success&&T(C,!0)}catch(I){Qn(I,"updateMetricValue"),k("Update failed.")}},300),l=({params:C,idMetricPayload:S})=>{var I;const y=xMa(C.data.formatValue).map(D=>({value:D.id,label:D.text||""})),T=((I=y.find(D=>D.label==C.data.inputValue))==null?void 0:I.value)??"",k=C.data.auth_permission.permission!==2,E={options:y,scrollerClass:".ag-body-viewport",placeholder:"",morpheme:C.data.morpheme||void 0,limitDecimal:Number(C.data.format_value),value:T,disabled:k,mappingValue:C.data.mapping,"onUpdate:modelValue":D=>{var R;const A=((R=y.find(B=>B.value==D))==null?void 0:R.label)??"";s(A,S,String(T),(B,P)=>{var $;if(P)b(C.data.id,B);else{const V=(($=y.find(N=>N.value==T))==null?void 0:$.label)??"";b(C.data.id,V)}})}};return{childComponent:WQ,childProps:E,isEdit:C.data.isEdit}},u=({params:C,idMetricPayload:S})=>{var D;const y=C.data.restricted_value.split(",").map(A=>({value:A,label:C.data.mapping&&C.data.mapping[`!${A}`]?C.data.mapping[`!${A}`]:A})),T=((D=y.find(A=>A.label==C.data.inputValue))==null?void 0:D.value)??"",k=W(T),E=C.data.auth_permission.permission!==2,I={options:y,scrollerClass:".ag-body-viewport",placeholder:"",disabled:E,morpheme:C.data.morpheme,limitDecimal:Number(C.data.format_value),value:k.value,mappingValue:C.data.mapping,"onUpdate:modelValue":jh(A=>s(A,S,String(T),R=>{var P;const B=((P=y.find($=>$.value==R))==null?void 0:P.label)??"";v(C.data.id,R,B)}),500)};return{childComponent:WQ,childProps:I,isEdit:C.data.isEdit}},c=({params:C,idMetricPayload:S})=>{const y=Number(C.data.inputValue),T=W(y),k=C.data.auth_permission.permission!==2,E={ratingIcon:C.data.format_symbol||"BoltSolid",value:T.value,maxRating:C.data.range,readOnly:k,"onUpdate:modelValue":async I=>s(I,S,Number(T.value),D=>b(C.data.id,D))};return{childComponent:C_e,childProps:E,isEdit:C.data.isEdit}},d=({params:C,idMetricPayload:S})=>{var I;const y=((I=C.data)==null?void 0:I.inputValue)===null?"":String(C.data.inputValue),T=W(y),k=C.data.auth_permission.permission!==2,E={value:T.value,morpheme:C.data.morpheme,disabled:k,limitDecimal:Number(C.data.format_value),inputType:"number",change:D=>{s(D,S,String(T.value),A=>{b(C.data.id,A)})}};return{childComponent:ZQ,childProps:E,isEdit:C.data.isEdit}},p=Gp(),h=C=>{if(!C.data)return;const S={item_ids:[p??""],metric_id:C.data.id},y=C.data.formatType;let T={childComponent:ZQ,childProps:{},isEdit:C.data.isEdit};switch(y){case Vde.dropdown:T=l({params:C,idMetricPayload:S});break;case Vde.rating:T=c({params:C,idMetricPayload:S});break;case Vde.number:C.data.restricted_type==="exact"?(C.data.formatValue=C.data.restricted_value,T=u({params:C,idMetricPayload:S})):C.data.formula?T=g({params:C}):T=d({params:C,idMetricPayload:S});break;default:T=d({params:C,idMetricPayload:S});break}return T},g=({params:C})=>{var y,T,k;const S={formulaValue:((y=C.data)==null?void 0:y.inputValue)||"",morpheme:((T=C.data)==null?void 0:T.morpheme)||"",limitDecimal:Number((k=C.data)==null?void 0:k.format_value),disable:C.data.auth_permission.permission!==2};return{childComponent:zQ,childProps:S,isEdit:C.data.isEdit}},v=(C,S,y)=>{(k=>{e.value.forEachNode(E=>{E.data.id===C&&E.setData({...E.data,value:k||"",inputValue:y})})})(String(S))},b=(C,S)=>{(T=>{e.value.forEachNode(k=>{k.data.id===C&&k.setData({...k.data,inputValue:T})})})(String(S))};return{childComponent:h,updateRows:b,refreshing:t,gridApi:e}},DMa={class:"h-full bg-white metric-log"},AMa={key:0,class:"flex flex-1 p-10 items-center justify-center w-full h-[calc(100%-40px)]"},OMa=Ia(ct({__name:"SceneMetric",emits:["loaded"],setup(e,{emit:t}){const n=Cl(),{sceneId:r,workspaceId:a}=sr(n),{refreshing:i}=TMa(),o=W(!1),s=W(void 0),l=W(null),u=z(()=>o.value&&!i.value),c=lR(),{connectState:d}=sr(c),p=W(!1),h=W(null),g=async()=>{var y;(y=h.value)==null||y.refreshGrid()},v=(y,T="error")=>{Di().showMessage(y,T)},b=y=>{},_=y=>{if(y.apiCode=="offline"){Di().showMessage("You are currently offline. Please check your internet connection.","error");return}else y.res&&y.res.data&&Di().showErrorNetMessage(y.res.data)},C=t,S=()=>{var y;if(l.value){const T=(((y=l.value)==null?void 0:y.offsetHeight)||0)-40;s.value=T}};return nn(()=>{window.addEventListener("resize",S),Ct(()=>{S(),C("loaded")}),C("loaded")}),$r(()=>{window.removeEventListener("resize",S)}),(y,T)=>(L(),qe(kie,{type:"metric","handle-reload":g,class:"scene-metric"},{view:Re(({})=>[be("div",{ref_key:"metricLogRef",ref:l,style:{height:"100%"}},[be("div",null,[De(xae,{title:"Metric","disable-refresh":F(i),onRefresh:g},null,8,["disable-refresh"])]),be("div",DMa,[u.value?(L(),re("div",AMa,[De(Sie,{type:"metric"})])):Ve("",!0),p.value?(L(),qe(dGr,{key:1,class:"loading-indicator"})):Ve("",!0),s.value?(L(),qe(F(EMa),{key:2,sceneId:F(r),workspaceId:F(a),ref_key:"metricTableRef",ref:h,onMessage:v,availableHeight:s.value,onUpdateSuccess:b,onUpdateError:_},null,8,["sceneId","workspaceId","availableHeight"])):Ve("",!0)])],512)]),_:1}))}}),[["__scopeId","data-v-658b2fb2"]]),IMa={class:"rendition-header"},RMa={class:"rendition-main"},$Ma={class:"rendition-list"},PMa={class:"rendition-player"},MMa={class:"rendition-files"},NMa={class:"rendition-description"},LMa=210,a$=300,y$e=100,b$e=255,vG=16,FMa=Ia(ct({__name:"SceneRenditionV2",setup(e){const t=W("layout-vertical"),n=W(),r=Wn({width:0,height:0});return OU(n,()=>{const{width:a,height:i}=n.value.getBoundingClientRect();if(a-a$-vG<i)t.value="layout-vertical",r.width=Math.max(b$e,a-16),r.height=a/(16/9)+32;else{const o=i-16-y$e;o/9*16<=a-a$-vG?(t.value="layout-mixed",r.height=o,r.width=Math.max(b$e,Math.min(o/(9/16),a-a$-vG)-16)):(t.value="layout-horizontal",r.width=Math.max(b$e,a-a$-vG-16),r.height=(a-a$-vG)/(16/9)+32)}}),(a,i)=>(L(),re($t,null,[be("div",{class:"scene-rendition-layout",style:Yt({"--list-width":LMa+"px","--file-width":a$+"px","--description-height":y$e+"px"})},[be("div",IMa,[at(a.$slots,"header",{},void 0,!0)]),be("div",RMa,[be("div",$Ma,[at(a.$slots,"list",{},void 0,!0)]),be("div",{class:ke(["rendition-body",[t.value]]),ref_key:"renditionLayoutBodyRef",ref:n,style:Yt({"--player-width":r.width+"px","--player-height":r.height+"px"})},[be("div",PMa,[at(a.$slots,"player",{height:r.height,width:r.width},void 0,!0)]),be("div",MMa,[at(a.$slots,"files",{width:a$},void 0,!0)]),be("div",NMa,[at(a.$slots,"description",{height:y$e},void 0,!0)])],6)])],4),i[0]||(i[0]=be("div",{class:"scene-rendition-empty"},null,-1))],64))}}),[["__scopeId","data-v-eccc8886"]]),BMa={class:"rendition-wrapper"},VMa=["innerHTML"],UMa=Ia(ct({__name:"RenditionDescription",props:{description:{},updateRenditionDescriptionFnc:{type:Function},height:{}},setup(e){const t=e,n=W(t.description||""),{permission:r}=hm(),a=W(!1),i=u0().getEnvVariable("DELAY_SAVE")||3e3;return lt(()=>t.description,o=>{n.value=o,a.value=!0}),lt(n,jh(async o=>{if(a.value){a.value=!1;return}await t.updateRenditionDescriptionFnc(o)||(a.value=!0,n.value=t.description)},Number(i)),{immediate:!1}),(o,s)=>(L(),re("div",BMa,[F(r).editRendition?(L(),qe(F(fTt),{key:0,modelValue:n.value,"onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l),"max-height":e.height+"px",placeholder:"Enter description"},null,8,["modelValue","max-height"])):(L(),re("div",{key:1,class:"description",innerHTML:n.value||"No description"},null,8,VMa))]))}}),[["__scopeId","data-v-ff803259"]]);function w$e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function HMa(e){if(Array.isArray(e))return w$e(e)}function jMa(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F3t(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(u){return void n(u)}s.done?t(l):Promise.resolve(l).then(r,a)}function CV(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var i=e.apply(t,n);function o(l){F3t(i,r,a,o,s,"next",l)}function s(l){F3t(i,r,a,o,s,"throw",l)}o(void 0)})}}function B3t(e,t,n){return t=fle(t),qMa(e,z3t()?Reflect.construct(t,n||[],fle(e).constructor):t.apply(e,n))}function V3t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zMa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,G3t(r.key),r)}}function U3t(e,t,n){return t&&zMa(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function H3t(e,t,n){return(t=G3t(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fle(e){return fle=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fle(e)}function j3t(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_$e(e,t)}function z3t(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(z3t=function(){return!!e})()}function WMa(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function GMa(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1038
1038
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W3t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ZC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W3t(Object(n),!0).forEach(function(r){H3t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W3t(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qMa(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jMa(e)}function vy(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function i(h,g,v,b){var _=g&&g.prototype instanceof s?g:s,C=Object.create(_.prototype);return yy(C,"_invoke",function(S,y,T){var k,E,I,D=0,A=T||[],R=!1,B={p:0,n:0,v:e,a:P,f:P.bind(e,4),d:function($,V){return k=$,E=0,I=e,B.n=V,o}};function P($,V){for(E=$,I=V,t=0;!R&&D&&!N&&t<A.length;t++){var N,q=A[t],J=B.p,ie=q[2];$>3?(N=ie===V)&&(I=q[(E=q[4])?5:(E=3,3)],q[4]=q[5]=e):q[0]<=J&&((N=$<2&&J<q[1])?(E=0,B.v=V,B.n=q[1]):J<ie&&(N=$<3||q[0]>V||V>ie)&&(q[4]=$,q[5]=V,B.n=ie,E=0))}if(N||$>1)return o;throw R=!0,V}return function($,V,N){if(D>1)throw TypeError("Generator is already running");for(R&&V===1&&P(V,N),E=V,I=N;(t=E<2?e:I)||!R;){k||(E?E<3?(E>1&&(B.n=-1),P(E,I)):B.n=I:B.v=I);try{if(D=2,k){if(E||($="next"),t=k[$]){if(!(t=t.call(k,I)))throw TypeError("iterator result is not an object");if(!t.done)return t;I=t.value,E<2&&(E=0)}else E===1&&(t=k.return)&&t.call(k),E<2&&(I=TypeError("The iterator does not provide a '"+$+"' method"),E=1);k=e}else if((t=(R=B.n<0)?I:S.call(y,B))!==o)break}catch(q){k=e,E=1,I=q}finally{D=1}}return{value:t,done:R}}}(h,v,b),!0),C}var o={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(yy(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,yy(h,a,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,yy(d,"constructor",u),yy(u,"constructor",l),l.displayName="GeneratorFunction",yy(u,a,"GeneratorFunction"),yy(d),yy(d,a,"Generator"),yy(d,r,function(){return this}),yy(d,"toString",function(){return"[object Generator]"}),(vy=function(){return{w:i,m:p}})()}function yy(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch{a=0}yy=function(i,o,s,l){function u(c,d){yy(i,c,function(p){return this._invoke(c,d,p)})}o?a?a(i,o,{value:s,enumerable:!l,configurable:!l,writable:!l}):i[o]=s:(u("next",0),u("throw",1),u("return",2))},yy(e,t,n,r)}function _$e(e,t){return _$e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},_$e(e,t)}function C$e(e){return HMa(e)||WMa(e)||YMa(e)||GMa()}function KMa(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function G3t(e){var t=KMa(e,"string");return typeof t=="symbol"?t:t+""}function YMa(e,t){if(e){if(typeof e=="string")return w$e(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w$e(e,t):void 0}}var hle=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yG(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function JMa(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var a=!1;try{a=this instanceof r}catch{}return a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var S$e,q3t;function ple(){if(q3t)return S$e;q3t=1;var e;return typeof window<"u"?e=window:typeof hle<"u"?e=hle:typeof self<"u"?e=self:e={},S$e=e,S$e}var ZMa=ple(),Ft=yG(ZMa),XMa={},QMa=Object.freeze({__proto__:null,default:XMa}),eNa=JMa(QMa),k$e,K3t;function Y3t(){if(K3t)return k$e;K3t=1;var e=typeof hle<"u"?hle:typeof window<"u"?window:{},t=eNa,n;return typeof document<"u"?n=document:(n=e["__GLOBAL_DOCUMENT_CACHE@4"],n||(n=e["__GLOBAL_DOCUMENT_CACHE@4"]=t)),k$e=n,k$e}var tNa=Y3t(),Kn=yG(tNa),mle={exports:{}},E$e={exports:{}},J3t;function nNa(){return J3t||(J3t=1,function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var i in a)({}).hasOwnProperty.call(a,i)&&(n[i]=a[i])}return n},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(E$e)),E$e.exports}var x$e,Z3t;function rNa(){if(Z3t)return x$e;Z3t=1,x$e=t;var e=Object.prototype.toString;function t(n){if(!n)return!1;var r=e.call(n);return r==="[object Function]"||typeof n=="function"&&r!=="[object RegExp]"||typeof window<"u"&&(n===window.setTimeout||n===window.alert||n===window.confirm||n===window.prompt)}return x$e}var T$e,X3t;function aNa(){if(X3t)return T$e;X3t=1;function e(a,i){var o=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(o)return(o=o.call(a)).next.bind(o);if(Array.isArray(a)||(o=t(a))||i){o&&(a=o);var s=0;return function(){return s>=a.length?{done:!0}:{done:!1,value:a[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1039
1039
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t(a,i){if(a){if(typeof a=="string")return n(a,i);var o=Object.prototype.toString.call(a).slice(8,-1);if(o==="Object"&&a.constructor&&(o=a.constructor.name),o==="Map"||o==="Set")return Array.from(a);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(a,i)}}function n(a,i){(i==null||i>a.length)&&(i=a.length);for(var o=0,s=new Array(i);o<i;o++)s[o]=a[o];return s}var r=function(){function a(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var i=a.prototype;return i.getIsEnabled=function(){return this.enabled_},i.enable=function(){this.enabled_=!0},i.disable=function(){this.enabled_=!1},i.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},i.addInterceptor=function(s,l){this.typeToInterceptorsMap_.has(s)||this.typeToInterceptorsMap_.set(s,new Set);var u=this.typeToInterceptorsMap_.get(s);return u.has(l)?!1:(u.add(l),!0)},i.removeInterceptor=function(s,l){var u=this.typeToInterceptorsMap_.get(s);return u&&u.has(l)?(u.delete(l),!0):!1},i.clearInterceptorsByType=function(s){var l=this.typeToInterceptorsMap_.get(s);return l?(this.typeToInterceptorsMap_.delete(s),this.typeToInterceptorsMap_.set(s,new Set),!0):!1},i.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},i.getForType=function(s){return this.typeToInterceptorsMap_.get(s)||new Set},i.execute=function(s,l){for(var u=this.getForType(s),c=e(u),d;!(d=c()).done;){var p=d.value;try{l=p(l)}catch{}}return l},a}();return T$e=r,T$e}var D$e,Q3t;function iNa(){if(Q3t)return D$e;Q3t=1;var e=function(){function n(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var r=n.prototype;return r.getIsEnabled=function(){return this.enabled_},r.enable=function(){this.enabled_=!0},r.disable=function(){this.enabled_=!1},r.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},r.getMaxAttempts=function(){return this.maxAttempts_},r.setMaxAttempts=function(i){this.maxAttempts_=i},r.getDelayFactor=function(){return this.delayFactor_},r.setDelayFactor=function(i){this.delayFactor_=i},r.getFuzzFactor=function(){return this.fuzzFactor_},r.setFuzzFactor=function(i){this.fuzzFactor_=i},r.getInitialDelay=function(){return this.initialDelay_},r.setInitialDelay=function(i){this.initialDelay_=i},r.createRetry=function(i){var o=i===void 0?{}:i,s=o.maxAttempts,l=o.delayFactor,u=o.fuzzFactor,c=o.initialDelay;return new t({maxAttempts:s||this.maxAttempts_,delayFactor:l||this.delayFactor_,fuzzFactor:u||this.fuzzFactor_,initialDelay:c||this.initialDelay_})},n}(),t=function(){function n(a){this.maxAttempts_=a.maxAttempts,this.delayFactor_=a.delayFactor,this.fuzzFactor_=a.fuzzFactor,this.currentDelay_=a.initialDelay,this.currentAttempt_=1}var r=n.prototype;return r.moveToNextAttempt=function(){this.currentAttempt_++;var i=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+i},r.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},r.getCurrentDelay=function(){return this.currentDelay_},r.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},r.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},r.getCurrentFuzzedDelay=function(){var i=this.getCurrentMinPossibleDelay(),o=this.getCurrentMaxPossibleDelay();return i+Math.random()*(o-i)},n}();return D$e=e,D$e}var A$e,eVt;function oNa(){if(eVt)return A$e;eVt=1;var e=ple(),t=function(a,i){return i===void 0&&(i=!1),function(o,s,l){if(o){a(o);return}if(s.statusCode>=400&&s.statusCode<=599){var u=l;if(i)if(e.TextDecoder){var c=n(s.headers&&s.headers["content-type"]);try{u=new TextDecoder(c).decode(l)}catch{}}else u=String.fromCharCode.apply(null,new Uint8Array(l));a({cause:u});return}a(null,l)}};function n(r){return r===void 0&&(r=""),r.toLowerCase().split(";").reduce(function(a,i){var o=i.split("="),s=o[0],l=o[1];return s.trim()==="charset"?l.trim():a},"utf-8")}return A$e=t,A$e}var tVt;function sNa(){if(tVt)return mle.exports;tVt=1;var e=ple(),t=nNa(),n=rNa(),r=aNa(),a=iNa();u.httpHandler=oNa(),u.requestInterceptorsStorage=new r,u.responseInterceptorsStorage=new r,u.retryManager=new a;/**
1040
1040
  * @license