1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NhatKyHeThong-BFi31NjN.js","assets/NhatKyHeThong-VASS4zpO.css","assets/BangDienTu-CGc4FFZF.js","assets/BangDienTu-BPkLcW6u.css"])))=>i.map(i=>d[i]); 2var e,t=Object.defineProperty,n=(e,n,i)=>((e,n,i)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i)(e,"symbol"!=typeof n?n+"":n,i);function i(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()} 3/** 4* @vue/shared v3.5.13 5* (c) 2018-present Yuxi (Evan) You and Vue contributors 6* @license MIT 7**/ 8/*! #__NO_SIDE_EFFECTS__ */ 9function a(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver(e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)}).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const o={},s=[],r=()=>{},l=()=>!1,c=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),u=e=>e.startsWith("onUpdate:"),h=Object.assign,d=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},f=Object.prototype.hasOwnProperty,p=(e,t)=>f.call(e,t),g=Array.isArray,m=e=>"[object Map]"===C(e),v=e=>"[object Set]"===C(e),y=e=>"[object Date]"===C(e),b=e=>"function"==typeof e,_=e=>"string"==typeof e,w=e=>"symbol"==typeof e,k=e=>null!==e&&"object"==typeof e,x=e=>(k(e)||b(e))&&b(e.then)&&b(e.catch),T=Object.prototype.toString,C=e=>T.call(e),E=e=>"[object Object]"===C(e),S=e=>_(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,I=a(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),A=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},D=/-(\w)/g,P=A(e=>e.replace(D,(e,t)=>t?t.toUpperCase():"")),O=/\B([A-Z])/g,M=A(e=>e.replace(O,"-$1").toLowerCase()),N=A(e=>e.charAt(0).toUpperCase()+e.slice(1)),R=A(e=>e?"on".concat(N(e)):""),L=(e,t)=>!Object.is(e,t),V=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},q=(e,t,n,i=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},F=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let B;const U=()=>B||(B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function j(e){if(g(e)){const t={};for(let n=0;n<e.length;n++){const i=e[n],a=_(i)?K(i):j(i);if(a)for(const e in a)t[e]=a[e]}return t}if(_(e)||k(e))return e}const H=/;(?![^(]*\))/g,z=/:([^]+)/,W=/\/\*[^]*?\*\//g;function K(e){const t={};return e.replace(W,"").split(H).forEach(e=>{if(e){const n=e.split(z);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function G(e){let t="";if(_(e))t=e;else if(g(e))for(let n=0;n<e.length;n++){const i=G(e[n]);i&&(t+=i+" ")}else if(k(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Y(e){if(!e)return null;let{class:t,style:n}=e;return t&&!_(t)&&(e.class=G(t)),n&&(e.style=j(n)),e}const Q=a("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function $(e){return!!e||""===e}function X(e,t){if(e===t)return!0;let n=y(e),i=y(t);if(n||i)return!(!n||!i)&&e.getTime()===t.getTime();if(n=w(e),i=w(t),n||i)return e===t;if(n=g(e),i=g(t),n||i)return!(!n||!i)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let i=0;n&&i<e.length;i++)n=X(e[i],t[i]);return n}(e,t);
9if(n=k(e),i=k(t),n||i){if(!n||!i)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const i=e.hasOwnProperty(n),a=t.hasOwnProperty(n);if(i&&!a||!i&&a||!X(e[n],t[n]))return!1}}return String(e)===String(t)}function J(e,t){return e.findIndex(e=>X(e,t))}const Z=e=>!(!e||!0!==e.__v_isRef),ee=e=>_(e)?e:null==e?"":g(e)||k(e)&&(e.toString===T||!b(e.toString))?Z(e)?ee(e.value):JSON.stringify(e,te,2):String(e),te=(e,t)=>Z(t)?te(e,t.value):m(t)?{["Map(".concat(t.size,")")]:[...t.entries()].reduce((e,[t,n],i)=>(e[ne(t,i)+" =>"]=n,e),{})}:v(t)?{["Set(".concat(t.size,")")]:[...t.values()].map(e=>ne(e))}:w(t)?ne(t):!k(t)||g(t)||E(t)?t:String(t),ne=(e,t="")=>{var n;return w(e)?"Symbol(".concat(null!=(n=e.description)?n:t,")"):e}; 10/** 11* @vue/reactivity v3.5.13 12* (c) 2018-present Yuxi (Evan) You and Vue contributors 13* @license MIT 14**/ 15let ie,ae;class oe{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=ie,!e&&ie&&(this.index=(ie.scopes||(ie.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=ie;try{return ie=this,e()}finally{ie=t}}}on(){ie=this}off(){ie=this.parent}stop(e){if(this._active){let t,n;for(this._active=!1,t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}function se(e){return new oe(e)}function re(){return ie}function le(e,t=!1){ie&&ie.cleanups.push(e)}const ce=new WeakSet;class ue{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ie&&ie.active&&ie.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,ce.has(this)&&(ce.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||pe(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,Se(this),ve(this);const e=ae,t=xe;ae=this,xe=!0;try{return this.fn()}finally{ye(this),ae=e,xe=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)we(e);this.deps=this.depsTail=void 0,Se(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?ce.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){be(this)&&this.run()}get dirty(){return be(this)}}let he,de,fe=0;function pe(e,t=!1){if(e.flags|=8,t)return e.next=de,void(de=e);e.next=he,he=e}function ge(){fe++}function me(){if(--fe>0)return;if(de){let e=de;for(de=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;he;){let n=he;for(he=void 0;n;){const i=n.next;if(n.next=void 0,n.flags&=-9,1&n.flags)try{n.trigger()}catch(t){e||(e=t)}n=i}}if(e)throw e}function ve(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ye(e){let t,n=e.depsTail,i=n;for(;i;){const e=i.prevDep;-1===i.version?(i===n&&(n=e),we(i),ke(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=e}e.deps=t,e.depsTail=n}function be(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(_e(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function _e(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===Ie)return;e.globalVersion=Ie;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!be(e))return void(e.flags&=-3);const n=ae,i=xe;ae=e,xe=!0;try{ve(e);const n=e.fn(e._value);(0===t.version||L(n,e._value))&&(e._value=n,t.version++)}catch(a){throw t.version++,a}finally{ae=n,xe=i,ye(e),e.flags&=-3}}function we(e,t=!1){const{dep:n,prevSub:i,nextSub:a}=e;if(i&&(i.nextSub=a,e.prevSub=void 0),a&&(a.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.c
vendor: 5,080 bytes, line 15
15omputed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)we(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function ke(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let xe=!0;const Te=[];function Ce(){Te.push(xe),xe=!1}function Ee(){const e=Te.pop();xe=void 0===e||e}function Se(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=ae;ae=void 0;try{t()}finally{ae=e}}}let Ie=0;class Ae{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class De{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!ae||!xe||ae===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==ae)t=this.activeLink=new Ae(ae,this),ae.deps?(t.prevDep=ae.depsTail,ae.depsTail.nextDep=t,ae.depsTail=t):ae.deps=ae.depsTail=t,Pe(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=ae.depsTail,t.nextDep=void 0,ae.depsTail.nextDep=t,ae.depsTail=t,ae.deps===t&&(ae.deps=e)}return t}trigger(e){this.version++,Ie++,this.notify(e)}notify(e){ge();try{0;for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{me()}}}function Pe(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Pe(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Oe=new WeakMap,Me=Symbol(""),Ne=Symbol(""),Re=Symbol("");function Le(e,t,n){if(xe&&ae){let t=Oe.get(e);t||Oe.set(e,t=new Map);let i=t.get(n);i||(t.set(n,i=new De),i.map=t,i.key=n),i.track()}}function Ve(e,t,n,i,a,o){const s=Oe.get(e);if(!s)return void Ie++;const r=e=>{e&&e.trigger()};if(ge(),"clear"===t)s.forEach(r);else{const a=g(e),o=a&&S(n);if(a&&"length"===n){const e=Number(i);s.forEach((t,n)=>{("length"===n||n===Re||!w(n)&&n>=e)&&r(t)})}else switch((void 0!==n||s.has(void 0))&&r(s.get(n)),o&&r(s.get(Re)),t){case"add":a?o&&r(s.get("length")):(r(s.get(Me)),m(e)&&r(s.get(Ne)));break;case"delete":a||(r(s.get(Me)),m(e)&&r(s.get(Ne)));break;case"set":m(e)&&r(s.get(Me))}}me()}function qe(e){const t=xt(e);return t===e?t:(Le(t,0,Re),wt(e)?t:t.map(Ct))}function Fe(e){return Le(e=xt(e),0,Re),e}const Be={__proto__:null,[Symbol.iterator](){return Ue(this,Symbol.iterator,Ct)},concat(...e){return qe(this).concat(...e.map(e=>g(e)?qe(e):e))},entries(){return Ue(this,"entries",e=>(e[1]=Ct(e[1]),e))},every(e,t){return He(this,"every",e,t,void 0,arguments)},filter(e,t){return He(this,"filter",e,t,e=>e.map(Ct),arguments)},find(e,t){return He(this,"find",e,t,Ct,arguments)},findIndex(e,t){return He(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return He(this,"findLast",e,t,Ct,arguments)},findLastIndex(e,t){return He(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return He(this,"forEach",e,t,void 0,arguments)},includes(...e){return We(this,"includes",e)},indexOf(...e){return We(this,"indexOf",e)},join(e){return qe(this).join(e)},lastIndexOf(...e){return We(this,"lastIndexOf",e)},map(e,t){return He(this,"map",e,t,void 0,arguments)},pop(){return Ke(this,"pop")},push(...e){return Ke(this,"push",e)},reduce(e,...t){return ze(this,"reduce",e,t)},reduceRight(e,...t){return ze(this,"reduceRight",e,t)},shift(){return Ke(this,"shift")},some(e,t){return He(this,"some",e,t,void 0,arguments)},splice(...e){return Ke(this,"splice",e)},toReversed(){return qe(this).toReversed()},toSorted(e){return qe(this).toSorted(e)},toSpliced(...e){return qe(this).toSpliced(...e)},unshift(...e){return Ke(this,"unshift",e)},values(){return Ue(this,"values",Ct)}};function Ue(e,t,n){const i=Fe(e),a=i[t]();return i===e||wt(e)||(a._next=a.next,a.next=()=>{const e=a._next();return e.value&&(e.value=n(e.value)),e}),a}const je=Array.prototype;function He(e,t,n,i,a,o){const s=Fe(e),r=s!==e&&!wt(e),l=s[t];if(l!==je[t]){const t=l.apply(e,o);return r?Ct(t):t}let c=n;s!==e&&(r?c=function(t,i){return n.call(this,Ct(t),i,e)}:n.length>2&&(c=function(t,i){return n.call(this,t,i,e)}));const u=l.call(s,c,i);return r&&a?a(u):u}function ze(e,t,n,i){const a=Fe(e);let o=n;return a!==e&&(wt(e)?n.length>3&&(o=function(t,i,a){return n.call(this,t,i,a,e)}):o=function(t,i,a){return n.call(this,t,Ct(i),a,e)}),a[t](o,...i)}function We(e,t,n){const i=xt(e);Le(i,0,Re);const a=i[t](...n);return-1!==a&&!1!==a||!kt(n[0])?a:(n[0]=xt(n[0]),i[t](...n))}function Ke(e,t,n=[]){Ce(),ge();const i=xt(e)[t].apply(e,n);return me(),Ee(),i}const Ge=a("__proto__,__v_isRef,__isVue"),Ye=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(w));function Qe(e){w(e)||(e=String(e));const t=xt(this);return Le(t,0,e),t.hasOwnProperty(e)}class $e{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const i=this._isReadonly,a=this._isShallow;if("__v_isReactive"===t)return!i;if("__v_isReadonly"===t)return i;if("__v_isShallow"===t)return a;
vendor: 16,577 bytes, lines 15-21
15if("__v_raw"===t)return n===(i?a?ft:dt:a?ht:ut).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=g(e);if(!i){let e;if(o&&(e=Be[t]))return e;if("hasOwnProperty"===t)return Qe}const s=Reflect.get(e,t,St(e)?e:n);return(w(t)?Ye.has(t):Ge(t))?s:(i||Le(e,0,t),a?s:St(s)?o&&S(t)?s:s.value:k(s)?i?vt(s):gt(s):s)}}class Xe extends $e{constructor(e=!1){super(!1,e)}set(e,t,n,i){let a=e[t];if(!this._isShallow){const t=_t(a);if(wt(n)||_t(n)||(a=xt(a),n=xt(n)),!g(e)&&St(a)&&!St(n))return!t&&(a.value=n,!0)}const o=g(e)&&S(t)?Number(t)<e.length:p(e,t),s=Reflect.set(e,t,n,St(e)?e:i);return e===xt(i)&&(o?L(n,a)&&Ve(e,"set",t,n):Ve(e,"add",t,n)),s}deleteProperty(e,t){const n=p(e,t);e[t];const i=Reflect.deleteProperty(e,t);return i&&n&&Ve(e,"delete",t,void 0),i}has(e,t){const n=Reflect.has(e,t);return w(t)&&Ye.has(t)||Le(e,0,t),n}ownKeys(e){return Le(e,0,g(e)?"length":Me),Reflect.ownKeys(e)}}class Je extends $e{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const Ze=new Xe,et=new Je,tt=new Xe(!0),nt=e=>e,it=e=>Reflect.getPrototypeOf(e);function at(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function ot(e,t){const n={get(n){const i=this.__v_raw,a=xt(i),o=xt(n);e||(L(n,o)&&Le(a,0,n),Le(a,0,o));const{has:s}=it(a),r=t?nt:e?Et:Ct;return s.call(a,n)?r(i.get(n)):s.call(a,o)?r(i.get(o)):void(i!==a&&i.get(n))},get size(){const t=this.__v_raw;return!e&&Le(xt(t),0,Me),Reflect.get(t,"size",t)},has(t){const n=this.__v_raw,i=xt(n),a=xt(t);return e||(L(t,a)&&Le(i,0,t),Le(i,0,a)),t===a?n.has(t):n.has(t)||n.has(a)},forEach(n,i){const a=this,o=a.__v_raw,s=xt(o),r=t?nt:e?Et:Ct;return!e&&Le(s,0,Me),o.forEach((e,t)=>n.call(i,r(e),r(t),a))}};h(n,e?{add:at("add"),set:at("set"),delete:at("delete"),clear:at("clear")}:{add(e){t||wt(e)||_t(e)||(e=xt(e));const n=xt(this);return it(n).has.call(n,e)||(n.add(e),Ve(n,"add",e,e)),this},set(e,n){t||wt(n)||_t(n)||(n=xt(n));const i=xt(this),{has:a,get:o}=it(i);let s=a.call(i,e);s||(e=xt(e),s=a.call(i,e));const r=o.call(i,e);return i.set(e,n),s?L(n,r)&&Ve(i,"set",e,n):Ve(i,"add",e,n),this},delete(e){const t=xt(this),{has:n,get:i}=it(t);let a=n.call(t,e);a||(e=xt(e),a=n.call(t,e)),i&&i.call(t,e);const o=t.delete(e);return a&&Ve(t,"delete",e,void 0),o},clear(){const e=xt(this),t=0!==e.size,n=e.clear();return t&&Ve(e,"clear",void 0,void 0),n}});return["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=function(e,t,n){return function(...i){const a=this.__v_raw,o=xt(a),s=m(o),r="entries"===e||e===Symbol.iterator&&s,l="keys"===e&&s,c=a[e](...i),u=n?nt:t?Et:Ct;return!t&&Le(o,0,l?Ne:Me),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:r?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}(i,e,t)}),n}function st(e,t){const n=ot(e,t);return(t,i,a)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get(p(n,i)&&i in t?n:t,i,a)}const rt={get:st(!1,!1)},lt={get:st(!1,!0)},ct={get:st(!0,!1)},ut=new WeakMap,ht=new WeakMap,dt=new WeakMap,ft=new WeakMap;function pt(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>C(e).slice(8,-1))(e))}function gt(e){return _t(e)?e:yt(e,!1,Ze,rt,ut)}function mt(e){return yt(e,!1,tt,lt,ht)}function vt(e){return yt(e,!0,et,ct,dt)}function yt(e,t,n,i,a){if(!k(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const o=a.get(e);if(o)return o;const s=pt(e);if(0===s)return e;const r=new Proxy(e,2===s?i:n);return a.set(e,r),r}function bt(e){return _t(e)?bt(e.__v_raw):!(!e||!e.__v_isReactive)}function _t(e){return!(!e||!e.__v_isReadonly)}function wt(e){return!(!e||!e.__v_isShallow)}function kt(e){return!!e&&!!e.__v_raw}function xt(e){const t=e&&e.__v_raw;return t?xt(t):e}function Tt(e){return!p(e,"__v_skip")&&Object.isExtensible(e)&&q(e,"__v_skip",!0),e}const Ct=e=>k(e)?gt(e):e,Et=e=>k(e)?vt(e):e;function St(e){return!!e&&!0===e.__v_isRef}function It(e){return Dt(e,!1)}function At(e){return Dt(e,!0)}function Dt(e,t){return St(e)?e:new Pt(e,t)}class Pt{constructor(e,t){this.dep=new De,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:xt(e),this._value=t?e:Ct(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||wt(e)||_t(e);e=n?e:xt(e),L(e,t)&&(this._rawValue=e,this._value=n?e:Ct(e),this.dep.trigger())}}function Ot(e){return St(e)?e.value:e}function Mt(e){return b(e)?e():Ot(e)}const Nt={get:(e,t,n)=>"__v_raw"===t?e:Ot(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const a=e[t];return St(a)&&!St(n)?(a.value=n,!0):Reflect.set(e,t,n,i)}};function Rt(e){return bt(e)?e:new Proxy(e,Nt)}class Lt{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new De,{get:n,set:i}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=i}get value(){return this._value=this._get()}set value(e){this._set(e)}}class Vt{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){const n=Oe.get(e);return n&&n.get(t)}(xt(this._object),this._key)}}class qt{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Ft(e,t,n){return St(e)?e:b(e)?new qt(e):k(e)&&arguments.length>1?Bt(e,t,n):It(e)}function Bt(e,t,n){const i=e[t];return St(i)?i:new Vt(e,t,n)}class Ut{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new De(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ie-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&ae!==this)return pe(this,!0),!0}get value(){const e=this.dep.track();return _e(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}const jt={},Ht=new WeakMap;let zt;function Wt(e,t,n=o){const{immediate:i,deep:a,once:s,scheduler:l,augmentJob:c,call:u}=n,h=e=>a?e:wt(e)||!1===a||0===a?Kt(e,1):Kt(e);let f,p,m,v,y=!1,_=!1;if(St(e)?(p=()=>e.value,y=wt(e)):bt(e)?(p=()=>h(e),y=!0):g(e)?(_=!0,y=e.some(e=>bt(e)||wt(e)),p=()=>e.map(e=>St(e)?e.value:bt(e)?h(e):b(e)?u?u(e,2):e():void 0)):p=b(e)?t?u?()=>u(e,2):e:()=>{if(m){Ce();try{m()}finally{Ee()}}const t=zt;zt=f;try{return u?u(e,3,[v]):e(v)}finally{zt=t}}:r,t&&a){const e=p,t=!0===a?1/0:a;p=()=>Kt(e(),t)}const w=re(),k=()=>{f.stop(),w&&w.active&&d(w.effects,f)};if(s&&t){const e=t;t=(...t)=>{e(...t),k()}}let x=_?new Array(e.length).fill(jt):jt;const T=e=>{if(1&f.flags&&(f.dirty||e))if(t){const e=f.run();if(a||y||(_?e.some((e,t)=>L(e,x[t])):L(e,x))){m&&m();const n=zt;zt=f;try{const n=[e,x===jt?void 0:_&&x[0]===jt?[]:x,v];u?u(t,3,n):t(...n),x=e}finally{zt=n}}}else f.run()};return c&&c(T),f=new ue(p),f.scheduler=l?()=>l(T,!1):T,v=e=>function(e,t=!1,n=zt){if(n){let t=Ht.get(n);t||Ht.set(n,t=[]),t.push(e)}}(e,!1,f),m=f.onStop=()=>{const e=Ht.get(f);if(e){if(u)u(e,4);else for(const t of e)t();Ht.delete(f)}},t?i?T(!0):x=f.run():l?l(T.bind(null,!0),!0):f.run(),k.pause=f.pause.bind(f),k.resume=f.resume.bind(f),k.stop=k,k}function Kt(e,t=1/0,n){if(t<=0||!k(e)||e.__v_skip)return e;if((n=n||new Set).has(e))return e;if(n.add(e),t--,St(e))Kt(e.value,t,n);else if(g(e))for(let i=0;i<e.length;i++)Kt(e[i],t,n);else if(v(e)||m(e))e.forEach(e=>{Kt(e,t,n)});else if(E(e)){for(const i in e)Kt(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&Kt(e[i],t,n)}return e} 16/** 17* @vue/runtime-core v3.5.13 18* (c) 2018-present Yuxi (Evan) You and Vue contributors 19* @license MIT 20**/function Gt(e,t,n,i){try{return i?e(...i):e()}catch(a){Qt(a,t,n)}}function Yt(e,t,n,i){if(b(e)){const a=Gt(e,t,n,i);return a&&x(a)&&a.catch(e=>{Qt(e,t,n)}),a}if(g(e)){const a=[];for(let o=0;o<e.length;o++)a.push(Yt(e[o],t,n,i));return a}}function Qt(e,t,n,i=!0){t&&t.vnode;const{errorHandler:a,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||o;if(t){let i=t.parent;const o=t.proxy,s="https://vuejs.org/error-reference/#runtime-".concat(n);for(;i;){const t=i.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,o,s))return;i=i.parent}if(a)return Ce(),Gt(a,null,10,[e,o,s]),void Ee()}!function(e,t,n,i=!0,a=!1){if(a)throw e}(e,0,0,i,s)}const $t=[];let Xt=-1;const Jt=[];let Zt=null,en=0;const tn=Promise.resolve();let nn=null;function an(e){const t=nn||tn;return e?t.then(this?e.bind(this):e):t}function on(e){if(!(1&e.flags)){const t=cn(e),n=$t[$t.length-1];!n||!(2&e.flags)&&t>=cn(n)?$t.push(e):$t.splice(function(e){let t=Xt+1,n=$t.length;for(;t<n;){const i=t+n>>>1,a=$t[i],o=cn(a);o<e||o===e&&2&a.flags?t=i+1:n=i}return t}(t),0,e),e.flags|=1,sn()}}function sn(){nn||(nn=tn.then(un))}function rn(e,t,n=Xt+1){for(;n<$t.length;n++){const t=$t[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;$t.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function ln(e){if(Jt.length){const e=[...new Set(Jt)].sort((e,t)=>cn(e)-cn(t));if(Jt.length=0,Zt)return void Zt.push(...e);for(Zt=e,en=0;en<Zt.length;en++){const e=Zt[en];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}Zt=null,en=0}}const cn=e=>null==e.id?2&e.flags?-1:1/0:e.id;function un(e){try{for(Xt=0;Xt<$t.length;Xt++){const e=$t[Xt];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),Gt(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;Xt<$t.length;Xt++){const e=$t[Xt];e&&(e.flags&=-2)}Xt=-1,$t.length=0,ln(),nn=null,($t.length||Jt.length)&&un()}}let hn=null,dn=null;function fn(e){const t=hn;return hn=e,dn=e&&e.type.__scopeId||null,t}function pn(e,t=hn,n){if(!t)return e;if(e._n)return e;const i=(...n)=>{i._d&&Ra(-1);const a=fn(t);let o;try{o=e(...n)}finally{fn(a),i._d&&Ra(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function gn(e,t){if(null===hn)return e;const n=vo(hn),i=e.dirs||(e.dirs=[]);for(let a=0;a<t.length;a++){let[e,s,r,l=o]=t[a];e&&(b(e)&&(e={mounted:e,updated:e}),e.deep&&Kt(s),i.push({dir:e,instance:n,value:s,oldValue:void 0,arg:r,modifiers:l}))}return e}function mn(e,t,n,i){const a=e.dirs,o=t&&t.dirs;for(let s=0;s<a.length;s++){const r=a[s];o&&(r.oldValue=o[s].value);let l=r.dir[i];l&&(Ce(),Yt(l,n,8,[e.el,r,e,t]),Ee())}}const vn=Symbol("_vte"),yn=e=>e.__isTeleport,bn=e=>e&&(e.disabled||""===e.disabled),_n=e=>e&&(e.defer||""===e.defer),wn=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,kn=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,xn=(e,t)=>{const n=e&&e.to;if(_(n)){if(t){return t(n)}return null}return n},Tn={name:"Teleport",__isTeleport:!0,process(e,t,n,i,a,o,s,r,l,c){const{mc:u,pc:h,pbc:d,o:{insert:f,querySelector:p,createText:g,createComment:m}}=c,v=bn(t.props);let{shapeFlag:y,children:b,dynamicChildren:_}=t;if(null==e){const e=t.el=g(""),c=t.anchor=g("");f(e,n,i),f(c,n,i);const h=(e,t)=>{16&y&&(a&&a.isCE&&(a.ce._teleportTarget=e),u(b,e,t,a,o,s,r,l))},d=()=>{const e=t.target=xn(t.props,p),n=In(e,t,g,f);e&&("svg"!==s&&wn(e)?s="svg":"mathml"!==s&&kn(e)&&(s="mathml"),v||(h(e,n),Sn(t,!1)))};v&&(h(n,c),Sn(t,!0)),_n(t.props)?aa(()=>{d(),t.el.__isMounted=!0},o):d()}else{if(_n(t.props)&&!e.el.__isMounted)return void aa(()=>{Tn.process(e,t,n,i,a,o,s,r,l,c),delete e.el.__isMounted},o);t.el=e.el,t.targetStart=e.targetStart;const u=t.anchor=e.anchor,f=t.target=e.target,g=t.targetAnchor=e.targetAnchor,m=bn(e.props),y=m?n:f,b=m?u:g;if("svg"===s||wn(f)?s="svg":("mathml"===s||kn(f))&&(s="mathml"),_?(d(e.dynamicChildren,_,y,a,o,s,r),la(e,t,!0)):l||h(e,t,y,b,a,o,s,r,!1),v)m?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Cn(t,n,u,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=xn(t.props,p);e&&Cn(t,e,null,c,0)}else m&&Cn(t,f,g,c,1);Sn(t,v)}},remove(e,t,n,{um:i,o:{remove:a}},o){const{shapeFlag:s,children:r,anchor:l,targetStart:c,targetAnchor:u,target:h,props:d}=e;if(h&&(a(c),a(u)),o&&a(l),16&s){const e=o||!bn(d);for(let a=0;a<r.length;a++){const o=r[a];i(o,t,n,e,!!o.dynamicChildren)}}},move:Cn,hydrate:function(e,t,n,i,a,o,{o:{nextSibling:s,parentNode:r,querySelector:l,insert:c,createText:u}},h){const d=t.target=xn(t.props,l);if(d){const l=bn(t.props),f=d._lpa||d.firstChild;if(16&t.shapeFlag)if(l)t.anchor=h(s(e),t,r(e),n,i,a,o),t.targetStart=f,t.targetAnchor=f&&s(f);else{t.anchor=s(e);let r=f;for(;r;){if(r&&8===r.nodeType)if("teleport start anchor"===r.data)t.targetStart=r;else if("teleport anchor"===r.data){t.targetAnchor=r,d._lpa=t.targetAnchor&&s(t.targetAnchor);break}r=s(r)}t.targetAnchor||In(d,t,u,c),h(f&&s(f),t,d,n,i,a,o)}Sn(t,l)}return t.anchor&&s(t.anchor)}};function Cn(e,t,n,{o:{insert:i},m:a},o=2){0===o&&i(e.targetAnchor,t,n);const{el:s,anchor:r,shapeFlag:l,children:c,props:u}=e,h=2===o;if(h&&i(s,t,n),(!h||bn(u))&&16&l)for(let d=0;d<c.length;d++)a(c[d],t,n,2);h&&i(r,t,n)}const En=Tn;function Sn(e,t){const n=e.ctx;if(n&&n.ut){let i,a;for(t?(i=e.el,a=e.anchor):(i=e.targetStart,a=e.targetAnchor);i&&i!==a;)1===i.nodeType&&i.setAttribute("data-v-owner",n.uid),i=i.nextSibling;n.ut()}}function In(e,t,n,i){const a=t.targetStart=n(""),o=t.targetAnchor=n("");return a[vn]=o,e&&(i(a,e),i(o,e)),o}const An=Symbol("_leaveCb"),Dn=Symbol("_enterCb");const Pn=[Function,Array],On={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Pn,onEnter:Pn,onAfterEnter:Pn,onEnterCancelled:Pn,onBeforeLeave:Pn,onLeave:Pn,onAfterLeave:Pn,onLeaveCancelled:Pn,onBeforeAppear:Pn,onAppear:Pn,onAfterAppear:Pn,onAppearCancelled:Pn},Mn=e=>{const t=e.subTree;return t.component?Mn(t.component):t};function Nn(e){let t=e[0];if(e.length>1)for(const n of e)if(n.type!==Aa){t=n;break}return t}const Rn={name:"BaseTransition",props:On,setup(e,{slots:t}){const n=ao(),i=function(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ei(()=>{e.isMounted=!0}),ii(()=>{e.isUnmounting=!0}),e}();return()=>{const a=t.default&&Un(t.default(),!0);if(!a||!a.length)return;const o=Nn(a),s=xt(e),{mode:r}=s;if(i.isLeaving)return qn(o);const l=Fn(o);if(!l)return qn(o);let c=Vn(l,s,i,n,e=>c=e);l.type!==Aa&&Bn(l,c);let u=n.subTree&&Fn(n.subTree);if(u&&u.type!==Aa&&!Ba(l,u)&&Mn(n).type!==Aa){let e=Vn(u,s,i,n);if(Bn(u,e),"out-in"===r&&l.type!==Aa)return i.isLeaving=!0,e.afterLeave=()=>{i.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,u=void 0},qn(o);"in-out"===r&&l.type!==Aa?e.delayLeave=(e,t,n)=>{Ln(i,u)[String(u.key)]=u,e[An]=()=>{t(),e[An]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{n(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return o}}};function Ln(e,t){const{leavingVNodes:n}=e;let i=n.get(t.type);return i||(i=Object.create(null),n.set(t.type,i)),i}function Vn(e,t,n,i,a){const{appear:o,mode:s,persisted:r=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:h,onBeforeLeave:d,onLeave:f,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:v,onAppear:y,onAfterAppear:b,onAppearCancelled:_}=t,w=String(e.key),k=Ln(n,e),x=(e,t)=>{e&&Yt(e,i,9,t)},T=(e,t)=>{const n=t[1];x(e,t),g(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},C={mode:s,persisted:r,beforeEnter(t){let i=l;if(!n.isMounted){if(!o)return;i=v||l}t[An]&&t[An](!0);const a=k[w];a&&Ba(e,a)&&a.el[An]&&a.el[An](),x(i,[t])},enter(e){let t=c,i=u,a=h;if(!n.isMounted){if(!o)return;t=y||c,i=b||u,a=_||h}let s=!1;const r=e[Dn]=t=>{s||(s=!0,x(t?a:i,[e]),C.delayedLeave&&C.delayedLeave(),e[Dn]=void 0)};t?T(t,[e,r]):r()},leave(t,i){const a=String(e.key);if(t[Dn]&&t[Dn](!0),n.isUnmounting)return i();x(d,[t]);let o=!1;const s=t[An]=n=>{o||(o=!0,i(),x(n?m:p,[t]),t[An]=void 0,k[a]===e&&delete k[a])};k[a]=e,f?T(f,[t,s]):s()},clone(e){const o=Vn(e,t,n,i,a);return a&&a(o),o}};return C}function qn(e){if(Kn(e))return(e=Ka(e)).children=null,e}function Fn(e){if(!Kn(e))return yn(e.type)&&e.children?Nn(e.children):e;const{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&b(n.default))return n.default()}}function Bn(e,t){6&e.shapeFlag&&e.component?(e.transition=t,Bn(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Un(e,t=!1,n){let i=[],a=0;for(let o=0;o<e.length;o++){let s=e[o];const r=null==n?s.key:String(n)+String(null!=s.key?s.key:o);s.type===Sa?(128&s.patchFlag&&a++,i=i.concat(Un(s.children,t,r))):(t||s.type!==Aa)&&i.push(null!=r?Ka(s,{key:r}):s)}if(a>1)for(let o=0;o<i.length;o++)i[o].patchFlag=-2;return i} 21/*! #__NO_SIDE_EFFECTS__ */function jn(e,t){return b(e)?(()=>h({name:e.name},t,{setup:e}))():e}
21function Hn(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function zn(e,t,n,i,a=!1){if(g(e))return void e.forEach((e,o)=>zn(e,t&&(g(t)?t[o]:t),n,i,a));if(Wn(i)&&!a)return void(512&i.shapeFlag&&i.type.__asyncResolved&&i.component.subTree.component&&zn(e,t,n,i.component.subTree));const s=4&i.shapeFlag?vo(i.component):i.el,r=a?null:s,{i:l,r:c}=e,u=t&&t.r,h=l.refs===o?l.refs={}:l.refs,f=l.setupState,m=xt(f),v=f===o?()=>!1:e=>p(m,e);if(null!=u&&u!==c&&(_(u)?(h[u]=null,v(u)&&(f[u]=null)):St(u)&&(u.value=null)),b(c))Gt(c,l,12,[r,h]);else{const t=_(c),i=St(c);if(t||i){const o=()=>{if(e.f){const n=t?v(c)?f[c]:h[c]:c.value;a?g(n)&&d(n,s):g(n)?n.includes(s)||n.push(s):t?(h[c]=[s],v(c)&&(f[c]=h[c])):(c.value=[s],e.k&&(h[e.k]=c.value))}else t?(h[c]=r,v(c)&&(f[c]=r)):i&&(c.value=r,e.k&&(h[e.k]=r))};r?(o.id=-1,aa(o,n)):o()}}}U().requestIdleCallback,U().cancelIdleCallback;const Wn=e=>!!e.type.__asyncLoader,Kn=e=>e.type.__isKeepAlive;function Gn(e,t){Qn(e,"a",t)}function Yn(e,t){Qn(e,"da",t)}function Qn(e,t,n=io){const i=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Xn(t,i,n),n){let e=n.parent;for(;e&&e.parent;)Kn(e.parent.vnode)&&$n(i,t,n,e),e=e.parent}}function $n(e,t,n,i){const a=Xn(t,e,i,!0);ai(()=>{d(i[t],a)},n)}function Xn(e,t,n=io,i=!1){if(n){const a=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Ce();const a=ro(n),o=Yt(t,n,e,i);return a(),Ee(),o});return i?a.unshift(o):a.push(o),o}}const Jn=e=>(t,n=io)=>{ho&&"sp"!==e||Xn(e,(...e)=>t(...e),n)},Zn=Jn("bm"),ei=Jn("m"),ti=Jn("bu"),ni=Jn("u"),ii=Jn("bum"),ai=Jn("um"),oi=Jn("sp"),si=Jn("rtg"),ri=Jn("rtc");function li(e,t=io){Xn("ec",e,t)}const ci="components";function ui(e,t){return fi(ci,e,!0,t)||e}const hi=Symbol.for("v-ndc");function di(e){return _(e)?fi(ci,e,!1)||e:e||hi}function fi(e,t,n=!0,i=!1){const a=hn||io;if(a){const n=a.type;{const e=yo(n,!1);if(e&&(e===t||e===P(t)||e===N(P(t))))return n}const o=pi(a[e]||n[e],t)||pi(a.appContext[e],t);return!o&&i?n:o}}function pi(e,t){return e&&(e[t]||e[P(t)]||e[N(P(t))])}function gi(e,t,n,i){let a;const o=n,s=g(e);if(s||_(e)){let n=!1;s&&bt(e)&&(n=!wt(e),e=Fe(e)),a=new Array(e.length);for(let i=0,s=e.length;i<s;i++)a[i]=t(n?Ct(e[i]):e[i],i,void 0,o)}else if("number"==typeof e){a=new Array(e);for(let n=0;n<e;n++)a[n]=t(n+1,n,void 0,o)}else if(k(e))if(e[Symbol.iterator])a=Array.from(e,(e,n)=>t(e,n,void 0,o));else{const n=Object.keys(e);a=new Array(n.length);for(let i=0,s=n.length;i<s;i++){const s=n[i];a[i]=t(e[s],s,i,o)}}else a=[];return a}function mi(e,t){for(let n=0;n<t.length;n++){const i=t[n];if(g(i))for(let t=0;t<i.length;t++)e[i[t].name]=i[t].fn;else i&&(e[i.name]=i.key?(...e)=>{const t=i.fn(...e);return t&&(t.key=i.key),t}:i.fn)}return e}function vi(e,t,n={},i,a){if(hn.ce||hn.parent&&Wn(hn.parent)&&hn.parent.ce)return"default"!==t&&(n.name=t),Ma(),qa(Sa,null,[za("slot",n,i&&i())],64);let o=e[t];o&&o._c&&(o._d=!1),Ma();const s=o&&yi(o(n)),r=n.key||s&&s.key,l=qa(Sa,{key:(r&&!w(r)?r:"_".concat(t))+(!s&&i?"_fb":"")},s||(i?i():[]),s&&1===e._?64:-2);return!a&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),o&&o._c&&(o._d=!0),l}function yi(e){return e.some(e=>!Fa(e)||e.type!==Aa&&!(e.type===Sa&&!yi(e.children)))?e:null}const bi=e=>e?co(e)?vo(e):bi(e.parent):null,_i=h(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>bi(e.parent),$root:e=>bi(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Di(e),$forceUpdate:e=>e.f||(e.f=()=>{on(e.update)}),$nextTick:e=>e.n||(e.n=an.bind(e.proxy)),$watch:e=>ma.bind(e)}),wi=(e,t)=>e!==o&&!e.__isScriptSetup&&p(e,t),ki={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:i,data:a,props:s,accessCache:r,type:l,appContext:c}=e;let u;if("$"!==t[0]){const l=r[t];if(void 0!==l)switch(l){case 1:return i[t];case 2:return a[t];case 4:return n[t];case 3:return s[t]}else{if(wi(i,t))return r[t]=1,i[t];if(a!==o&&p(a,t))return r[t]=2,a[t];if((u=e.propsOptions[0])&&p(u,t))return r[t]=3,s[t];if(n!==o&&p(n,t))return r[t]=4,n[t];Ei&&(r[t]=0)}}const h=_i[t];let d,f;return h?("$attrs"===t&&Le(e.attrs,0,""),h(e)):(d=l.__cssModules)&&(d=d[t])?d:n!==o&&p(n,t)?(r[t]=4,n[t]):(f=c.config.globalProperties,p(f,t)?f[t]:void 0)},set({_:e},t,n){const{data:i,setupState:a,ctx:s}=e;
vendor: 12,635 bytes, line 21
21return wi(a,t)?(a[t]=n,!0):i!==o&&p(i,t)?(i[t]=n,!0):!p(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(s[t]=n,!0))},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:a,propsOptions:s}},r){let l;return!!n[r]||e!==o&&p(e,r)||wi(t,r)||(l=s[0])&&p(l,r)||p(i,r)||p(_i,r)||p(a.config.globalProperties,r)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:p(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function xi(){return Ti().slots}function Ti(){const e=ao();return e.setupContext||(e.setupContext=mo(e))}function Ci(e){return g(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let Ei=!0;function Si(e){const t=Di(e),n=e.proxy,i=e.ctx;Ei=!1,t.beforeCreate&&Ii(t.beforeCreate,e,"bc");const{data:a,computed:o,methods:s,watch:l,provide:c,inject:u,created:h,beforeMount:d,mounted:f,beforeUpdate:p,updated:m,activated:v,deactivated:y,beforeDestroy:_,beforeUnmount:w,destroyed:x,unmounted:T,render:C,renderTracked:E,renderTriggered:S,errorCaptured:I,serverPrefetch:A,expose:D,inheritAttrs:P,components:O,directives:M,filters:N}=t;if(u&&function(e,t){g(e)&&(e=Ni(e));for(const n in e){const i=e[n];let a;a=k(i)?"default"in i?Hi(i.from||n,i.default,!0):Hi(i.from||n):Hi(i),St(a)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e}):t[n]=a}}(u,i,null),s)for(const r in s){const e=s[r];b(e)&&(i[r]=e.bind(n))}if(a){const t=a.call(n,n);k(t)&&(e.data=gt(t))}if(Ei=!0,o)for(const g in o){const e=o[g],t=b(e)?e.bind(n,n):b(e.get)?e.get.bind(n,n):r,a=!b(e)&&b(e.set)?e.set.bind(n):r,s=bo({get:t,set:a});Object.defineProperty(i,g,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(l)for(const r in l)Ai(l[r],i,n,r);if(c){const e=b(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{ji(t,e[t])})}function R(e,t){g(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(h&&Ii(h,e,"c"),R(Zn,d),R(ei,f),R(ti,p),R(ni,m),R(Gn,v),R(Yn,y),R(li,I),R(ri,E),R(si,S),R(ii,w),R(ai,T),R(oi,A),g(D))if(D.length){const t=e.exposed||(e.exposed={});D.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={});C&&e.render===r&&(e.render=C),null!=P&&(e.inheritAttrs=P),O&&(e.components=O),M&&(e.directives=M),A&&Hn(e)}function Ii(e,t,n){Yt(g(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ai(e,t,n,i){let a=i.includes(".")?va(n,i):()=>n[i];if(_(e)){const n=t[e];b(n)&&pa(a,n)}else if(b(e))pa(a,e.bind(n));else if(k(e))if(g(e))e.forEach(e=>Ai(e,t,n,i));else{const i=b(e.handler)?e.handler.bind(n):t[e.handler];b(i)&&pa(a,i,e)}}function Di(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:a,optionsCache:o,config:{optionMergeStrategies:s}}=e.appContext,r=o.get(t);let l;return r?l=r:a.length||n||i?(l={},a.length&&a.forEach(e=>Pi(l,e,s,!0)),Pi(l,t,s)):l=t,k(t)&&o.set(t,l),l}function Pi(e,t,n,i=!1){const{mixins:a,extends:o}=t;o&&Pi(e,o,n,!0),a&&a.forEach(t=>Pi(e,t,n,!0));for(const s in t)if(i&&"expose"===s);else{const i=Oi[s]||n&&n[s];e[s]=i?i(e[s],t[s]):t[s]}return e}const Oi={data:Mi,props:Vi,emits:Vi,methods:Li,computed:Li,beforeCreate:Ri,created:Ri,beforeMount:Ri,mounted:Ri,beforeUpdate:Ri,updated:Ri,beforeDestroy:Ri,beforeUnmount:Ri,destroyed:Ri,unmounted:Ri,activated:Ri,deactivated:Ri,errorCaptured:Ri,serverPrefetch:Ri,components:Li,directives:Li,watch:function(e,t){if(!e)return t;if(!t)return e;const n=h(Object.create(null),e);for(const i in t)n[i]=Ri(e[i],t[i]);return n},provide:Mi,inject:function(e,t){return Li(Ni(e),Ni(t))}};function Mi(e,t){return t?e?function(){return h(b(e)?e.call(this,this):e,b(t)?t.call(this,this):t)}:t:e}function Ni(e){if(g(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ri(e,t){return e?[...new Set([].concat(e,t))]:t}function Li(e,t){return e?h(Object.create(null),e,t):t}function Vi(e,t){return e?g(e)&&g(t)?[...new Set([...e,...t])]:h(Object.create(null),Ci(e),Ci(null!=t?t:{})):t}function qi(){return{app:null,config:{isNativeTag:l,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Fi=0;function Bi(e,t){return function(n,i=null){b(n)||(n=h({},n)),null==i||k(i)||(i=null);const a=qi(),o=new WeakSet,s=[];let r=!1;const l=a.app={_uid:Fi++,_component:n,_props:i,_container:null,_context:a,_instance:null,version:wo,get config(){return a.config},set config(e){},use:(e,...t)=>(o.has(e)||(e&&b(e.install)?(o.add(e),e.install(l,...t)):b(e)&&(o.add(e),e(l,...t))),l),mixin:e=>(a.mixins.includes(e)||a.mixins.push(e),l),component:(e,t)=>t?(a.components[e]=t,l):a.components[e],directive:(e,t)=>t?(a.directives[e]=t,l):a.directives[e],mount(o,s,c){if(!r){const u=l._ceVNode||za(n,i);return u.appContext=a,!0===c?c="svg":!1===c&&(c=void 0),s&&t?t(u,o):e(u,o,c),r=!0,l._container=o,o.__vue_app__=l,vo(u.component)}},onUnmount(e){s.push(e)},unmount(){r&&(Yt(s,l._instance,16),e(null,l._container),delete l._container.__vue_app__)},provide:(e,t)=>(a.provides[e]=t,l),runWithContext(e){const t=Ui;Ui=l;try{return e()}finally{Ui=t}}};return l}}let Ui=null;function ji(e,t){if(io){let n=io.provides;const i=io.parent&&io.parent.provides;i===n&&(n=io.provides=Object.create(i)),n[e]=t}else;}function Hi(e,t,n=!1){const i=io||hn;if(i||Ui){const a=Ui?Ui._context.provides:i?null==i.parent?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(a&&e in a)return a[e];if(arguments.length>1)return n&&b(t)?t.call(i&&i.proxy):t}}const zi={},Wi=()=>Object.create(zi),Ki=e=>Object.getPrototypeOf(e)===zi;function Gi(e,t,n,i){const[a,s]=e.propsOptions;let r,l=!1;if(t)for(let o in t){if(I(o))continue;const c=t[o];let u;a&&p(a,u=P(o))?s&&s.includes(u)?(r||(r={}))[u]=c:n[u]=c:wa(e.emitsOptions,o)||o in i&&c===i[o]||(i[o]=c,l=!0)}if(s){const t=xt(n),i=r||o;for(let o=0;o<s.length;o++){const r=s[o];n[r]=Yi(a,t,r,i[r],e,!p(i,r))}}return l}function Yi(e,t,n,i,a,o){const s=e[n];if(null!=s){const e=p(s,"default");if(e&&void 0===i){const e=s.default;if(s.type!==Function&&!s.skipFactory&&b(e)){const{propsDefaults:o}=a;if(n in o)i=o[n];else{const s=ro(a);i=o[n]=e.call(null,t),s()}}else i=e;a.ce&&a.ce._setProp(n,i)}s[0]&&(o&&!e?i=!1:!s[1]||""!==i&&i!==M(n)||(i=!0))}return i}const Qi=new WeakMap;function $i(e,t,n=!1){const i=n?Qi:t.propsCache,a=i.get(e);if(a)return a;const r=e.props,l={},c=[];let u=!1;if(!b(e)){const i=e=>{u=!0;const[n,i]=$i(e,t,!0);h(l,n),i&&c.push(...i)};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}if(!r&&!u)return k(e)&&i.set(e,s),s;if(g(r))for(let s=0;s<r.length;s++){const e=P(r[s]);Xi(e)&&(l[e]=o)}else if(r)for(const o in r){const e=P(o);if(Xi(e)){const t=r[o],n=l[e]=g(t)||b(t)?{type:t}:h({},t),i=n.type;let a=!1,s=!0;if(g(i))for(let e=0;e<i.length;++e){const t=i[e],n=b(t)&&t.name;if("Boolean"===n){a=!0;break}"String"===n&&(s=!1)}else a=b(i)&&"Boolean"===i.name;n[0]=a,n[1]=s,(a||p(n,"default"))&&c.push(e)}}const d=[l,c];return k(e)&&i.set(e,d),d}function Xi(e){return"$"!==e[0]&&!I(e)}const Ji=e=>"_"===e[0]||"$stable"===e,Zi=e=>g(e)?e.map($a):[$a(e)],ea=(e,t,n)=>{if(t._n)return t;const i=pn((...e)=>Zi(t(...e)),n);return i._c=!1,i},ta=(e,t,n)=>{const i=e._ctx;for(const a in e){if(Ji(a))continue;const n=e[a];if(b(n))t[a]=ea(0,n,i);else if(null!=n){const e=Zi(n);t[a]=()=>e}}},na=(e,t)=>{const n=Zi(t);e.slots.default=()=>n},ia=(e,t,n)=>{for(const i in t)(n||"_"!==i)&&(e[i]=t[i])},aa=function(e,t){t&&t.pendingBranch?g(e)?t.effects.push(...e):t.effects.push(e):(g(n=e)?Jt.push(...n):Zt&&-1===n.id?Zt.splice(en+1,0,n):1&n.flags||(Jt.push(n),n.flags|=1),sn());var n};function oa(e){return function(e){U().__VUE__=!0;const{insert:t,remove:n,patchProp:i,createElement:a,createText:l,createComment:c,setText:u,setElementText:h,parentNode:d,nextSibling:f,setScopeId:g=r,insertStaticContent:m}=e,v=(e,t,n,i=null,a=null,o=null,s=void 0,r=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!Ba(e,t)&&(i=J(e),G(e,a,o,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:u,shapeFlag:h}=t;switch(c){case Ia:y(e,t,n,i);break;case Aa:b(e,t,n,i);break;case Da:null==e&&_(t,n,i,s);break;case Sa:N(e,t,n,i,a,o,s,r,l);break;default:1&h?T(e,t,n,i,a,o,s,r,l):6&h?R(e,t,n,i,a,o,s,r,l):(64&h||128&h)&&c.process(e,t,n,i,a,o,s,r,l,te)}null!=u&&a&&zn(u,e&&e.ref,o,t||e,!t)},y=(e,n,i,a)=>{if(null==e)t(n.el=l(n.children),i,a);else{const t=n.el=e.el;n.children!==e.children&&u(t,n.children)}},b=(e,n,i,a)=>{null==e?t(n.el=c(n.children||""),i,a):n.el=e.el},_=(e,t,n,i)=>{[e.el,e.anchor]=m(e.children,t,n,i,e.el,e.anchor)},w=({el:e,anchor:n},i,a)=>{let o;for(;e&&e!==n;)o=f(e),t(e,i,a),e=o;t(n,i,a)},k=({el:e,anchor:t})=>{let i;for(;e&&e!==t;)i=f(e),n(e),e=i;n(t)},T=(e,t,n,i,a,o,s,r,l)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?C(t,n,i,a,o,s,r,l):A(e,t,a,o,s,r,l)},C=(e,n,o,s,r,l,c,u)=>{let d,f;const{props:p,shapeFlag:g,transition:m,dirs:v}=e;if(d=e.el=a(e.type,l,p&&p.is,p),8&g?h(d,e.children):16&g&&S(e.children,d,null,s,r,sa(e,l),c,u),v&&mn(e,null,s,"created"),E(d,e,e.scopeId,c,s),p){for(const e in p)"value"===e||I(e)||i(d,e,null,p[e],l,s);"value"in p&&i(d,"value",null,p.value,l),(f=p.onVnodeBeforeMount)&&eo(f,s,e)}v&&mn(e,null,s,"beforeMount");const y=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(r,m);y&&m.beforeEnter(d),t(d,n,o),((f=p&&p.onVnodeMounted)||y||v)&&aa(()=>{f&&eo(f,s,e),y&&m.enter(d),v&&mn(e,null,s,"mounted")},r)},E=(e,t,n,i,a)=>{if(n&&g(e,n),i)for(let o=0;o<i.length;o++)g(e,i[o]);if(a){let n=a.subTree;if(t===n||Ea(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=a.vnode;E(e,t,t.scopeId,t.slotScopeIds,a.parent)}}},S=(e,t,n,i,a,o,s,r,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=r?Xa(e[c]):$a(e[c]);v(null,l,t,n,i,a,o,s,r)}},A=(e,t,n,a,s,r,l)=>{const c=t.el=e.el;let{patchFlag:u,dynamicChildren:d,dirs:f}=t;u|=16&e.patchFlag;const p=e.props||o,g=t.props||o;let m;if(n&&ra(n,!1),(m=g.onVnodeBeforeUpdate)&&eo(m,n,t,e),f&&mn(t,e,n,"beforeUpdate"),n&&ra(n,!0),(p.innerHTML&&null==g.innerHTML||p.textContent&&null==g.textContent)&&h(c,""),d?D(e.dynamicChildren,d,c,n,a,sa(t,s),r):l||H(e,t,c,null,n,a,sa(t,s),r,!1),u>0){if(16&u)O(c,p,g,n,s);else if(2&u&&p.class!==g.class&&i(c,"class",null,g.class,s),4&u&&i(c,"style",p.style,g.style,s),8&u){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const a=e[t],o=p[a],r=g[a];r===o&&"value"!==a||i(c,a,o,r,s,n)}}1&u&&e.children!==t.children&&h(c,t.children)}else l||null!=d||O(c,p,g,n,s);((m=g.onVnodeUpdated)||f)&&aa(()=>{m&&eo(m,n,t,e),f&&mn(t,e,n,"updated")},a)},D=(e,t,n,i,a,o,s)=>{for(let r=0;r<t.length;r++){const l=e[r],c=t[r],u=l.el&&(l.type===Sa||!Ba(l,c)||70&l.shapeFlag)?d(l.el):n;v(l,c,u,null,i,a,o,s,!0)}},O=(e,t,n,a,s)=>{if(t!==n){if(t!==o)for(const o in t)I(o)||o in n||i(e,o,t[o],null,s,a);for(const o in n){if(I(o))continue;const r=n[o],l=t[o];r!==l&&"value"!==o&&i(e,o,l,r,s,a)}"value"in n&&i(e,"value",t.value,n.value,s)}},N=(e,n,i,a,o,s,r,c,u)=>{const h=n.el=e?e.el:l(""),d=n.anchor=e?e.anchor:l("");let{patchFlag:f,dynamicChildren:p,slotScopeIds:g}=n;g&&(c=c?c.concat(g):g),null==e?(t(h,i,a),t(d,i,a),S(n.children||[],i,d,o,s,r,c,u)):f>0&&64&f&&p&&e.dynamicChildren?(D(e.dynamicChildren,p,i,o,s,r,c),(null!=n.key||o&&n===o.subTree)&&la(e,n,!0)):H(e,n,i,d,o,s,r,c,u)},R=(e,t,n,i,a,o,s,r,l)=>{t.slotScopeIds=r,null==e?512&t.shapeFlag?a.ctx.activate(t,n,i,s,l):L(t,n,i,a,o,s,l):F(e,t,l)},L=(e,t,n,i,a,s,r)=>{const l=e.component=function(e,t,n){const i=e.type,a=(t?t.appContext:e.appContext)||to,s={uid:no++,vnode:e,type:i,parent:t,appContext:a,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new oe(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(a.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:$i(i,a),emitsOptions:_a(i,a),emit:null,emitted:null,propsDefaults:o,inheritAttrs:i.inheritAttrs,ctx:o,data:o,props:o,attrs:o,slots:o,refs:o,setupState:o,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};s.ctx={_:s},s.root=t?t.root:s,s.emit=ba.bind(null,s),e.ce&&e.ce(s);return s}(e,i,a);if(Kn(e)&&(l.ctx.renderer=te),function(e,t=!1,n=!1){t&&so(t);const{props:i,children:a}=e.vnode,o=co(e);(function(e,t,n,i=!1){const a={},o=Wi();e.propsDefaults=Object.create(null),Gi(e,t,a,o);for(const s in e.propsOptions[0])s in a||(a[s]=void 0);n?e.props=i?a:mt(a):e.type.props?e.props=a:e.props=o,e.attrs=o}
21)(e,i,o,t),((e,t,n)=>{const i=e.slots=Wi();if(32&e.vnode.shapeFlag){const e=t._;e?(ia(i,t,n),n&&q(i,"_",e,!0)):ta(t,i)}else t&&na(e,t)})(e,a,n);const s=o?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ki);const{setup:i}=n;if(i){Ce();const n=e.setupContext=i.length>1?mo(e):null,a=ro(e),o=Gt(i,e,0,[e.props,n]),s=x(o);if(Ee(),a(),!s&&!e.sp||Wn(e)||Hn(e),s){if(o.then(lo,lo),t)return o.then(n=>{fo(e,n,t)}).catch(t=>{Qt(t,e,0)});e.asyncDep=o}else fo(e,o,t)}else po(e,t)}(e,t):void 0;t&&so(!1)}(l,!1,r),l.asyncDep){if(a&&a.registerDep(l,B,r),!e.el){const e=l.subTree=za(Aa);b(null,e,t,n)}}else B(l,e,t,n,a,s,r)},F=(e,t,n)=>{const i=t.component=e.component;if(function(e,t,n){const{props:i,children:a,component:o}=e,{props:s,children:r,patchFlag:l}=t,c=o.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!a&&!r||r&&r.$stable)||i!==s&&(i?!s||Ca(i,s,c):!!s);if(1024&l)return!0;if(16&l)return i?Ca(i,s,c):!!s;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(s[n]!==i[n]&&!wa(c,n))return!0}}return!1}(e,t,n)){if(i.asyncDep&&!i.asyncResolved)return void j(i,t,n);i.next=t,i.update()}else t.el=e.el,i.vnode=t},B=(e,t,n,i,a,o,s)=>{const r=()=>{if(e.isMounted){let{next:t,bu:n,u:i,parent:l,vnode:c}=e;{const n=ca(e);if(n)return t&&(t.el=c.el,j(e,t,s)),void n.asyncDep.then(()=>{e.isUnmounted||r()})}let u,h=t;ra(e,!1),t?(t.el=c.el,j(e,t,s)):t=c,n&&V(n),(u=t.props&&t.props.onVnodeBeforeUpdate)&&eo(u,l,t,c),ra(e,!0);const f=ka(e),p=e.subTree;e.subTree=f,v(p,f,d(p.el),J(p),e,a,o),t.el=f.el,null===h&&function({vnode:e,parent:t},n){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.el=e.el),i!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,f.el),i&&aa(i,a),(u=t.props&&t.props.onVnodeUpdated)&&aa(()=>eo(u,l,t,c),a)}else{let s;const{el:r,props:l}=t,{bm:c,m:u,parent:h,root:d,type:f}=e,p=Wn(t);
vendor: 11,139 bytes, line 21
21if(ra(e,!1),c&&V(c),!p&&(s=l&&l.onVnodeBeforeMount)&&eo(s,h,t),ra(e,!0),r&&ie){const t=()=>{e.subTree=ka(e),ie(r,e.subTree,e,a,null)};p&&f.__asyncHydrate?f.__asyncHydrate(r,e,t):t()}else{d.ce&&d.ce._injectChildStyle(f);const s=e.subTree=ka(e);v(null,s,n,i,e,a,o),t.el=s.el}if(u&&aa(u,a),!p&&(s=l&&l.onVnodeMounted)){const e=t;aa(()=>eo(s,h,e),a)}(256&t.shapeFlag||h&&Wn(h.vnode)&&256&h.vnode.shapeFlag)&&e.a&&aa(e.a,a),e.isMounted=!0,t=n=i=null}};e.scope.on();const l=e.effect=new ue(r);e.scope.off();const c=e.update=l.run.bind(l),u=e.job=l.runIfDirty.bind(l);u.i=e,u.id=e.uid,l.scheduler=()=>on(u),ra(e,!0),c()},j=(e,t,n)=>{t.component=e;const i=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,i){const{props:a,attrs:o,vnode:{patchFlag:s}}=e,r=xt(a),[l]=e.propsOptions;let c=!1;if(!(i||s>0)||16&s){let i;Gi(e,t,a,o)&&(c=!0);for(const o in r)t&&(p(t,o)||(i=M(o))!==o&&p(t,i))||(l?!n||void 0===n[o]&&void 0===n[i]||(a[o]=Yi(l,r,o,void 0,e,!0)):delete a[o]);if(o!==r)for(const e in o)t&&p(t,e)||(delete o[e],c=!0)}else if(8&s){const n=e.vnode.dynamicProps;for(let i=0;i<n.length;i++){let s=n[i];if(wa(e.emitsOptions,s))continue;const u=t[s];if(l)if(p(o,s))u!==o[s]&&(o[s]=u,c=!0);else{const t=P(s);a[t]=Yi(l,r,t,u,e,!1)}else u!==o[s]&&(o[s]=u,c=!0)}}c&&Ve(e.attrs,"set","")}(e,t.props,i,n),((e,t,n)=>{const{vnode:i,slots:a}=e;let s=!0,r=o;if(32&i.shapeFlag){const e=t._;e?n&&1===e?s=!1:ia(a,t,n):(s=!t.$stable,ta(t,a)),r=t}else t&&(na(e,t),r={default:1});if(s)for(const o in a)Ji(o)||null!=r[o]||delete a[o]})(e,t.children,n),Ce(),rn(e),Ee()},H=(e,t,n,i,a,o,s,r,l=!1)=>{const c=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:p}=t;if(f>0){if(128&f)return void W(c,d,n,i,a,o,s,r,l);if(256&f)return void z(c,d,n,i,a,o,s,r,l)}8&p?(16&u&&X(c,a,o),d!==c&&h(n,d)):16&u?16&p?W(c,d,n,i,a,o,s,r,l):X(c,a,o,!0):(8&u&&h(n,""),16&p&&S(d,n,i,a,o,s,r,l))},z=(e,t,n,i,a,o,r,l,c)=>{t=t||s;const u=(e=e||s).length,h=t.length,d=Math.min(u,h);let f;for(f=0;f<d;f++){const i=t[f]=c?Xa(t[f]):$a(t[f]);v(e[f],i,n,null,a,o,r,l,c)}u>h?X(e,a,o,!0,!1,d):S(t,n,i,a,o,r,l,c,d)},W=(e,t,n,i,a,o,r,l,c)=>{let u=0;const h=t.length;let d=e.length-1,f=h-1;for(;u<=d&&u<=f;){const i=e[u],s=t[u]=c?Xa(t[u]):$a(t[u]);if(!Ba(i,s))break;v(i,s,n,null,a,o,r,l,c),u++}for(;u<=d&&u<=f;){const i=e[d],s=t[f]=c?Xa(t[f]):$a(t[f]);if(!Ba(i,s))break;v(i,s,n,null,a,o,r,l,c),d--,f--}if(u>d){if(u<=f){const e=f+1,s=e<h?t[e].el:i;for(;u<=f;)v(null,t[u]=c?Xa(t[u]):$a(t[u]),n,s,a,o,r,l,c),u++}}else if(u>f)for(;u<=d;)G(e[u],a,o,!0),u++;else{const p=u,g=u,m=new Map;for(u=g;u<=f;u++){const e=t[u]=c?Xa(t[u]):$a(t[u]);null!=e.key&&m.set(e.key,u)}let y,b=0;const _=f-g+1;let w=!1,k=0;const x=new Array(_);for(u=0;u<_;u++)x[u]=0;for(u=p;u<=d;u++){const i=e[u];if(b>=_){G(i,a,o,!0);continue}let s;if(null!=i.key)s=m.get(i.key);else for(y=g;y<=f;y++)if(0===x[y-g]&&Ba(i,t[y])){s=y;break}void 0===s?G(i,a,o,!0):(x[s-g]=u+1,s>=k?k=s:w=!0,v(i,t[s],n,null,a,o,r,l,c),b++)}const T=w?function(e){const t=e.slice(),n=[0];let i,a,o,s,r;const l=e.length;for(i=0;i<l;i++){const l=e[i];if(0!==l){if(a=n[n.length-1],e[a]<l){t[i]=a,n.push(i);continue}for(o=0,s=n.length-1;o<s;)r=o+s>>1,e[n[r]]<l?o=r+1:s=r;l<e[n[o]]&&(o>0&&(t[i]=n[o-1]),n[o]=i)}}o=n.length,s=n[o-1];for(;o-- >0;)n[o]=s,s=t[s];return n}(x):s;for(y=T.length-1,u=_-1;u>=0;u--){const e=g+u,s=t[e],d=e+1<h?t[e+1].el:i;0===x[u]?v(null,s,n,d,a,o,r,l,c):w&&(y<0||u!==T[y]?K(s,n,d,2):y--)}}},K=(e,n,i,a,o=null)=>{const{el:s,type:r,transition:l,children:c,shapeFlag:u}=e;if(6&u)return void K(e.component.subTree,n,i,a);if(128&u)return void e.suspense.move(n,i,a);if(64&u)return void r.move(e,n,i,te);if(r===Sa){t(s,n,i);for(let e=0;e<c.length;e++)K(c[e],n,i,a);return void t(e.anchor,n,i)}if(r===Da)return void w(e,n,i);if(2!==a&&1&u&&l)if(0===a)l.beforeEnter(s),t(s,n,i),aa(()=>l.enter(s),o);else{const{leave:e,delayLeave:a,afterLeave:o}=l,r=()=>t(s,n,i),c=()=>{e(s,()=>{r(),o&&o()})};a?a(s,r,c):c()}else t(s,n,i)},G=(e,t,n,i=!1,a=!1)=>{const{type:o,props:s,ref:r,children:l,dynamicChildren:c,shapeFlag:u,patchFlag:h,dirs:d,cacheIndex:f}=e;if(-2===h&&(a=!1),null!=r&&zn(r,null,n,e,!0),null!=f&&(t.renderCache[f]=void 0),256&u)return void t.ctx.deactivate(e);const p=1&u&&d,g=!Wn(e);let m;if(g&&(m=s&&s.onVnodeBeforeUnmount)&&eo(m,t,e),6&u)$(e.component,n,i);else{if(128&u)return void e.suspense.unmount(n,i);p&&mn(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,te,i):c&&!c.hasOnce&&(o!==Sa||h>0&&64&h)?X(c,t,n,!1,!0):(o===Sa&&384&h||!a&&16&u)&&X(l,t,n),i&&Y(e)}(g&&(m=s&&s.onVnodeUnmounted)||p)&&aa(()=>{m&&eo(m,t,e),p&&mn(e,null,t,"unmounted")},n)},Y=e=>{const{type:t,el:i,anchor:a,transition:o}=e;if(t===Sa)return void Q(i,a);if(t===Da)return void k(e);const s=()=>{n(i),o&&!o.persisted&&o.afterLeave&&o.afterLeave()};if(1&e.shapeFlag&&o&&!o.persisted){const{leave:t,delayLeave:n}=o,a=()=>t(i,s);n?n(e.el,s,a):a()}else s()},Q=(e,t)=>{let i;for(;e!==t;)i=f(e),n(e),e=i;n(t)},$=(e,t,n)=>{const{bum:i,scope:a,job:o,subTree:s,um:r,m:l,a:c}=e;ua(l),ua(c),i&&V(i),a.stop(),o&&(o.flags|=8,G(s,e,t,n)),r&&aa(r,t),aa(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},X=(e,t,n,i=!1,a=!1,o=0)=>{for(let s=o;s<e.length;s++)G(e[s],t,n,i,a)},J=e=>{if(6&e.shapeFlag)return J(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=f(e.anchor||e.el),n=t&&t[vn];return n?f(n):t};let Z=!1;const ee=(e,t,n)=>{null==e?t._vnode&&G(t._vnode,null,null,!0):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,Z||(Z=!0,rn(),ln(),Z=!1)},te={p:v,um:G,m:K,r:Y,mt:L,mc:S,pc:H,pbc:D,n:J,o:e};let ne,ie;return{render:ee,hydrate:ne,createApp:Bi(ee,ne)}}(e)}function sa({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function ra({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function la(e,t,n=!1){const i=e.children,a=t.children;if(g(i)&&g(a))for(let o=0;o<i.length;o++){const e=i[o];let t=a[o];1&t.shapeFlag&&!t.dynamicChildren&&((t.patchFlag<=0||32===t.patchFlag)&&(t=a[o]=Xa(a[o]),t.el=e.el),n||-2===t.patchFlag||la(e,t)),t.type===Ia&&(t.el=e.el)}}function ca(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ca(t)}function ua(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const ha=Symbol.for("v-scx"),da=()=>Hi(ha);function fa(e,t){return ga(e,null,t)}function pa(e,t,n){return ga(e,t,n)}function ga(e,t,n=o){const{immediate:i,deep:a,flush:s,once:l}=n,c=h({},n),u=t&&i||!t&&"post"!==s;let d;if(ho)if("sync"===s){const e=da();d=e.__watcherHandles||(e.__watcherHandles=[])}else if(!u){const e=()=>{};return e.stop=r,e.resume=r,e.pause=r,e}const f=io;c.call=(e,t,n)=>Yt(e,f,t,n);let p=!1;"post"===s?c.scheduler=e=>{aa(e,f&&f.suspense)}:"sync"!==s&&(p=!0,c.scheduler=(e,t)=>{t?e():on(e)}),c.augmentJob=e=>{t&&(e.flags|=4),p&&(e.flags|=2,f&&(e.id=f.uid,e.i=f))};const g=Wt(e,t,c);return ho&&(d?d.push(g):u&&g()),g}function ma(e,t,n){const i=this.proxy,a=_(e)?e.includes(".")?va(i,e):()=>i[e]:e.bind(i,i);let o;b(t)?o=t:(o=t.handler,n=t);const s=ro(this),r=ga(a,o.bind(i),n);return s(),r}function va(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}const ya=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e["".concat(t,"Modifiers")]||e["".concat(P(t),"Modifiers")]||e["".concat(M(t),"Modifiers")];function ba(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||o;let a=n;const s=t.startsWith("update:"),r=s&&ya(i,t.slice(7));let l;r&&(r.trim&&(a=n.map(e=>_(e)?e.trim():e)),r.number&&(a=n.map(F)));let c=i[l=R(t)]||i[l=R(P(t))];!c&&s&&(c=i[l=R(M(t))]),c&&Yt(c,e,6,a);const u=i[l+"Once"];if(u){if(e.emitted){if(e.emitted[l])return}else e.emitted={};e.emitted[l]=!0,Yt(u,e,6,a)}}function _a(e,t,n=!1){const i=t.emitsCache,a=i.get(e);if(void 0!==a)return a;const o=e.emits;let s={},r=!1;if(!b(e)){const i=e=>{const n=_a(e,t,!0);n&&(r=!0,h(s,n))};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}return o||r?(g(o)?o.forEach(e=>s[e]=null):h(s,o),k(e)&&i.set(e,s),s):(k(e)&&i.set(e,null),null)}function wa(e,t){return!(!e||!c(t))&&(t=t.slice(2).replace(/Once$/,""),p(e,t[0].toLowerCase()+t.slice(1))||p(e,M(t))||p(e,t))}function ka(e){const{type:t,vnode:n,proxy:i,withProxy:a,propsOptions:[o],slots:s,attrs:r,emit:l,render:c,renderCache:h,props:d,data:f,setupState:p,ctx:g,inheritAttrs:m}=e,v=fn(e);let y,b;try{if(4&n.shapeFlag){const e=a||i,t=e;y=$a(c.call(t,e,h,d,p,f,g)),b=r}else{const e=t;0,y=$a(e.length>1?e(d,{attrs:r,slots:s,emit:l}):e(d,null)),b=t.props?r:xa(r)}}catch(w){Pa.length=0,Qt(w,e,1),y=za(Aa)}let _=y;if(b&&!1!==m){const e=Object.keys(b),{shapeFlag:t}=_;e.length&&7&t&&(o&&e.some(u)&&(b=Ta(b,o)),_=Ka(_,b,!1,!0))}return n.dirs&&(_=Ka(_,null,!1,!0),_.dirs=_.dirs?_.dirs.concat(n.dirs):n.dirs),n.transition&&Bn(_,n.transition),y=_,fn(v),y}const xa=e=>{let t;for(const n in e)("class"===n||"style"===n||c(n))&&((t||(t={}))[n]=e[n]);return t},Ta=(e,t)=>{const n={};for(const i in e)u(i)&&i.slice(9)in t||(n[i]=e[i]);return n};function Ca(e,t,n){const i=Object.keys(t);if(i.length!==Object.keys(e).length)return!0;for(let a=0;a<i.length;a++){const o=i[a];if(t[o]!==e[o]&&!wa(n,o))return!0}return!1}const Ea=e=>e.__isSuspense;const Sa=Symbol.for("v-fgt"),Ia=Symbol.for("v-txt"),Aa=Symbol.for("v-cmt"),Da=Symbol.for("v-stc"),Pa=[];let Oa=null;function Ma(e=!1){Pa.push(Oa=e?null:[])}let Na=1;function Ra(e,t=!1){Na+=e,e<0&&Oa&&t&&(Oa.hasOnce=!0)}function La(e){return e.dynamicChildren=Na>0?Oa||s:null,Pa.pop(),Oa=Pa[Pa.length-1]||null,Na>0&&Oa&&Oa.push(e),e}function Va(e,t,n,i,a,o){return La(Ha(e,t,n,i,a,o,!0))}function qa(e,t,n,i,a){return La(za(e,t,n,i,a,!0))}function Fa(e){return!!e&&!0===e.__v_isVNode}function Ba(e,t){return e.type===t.type&&e.key===t.key}const Ua=({key:e})=>null!=e?e:null,ja=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?_(e)||St(e)||b(e)?{i:hn,r:e,k:t,f:!!n}:e:null);function Ha(e,t=null,n=null,i=0,a=null,o=(e===Sa?0:1),s=!1,r=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ua(t),ref:t&&ja(t),scopeId:dn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:i,dynamicProps:a,dynamicChildren:null,appContext:null,ctx:hn};return r?(Ja(l,n),128&o&&e.normalize(l)):n&&(l.shapeFlag|=_(n)?8:16),Na>0&&!s&&Oa&&(l.patchFlag>0||6&o)&&32!==l.patchFlag&&Oa.push(l),l}const za=function(e,t=null,n=null,i=0,a=null,o=!1){e&&e!==hi||(e=Aa);if(Fa(e)){const i=Ka(e,t,!0);return n&&Ja(i,n),Na>0&&!o&&Oa&&(6&i.shapeFlag?Oa[Oa.indexOf(e)]=i:Oa.push(i)),i.patchFlag=-2,i}s=e,b(s)&&"__vccOpts"in s&&(e=e.__vccOpts);var s;if(t){t=Wa(t);let{class:e,style:n}=t;e&&!_(e)&&(t.class=G(e)),k(n)&&(kt(n)&&!g(n)&&(n=h({},n)),t.style=j(n))}const r=_(e)?1:Ea(e)?128:yn(e)?64:k(e)?4:b(e)?2:0;return Ha(e,t,n,i,a,r,o,!0)};function Wa(e){return e?kt(e)||Ki(e)?h({},e):e:null}function Ka(e,t,n=!1,i=!1){const{props:a,ref:o,patchFlag:s,children:r,transition:l}=e,c=t?Za(a||{}
21,t):a,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Ua(c),ref:t&&t.ref?n&&o?g(o)?o.concat(ja(t)):[o,ja(t)]:ja(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:r,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Sa?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ka(e.ssContent),ssFallback:e.ssFallback&&Ka(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&i&&Bn(u,l.clone(u)),u}function Ga(e=" ",t=0){return za(Ia,null,e,t)}function Ya(e,t){const n=za(Da,null,e);return n.staticCount=t,n}function Qa(e="",t=!1){return t?(Ma(),qa(Aa,null,e)):za(Aa,null,e)}function $a(e){return null==e||"boolean"==typeof e?za(Aa):g(e)?za(Sa,null,e.slice()):Fa(e)?Xa(e):za(Ia,null,String(e))}function Xa(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Ka(e)}function Ja(e,t){let n=0;const{shapeFlag:i}=e;if(null==t)t=null;else if(g(t))n=16;else if("object"==typeof t){if(65&i){const n=t.default;return void(n&&(n._c&&(n._d=!1),Ja(e,n()),n._c&&(n._d=!0)))}{n=32;const i=t._;i||Ki(t)?3===i&&hn&&(1===hn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=hn}}else b(t)?(t={default:t,_ctx:hn},n=32):(t=String(t),64&i?(n=16,t=[Ga(t)]):n=8);e.children=t,e.shapeFlag|=n}function Za(...e){const t={};for(let n=0;n<e.length;n++){const i=e[n];for(const e in i)if("class"===e)t.class!==i.class&&(t.class=G([t.class,i.class]));else if("style"===e)t.style=j([t.style,i.style]);else if(c(e)){const n=t[e],a=i[e];!a||n===a||g(n)&&n.includes(a)||(t[e]=n?[].concat(n,a):a)}else""!==e&&(t[e]=i[e])}return t}function eo(e,t,n,i=null){Yt(e,t,7,[n,i])}const to=qi();let no=0;let io=null;const ao=()=>io||hn;let oo,so;{const e=U(),t=(t,n)=>{let i;return(i=e[t])||(i=e[t]=[]),i.push(n),e=>{i.length>1?i.forEach(t=>t(e)):i[0](e)}};oo=t("__VUE_INSTANCE_SETTERS__",e=>io=e),so=t("__VUE_SSR_SETTERS__",e=>ho=e)}const ro=e=>{const t=io;return oo(e),e.scope.on(),()=>{e.scope.off(),oo(t)}},lo=()=>{io&&io.scope.off(),oo(null)};function co(e){return 4&e.vnode.shapeFlag}let uo,ho=!1;function fo(e,t,n){b(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:k(t)&&(e.setupState=Rt(t)),po(e,n)}function po(e,t,n){const i=e.type;if(!e.render){if(!t&&uo&&!i.render){const t=i.template||Di(e).template;if(t){const{isCustomElement:n,compilerOptions:a}=e.appContext.config,{delimiters:o,compilerOptions:s}=i,r=h(h({isCustomElement:n,delimiters:o},a),s);i.render=uo(t,r)}}e.render=i.render||r}{const t=ro(e);Ce();try{Si(e)}finally{Ee(),t()}}}const go={get:(e,t)=>(Le(e,0,""),e[t])};function mo(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,go),slots:e.slots,emit:e.emit,expose:t}}function vo(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Rt(Tt(e.exposed)),{get:(t,n)=>n in t?t[n]:n in _i?_i[n](e):void 0,has:(e,t)=>t in e||t in _i})):e.proxy}function yo(e,t=!0){return b(e)?e.displayName||e.name:e.name||t&&e.__name}const bo=(e,t)=>{const n=function(e,t,n=!1){let i,a;return b(e)?i=e:(i=e.get,a=e.set),new Ut(i,a,n)}(e,0,ho);return n};function _o(e,t,n){const i=arguments.length;return 2===i?k(t)&&!g(t)?Fa(t)?za(e,null,[t]):za(e,t):za(e,null,t):(i>3?n=Array.prototype.slice.call(arguments,2):3===i&&Fa(n)&&(n=[n]),za(e,t,n))}const wo="3.5.13"; 22/** 23* @vue/runtime-dom v3.5.13 24* (c) 2018-present Yuxi (Evan) You and Vue contributors 25* @license MIT
26**/let ko;const xo="undefined"!=typeof window&&window.trustedTypes;if(xo)try{ko=xo.createPolicy("vue",{createHTML:e=>e})}catch(ZNe){}const To=ko?e=>ko.createHTML(e):e=>e,Co="undefined"!=typeof document?document:null,Eo=Co&&Co.createElement("template"),So={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const a="svg"===t?Co.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?Co.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?Co.createElement(e,{is:n}):Co.createElement(e);return"select"===e&&i&&null!=i.multiple&&a.setAttribute("multiple",i.multiple),a},createText:e=>Co.createTextNode(e),createComment:e=>Co.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Co.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,a,o){const s=n?n.previousSibling:t.lastChild;if(a&&(a===o||a.nextSibling))for(;t.insertBefore(a.cloneNode(!0),n),a!==o&&(a=a.nextSibling););else{Eo.innerHTML=To("svg"===i?"<svg>".concat(e,"</svg>"):"mathml"===i?"<math>".concat(e,"</math>"):e);const a=Eo.content;if("svg"===i||"mathml"===i){const e=a.firstChild;for(;e.firstChild;)a.appendChild(e.firstChild);a.removeChild(e)}t.insertBefore(a,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Io="transition",Ao="animation",Do=Symbol("_vtc"),Po={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Oo=h({},On,Po),Mo=(e=>(e.displayName="Transition",e.props=Oo,e))((e,{slots:t})=>_o(Rn,function(e){const t={};for(const h in e)h in Po||(t[h]=e[h]);if(!1===e.css)return t;const{name:n="v",type:i,duration:a,enterFromClass:o="".concat(n,"-enter-from"),enterActiveClass:s="".concat(n,"-enter-active"),enterToClass:r="".concat(n,"-enter-to"),appearFromClass:l=o,appearActiveClass:c=s,appearToClass:u=r,leaveFromClass:d="".concat(n,"-leave-from"),leaveActiveClass:f="".concat(n,"-leave-active"),leaveToClass:p="".concat(n,"-leave-to")}=e,g=function(e){if(null==e)return null;if(k(e))return[Lo(e.enter),Lo(e.leave)];{const t=Lo(e);return[t,t]}}(a),m=g&&g[0],v=g&&g[1],{onBeforeEnter:y,onEnter:b,onEnterCancelled:_,onLeave:w,onLeaveCancelled:x,onBeforeAppear:T=y,onAppear:C=b,onAppearCancelled:E=_}=t,S=(e,t,n,i)=>{e._enterCancelled=i,qo(e,t?u:r),qo(e,t?c:s),n&&n()},I=(e,t)=>{e._isLeaving=!1,qo(e,d),qo(e,p),qo(e,f),t&&t()},A=e=>(t,n)=>{const a=e?C:b,s=()=>S(t,e,n);No(a,[t,s]),Fo(()=>{qo(t,e?l:o),Vo(t,e?u:r),Ro(a)||Uo(t,i,m,s)})};return h(t,{onBeforeEnter(e){No(y,[e]),Vo(e,o),Vo(e,s)},onBeforeAppear(e){No(T,[e]),Vo(e,l),Vo(e,c)},onEnter:A(!1),onAppear:A(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>I(e,t);Vo(e,d),e._enterCancelled?(Vo(e,f),zo()):(zo(),Vo(e,f)),Fo(()=>{e._isLeaving&&(qo(e,d),Vo(e,p),Ro(w)||Uo(e,i,v,n))}),No(w,[e,n])},onEnterCancelled(e){S(e,!1,void 0,!0),No(_,[e])},onAppearCancelled(e){S(e,!0,void 0,!0),No(E,[e])},onLeaveCancelled(e){I(e),No(x,[e])}})}(e),t)),No=(e,t=[])=>{g(e)?e.forEach(e=>e(...t)):e&&e(...t)},Ro=e=>!!e&&(g(e)?e.some(e=>e.length>1):e.length>1);function Lo(e){const t=(e=>{const t=_(e)?Number(e):NaN;return isNaN(t)?e:t})(e);return t}function Vo(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Do]||(e[Do]=new Set)).add(t)}function qo(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));const n=e[Do];n&&(n.delete(t),n.size||(e[Do]=void 0))}function Fo(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Bo=0;function Uo(e,t,n,i){const a=e._endId=++Bo,o=()=>{a===e._endId&&i()};if(null!=n)return setTimeout(o,n);const{type:s,timeout:r,propCount:l}=function(e,t){const n=window.getComputedStyle(e),i=e=>(n[e]||"").split(", "),a=i("".concat(Io,"Delay")),o=i("".concat(Io,"Duration")),s=jo(a,o),r=i("".concat(Ao,"Delay")),l=i("".concat(Ao,"Duration")),c=jo(r,l);let u=null,h=0,d=0;t===Io?s>0&&(u=Io,h=s,d=o.length):t===Ao?c>0&&(u=Ao,h=c,d=l.length):(h=Math.max(s,c),u=h>0?s>c?Io:Ao:null,d=u?u===Io?o.length:l.length:0);const f=u===Io&&/\b(transform|all)(,|$)/.test(i("".concat(Io,"Property")).toString());return{type:u,timeout:h,propCount:d,hasTransform:f}}(e,t);if(!s)return i();const c=s+"end";let u=0;const h=()=>{e.removeEventListener(c,d),o()},d=t=>{t.target===e&&++u>=l&&h()};setTimeout(()=>{u<l&&h()},r+1),e.addEventListener(c,d)}function jo(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>Ho(t)+Ho(e[n])))}function Ho(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function zo(){return document.body.offsetHeight}const Wo=Symbol("_vod"),Ko=Symbol("_vsh"),Go={beforeMount(e,{value:t},{transition:n}){e[Wo]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):Yo(e,t)}
26,mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:i}){!t!=!n&&(i?t?(i.beforeEnter(e),Yo(e,!0),i.enter(e)):i.leave(e,()=>{Yo(e,!1)}):Yo(e,t))},beforeUnmount(e,{value:t}){Yo(e,t)}};function Yo(e,t){e.style.display=t?e[Wo]:"none",e[Ko]=!t}const Qo=Symbol(""),$o=/(^|;)\s*display\s*:/;const Xo=/\s*!important$/;function Jo(e,t,n){if(g(n))n.forEach(n=>Jo(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=function(e,t){const n=es[t];if(n)return n;let i=P(t);if("filter"!==i&&i in e)return es[t]=i;i=N(i);for(let a=0;a<Zo.length;a++){const n=Zo[a]+i;if(n in e)return es[t]=n}return t}(e,t);Xo.test(n)?e.setProperty(M(i),n.replace(Xo,""),"important"):e[i]=n}}const Zo=["Webkit","Moz","ms"],es={};const ts="http://www.w3.org/1999/xlink";function ns(e,t,n,i,a,o=Q(t)){i&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(ts,t.slice(6,t.length)):e.setAttributeNS(ts,t,n):null==n||o&&!$(n)?e.removeAttribute(t):e.setAttribute(t,o?"":w(n)?String(n):n)}function is(e,t,n,i,a){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?To(n):n));const o=e.tagName;if("value"===t&&"PROGRESS"!==o&&!o.includes("-")){const i="OPTION"===o?e.getAttribute("value")||"":e.value,a=null==n?"checkbox"===e.type?"on":"":String(n);return i===a&&"_value"in e||(e.value=a),null==n&&e.removeAttribute(t),void(e._value=n)}let s=!1;if(""===n||null==n){const i=typeof e[t];"boolean"===i?n=$(n):null==n&&"string"===i?(n="",s=!0):"number"===i&&(n=0,s=!0)}try{e[t]=n}catch(ZNe){}s&&e.removeAttribute(a||t)}function as(e,t,n,i){e.addEventListener(t,n,i)}const os=Symbol("_vei");function ss(e,t,n,i,a=null){const o=e[os]||(e[os]={}),s=o[t];if(i&&s)s.value=i;else{const[n,r]=function(e){let t;if(rs.test(e)){let n;for(t={};n=e.match(rs);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}const n=":"===e[2]?e.slice(3):M(e.slice(2));return[n,t]}(t);if(i){const s=o[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();Yt(function(e,t){if(g(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=us(),n}(i,a);as(e,n,s,r)}else s&&(!function(e,t,n,i){e.removeEventListener(t,n,i)}(e,n,s,r),o[t]=void 0)}}const rs=/(?:Once|Passive|Capture)$/;let ls=0;const cs=Promise.resolve(),us=()=>ls||(cs.then(()=>ls=0),ls=Date.now());const hs=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;const ds=e=>{const t=e.props["onUpdate:modelValue"]||!1;return g(t)?e=>V(t,e):t};function fs(e){e.target.composing=!0}function ps(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const gs=Symbol("_assign"),ms={created(e,{modifiers:{lazy:t,trim:n,number:i}},a){e[gs]=ds(a);const o=i||a.props&&"number"===a.props.type;as(e,t?"change":"input",t=>{if(t.target.composing)return;let i=e.value;n&&(i=i.trim()),o&&(i=F(i)),e[gs](i)}),n&&as(e,"change",()=>{e.value=e.value.trim()}),t||(as(e,"compositionstart",fs),as(e,"compositionend",ps),as(e,"change",ps))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:i,trim:a,number:o}},s){if(e[gs]=ds(s),e.composing)return;const r=null==t?"":t;if((!o&&"number"!==e.type||/^0\d/.test(e.value)?e.value:F(e.value))!==r){if(document.activeElement===e&&"range"!==e.type){if(i&&t===n)return;if(a&&e.value.trim()===r)return}e.value=r}}},vs={deep:!0,created(e,t,n){e[gs]=ds(n),as(e,"change",()=>{const t=e._modelValue,n=ks(e),i=e.checked,a=e[gs];if(g(t)){const e=J(t,n),o=-1!==e;if(i&&!o)a(t.concat(n));else if(!i&&o){const n=[...t];n.splice(e,1),a(n)}}else if(v(t)){const e=new Set(t);i?e.add(n):e.delete(n),a(e)}else a(xs(e,i))})},mounted:ys,beforeUpdate(e,t,n){e[gs]=ds(n),ys(e,t,n)}};function ys(e,{value:t,oldValue:n},i){let a;if(e._modelValue=t,g(t))a=J(t,i.props.value)>-1;else if(v(t))a=t.has(i.props.value);else{if(t===n)return;a=X(t,xs(e,!0))}e.checked!==a&&(e.checked=a)}const bs={created(e,{value:t},n){e.checked=X(t,n.props.value),e[gs]=ds(n),as(e,"change",()=>{e[gs](ks(e))})},beforeUpdate(e,{value:t,oldValue:n},i){e[gs]=ds(i),t!==n&&(e.checked=X(t,i.props.value))}},_s={deep:!0,created(e,{value:t,modifiers:{number:n}},i){const a=v(t);as(e,"change",()=>{const t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?F(ks(e)):ks(e));e[gs](e.multiple?a?new Set(t):t:t[0]),e._assigning=!0,an(()=>{e._assigning=!1})}),e[gs]=ds(i)},mounted(e,{value:t}){ws(e,t)},beforeUpdate(e,t,n){e[gs]=ds(n)},updated(e,{value:t}){e._assigning||ws(e,t)}};function ws(e,t){const n=e.multiple,i=g(t);if(!n||i||v(t)){for(let a=0,o=e.options.length;a<o;a++){const o=e.options[a],s=ks(o);if(n)if(i){const e=typeof s;o.selected="string"===e||"number"===e?t.some(e=>String(e)===String(s)):J(t,s)>-1}else o.selected=t.has(s);else if(X(ks(o),t))return void(e.selectedIndex!==a&&(e.selectedIndex=a))}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function ks(e){return"_value"in e?e._value:e.value}function xs(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Ts=["ctrl","shift","alt","meta"],Cs={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>
vendor: 4,329 bytes, lines 26-32
26Ts.some(n=>e["".concat(n,"Key")]&&!t.includes(n))},Es=(e,t)=>{const n=e._withMods||(e._withMods={}),i=t.join(".");return n[i]||(n[i]=(n,...i)=>{for(let e=0;e<t.length;e++){const i=Cs[t[e]];if(i&&i(n,t))return}return e(n,...i)})},Ss={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Is=(e,t)=>{const n=e._withKeys||(e._withKeys={}),i=t.join(".");return n[i]||(n[i]=n=>{if(!("key"in n))return;const i=M(n.key);return t.some(e=>e===i||Ss[e]===i)?e(n):void 0})},As=h({patchProp:(e,t,n,i,a,o)=>{const s="svg"===a;"class"===t?function(e,t,n){const i=e[Do];i&&(t=(t?[t,...i]:[...i]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,i,s):"style"===t?function(e,t,n){const i=e.style,a=_(n);let o=!1;if(n&&!a){if(t)if(_(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&Jo(i,t,"")}else for(const e in t)null==n[e]&&Jo(i,e,"");for(const e in n)"display"===e&&(o=!0),Jo(i,e,n[e])}else if(a){if(t!==n){const e=i[Qo];e&&(n+=";"+e),i.cssText=n,o=$o.test(n)}}else t&&e.removeAttribute("style");Wo in e&&(e[Wo]=o?i.display:"",e[Ko]&&(i.display="none"))}(e,n,i):c(t)?u(t)||ss(e,t,0,i,o):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,i){if(i)return"innerHTML"===t||"textContent"===t||!!(t in e&&hs(t)&&b(n));if("spellcheck"===t||"draggable"===t||"translate"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}if(hs(t)&&_(n))return!1;return t in e}(e,t,i,s))?(is(e,t,i),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||ns(e,t,i,s,0,"value"!==t)):!e._isVueCE||!/[A-Z]/.test(t)&&_(i)?("true-value"===t?e._trueValue=i:"false-value"===t&&(e._falseValue=i),ns(e,t,i,s)):is(e,P(t),i,0,t)}},So);let Ds;function Ps(){return Ds||(Ds=oa(As))}const Os=(...e)=>{Ps().render(...e)}; 27/*! 28 * pinia v2.2.4 29 * (c) 2024 Eduardo San Martin Morote 30 * @license MIT 31 */ 32let Ms;const Ns=e=>Ms=e,Rs=Symbol();function Ls(e){return e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)&&"function"!=typeof e.toJSON}var Vs,qs;(qs=Vs||(Vs={})).direct="direct",qs.patchObject="patch object",qs.patchFunction="patch function";const Fs=()=>{};function Bs(e,t,n,i=Fs){e.push(t);const a=()=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),i())};return!n&&re()&&le(a),a}function Us(e,...t){e.slice().forEach(e=>{e(...t)})}const js=e=>e(),Hs=Symbol(),zs=Symbol();function Ws(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const i=t[n],a=e[n];Ls(a)&&Ls(i)&&e.hasOwnProperty(n)&&!St(i)&&!bt(i)?e[n]=Ws(a,i):e[n]=i}return e}const Ks=Symbol();function Gs(e){return!Ls(e)||!e.hasOwnProperty(Ks)}const{assign:Ys}=Object;function Qs(e){return!(!St(e)||!e.effect)}function $s(e,t,n,i){const{state:a,actions:o,getters:s}=t,r=n.state.value[e];let l;return l=Xs(e,function(){r||(n.state.value[e]=a?a():{});const t=function(e){const t=g(e)?new Array(e.length):{};for(const n in e)t[n]=Bt(e,n);return t}(n.state.value[e]);return Ys(t,o,Object.keys(s||{}).reduce((t,i)=>(t[i]=Tt(bo(()=>{Ns(n);const t=n._s.get(e);return s[i].call(t,t)})),t),{}))},t,n,i,!0),l}function Xs(e,t,n={},i,a,o){let s;const r=Ys({actions:{}},n),l={deep:!0};let c,u,h,d=[],f=[];const p=i.state.value[e];let g;function m(t){let n;c=u=!1,"function"==typeof t?(t(i.state.value[e]),n={type:Vs.patchFunction,storeId:e,events:h}):(Ws(i.state.value[e],t),n={type:Vs.patchObject,payload:t,storeId:e,events:h});const a=g=Symbol();an().then(()=>{g===a&&(c=!0)}),u=!0,Us(d,n,i.state.value[e])}o||p||(i.state.value[e]={}),It({});const v=o?function(){const{state:e}=n,t=e?e():{};this.$patch(e=>{Ys(e,t)})}:Fs;const y=(t,n="")=>{if(Hs in t)return t[zs]=n,t;const a=function(){Ns(i);const n=Array.from(arguments),o=[],s=[];let r;Us(f,{args:n,name:a[zs],store:b,after:function(e){o.push(e)},onError:function(e){s.push(e)}});try{r=t.apply(this&&this.$id===e?this:b,n)}catch(l){throw Us(s,l),l}return r instanceof Promise?r.then(e=>(Us(o,e),e)).catch(e=>(Us(s,e),Promise.reject(e))):(Us(o,r),r)};return a[Hs]=!0,a[zs]=n,a}
32,b=gt({_p:i,$id:e,$onAction:Bs.bind(null,f),$patch:m,$reset:v,$subscribe(t,n={}){const a=Bs(d,t,n.detached,()=>o()),o=s.run(()=>pa(()=>i.state.value[e],i=>{("sync"===n.flush?u:c)&&t({storeId:e,type:Vs.direct,events:h},i)},Ys({},l,n)));return a},$dispose:function(){s.stop(),d=[],f=[],i._s.delete(e)}});i._s.set(e,b);const _=(i._a&&i._a.runWithContext||js)(()=>i._e.run(()=>(s=se()).run(()=>t({action:y}))));for(const w in _){const t=_[w];if(St(t)&&!Qs(t)||bt(t))o||(p&&Gs(t)&&(St(t)?t.value=p[w]:Ws(t,p[w])),i.state.value[e][w]=t);else if("function"==typeof t){const e=y(t,w);_[w]=e,r.actions[w]=t}}return Ys(b,_),Ys(xt(b),_),Object.defineProperty(b,"$state",{get:()=>i.state.value[e],set:e=>{m(t=>{Ys(t,e)})}}),i._p.forEach(e=>{Ys(b,s.run(()=>e({store:b,app:i._a,pinia:i,options:r})))}),p&&o&&n.hydrate&&n.hydrate(b.$state,p),c=!0,u=!0,b}function Js(e,t,n){let i,a;const o="function"==typeof t;function s(e,n){(e=e||(!!(io||hn||Ui)?Hi(Rs,null):null))&&Ns(e),(e=Ms)._s.has(i)||(o?Xs(i,t,a,e):$s(i,a,e));return e._s.get(i)}return"string"==typeof e?(i=e,a=o?n:t):(a=e,i=e.id),s.$id=i,s}function Zs(e){{e=xt(e);const t={};for(const n in e){const i=e[n];(St(i)||bt(i))&&(t[n]=Ft(e,n))}return t}}const er={},tr=function(e,t,n){let i=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const e=document.querySelector("meta[property=csp-nonce]"),n=(null==e?void 0:e.nonce)||(null==e?void 0:e.getAttribute("nonce"));i=Promise.allSettled(t.map(e=>{if((e=function(e){return"/"+e}(e))in er)return;er[e]=!0;const t=e.endsWith(".css"),i=t?'[rel="stylesheet"]':"";if(document.querySelector('link[href="'.concat(e,'"]').concat(i)))return;const a=document.createElement("link");return a.rel=t?"stylesheet":"modulepreload",t||(a.as="script"),a.crossOrigin="",a.href=e,n&&a.setAttribute("nonce",n),document.head.appendChild(a),t?new Promise((t,n)=>{a.addEventListener("load",t),a.addEventListener("error",()=>n(new Error("Unable to preload CSS for ".concat(e))))}):void 0}))}function a(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return i.then(t=>{for(const e of t||[])"rejected"===e.status&&a(e.reason);return e().catch(a)})},nr="undefined"!=typeof document;function ir(e){return"object"==typeof e||"displayName"in e||"props"in e||"__vccOpts"in e}const ar=Object.assign;function or(e,t){const n={};for(const i in t){const a=t[i];n[i]=rr(a)?a.map(e):e(a)}return n}const sr=()=>{},rr=Array.isArray,lr=/#/g,cr=/&/g,ur=/\//g,hr=/=/g,dr=/\?/g,fr=/\+/g,pr=/%5B/g,gr=/%5D/g,mr=/%5E/g,vr=/%60/g,yr=/%7B/g,br=/%7C/g,_r=/%7D/g,wr=/%20/g;function kr(e){return encodeURI(""+e).replace(br,"|").replace(pr,"[").replace(gr,"]")}function xr(e){return kr(e).replace(fr,"%2B").replace(wr,"+").replace(lr,"%23").replace(cr,"%26").replace(vr,"`").replace(yr,"{").replace(_r,"}").replace(mr,"^")}function Tr(e){return xr(e).replace(hr,"%3D")}function Cr(e){return null==e?"":function(e){return kr(e).replace(lr,"%23").replace(dr,"%3F")}(e).replace(ur,"%2F")}function Er(e){try{return decodeURIComponent(""+e)}catch(t){}return""+e}const Sr=/\/$/;function Ir(e,t,n="/"){let i,a={},o="",s="";const r=t.indexOf("#");let l=t.indexOf("?");return r<l&&r>=0&&(l=-1),l>-1&&(i=t.slice(0,l),o=t.slice(l+1,r>-1?r:t.length),a=e(o)),r>-1&&(i=i||t.slice(0,r),s=t.slice(r,t.length)),i=function(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),i=e.split("/"),a=i[i.length-1];".."!==a&&"."!==a||i.push("");let o,s,r=n.length-1;for(o=0;o<i.length;o++)if(s=i[o],"."!==s){if(".."!==s)break;r>1&&r--}return n.slice(0,r).join("/")+"/"+i.slice(o).join("/")}(null!=i?i:t,n),{fullPath:i+(o&&"?")+o+s,path:i,query:a,hash:Er(s)}}function Ar(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function Dr(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Pr(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Or(e[n],t[n]))return!1;return!0}function Or(e,t){return rr(e)?Mr(e,t):rr(t)?Mr(t,e):e===t}function Mr(e,t){return rr(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):1===e.length&&e[0]===t}const Nr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Rr,Lr,Vr,qr;function Fr(e){if(!e)if(nr){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),e.replace(Sr,"")}(Lr=Rr||(Rr={})).pop="pop",Lr.push="push",(qr=Vr||(Vr={})).back="back",qr.forward="forward",qr.unknown="";const Br=/^[^#]+#/;function Ur(e,t){return e.replace(Br,"#")+t}const jr=()=>({left:window.scrollX,top:window.scrollY});function Hr(e){let t;if("el"in e){const n=e.el,i="string"==typeof n&&n.startsWith("#"),a="string"==typeof n?i?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!a)return;t=function(e,t){const n=document.documentElement.getBoundingClientRect(),i=e.getBoundingClientRect();return{behavior:t.behavior,left:i.left-n.left-(t.left||0),top:i.top-n.top-(t.top||0)}}(a,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(null!=t.left?t.left:window.scrollX,null!=t.top?t.top:window.scrollY)}
32function zr(e,t){return(history.state?history.state.position-t:-1)+e}const Wr=new Map;function Kr(e,t){const{pathname:n,search:i,hash:a}=t,o=e.indexOf("#");if(o>-1){let t=a.includes(e.slice(o))?e.slice(o).length:1,n=a.slice(t);return"/"!==n[0]&&(n="/"+n),Ar(n,"")}return Ar(n,e)+i+a}function Gr(e,t,n,i=!1,a=!1){return{back:e,current:t,forward:n,replaced:i,position:window.history.length,scroll:a?jr():null}}function Yr(e){const{history:t,location:n}=window,i={value:Kr(e,n)},a={value:t.state};function o(i,o,s){const r=e.indexOf("#"),l=r>-1?(n.host&&document.querySelector("base")?e:e.slice(r))+i:location.protocol+"//"+location.host+e+i;try{t[s?"replaceState":"pushState"](o,"",l),a.value=o}catch(c){n[s?"replace":"assign"](l)}}return a.value||o(i.value,{back:null,current:i.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:i,state:a,push:function(e,n){const s=ar({},a.value,t.state,{forward:e,scroll:jr()});o(s.current,s,!0),o(e,ar({},Gr(i.value,e,null),{position:s.position+1},n),!1),i.value=e},replace:function(e,n){o(e,ar({},t.state,Gr(a.value.back,e,a.value.forward,!0),n,{position:a.value.position}),!0),i.value=e}}}function Qr(e){return"string"==typeof e||"symbol"==typeof e}const $r=Symbol("");var Xr,Jr;function Zr(e,t){return ar(new Error,{type:e,[$r]:!0},t)}function el(e,t){return e instanceof Error&&$r in e&&(null==t||!!(e.type&t))}(Jr=Xr||(Xr={}))[Jr.aborted=4]="aborted",Jr[Jr.cancelled=8]="cancelled",Jr[Jr.duplicated=16]="duplicated";const tl="[^/]+?",nl={sensitive:!1,strict:!1,start:!0,end:!0},il=/[.+*?^${}()[\]/\\]/g;function al(e,t){let n=0;for(;n<e.length&&n<t.length;){const i=t[n]-e[n];if(i)return i;n++}return e.length<t.length?1===e.length&&80===e[0]?-1:1:e.length>t.length?1===t.length&&80===t[0]?1:-1:0}function ol(e,t){let n=0;const i=e.score,a=t.score;for(;n<i.length&&n<a.length;){const e=al(i[n],a[n]);if(e)return e;n++}if(1===Math.abs(a.length-i.length)){if(sl(i))return 1;if(sl(a))return-1}return a.length-i.length}function sl(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const rl={type:0,value:""},ll=/[a-zA-Z0-9_]/;function cl(e,t,n){const i=function(e,t){const n=ar({},nl,t),i=[];let a=n.start?"^":"";const o=[];for(const l of e){const e=l.length?[]:[90];n.strict&&!l.length&&(a+="/");for(let t=0;t<l.length;t++){const i=l[t];let s=40+(n.sensitive?.25:0);if(0===i.type)t||(a+="/"),a+=i.value.replace(il,"\\$&"),s+=40;else if(1===i.type){const{value:e,repeatable:n,optional:c,regexp:u}=i;o.push({name:e,repeatable:n,optional:c});const h=u||tl;if(h!==tl){s+=10;try{new RegExp("(".concat(h,")"))}catch(r){throw new Error('Invalid custom RegExp for param "'.concat(e,'" (').concat(h,"): ")+r.message)}}let d=n?"((?:".concat(h,")(?:/(?:").concat(h,"))*)"):"(".concat(h,")");t||(d=c&&l.length<2?"(?:/".concat(d,")"):"/"+d),c&&(d+="?"),a+=d,s+=20,c&&(s+=-8),n&&(s+=-20),".*"===h&&(s+=-50)}e.push(s)}i.push(e)}if(n.strict&&n.end){const e=i.length-1;i[e][i[e].length-1]+=.7000000000000001}n.strict||(a+="/?"),n.end?a+="$":n.strict&&(a+="(?:/|$)");const s=new RegExp(a,n.sensitive?"":"i");return{re:s,score:i,keys:o,parse:function(e){const t=e.match(s),n={};if(!t)return null;for(let i=1;i<t.length;i++){const e=t[i]||"",a=o[i-1];n[a.name]=e&&a.repeatable?e.split("/"):e}return n},stringify:function(t){let n="",i=!1;for(const a of e){i&&n.endsWith("/")||(n+="/"),i=!1;for(const e of a)if(0===e.type)n+=e.value;else if(1===e.type){const{value:o,repeatable:s,optional:r}=e,l=o in t?t[o]:"";if(rr(l)&&!s)throw new Error('Provided param "'.concat(o,'" is an array but it is not repeatable (* or + modifiers)'));const c=rr(l)?l.join("/"):l;if(!c){if(!r)throw new Error('Missing required param "'.concat(o,'"'));a.length<2&&(n.endsWith("/")?n=n.slice(0,-1):i=!0)}n+=c}}return n||"/"}}}(function(e){if(!e)return[[]];if("/"===e)return[[rl]];if(!e.startsWith("/"))throw new Error('Invalid path "'.concat(e,'"'));function t(e){throw new Error("ERR (".concat(n,')/"').concat(c,'": ').concat(e))}let n=0,i=n;const a=[];let o;function s(){o&&a.push(o),o=[]}let r,l=0,c="",u="";function h(){c&&(0===n?o.push({type:0,value:c}):1===n||2===n||3===n?(o.length>1&&("*"===r||"+"===r)&&t("A repeatable param (".concat(c,") must be alone in its segment. eg: '/:ids+.")),o.push({type:1,value:c,regexp:u,repeatable:"*"===r||"+"===r,optional:"*"===r||"?"===r})):t("Invalid state to consume buffer"),c="")}function d(){c+=r}for(;l<e.length;)if(r=e[l++],"\\"!==r||2===n)switch(n){case 0:"/"===r?(c&&h(),s()):":"===r?(h(),n=1):d();break;case 4:d(),n=i;break;case 1:"("===r?n=2:ll.test(r)?d():(h(),n=0,"*"!==r&&"?"!==r&&"+"!==r&&l--);break;case 2:")"===r?"\\"==u[u.length-1]?u=u.slice(0,-1)+r:n=3:u+=r;break;case 3:h(),n=0,"*"!==r&&"?"!==r&&"+"!==r&&l--,u="";break;default:t("Unknown state")}else i=n,n=4;return 2===n&&t('Unfinished custom RegExp for param "'.concat(c,'"')),h(),s(),a}(e.path),n),a=ar(i,{record:e,parent:t,children:[],alias:[]});return t&&!a.record.aliasOf==!t.record.aliasOf&&t.children.push(a),a}function ul(e,t){const n=[],i=new Map;function a(e,n,i){const r=!i,l=dl(e);l.aliasOf=i&&i.record;const c=ml(t,e),u=[l];if("alias"in e){const t="string"==typeof e.alias?[e.alias]:e.alias;for(const e of t)u.push(dl(ar({},l,{components:i?i.record.components:l.components,path:e,aliasOf:i?i.record:l})))}let h,d;for(const t of u){const{path:u}=t;if(n&&"/"!==u[0]){const e=n.record.path,i="/"===e[e.length-1]?"":"/";t.path=n.record.path+(u&&i+u)}if(h=cl(t,n,c),i?i.alias.push(h):(d=d||h,d!==h&&d.alias.push(h),r&&e.name&&!pl(h)&&o(e.name)),vl(h)&&s(h),l.children){const e=l.children;for(let t=0;t<e.length;t++)a(e[t],h,i&&i.children[t])}i=i||h}return d?()=>{o(d)}:sr}function o(e){if(Qr(e)){const t=i.get(e);
32t&&(i.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{const t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&i.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(e){const t=function(e,t){let n=0,i=t.length;for(;n!==i;){const a=n+i>>1;ol(e,t[a])<0?i=a:n=a+1}const a=function(e){let t=e;for(;t=t.parent;)if(vl(t)&&0===ol(e,t))return t;return}(e);a&&(i=t.lastIndexOf(a,i-1));return i}(e,n);n.splice(t,0,e),e.record.name&&!pl(e)&&i.set(e.record.name,e)}return t=ml({strict:!1,end:!0,sensitive:!1},t),e.forEach(e=>a(e)),{addRoute:a,resolve:function(e,t){let a,o,s,r={};if("name"in e&&e.name){if(a=i.get(e.name),!a)throw Zr(1,{location:e});s=a.record.name,r=ar(hl(t.params,a.keys.filter(e=>!e.optional).concat(a.parent?a.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&hl(e.params,a.keys.map(e=>e.name))),o=a.stringify(r)}else if(null!=e.path)o=e.path,a=n.find(e=>e.re.test(o)),a&&(r=a.parse(o),s=a.record.name);else{if(a=t.name?i.get(t.name):n.find(e=>e.re.test(t.path)),!a)throw Zr(1,{location:e,currentLocation:t});s=a.record.name,r=ar({},t.params,e.params),o=a.stringify(r)}const l=[];let c=a;for(;c;)l.unshift(c.record),c=c.parent;return{name:s,path:o,params:r,matched:l,meta:gl(l)}},removeRoute:o,clearRoutes:function(){n.length=0,i.clear()},getRoutes:function(){return n},getRecordMatcher:function(e){return i.get(e)}}}function hl(e,t){const n={};for(const i of t)i in e&&(n[i]=e[i]);return n}function dl(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:fl(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function fl(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const i in e.components)t[i]="object"==typeof n?n[i]:n;return t}function pl(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function gl(e){return e.reduce((e,t)=>ar(e,t.meta),{})}function ml(e,t){const n={};for(const i in e)n[i]=i in t?t[i]:e[i];return n}function vl({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function yl(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let i=0;i<n.length;++i){const e=n[i].replace(fr," "),a=e.indexOf("="),o=Er(a<0?e:e.slice(0,a)),s=a<0?null:Er(e.slice(a+1));if(o in t){let e=t[o];rr(e)||(e=t[o]=[e]),e.push(s)}else t[o]=s}return t}function bl(e){let t="";for(let n in e){const i=e[n];if(n=Tr(n),null==i){void 0!==i&&(t+=(t.length?"&":"")+n);continue}(rr(i)?i.map(e=>e&&xr(e)):[i&&xr(i)]).forEach(e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))})}return t}function _l(e){const t={};for(const n in e){const i=e[n];void 0!==i&&(t[n]=rr(i)?i.map(e=>null==e?null:""+e):null==i?i:""+i)}return t}const wl=Symbol(""),kl=Symbol(""),xl=Symbol(""),Tl=Symbol(""),Cl=Symbol("");function El(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e.slice(),reset:function(){e=[]}}}function Sl(e,t,n,i,a,o=e=>e()){const s=i&&(i.enterCallbacks[a]=i.enterCallbacks[a]||[]);return()=>new Promise((r,l)=>{const c=e=>{var o;!1===e?l(Zr(4,{from:n,to:t})):e instanceof Error?l(e):"string"==typeof(o=e)||o&&"object"==typeof o?l(Zr(2,{from:t,to:e})):(s&&i.enterCallbacks[a]===s&&"function"==typeof e&&s.push(e),r())},u=o(()=>e.call(i&&i.instances[a],t,n,c));let h=Promise.resolve(u);e.length<3&&(h=h.then(c)),h.catch(e=>l(e))})}function Il(e,t,n,i,a=e=>e()){const o=[];for(const s of e)for(const e in s.components){let r=s.components[e];if("beforeRouteEnter"===t||s.instances[e])if(ir(r)){const l=(r.__vccOpts||r)[t];l&&o.push(Sl(l,n,i,s,e,a))}else{let l=r();o.push(()=>l.then(o=>{if(!o)throw new Error("Couldn't resolve component \"".concat(e,'" at "').concat(s.path,'"'));const r=(l=o).__esModule||"Module"===l[Symbol.toStringTag]||l.default&&ir(l.default)?o.default:o;var l;s.mods[e]=o,s.components[e]=r;const c=(r.__vccOpts||r)[t];return c&&Sl(c,n,i,s,e,a)()}))}}return o}function Al(e){const t=Hi(xl),n=Hi(Tl),i=bo(()=>{const n=Ot(e.to);return t.resolve(n)}),a=bo(()=>{const{matched:e}=i.value,{length:t}=e,a=e[t-1],o=n.matched;
32if(!a||!o.length)return-1;const s=o.findIndex(Dr.bind(null,a));if(s>-1)return s;const r=Pl(e[t-2]);return t>1&&Pl(a)===r&&o[o.length-1].path!==r?o.findIndex(Dr.bind(null,e[t-2])):s}),o=bo(()=>a.value>-1&&function(e,t){for(const n in t){const i=t[n],a=e[n];if("string"==typeof i){if(i!==a)return!1}else if(!rr(a)||a.length!==i.length||i.some((e,t)=>e!==a[t]))return!1}return!0}(n.params,i.value.params)),s=bo(()=>a.value>-1&&a.value===n.matched.length-1&&Pr(n.params,i.value.params));return{route:i,href:bo(()=>i.value.href),isActive:o,isExactActive:s,navigate:function(n={}){return function(e){if(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)return;if(e.defaultPrevented)return;if(void 0!==e.button&&0!==e.button)return;if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}e.preventDefault&&e.preventDefault();return!0}(n)?t[Ot(e.replace)?"replace":"push"](Ot(e.to)).catch(sr):Promise.resolve()}}}const Dl=jn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Al,setup(e,{slots:t}){const n=gt(Al(e)),{options:i}=Hi(xl),a=bo(()=>({[Ol(e.activeClass,i.linkActiveClass,"router-link-active")]:n.isActive,[Ol(e.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&t.default(n);return e.custom?i:_o("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:a.value},i)}}});function Pl(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Ol=(e,t,n)=>null!=e?e:null!=t?t:n,Ml=jn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const i=Hi(Cl),a=bo(()=>e.route||i.value),o=Hi(kl,0),s=bo(()=>{let e=Ot(o);const{matched:t}=a.value;let n;for(;(n=t[e])&&!n.components;)e++;return e}),r=bo(()=>a.value.matched[s.value]);ji(kl,bo(()=>s.value+1)),ji(wl,r),ji(Cl,a);const l=It();return pa(()=>[l.value,r.value,e.name],([e,t,n],[i,a,o])=>{t&&(t.instances[n]=e,a&&a!==t&&e&&e===i&&(t.leaveGuards.size||(t.leaveGuards=a.leaveGuards),t.updateGuards.size||(t.updateGuards=a.updateGuards))),!e||!t||a&&Dr(t,a)&&i||(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:"post"}),()=>{const i=a.value,o=e.name,s=r.value,c=s&&s.components[o];if(!c)return Nl(n.default,{Component:c,route:i});const u=s.props[o],h=u?!0===u?i.params:"function"==typeof u?u(i):u:null,d=_o(c,ar({},h,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(s.instances[o]=null)},ref:l}));return Nl(n.default,{Component:d,route:i})||d}}});function Nl(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const Rl=Ml;function Ll(){return Hi(xl)}function Vl(e){return Hi(Tl)}var ql={}; 33/** 34 * @license 35 * Copyright 2017 Google LLC 36 * 37 * Licensed under the Apache License, Version 2.0 (the "License"); 38 * you may not use this file except in compliance with the License. 39 * You may obtain a copy of the License at 40 * 41 * http://www.apache.org/licenses/LICENSE-2.0 42 * 43 * Unless required by applicable law or agreed to in writing, software 44 * distributed under the License is distributed on an "AS IS" BASIS, 45 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 46 * See the License for the specific language governing permissions and 47 * limitations under the License. 48 */const Fl=!1,Bl="${JSCORE_VERSION}",Ul=function(e,t){if(!e)throw jl(t)},jl=function(e){return new Error("Firebase Database ("+Bl+") INTERNAL ASSERT FAILED: "+e)},Hl=function(e){const t=[];let n=0;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);a<128?t[n++]=a:a<2048?(t[n++]=a>>6|192,t[n++]=63&a|128):55296==(64512&a)&&i+1<e.length&&56320==(64512&e.charCodeAt(i+1))?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),t[n++]=a>>18|240,t[n++]=a>>12&63|128,t[n++]=a>>6&63|128,t[n++]=63&a|128):(t[n++]=a>>12|224,t[n++]=a>>6&63|128,t[n++]=63&a|128)}return t},zl={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let a=0;a<e.length;a+=3){const t=e[a],o=a+1<e.length,s=o?e[a+1]:0,r=a+2<e.length,l=r?e[a+2]:0,c=t>>2,u=(3&t)<<4|s>>4;let h=(15&s)<<2|l>>6,d=63&l;r||(d=64,o||(h=64)),i.push(n[c],n[u],n[h],n[d])}return i.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(Hl(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,i=0;for(;n<e.length;){const a=e[n++];if(a<128)t[i++]=String.fromCharCode(a);else if(a>191&&a<224){const o=e[n++];t[i++]=String.fromCharCode((31&a)<<6|63&o)}else if(a>239&&a<365){const o=((7&a)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[i++]=String.fromCharCode(55296+(o>>10)),t[i++]=String.fromCharCode(56320+(1023&o))}else{const o=e[n++],s=e[n++];
vendor: 4,626 bytes, lines 48-114
48t[i++]=String.fromCharCode((15&a)<<12|(63&o)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let a=0;a<e.length;){const t=n[e.charAt(a++)],o=a<e.length?n[e.charAt(a)]:0;++a;const s=a<e.length?n[e.charAt(a)]:64;++a;const r=a<e.length?n[e.charAt(a)]:64;if(++a,null==t||null==o||null==s||null==r)throw new Wl;const l=t<<2|o>>4;if(i.push(l),64!==s){const e=o<<4&240|s>>2;if(i.push(e),64!==r){const e=s<<6&192|r;i.push(e)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}}; 49/** 50 * @license 51 * Copyright 2017 Google LLC 52 * 53 * Licensed under the Apache License, Version 2.0 (the "License"); 54 * you may not use this file except in compliance with the License. 55 * You may obtain a copy of the License at 56 * 57 * http://www.apache.org/licenses/LICENSE-2.0 58 * 59 * Unless required by applicable law or agreed to in writing, software 60 * distributed under the License is distributed on an "AS IS" BASIS, 61 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 62 * See the License for the specific language governing permissions and 63 * limitations under the License. 64 */class Wl extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Kl=function(e){const t=Hl(e);return zl.encodeByteArray(t,!0)},Gl=function(e){return Kl(e).replace(/\./g,"")},Yl=function(e){try{return zl.decodeString(e,!0)}catch(ZNe){}return null}; 65/** 66 * @license 67 * Copyright 2017 Google LLC 68 * 69 * Licensed under the Apache License, Version 2.0 (the "License"); 70 * you may not use this file except in compliance with the License. 71 * You may obtain a copy of the License at 72 * 73 * http://www.apache.org/licenses/LICENSE-2.0 74 * 75 * Unless required by applicable law or agreed to in writing, software 76 * distributed under the License is distributed on an "AS IS" BASIS, 77 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 78 * See the License for the specific language governing permissions and 79 * limitations under the License. 80 */ 81function Ql(e){return $l(void 0,e)}function $l(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(const n in t)t.hasOwnProperty(n)&&Xl(n)&&(e[n]=$l(e[n],t[n]));return e}function Xl(e){return"__proto__"!==e} 82/** 83 * @license 84 * Copyright 2022 Google LLC 85 * 86 * Licensed under the Apache License, Version 2.0 (the "License"); 87 * you may not use this file except in compliance with the License. 88 * You may obtain a copy of the License at 89 * 90 * http://www.apache.org/licenses/LICENSE-2.0 91 * 92 * Unless required by applicable law or agreed to in writing, software 93 * distributed under the License is distributed on an "AS IS" BASIS, 94 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 95 * See the License for the specific language governing permissions and 96 * limitations under the License. 97 */ 98/** 99 * @license 100 * Copyright 2022 Google LLC 101 * 102 * Licensed under the Apache License, Version 2.0 (the "License"); 103 * you may not use this file except in compliance with the License. 104 * You may obtain a copy of the License at 105 * 106 * http://www.apache.org/licenses/LICENSE-2.0 107 * 108 * Unless required by applicable law or agreed to in writing, software 109 * distributed under the License is distributed on an "AS IS" BASIS, 110 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 111 * See the License for the specific language governing permissions and 112 * limitations under the License. 113 */ 114const Jl=()=>function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__,Zl=()=>{try{return Jl()||(()=>{if("undefined"==typeof process)return;const e=ql.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;
114]+)/)}catch(ZNe){return}const t=e&&Yl(e[1]);return t&&JSON.parse(t)})()}catch(ZNe){return}},ec=e=>{var t,n;return null===(n=null===(t=Zl())||void 0===t?void 0:t.emulatorHosts)||void 0===n?void 0:n[e]},tc=e=>{const t=ec(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error("Invalid host ".concat(t," with no separate hostname and port!"));const i=parseInt(t.substring(n+1),10);return"["===t[0]?[t.substring(1,n-1),i]:[t.substring(0,n),i]},nc=()=>{var e;return null===(e=Zl())||void 0===e?void 0:e.config},ic=e=>{var t;return null===(t=Zl())||void 0===t?void 0:t["_".concat(e)]}; 115/** 116 * @license 117 * Copyright 2017 Google LLC 118 * 119 * Licensed under the Apache License, Version 2.0 (the "License"); 120 * you may not use this file except in compliance with the License. 121 * You may obtain a copy of the License at 122 * 123 * http://www.apache.org/licenses/LICENSE-2.0 124 * 125 * Unless required by applicable law or agreed to in writing, software 126 * distributed under the License is distributed on an "AS IS" BASIS, 127 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 128 * See the License for the specific language governing permissions and 129 * limitations under the License. 130 */ 131class ac{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,n))}}} 132/** 133 * @license 134 * Copyright 2021 Google LLC 135 * 136 * Licensed under the Apache License, Version 2.0 (the "License"); 137 * you may not use this file except in compliance with the License. 138 * You may obtain a copy of the License at 139 * 140 * http://www.apache.org/licenses/LICENSE-2.0 141 * 142 * Unless required by applicable law or agreed to in writing, software 143 * distributed under the License is distributed on an "AS IS" BASIS, 144 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 145 * See the License for the specific language governing permissions and 146 * limitations under the License. 147 */function oc(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=t||"demo-project",i=e.iat||0,a=e.sub||e.user_id;if(!a)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:"https://securetoken.google.com/".concat(n),aud:n,iat:i,exp:i+3600,auth_time:i,sub:a,user_id:a,firebase:{sign_in_provider:"custom",identities:{}}},e);return[Gl(JSON.stringify({alg:"none",type:"JWT"})),Gl(JSON.stringify(o)),""].join(".")} 148/** 149 * @license 150 * Copyright 2017 Google LLC 151 * 152 * Licensed under the Apache License, Version 2.0 (the "License"); 153 * you may not use this file except in compliance with the License. 154 * You may obtain a copy of the License at 155 * 156 * http://www.apache.org/licenses/LICENSE-2.0 157 * 158 * Unless required by applicable law or agreed to in writing, software 159 * distributed under the License is distributed on an "AS IS" BASIS, 160 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 161 * See the License for the specific language governing permissions and 162 * limitations under the License. 163 */function sc(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function rc(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(sc())}function lc(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function cc(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function uc(){return!0===Fl}function hc(){return!function(){var e;const t=null===(e=Zl())||void 0===e?void 0:e.forceEnvironment;if("node"===t)return!0;if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(ZNe){return!1}}()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function dc(){try{return"object"==typeof indexedDB}catch(ZNe){return!1}}function fc(){return new Promise((e,t)=>
163{try{let n=!0;const i="validate-browser-context-for-indexeddb-analytics-module",a=self.indexedDB.open(i);a.onsuccess=()=>{a.result.close(),n||self.indexedDB.deleteDatabase(i),e(!0)},a.onupgradeneeded=()=>{n=!1},a.onerror=()=>{var e;t((null===(e=a.error)||void 0===e?void 0:e.message)||"")}}catch(n){t(n)}})}function pc(){return!("undefined"==typeof navigator||!navigator.cookieEnabled)} 164/** 165 * @license 166 * Copyright 2017 Google LLC 167 * 168 * Licensed under the Apache License, Version 2.0 (the "License"); 169 * you may not use this file except in compliance with the License. 170 * You may obtain a copy of the License at 171 * 172 * http://www.apache.org/licenses/LICENSE-2.0 173 * 174 * Unless required by applicable law or agreed to in writing, software 175 * distributed under the License is distributed on an "AS IS" BASIS, 176 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 177 * See the License for the specific language governing permissions and 178 * limitations under the License. 179 */class gc extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,gc.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,mc.prototype.create)}}class mc{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},i="".concat(this.service,"/").concat(e),a=this.errors[e],o=a?function(e,t){return e.replace(vc,(e,n)=>{const i=t[n];return null!=i?String(i):"<".concat(n,"?>")})}(a,n):"Error",s="".concat(this.serviceName,": ").concat(o," (").concat(i,").");return new gc(i,s,n)}}const vc=/\{\$([^}]+)}/g; 180/** 181 * @license 182 * Copyright 2017 Google LLC 183 * 184 * Licensed under the Apache License, Version 2.0 (the "License"); 185 * you may not use this file except in compliance with the License. 186 * You may obtain a copy of the License at 187 * 188 * http://www.apache.org/licenses/LICENSE-2.0 189 * 190 * Unless required by applicable law or agreed to in writing, software 191 * distributed under the License is distributed on an "AS IS" BASIS, 192 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 193 * See the License for the specific language governing permissions and 194 * limitations under the License. 195 */function yc(e){return JSON.parse(e)}function bc(e){return JSON.stringify(e)} 196/** 197 * @license 198 * Copyright 2017 Google LLC 199 * 200 * Licensed under the Apache License, Version 2.0 (the "License"); 201 * you may not use this file except in compliance with the License. 202 * You may obtain a copy of the License at 203 * 204 * http://www.apache.org/licenses/LICENSE-2.0 205 * 206 * Unless required by applicable law or agreed to in writing, software 207 * distributed under the License is distributed on an "AS IS" BASIS, 208 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 209 * See the License for the specific language governing permissions and 210 * limitations under the License. 211 */const _c=function(e){let t={},n={},i={},a="";try{const o=e.split(".");t=yc(Yl(o[0])||""),n=yc(Yl(o[1])||""),a=o[2],i=n.d||{},delete n.d}catch(ZNe){}return{header:t,claims:n,data:i,signature:a}}; 212/** 213 * @license 214 * Copyright 2017 Google LLC 215 * 216 * Licensed under the Apache License, Version 2.0 (the "License"); 217 * you may not use this file except in compliance with the License. 218 * You may obtain a copy of the License at 219 * 220 * http://www.apache.org/licenses/LICENSE-2.0 221 * 222 * Unless required by applicable law or agreed to in writing, software 223 * distributed under the License is distributed on an "AS IS" BASIS, 224 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 225 * See the License for the specific language governing permissions and 226 * limitations under the License. 227 */ 228function wc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function kc(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function xc(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function Tc(e,t,n){const i={};for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(i[a]=t.call(n,e[a],a,e));return i}function Cc(e,t){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);for(const a of n){if(!i.includes(a))return!1;const n=e[a],o=t[a];if(Ec(n)&&Ec(o)){if(!Cc(n,o))return!1}else if(n!==o)return!1}for(const a of i)if(!n.includes(a))return!1;return!0}function Ec(e){return null!==e&&"object"==typeof e} 229/** 230 * @license 231 * Copyright 2017 Google LLC 232 * 233 * Licensed under the Apache License, Version 2.0 (the "License");
234 * you may not use this file except in compliance with the License. 235 * You may obtain a copy of the License at 236 * 237 * http://www.apache.org/licenses/LICENSE-2.0 238 * 239 * Unless required by applicable law or agreed to in writing, software 240 * distributed under the License is distributed on an "AS IS" BASIS, 241 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 242 * See the License for the specific language governing permissions and 243 * limitations under the License. 244 */function Sc(e){const t=[];for(const[n,i]of Object.entries(e))Array.isArray(i)?i.forEach(e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(i));return t.length?"&"+t.join("&"):""}function Ic(e){const t={};return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){const[n,i]=e.split("=");t[decodeURIComponent(n)]=decodeURIComponent(i)}}),t}function Ac(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)} 245/** 246 * @license 247 * Copyright 2017 Google LLC 248 * 249 * Licensed under the Apache License, Version 2.0 (the "License"); 250 * you may not use this file except in compliance with the License. 251 * You may obtain a copy of the License at 252 * 253 * http://www.apache.org/licenses/LICENSE-2.0 254 * 255 * Unless required by applicable law or agreed to in writing, software 256 * distributed under the License is distributed on an "AS IS" BASIS, 257 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 258 * See the License for the specific language governing permissions and 259 * limitations under the License. 260 */class Dc{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,t){t||(t=0);const n=this.W_;if("string"==typeof e)for(let u=0;u<16;u++)n[u]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(let u=0;u<16;u++)n[u]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(let u=16;u<80;u++){const e=n[u-3]^n[u-8]^n[u-14]^n[u-16];n[u]=4294967295&(e<<1|e>>>31)}let i,a,o=this.chain_[0],s=this.chain_[1],r=this.chain_[2],l=this.chain_[3],c=this.chain_[4];for(let u=0;u<80;u++){u<40?u<20?(i=l^s&(r^l),a=1518500249):(i=s^r^l,a=1859775393):u<60?(i=s&r|l&(s|r),a=2400959708):(i=s^r^l,a=3395469782);const e=(o<<5|o>>>27)+i+c+a+n[u]&4294967295;c=l,l=r,r=4294967295&(s<<30|s>>>2),s=o,o=e}this.chain_[0]=this.chain_[0]+o&4294967295,this.chain_[1]=this.chain_[1]+s&4294967295,this.chain_[2]=this.chain_[2]+r&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+c&4294967295}update(e,t){if(null==e)return;void 0===t&&(t=e.length);const n=t-this.blockSize;let i=0;const a=this.buf_;let o=this.inbuf_;for(;i<t;){if(0===o)for(;i<=n;)this.compress_(e,i),i+=this.blockSize;if("string"==typeof e){for(;i<t;)if(a[o]=e.charCodeAt(i),++o,++i,o===this.blockSize){this.compress_(a),o=0;break}}else for(;i<t;)if(a[o]=e[i],++o,++i,o===this.blockSize){this.compress_(a),o=0;break}}this.inbuf_=o,this.total_+=t}digest(){const e=[];let t=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let i=this.blockSize-1;i>=56;i--)this.buf_[i]=255&t,t/=256;this.compress_(this.buf_);let n=0;for(let i=0;i<5;i++)for(let t=24;t>=0;t-=8)e[n]=this.chain_[i]>>t&255,++n;return e}}class Pc{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,n){let i;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");i=function(e,t){if("object"!=typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===i.next&&(i.next=Oc),void 0===i.error&&(i.error=Oc),void 0===i.complete&&(i.complete=Oc);const a=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch(ZNe){}}),this.observers.push(i),a}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>
260{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(ZNe){"undefined"!=typeof console&&console.error}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function Oc(){} 261/** 262 * @license 263 * Copyright 2017 Google LLC 264 * 265 * Licensed under the Apache License, Version 2.0 (the "License"); 266 * you may not use this file except in compliance with the License. 267 * You may obtain a copy of the License at 268 * 269 * http://www.apache.org/licenses/LICENSE-2.0 270 * 271 * Unless required by applicable law or agreed to in writing, software 272 * distributed under the License is distributed on an "AS IS" BASIS, 273 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 274 * See the License for the specific language governing permissions and 275 * limitations under the License. 276 */ 277const Mc=function(e){let t=0;for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);i<128?t++:i<2048?t+=2:i>=55296&&i<=56319?(t+=4,n++):t+=3}return t};function Nc(e,t=1e3,n=2){const i=t*Math.pow(n,e),a=Math.round(.5*i*(Math.random()-.5)*2);return Math.min(144e5,i+a)} 278/** 279 * @license 280 * Copyright 2021 Google LLC 281 * 282 * Licensed under the Apache License, Version 2.0 (the "License"); 283 * you may not use this file except in compliance with the License. 284 * You may obtain a copy of the License at 285 * 286 * http://www.apache.org/licenses/LICENSE-2.0 287 * 288 * Unless required by applicable law or agreed to in writing, software 289 * distributed under the License is distributed on an "AS IS" BASIS, 290 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 291 * See the License for the specific language governing permissions and 292 * limitations under the License. 293 */function Rc(e){return e&&e._delegate?e._delegate:e}class Lc{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}} 294/** 295 * @license 296 * Copyright 2019 Google LLC 297 * 298 * Licensed under the Apache License, Version 2.0 (the "License"); 299 * you may not use this file except in compliance with the License. 300 * You may obtain a copy of the License at 301 * 302 * http://www.apache.org/licenses/LICENSE-2.0 303 * 304 * Unless required by applicable law or agreed to in writing, software 305 * distributed under the License is distributed on an "AS IS" BASIS, 306 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 307 * See the License for the specific language governing permissions and 308 * limitations under the License. 309 */const Vc="[DEFAULT]"; 310/** 311 * @license 312 * Copyright 2019 Google LLC 313 * 314 * Licensed under the Apache License, Version 2.0 (the "License"); 315 * you may not use this file except in compliance with the License. 316 * You may obtain a copy of the License at 317 * 318 * http://www.apache.org/licenses/LICENSE-2.0 319 * 320 * Unless required by applicable law or agreed to in writing, software 321 * distributed under the License is distributed on an "AS IS" BASIS, 322 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 323 * See the License for the specific language governing permissions and 324 * limitations under the License. 325 */class qc{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new ac;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(ZNe){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),i=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(i)return null;throw Error("Service ".concat(this.name," is not available"))}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(ZNe){if(i)return null;throw ZNe}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error("Mismatching Component ".concat(e.name," for Provider ").concat(this.name,"."));if(this.component)throw Error("Component for ".concat(this.name," has already been provided"));if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode} 326/** 327 * @license 328 * Copyright 2019 Google LLC 329 * 330 * Licensed under the Apache License, Version 2.0 (the "License");
331 * you may not use this file except in compliance with the License. 332 * You may obtain a copy of the License at 333 * 334 * http://www.apache.org/licenses/LICENSE-2.0 335 * 336 * Unless required by applicable law or agreed to in writing, software 337 * distributed under the License is distributed on an "AS IS" BASIS, 338 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 339 * See the License for the specific language governing permissions and 340 * limitations under the License. 341 */(e))try{this.getOrInitializeService({instanceIdentifier:Vc})}catch(ZNe){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(ZNe){}}}}clearInstance(e=Vc){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=Vc){return this.instances.has(e)}getOptions(e=Vc){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error("".concat(this.name,"(").concat(n,") has already been initialized"));if(!this.isComponentSet())throw Error("Component ".concat(this.name," has not been registered yet"));const i=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[a,o]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(a)&&o.resolve(i)}return i}onInit(e,t){var n;const i=this.normalizeInstanceIdentifier(t),a=null!==(n=this.onInitCallbacks.get(i))&&void 0!==n?n:new Set;a.add(e),this.onInitCallbacks.set(i,a);const o=this.instances.get(i);return o&&e(o,i),()=>{a.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const a of n)try{a(e,t)}catch(i){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(i=e,i===Vc?void 0:i),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(a){}var i;return n||null}normalizeInstanceIdentifier(e=Vc){return this.component?this.component.multipleInstances?e:Vc:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class Fc{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component ".concat(e.name," has already been registered with ").concat(this.name));t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new qc(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}} 342/** 343 * @license 344 * Copyright 2017 Google LLC 345 * 346 * Licensed under the Apache License, Version 2.0 (the "License"); 347 * you may not use this file except in compliance with the License. 348 * You may obtain a copy of the License at 349 * 350 * http://www.apache.org/licenses/LICENSE-2.0 351 * 352 * Unless required by applicable law or agreed to in writing, software 353 * distributed under the License is distributed on an "AS IS" BASIS, 354 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 355 * See the License for the specific language governing permissions and 356 * limitations under the License. 357 */var Bc,Uc;(Uc=Bc||(Bc={}))[Uc.DEBUG=0]="DEBUG",Uc[Uc.VERBOSE=1]="VERBOSE",Uc[Uc.INFO=2]="INFO",Uc[Uc.WARN=3]="WARN",Uc[Uc.ERROR=4]="ERROR",Uc[Uc.SILENT=5]="SILENT";const jc={debug:Bc.DEBUG,verbose:Bc.VERBOSE,info:Bc.INFO,warn:Bc.WARN,error:Bc.ERROR,silent:Bc.SILENT},Hc=Bc.INFO,zc={[Bc.DEBUG]:"log",[Bc.VERBOSE]:"log",[Bc.INFO]:"info",[Bc.WARN]:"warn",[Bc.ERROR]:"error"},Wc=(e,t,...n)=>{if(t<e.logLevel)return;(new Date).toISOString();if(!zc[t])throw new Error("Attempted to log a message with an invali
357d logType (value: ".concat(t,")"))};class Kc{constructor(e){this.name=e,this._logLevel=Hc,this._logHandler=Wc,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Bc))throw new TypeError('Invalid value "'.concat(e,'" assigned to `logLevel`'));this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?jc[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,Bc.DEBUG,...e),this._logHandler(this,Bc.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Bc.VERBOSE,...e),this._logHandler(this,Bc.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Bc.INFO,...e),this._logHandler(this,Bc.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Bc.WARN,...e),this._logHandler(this,Bc.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Bc.ERROR,...e),this._logHandler(this,Bc.ERROR,...e)}}let Gc,Yc;const Qc=new WeakMap,$c=new WeakMap,Xc=new WeakMap,Jc=new WeakMap,Zc=new WeakMap;let eu={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return $c.get(e);if("objectStoreNames"===t)return e.objectStoreNames||Xc.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return iu(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function tu(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(Yc||(Yc=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(au(this),t),iu(Qc.get(this))}:function(...t){return iu(e.apply(au(this),t))}:function(t,...n){const i=e.call(au(this),t,...n);return Xc.set(i,t.sort?t.sort():[t]),iu(i)}}function nu(e){return"function"==typeof e?tu(e):(e instanceof IDBTransaction&&function(e){if($c.has(e))return;const t=new Promise((t,n)=>{const i=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",o),e.removeEventListener("abort",o)},a=()=>{t(),i()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",a),e.addEventListener("error",o),e.addEventListener("abort",o)});$c.set(e,t)}(e),t=e,(Gc||(Gc=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,eu):e);var t}function iu(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const i=()=>{e.removeEventListener("success",a),e.removeEventListener("error",o)},a=()=>{t(iu(e.result)),i()},o=()=>{n(e.error),i()};e.addEventListener("success",a),e.addEventListener("error",o)});return t.then(t=>{t instanceof IDBCursor&&Qc.set(t,e)}).catch(()=>{}),Zc.set(t,e),t}(e);if(Jc.has(e))return Jc.get(e);const t=nu(e);return t!==e&&(Jc.set(e,t),Zc.set(t,e)),t}const au=e=>Zc.get(e);function ou(e,t,{blocked:n,upgrade:i,blocking:a,terminated:o}={}){const s=indexedDB.open(e,t),r=iu(s);return i&&s.addEventListener("upgradeneeded",e=>{i(iu(s.result),e.oldVersion,e.newVersion,iu(s.transaction),e)}),n&&s.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),r.then(e=>{o&&e.addEventListener("close",()=>o()),a&&e.addEventListener("versionchange",e=>a(e.oldVersion,e.newVersion,e))}).catch(()=>{}),r}function su(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",e=>t(e.oldVersion,e)),iu(n).then(()=>{})}const ru=["get","getKey","getAll","getAllKeys","count"],lu=["put","add","delete","clear"],cu=new Map;function uu(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(cu.get(t))return cu.get(t);const n=t.replace(/FromIndex$/,""),i=t!==n,a=lu.includes(n);if(!(n in(i?IDBIndex:IDBObjectStore).prototype)||!a&&!ru.includes(n))return;const o=async function(e,...t){const o=this.transaction(e,a?"readwrite":"readonly");let s=o.store;
357return i&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),a&&o.done]))[0]};return cu.set(t,o),o}eu=(e=>({...e,get:(t,n,i)=>uu(t,n)||e.get(t,n,i),has:(t,n)=>!!uu(t,n)||e.has(t,n)}))(eu); 358/** 359 * @license 360 * Copyright 2019 Google LLC 361 * 362 * Licensed under the Apache License, Version 2.0 (the "License"); 363 * you may not use this file except in compliance with the License. 364 * You may obtain a copy of the License at 365 * 366 * http://www.apache.org/licenses/LICENSE-2.0 367 * 368 * Unless required by applicable law or agreed to in writing, software 369 * distributed under the License is distributed on an "AS IS" BASIS, 370 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 371 * See the License for the specific language governing permissions and 372 * limitations under the License. 373 */ 374class hu{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return"".concat(t.library,"/").concat(t.version)}return null}).filter(e=>e).join(" ")}}const du="@firebase/app",fu="0.10.13",pu=new Kc("@firebase/app"),gu="@firebase/app-compat",mu="@firebase/analytics-compat",vu="@firebase/analytics",yu="@firebase/app-check-compat",bu="@firebase/app-check",_u="@firebase/auth",wu="@firebase/auth-compat",ku="@firebase/database",xu="@firebase/data-connect",Tu="@firebase/database-compat",Cu="@firebase/functions",Eu="@firebase/functions-compat",Su="@firebase/installations",Iu="@firebase/installations-compat",Au="@firebase/messaging",Du="@firebase/messaging-compat",Pu="@firebase/performance",Ou="@firebase/performance-compat",Mu="@firebase/remote-config",Nu="@firebase/remote-config-compat",Ru="@firebase/storage",Lu="@firebase/storage-compat",Vu="@firebase/firestore",qu="@firebase/vertexai-preview",Fu="@firebase/firestore-compat",Bu="firebase",Uu="[DEFAULT]",ju={[du]:"fire-core",[gu]:"fire-core-compat",[vu]:"fire-analytics",[mu]:"fire-analytics-compat",[bu]:"fire-app-check",[yu]:"fire-app-check-compat",[_u]:"fire-auth",[wu]:"fire-auth-compat",[ku]:"fire-rtdb",[xu]:"fire-data-connect",[Tu]:"fire-rtdb-compat",[Cu]:"fire-fn",[Eu]:"fire-fn-compat",[Su]:"fire-iid",[Iu]:"fire-iid-compat",[Au]:"fire-fcm",[Du]:"fire-fcm-compat",[Pu]:"fire-perf",[Ou]:"fire-perf-compat",[Mu]:"fire-rc",[Nu]:"fire-rc-compat",[Ru]:"fire-gcs",[Lu]:"fire-gcs-compat",[Vu]:"fire-fst",[Fu]:"fire-fst-compat",[qu]:"fire-vertex","fire-js":"fire-js",[Bu]:"fire-js-all"},Hu=new Map,zu=new Map,Wu=new Map;function Ku(e,t){try{e.container.addComponent(t)}catch(ZNe){pu.debug("Component ".concat(t.name," failed to register with FirebaseApp ").concat(e.name),ZNe)}}function Gu(e){const t=e.name;if(Wu.has(t))return pu.debug("There were multiple attempts to register component ".concat(t,".")),!1;Wu.set(t,e);for(const n of Hu.values())Ku(n,e);for(const n of zu.values())Ku(n,e);return!0}function Yu(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function Qu(e){return void 0!==e.settings} 375/** 376 * @license 377 * Copyright 2019 Google LLC 378 * 379 * Licensed under the Apache License, Version 2.0 (the "License"); 380 * you may not use this file except in compliance with the License. 381 * You may obtain a copy of the License at 382 * 383 * http://www.apache.org/licenses/LICENSE-2.0 384 * 385 * Unless required by applicable law or agreed to in writing, software 386 * distributed under the License is distributed on an "AS IS" BASIS, 387 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 388 * See the License for the specific language governing permissions and 389 * limitations under the License. 390 */const $u=new mc("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invali
390d-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."}); 391/** 392 * @license 393 * Copyright 2019 Google LLC 394 * 395 * Licensed under the Apache License, Version 2.0 (the "License"); 396 * you may not use this file except in compliance with the License. 397 * You may obtain a copy of the License at 398 * 399 * http://www.apache.org/licenses/LICENSE-2.0 400 * 401 * Unless required by applicable law or agreed to in writing, software 402 * distributed under the License is distributed on an "AS IS" BASIS, 403 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 404 * See the License for the specific language governing permissions and 405 * limitations under the License. 406 */ 407class Xu{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new Lc("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw $u.create("app-deleted",{appName:this._name})}} 408/** 409 * @license 410 * Copyright 2019 Google LLC 411 * 412 * Licensed under the Apache License, Version 2.0 (the "License"); 413 * you may not use this file except in compliance with the License. 414 * You may obtain a copy of the License at 415 * 416 * http://www.apache.org/licenses/LICENSE-2.0 417 * 418 * Unless required by applicable law or agreed to in writing, software 419 * distributed under the License is distributed on an "AS IS" BASIS, 420 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 421 * See the License for the specific language governing permissions and 422 * limitations under the License. 423 */const Ju="10.14.1";function Zu(e,t={}){let n=e;if("object"!=typeof t){t={name:t}}const i=Object.assign({name:Uu,automaticDataCollectionEnabled:!1},t),a=i.name;if("string"!=typeof a||!a)throw $u.create("bad-app-name",{appName:String(a)});if(n||(n=nc()),!n)throw $u.create("no-options");const o=Hu.get(a);if(o){if(Cc(n,o.options)&&Cc(i,o.config))return o;throw $u.create("duplicate-app",{appName:a})}const s=new Fc(a);for(const l of Wu.values())s.addComponent(l);const r=new Xu(n,i,s);return Hu.set(a,r),r}function eh(e=Uu){const t=Hu.get(e);if(!t&&e===Uu&&nc())return Zu();if(!t)throw $u.create("no-app",{appName:e});return t}function th(e,t,n){var i;let a=null!==(i=ju[e])&&void 0!==i?i:e;n&&(a+="-".concat(n));const o=a.match(/\s|\//),s=t.match(/\s|\//);if(o||s){const e=['Unable to register library "'.concat(a,'" with version "').concat(t,'":')];return o&&e.push('library name "'.concat(a,'" contains illegal characters (whitespace or "/")')),o&&s&&e.push("and"),s&&e.push('version name "'.concat(t,'" contains illegal characters (whitespace or "/")')),void pu.warn(e.join(" "))}Gu(new Lc("".concat(a,"-version"),()=>({library:a,version:t}),"VERSION"))} 424/** 425 * @license 426 * Copyright 2021 Google LLC 427 * 428 * Licensed under the Apache License, Version 2.0 (the "License");
429 * you may not use this file except in compliance with the License. 430 * You may obtain a copy of the License at 431 * 432 * http://www.apache.org/licenses/LICENSE-2.0 433 * 434 * Unless required by applicable law or agreed to in writing, software 435 * distributed under the License is distributed on an "AS IS" BASIS, 436 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 437 * See the License for the specific language governing permissions and 438 * limitations under the License. 439 */const nh="firebase-heartbeat-store";let ih=null;function ah(){return ih||(ih=ou("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(nh)}catch(ZNe){}}}).catch(e=>{throw $u.create("idb-open",{originalErrorMessage:e.message})})),ih}async function oh(e,t){try{const n=(await ah()).transaction(nh,"readwrite"),i=n.objectStore(nh);await i.put(t,sh(e)),await n.done}catch(ZNe){if(ZNe instanceof gc)pu.warn(ZNe.message);else{const t=$u.create("idb-set",{originalErrorMessage:null==ZNe?void 0:ZNe.message});pu.warn(t.message)}}}function sh(e){return"".concat(e.name,"!").concat(e.options.appId)} 440/** 441 * @license 442 * Copyright 2021 Google LLC 443 * 444 * Licensed under the Apache License, Version 2.0 (the "License"); 445 * you may not use this file except in compliance with the License. 446 * You may obtain a copy of the License at 447 * 448 * http://www.apache.org/licenses/LICENSE-2.0 449 * 450 * Unless required by applicable law or agreed to in writing, software 451 * distributed under the License is distributed on an "AS IS" BASIS, 452 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 453 * See the License for the specific language governing permissions and 454 * limitations under the License. 455 */class rh{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new ch(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){var e,t;try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),i=lh();if(null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)))return;if(this._heartbeatsCache.lastSentHeartbeatDate===i||this._heartbeatsCache.heartbeats.some(e=>e.date===i))return;return this._heartbeatsCache.heartbeats.push({date:i,agent:n}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(e=>{const t=new Date(e.date).valueOf();return Date.now()-t<=2592e6}),this._storage.overwrite(this._heartbeatsCache)}catch(ZNe){pu.warn(ZNe)}}async getHeartbeatsHeader(){var e;try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const t=lh(),{heartbeatsToSend:n,unsentEntries:i}=function(e,t=1024){const n=[];let i=e.slice();for(const a of e){const e=n.find(e=>e.agent===a.agent);if(e){if(e.dates.push(a.date),uh(n)>t){e.dates.pop();break}}else if(n.push({agent:a.agent,dates:[a.date]}),uh(n)>t){n.pop();break}i=i.slice(1)}return{heartbeatsToSend:n,unsentEntries:i}}(this._heartbeatsCache.heartbeats),a=Gl(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=t,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),a}catch(ZNe){return pu.warn(ZNe),""}}}function lh(){return(new Date).toISOString().substring(0,10)}class ch{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!dc()&&fc().then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await ah()).transaction(nh),n=await t.objectStore(nh).get(sh(e));return await t.done,n}catch(ZNe){if(ZNe instanceof gc)pu.warn(ZNe.message);else{const t=$u.create("idb-get",{originalErrorMessage:null==ZNe?void 0:ZNe.message});pu.warn(t.message)}}}(this.app);return(null==e?void 0:e.heartbeats)?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return oh(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return oh(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}
455function uh(e){return Gl(JSON.stringify({version:2,heartbeats:e})).length} 456/** 457 * @license 458 * Copyright 2019 Google LLC 459 * 460 * Licensed under the Apache License, Version 2.0 (the "License"); 461 * you may not use this file except in compliance with the License. 462 * You may obtain a copy of the License at 463 * 464 * http://www.apache.org/licenses/LICENSE-2.0 465 * 466 * Unless required by applicable law or agreed to in writing, software 467 * distributed under the License is distributed on an "AS IS" BASIS, 468 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 469 * See the License for the specific language governing permissions and 470 * limitations under the License. 471 */var hh;function dh(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]])}return n}function fh(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}hh="",Gu(new Lc("platform-logger",e=>new hu(e),"PRIVATE")),Gu(new Lc("heartbeat",e=>new rh(e),"PRIVATE")),th(du,fu,hh),th(du,fu,"esm2017"),th("fire-js",""),"function"==typeof SuppressedError&&SuppressedError;const ph=fh,gh=new mc("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),mh=new Kc("@firebase/auth");function vh(e,...t){mh.logLevel<=Bc.ERROR&&mh.error("Auth (".concat(Ju,"): ").concat(e),...t)} 472/** 473 * @license 474 * Copyright 2020 Google LLC 475 * 476 * Licensed under the Apache License, Version 2.0 (the "License"); 477 * you may not use this file except in compliance with the License. 478 * You may obtain a copy of the License at 479 * 480 * http://www.apache.org/licenses/LICENSE-2.0 481 * 482 * Unless required by applicable law or agreed to in writing, software 483 * distributed under the License is distributed on an "AS IS" BASIS, 484 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 485 * See the License for the specific language governing permissions and 486 * limitations under the License. 487 */function yh(e,...t){throw kh(e,...t)}function bh(e,...t){return kh(e,...t)}function _h(e,t,n){const i=Object.assign(Object.assign({},ph()),{[t]:n});return new mc("auth","Firebase",i).create(t,{appName:e.name})}function wh(e){return _h(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function kh(e,...t){if("string"!=typeof e){const n=t[0],i=[...t.slice(1)];return i[0]&&(i[0].appName=e.name),e._errorFactory.create(n,...i)}return gh.create(e,...t)}function xh(e,t,...n){if(!e)throw kh(t,...n)}function Th(e){const t="INTERNAL ASSERTION FAILED: "+e;throw vh(t),new Error(t)}function Ch(e,t){e||Th(t)} 488/** 489 * @license 490 * Copyright 2020 Google LLC 491 * 492 * Licensed under the Apache License, Version 2.0 (the "License"); 493 * you may not use this file except in compliance with the License. 494 * You may obtain a copy of the License at 495 * 496 * http://www.apache.org/licenses/LICENSE-2.0 497 * 498 * Unless required by applicable law or agreed to in writing, software 499 * distributed under the License is distributed on an "AS IS" BASIS, 500 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 501 * See the License for the specific language governing permissions and 502 * limitations under the License. 503 */function Eh(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function Sh(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null} 504/** 505 * @license 506 * Copyright 2020 Google LLC 507 * 508 * Licensed under the Apache License, Version 2.0 (the "License");
509 * you may not use this file except in compliance with the License. 510 * You may obtain a copy of the License at 511 * 512 * http://www.apache.org/licenses/LICENSE-2.0 513 * 514 * Unless required by applicable law or agreed to in writing, software 515 * distributed under the License is distributed on an "AS IS" BASIS, 516 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 517 * See the License for the specific language governing permissions and 518 * limitations under the License. 519 */function Ih(){return"undefined"==typeof navigator||!navigator||!("onLine"in navigator)||"boolean"!=typeof navigator.onLine||"http:"!==Sh()&&"https:"!==Sh()&&!lc()&&!("connection"in navigator)||navigator.onLine} 520/** 521 * @license 522 * Copyright 2020 Google LLC 523 * 524 * Licensed under the Apache License, Version 2.0 (the "License"); 525 * you may not use this file except in compliance with the License. 526 * You may obtain a copy of the License at 527 * 528 * http://www.apache.org/licenses/LICENSE-2.0 529 * 530 * Unless required by applicable law or agreed to in writing, software 531 * distributed under the License is distributed on an "AS IS" BASIS, 532 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 533 * See the License for the specific language governing permissions and 534 * limitations under the License. 535 */ 536class Ah{constructor(e,t){this.shortDelay=e,this.longDelay=t,Ch(t>e,"Short delay should be less than long delay!"),this.isMobile=rc()||cc()}get(){return Ih()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}} 537/** 538 * @license 539 * Copyright 2020 Google LLC 540 * 541 * Licensed under the Apache License, Version 2.0 (the "License"); 542 * you may not use this file except in compliance with the License. 543 * You may obtain a copy of the License at 544 * 545 * http://www.apache.org/licenses/LICENSE-2.0 546 * 547 * Unless required by applicable law or agreed to in writing, software 548 * distributed under the License is distributed on an "AS IS" BASIS, 549 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 550 * See the License for the specific language governing permissions and 551 * limitations under the License. 552 */function Dh(e,t){Ch(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?"".concat(n).concat(t.startsWith("/")?t.slice(1):t):n} 553/** 554 * @license 555 * Copyright 2020 Google LLC 556 * 557 * Licensed under the Apache License, Version 2.0 (the "License"); 558 * you may not use this file except in compliance with the License. 559 * You may obtain a copy of the License at 560 * 561 * http://www.apache.org/licenses/LICENSE-2.0 562 * 563 * Unless required by applicable law or agreed to in writing, software 564 * distributed under the License is distributed on an "AS IS" BASIS, 565 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 566 * See the License for the specific language governing permissions and 567 * limitations under the License. 568 */class Ph{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:"undefined"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!=typeof fetch?fetch:void Th("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:"undefined"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!=typeof Headers?Headers:void Th("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:"undefined"!=typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!=typeof Response?Response:void Th("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}} 569/** 570 * @license 571 * Copyright 2020 Google LLC 572 * 573 * Licensed under the Apache License, Version 2.0 (the "License");
574 * you may not use this file except in compliance with the License. 575 * You may obtain a copy of the License at 576 * 577 * http://www.apache.org/licenses/LICENSE-2.0 578 * 579 * Unless required by applicable law or agreed to in writing, software 580 * distributed under the License is distributed on an "AS IS" BASIS, 581 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 582 * See the License for the specific language governing permissions and 583 * limitations under the License. 584 */const Oh={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},Mh=new Ah(3e4,6e4); 585/** 586 * @license 587 * Copyright 2020 Google LLC 588 * 589 * Licensed under the Apache License, Version 2.0 (the "License"); 590 * you may not use this file except in compliance with the License. 591 * You may obtain a copy of the License at 592 * 593 * http://www.apache.org/licenses/LICENSE-2.0 594 * 595 * Unless required by applicable law or agreed to in writing, software 596 * distributed under the License is distributed on an "AS IS" BASIS, 597 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 598 * See the License for the specific language governing permissions and 599 * limitations under the License. 600 */function Nh(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function Rh(e,t,n,i,a={}){return Lh(e,a,async()=>{let a={},o={};i&&("GET"===t?o=i:a={body:JSON.stringify(i)});const s=Sc(Object.assign({key:e.config.apiKey},o)).slice(1),r=await e._getAdditionalHeaders();r["Content-Type"]="application/json",e.languageCode&&(r["X-Firebase-Locale"]=e.languageCode);const l=Object.assign({method:t,headers:r},a);return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||(l.referrerPolicy="no-referrer"),Ph.fetch()(qh(e,e.config.apiHost,n,s),l)})}async function Lh(e,t,n){e._canInitEmulator=!1;const i=Object.assign(Object.assign({},Oh),t);try{const t=new Bh(e),a=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const o=await a.json();if("needConfirmation"in o)throw Uh(e,"account-exists-with-different-credential",o);if(a.ok&&!("errorMessage"in o))return o;{const t=a.ok?o.errorMessage:o.error.message,[n,s]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw Uh(e,"credential-already-in-use",o);if("EMAIL_EXISTS"===n)throw Uh(e,"email-already-in-use",o);if("USER_DISABLED"===n)throw Uh(e,"user-disabled",o);const r=i[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(s)throw _h(e,r,s);yh(e,r)}}catch(ZNe){if(ZNe instanceof gc)throw ZNe;yh(e,"network-request-failed",{message:String(ZNe)})}}async function Vh(e,t,n,i,a={}){const o=await Rh(e,t,n,i,a);return"mfaPendingCredential"in o&&yh(e,"multi-factor-auth-required",{_serverResponse:o}),o}function qh(e,t,n,i){const a="".concat(t).concat(n,"?").concat(i);return e.config.emulator?Dh(e.config,a):"".concat(e.config.apiScheme,"://").concat(a)}function Fh(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Bh{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>
600{this.timer=setTimeout(()=>t(bh(this.auth,"network-request-failed")),Mh.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function Uh(e,t,n){const i={appName:e.name};n.email&&(i.email=n.email),n.phoneNumber&&(i.phoneNumber=n.phoneNumber);const a=bh(e,t,i);return a.customData._tokenResponse=n,a}function jh(e){return void 0!==e&&void 0!==e.enterprise}class Hh{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return Fh(t.enforcementState);return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}}async function zh(e,t){return Rh(e,"POST","/v1/accounts:lookup",t)} 601/** 602 * @license 603 * Copyright 2020 Google LLC 604 * 605 * Licensed under the Apache License, Version 2.0 (the "License"); 606 * you may not use this file except in compliance with the License. 607 * You may obtain a copy of the License at 608 * 609 * http://www.apache.org/licenses/LICENSE-2.0 610 * 611 * Unless required by applicable law or agreed to in writing, software 612 * distributed under the License is distributed on an "AS IS" BASIS, 613 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 614 * See the License for the specific language governing permissions and 615 * limitations under the License. 616 */function Wh(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(ZNe){}}function Kh(e){return 1e3*Number(e)}function Gh(e){const[t,n,i]=e.split(".");if(void 0===t||void 0===n||void 0===i)return vh("JWT malformed, contained fewer than 3 sections"),null;try{const e=Yl(n);return e?JSON.parse(e):(vh("Failed to decode base64 JWT payload"),null)}catch(ZNe){return vh("Caught error parsing JWT payload as JSON",null==ZNe?void 0:ZNe.toString()),null}}function Yh(e){const t=Gh(e);return xh(t,"internal-error"),xh(void 0!==t.exp,"internal-error"),xh(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)} 617/** 618 * @license 619 * Copyright 2020 Google LLC 620 * 621 * Licensed under the Apache License, Version 2.0 (the "License"); 622 * you may not use this file except in compliance with the License. 623 * You may obtain a copy of the License at 624 * 625 * http://www.apache.org/licenses/LICENSE-2.0 626 * 627 * Unless required by applicable law or agreed to in writing, software 628 * distributed under the License is distributed on an "AS IS" BASIS, 629 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 630 * See the License for the specific language governing permissions and 631 * limitations under the License. 632 */async function Qh(e,t,n=!1){if(n)return t;try{return await t}catch(ZNe){throw ZNe instanceof gc&&function({code:e}){return e==="auth/".concat("user-disabled")||e==="auth/".concat("user-token-expired")} 633/** 634 * @license 635 * Copyright 2020 Google LLC 636 * 637 * Licensed under the Apache License, Version 2.0 (the "License"); 638 * you may not use this file except in compliance with the License. 639 * You may obtain a copy of the License at 640 * 641 * http://www.apache.org/licenses/LICENSE-2.0 642 * 643 * Unless required by applicable law or agreed to in writing, software 644 * distributed under the License is distributed on an "AS IS" BASIS, 645 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 646 * See the License for the specific language governing permissions and 647 * limitations under the License. 648 */(ZNe)&&e.auth.currentUser===e&&await e.auth.signOut(),ZNe}}class $h{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,e)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(ZNe){return void((null==ZNe?void 0:ZNe.code)==="auth/".concat("network-request-failed")&&this.schedule(!0))}this.schedule()}} 649/** 650 * @license 651 * Copyright 2020 Google LLC 652 * 653 * Licensed under the Apache License, Version 2.0 (the "License");
654 * you may not use this file except in compliance with the License. 655 * You may obtain a copy of the License at 656 * 657 * http://www.apache.org/licenses/LICENSE-2.0 658 * 659 * Unless required by applicable law or agreed to in writing, software 660 * distributed under the License is distributed on an "AS IS" BASIS, 661 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 662 * See the License for the specific language governing permissions and 663 * limitations under the License. 664 */class Xh{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=Wh(this.lastLoginAt),this.creationTime=Wh(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}} 665/** 666 * @license 667 * Copyright 2019 Google LLC 668 * 669 * Licensed under the Apache License, Version 2.0 (the "License"); 670 * you may not use this file except in compliance with the License. 671 * You may obtain a copy of the License at 672 * 673 * http://www.apache.org/licenses/LICENSE-2.0 674 * 675 * Unless required by applicable law or agreed to in writing, software 676 * distributed under the License is distributed on an "AS IS" BASIS, 677 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 678 * See the License for the specific language governing permissions and 679 * limitations under the License. 680 */async function Jh(e){var t;const n=e.auth,i=await e.getIdToken(),a=await Qh(e,zh(n,{idToken:i}));xh(null==a?void 0:a.users.length,n,"internal-error");const o=a.users[0];e._notifyReloadListener(o);const s=(null===(t=o.providerUserInfo)||void 0===t?void 0:t.length)?Zh(o.providerUserInfo):[],r=(l=e.providerData,c=s,[...l.filter(e=>!c.some(t=>t.providerId===e.providerId)),...c]);var l,c;const u=e.isAnonymous,h=!(e.email&&o.passwordHash||(null==r?void 0:r.length)),d=!!u&&h,f={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:r,metadata:new Xh(o.createdAt,o.lastLoginAt),isAnonymous:d};Object.assign(e,f)}function Zh(e){return e.map(e=>{var{providerId:t}=e,n=dh(e,["providerId"]);return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})} 681/** 682 * @license 683 * Copyright 2020 Google LLC 684 * 685 * Licensed under the Apache License, Version 2.0 (the "License"); 686 * you may not use this file except in compliance with the License. 687 * You may obtain a copy of the License at 688 * 689 * http://www.apache.org/licenses/LICENSE-2.0 690 * 691 * Unless required by applicable law or agreed to in writing, software 692 * distributed under the License is distributed on an "AS IS" BASIS, 693 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 694 * See the License for the specific language governing permissions and 695 * limitations under the License. 696 */ 697/** 698 * @license 699 * Copyright 2020 Google LLC 700 * 701 * Licensed under the Apache License, Version 2.0 (the "License"); 702 * you may not use this file except in compliance with the License. 703 * You may obtain a copy of the License at 704 * 705 * http://www.apache.org/licenses/LICENSE-2.0 706 * 707 * Unless required by applicable law or agreed to in writing, software 708 * distributed under the License is distributed on an "AS IS" BASIS, 709 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 710 * See the License for the specific language governing permissions and 711 * limitations under the License. 712 */ 713class ed{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){xh(e.idToken,"internal-error"),xh(void 0!==e.idToken,"internal-error"),xh(void 0!==e.refreshToken,"internal-error");const t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):Yh(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){xh(0!==e.length,"internal-error");const t=Yh(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return t||!this.accessToken||this.isExpired?(xh(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:n,refreshToken:i,expiresIn:a}=await async function(e,t){const n=await Lh(e,{},async()=>{const n=Sc({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:i,apiKey:a}=e.config,o=qh(e,i,"/v1/token","key=".concat(a)),s=await e._getAdditionalHeaders();return s["Content-Type"]="application/x-www-form-urlencoded",Ph.fetch()(o,{method:"POST",headers:s,body:n})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,i,Number(a))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:i,expirationTime:a}=t,o=new ed;return n&&(xh("string"==typeof n,"internal-error",{appName:e}),o.refreshToken=n),i&&(xh("string"==typeof i,"internal-error",{appName:e}),o.accessToken=i),a&&(xh("number"==typeof a,"internal-error",{appName:e}),o.expirationTime=a),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new ed,this.toJSON())}_performRefresh(){return Th("not implemented")}} 714/** 715 * @license 716 * Copyright 2020 Google LLC 717 * 718 * Licensed under the Apache License, Version 2.0 (the "License");
719 * you may not use this file except in compliance with the License. 720 * You may obtain a copy of the License at 721 * 722 * http://www.apache.org/licenses/LICENSE-2.0 723 * 724 * Unless required by applicable law or agreed to in writing, software 725 * distributed under the License is distributed on an "AS IS" BASIS, 726 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 727 * See the License for the specific language governing permissions and 728 * limitations under the License. 729 */function td(e,t){xh("string"==typeof e||void 0===e,"internal-error",{appName:t})}class nd{constructor(e){var{uid:t,auth:n,stsTokenManager:i}=e,a=dh(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new $h(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=a.displayName||null,this.email=a.email||null,this.emailVerified=a.emailVerified||!1,this.phoneNumber=a.phoneNumber||null,this.photoURL=a.photoURL||null,this.isAnonymous=a.isAnonymous||!1,this.tenantId=a.tenantId||null,this.providerData=a.providerData?[...a.providerData]:[],this.metadata=new Xh(a.createdAt||void 0,a.lastLoginAt||void 0)}async getIdToken(e){const t=await Qh(this,this.stsTokenManager.getToken(this.auth,e));return xh(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e,t=!1){const n=Rc(e),i=await n.getIdToken(t),a=Gh(i);xh(a&&a.exp&&a.auth_time&&a.iat,n.auth,"internal-error");const o="object"==typeof a.firebase?a.firebase:void 0,s=null==o?void 0:o.sign_in_provider;return{claims:a,token:i,authTime:Wh(Kh(a.auth_time)),issuedAtTime:Wh(Kh(a.iat)),expirationTime:Wh(Kh(a.exp)),signInProvider:s||null,signInSecondFactor:(null==o?void 0:o.sign_in_second_factor)||null}}(this,e)}reload(){return async function(e){const t=Rc(e);await Jh(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(xh(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(e=>Object.assign({},e)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new nd(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){xh(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await Jh(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Qu(this.auth.app))return Promise.reject(wh(this.auth));const e=await this.getIdToken();return await Qh(this, 730/** 731 * @license 732 * Copyright 2020 Google LLC 733 * 734 * Licensed under the Apache License, Version 2.0 (the "License"); 735 * you may not use this file except in compliance with the License. 736 * You may obtain a copy of the License at 737 * 738 * http://www.apache.org/licenses/LICENSE-2.0 739 * 740 * Unless required by applicable law or agreed to in writing, software 741 * distributed under the License is distributed on an "AS IS" BASIS, 742 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 743 * See the License for the specific language governing permissions and 744 * limitations under the License. 745 */ 746async function(e,t){return Rh(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isA
vendor: 4,147 bytes, lines 746-783
746nonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var n,i,a,o,s,r,l,c;const u=null!==(n=t.displayName)&&void 0!==n?n:void 0,h=null!==(i=t.email)&&void 0!==i?i:void 0,d=null!==(a=t.phoneNumber)&&void 0!==a?a:void 0,f=null!==(o=t.photoURL)&&void 0!==o?o:void 0,p=null!==(s=t.tenantId)&&void 0!==s?s:void 0,g=null!==(r=t._redirectEventId)&&void 0!==r?r:void 0,m=null!==(l=t.createdAt)&&void 0!==l?l:void 0,v=null!==(c=t.lastLoginAt)&&void 0!==c?c:void 0,{uid:y,emailVerified:b,isAnonymous:_,providerData:w,stsTokenManager:k}=t;xh(y&&k,e,"internal-error");const x=ed.fromJSON(this.name,k);xh("string"==typeof y,e,"internal-error"),td(u,e.name),td(h,e.name),xh("boolean"==typeof b,e,"internal-error"),xh("boolean"==typeof _,e,"internal-error"),td(d,e.name),td(f,e.name),td(p,e.name),td(g,e.name),td(m,e.name),td(v,e.name);const T=new nd({uid:y,auth:e,email:h,emailVerified:b,displayName:u,isAnonymous:_,photoURL:f,phoneNumber:d,tenantId:p,stsTokenManager:x,createdAt:m,lastLoginAt:v});return w&&Array.isArray(w)&&(T.providerData=w.map(e=>Object.assign({},e))),g&&(T._redirectEventId=g),T}static async _fromIdTokenResponse(e,t,n=!1){const i=new ed;i.updateFromServerResponse(t);const a=new nd({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:n});return await Jh(a),a}static async _fromGetAccountInfoResponse(e,t,n){const i=t.users[0];xh(void 0!==i.localId,"internal-error");const a=void 0!==i.providerUserInfo?Zh(i.providerUserInfo):[],o=!(i.email&&i.passwordHash||(null==a?void 0:a.length)),s=new ed;s.updateFromIdToken(n);const r=new nd({uid:i.localId,auth:e,stsTokenManager:s,isAnonymous:o}),l={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:a,metadata:new Xh(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash||(null==a?void 0:a.length))};return Object.assign(r,l),r}} 747/** 748 * @license 749 * Copyright 2020 Google LLC 750 * 751 * Licensed under the Apache License, Version 2.0 (the "License"); 752 * you may not use this file except in compliance with the License. 753 * You may obtain a copy of the License at 754 * 755 * http://www.apache.org/licenses/LICENSE-2.0 756 * 757 * Unless required by applicable law or agreed to in writing, software 758 * distributed under the License is distributed on an "AS IS" BASIS, 759 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 760 * See the License for the specific language governing permissions and 761 * limitations under the License. 762 */const id=new Map;function ad(e){Ch(e instanceof Function,"Expected a class definition");let t=id.get(e);return t?(Ch(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,id.set(e,t),t)} 763/** 764 * @license 765 * Copyright 2019 Google LLC 766 * 767 * Licensed under the Apache License, Version 2.0 (the "License"); 768 * you may not use this file except in compliance with the License. 769 * You may obtain a copy of the License at 770 * 771 * http://www.apache.org/licenses/LICENSE-2.0 772 * 773 * Unless required by applicable law or agreed to in writing, software 774 * distributed under the License is distributed on an "AS IS" BASIS, 775 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 776 * See the License for the specific language governing permissions and 777 * limitations under the License. 778 */class od{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}od.type="NONE";const sd=od; 779/** 780 * @license 781 * Copyright 2019 Google LLC 782 * 783 * Licensed under the Apache License, Version 2.0 (the "License");
784 * you may not use this file except in compliance with the License. 785 * You may obtain a copy of the License at 786 * 787 * http://www.apache.org/licenses/LICENSE-2.0 788 * 789 * Unless required by applicable law or agreed to in writing, software 790 * distributed under the License is distributed on an "AS IS" BASIS, 791 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 792 * See the License for the specific language governing permissions and 793 * limitations under the License. 794 */function rd(e,t,n){return"".concat("firebase",":").concat(e,":").concat(t,":").concat(n)}class ld{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:i,name:a}=this.auth;this.fullUserKey=rd(this.userKey,i.apiKey,a),this.fullPersistenceKey=rd("persistence",i.apiKey,a),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?nd._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,n="authUser"){if(!t.length)return new ld(ad(sd),e,n);const i=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e);let a=i[0]||ad(sd);const o=rd(n,e.config.apiKey,e.name);let s=null;for(const c of t)try{const t=await c._get(o);if(t){const n=nd._fromJSON(e,t);c!==a&&(s=n),a=c;break}}catch(l){}const r=i.filter(e=>e._shouldAllowMigration);return a._shouldAllowMigration&&r.length?(a=r[0],s&&await a._set(o,s.toJSON()),await Promise.all(t.map(async e=>{if(e!==a)try{await e._remove(o)}catch(l){}})),new ld(a,e,n)):new ld(a,e,n)}} 795/** 796 * @license 797 * Copyright 2020 Google LLC 798 * 799 * Licensed under the Apache License, Version 2.0 (the "License"); 800 * you may not use this file except in compliance with the License. 801 * You may obtain a copy of the License at 802 * 803 * http://www.apache.org/licenses/LICENSE-2.0 804 * 805 * Unless required by applicable law or agreed to in writing, software 806 * distributed under the License is distributed on an "AS IS" BASIS, 807 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 808 * See the License for the specific language governing permissions and 809 * limitations under the License. 810 */function cd(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(fd(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(ud(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(gd(t))return"Blackberry";if(md(t))return"Webos";if(hd(t))return"Safari";if((t.includes("chrome/")||dd(t))&&!t.includes("edge/"))return"Chrome";if(pd(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===(null==n?void 0:n.length))return n[1]}return"Other"}function ud(e=sc()){return/firefox\//i.test(e)}function hd(e=sc()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function dd(e=sc()){return/crios\//i.test(e)}function fd(e=sc()){return/iemobile/i.test(e)}function pd(e=sc()){return/android/i.test(e)}function gd(e=sc()){return/blackberry/i.test(e)}function md(e=sc()){return/webos/i.test(e)}function vd(e=sc()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function yd(){return function(){const e=sc();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}()&&10===document.documentMode}function bd(e=sc()){return vd(e)||pd(e)||md(e)||gd(e)||/windows phone/i.test(e)||fd(e)} 811/** 812 * @license 813 * Copyright 2020 Google LLC 814 * 815 * Licensed under the Apache License, Version 2.0 (the "License");
816 * you may not use this file except in compliance with the License. 817 * You may obtain a copy of the License at 818 * 819 * http://www.apache.org/licenses/LICENSE-2.0 820 * 821 * Unless required by applicable law or agreed to in writing, software 822 * distributed under the License is distributed on an "AS IS" BASIS, 823 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 824 * See the License for the specific language governing permissions and 825 * limitations under the License. 826 */function _d(e,t=[]){let n;switch(e){case"Browser":n=cd(sc());break;case"Worker":n="".concat(cd(sc()),"-").concat(e);break;default:n=e}const i=t.length?t.join(","):"FirebaseCore-web";return"".concat(n,"/").concat("JsCore","/").concat(Ju,"/").concat(i)} 827/** 828 * @license 829 * Copyright 2022 Google LLC 830 * 831 * Licensed under the Apache License, Version 2.0 (the "License"); 832 * you may not use this file except in compliance with the License. 833 * You may obtain a copy of the License at 834 * 835 * http://www.apache.org/licenses/LICENSE-2.0 836 * 837 * Unless required by applicable law or agreed to in writing, software 838 * distributed under the License is distributed on an "AS IS" BASIS, 839 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 840 * See the License for the specific language governing permissions and 841 * limitations under the License. 842 */class wd{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise((n,i)=>{try{n(e(t))}catch(ZNe){i(ZNe)}});n.onAbort=t,this.queue.push(n);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(ZNe){t.reverse();for(const i of t)try{i()}catch(n){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==ZNe?void 0:ZNe.message})}}} 843/** 844 * @license 845 * Copyright 2023 Google LLC 846 * 847 * Licensed under the Apache License, Version 2.0 (the "License"); 848 * you may not use this file except in compliance with the License. 849 * You may obtain a copy of the License at 850 * 851 * http://www.apache.org/licenses/LICENSE-2.0 852 * 853 * Unless required by applicable law or agreed to in writing, software 854 * distributed under the License is distributed on an "AS IS" BASIS, 855 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 856 * See the License for the specific language governing permissions and 857 * limitations under the License. 858 */class kd{constructor(e){var t,n,i,a;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(t=o.minPasswordLength)&&void 0!==t?t:6,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),void 0!==o.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),void 0!==o.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),void 0!==o.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),void 0!==o.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(i=null===(n=e.allowedNonAlphanumericCharacters)||void 0===n?void 0:n.join(""))&&void 0!==i?i:"",this.forceUpgradeOnSignin=null!==(a=e.forceUpgradeOnSignin)&&void 0!==a&&a,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,n,i,a,o,s;const r={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,r),this.validatePasswordCharacterOptions(e,r),r.isValid&&(r.isValid=null===(t=r.meetsMinPasswordLength)||void 0===t||t),r.isValid&&(r.isValid=null===(n=r.meetsMaxPasswordLength)||void 0===n||n),r.isValid&&(r.isValid=null===(i=r.containsLowercaseLetter)||void 0===i||i),r.isValid&&(r.isValid=null===(a=r.containsUppercaseLetter)||void 0===a||a),r.isValid&&
858(r.isValid=null===(o=r.containsNumericCharacter)||void 0===o||o),r.isValid&&(r.isValid=null===(s=r.containsNonAlphanumericCharacter)||void 0===s||s),r}validatePasswordLengthOptions(e,t){const n=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){let n;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let i=0;i<e.length;i++)n=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(t,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,t,n,i,a){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=a))}} 859/** 860 * @license 861 * Copyright 2020 Google LLC 862 * 863 * Licensed under the Apache License, Version 2.0 (the "License"); 864 * you may not use this file except in compliance with the License. 865 * You may obtain a copy of the License at 866 * 867 * http://www.apache.org/licenses/LICENSE-2.0 868 * 869 * Unless required by applicable law or agreed to in writing, software 870 * distributed under the License is distributed on an "AS IS" BASIS, 871 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 872 * See the License for the specific language governing permissions and 873 * limitations under the License. 874 */class xd{constructor(e,t,n,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Cd(this),this.idTokenSubscription=new Cd(this),this.beforeStateQueue=new wd(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=gh,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=ad(t)),this._initializationPromise=this.queue(async()=>{var n,i;if(!this._deleted&&(this.persistenceManager=await ld.create(this,e),!this._deleted)){if(null===(n=this._popupRedirectResolver)||void 0===n?void 0:n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(ZNe){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(i=this.currentUser)||void 0===i?void 0:i.uid)||null,this._deleted||(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void(await this.currentUser.getIdToken())):void(await this._updateCurrentUser(e,!0)):void 0}async initializeCurrentUserFromIdToken(e){try{const t=await zh(this,{idToken:e}),n=await nd._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(n)}catch(t){await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if(Qu(this.app)){const e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let i=n,a=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const n=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,o=null==i?void 0:i._redirectEventId,s=await this.tryRedirectSignIn(e);n&&n!==o||!(null==s?void 0:s.user)||(i=s.user,a=!0)}if(!i)return this.directlySetCurrentUser(null);
874if(!i._redirectEventId){if(a)try{await this.beforeStateQueue.runMiddleware(i)}catch(ZNe){i=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(ZNe))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return xh(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(ZNe){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await Jh(e)}catch(ZNe){if((null==ZNe?void 0:ZNe.code)!=="auth/".concat("network-request-failed"))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Qu(this.app))return Promise.reject(wh(this));const t=e?Rc(e):null;return t&&xh(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&xh(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Qu(this.app)?Promise.reject(wh(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Qu(this.app)?Promise.reject(wh(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(ad(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await async function(e,t={}){return Rh(e,"GET","/v2/passwordPolicy",Nh(e,t))} 875/** 876 * @license 877 * Copyright 2023 Google LLC 878 * 879 * Licensed under the Apache License, Version 2.0 (the "License"); 880 * you may not use this file except in compliance with the License. 881 * You may obtain a copy of the License at 882 * 883 * http://www.apache.org/licenses/LICENSE-2.0 884 * 885 * Unless required by applicable law or agreed to in writing, software 886 * distributed under the License is distributed on an "AS IS" BASIS, 887 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 888 * See the License for the specific language governing permissions and 889 * limitations under the License. 890 */(this),t=new kd(e);null===this.tenantId?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new mc("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const n=this.onAuthStateChanged(()=>{n(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await async function(e,t){return Rh(e,"POST","/v2/accounts:revokeToken",Nh(e,t))}(this,t)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&ad(e)||this._popupRedirectResolver;xh(t,this,"argument-error"),this.redirectPersistenceManager=await ld.create(this,[ad(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,n;return this._isInitialized&&await this.queue(async()=>{}),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e?this._currentUser:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return"".concat(this.config.authDomain,":").concat(this.config.apiKey,":").concat(this.name)}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,i){if(this._deleted)return()=>{};const a="function"==typeof t?t:t.next.bind(t);let o=!1;const s=this._isInitialized?Promise.resolve():this._initializationPromise;if(xh(s,this,"internal-error"),s.then(()=>{o||a(this.currentUser)}),"function"==typeof t){const a=e.addObserver(t,n,i);return()=>{o=!0,a()}}{const n=e.addObserver(t);return()=>{o=!0,n()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return xh(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=_d(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await(null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const i=await this._getAppCheckToken();return i&&(t["X-Firebase-AppCheck"]=i),t}async _getAppCheckToken(){var e;const t=await(null===(e=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getToken());return(null==t?void 0:t.error)&&function(e,...t){mh.logLevel<=Bc.WARN&&mh.warn("Auth (".concat(Ju,"): ").concat(e),...t)}("Error while retrieving App Check token: ".concat(t.error)),null==t?void 0:t.token}}function Td(e){return Rc(e)}class Cd{constructor(e){this.auth=e,this.observer=null,this.addObserver=function(e,t){const n=new Pc(e,t);return n.subscribe.bind(n)}(e=>this.observer=e)}get next(){return xh(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}} 891/** 892 * @license 893 * Copyright 2020 Google LLC 894 * 895 * Licensed under the Apache License, Version 2.0 (the "License");
896 * you may not use this file except in compliance with the License. 897 * You may obtain a copy of the License at 898 * 899 * http://www.apache.org/licenses/LICENSE-2.0 900 * 901 * Unless required by applicable law or agreed to in writing, software 902 * distributed under the License is distributed on an "AS IS" BASIS, 903 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 904 * See the License for the specific language governing permissions and 905 * limitations under the License. 906 */let Ed={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Sd(e){return Ed.loadJS(e)}class Id{constructor(e){this.type="recaptcha-enterprise",this.auth=Td(e)}async verify(e="verify",t=!1){async function n(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,n)=>{(async function(e,t){return Rh(e,"GET","/v2/recaptchaConfig",Nh(e,t))})(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(i=>{if(void 0!==i.recaptchaKey){const n=new Hh(i);return null==e.tenantId?e._agentRecaptchaConfig=n:e._tenantRecaptchaConfigs[e.tenantId]=n,t(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))}).catch(e=>{n(e)})})}function i(t,n,i){const a=window.grecaptcha;jh(a)?a.enterprise.ready(()=>{a.enterprise.execute(t,{action:e}).then(e=>{n(e)}).catch(()=>{n("NO_RECAPTCHA")})}):i(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((e,a)=>{n(this.auth).then(n=>{if(!t&&jh(window.grecaptcha))i(n,e,a);else{if("undefined"==typeof window)return void a(new Error("RecaptchaVerifier is only supported in browser"));let t=Ed.recaptchaEnterpriseScript;0!==t.length&&(t+=n),Sd(t).then(()=>{i(n,e,a)}).catch(e=>{a(e)})}}).catch(e=>{a(e)})})}}async function Ad(e,t,n,i=!1){const a=new Id(e);let o;try{o=await a.verify(n)}catch(r){o=await a.verify(n,!0)}const s=Object.assign({},t);return i?Object.assign(s,{captchaResp:o}):Object.assign(s,{captchaResponse:o}),Object.assign(s,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(s,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),s}async function Dd(e,t,n,i){var a;if(null===(a=e._getRecaptchaConfig())||void 0===a?void 0:a.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const a=await Ad(e,t,n,"getOobCode"===n);return i(e,a)}return i(e,t).catch(async a=>{if(a.code==="auth/".concat("missing-recaptcha-token")){const a=await Ad(e,t,n,"getOobCode"===n);return i(e,a)}return Promise.reject(a)})} 907/** 908 * @license 909 * Copyright 2020 Google LLC 910 * 911 * Licensed under the Apache License, Version 2.0 (the "License"); 912 * you may not use this file except in compliance with the License. 913 * You may obtain a copy of the License at 914 * 915 * http://www.apache.org/licenses/LICENSE-2.0 916 * 917 * Unless required by applicable law or agreed to in writing, software 918 * distributed under the License is distributed on an "AS IS" BASIS, 919 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 920 * See the License for the specific language governing permissions and 921 * limitations under the License. 922 */function Pd(e,t,n){const i=Td(e);xh(i._canInitEmulator,i,"emulator-config-failed"),xh(/^https?:\/\//.test(t),i,"invalid-emulator-scheme");const a=Od(t),{host:o,port:s}=function(e){const t=Od(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const i=n[2].split("@").pop()||"",a=/^(\[[^\]]+\])(:|$)/.exec(i);if(a){const e=a[1];return{host:e,port:Md(i.substr(e.length+1))}}{const[e,t]=i.split(":");return{host:e,port:Md(t)}}}(t),r=null===s?"":":".concat(s);i.config.emulator={url:"".concat(a,"//").concat(o).concat(r,"/")},i.settings.appVerificationDisabledForTesting=!0,i.emulatorConfig=Object.freeze({host:o,port:s,protocol:a.replace(":",""),options:Object.freeze({disableWarnings:!1})}),function(){function e(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!=typeof console&&console.info;"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())} 923/** 924 * @license 925 * Copyright 2020 Google LLC 926 * 927 * Licensed under the Apache License, Version 2.0 (the "License");
928 * you may not use this file except in compliance with the License. 929 * You may obtain a copy of the License at 930 * 931 * http://www.apache.org/licenses/LICENSE-2.0 932 * 933 * Unless required by applicable law or agreed to in writing, software 934 * distributed under the License is distributed on an "AS IS" BASIS, 935 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 936 * See the License for the specific language governing permissions and 937 * limitations under the License. 938 */()}function Od(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function Md(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class Nd{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return Th("not implemented")}_getIdTokenResponse(e){return Th("not implemented")}_linkToIdToken(e,t){return Th("not implemented")}_getReauthenticationResolver(e){return Th("not implemented")}}async function Rd(e,t){return Rh(e,"POST","/v1/accounts:signUp",t)} 939/** 940 * @license 941 * Copyright 2020 Google LLC 942 * 943 * Licensed under the Apache License, Version 2.0 (the "License"); 944 * you may not use this file except in compliance with the License. 945 * You may obtain a copy of the License at 946 * 947 * http://www.apache.org/licenses/LICENSE-2.0 948 * 949 * Unless required by applicable law or agreed to in writing, software 950 * distributed under the License is distributed on an "AS IS" BASIS, 951 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 952 * See the License for the specific language governing permissions and 953 * limitations under the License. 954 */async function Ld(e,t){return Vh(e,"POST","/v1/accounts:signInWithPassword",Nh(e,t))}async function Vd(e,t){return async function(e,t){return Rh(e,"POST","/v1/accounts:sendOobCode",Nh(e,t))}(e,t)} 955/** 956 * @license 957 * Copyright 2020 Google LLC 958 * 959 * Licensed under the Apache License, Version 2.0 (the "License"); 960 * you may not use this file except in compliance with the License. 961 * You may obtain a copy of the License at 962 * 963 * http://www.apache.org/licenses/LICENSE-2.0 964 * 965 * Unless required by applicable law or agreed to in writing, software 966 * distributed under the License is distributed on an "AS IS" BASIS, 967 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 968 * See the License for the specific language governing permissions and 969 * limitations under the License. 970 */ 971/** 972 * @license 973 * Copyright 2020 Google LLC 974 * 975 * Licensed under the Apache License, Version 2.0 (the "License"); 976 * you may not use this file except in compliance with the License. 977 * You may obtain a copy of the License at 978 * 979 * http://www.apache.org/licenses/LICENSE-2.0 980 * 981 * Unless required by applicable law or agreed to in writing, software 982 * distributed under the License is distributed on an "AS IS" BASIS, 983 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 984 * See the License for the specific language governing permissions and 985 * limitations under the License. 986 */ 987class qd extends Nd{constructor(e,t,n,i=null){super("password",n),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new qd(e,t,"password")}static _fromEmailAndCode(e,t,n=null){return new qd(e,t,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e;if((null==t?void 0:t.email)&&(null==t?void 0:t.password)){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return Dd(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",Ld);case"emailLink":return async function(e,t){return Vh(e,"POST","/v1/accounts:signInWithEmailLink",Nh(e,t))}(e,{email:this._email,oobCode:this._password});default:yh(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Dd(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",Rd);case"emailLink":return async function(e,t){return Vh(e,"POST","/v1/accounts:signInWithEmailLink",Nh(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:yh(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}} 988/** 989 * @license 990 * Copyright 2020 Google LLC 991 * 992 * Licensed under the Apache License, Version 2.0 (the "License");
993 * you may not use this file except in compliance with the License. 994 * You may obtain a copy of the License at 995 * 996 * http://www.apache.org/licenses/LICENSE-2.0 997 * 998 * Unless required by applicable law or agreed to in writing, software 999 * distributed under the License is distributed on an "AS IS" BASIS, 1000 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1001 * See the License for the specific language governing permissions and 1002 * limitations under the License. 1003 */async function Fd(e,t){return Vh(e,"POST","/v1/accounts:signInWithIdp",Nh(e,t))} 1004/** 1005 * @license 1006 * Copyright 2020 Google LLC 1007 * 1008 * Licensed under the Apache License, Version 2.0 (the "License"); 1009 * you may not use this file except in compliance with the License. 1010 * You may obtain a copy of the License at 1011 * 1012 * http://www.apache.org/licenses/LICENSE-2.0 1013 * 1014 * Unless required by applicable law or agreed to in writing, software 1015 * distributed under the License is distributed on an "AS IS" BASIS, 1016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1017 * See the License for the specific language governing permissions and 1018 * limitations under the License. 1019 */class Bd extends Nd{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Bd(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):yh("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
1019once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:i}=t,a=dh(t,["providerId","signInMethod"]);if(!n||!i)return null;const o=new Bd(n,i);return o.idToken=a.idToken||void 0,o.accessToken=a.accessToken||void 0,o.secret=a.secret,o.nonce=a.nonce,o.pendingToken=a.pendingToken||null,o}_getIdTokenResponse(e){return Fd(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Fd(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Fd(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=Sc(t)}return e}} 1020/** 1021 * @license 1022 * Copyright 2020 Google LLC 1023 * 1024 * Licensed under the Apache License, Version 2.0 (the "License"); 1025 * you may not use this file except in compliance with the License. 1026 * You may obtain a copy of the License at 1027 * 1028 * http://www.apache.org/licenses/LICENSE-2.0 1029 * 1030 * Unless required by applicable law or agreed to in writing, software 1031 * distributed under the License is distributed on an "AS IS" BASIS, 1032 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1033 * See the License for the specific language governing permissions and 1034 * limitations under the License. 1035 */class Ud{constructor(e){var t,n,i,a,o,s;const r=Ic(Ac(e)),l=null!==(t=r.apiKey)&&void 0!==t?t:null,c=null!==(n=r.oobCode)&&void 0!==n?n:null,u=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(i=r.mode)&&void 0!==i?i:null);xh(l&&c&&u,"argument-error"),this.apiKey=l,this.operation=u,this.code=c,this.continueUrl=null!==(a=r.continueUrl)&&void 0!==a?a:null,this.languageCode=null!==(o=r.languageCode)&&void 0!==o?o:null,this.tenantId=null!==(s=r.tenantId)&&void 0!==s?s:null}static parseLink(e){const t=function(e){const t=Ic(Ac(e)).link,n=t?Ic(Ac(t)).deep_link_id:null,i=Ic(Ac(e)).deep_link_id;return(i?Ic(Ac(i)).link:null)||i||n||t||e}(e);try{return new Ud(t)}catch(n){return null}}} 1036/** 1037 * @license 1038 * Copyright 2020 Google LLC 1039 * 1040 * Licensed under the Apache License, Version 2.0 (the "License"); 1041 * you may not use this file except in compliance with the License. 1042 * You may obtain a copy of the License at 1043 * 1044 * http://www.apache.org/licenses/LICENSE-2.0 1045 * 1046 * Unless required by applicable law or agreed to in writing, software 1047 * distributed under the License is distributed on an "AS IS" BASIS, 1048 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1049 * See the License for the specific language governing permissions and 1050 * limitations under the License. 1051 */class jd{constructor(){this.providerId=jd.PROVIDER_ID}static credential(e,t){return qd._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=Ud.parseLink(t);return xh(n,"argument-error"),qd._fromEmailAndCode(e,n.code,n.tenantId)}}jd.PROVIDER_ID="password",jd.EMAIL_PASSWORD_SIGN_IN_METHOD="password",jd.EMAIL_LINK_SIGN_IN_METHOD="emailLink"; 1052/** 1053 * @license 1054 * Copyright 2020 Google LLC 1055 * 1056 * Licensed under the Apache License, Version 2.0 (the "License"); 1057 * you may not use this file except in compliance with the License. 1058 * You may obtain a copy of the License at 1059 * 1060 * http://www.apache.org/licenses/LICENSE-2.0 1061 * 1062 * Unless required by applicable law or agreed to in writing, software 1063 * distributed under the License is distributed on an "AS IS" BASIS, 1064 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1065 * See the License for the specific language governing permissions and 1066 * limitations under the License. 1067 */ 1068class Hd{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}} 1069/** 1070 * @license 1071 * Copyright 2019 Google LLC 1072 * 1073 * Licensed under the Apache License, Version 2.0 (the "License");
1074 * you may not use this file except in compliance with the License. 1075 * You may obtain a copy of the License at 1076 * 1077 * http://www.apache.org/licenses/LICENSE-2.0 1078 * 1079 * Unless required by applicable law or agreed to in writing, software 1080 * distributed under the License is distributed on an "AS IS" BASIS, 1081 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1082 * See the License for the specific language governing permissions and 1083 * limitations under the License. 1084 */class zd extends Hd{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}} 1085/** 1086 * @license 1087 * Copyright 2020 Google LLC 1088 * 1089 * Licensed under the Apache License, Version 2.0 (the "License"); 1090 * you may not use this file except in compliance with the License. 1091 * You may obtain a copy of the License at 1092 * 1093 * http://www.apache.org/licenses/LICENSE-2.0 1094 * 1095 * Unless required by applicable law or agreed to in writing, software 1096 * distributed under the License is distributed on an "AS IS" BASIS, 1097 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1098 * See the License for the specific language governing permissions and 1099 * limitations under the License. 1100 */class Wd extends zd{constructor(){super("facebook.com")}static credential(e){return Bd._fromParams({providerId:Wd.PROVIDER_ID,signInMethod:Wd.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Wd.credentialFromTaggedObject(e)}static credentialFromError(e){return Wd.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return Wd.credential(e.oauthAccessToken)}catch(t){return null}}}Wd.FACEBOOK_SIGN_IN_METHOD="facebook.com",Wd.PROVIDER_ID="facebook.com"; 1101/** 1102 * @license 1103 * Copyright 2020 Google LLC 1104 * 1105 * Licensed under the Apache License, Version 2.0 (the "License"); 1106 * you may not use this file except in compliance with the License. 1107 * You may obtain a copy of the License at 1108 * 1109 * http://www.apache.org/licenses/LICENSE-2.0 1110 * 1111 * Unless required by applicable law or agreed to in writing, software 1112 * distributed under the License is distributed on an "AS IS" BASIS, 1113 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1114 * See the License for the specific language governing permissions and 1115 * limitations under the License. 1116 */ 1117class Kd extends zd{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Bd._fromParams({providerId:Kd.PROVIDER_ID,signInMethod:Kd.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return Kd.credentialFromTaggedObject(e)}static credentialFromError(e){return Kd.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return Kd.credential(t,n)}catch(i){return null}}}Kd.GOOGLE_SIGN_IN_METHOD="google.com",Kd.PROVIDER_ID="google.com"; 1118/** 1119 * @license 1120 * Copyright 2020 Google LLC 1121 * 1122 * Licensed under the Apache License, Version 2.0 (the "License"); 1123 * you may not use this file except in compliance with the License. 1124 * You may obtain a copy of the License at 1125 * 1126 * http://www.apache.org/licenses/LICENSE-2.0 1127 * 1128 * Unless required by applicable law or agreed to in writing, software 1129 * distributed under the License is distributed on an "AS IS" BASIS, 1130 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1131 * See the License for the specific language governing permissions and 1132 * limitations under the License. 1133 */ 1134class Gd extends zd{constructor(){super("github.com")}static credential(e){return Bd._fromParams({providerId:Gd.PROVIDER_ID,signInMethod:Gd.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Gd.credentialFromTaggedObject(e)}static credentialFromError(e){return Gd.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return Gd.credential(e.oauthAccessToken)}catch(t){return null}}}Gd.GITHUB_SIGN_IN_METHOD="github.com",Gd.PROVIDER_ID="github.com"; 1135/** 1136 * @license 1137 * Copyright 2020 Google LLC 1138 * 1139 * Licensed under the Apache License, Version 2.0 (the "License");
1140 * you may not use this file except in compliance with the License. 1141 * You may obtain a copy of the License at 1142 * 1143 * http://www.apache.org/licenses/LICENSE-2.0 1144 * 1145 * Unless required by applicable law or agreed to in writing, software 1146 * distributed under the License is distributed on an "AS IS" BASIS, 1147 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1148 * See the License for the specific language governing permissions and 1149 * limitations under the License. 1150 */ 1151class Yd extends zd{constructor(){super("twitter.com")}static credential(e,t){return Bd._fromParams({providerId:Yd.PROVIDER_ID,signInMethod:Yd.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return Yd.credentialFromTaggedObject(e)}static credentialFromError(e){return Yd.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return Yd.credential(t,n)}catch(i){return null}}}Yd.TWITTER_SIGN_IN_METHOD="twitter.com",Yd.PROVIDER_ID="twitter.com"; 1152/** 1153 * @license 1154 * Copyright 2020 Google LLC 1155 * 1156 * Licensed under the Apache License, Version 2.0 (the "License"); 1157 * you may not use this file except in compliance with the License. 1158 * You may obtain a copy of the License at 1159 * 1160 * http://www.apache.org/licenses/LICENSE-2.0 1161 * 1162 * Unless required by applicable law or agreed to in writing, software 1163 * distributed under the License is distributed on an "AS IS" BASIS, 1164 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1165 * See the License for the specific language governing permissions and 1166 * limitations under the License. 1167 */ 1168class Qd{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n,i=!1){const a=await nd._fromIdTokenResponse(e,n,i),o=$d(n);return new Qd({user:a,providerId:o,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const i=$d(n);return new Qd({user:e,providerId:i,_tokenResponse:n,operationType:t})}}function $d(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null} 1169/** 1170 * @license 1171 * Copyright 2020 Google LLC 1172 * 1173 * Licensed under the Apache License, Version 2.0 (the "License"); 1174 * you may not use this file except in compliance with the License. 1175 * You may obtain a copy of the License at 1176 * 1177 * http://www.apache.org/licenses/LICENSE-2.0 1178 * 1179 * Unless required by applicable law or agreed to in writing, software 1180 * distributed under the License is distributed on an "AS IS" BASIS, 1181 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1182 * See the License for the specific language governing permissions and 1183 * limitations under the License. 1184 */class Xd extends gc{constructor(e,t,n,i){var a;super(t.code,t.message),this.operationType=n,this.user=i,Object.setPrototypeOf(this,Xd.prototype),this.customData={appName:e.name,tenantId:null!==(a=e.tenantId)&&void 0!==a?a:void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,i){return new Xd(e,t,n,i)}}function Jd(e,t,n,i){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(n=>{if(n.code==="auth/".concat("multi-factor-auth-required"))throw Xd._fromErrorAndOperation(e,n,t,i);throw n})} 1185/** 1186 * @license 1187 * Copyright 2020 Google LLC 1188 * 1189 * Licensed under the Apache License, Version 2.0 (the "License"); 1190 * you may not use this file except in compliance with the License. 1191 * You may obtain a copy of the License at 1192 * 1193 * http://www.apache.org/licenses/LICENSE-2.0 1194 * 1195 * Unless required by applicable law or agreed to in writing, software 1196 * distributed under the License is distributed on an "AS IS" BASIS, 1197 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1198 * See the License for the specific language governing permissions and 1199 * limitations under the License. 1200 */ 1201async function Zd(e,t,n=!1){if(Qu(e.app))return Promise.reject(wh(e));const i="signIn",a=await Jd(e,i,t),o=await Qd._fromIdTokenResponse(e,i,a);return n||await e._updateCurrentUser(o.user),o}function ef(e,t,n){return Qu(e.app)?Promise.reject(wh(e)):async function(e,t){return Zd(Td(e),t)} 1202/** 1203 * @license 1204 * Copyright 2020 Google LLC 1205 * 1206 * Licensed under the Apache License, Version 2.0 (the "License");
1207 * you may not use this file except in compliance with the License. 1208 * You may obtain a copy of the License at 1209 * 1210 * http://www.apache.org/licenses/LICENSE-2.0 1211 * 1212 * Unless required by applicable law or agreed to in writing, software 1213 * distributed under the License is distributed on an "AS IS" BASIS, 1214 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1215 * See the License for the specific language governing permissions and 1216 * limitations under the License. 1217 */(Rc(e),jd.credential(t,n)).catch(async t=>{throw t.code==="auth/".concat("password-does-not-meet-requirements")&&async function(e){const t=Td(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}(e),t})}function tf(e,t,n,i){return Rc(e).onAuthStateChanged(t,n,i)}const nf="__sak"; 1218/** 1219 * @license 1220 * Copyright 2019 Google LLC 1221 * 1222 * Licensed under the Apache License, Version 2.0 (the "License"); 1223 * you may not use this file except in compliance with the License. 1224 * You may obtain a copy of the License at 1225 * 1226 * http://www.apache.org/licenses/LICENSE-2.0 1227 * 1228 * Unless required by applicable law or agreed to in writing, software 1229 * distributed under the License is distributed on an "AS IS" BASIS, 1230 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1231 * See the License for the specific language governing permissions and 1232 * limitations under the License. 1233 */class af{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(nf,"1"),this.storage.removeItem(nf),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}} 1234/** 1235 * @license 1236 * Copyright 2020 Google LLC 1237 * 1238 * Licensed under the Apache License, Version 2.0 (the "License"); 1239 * you may not use this file except in compliance with the License. 1240 * You may obtain a copy of the License at 1241 * 1242 * http://www.apache.org/licenses/LICENSE-2.0 1243 * 1244 * Unless required by applicable law or agreed to in writing, software 1245 * distributed under the License is distributed on an "AS IS" BASIS, 1246 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1247 * See the License for the specific language governing permissions and 1248 * limitations under the License. 1249 */class of extends af{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=bd(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),i=this.localCache[t];n!==i&&e(t,i,n)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys((e,t,n)=>{this.notifyListeners(e,n)});const n=e.key;t?this.detachListener():this.stopPolling();const i=()=>{const e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},a=this.storage.getItem(n);yd()&&a!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,10):i()}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const i of Array.from(n))i(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}of.type="LOCAL";const sf=of; 1250/** 1251 * @license 1252 * Copyright 2020 Google LLC 1253 * 1254 * Licensed under the Apache License, Version 2.0 (the "License");
1255 * you may not use this file except in compliance with the License. 1256 * You may obtain a copy of the License at 1257 * 1258 * http://www.apache.org/licenses/LICENSE-2.0 1259 * 1260 * Unless required by applicable law or agreed to in writing, software 1261 * distributed under the License is distributed on an "AS IS" BASIS, 1262 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1263 * See the License for the specific language governing permissions and 1264 * limitations under the License. 1265 */class rf extends af{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}rf.type="SESSION";const lf=rf; 1266/** 1267 * @license 1268 * Copyright 2019 Google LLC 1269 * 1270 * Licensed under the Apache License, Version 2.0 (the "License"); 1271 * you may not use this file except in compliance with the License. 1272 * You may obtain a copy of the License at 1273 * 1274 * http://www.apache.org/licenses/LICENSE-2.0 1275 * 1276 * Unless required by applicable law or agreed to in writing, software 1277 * distributed under the License is distributed on an "AS IS" BASIS, 1278 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1279 * See the License for the specific language governing permissions and 1280 * limitations under the License. 1281 */ 1282/** 1283 * @license 1284 * Copyright 2019 Google LLC 1285 * 1286 * Licensed under the Apache License, Version 2.0 (the "License"); 1287 * you may not use this file except in compliance with the License. 1288 * You may obtain a copy of the License at 1289 * 1290 * http://www.apache.org/licenses/LICENSE-2.0 1291 * 1292 * Unless required by applicable law or agreed to in writing, software 1293 * distributed under the License is distributed on an "AS IS" BASIS, 1294 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1295 * See the License for the specific language governing permissions and 1296 * limitations under the License. 1297 */ 1298class cf{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;const n=new cf(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:i,data:a}=t.data,o=this.handlersMap[i];if(!(null==o?void 0:o.size))return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:i});const s=Array.from(o).map(async e=>e(t.origin,a)),r=await function(e){return Promise.all(e.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}(s);t.ports[0].postMessage({status:"done",eventId:n,eventType:i,response:r})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}} 1299/** 1300 * @license 1301 * Copyright 2020 Google LLC 1302 * 1303 * Licensed under the Apache License, Version 2.0 (the "License"); 1304 * you may not use this file except in compliance with the License. 1305 * You may obtain a copy of the License at 1306 * 1307 * http://www.apache.org/licenses/LICENSE-2.0 1308 * 1309 * Unless required by applicable law or agreed to in writing, software 1310 * distributed under the License is distributed on an "AS IS" BASIS, 1311 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1312 * See the License for the specific language governing permissions and 1313 * limitations under the License. 1314 */ 1315function uf(e="",t=10){let n="";for(let i=0;i<t;i++)n+=Math.floor(10*Math.random());return e+n} 1316/** 1317 * @license 1318 * Copyright 2019 Google LLC 1319 * 1320 * Licensed under the Apache License, Version 2.0 (the "License"); 1321 * you may not use this file except in compliance with the License. 1322 * You may obtain a copy of the License at 1323 * 1324 * http://www.apache.org/licenses/LICENSE-2.0 1325 * 1326 * Unless required by applicable law or agreed to in writing, softw
1326are 1327 * distributed under the License is distributed on an "AS IS" BASIS, 1328 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1329 * See the License for the specific language governing permissions and 1330 * limitations under the License. 1331 */cf.receivers=[];class hf{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,n=50){const i="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let a,o;return new Promise((s,r)=>{const l=uf("",20);i.port1.start();const c=setTimeout(()=>{r(new Error("unsupported_event"))},n);o={messageChannel:i,onMessage(e){const t=e;if(t.data.eventId===l)switch(t.data.status){case"ack":clearTimeout(c),a=setTimeout(()=>{r(new Error("timeout"))},3e3);break;case"done":clearTimeout(a),s(t.data.response);break;default:clearTimeout(c),clearTimeout(a),r(new Error("invalid_response"))}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}} 1332/** 1333 * @license 1334 * Copyright 2020 Google LLC 1335 * 1336 * Licensed under the Apache License, Version 2.0 (the "License"); 1337 * you may not use this file except in compliance with the License. 1338 * You may obtain a copy of the License at 1339 * 1340 * http://www.apache.org/licenses/LICENSE-2.0 1341 * 1342 * Unless required by applicable law or agreed to in writing, software 1343 * distributed under the License is distributed on an "AS IS" BASIS, 1344 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1345 * See the License for the specific language governing permissions and 1346 * limitations under the License. 1347 */function df(){return window} 1348/** 1349 * @license 1350 * Copyright 2020 Google LLC. 1351 * 1352 * Licensed under the Apache License, Version 2.0 (the "License"); 1353 * you may not use this file except in compliance with the License. 1354 * You may obtain a copy of the License at 1355 * 1356 * http://www.apache.org/licenses/LICENSE-2.0 1357 * 1358 * Unless required by applicable law or agreed to in writing, software 1359 * distributed under the License is distributed on an "AS IS" BASIS, 1360 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1361 * See the License for the specific language governing permissions and 1362 * limitations under the License. 1363 */ 1364function ff(){return void 0!==df().WorkerGlobalScope&&"function"==typeof df().importScripts} 1365/** 1366 * @license 1367 * Copyright 2019 Google LLC 1368 * 1369 * Licensed under the Apache License, Version 2.0 (the "License"); 1370 * you may not use this file except in compliance with the License. 1371 * You may obtain a copy of the License at 1372 * 1373 * http://www.apache.org/licenses/LICENSE-2.0 1374 * 1375 * Unless required by applicable law or agreed to in writing, software 1376 * distributed under the License is distributed on an "AS IS" BASIS, 1377 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1378 * See the License for the specific language governing permissions and 1379 * limitations under the License. 1380 */ 1381const pf="firebaseLocalStorageDb",gf="firebaseLocalStorage",mf="fbase_key";class vf{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function yf(e,t){return e.transaction([gf],t?"readwrite":"readonly").objectStore(gf)}function bf(){const e=indexedDB.open(pf,1);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const t=e.result;try{t.createObjectStore(gf,{keyPath:mf})}catch(ZNe){n(ZNe)}}),e.addEventListener("success",async()=>{const n=e.result;n.objectStoreNames.contains(gf)?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(pf);return new vf(e).toPromise()}(),t(await bf()))})})}async function _f(e,t,n){const i=yf(e,!0).put({[mf]:t,value:n});return new vf(i).toPromise()}function wf(e,t){const n=yf(e,!0).delete(t);return new vf(n).toPromise()}class kf{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db||(this.db=await bf()),this.db}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(ZNe){if(t++>3)throw ZNe;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return ff()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=cf._getInstance(ff()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}(),!this.activeServiceWorker)return;this.sender=new hf(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&(null===(e=n[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=n[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){var t;if(this.sender&&this.activeServiceWorker&&((null===(t=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(t){}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await bf();return await _f(e,nf,"1"),await wf(e,nf),!0}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(n=>_f(n,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(t=>async function(e,t){const n=yf(e,!1).get(t),i=await new vf(n).toPromise();return void 0===i?null:i.value}(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>wf(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(e=>{const t=yf(e,!1).getAll();
vendor: 5,711 bytes, lines 1381-1436
1381return new vf(t).toPromise()});if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;if(0!==e.length)for(const{fbase_key:i,value:a}of e)n.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(a)&&(this.notifyListeners(i,a),t.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!n.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const i of Array.from(n))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}kf.type="LOCAL";const xf=kf;new Ah(3e4,6e4); 1382/** 1383 * @license 1384 * Copyright 2019 Google LLC 1385 * 1386 * Licensed under the Apache License, Version 2.0 (the "License"); 1387 * you may not use this file except in compliance with the License. 1388 * You may obtain a copy of the License at 1389 * 1390 * http://www.apache.org/licenses/LICENSE-2.0 1391 * 1392 * Unless required by applicable law or agreed to in writing, software 1393 * distributed under the License is distributed on an "AS IS" BASIS, 1394 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1395 * See the License for the specific language governing permissions and 1396 * limitations under the License. 1397 */ 1398class Tf extends Nd{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Fd(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Fd(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Fd(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function Cf(e){return Zd(e.auth,new Tf(e),e.bypassAuthState)}function Ef(e){const{auth:t,user:n}=e;return xh(n,t,"internal-error"), 1399/** 1400 * @license 1401 * Copyright 2019 Google LLC 1402 * 1403 * Licensed under the Apache License, Version 2.0 (the "License"); 1404 * you may not use this file except in compliance with the License. 1405 * You may obtain a copy of the License at 1406 * 1407 * http://www.apache.org/licenses/LICENSE-2.0 1408 * 1409 * Unless required by applicable law or agreed to in writing, software 1410 * distributed under the License is distributed on an "AS IS" BASIS, 1411 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1412 * See the License for the specific language governing permissions and 1413 * limitations under the License. 1414 */ 1415async function(e,t,n=!1){const{auth:i}=e;if(Qu(i.app))return Promise.reject(wh(i));const a="reauthenticate";try{const o=await Qh(e,Jd(i,a,t,e),n);xh(o.idToken,i,"internal-error");const s=Gh(o.idToken);xh(s,i,"internal-error");const{sub:r}=s;return xh(e.uid===r,i,"user-mismatch"),Qd._forOperation(e,a,o)}catch(ZNe){throw(null==ZNe?void 0:ZNe.code)==="auth/".concat("user-not-found")&&yh(i,"user-mismatch"),ZNe}}(n,new Tf(e),e.bypassAuthState)}async function Sf(e){const{auth:t,user:n}=e;return xh(n,t,"internal-error"),async function(e,t,n=!1){const i=await Qh(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return Qd._forOperation(e,"link",i)}(n,new Tf(e),e.bypassAuthState)} 1416/** 1417 * @license 1418 * Copyright 2020 Google LLC 1419 * 1420 * Licensed under the Apache License, Version 2.0 (the "License"); 1421 * you may not use this file except in compliance with the License. 1422 * You may obtain a copy of the License at 1423 * 1424 * http://www.apache.org/licenses/LICENSE-2.0 1425 * 1426 * Unless required by applicable law or agreed to in writing, software 1427 * distributed under the License is distributed on an "AS IS" BASIS, 1428 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1429 * See the License for the specific language governing permissions and 1430 * limitations under the License. 1431 */class If{constructor(e,t,n,i,a=!1){this.auth=e,this.resolver=n,this.user=i,this.bypassAuthState=a,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(ZNe){this.reject(ZNe)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:i,tenantId:a,error:o,type:s}=e;if(o)return void this.reject(o);const r={auth:this.auth,requestUri:t,sessionId:n,tenantId:a||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(s)(r))}catch(ZNe){this.reject(ZNe)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Cf;case"linkViaPopup":case"linkViaRedirect":return Sf;case"reauthViaPopup":case"reauthViaRedirect":return Ef;default:yh(this.auth,"internal-error")}}resolve(e){Ch(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Ch(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}} 1432/** 1433 * @license 1434 * Copyright 2020 Google LLC 1435 * 1436 * Licensed under the Apache License, Version 2.0 (the "License");
1437 * you may not use this file except in compliance with the License. 1438 * You may obtain a copy of the License at 1439 * 1440 * http://www.apache.org/licenses/LICENSE-2.0 1441 * 1442 * Unless required by applicable law or agreed to in writing, software 1443 * distributed under the License is distributed on an "AS IS" BASIS, 1444 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1445 * See the License for the specific language governing permissions and 1446 * limitations under the License. 1447 */const Af=new Ah(2e3,1e4);class Df extends If{constructor(e,t,n,i,a){super(e,t,i,a),this.provider=n,this.authWindow=null,this.pollId=null,Df.currentPopupAction&&Df.currentPopupAction.cancel(),Df.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return xh(e,this.auth,"internal-error"),e}async onExecution(){Ch(1===this.filter.length,"Popup operations only handle one event");const e=uf();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(bh(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(bh(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Df.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,n;(null===(n=null===(t=this.authWindow)||void 0===t?void 0:t.window)||void 0===n?void 0:n.closed)?this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(bh(this.auth,"popup-closed-by-user"))},8e3):this.pollId=window.setTimeout(e,Af.get())};e()}}Df.currentPopupAction=null; 1448/** 1449 * @license 1450 * Copyright 2020 Google LLC 1451 * 1452 * Licensed under the Apache License, Version 2.0 (the "License"); 1453 * you may not use this file except in compliance with the License. 1454 * You may obtain a copy of the License at 1455 * 1456 * http://www.apache.org/licenses/LICENSE-2.0 1457 * 1458 * Unless required by applicable law or agreed to in writing, software 1459 * distributed under the License is distributed on an "AS IS" BASIS, 1460 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1461 * See the License for the specific language governing permissions and 1462 * limitations under the License. 1463 */ 1464const Pf="pendingRedirect",Of=new Map;class Mf extends If{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=Of.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=function(e){return rd(Pf,e.config.apiKey,e.name)}(t),i=function(e){return ad(e._redirectPersistence)}(e);if(!(await i._isAvailable()))return!1;const a="true"===await i._get(n);return await i._remove(n),a}(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(ZNe){e=()=>Promise.reject(ZNe)}Of.set(this.auth._key(),e)}return this.bypassAuthState||Of.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function Nf(e,t){Of.set(e._key(),t)}async function Rf(e,t,n=!1){if(Qu(e.app))return Promise.reject(wh(e));const i=Td(e),a= 1465/** 1466 * @license 1467 * Copyright 2021 Google LLC 1468 * 1469 * Licensed under the Apache License, Version 2.0 (the "License"); 1470 * you may not use this file except in compliance with the License. 1471 * You may obtain a copy of the License at 1472 * 1473 * http://www.apache.org/licenses/LICENSE-2.0 1474 * 1475 * Unless required by applicable law or agreed to in writing, software 1476 * distributed under the License is distributed on an "AS IS" BASIS, 1477 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1478 * See the License for the specific language governing permissions and 1479 * limitations under the License. 1480 */ 1481function(e,t){return t?ad(t):(xh(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}(i,t),o=new Mf(i,a,n),s=await o.execute();return s&&!n&&(delete s.user._redirectEventId,await i._persistUserIfCurrent(s.user),await i._setRedirectUser(null,t)),s} 1482/** 1483 * @license 1484 * Copyright 2020 Google LLC 1485 * 1486 * Licensed under the Apache License, Version 2.0 (the "License");
1487 * you may not use this file except in compliance with the License. 1488 * You may obtain a copy of the License at 1489 * 1490 * http://www.apache.org/licenses/LICENSE-2.0 1491 * 1492 * Unless required by applicable law or agreed to in writing, software 1493 * distributed under the License is distributed on an "AS IS" BASIS, 1494 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1495 * See the License for the specific language governing permissions and 1496 * limitations under the License. 1497 */class Lf{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return qf(e);default:return!1}} 1498/** 1499 * @license 1500 * Copyright 2020 Google LLC 1501 * 1502 * Licensed under the Apache License, Version 2.0 (the "License"); 1503 * you may not use this file except in compliance with the License. 1504 * You may obtain a copy of the License at 1505 * 1506 * http://www.apache.org/licenses/LICENSE-2.0 1507 * 1508 * Unless required by applicable law or agreed to in writing, software 1509 * distributed under the License is distributed on an "AS IS" BASIS, 1510 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1511 * See the License for the specific language governing permissions and 1512 * limitations under the License. 1513 */(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;if(e.error&&!qf(e)){const i=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(bh(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(Vf(e))}saveEventToCache(e){this.cachedEventUids.add(Vf(e)),this.lastProcessedEventTime=Date.now()}}function Vf(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function qf({type:e,error:t}){return"unknown"===e&&(null==t?void 0:t.code)==="auth/".concat("no-auth-event")} 1514/** 1515 * @license 1516 * Copyright 2020 Google LLC 1517 * 1518 * Licensed under the Apache License, Version 2.0 (the "License"); 1519 * you may not use this file except in compliance with the License. 1520 * You may obtain a copy of the License at 1521 * 1522 * http://www.apache.org/licenses/LICENSE-2.0 1523 * 1524 * Unless required by applicable law or agreed to in writing, software 1525 * distributed under the License is distributed on an "AS IS" BASIS, 1526 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1527 * See the License for the specific language governing permissions and 1528 * limitations under the License. 1529 */ 1530const Ff=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Bf=/^https?/;async function Uf(e){if(e.config.emulator)return;const{authorizedDomains:t}=await async function(e,t={}){return Rh(e,"GET","/v1/projects",t)}(e);for(const i of t)try{if(jf(i))return}catch(n){}yh(e,"unauthorized-domain")}function jf(e){const t=Eh(),{protocol:n,hostname:i}=new URL(t);if(e.startsWith("chrome-extension://")){const a=new URL(e);return""===a.hostname&&""===i?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&a.hostname===i}if(!Bf.test(n))return!1;if(Ff.test(e))return i===e;const a=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+a+"|"+a+")$","i").test(i)} 1531/** 1532 * @license 1533 * Copyright 2020 Google LLC. 1534 * 1535 * Licensed under the Apache License, Version 2.0 (the "License");
1536 * you may not use this file except in compliance with the License. 1537 * You may obtain a copy of the License at 1538 * 1539 * http://www.apache.org/licenses/LICENSE-2.0 1540 * 1541 * Unless required by applicable law or agreed to in writing, software 1542 * distributed under the License is distributed on an "AS IS" BASIS, 1543 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1544 * See the License for the specific language governing permissions and 1545 * limitations under the License. 1546 */const Hf=new Ah(3e4,6e4);function zf(){const e=df().___jsl;if(null==e?void 0:e.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n<e.CP.length;n++)e.CP[n]=null}function Wf(e){return new Promise((t,n)=>{var i,a,o;function s(){zf(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{zf(),n(bh(e,"network-request-failed"))},timeout:Hf.get()})}if(null===(a=null===(i=df().gapi)||void 0===i?void 0:i.iframes)||void 0===a?void 0:a.Iframe)t(gapi.iframes.getContext());else{if(!(null===(o=df().gapi)||void 0===o?void 0:o.load)){const t="__".concat("iframefcb").concat(Math.floor(1e6*Math.random()));return df()[t]=()=>{gapi.load?s():n(bh(e,"network-request-failed"))},Sd("".concat(Ed.gapiScript,"?onload=").concat(t)).catch(e=>n(e))}s()}}).catch(e=>{throw Kf=null,e})}let Kf=null; 1547/** 1548 * @license 1549 * Copyright 2020 Google LLC. 1550 * 1551 * Licensed under the Apache License, Version 2.0 (the "License"); 1552 * you may not use this file except in compliance with the License. 1553 * You may obtain a copy of the License at 1554 * 1555 * http://www.apache.org/licenses/LICENSE-2.0 1556 * 1557 * Unless required by applicable law or agreed to in writing, software 1558 * distributed under the License is distributed on an "AS IS" BASIS, 1559 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1560 * See the License for the specific language governing permissions and 1561 * limitations under the License. 1562 */ 1563const Gf=new Ah(5e3,15e3),Yf={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Qf=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function $f(e){const t=e.config;xh(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?Dh(t,"emulator/auth/iframe"):"https://".concat(e.config.authDomain,"/").concat("__/auth/iframe"),i={apiKey:t.apiKey,appName:e.name,v:Ju},a=Qf.get(e.config.apiHost);a&&(i.eid=a);const o=e._getFrameworks();return o.length&&(i.fw=o.join(",")),"".concat(n,"?").concat(Sc(i).slice(1))}async function Xf(e){const t=await function(e){return Kf=Kf||Wf(e),Kf}(e),n=df().gapi;return xh(n,e,"internal-error"),t.open({where:document.body,url:$f(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Yf,dontclear:!0},t=>new Promise(async(n,i)=>{await t.restyle({setHideOnLeave:!1});const a=bh(e,"network-request-failed"),o=df().setTimeout(()=>{i(a)},Gf.get());function s(){df().clearTimeout(o),n(t)}t.ping(s).then(s,()=>{i(a)})}))} 1564/** 1565 * @license 1566 * Copyright 2020 Google LLC. 1567 * 1568 * Licensed under the Apache License, Version 2.0 (the "License"); 1569 * you may not use this file except in compliance with the License. 1570 * You may obtain a copy of the License at 1571 * 1572 * http://www.apache.org/licenses/LICENSE-2.0 1573 * 1574 * Unless required by applicable law or agreed to in writing, software 1575 * distributed under the License is distributed on an "AS IS" BASIS, 1576 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1577 * See the License for the specific language governing permissions and 1578 * limitations under the License. 1579 */const Jf={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class Zf{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(ZNe){}}}function ep(e,t,n,i=500,a=600){const o=Math.max((window.screen.availHeight-a)/2,0).toString(),s=Math.max((window.screen.availWidth-i)/2,0).toString();let r="";const l=Object.assign(Object.assign({},Jf),{width:i.toString(),height:a.toString(),top:o,left:s}),c=sc().toLowerCase();n&&(r=dd(c)?"_blank":n),ud(c)&&(t=t||"http://localhost",l.scrollbars="yes");const u=Object.entries(l).reduce((e,[t,n])=>"".concat(e).concat(t,"=").concat(n,","),"");if(function(e=sc()){var t;return vd(e)&&!!(null===(t=window.navigator)||void 0===t?void 0:t.standalone)}(c)&&"_self"!==r)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const i=document.createEvent("MouseEvent");
1579i.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(i)} 1580/** 1581 * @license 1582 * Copyright 2021 Google LLC 1583 * 1584 * Licensed under the Apache License, Version 2.0 (the "License"); 1585 * you may not use this file except in compliance with the License. 1586 * You may obtain a copy of the License at 1587 * 1588 * http://www.apache.org/licenses/LICENSE-2.0 1589 * 1590 * Unless required by applicable law or agreed to in writing, software 1591 * distributed under the License is distributed on an "AS IS" BASIS, 1592 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1593 * See the License for the specific language governing permissions and 1594 * limitations under the License. 1595 */(t||"",r),new Zf(null);const h=window.open(t||"",r,u);xh(h,e,"popup-blocked");try{h.focus()}catch(ZNe){}return new Zf(h)}const tp="__/auth/handler",np="emulator/auth/handler",ip=encodeURIComponent("fac");async function ap(e,t,n,i,a,o){xh(e.config.authDomain,e,"auth-domain-config-required"),xh(e.config.apiKey,e,"invalid-api-key");const s={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:i,v:Ju,eventId:a};if(t instanceof Hd){t.setDefaultLanguage(e.languageCode),s.providerId=t.providerId||"",xc(t.getCustomParameters())||(s.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries({}))s[e]=t}if(t instanceof zd){const e=t.getScopes().filter(e=>""!==e);e.length>0&&(s.scopes=e.join(","))}e.tenantId&&(s.tid=e.tenantId);const r=s;for(const u of Object.keys(r))void 0===r[u]&&delete r[u];const l=await e._getAppCheckToken(),c=l?"#".concat(ip,"=").concat(encodeURIComponent(l)):"";return"".concat(function({config:e}){if(!e.emulator)return"https://".concat(e.authDomain,"/").concat(tp);return Dh(e,np)} 1596/** 1597 * @license 1598 * Copyright 2020 Google LLC 1599 * 1600 * Licensed under the Apache License, Version 2.0 (the "License"); 1601 * you may not use this file except in compliance with the License. 1602 * You may obtain a copy of the License at 1603 * 1604 * http://www.apache.org/licenses/LICENSE-2.0 1605 * 1606 * Unless required by applicable law or agreed to in writing, software 1607 * distributed under the License is distributed on an "AS IS" BASIS, 1608 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1609 * See the License for the specific language governing permissions and 1610 * limitations under the License. 1611 */(e),"?").concat(Sc(r).slice(1)).concat(c)}const op="webStorageSupport";const sp=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=lf,this._completeRedirectFn=Rf,this._overrideRedirectResult=Nf}async _openPopup(e,t,n,i){var a;Ch(null===(a=this.eventManagers[e._key()])||void 0===a?void 0:a.manager,"_initialize() not called before _openPopup()");return ep(e,await ap(e,t,n,Eh(),i),uf())}async _openRedirect(e,t,n,i){await this._originValidation(e);return function(e){df().location.href=e}(await ap(e,t,n,Eh(),i)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(Ch(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch(()=>{delete this.eventManagers[t]}),n}async initAndGetManager(e){const t=await Xf(e),n=new Lf(e);return t.register("authEvent",t=>{xh(null==t?void 0:t.authEvent,e,"invalid-auth-event");return{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(op,{type:op},n=>{var i;const a=null===(i=null==n?void 0:n[0])||void 0===i?void 0:i[op];void 0!==a&&t(!!a),yh(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=Uf(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return bd()||hd()||vd()}};var rp="@firebase/auth",lp="1.7.9"; 1612/** 1613 * @license 1614 * Copyright 2020 Google LLC 1615 * 1616 * Licensed under the Apache License, Version 2.0 (the "License");
1617 * you may not use this file except in compliance with the License. 1618 * You may obtain a copy of the License at 1619 * 1620 * http://www.apache.org/licenses/LICENSE-2.0 1621 * 1622 * Unless required by applicable law or agreed to in writing, software 1623 * distributed under the License is distributed on an "AS IS" BASIS, 1624 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1625 * See the License for the specific language governing permissions and 1626 * limitations under the License. 1627 */ 1628class cp{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}async getToken(e){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(e)}}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(t=>{e((null==t?void 0:t.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){xh(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}} 1629/** 1630 * @license 1631 * Copyright 2020 Google LLC 1632 * 1633 * Licensed under the Apache License, Version 2.0 (the "License"); 1634 * you may not use this file except in compliance with the License. 1635 * You may obtain a copy of the License at 1636 * 1637 * http://www.apache.org/licenses/LICENSE-2.0 1638 * 1639 * Unless required by applicable law or agreed to in writing, software 1640 * distributed under the License is distributed on an "AS IS" BASIS, 1641 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1642 * See the License for the specific language governing permissions and 1643 * limitations under the License. 1644 */ 1645/** 1646 * @license 1647 * Copyright 2021 Google LLC 1648 * 1649 * Licensed under the Apache License, Version 2.0 (the "License"); 1650 * you may not use this file except in compliance with the License. 1651 * You may obtain a copy of the License at 1652 * 1653 * http://www.apache.org/licenses/LICENSE-2.0 1654 * 1655 * Unless required by applicable law or agreed to in writing, software 1656 * distributed under the License is distributed on an "AS IS" BASIS, 1657 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1658 * See the License for the specific language governing permissions and 1659 * limitations under the License. 1660 */ 1661const up=ic("authIdTokenMaxAge")||300;let hp=null;function dp(e=eh()){const t=Yu(e,"auth");if(t.isInitialized())return t.getImmediate();const n=function(e,t){const n=Yu(e,"auth");if(n.isInitialized()){const e=n.getImmediate();if(Cc(n.getOptions(),null!=t?t:{}))return e;yh(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:sp,persistence:[xf,sf,lf]}),i=ic("authTokenSyncURL");if(i&&"boolean"==typeof isSecureContext&&isSecureContext){const e=new URL(i,location.origin);if(location.origin===e.origin){const t=(a=e.toString(),async e=>{const t=e&&await e.getIdTokenResult(),n=t&&((new Date).getTime()-Date.parse(t.issuedAtTime))/1e3;if(n&&n>up)return;const i=null==t?void 0:t.token;hp!==i&&(hp=i,await fetch(a,{method:i?"POST":"DELETE",headers:i?{Authorization:"Bearer ".concat(i)}:{}}))});!function(e,t,n){Rc(e).beforeAuthStateChanged(t,n)}(n,t,()=>t(n.currentUser)),function(e,t,n,i){Rc(e).onIdTokenChanged(t,n,i)}(n,e=>t(e))}}var a;const o=ec("auth");return o&&Pd(n,"http://".concat(o)),n}var fp;Ed={loadJS:e=>new Promise((t,n)=>{const i=document.createElement("script");var a,o;i.setAttribute("src",e),i.onload=t,i.onerror=e=>{const t=bh("internal-error");t.customData=e,n(t)},i.type="text/javascript",i.charset="UTF-8",(null!==(o=null===(a=document.getElementsByTagName("head"))||void 0===a?void 0:a[0])&&void 0!==o?o:document).appendChild(i)}),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="},fp="Browser",Gu(new Lc("auth",(e,{options:t})=>{const n=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),a=e.getProvider("app-check-internal"),{apiKey:o,authDomain:s}=n.options;xh(o&&!o.includes(":"),"invalid-api-key",{appName:n.name});const r={apiKey:o,authDomain:s,clientPlatform:fp,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:_d(fp)},l=new xd(n,i,a,r);return function(e,t){const n=(null==t?void 0:t.persistence)||[],i=(Array.isArray(n)?n:[n]).map(ad);(null==t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(i,null==t?void 0:t.popupRedirectResolver)}(l,t),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider("auth-internal").initialize()})),Gu(new Lc("auth-internal",e=>{const t=Td(e.getProvider("auth").getImmediate());return new cp(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),th(rp,lp,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(fp)),th(rp,lp,"esm2017"); 1662/** 1663 * @license 1664 * Copyright 2020 Google LLC 1665 * 1666 * Licensed under the Apache License, Version 2.0 (the "License");
1667 * you may not use this file except in compliance with the License. 1668 * You may obtain a copy of the License at 1669 * 1670 * http://www.apache.org/licenses/LICENSE-2.0 1671 * 1672 * Unless required by applicable law or agreed to in writing, software 1673 * distributed under the License is distributed on an "AS IS" BASIS, 1674 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1675 * See the License for the specific language governing permissions and 1676 * limitations under the License. 1677 */ 1678th("firebase","10.14.1","app");var pp,gp,mp="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}; 1679/** @license 1680Copyright The Closure Library Authors. 1681SPDX-License-Identifier: Apache-2.0 1682*/(function(){var e; 1683/** @license 1684 1685 Copyright The Closure Library Authors. 1686 SPDX-License-Identifier: Apache-2.0 1687 */function t(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}function n(e,t,n){n||(n=0);var i=Array(16);if("string"==typeof t)for(var a=0;16>a;++a)i[a]=t.charCodeAt(n++)|t.charCodeAt(n++)<<8|t.charCodeAt(n++)<<16|t.charCodeAt(n++)<<24;else for(a=0;16>a;++a)i[a]=t[n++]|t[n++]<<8|t[n++]<<16|t[n++]<<24;t=e.g[0],n=e.g[1],a=e.g[2];var o=e.g[3],s=t+(o^n&(a^o))+i[0]+3614090360&4294967295;s=(n=(a=(o=(t=(n=(a=(o=(t=(n=(a=(o=(t=(n=(a=(o=(t=(n=(a=(o=(t=(n=(a=(o=(t=(n=(a=(o=(t=(n=(a=(o=(t=(n=(a=(o=(t=(n=(a=(o=(t=(n=(a=(o=(t=(n=(a=(o=(t=(n=(a=(o=(t=(n=(a=(o=(t=(n=(a=(o=(t=n+(s<<7&4294967295|s>>>25))+((s=o+(a^t&(n^a))+i[1]+3905402710&4294967295)<<12&4294967295|s>>>20))+((s=a+(n^o&(t^n))+i[2]+606105819&4294967295)<<17&4294967295|s>>>15))+((s=n+(t^a&(o^t))+i[3]+3250441966&4294967295)<<22&4294967295|s>>>10))+((s=t+(o^n&(a^o))+i[4]+4118548399&4294967295)<<7&4294967295|s>>>25))+((s=o+(a^t&(n^a))+i[5]+1200080426&4294967295)<<12&4294967295|s>>>20))+((s=a+(n^o&(t^n))+i[6]+2821735955&4294967295)<<17&4294967295|s>>>15))+((s=n+(t^a&(o^t))+i[7]+4249261313&4294967295)<<22&4294967295|s>>>10))+((s=t+(o^n&(a^o))+i[8]+1770035416&4294967295)<<7&4294967295|s>>>25))+((s=o+(a^t&(n^a))+i[9]+2336552879&4294967295)<<12&4294967295|s>>>20))+((s=a+(n^o&(t^n))+i[10]+4294925233&4294967295)<<17&4294967295|s>>>15))+((s=n+(t^a&(o^t))+i[11]+2304563134&4294967295)<<22&4294967295|s>>>10))+((s=t+(o^n&(a^o))+i[12]+1804603682&4294967295)<<7&4294967295|s>>>25))+((s=o+(a^t&(n^a))+i[13]+4254626195&4294967295)<<12&4294967295|s>>>20))+((s=a+(n^o&(t^n))+i[14]+2792965006&4294967295)<<17&4294967295|s>>>15))+((s=n+(t^a&(o^t))+i[15]+1236535329&4294967295)<<22&4294967295|s>>>10))+((s=t+(a^o&(n^a))+i[1]+4129170786&4294967295)<<5&4294967295|s>>>27))+((s=o+(n^a&(t^n))+i[6]+3225465664&4294967295)<<9&4294967295|s>>>23))+((s=a+(t^n&(o^t))+i[11]+643717713&4294967295)<<14&4294967295|s>>>18))+((s=n+(o^t&(a^o))+i[0]+3921069994&4294967295)<<20&4294967295|s>>>12))+((s=t+(a^o&(n^a))+i[5]+3593408605&4294967295)<<5&4294967295|s>>>27))+((s=o+(n^a&(t^n))+i[10]+38016083&4294967295)<<9&4294967295|s>>>23))+((s=a+(t^n&(o^t))+i[15]+3634488961&4294967295)<<14&4294967295|s>>>18))+((s=n+(o^t&(a^o))+i[4]+3889429448&4294967295)<<20&4294967295|s>>>12))+((s=t+(a^o&(n^a))+i[9]+568446438&4294967295)<<5&4294967295|s>>>27))+((s=o+(n^a&(t^n))+i[14]+3275163606&4294967295)<<9&4294967295|s>>>23))+((s=a+(t^n&(o^t))+i[3]+4107603335&4294967295)<<14&4294967295|s>>>18))+((s=n+(o^t&(a^o))+i[8]+1163531501&4294967295)<<20&4294967295|s>>>12))+((s=t+(a^o&(n^a))+i[13]+2850285829&4294967295)<<5&4294967295|s>>>27))+((s=o+(n^a&(t^n))+i[2]+4243563512&4294967295)<<9&4294967295|s>>>23))+((s=a+(t^n&(o^t))+i[7]+1735328473&4294967295)<<14&4294967295|s>>>18))+((s=n+(o^t&(a^o))+i[12]+2368359562&4294967295)<<20&4294967295|s>>>12))+((s=t+(n^a^o)+i[5]+4294588738&4294967295)<<4&4294967295|s>>>28))+((s=o+(t^n^a)+i[8]+2272392833&4294967295)<<11&4294967295|s>>>21))+((s=a+(o^t^n)+i[11]+1839030562&4294967295)<<16&4294967295|s>>>16))+((s=n+(a^o^t)+i[14]+4259657740&4294967295)<<23&4294967295|s>>>9))+((s=t+(n^a^o)+i[1]+2763975236&4294967295)<<4&4294967295|s>>>28))+((s=o+(t^n^a)+i[4]+1272893353&4294967295)<<11&4294967295|s>>>21))+((s=a+(o^t^n)+i[7]+4139469664&4294967295)<<16&4294967295|s>>>16))+((s=n+(a^o^t)+i[10]+3200236656&4294967295)<<23&4294967295|s>>>9))+((s=t+(n^a^o)+i[13]+681279174&4294967295)<<4&4294967295|s>>>28))+((s=o+(t^n^a)+i[0]+3936430074&4294967295)<<11&4294967295|s>>>21))+((s=a+(o^t^n)+i[3]+3572445317&4294967295)<<16&4294967295|s>>>16))+((s=n+(a^o^t)+i[6]+76029189&4294967295)<<23&4294967295|s>>>9))+((s=t+(n^a^o)+i[9]+3654602809&4294967295)<<4&4294967295|s>>>28))+((s=o+(t^n^a)+i[12]+3873151461&4294967295)<<11&4294967295|s>>>21))+((s=a+(o^t^n)+i[15]+530742520&4294967295)<<16&4294967295|s>>>16))+((s=n+(a^o^t)+i[2]+3299628645&4294967295)<<23&4294967295|s>>>9))+((s=t+(a^(n|~o))+i[0]+4096336452&4294967295)<<6&4294967295|s>>>26))+((s=o+(n^(t|~a))+i[7]+1126891415&4294967295)<<10&4294967295|s>>>22))+((s=a+(t^(o|~n))+i[14]+2878612391&4294967295)<<15&4294967295|s>>>17))+((s=n+(o^(a|~t))+i[5]+4237533241&4294967295)<<21&4294967295|s>>>11))+((s=t+(a^(n|~o))+i[12]+1700485571&4294967295)<<6&4294967295|s>>>26))+((s=o+(n^(t|~a))+i[3]+2399980690&4294967295)<<10&4294967295|s>>>22))+((s=a+(t^(o|~n))+i[10]+4293915773&4294967295)<<15&4294967295|s>>>17))+((s=n+(o^(a|~t))+i[1]+2240044497&4294967295)<<21&4294967295|s>>>11))+((s=t+(a^(n|~o))+i[8]+1873313359&4294967295)<<6&4294967295|s>>>26))+((s=o+(n^(t|~a))+i[15]+4264355552&4294967295)<<10&4294967295|s>>>22))+((s=a+(t^(o|~n))+i[6]+2734768916&4294967295)<<15&4294967295|s>>>17))+((s=n+(o^(a|~t))+i[13]+1309151649&4294967295)<<21&4294967295|s>>>11))+((o=(t=n+((s=t+(a^(n|~o))+i[4]+4149444226&4294967295)<<6&4294967295|s>>>26))+((s=o+(n^(t|~a))+i[11]+3174756917&4294967295)<<10&4294967295|s>>>22))^((a=o+((s=a+(t^(o|~n))+i[2]+718787259&4294967295)<<15&4294967295|s>>>17))|~t))+i[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(a+(s<<21&4294967295|s>>>11))&4294967295,e.g[2]=e.g[2]+a&4294967295,e.g[3]=e.g[3]+o&4294967295}function i(e,t){this.h=t;for(var n=[],i=!0,a=e.length-1;0<=a;a--){var o=0|e[a];i&&o==t||(n[a]=o,i=!1)}this.g=n}!function(e,t){function n(){}n.prototype=t.prototype,e.D=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.C=function(e,n,i){for(var a=Array(arguments.length-2),o=2;o<arguments.length;o++)a[o-2]=arguments[o];return t.prototype[n].apply(e,a)}}(t,function(){this.blockSize=-1}),t.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0},t.prototype.u=function(e,t){void 0===t&&(t=e.length);for(var i=t-this.blockSize,a=this.B,o=this.h,s=0;s<t;){if(0==o)for(;s<=i;)n(this,e,s),s+=this.blockSize;if("string"==typeof e){for(;s<t;)if(a[o++]=e.charCodeAt(s++),o==this.blockSize){n(this,a),o=0;break}}else for(;s<t;)if(a[o++]=e[s++],o==this.blockSize){n(this,a),o=0;break}}this.h=o,this.o+=t},t.prototype.v=function(){var e=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;t<e.length-8;++t)e[t]=0;var n=8*this.o;for(t=e.length-8;t<e.length;++t)e[t]=255&n,n/=256;for(this.u(e),e=Array(16),t=n=0;4>t;++t)for(var i=0;32>i;i+=8)e[n++]=this.g[t]>>>i&255;return e};var a={};function o(e){return-128<=e&&128>e?function(e,t){var n=a;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,function(e){return new i([0|e],0>e?-1:0)}):new i([0|e],0>e?-1:0)}function s(e){if(isNaN(e)||!isFinite(e))return r;if(0>e)return d(s(-e));for(var t=[],n=1,a=0;e>=n;a++)t[a]=e/n|0,n*=4294967296;return new i(t,0)}var r=o(0),l=o(1),c=o(16777216);function u(e){if(0!=e.h)return!1;for(var t=0;t<e.g.length;t++)if(0!=e.g[t])return!1;return!0}function h(e){return-1==e.h}function d(e){for(var t=e.g.length,n=[],a=0;a<t;a++)n[a]=~e.g[a];return new i(n,~e.h).add(l)}function f(e,t){return e.add(d(t))}function p(e,t){for(;(65535&e[t])!=e[t];)e[t+1]+=e[t]>>>16,e[t]&=65535,t++}function g(e,t){this.g=e,this.h=t}function m(e,t){if(u(t))throw Error("division by zero");if(u(e))return new g(r,r);if(h(e))return t=m(d(e),t),new g(d(t.g),d(t.h));if(h(t))return t=m(e,d(t)),new g(d(t.g),t.h);if(30<e.g.length){if(h(e)||h(t))throw Error("slowDivide_ only works with positive integers.");for(var n=l,i=t;0>=i.l(e);)n=v(n),i=v(i);var a=y(n,1),o=y(i,1);for(i=y(i,2),n=y(n,2);!u(i);){var c=o.add(i);0>=c.l(e)&&(a=a.add(n),o=c),i=y(i,1),n=y(n,1)}return t=f(e,a.j(t)),new g(a,t)}for(a=r;0<=e.l(t);){for(n=Math.max(1,Math.floor(e.m()/t.m())),i=48>=(i=Math.ceil(Math.log(n)/Math.LN2))?1:Math.pow(2,i-48),c=(o=s(n)).j(t);h(c)||0<c.l(e);)c=(o=s(n-=i)).j(t);u(o)&&(o=l),a=a.add(o),e=f(e,c)}return new g(a,e)}function v(e){for(var t=e.g.length+1,n=[],a=0;a<t;a++)n[a]=e.i(a)<<1|e.i(a-1)>>>31;return new i(n,e.h)}function y(e,t){var n=t>>5;t%=32;for(var a=e.g.length-n,o=[],s=0;s<a;s++)o[s]=0<t?e.i(s+n)>>>t|e.i(s+n+1)<<32-t:e.i(s+n);return new i(o,e.h)}(e=i.prototype).m=function(){if(h(this))return-d(this).m();for(var e=0,t=1,n=0;n<this.g.length;n++){var i=this.i(n);e+=(0<=i?i:4294967296+i)*t,t*=4294967296}return e},e.toString=function(e){if(2>(e=e||10)||36<e)throw Error("radix out of range: "+e);if(u(this))return"0";if(h(this))return"-"+d(this).toString(e);for(var t=s(Math.pow(e,6)),n=this,i="";;){var a=m(n,t).g,o=((0<(n=f(n,a.j(t))).g.length?n.g[0]:n.h)>>>0).toString(e);if(u(n=a))return o+i;for(;6>o.length;)o="0"+o;i=o+i}},e.i=function(e){return 0>e?0:e<this.g.length?this.g[e]:this.h},e.l=function(e){return h(e=f(this,e))?-1:u(e)?0:1},e.abs=function(){return h(this)?d(this):this},e.add=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],a=0,o=0;o<=t;o++){var s=a+(65535&this.i(o))+(65535&e.i(o)),r=(s>>>16)+(this.i(o)>>>16)+(e.i(o)>>>16);a=r>>>16,s&=65535,r&=65535,n[o]=r<<16|s}return new i(n,-2147483648&n[n.length-1]?-1:0)},e.j=function(e){if(u(this)||u(e))return r;if(h(this))return h(e)?d(this).j(d(e)):d(d(this).j(e));if(h(e))return d(this.j(d(e)));if(0>this.l(c)&&0>e.l(c))return s(this.m()*e.m());for(var t=this.g.length+e.g.length,n=[],a=0;a<2*t;a++)n[a]=0;for(a=0;a<this.g.length;a++)for(var o=0;o<e.g.length;o++){var l=this.i(a)>>>16,f=65535&this.i(a),g=e.i(o)>>>16,m=65535&e.i(o);n[2*a+2*o]+=f*m,p(n,2*a+2*o),n[2*a+2*o+1]+=l*m,p(n,2*a+2*o+1),n[2*a+2*o+1]+=f*g,p(n,2*a+2*o+1),n[2*a+2*o+2]+=l*g,p(n,2*a+2*o+2)}for(a=0;a<t;a++)n[a]=n[2*a+1]<<16|n[2*a];for(a=t;a<2*t;a++)n[a]=0;return new i(n,0)},e.A=function(e){return m(this,e).h},e.and=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],a=0;a<t;a++)n[a]=this.i(a)&e.i(a);return new i(n,this.h&e.h)},e.or=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],a=0;a<t;a++)n[a]=this.i(a)|e.i(a);return new i(n,this.h|e.h)},e.xor=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],a=0;a<t;a++)n[a]=this.i(a)^e.i(a);return new i(n,this.h^e.h)},t.prototype.digest=t.prototype.v,t.prototype.reset=t.prototype.s,t.prototype.update=t.prototype.u,gp=t,i.prototype.add=i.prototype.add,i.prototype.multiply=i.prototype.j,i.prototype.modulo=i.prototype.A,i.prototype.compare=i.prototype.l,i.prototype.toNumber=i.prototype.m,i.prototype.toString=i.prototype.toString,i.prototype.getBits=i.prototype.i,i.fromNumber=s,i.fromString=function e(t,n){if(0==t.length)throw Error("number format error: empty string");if(2>(n=n||10)||36<n)throw Error("radix out of range: "+n);
1687if("-"==t.charAt(0))return d(e(t.substring(1),n));if(0<=t.indexOf("-"))throw Error('number format error: interior "-" character');for(var i=s(Math.pow(n,8)),a=r,o=0;o<t.length;o+=8){var l=Math.min(8,t.length-o),c=parseInt(t.substring(o,o+l),n);8>l?(l=s(Math.pow(n,l)),a=a.j(l).add(s(c))):a=(a=a.j(i)).add(s(c))}return a},pp=i}).apply(void 0!==mp?mp:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var vp,yp,bp,_p,wp,kp,xp,Tp,Cp="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}; 1688/** @license 1689Copyright The Closure Library Authors. 1690SPDX-License-Identifier: Apache-2.0 1691*/(function(){var e,t="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var n=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof Cp&&Cp];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);!function(e,i){if(i)e:{var a=n;e=e.split(".");for(var o=0;o<e.length-1;o++){var s=e[o];if(!(s in a))break e;a=a[s]}(i=i(o=a[e=e[e.length-1]]))!=o&&null!=i&&t(a,e,{configurable:!0,writable:!0,value:i})}}("Array.prototype.values",function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,i=!1,a={next:function(){if(!i&&n<e.length){var a=n++;return{value:t(a,e[a]),done:!1}}return i=!0,{done:!0,value:void 0}}};return a[Symbol.iterator]=function(){return a},a}(this,function(e,t){return t})}}); 1692/** @license 1693 1694 Copyright The Closure Library Authors. 1695 SPDX-License-Identifier: Apache-2.0 1696 */ 1697var i=i||{},a=this||self;function o(e){var t=typeof e;return"array"==(t="object"!=t?t:e?Array.isArray(e)?"array":t:"null")||"object"==t&&"number"==typeof e.length}function s(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function r(e,t,n){return e.call.apply(e.bind,arguments)}function l(e,t,n){if(!e)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,i),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function c(e,t,n){return(c=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?r:l).apply(null,arguments)}function u(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function h(e,t){function n(){}n.prototype=t.prototype,e.aa=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.Qb=function(e,n,i){for(var a=Array(arguments.length-2),o=2;o<arguments.length;o++)a[o-2]=arguments[o];return t.prototype[n].apply(e,a)}}function d(e){const t=e.length;if(0<t){const n=Array(t);for(let i=0;i<t;i++)n[i]=e[i];return n}return[]}function f(e,t){for(let n=1;n<arguments.length;n++){const t=arguments[n];if(o(t)){const n=e.length||0,i=t.length||0;e.length=n+i;for(let a=0;a<i;a++)e[n+a]=t[a]}else e.push(t)}}function p(e){return/^[\s\xa0]*$/.test(e)}function g(){var e=a.navigator;return e&&(e=e.userAgent)?e:""}function m(e){return m[" "](e),e}m[" "]=function(){};var v=!(-1==g().indexOf("Gecko")||-1!=g().toLowerCase().indexOf("webkit")&&-1==g().indexOf("Edge")||-1!=g().indexOf("Trident")||-1!=g().indexOf("MSIE")||-1!=g().indexOf("Edge"));function y(e,t,n){for(const i in e)t.call(n,e[i],i,e)}function b(e){const t={};for(const n in e)t[n]=e[n];return t}const _="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function w(e,t){let n,i;for(let a=1;a<arguments.length;a++){for(n in i=arguments[a],i)e[n]=i[n];for(let t=0;t<_.length;t++)n=_[t],Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}}function k(e){var t=1;e=e.split(":");const n=[];for(;0<t&&e.length;)n.push(e.shift()),t--;return e.length&&n.push(e.join(":")),n}function x(e){a.setTimeout(()=>{throw e},0)}function T(){var e=A;let t=null;return e.g&&(t=e.g,e.g=e.g.next,e.g||(e.h=null),t.next=null),t}var C=new class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return 0<this.h?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}(()=>new E,e=>e.reset());class E{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}let S,I=!1,A=new class{constructor(){this.h=this.g=null}add(e,t){const n=C.get();n.set(e,t),this.h?this.h.next=n:this.g=n,this.h=n}},D=()=>{const e=a.Promise.resolve(void 0);S=()=>{e.then(P)}};var P=()=>{for(var e;e=T();){try{e.h.call(e.g)}catch(n){x(n)}var t=C;t.j(e),100>t.h&&(t.h++,e.next=t.g,t.g=e)}I=!1};function O(){this.s=this.s,this.C=this.C}function M(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}O.prototype.s=!1,O.prototype.ma=function(){this.s||(this.s=!0,this.N())},O.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},M.prototype.h=function(){this.defaultPrevented=!0};var N=function(){if(!a.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{const e=()=>{};a.addEventListener("test",e,t),a.removeEventListener("test",e,t)}catch(n){}return e}();function R(e,t){if(M.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,i=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(v){e:{try{m(t.nodeName);var a=!0;break e}catch(o){}a=!1}a||(t=null)}}
vendor: 7,717 bytes, line 1697
1697else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,i?(this.clientX=void 0!==i.clientX?i.clientX:i.pageX,this.clientY=void 0!==i.clientY?i.clientY:i.pageY,this.screenX=i.screenX||0,this.screenY=i.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"==typeof e.pointerType?e.pointerType:L[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&R.aa.h.call(this)}}h(R,M);var L={2:"touch",3:"pen",4:"mouse"};R.prototype.h=function(){R.aa.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var V="closure_listenable_"+(1e6*Math.random()|0),q=0;function F(e,t,n,i,a){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!i,this.ha=a,this.key=++q,this.da=this.fa=!1}function B(e){e.da=!0,e.listener=null,e.proxy=null,e.src=null,e.ha=null}function U(e){this.src=e,this.g={},this.h=0}function j(e,t){var n=t.type;if(n in e.g){var i,a=e.g[n],o=Array.prototype.indexOf.call(a,t,void 0);(i=0<=o)&&Array.prototype.splice.call(a,o,1),i&&(B(t),0==e.g[n].length&&(delete e.g[n],e.h--))}}function H(e,t,n,i){for(var a=0;a<e.length;++a){var o=e[a];if(!o.da&&o.listener==t&&o.capture==!!n&&o.ha==i)return a}return-1}U.prototype.add=function(e,t,n,i,a){var o=e.toString();(e=this.g[o])||(e=this.g[o]=[],this.h++);var s=H(e,t,i,a);return-1<s?(t=e[s],n||(t.fa=!1)):((t=new F(t,this.src,o,!!i,a)).fa=n,e.push(t)),t};var z="closure_lm_"+(1e6*Math.random()|0),W={};function K(e,t,n,i,a){if(Array.isArray(t)){for(var o=0;o<t.length;o++)K(e,t[o],n,i,a);return null}return n=Z(n),e&&e[V]?e.K(t,n,s(i)?!!i.capture:!!i,a):function(e,t,n,i,a,o){if(!t)throw Error("Invalid event type");var r=s(a)?!!a.capture:!!a,l=X(e);if(l||(e[z]=l=new U(e)),n=l.add(t,n,i,r,o),n.proxy)return n;if(i=function(){function e(n){return t.call(e.src,e.listener,n)}const t=$;return e}(),n.proxy=i,i.src=e,i.listener=n,e.addEventListener)N||(a=r),void 0===a&&(a=!1),e.addEventListener(t.toString(),i,a);else if(e.attachEvent)e.attachEvent(Q(t.toString()),i);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(i)}return n}(e,t,n,!1,i,a)}function G(e,t,n,i,a){if(Array.isArray(t))for(var o=0;o<t.length;o++)G(e,t[o],n,i,a);else i=s(i)?!!i.capture:!!i,n=Z(n),e&&e[V]?(e=e.i,(t=String(t).toString())in e.g&&(-1<(n=H(o=e.g[t],n,i,a))&&(B(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete e.g[t],e.h--)))):e&&(e=X(e))&&(t=e.g[t.toString()],e=-1,t&&(e=H(t,n,i,a)),(n=-1<e?t[e]:null)&&Y(n))}function Y(e){if("number"!=typeof e&&e&&!e.da){var t=e.src;if(t&&t[V])j(t.i,e);else{var n=e.type,i=e.proxy;t.removeEventListener?t.removeEventListener(n,i,e.capture):t.detachEvent?t.detachEvent(Q(n),i):t.addListener&&t.removeListener&&t.removeListener(i),(n=X(t))?(j(n,e),0==n.h&&(n.src=null,t[z]=null)):B(e)}}}function Q(e){return e in W?W[e]:W[e]="on"+e}function $(e,t){if(e.da)e=!0;else{t=new R(t,this);var n=e.listener,i=e.ha||e.src;e.fa&&Y(e),e=n.call(i,t)}return e}function X(e){return(e=e[z])instanceof U?e:null}var J="__closure_events_fn_"+(1e9*Math.random()>>>0);function Z(e){return"function"==typeof e?e:(e[J]||(e[J]=function(t){return e.handleEvent(t)}),e[J])}function ee(){O.call(this),this.i=new U(this),this.M=this,this.F=null}function te(e,t){var n,i=e.F;if(i)for(n=[];i;i=i.F)n.push(i);if(e=e.M,i=t.type||t,"string"==typeof t)t=new M(t,e);else if(t instanceof M)t.target=t.target||e;else{var a=t;w(t=new M(i,e),a)}if(a=!0,n)for(var o=n.length-1;0<=o;o--){var s=t.g=n[o];a=ne(s,i,!0,t)&&a}if(a=ne(s=t.g=e,i,!0,t)&&a,a=ne(s,i,!1,t)&&a,n)for(o=0;o<n.length;o++)a=ne(s=t.g=n[o],i,!1,t)&&a}function ne(e,t,n,i){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();for(var a=!0,o=0;o<t.length;++o){var s=t[o];if(s&&!s.da&&s.capture==n){var r=s.listener,l=s.ha||s.src;s.fa&&j(e.i,s),a=!1!==r.call(l,i)&&a}}return a&&!i.defaultPrevented}function ie(e,t,n){if("function"==typeof e)n&&(e=c(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=c(e.handleEvent,e)}return 2147483647<Number(t)?-1:a.setTimeout(e,t||0)}function ae(e){e.g=ie(()=>{e.g=null,e.i&&(e.i=!1,ae(e))},e.l);const t=e.h;e.h=null,e.m.apply(null,t)}h(ee,O),ee.prototype[V]=!0,ee.prototype.removeEventListener=function(e,t,n,i){G(this,e,t,n,i)},ee.prototype.N=function(){if(ee.aa.N.call(this),this.i){var e,t=this.i;for(e in t.g){for(var n=t.g[e],i=0;i<n.length;i++)B(n[i]);delete t.g[e],t.h--}}this.F=null},ee.prototype.K=function(e,t,n,i){return this.i.add(String(e),t,!1,n,i)},ee.prototype.L=function(e,t,n,i){return this.i.add(String(e),t,!0,n,i)};class oe extends O{constructor(e,t){super(),this.m=e,this.l=t,this.h=null,this.i=!1,this.g=null}j(e){this.h=arguments,this.g?this.i=!0:ae(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function se(e){O.call(this),this.h=e,this.g={}}h(se,O);var re=[];function le(e){y(e.g,function(e,t){this.g.hasOwnProperty(t)&&Y(e)},e),e.g={}}se.prototype.N=function(){se.aa.N.call(this),le(this)},se.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var ce=a.JSON.stringify,ue=a.JSON.parse,he=class{stringify(e){return a.JSON.stringify(e,void 0)}parse(e){return a.JSON.parse(e,void 0)}};function de(){}function fe(e){return e.h||(e.h=e.i())}function pe(){}de.prototype.h=null;var ge={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function me(){M.call(this,"d")}function ve(){M.call(this,"c")}h(me,M),h(ve,M);var ye={},be=null;function _e(){return be=be||new ee}function we(e){M.call(this,ye.La,e)}function ke(e){const t=_e();te(t,new we(t))}function xe(e,t){M.call(this,ye.STAT_EVENT,e),this.stat=t}function Te(e){const t=_e();te(t,new xe(t,e))}function Ce(e,t){M.call(this,ye.Ma,e),this.size=t}function Ee(e,t){if("function"!=typeof e)throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){e()},t)}function Se(){this.g=!0}function Ie(e,t,n,i){e.info(function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{var n=JSON.parse(t);if(n)for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var i=n[e];if(!(2>i.length)){var a=i[1];if(Array.isArray(a)&&!(1>a.length)){var o=a[0];if("noop"!=o&&"stop"!=o&&"close"!=o)for(var s=1;s<a.length;s++)a[s]=""}}}return ce(n)}catch(r){return t}}(e,n)+(i?" "+i:"")})}ye.La="serverreachability",h(we,M),ye.STAT_EVENT="statevent",h(xe,M),ye.Ma="timingevent",h(Ce,M),Se.prototype.xa=function(){this.g=!1},Se.prototype.info=function(){};var Ae,De={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},Pe={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"};function Oe(){}function Me(e,t,n,i){this.j=e,this.i=t,this.l=n,this.R=i||1,this.U=new se(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new Ne}function Ne(){this.i=null,this.g="",this.h=!1}h(Oe,de),Oe.prototype.g=function(){return new XMLHttpRequest},Oe.prototype.i=function(){return{}},Ae=new Oe;var Re={},Le={};function Ve(e,t,n){e.L=1,e.v=ct(at(t)),e.m=n,e.P=!0,qe(e,null)}function qe(e,t){e.F=Date.now(),Ue(e),e.A=at(e.v);var n=e.A,i=e.R;Array.isArray(i)||(i=[String(i)]),kt(n.i,"t",i),e.C=0,n=e.j.J,e.h=new Ne,e.g=un(e.j,n?t:null,!e.m),
16970<e.O&&(e.M=new oe(c(e.Y,e,e.g),e.O)),t=e.U,n=e.g,i=e.ca;var a="readystatechange";Array.isArray(a)||(a&&(re[0]=a.toString()),a=re);for(var o=0;o<a.length;o++){var s=K(n,a[o],i||t.handleEvent,!1,t.h||t);if(!s)break;t.g[s.key]=s}t=e.H?b(e.H):{},e.m?(e.u||(e.u="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ea(e.A,e.u,e.m,t)):(e.u="GET",e.g.ea(e.A,e.u,null,t)),ke(),function(e,t,n,i,a,o){e.info(function(){if(e.g)if(o)for(var s="",r=o.split("&"),l=0;l<r.length;l++){var c=r[l].split("=");if(1<c.length){var u=c[0];c=c[1];var h=u.split("_");s=2<=h.length&&"type"==h[1]?s+(u+"=")+c+"&":s+(u+"=redacted&")}}else s=null;else s=o;return"XMLHTTP REQ ("+i+") [attempt "+a+"]: "+t+"\n"+n+"\n"+s})}(e.i,e.u,e.A,e.l,e.R,e.m)}function Fe(e){return!!e.g&&("GET"==e.u&&2!=e.L&&e.j.Ca)}function Be(e,t){var n=e.C,i=t.indexOf("\n",n);return-1==i?Le:(n=Number(t.substring(n,i)),isNaN(n)?Re:(i+=1)+n>t.length?Le:(t=t.slice(i,i+n),e.C=i+n,t))}function Ue(e){e.S=Date.now()+e.I,je(e,e.I)}function je(e,t){if(null!=e.B)throw Error("WatchDog timer not null");e.B=Ee(c(e.ba,e),t)}function He(e){e.B&&(a.clearTimeout(e.B),e.B=null)}function ze(e){0==e.j.G||e.J||on(e.j,e)}function We(e){He(e);var t=e.M;t&&"function"==typeof t.ma&&t.ma(),e.M=null,le(e.U),e.g&&(t=e.g,e.g=null,t.abort(),t.ma())}function Ke(e,t){try{var n=e.j;if(0!=n.G&&(n.g==e||Xe(n.h,e)))if(!e.K&&Xe(n.h,e)&&3==n.G){try{var i=n.Da.g.parse(t)}catch(u){i=null}if(Array.isArray(i)&&3==i.length){var a=i;if(0==a[0]){e:if(!n.u){if(n.g){if(!(n.g.F+3e3<e.F))break e;an(n),Gt(n)}en(n),Te(18)}}else n.za=a[1],0<n.za-n.T&&37500>a[2]&&n.F&&0==n.v&&!n.C&&(n.C=Ee(c(n.Za,n),6e3));if(1>=$e(n.h)&&n.ca){try{n.ca()}catch(u){}n.ca=void 0}}else rn(n,11)}else if((e.K||n.g==e)&&an(n),!p(t))for(a=n.Da.g.parse(t),t=0;t<a.length;t++){let c=a[t];if(n.T=c[0],c=c[1],2==n.G)if("c"==c[0]){n.K=c[1],n.ia=c[2];const t=c[3];null!=t&&(n.la=t,n.j.info("VER="+n.la));const a=c[4];null!=a&&(n.Aa=a,n.j.info("SVER="+n.Aa));const u=c[5];null!=u&&"number"==typeof u&&0<u&&(i=1.5*u,n.L=i,n.j.info("backChannelRequestTimeoutMs_="+i)),i=n;const h=e.g;if(h){const e=h.g?h.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(e){var o=i.h;o.g||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(o.j=o.l,o.g=new Set,o.h&&(Je(o,o.h),o.h=null))}if(i.D){const e=h.g?h.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(i.ya=e,lt(i.I,i.D,e))}}n.G=3,n.l&&n.l.ua(),n.ba&&(n.R=Date.now()-e.F,n.j.info("Handshake RTT: "+n.R+"ms"));var s=e;if((i=n).qa=cn(i,i.J?i.ia:null,i.W),s.K){Ze(i.h,s);var r=s,l=i.L;l&&(r.I=l),r.B&&(He(r),Ue(r)),i.g=s}else Zt(i);0<n.i.length&&Qt(n)}else"stop"!=c[0]&&"close"!=c[0]||rn(n,7);else 3==n.G&&("stop"==c[0]||"close"==c[0]?"stop"==c[0]?rn(n,7):Kt(n):"noop"!=c[0]&&n.l&&n.l.ta(c),n.v=0)}ke()}catch(u){}}Me.prototype.ca=function(e){e=e.target;const t=this.M;t&&3==jt(e)?t.j():this.Y(e)},Me.prototype.Y=function(e){try{if(e==this.g)e:{const d=jt(this.g);var t=this.g.Ba();this.g.Z();if(!(3>d)&&(3!=d||this.g&&(this.h.h||this.g.oa()||Ht(this.g)))){this.J||4!=d||7==t||ke(),He(this);var n=this.g.Z();this.X=n;t:if(Fe(this)){var i=Ht(this.g);e="";var o=i.length,s=4==jt(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){We(this),ze(this);var r="";break t}this.h.i=new a.TextDecoder}for(t=0;t<o;t++)this.h.h=!0,e+=this.h.i.decode(i[t],{stream:!(s&&t==o-1)});i.length=0,this.h.g+=e,this.C=0,r=this.h.g}else r=this.g.oa();if(this.o=200==n,function(e,t,n,i,a,o,s){e.info(function(){return"XMLHTTP RESP ("+i+") [ attempt "+a+"]: "+t+"\n"+n+"\n"+o+" "+s})}(this.i,this.u,this.A,this.l,this.R,d,n),this.o){if(this.T&&!this.K){t:{if(this.g){var l,c=this.g;if((l=c.g?c.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!p(l)){var u=l;break t}}u=null}if(!(n=u)){this.o=!1,this.s=3,Te(12),We(this),ze(this);break e}Ie(this.i,this.l,n,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,Ke(this,n)}if(this.P){let e;for(n=!0;!this.J&&this.C<r.length;){if(e=Be(this,r),e==Le){4==d&&(this.s=4,Te(14),n=!1),Ie(this.i,this.l,null,"[Incomplete Response]");break}if(e==Re){this.s=4,Te(15),Ie(this.i,this.l,r,"[Invalid Chunk]"),n=!1;break}Ie(this.i,this.l,e,null),Ke(this,e)}if(Fe(this)&&0!=this.C&&(this.h.g=this.h.g.slice(this.C),this.C=0),4!=d||0!=r.length||this.h.h||(this.s=1,Te(16),n=!1),this.o=this.o&&n,n){if(0<r.length&&!this.W){this.W=!0;var h=this.j;h.g==this&&h.ba&&!h.M&&(h.j.info("Great, no buffering proxy detected. Bytes received: "+r.length),tn(h),h.M=!0,Te(11))}}else Ie(this.i,this.l,r,"[Invalid Chunked Response]"),We(this),ze(this)}else Ie(this.i,this.l,r,null),Ke(this,r);4==d&&We(this),this.o&&!this.J&&(4==d?on(this.j,this):(this.o=!1,Ue(this)))}else(function(e){const t={};e=(e.g&&2<=jt(e)&&e.g.getAllResponseHeaders()||"").split("\r\n");for(let i=0;i<e.length;i++){if(p(e[i]))continue;var n=k(e[i]);const a=n[0];if("string"!=typeof(n=n[1]))continue;n=n.trim();const o=t[a]||[];t[a]=o,o.push(n)}!function(e,t){for(const n in e)t.call(void 0,e[n],n,e)}(t,function(e){return e.join(", ")})})(this.g),400==n&&0<r.indexOf("Unknown SID")?(this.s=3,Te(12)):(this.s=0,Te(13)),We(this),ze(this)}}}catch(d){}},Me.prototype.cancel=function(){this.J=!0,We(this)},Me.prototype.ba=function(){this.B=null;const e=Date.now();0<=e-this.S?(function(e,t){e.info(function(){return"TIMEOUT: "+t})}(this.i,this.A),2!=this.L&&(ke(),Te(17)),We(this),this.s=2,ze(this)):je(this,this.S-e)};var Ge=class{constructor(e,t){this.g=e,this.map=t}};function Ye(e){this.l=e||10,a.PerformanceNavigationTiming?e=0<(e=a.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(a.chrome&&a.chrome.loadTimes&&a.chrome.loadTimes()&&a.chrome.loadTimes().wasFetchedViaSpdy),this.j=e?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function Qe(e){return!!e.h||!!e.g&&e.g.size>=e.j}function $e(e){return e.h?1:e.g?e.g.size:0}function Xe(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function Je(e,t){e.g?e.g.add(t):e.h=t}function Ze(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function et(e){if(null!=e.h)return e.i.concat(e.h.D);if(null!=e.g&&0!==e.g.size){let t=e.i;for(const n of e.g.values())t=t.concat(n.D);return t}return d(e.i)}function tt(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(o(e)||"string"==typeof e)Array.prototype.forEach.call(e,t,void 0);else for(var n=function(e){if(e.na&&"function"==typeof e.na)return e.na();if(!e.V||"function"!=typeof e.V){if("undefined"!=typeof Map&&e instanceof Map)return Array.from(e.keys());if(!("undefined"!=typeof Set&&e instanceof Set)){if(o(e)||"string"==typeof e){var t=[];e=e.length;for(var n=0;n<e;n++)t.push(n);return t}t=[],n=0;for(const i in e)t[n++]=i;return t}}}(e),i=function(e){if(e.V&&"function"==typeof e.V)return e.V();if("undefined"!=typeof Map&&e instanceof Map||"undefined"!=typeof Set&&e instanceof Set)return Array.from(e.values());if("string"==typeof e)return e.split("");
1697if(o(e)){for(var t=[],n=e.length,i=0;i<n;i++)t.push(e[i]);return t}for(i in t=[],n=0,e)t[n++]=e[i];return t}(e),a=i.length,s=0;s<a;s++)t.call(void 0,i[s],n&&n[s],e)}Ye.prototype.cancel=function(){if(this.i=et(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const e of this.g.values())e.cancel();this.g.clear()}};var nt=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function it(e){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,e instanceof it){this.h=e.h,ot(this,e.j),this.o=e.o,this.g=e.g,st(this,e.s),this.l=e.l;var t=e.i,n=new yt;n.i=t.i,t.g&&(n.g=new Map(t.g),n.h=t.h),rt(this,n),this.m=e.m}else e&&(t=String(e).match(nt))?(this.h=!1,ot(this,t[1]||"",!0),this.o=ut(t[2]||""),this.g=ut(t[3]||"",!0),st(this,t[4]),this.l=ut(t[5]||"",!0),rt(this,t[6]||"",!0),this.m=ut(t[7]||"")):(this.h=!1,this.i=new yt(null,this.h))}function at(e){return new it(e)}function ot(e,t,n){e.j=n?ut(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function st(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.s=t}else e.s=null}function rt(e,t,n){t instanceof yt?(e.i=t,function(e,t){t&&!e.j&&(bt(e),e.i=null,e.g.forEach(function(e,t){var n=t.toLowerCase();t!=n&&(_t(this,t),kt(this,n,e))},e)),e.j=t}(e.i,e.h)):(n||(t=ht(t,mt)),e.i=new yt(t,e.h))}function lt(e,t,n){e.i.set(t,n)}function ct(e){return lt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function ut(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function ht(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,dt),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function dt(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}it.prototype.toString=function(){var e=[],t=this.j;t&&e.push(ht(t,ft,!0),":");var n=this.g;return(n||"file"==t)&&(e.push("//"),(t=this.o)&&e.push(ht(t,ft,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.s)&&e.push(":",String(n))),(n=this.l)&&(this.g&&"/"!=n.charAt(0)&&e.push("/"),e.push(ht(n,"/"==n.charAt(0)?gt:pt,!0))),(n=this.i.toString())&&e.push("?",n),(n=this.m)&&e.push("#",ht(n,vt)),e.join("")};var ft=/[#\/\?@]/g,pt=/[#\?:]/g,gt=/[#\?]/g,mt=/[#\?@]/g,vt=/#/g;function yt(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function bt(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var i=e[n].indexOf("="),a=null;if(0<=i){var o=e[n].substring(0,i);a=e[n].substring(i+1)}else o=e[n];t(o,a?decodeURIComponent(a.replace(/\+/g," ")):"")}}}(e.i,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function _t(e,t){bt(e),t=xt(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function wt(e,t){return bt(e),t=xt(e,t),e.g.has(t)}function kt(e,t,n){_t(e,t),0<n.length&&(e.i=null,e.g.set(xt(e,t),d(n)),e.h+=n.length)}function xt(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}function Tt(e,t,n,i,a){try{a&&(a.onload=null,a.onerror=null,a.onabort=null,a.ontimeout=null),i(n)}catch(o){}}function Ct(){this.g=new he}function Et(e,t,n){const i=n||"";try{tt(e,function(e,n){let a=e;s(e)&&(a=ce(e)),t.push(i+n+"="+encodeURIComponent(a))})}catch(ZNe){throw t.push(i+"type="+encodeURIComponent("_badmap")),ZNe}}function St(e){this.l=e.Ub||null,this.j=e.eb||!1}function It(e,t){ee.call(this),this.D=e,this.o=t,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}function At(e){e.j.read().then(e.Pa.bind(e)).catch(e.ga.bind(e))}function Dt(e){e.readyState=4,e.l=null,e.j=null,e.v=null,Pt(e)}function Pt(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function Ot(e){let t="";return y(e,function(e,n){t+=n,t+=":",t+=e,t+="\r\n"}),t}function Mt(e,t,n){e:{for(i in n){var i=!1;break e}i=!0}i||(n=Ot(n),"string"==typeof e?null!=n&&encodeURIComponent(String(n)):lt(e,t,n))}function Nt(e){ee.call(this),this.headers=new Map,this.o=e||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}(e=yt.prototype).add=function(e,t){bt(this),this.i=null,e=xt(this,e);var n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this},e.forEach=function(e,t){bt(this),this.g.forEach(function(n,i){n.forEac
1697h(function(n){e.call(t,n,i,this)},this)},this)},e.na=function(){bt(this);const e=Array.from(this.g.values()),t=Array.from(this.g.keys()),n=[];for(let i=0;i<t.length;i++){const a=e[i];for(let e=0;e<a.length;e++)n.push(t[i])}return n},e.V=function(e){bt(this);let t=[];if("string"==typeof e)wt(this,e)&&(t=t.concat(this.g.get(xt(this,e))));else{e=Array.from(this.g.values());for(let n=0;n<e.length;n++)t=t.concat(e[n])}return t},e.set=function(e,t){return bt(this),this.i=null,wt(this,e=xt(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},e.get=function(e,t){return e&&0<(e=this.V(e)).length?String(e[0]):t},e.toString=function(){if(this.i)return this.i;if(!this.g)return"";const e=[],t=Array.from(this.g.keys());for(var n=0;n<t.length;n++){var i=t[n];const o=encodeURIComponent(String(i)),s=this.V(i);for(i=0;i<s.length;i++){var a=o;""!==s[i]&&(a+="="+encodeURIComponent(String(s[i]))),e.push(a)}}return this.i=e.join("&")},h(St,de),St.prototype.g=function(){return new It(this.l,this.j)},St.prototype.i=function(e){return function(){return e}}({}),h(It,ee),(e=It.prototype).open=function(e,t){if(0!=this.readyState)throw this.abort(),Error("Error reopening a connection");this.B=e,this.A=t,this.readyState=1,Pt(this)},e.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;const t={headers:this.u,method:this.B,credentials:this.m,cache:void 0};e&&(t.body=e),(this.D||a).fetch(new Request(this.A,t)).then(this.Sa.bind(this),this.ga.bind(this))},e.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,Dt(this)),this.readyState=0},e.Sa=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,Pt(this)),this.g&&(this.readyState=3,Pt(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(void 0!==a.ReadableStream&&"body"in e){if(this.j=e.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;At(this)}else e.text().then(this.Ra.bind(this),this.ga.bind(this))},e.Pa=function(e){if(this.g){if(this.o&&e.value)this.response.push(e.value);else if(!this.o){var t=e.value?e.value:new Uint8Array(0);(t=this.v.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?Dt(this):Pt(this),3==this.readyState&&At(this)}},e.Ra=function(e){this.g&&(this.response=this.responseText=e,Dt(this))},e.Qa=function(e){this.g&&(this.response=e,Dt(this))},e.ga=function(){this.g&&Dt(this)},e.setRequestHeader=function(e,t){this.u.append(e,t)},e.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},e.getAllResponseHeaders=function(){if(!this.h)return"";const e=[],t=this.h.entries();for(var n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty(It.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}}),h(Nt,ee);var Rt=/^https?$/i,Lt=["POST","PUT"];function Vt(e,t){e.h=!1,e.g&&(e.j=!0,e.g.abort(),e.j=!1),e.l=t,e.m=5,qt(e),Bt(e)}function qt(e){e.A||(e.A=!0,te(e,"complete"),te(e,"error"))}function Ft(e){if(e.h&&void 0!==i&&(!e.v[1]||4!=jt(e)||2!=e.Z()))if(e.u&&4==jt(e))ie(e.Ea,0,e);else if(te(e,"readystatechange"),4==jt(e)){e.h=!1;try{const i=e.Z();e:switch(i){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t=!0;break e;default:t=!1}var n;if(!(n=t)){var o;if(o=0===i){var s=String(e.D).match(nt)[1]||null;!s&&a.self&&a.self.location&&(s=a.self.location.protocol.slice(0,-1)),o=!Rt.test(s?s.toLowerCase():"")}n=o}if(n)te(e,"complete"),te(e,"success");else{e.m=6;try{var r=2<jt(e)?e.g.statusText:""}catch(l){r=""}e.l=r+" ["+e.Z()+"]",qt(e)}}finally{Bt(e)}}}function Bt(e,t){if(e.g){Ut(e);const n=e.g,i=e.v[0]?()=>{}:null;e.g=null,e.v=null,t||te(e,"ready");try{n.onreadystatechange=i}catch(ZNe){}}}function Ut(e){e.I&&(a.clearTimeout(e.I),e.I=null)}function jt(e){return e.g?e.g.readyState:0}function Ht(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.H){case"":case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(t){return null}}
1697function zt(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function Wt(e){this.Aa=0,this.i=[],this.j=new Se,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=zt("failFast",!1,e),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=zt("baseRetryDelayMs",5e3,e),this.cb=zt("retryDelaySeedMs",1e4,e),this.Wa=zt("forwardChannelMaxRetries",2,e),this.wa=zt("forwardChannelRequestTimeoutMs",2e4,e),this.pa=e&&e.xmlHttpFactory||void 0,this.Xa=e&&e.Tb||void 0,this.Ca=e&&e.useFetchStreams||!1,this.L=void 0,this.J=e&&e.supportsCrossDomainXhr||!1,this.K="",this.h=new Ye(e&&e.concurrentRequestLimit),this.Da=new Ct,this.P=e&&e.fastHandshake||!1,this.O=e&&e.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=e&&e.Rb||!1,e&&e.xa&&this.j.xa(),e&&e.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&e&&e.detectBufferingProxy||!1,this.ja=void 0,e&&e.longPollingTimeout&&0<e.longPollingTimeout&&(this.ja=e.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}function Kt(e){if(Yt(e),3==e.G){var t=e.U++,n=at(e.I);if(lt(n,"SID",e.K),lt(n,"RID",t),lt(n,"TYPE","terminate"),Xt(e,n),(t=new Me(e,e.j,t)).L=2,t.v=ct(at(n)),n=!1,a.navigator&&a.navigator.sendBeacon)try{n=a.navigator.sendBeacon(t.v.toString(),"")}catch(i){}!n&&a.Image&&((new Image).src=t.v,n=!0),n||(t.g=un(t.j,null),t.g.ea(t.v)),t.F=Date.now(),Ue(t)}ln(e)}function Gt(e){e.g&&(tn(e),e.g.cancel(),e.g=null)}function Yt(e){Gt(e),e.u&&(a.clearTimeout(e.u),e.u=null),an(e),e.h.cancel(),e.s&&("number"==typeof e.s&&a.clearTimeout(e.s),e.s=null)}function Qt(e){if(!Qe(e.h)&&!e.s){e.s=!0;var t=e.Ga;S||D(),I||(S(),I=!0),A.add(t,e),e.B=0}}function $t(e,t){var n;n=t?t.l:e.U++;const i=at(e.I);lt(i,"SID",e.K),lt(i,"RID",n),lt(i,"AID",e.T),Xt(e,i),e.m&&e.o&&Mt(i,e.m,e.o),n=new Me(e,e.j,n,e.B+1),null===e.m&&(n.H=e.o),t&&(e.i=t.D.concat(e.i)),t=Jt(e,n,1e3),n.I=Math.round(.5*e.wa)+Math.round(.5*e.wa*Math.random()),Je(e.h,n),Ve(n,i,t)}function Xt(e,t){e.H&&y(e.H,function(e,n){lt(t,n,e)}),e.l&&tt({},function(e,n){lt(t,n,e)})}function Jt(e,t,n){n=Math.min(e.i.length,n);var i=e.l?c(e.l.Na,e.l,e):null;e:{var a=e.i;let t=-1;for(;;){const e=["count="+n];-1==t?0<n?(t=a[0].g,e.push("ofs="+t)):t=0:e.push("ofs="+t);let s=!0;for(let r=0;r<n;r++){let n=a[r].g;const l=a[r].map;if(n-=t,0>n)t=Math.max(0,a[r].g-100),s=!1;else try{Et(l,e,"req"+n+"_")}catch(o){i&&i(l)}}if(s){i=e.join("&");break e}}}return e=e.i.splice(0,n),t.D=e,i}function Zt(e){if(!e.g&&!e.u){e.Y=1;var t=e.Fa;S||D(),I||(S(),I=!0),A.add(t,e),e.v=0}}function en(e){return!(e.g||e.u||3<=e.v)&&(e.Y++,e.u=Ee(c(e.Fa,e),sn(e,e.v)),e.v++,!0)}function tn(e){null!=e.A&&(a.clearTimeout(e.A),e.A=null)}function nn(e){e.g=new Me(e,e.j,"rpc",e.Y),null===e.m&&(e.g.H=e.o),e.g.O=0;var t=at(e.qa);lt(t,"RID","rpc"),lt(t,"SID",e.K),lt(t,"AID",e.T),lt(t,"CI",e.F?"0":"1"),!e.F&&e.ja&<(t,"TO",e.ja),lt(t,"TYPE","xmlhttp"),Xt(e,t),e.m&&e.o&&Mt(t,e.m,e.o),e.L&&(e.g.I=e.L);var n=e.g;e=e.ia,n.L=1,n.v=ct(at(t)),n.m=null,n.P=!0,qe(n,e)}function an(e){null!=e.C&&(a.clearTimeout(e.C),e.C=null)}function on(e,t){var n=null;if(e.g==t){an(e),tn(e),e.g=null;var i=2}else{if(!Xe(e.h,t))return;n=t.D,Ze(e.h,t),i=1}if(0!=e.G)if(t.o)if(1==i){n=t.m?t.m.length:0,t=Date.now()-t.F;var a=e.B;te(i=_e(),new Ce(i,n)),Qt(e)}else Zt(e);else if(3==(a=t.s)||0==a&&0<t.X||!(1==i&&function(e,t){return!($e(e.h)>=e.h.j-(e.s?1:0)||(e.s?(e.i=t.D.concat(e.i),0):1==e.G||2==e.G||e.B>=(e.Va?0:e.Wa)||(e.s=Ee(c(e.Ga,e,t),sn(e,e.B)),e.B++,0)))}(e,t)||2==i&&en(e)))switch(n&&0<n.length&&(t=e.h,t.i=t.i.concat(n)),a){case 1:rn(e,5);break;case 4:rn(e,10);break;case 3:rn(e,6);break;default:rn(e,2)}}function sn(e,t){let n=e.Ta+Math.floor(Math.random()*e.cb);return e.isActive()||(n*=2),n*t}function rn(e,t){if(e.j.info("Error code "+t),2==t){var n=c(e.fb,e),i=e.Xa;const t=!i;i=new it(i||"//www.google.com/images/cleardot.gif"),a.location&&"http"==a.location.protocol||ot(i,"https"),ct(i),t?function(e,t){const n=new Se;if(a.Image){const i=new Image;i.onload=u(Tt,n,"TestLoadImage: loaded",!0,t,i),i.onerror=u(Tt,n,"TestLoadImage: error",!1,t,i),i.onabort=u(Tt,n,"TestLoadImage: abort",!1,t,i),i.ontimeout=u(Tt,n,"TestLoadImage: timeout",!1,t,i),a.setTimeout(function(){i.ontimeout&&i.ontimeout()},1e4),i.src=e}else t(!1)}(i.toString(),n):function(e,t){new Se;const n=new AbortController,i=setTimeout(()=>{n.abort(),Tt(0,0,!1,t)},1e4);fetch(e,{signal:n.signal}).then(e=>{clearTimeout(i),e.ok?Tt(0,0,!0,t):Tt(0,0,!1,t)}).catch(()=>{clearTimeout(i),Tt(0,0,!1,t)})}(i.toString(),n)}else Te(2);e.G=0,e.l&&e.l.sa(t),ln(e),Yt(e)}function ln(e){if(e.G=0,e.ka=[],e.l){const t=et(e.h);0==t.length&&0==e.i.length||(f(e.ka,t),f(e.ka,e.i),e.h.i.length=0,d(e.i),e.i.length=0),e.l.ra()}}function cn(e,t,n){var i=n instanceof it?at(n):new it(n);if(""!=i.g)t&&(i.g=t+"."+i.g),st(i,i.s);else{var o=a.location;i=o.protocol,t=t?t+"."+o.hostname:o.hostname,o=+o.port;var s=new it(null);i&&ot(s,i),t&&(s.g=t),o&&st(s,o),n&&(s.l=n),i=s}return n=e.D,t=e.ya,n&&t&<(i,n,t),lt(i,"VER",e.la),Xt(e,i),i}
vendor: 6,839 bytes, lines 1697-1702
1697function un(e,t,n){if(t&&!e.J)throw Error("Can't create secondary domain capable XhrIo object.");return(t=e.Ca&&!e.pa?new Nt(new St({eb:n})):new Nt(e.pa)).Ha(e.J),t}function hn(){}function dn(){}function fn(e,t){ee.call(this),this.g=new Wt(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.o=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.va&&(e?e["X-WebChannel-Client-Profile"]=t.va:e={"X-WebChannel-Client-Profile":t.va}),this.g.S=e,(e=t&&t.Sb)&&!p(e)&&(this.g.m=e),this.v=t&&t.supportsCrossDomainXhr||!1,this.u=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!p(t)&&(this.g.D=t,null!==(e=this.h)&&t in e&&(t in(e=this.h)&&delete e[t])),this.j=new mn(this)}function pn(e){me.call(this),e.__headers__&&(this.headers=e.__headers__,this.statusCode=e.__status__,delete e.__headers__,delete e.__status__);var t=e.__sm__;if(t){e:{for(const n in t){e=n;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function gn(){ve.call(this),this.status=1}function mn(e){this.g=e}(e=Nt.prototype).Ha=function(e){this.J=e},e.ea=function(e,t,n,i){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+e);t=t?t.toUpperCase():"GET",this.D=e,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():Ae.g(),this.v=this.o?fe(this.o):fe(Ae),this.g.onreadystatechange=c(this.Ea,this);try{this.B=!0,this.g.open(t,String(e),!0),this.B=!1}catch(s){return void Vt(this,s)}if(e=n||"",n=new Map(this.headers),i)if(Object.getPrototypeOf(i)===Object.prototype)for(var o in i)n.set(o,i[o]);else{if("function"!=typeof i.keys||"function"!=typeof i.get)throw Error("Unknown input type for opt_headers: "+String(i));for(const e of i.keys())n.set(e,i.get(e))}i=Array.from(n.keys()).find(e=>"content-type"==e.toLowerCase()),o=a.FormData&&e instanceof a.FormData,!(0<=Array.prototype.indexOf.call(Lt,t,void 0))||i||o||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[a,r]of n)this.g.setRequestHeader(a,r);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{Ut(this),this.u=!0,this.g.send(e),this.u=!1}catch(s){Vt(this,s)}},e.abort=function(e){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=e||7,te(this,"complete"),te(this,"abort"),Bt(this))},e.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Bt(this,!0)),Nt.aa.N.call(this)},e.Ea=function(){this.s||(this.B||this.u||this.j?Ft(this):this.bb())},e.bb=function(){Ft(this)},e.isActive=function(){return!!this.g},e.Z=function(){try{return 2<jt(this)?this.g.status:-1}catch(e){return-1}},e.oa=function(){try{return this.g?this.g.responseText:""}catch(e){return""}},e.Oa=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),ue(t)}},e.Ba=function(){return this.m},e.Ka=function(){return"string"==typeof this.l?this.l:String(this.l)},(e=Wt.prototype).la=8,e.G=1,e.connect=function(e,t,n,i){Te(0),this.W=e,this.H=t||{},n&&void 0!==i&&(this.H.OSID=n,this.H.OAID=i),this.F=this.X,this.I=cn(this,null,this.W),Qt(this)},e.Ga=function(e){if(this.s)if(this.s=null,1==this.G){if(!e){this.U=Math.floor(1e5*Math.random()),e=this.U++;const a=new Me(this,this.j,e);let o=this.o;if(this.S&&(o?(o=b(o),w(o,this.S)):o=this.S),null!==this.m||this.O||(a.H=o,o=null),this.P)e:{for(var t=0,n=0;n<this.i.length;n++){var i=this.i[n];if(void 0===(i="__data__"in i.map&&"string"==typeof(i=i.map.__data__)?i.length:void 0))break;if(4096<(t+=i)){t=n;break e}if(4096===t||n===this.i.length-1){t=n+1;break e}}t=1e3}else t=1e3;t=Jt(this,a,t),lt(n=at(this.I),"RID",e),lt(n,"CVER",22),this.D&<(n,"X-HTTP-Session-Id",this.D),Xt(this,n),o&&(this.O?t="headers="+encodeURIComponent(String(Ot(o)))+"&"+t:this.m&&Mt(n,this.m,o)),Je(this.h,a),this.Ua&<(n,"TYPE","init"),this.P?(lt(n,"$req",t),lt(n,"SID","null"),a.T=!0,Ve(a,n,null)):Ve(a,n,t),this.G=2}}else 3==this.G&&(e?$t(this,e):0==this.i.length||Qe(this.h)||$t(this))},e.Fa=function(){if(this.u=null,nn(this),this.ba&&!(this.M||null==this.g||0>=this.R)){var e=2*this.R;this.j.info("BP detection timer enabled: "+e),this.A=Ee(c(this.ab,this),e)}},e.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,Te(10),Gt(this),nn(this))},e.Za=function(){null!=this.C&&(this.C=null,Gt(this),en(this),Te(19))},e.fb=function(e){e?(this.j.info("Successfully pinged google.com"),Te(2)):(this.j.info("Failed to ping google.com"),Te(1))},e.isActive=function(){return!!this.l&&this.l.isActive(this)},(e=hn.prototype).ua=function(){},e.ta=function(){},e.sa=function(){},e.ra=function(){},e.isActive=function(){return!0},e.Na=function(){},dn.prototype.g=function(e,t){return new fn(e,t)},h(fn,ee),fn.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},fn.prototype.close=function(){Kt(this.g)},fn.prototype.o=function(e){var t=this.g;if("string"==typeof e){var n={};n.__data__=e,e=n}else this.u&&((n={}).__data__=ce(e),e=n);t.i.push(new Ge(t.Ya++,e)),3==t.G&&Qt(t)},fn.prototype.N=function(){this.g.l=null,delete this.j,Kt(this.g),delete this.g,fn.aa.N.call(this)},h(pn,me),h(gn,ve),h(mn,hn),mn.prototype.ua=function(){te(this.g,"a")},mn.prototype.ta=function(e){te(this.g,new pn(e))},mn.prototype.sa=function(e){te(this.g,new gn)},mn.prototype.ra=function(){te(this.g,"b")},dn.prototype.createWebChannel=dn.prototype.g,fn.prototype.send=fn.prototype.o,fn.prototype.open=fn.prototype.m,fn.prototype.close=fn.prototype.close,Tp=function(){return new dn},xp=function(){return _e()},kp=ye,wp={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},De.NO_ERROR=0,De.TIMEOUT=8,De.HTTP_ERROR=6,_p=De,Pe.COMPLETE="complete",bp=Pe,pe.EventType=ge,ge.OPEN="a",ge.CLOSE="b",ge.ERROR="c",ge.MESSAGE="d",ee.prototype.listen=ee.prototype.K,yp=pe,Nt.prototype.listenOnce=Nt.prototype.L,Nt.prototype.getLastError=Nt.prototype.Ka,Nt.prototype.getLastErrorCode=Nt.prototype.Ba,Nt.prototype.getStatus=Nt.prototype.Z,Nt.prototype.getResponseJson=Nt.prototype.Oa,Nt.prototype.getResponseText=Nt.prototype.oa,Nt.prototype.send=Nt.prototype.ea,Nt.prototype.setWithCredentials=Nt.prototype.Ha,vp=Nt}).apply(void 0!==Cp?Cp:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});const Ep="@firebase/firestore"; 1698/** 1699 * @license 1700 * Copyright 2017 Google LLC 1701 * 1702 * Licensed under the Apache License, Version 2.0 (the "License");
1703 * you may not use this file except in compliance with the License. 1704 * You may obtain a copy of the License at 1705 * 1706 * http://www.apache.org/licenses/LICENSE-2.0 1707 * 1708 * Unless required by applicable law or agreed to in writing, software 1709 * distributed under the License is distributed on an "AS IS" BASIS, 1710 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1711 * See the License for the specific language governing permissions and 1712 * limitations under the License. 1713 */class Sp{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}Sp.UNAUTHENTICATED=new Sp(null),Sp.GOOGLE_CREDENTIALS=new Sp("google-credentials-uid"),Sp.FIRST_PARTY=new Sp("first-party-uid"),Sp.MOCK_USER=new Sp("mock-user"); 1714/** 1715 * @license 1716 * Copyright 2017 Google LLC 1717 * 1718 * Licensed under the Apache License, Version 2.0 (the "License"); 1719 * you may not use this file except in compliance with the License. 1720 * You may obtain a copy of the License at 1721 * 1722 * http://www.apache.org/licenses/LICENSE-2.0 1723 * 1724 * Unless required by applicable law or agreed to in writing, software 1725 * distributed under the License is distributed on an "AS IS" BASIS, 1726 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1727 * See the License for the specific language governing permissions and 1728 * limitations under the License. 1729 */ 1730let Ip="10.14.0"; 1731/** 1732 * @license 1733 * Copyright 2017 Google LLC 1734 * 1735 * Licensed under the Apache License, Version 2.0 (the "License"); 1736 * you may not use this file except in compliance with the License. 1737 * You may obtain a copy of the License at 1738 * 1739 * http://www.apache.org/licenses/LICENSE-2.0 1740 * 1741 * Unless required by applicable law or agreed to in writing, software 1742 * distributed under the License is distributed on an "AS IS" BASIS, 1743 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1744 * See the License for the specific language governing permissions and 1745 * limitations under the License. 1746 */const Ap=new Kc("@firebase/firestore");function Dp(){return Ap.logLevel}function Pp(e,...t){if(Ap.logLevel<=Bc.DEBUG){const n=t.map(Np);Ap.debug("Firestore (".concat(Ip,"): ").concat(e),...n)}}function Op(e,...t){if(Ap.logLevel<=Bc.ERROR){const n=t.map(Np);Ap.error("Firestore (".concat(Ip,"): ").concat(e),...n)}}function Mp(e,...t){if(Ap.logLevel<=Bc.WARN){const n=t.map(Np);Ap.warn("Firestore (".concat(Ip,"): ").concat(e),...n)}}function Np(e){if("string"==typeof e)return e;try{ 1747/** 1748 * @license 1749 * Copyright 2020 Google LLC 1750 * 1751 * Licensed under the Apache License, Version 2.0 (the "License"); 1752 * you may not use this file except in compliance with the License. 1753 * You may obtain a copy of the License at 1754 * 1755 * http://www.apache.org/licenses/LICENSE-2.0 1756 * 1757 * Unless required by applicable law or agreed to in writing, software 1758 * distributed under the License is distributed on an "AS IS" BASIS, 1759 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1760 * See the License for the specific language governing permissions and 1761 * limitations under the License. 1762 */ 1763return t=e,JSON.stringify(t)}catch(n){return e}var t} 1764/** 1765 * @license 1766 * Copyright 2017 Google LLC 1767 * 1768 * Licensed under the Apache License, Version 2.0 (the "License"); 1769 * you may not use this file except in compliance with the License. 1770 * You may obtain a copy of the License at 1771 * 1772 * http://www.apache.org/licenses/LICENSE-2.0 1773 * 1774 * Unless required by applicable law or agreed to in writing, software 1775 * distributed under the License is distributed on an "AS IS" BASIS, 1776 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1777 * See the License for the specific language governing permissions and 1778 * limitations under the License. 1779 */function Rp(e="Unexpected state"){const t="FIRESTORE (".concat(Ip,") INTERNAL ASSERTION FAILED: ")+e;throw Op(t),new Error(t)}function Lp(e,t){e||Rp()}function Vp(e,t){return e} 1780/** 1781 * @license 1782 * Copyright 2017 Google LLC 1783 * 1784 * Licensed under the Apache License, Version 2.0 (the "License");
1785 * you may not use this file except in compliance with the License. 1786 * You may obtain a copy of the License at 1787 * 1788 * http://www.apache.org/licenses/LICENSE-2.0 1789 * 1790 * Unless required by applicable law or agreed to in writing, software 1791 * distributed under the License is distributed on an "AS IS" BASIS, 1792 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1793 * See the License for the specific language governing permissions and 1794 * limitations under the License. 1795 */const qp={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class Fp extends gc{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>"".concat(this.name,": [code=").concat(this.code,"]: ").concat(this.message)}} 1796/** 1797 * @license 1798 * Copyright 2017 Google LLC 1799 * 1800 * Licensed under the Apache License, Version 2.0 (the "License"); 1801 * you may not use this file except in compliance with the License. 1802 * You may obtain a copy of the License at 1803 * 1804 * http://www.apache.org/licenses/LICENSE-2.0 1805 * 1806 * Unless required by applicable law or agreed to in writing, software 1807 * distributed under the License is distributed on an "AS IS" BASIS, 1808 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1809 * See the License for the specific language governing permissions and 1810 * limitations under the License. 1811 */class Bp{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}} 1812/** 1813 * @license 1814 * Copyright 2017 Google LLC 1815 * 1816 * Licensed under the Apache License, Version 2.0 (the "License"); 1817 * you may not use this file except in compliance with the License. 1818 * You may obtain a copy of the License at 1819 * 1820 * http://www.apache.org/licenses/LICENSE-2.0 1821 * 1822 * Unless required by applicable law or agreed to in writing, software 1823 * distributed under the License is distributed on an "AS IS" BASIS, 1824 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1825 * See the License for the specific language governing permissions and 1826 * limitations under the License. 1827 */class Up{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization","Bearer ".concat(e))}}class jp{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(Sp.UNAUTHENTICATED))}shutdown(){}}class Hp{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class zp{constructor(e){this.t=e,this.currentUser=Sp.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){Lp(void 0===this.o);let n=this.i;const i=e=>this.i!==n?(n=this.i,t(e)):Promise.resolve();let a=new Bp;this.o=()=>{this.i++,this.currentUser=this.u(),a.resolve(),a=new Bp,e.enqueueRetryable(()=>i(this.currentUser))};const o=()=>{const t=a;e.enqueueRetryable(async()=>{await t.promise,await i(this.currentUser)})},s=e=>{Pp("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.o&&(this.auth.addAuthTokenListener(this.o),o())};this.t.onInit(e=>s(e)),setTimeout(()=>{if(!this.auth){const e=this.t.getImmediate({optional:!0});e?s(e):(Pp("FirebaseAuthCredentialsProvider","Auth not yet detected"),a.resolve(),a=new Bp)}},0),o()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(t=>this.i!==e?(Pp("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?(Lp("string"==typeof t.accessToken),new Up(t.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return Lp(null===e||"string"==typeof e),new Sp(e)}}class Wp{constructor(e,t,n){this.l=e,this.h=t,this.P=n,this.type="FirstParty",this.user=Sp.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class Kp{constructor(e,t,n){this.l=e,this.h=t,this.P=n}getToken(){return Promise.resolve(new Wp(this.l,this.h,this.P))}start(e,t){e.enqueueRetryable(()=>t(Sp.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class Gp{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class Yp{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,t){Lp(void 0===this.o);const n=e=>{null!=e.error&&Pp("FirebaseAppCheckTokenProvider","Error getting App Check token; using placeholder token instead. Error: ".concat(e.error.message));const n=e.token!==this.R;return this.R=e.token,Pp("FirebaseAppCheckTokenProvider","Received ".concat(n?"new":"existing"," token.")),n?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable(()=>n(t))};const i=e=>{Pp("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.o&&this.appCheck.addTokenListener(this.o)};this.A.onInit(e=>i(e)),setTimeout(()=>{if(!this.appCheck){const e=this.A.getImmediate({optional:!0});e?i(e):Pp("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>
1827e?(Lp("string"==typeof e.token),this.R=e.token,new Gp(e.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}} 1828/** 1829 * @license 1830 * Copyright 2020 Google LLC 1831 * 1832 * Licensed under the Apache License, Version 2.0 (the "License"); 1833 * you may not use this file except in compliance with the License. 1834 * You may obtain a copy of the License at 1835 * 1836 * http://www.apache.org/licenses/LICENSE-2.0 1837 * 1838 * Unless required by applicable law or agreed to in writing, software 1839 * distributed under the License is distributed on an "AS IS" BASIS, 1840 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1841 * See the License for the specific language governing permissions and 1842 * limitations under the License. 1843 */function Qp(e){const t="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(n);else for(let i=0;i<e;i++)n[i]=Math.floor(256*Math.random());return n} 1844/** 1845 * @license 1846 * Copyright 2017 Google LLC 1847 * 1848 * Licensed under the Apache License, Version 2.0 (the "License"); 1849 * you may not use this file except in compliance with the License. 1850 * You may obtain a copy of the License at 1851 * 1852 * http://www.apache.org/licenses/LICENSE-2.0 1853 * 1854 * Unless required by applicable law or agreed to in writing, software 1855 * distributed under the License is distributed on an "AS IS" BASIS, 1856 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1857 * See the License for the specific language governing permissions and 1858 * limitations under the License. 1859 */class $p{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=62*Math.floor(256/62);let n="";for(;n.length<20;){const i=Qp(40);for(let a=0;a<i.length;++a)n.length<20&&i[a]<t&&(n+=e.charAt(i[a]%62))}return n}}function Xp(e,t){return e<t?-1:e>t?1:0}function Jp(e,t,n){return e.length===t.length&&e.every((e,i)=>n(e,t[i]))} 1860/** 1861 * @license 1862 * Copyright 2017 Google LLC 1863 * 1864 * Licensed under the Apache License, Version 2.0 (the "License"); 1865 * you may not use this file except in compliance with the License. 1866 * You may obtain a copy of the License at 1867 * 1868 * http://www.apache.org/licenses/LICENSE-2.0 1869 * 1870 * Unless required by applicable law or agreed to in writing, software 1871 * distributed under the License is distributed on an "AS IS" BASIS, 1872 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1873 * See the License for the specific language governing permissions and 1874 * limitations under the License. 1875 */class Zp{constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new Fp(qp.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new Fp(qp.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800)throw new Fp(qp.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new Fp(qp.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return Zp.fromMillis(Date.now())}static fromDate(e){return Zp.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),n=Math.floor(1e6*(e-1e3*t));return new Zp(t,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?Xp(this.nanoseconds,e.nanoseconds):Xp(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}} 1876/** 1877 * @license 1878 * Copyright 2017 Google LLC 1879 * 1880 * Licensed under the Apache License, Version 2.0 (the "License"); 1881 * you may not use this file except in compliance with the License. 1882 * You may obtain a copy of the License at 1883 * 1884 * http://www.apache.org/licenses/LICENSE-2.0 1885 * 1886 * Unless required by applicable law or agreed to in writing, softw
1886are 1887 * distributed under the License is distributed on an "AS IS" BASIS, 1888 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1889 * See the License for the specific language governing permissions and 1890 * limitations under the License. 1891 */class eg{constructor(e){this.timestamp=e}static fromTimestamp(e){return new eg(e)}static min(){return new eg(new Zp(0,0))}static max(){return new eg(new Zp(253402300799,999999999))}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}} 1892/** 1893 * @license 1894 * Copyright 2017 Google LLC 1895 * 1896 * Licensed under the Apache License, Version 2.0 (the "License"); 1897 * you may not use this file except in compliance with the License. 1898 * You may obtain a copy of the License at 1899 * 1900 * http://www.apache.org/licenses/LICENSE-2.0 1901 * 1902 * Unless required by applicable law or agreed to in writing, software 1903 * distributed under the License is distributed on an "AS IS" BASIS, 1904 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1905 * See the License for the specific language governing permissions and 1906 * limitations under the License. 1907 */class tg{constructor(e,t,n){void 0===t?t=0:t>e.length&&Rp(),void 0===n?n=e.length-t:n>e.length-t&&Rp(),this.segments=e,this.offset=t,this.len=n}get length(){return this.len}isEqual(e){return 0===tg.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof tg?e.forEach(e=>{t.push(e)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++){const n=e.get(i),a=t.get(i);if(n<a)return-1;if(n>a)return 1}return e.length<t.length?-1:e.length>t.length?1:0}}class ng extends tg{construct(e,t,n){return new ng(e,t,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const t=[];for(const n of e){if(n.indexOf("//")>=0)throw new Fp(qp.INVALID_ARGUMENT,"Invalid segment (".concat(n,"). Paths must not contain // in them."));t.push(...n.split("/").filter(e=>e.length>0))}return new ng(t)}static emptyPath(){return new ng([])}}const ig=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class ag extends tg{construct(e,t,n){return new ag(e,t,n)}static isValidIdentifier(e){return ig.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),ag.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new ag(["__name__"])}static fromServerFormat(e){const t=[];let n="",i=0;const a=()=>{if(0===n.length)throw new Fp(qp.INVALID_ARGUMENT,"Invalid field path (".concat(e,"). Paths must not be empty, begin with '.', end with '.', or contain '..'"));t.push(n),n=""};let o=!1;for(;i<e.length;){const t=e[i];if("\\"===t){if(i+1===e.length)throw new Fp(qp.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const t=e[i+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new Fp(qp.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);n+=t,i+=2}else"`"===t?(o=!o,i++):"."!==t||o?(n+=t,i++):(a(),i++)}if(a(),o)throw new Fp(qp.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new ag(t)}static emptyPath(){return new ag([])}} 1908/** 1909 * @license 1910 * Copyright 2017 Google LLC 1911 * 1912 * Licensed under the Apache License, Version 2.0 (the "License");
1913 * you may not use this file except in compliance with the License. 1914 * You may obtain a copy of the License at 1915 * 1916 * http://www.apache.org/licenses/LICENSE-2.0 1917 * 1918 * Unless required by applicable law or agreed to in writing, software 1919 * distributed under the License is distributed on an "AS IS" BASIS, 1920 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1921 * See the License for the specific language governing permissions and 1922 * limitations under the License. 1923 */class og{constructor(e){this.path=e}static fromPath(e){return new og(ng.fromString(e))}static fromName(e){return new og(ng.fromString(e).popFirst(5))}static empty(){return new og(ng.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===ng.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return ng.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new og(new ng(e.slice()))}}function sg(e){return new rg(e.readTime,e.key,-1)}class rg{constructor(e,t,n){this.readTime=e,this.documentKey=t,this.largestBatchId=n}static min(){return new rg(eg.min(),og.empty(),-1)}static max(){return new rg(eg.max(),og.empty(),-1)}}function lg(e,t){let n=e.readTime.compareTo(t.readTime);return 0!==n?n:(n=og.comparator(e.documentKey,t.documentKey),0!==n?n:Xp(e.largestBatchId,t.largestBatchId) 1924/** 1925 * @license 1926 * Copyright 2020 Google LLC 1927 * 1928 * Licensed under the Apache License, Version 2.0 (the "License"); 1929 * you may not use this file except in compliance with the License. 1930 * You may obtain a copy of the License at 1931 * 1932 * http://www.apache.org/licenses/LICENSE-2.0 1933 * 1934 * Unless required by applicable law or agreed to in writing, software 1935 * distributed under the License is distributed on an "AS IS" BASIS, 1936 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1937 * See the License for the specific language governing permissions and 1938 * limitations under the License. 1939 */)}class cg{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}} 1940/** 1941 * @license 1942 * Copyright 2017 Google LLC 1943 * 1944 * Licensed under the Apache License, Version 2.0 (the "License"); 1945 * you may not use this file except in compliance with the License. 1946 * You may obtain a copy of the License at 1947 * 1948 * http://www.apache.org/licenses/LICENSE-2.0 1949 * 1950 * Unless required by applicable law or agreed to in writing, software 1951 * distributed under the License is distributed on an "AS IS" BASIS, 1952 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1953 * See the License for the specific language governing permissions and 1954 * limitations under the License. 1955 */async function ug(e){if(e.code!==qp.FAILED_PRECONDITION||"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab."!==e.message)throw e;Pp("LocalStore","Unexpectedly lost primary lease")} 1956/** 1957 * @license 1958 * Copyright 2017 Google LLC 1959 * 1960 * Licensed under the Apache License, Version 2.0 (the "License"); 1961 * you may not use this file except in compliance with the License. 1962 * You may obtain a copy of the License at 1963 * 1964 * http://www.apache.org/licenses/LICENSE-2.0 1965 * 1966 * Unless required by applicable law or agreed to in writing, software 1967 * distributed under the License is distributed on an "AS IS" BASIS, 1968 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1969 * See the License for the specific language governing permissions and 1970 * limitations under the License. 1971 */class hg{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)},e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&Rp(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new hg((n,i)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(n,i)},this.catchCallback=e=>{this.wrapFailure(t,e).next(n,i)}})}toPromise(){return new Promise((e,t)=>
1971{this.next(e,t)})}wrapUserFunction(e){try{const t=e();return t instanceof hg?t:hg.resolve(t)}catch(t){return hg.reject(t)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):hg.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):hg.reject(t)}static resolve(e){return new hg((t,n)=>{t(e)})}static reject(e){return new hg((t,n)=>{n(e)})}static waitFor(e){return new hg((t,n)=>{let i=0,a=0,o=!1;e.forEach(e=>{++i,e.next(()=>{++a,o&&a===i&&t()},e=>n(e))}),o=!0,a===i&&t()})}static or(e){let t=hg.resolve(!1);for(const n of e)t=t.next(e=>e?hg.resolve(e):n());return t}static forEach(e,t){const n=[];return e.forEach((e,i)=>{n.push(t.call(this,e,i))}),this.waitFor(n)}static mapArray(e,t){return new hg((n,i)=>{const a=e.length,o=new Array(a);let s=0;for(let r=0;r<a;r++){const l=r;t(e[l]).next(e=>{o[l]=e,++s,s===a&&n(o)},e=>i(e))}})}static doWhile(e,t){return new hg((n,i)=>{const a=()=>{!0===e()?t().next(()=>{a()},i):n()};a()})}}function dg(e){return"IndexedDbTransactionError"===e.name} 1972/** 1973 * @license 1974 * Copyright 2018 Google LLC 1975 * 1976 * Licensed under the Apache License, Version 2.0 (the "License"); 1977 * you may not use this file except in compliance with the License. 1978 * You may obtain a copy of the License at 1979 * 1980 * http://www.apache.org/licenses/LICENSE-2.0 1981 * 1982 * Unless required by applicable law or agreed to in writing, software 1983 * distributed under the License is distributed on an "AS IS" BASIS, 1984 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1985 * See the License for the specific language governing permissions and 1986 * limitations under the License. 1987 */class fg{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.ie(e),this.se=e=>t.writeSequenceNumber(e))}ie(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.se&&this.se(e),e}}function pg(e){return null==e}function gg(e){return 0===e&&1/e==-1/0} 1988/** 1989 * @license 1990 * Copyright 2017 Google LLC 1991 * 1992 * Licensed under the Apache License, Version 2.0 (the "License"); 1993 * you may not use this file except in compliance with the License. 1994 * You may obtain a copy of the License at 1995 * 1996 * http://www.apache.org/licenses/LICENSE-2.0 1997 * 1998 * Unless required by applicable law or agreed to in writing, software 1999 * distributed under the License is distributed on an "AS IS" BASIS, 2000 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2001 * See the License for the specific language governing permissions and 2002 * limitations under the License. 2003 */ 2004function mg(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function vg(e,t){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function yg(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0} 2005/** 2006 * @license 2007 * Copyright 2017 Google LLC 2008 * 2009 * Licensed under the Apache License, Version 2.0 (the "License"); 2010 * you may not use this file except in compliance with the License. 2011 * You may obtain a copy of the License at 2012 * 2013 * http://www.apache.org/licenses/LICENSE-2.0 2014 * 2015 * Unless required by applicable law or agreed to in writing, software 2016 * distributed under the License is distributed on an "AS IS" BASIS, 2017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2018 * See the License for the specific language governing permissions and 2019 * limitations under the License. 2020 */fg.oe=-1;let bg=class e{constructor(e,t){this.comparator=e,this.root=t||wg.EMPTY}insert(t,n){return new e(this.comparator,this.root.insert(t,n,this.comparator).copy(null,null,wg.BLACK,null,null))}remove(t){return new e(this.comparator,this.root.remove(t,this.comparator).copy(null,null,wg.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){const i=this.comparator(e,n.key);if(0===i)return t+n.left.size;i<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,n)=>(e(t,n),!1))}toString(){const e=[];return this.inorderTraversal((t,n)=>(e.push("".concat(t,":").concat(n)),!1)),"{".concat(e.join(", "),"}")}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new _g(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new _g(this.root,e,this.comparator,!1)}getReverseIterator(){return new _g(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new _g(this.root,e,this.comparator,!0)}},_g=class{constructor(e,t,n,i){this.isReverse=i,this.nodeStack=[];let a=1;for(;!e.isEmpty();)if(a=t?n(e.key,t):1,t&&i&&(a*=-1),a<0)e=this.isReverse?e.left:e.right;else{if(0===a){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}},wg=class e{constructor(t,n,i,a,o){this.key=t,this.value=n,this.color=null!=i?i:e.RED,this.left=null!=a?a:e.EMPTY,this.right=null!=o?o:e.EMPTY,this.size=this.left.size+1+this.right.size}copy(t,n,i,a,o){return new e(null!=t?t:this.key,null!=n?n:this.value,
vendor: 4,521 bytes, lines 2020-2037
2020null!=i?i:this.color,null!=a?a:this.left,null!=o?o:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let i=this;const a=n(e,i.key);return i=a<0?i.copy(null,null,null,i.left.insert(e,t,n),null):0===a?i.copy(null,t,null,null,null):i.copy(null,null,null,null,i.right.insert(e,t,n)),i.fixUp()}removeMin(){if(this.left.isEmpty())return e.EMPTY;let t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()}remove(t,n){let i,a=this;if(n(t,a.key)<0)a.left.isEmpty()||a.left.isRed()||a.left.left.isRed()||(a=a.moveRedLeft()),a=a.copy(null,null,null,a.left.remove(t,n),null);else{if(a.left.isRed()&&(a=a.rotateRight()),a.right.isEmpty()||a.right.isRed()||a.right.left.isRed()||(a=a.moveRedRight()),0===n(t,a.key)){if(a.right.isEmpty())return e.EMPTY;i=a.right.min(),a=a.copy(i.key,i.value,null,null,a.right.removeMin())}a=a.copy(null,null,null,null,a.right.remove(t,n))}return a.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight(){const t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Rp();if(this.right.isRed())throw Rp();const e=this.left.check();if(e!==this.right.check())throw Rp();return e+(this.isRed()?0:1)}};wg.EMPTY=null,wg.RED=!0,wg.BLACK=!1,wg.EMPTY=new class{constructor(){this.size=0}get key(){throw Rp()}get value(){throw Rp()}get color(){throw Rp()}get left(){throw Rp()}get right(){throw Rp()}copy(e,t,n,i,a){return this}insert(e,t,n){return new wg(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}}; 2021/** 2022 * @license 2023 * Copyright 2017 Google LLC 2024 * 2025 * Licensed under the Apache License, Version 2.0 (the "License"); 2026 * you may not use this file except in compliance with the License. 2027 * You may obtain a copy of the License at 2028 * 2029 * http://www.apache.org/licenses/LICENSE-2.0 2030 * 2031 * Unless required by applicable law or agreed to in writing, software 2032 * distributed under the License is distributed on an "AS IS" BASIS, 2033 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2034 * See the License for the specific language governing permissions and 2035 * limitations under the License. 2036 */ 2037class kg{constructor(e){this.comparator=e,this.data=new bg(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,n)=>(e(t),!1))}forEachInRange(e,t){const n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){const i=n.getNext();if(this.comparator(i.key,e[1])>=0)return;t(i.key)}}forEachWhile(e,t){let n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new xg(this.data.getIterator())}getIteratorFrom(e){return new xg(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;
2037return t.size<e.size&&(t=e,e=this),e.forEach(e=>{t=t.add(e)}),t}isEqual(e){if(!(e instanceof kg))return!1;if(this.size!==e.size)return!1;const t=this.data.getIterator(),n=e.data.getIterator();for(;t.hasNext();){const e=t.getNext().key,i=n.getNext().key;if(0!==this.comparator(e,i))return!1}return!0}toArray(){const e=[];return this.forEach(t=>{e.push(t)}),e}toString(){const e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){const t=new kg(this.comparator);return t.data=e,t}}class xg{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}} 2038/** 2039 * @license 2040 * Copyright 2020 Google LLC 2041 * 2042 * Licensed under the Apache License, Version 2.0 (the "License"); 2043 * you may not use this file except in compliance with the License. 2044 * You may obtain a copy of the License at 2045 * 2046 * http://www.apache.org/licenses/LICENSE-2.0 2047 * 2048 * Unless required by applicable law or agreed to in writing, software 2049 * distributed under the License is distributed on an "AS IS" BASIS, 2050 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2051 * See the License for the specific language governing permissions and 2052 * limitations under the License. 2053 */class Tg{constructor(e){this.fields=e,e.sort(ag.comparator)}static empty(){return new Tg([])}unionWith(e){let t=new kg(ag.comparator);for(const n of this.fields)t=t.add(n);for(const n of e)t=t.add(n);return new Tg(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return Jp(this.fields,e.fields,(e,t)=>e.isEqual(t))}} 2054/** 2055 * @license 2056 * Copyright 2023 Google LLC 2057 * 2058 * Licensed under the Apache License, Version 2.0 (the "License"); 2059 * you may not use this file except in compliance with the License. 2060 * You may obtain a copy of the License at 2061 * 2062 * http://www.apache.org/licenses/LICENSE-2.0 2063 * 2064 * Unless required by applicable law or agreed to in writing, software 2065 * distributed under the License is distributed on an "AS IS" BASIS, 2066 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2067 * See the License for the specific language governing permissions and 2068 * limitations under the License. 2069 */class Cg extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}} 2070/** 2071 * @license 2072 * Copyright 2020 Google LLC 2073 * 2074 * Licensed under the Apache License, Version 2.0 (the "License"); 2075 * you may not use this file except in compliance with the License. 2076 * You may obtain a copy of the License at 2077 * 2078 * http://www.apache.org/licenses/LICENSE-2.0 2079 * 2080 * Unless required by applicable law or agreed to in writing, software 2081 * distributed under the License is distributed on an "AS IS" BASIS, 2082 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2083 * See the License for the specific language governing permissions and 2084 * limitations under the License. 2085 */class Eg{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(e){try{return atob(e)}catch(t){throw"undefined"!=typeof DOMException&&t instanceof DOMException?new Cg("Invalid base64 string: "+t):t}}(e);return new Eg(t)}static fromUint8Array(e){const t=function(e){let t="";for(let n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(e);return new Eg(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return e=this.binaryString,btoa(e);var e}toUint8Array(){return function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return Xp(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Eg.EMPTY_BYTE_STRING=new Eg("");const Sg=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Ig(e){if(Lp(!!e),"string"==typeof e){let t=0;const n=Sg.exec(e);if(Lp(!!n),n[1]){let e=n[1];e=(e+"000000000").substr(0,9),t=Number(e)}const i=new Date(e);return{seconds:Math.floor(i.getTime()/1e3),nanos:t}}return{seconds:Ag(e.seconds),nanos:Ag(e.nanos)}}function Ag(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function Dg(e){return"string"==typeof e?Eg.fromBase64String(e):Eg.fromUint8Array(e)} 2086/** 2087 * @license 2088 * Copyright 2020 Google LLC 2089 * 2090 * Licensed under the Apache License, Version 2.0 (the "License");
2091 * you may not use this file except in compliance with the License. 2092 * You may obtain a copy of the License at 2093 * 2094 * http://www.apache.org/licenses/LICENSE-2.0 2095 * 2096 * Unless required by applicable law or agreed to in writing, software 2097 * distributed under the License is distributed on an "AS IS" BASIS, 2098 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2099 * See the License for the specific language governing permissions and 2100 * limitations under the License. 2101 */function Pg(e){var t,n;return"server_timestamp"===(null===(n=((null===(t=null==e?void 0:e.mapValue)||void 0===t?void 0:t.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function Og(e){const t=e.mapValue.fields.__previous_value__;return Pg(t)?Og(t):t}function Mg(e){const t=Ig(e.mapValue.fields.__local_write_time__.timestampValue);return new Zp(t.seconds,t.nanos)} 2102/** 2103 * @license 2104 * Copyright 2017 Google LLC 2105 * 2106 * Licensed under the Apache License, Version 2.0 (the "License"); 2107 * you may not use this file except in compliance with the License. 2108 * You may obtain a copy of the License at 2109 * 2110 * http://www.apache.org/licenses/LICENSE-2.0 2111 * 2112 * Unless required by applicable law or agreed to in writing, software 2113 * distributed under the License is distributed on an "AS IS" BASIS, 2114 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2115 * See the License for the specific language governing permissions and 2116 * limitations under the License. 2117 */class Ng{constructor(e,t,n,i,a,o,s,r,l){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=i,this.ssl=a,this.forceLongPolling=o,this.autoDetectLongPolling=s,this.longPollingOptions=r,this.useFetchStreams=l}}class Rg{constructor(e,t){this.projectId=e,this.database=t||"(default)"}static empty(){return new Rg("","")}get isDefaultDatabase(){return"(default)"===this.database}isEqual(e){return e instanceof Rg&&e.projectId===this.projectId&&e.database===this.database}} 2118/** 2119 * @license 2120 * Copyright 2020 Google LLC 2121 * 2122 * Licensed under the Apache License, Version 2.0 (the "License"); 2123 * you may not use this file except in compliance with the License. 2124 * You may obtain a copy of the License at 2125 * 2126 * http://www.apache.org/licenses/LICENSE-2.0 2127 * 2128 * Unless required by applicable law or agreed to in writing, software 2129 * distributed under the License is distributed on an "AS IS" BASIS, 2130 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2131 * See the License for the specific language governing permissions and 2132 * limitations under the License. 2133 */const Lg={fields:{__type__:{stringValue:"__max__"}}};function Vg(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?Pg(e)?4:function(e){return"__max__"===(((e.mapValue||{}).fields||{}).__type__||{}).stringValue} 2134/** 2135 * @license 2136 * Copyright 2017 Google LLC 2137 * 2138 * Licensed under the Apache License, Version 2.0 (the "License"); 2139 * you may not use this file except in compliance with the License. 2140 * You may obtain a copy of the License at 2141 * 2142 * http://www.apache.org/licenses/LICENSE-2.0 2143 * 2144 * Unless required by applicable law or agreed to in writing, software 2145 * distributed under the License is distributed on an "AS IS" BASIS, 2146 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2147 * See the License for the specific language governing permissions and 2148 * limitations under the License. 2149 */(e)?9007199254740991:function(e){var t,n;return"__vector__"===(null===(n=((null===(t=null==e?void 0:e.mapValue)||void 0===t?void 0:t.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}(e)?10:11:Rp()}function qg(e,t){if(e===t)return!0;const n=Vg(e);if(n!==Vg(t))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return Mg(e).isEqual(Mg(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;const n=Ig(e.timestampValue),i=Ig(t.timestampValue);return n.seconds===i.seconds&&n.nanos===i.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return i=t,Dg(e.bytesValue).isEqual(Dg(i.bytesValue));case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return Ag(e.geoPointValue.latitude)===Ag(t.geoPointValue.latitude)&&Ag(e.geoPointValue.longitude)===Ag(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return Ag(e.integerValue)===Ag(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){const n=Ag(e.doubleValue),i=Ag(t.doubleValue);return n===i?gg(n)===gg(i):isNaN(n)&&isNaN(i)}return!1}(e,t);case 9:return Jp(e.arrayValue.values||[],t.arrayValue.values||[],qg);case 10:case 11:return function(e,t){const n=e.mapValue.fields||{},i=t.mapValue.fields||{};if(mg(n)!==mg(i))return!1;for(const a in n)if(n.hasOwnProperty(a)&&(void 0===i[a]||!qg(n[a],i[a])))return!1;return!0}(e,t);default:return Rp()}var i}function Fg(e,t){return void 0!==(e.values||[]).find(e=>qg(e,t))}function Bg(e,t){if(e===t)return 0;const n=Vg(e),i=Vg(t);if(n!==i)return Xp(n,i);switch(n){case 0:case 9007199254740991:return 0;case 1:return Xp(e.booleanValue,t.booleanValue);case 2:return function(e,t){const n=Ag(e.integerValue||e.doubleValue),i=Ag(t.integerValue||t.doubleValue);return n<i?-1:n>i?1:n===i?0:isNaN(n)?isNaN(i)?0:-1:1}(e,t);
2149case 3:return Ug(e.timestampValue,t.timestampValue);case 4:return Ug(Mg(e),Mg(t));case 5:return Xp(e.stringValue,t.stringValue);case 6:return function(e,t){const n=Dg(e),i=Dg(t);return n.compareTo(i)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){const n=e.split("/"),i=t.split("/");for(let a=0;a<n.length&&a<i.length;a++){const e=Xp(n[a],i[a]);if(0!==e)return e}return Xp(n.length,i.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){const n=Xp(Ag(e.latitude),Ag(t.latitude));return 0!==n?n:Xp(Ag(e.longitude),Ag(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return jg(e.arrayValue,t.arrayValue);case 10:return function(e,t){var n,i,a,o;const s=e.fields||{},r=t.fields||{},l=null===(n=s.value)||void 0===n?void 0:n.arrayValue,c=null===(i=r.value)||void 0===i?void 0:i.arrayValue,u=Xp((null===(a=null==l?void 0:l.values)||void 0===a?void 0:a.length)||0,(null===(o=null==c?void 0:c.values)||void 0===o?void 0:o.length)||0);return 0!==u?u:jg(l,c)}(e.mapValue,t.mapValue);case 11:return function(e,t){if(e===Lg&&t===Lg)return 0;if(e===Lg)return 1;if(t===Lg)return-1;const n=e.fields||{},i=Object.keys(n),a=t.fields||{},o=Object.keys(a);i.sort(),o.sort();for(let s=0;s<i.length&&s<o.length;++s){const e=Xp(i[s],o[s]);if(0!==e)return e;const t=Bg(n[i[s]],a[o[s]]);if(0!==t)return t}return Xp(i.length,o.length)}(e.mapValue,t.mapValue);default:throw Rp()}}function Ug(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return Xp(e,t);const n=Ig(e),i=Ig(t),a=Xp(n.seconds,i.seconds);return 0!==a?a:Xp(n.nanos,i.nanos)}function jg(e,t){const n=e.values||[],i=t.values||[];for(let a=0;a<n.length&&a<i.length;++a){const e=Bg(n[a],i[a]);if(e)return e}return Xp(n.length,i.length)}function Hg(e){return zg(e)}function zg(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(e){const t=Ig(e);return"time(".concat(t.seconds,",").concat(t.nanos,")")}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?Dg(e.bytesValue).toBase64():"referenceValue"in e?function(e){return og.fromName(e).toString()}(e.referenceValue):"geoPointValue"in e?function(e){return"geo(".concat(e.latitude,",").concat(e.longitude,")")}(e.geoPointValue):"arrayValue"in e?function(e){let t="[",n=!0;for(const i of e.values||[])n?n=!1:t+=",",t+=zg(i);return t+"]"}(e.arrayValue):"mapValue"in e?function(e){const t=Object.keys(e.fields||{}).sort();let n="{",i=!0;for(const a of t)i?i=!1:n+=",",n+="".concat(a,":").concat(zg(e.fields[a]));return n+"}"}(e.mapValue):Rp()}function Wg(e,t){return{referenceValue:"projects/".concat(e.projectId,"/databases/").concat(e.database,"/documents/").concat(t.path.canonicalString())}}function Kg(e){return!!e&&"integerValue"in e}function Gg(e){return!!e&&"arrayValue"in e}function Yg(e){return!!e&&"nullValue"in e}function Qg(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function $g(e){return!!e&&"mapValue"in e}function Xg(e){if(e.geoPointValue)return{geoPointValue:Object.assign({},e.geoPointValue)};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:Object.assign({},e.timestampValue)};if(e.mapValue){const t={mapValue:{fields:{}}};return vg(e.mapValue.fields,(e,n)=>t.mapValue.fields[e]=Xg(n)),t}if(e.arrayValue){const t={arrayValue:{values:[]}};for(let n=0;n<(e.arrayValue.values||[]).length;++n)t.arrayValue.values[n]=Xg(e.arrayValue.values[n]);return t}return Object.assign({},e)}class Jg{constructor(e){this.value=e}static empty(){return new Jg({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let n=0;n<e.length-1;++n)if(t=(t.mapValue.fields||{})[e.get(n)],!$g(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=Xg(t)}setAll(e){let t=ag.emptyPath(),n={},i=[];e.forEach((e,a)=>{if(!t.isImmediateParentOf(a)){const e=this.getFieldsMap(t);this.applyChanges(e,n,i),n={},i=[],t=a.popLast()}e?n[a.lastSegment()]=Xg(e):i.push(a.lastSegment())});const a=this.getFieldsMap(t);this.applyChanges(a,n,i)}delete(e){const t=this.field(e.popLast());$g(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return qg(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let n=0;n<e.length;++n){let i=t.mapValue.fields[e.get(n)];$g(i)&&i.mapValue.fields||(i={mapValue:{fields:{}}},t.mapValue.fields[e.get(n)]=i),t=i}return t.mapValue.fields}
2149applyChanges(e,t,n){vg(t,(t,n)=>e[t]=n);for(const i of n)delete e[i]}clone(){return new Jg(Xg(this.value))}}function Zg(e){const t=[];return vg(e.fields,(e,n)=>{const i=new ag([e]);if($g(n)){const e=Zg(n.mapValue).fields;if(0===e.length)t.push(i);else for(const n of e)t.push(i.child(n))}else t.push(i)}),new Tg(t) 2150/** 2151 * @license 2152 * Copyright 2017 Google LLC 2153 * 2154 * Licensed under the Apache License, Version 2.0 (the "License"); 2155 * you may not use this file except in compliance with the License. 2156 * You may obtain a copy of the License at 2157 * 2158 * http://www.apache.org/licenses/LICENSE-2.0 2159 * 2160 * Unless required by applicable law or agreed to in writing, software 2161 * distributed under the License is distributed on an "AS IS" BASIS, 2162 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2163 * See the License for the specific language governing permissions and 2164 * limitations under the License. 2165 */}class em{constructor(e,t,n,i,a,o,s){this.key=e,this.documentType=t,this.version=n,this.readTime=i,this.createTime=a,this.data=o,this.documentState=s}static newInvalidDocument(e){return new em(e,0,eg.min(),eg.min(),eg.min(),Jg.empty(),0)}static newFoundDocument(e,t,n,i){return new em(e,1,t,eg.min(),n,i,0)}static newNoDocument(e,t){return new em(e,2,t,eg.min(),eg.min(),Jg.empty(),0)}static newUnknownDocument(e,t){return new em(e,3,t,eg.min(),eg.min(),Jg.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(eg.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=Jg.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=Jg.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=eg.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof em&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new em(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return"Document(".concat(this.key,", ").concat(this.version,", ").concat(JSON.stringify(this.data.value),", {createTime: ").concat(this.createTime,"}), {documentType: ").concat(this.documentType,"}), {documentState: ").concat(this.documentState,"})")}} 2166/** 2167 * @license 2168 * Copyright 2022 Google LLC 2169 * 2170 * Licensed under the Apache License, Version 2.0 (the "License"); 2171 * you may not use this file except in compliance with the License. 2172 * You may obtain a copy of the License at 2173 * 2174 * http://www.apache.org/licenses/LICENSE-2.0 2175 * 2176 * Unless required by applicable law or agreed to in writing, software 2177 * distributed under the License is distributed on an "AS IS" BASIS, 2178 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2179 * See the License for the specific language governing permissions and 2180 * limitations under the License. 2181 */class tm{constructor(e,t){this.position=e,this.inclusive=t}}function nm(e,t,n){let i=0;for(let a=0;a<e.position.length;a++){const o=t[a],s=e.position[a];if(i=o.field.isKeyField()?og.comparator(og.fromName(s.referenceValue),n.key):Bg(s,n.data.field(o.field)),"desc"===o.dir&&(i*=-1),0!==i)break}return i}function im(e,t){if(null===e)return null===t;if(null===t)return!1;if(e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(let n=0;n<e.position.length;n++)if(!qg(e.position[n],t.position[n]))return!1;return!0} 2182/** 2183 * @license 2184 * Copyright 2022 Google LLC 2185 * 2186 * Licensed under the Apache License, Version 2.0 (the "License");
2187 * you may not use this file except in compliance with the License. 2188 * You may obtain a copy of the License at 2189 * 2190 * http://www.apache.org/licenses/LICENSE-2.0 2191 * 2192 * Unless required by applicable law or agreed to in writing, software 2193 * distributed under the License is distributed on an "AS IS" BASIS, 2194 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2195 * See the License for the specific language governing permissions and 2196 * limitations under the License. 2197 */class am{constructor(e,t="asc"){this.field=e,this.dir=t}}function om(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)} 2198/** 2199 * @license 2200 * Copyright 2022 Google LLC 2201 * 2202 * Licensed under the Apache License, Version 2.0 (the "License"); 2203 * you may not use this file except in compliance with the License. 2204 * You may obtain a copy of the License at 2205 * 2206 * http://www.apache.org/licenses/LICENSE-2.0 2207 * 2208 * Unless required by applicable law or agreed to in writing, software 2209 * distributed under the License is distributed on an "AS IS" BASIS, 2210 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2211 * See the License for the specific language governing permissions and 2212 * limitations under the License. 2213 */class sm{}class rm extends sm{constructor(e,t,n){super(),this.field=e,this.op=t,this.value=n}static create(e,t,n){return e.isKeyField()?"in"===t||"not-in"===t?this.createKeyFieldInFilter(e,t,n):new pm(e,t,n):"array-contains"===t?new ym(e,n):"in"===t?new bm(e,n):"not-in"===t?new _m(e,n):"array-contains-any"===t?new wm(e,n):new rm(e,t,n)}static createKeyFieldInFilter(e,t,n){return"in"===t?new gm(e,n):new mm(e,n)}matches(e){const t=e.data.field(this.field);return"!="===this.op?null!==t&&this.matchesComparison(Bg(t,this.value)):null!==t&&Vg(this.value)===Vg(t)&&this.matchesComparison(Bg(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return Rp()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class lm extends sm{constructor(e,t){super(),this.filters=e,this.op=t,this.ae=null}static create(e,t){return new lm(e,t)}matches(e){return cm(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.ae||(this.ae=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.ae}getFilters(){return Object.assign([],this.filters)}}function cm(e){return"and"===e.op}function um(e){return function(e){for(const t of e.filters)if(t instanceof lm)return!1;return!0}(e)&&cm(e)}function hm(e){if(e instanceof rm)return e.field.canonicalString()+e.op.toString()+Hg(e.value);if(um(e))return e.filters.map(e=>hm(e)).join(",");{const t=e.filters.map(e=>hm(e)).join(",");return"".concat(e.op,"(").concat(t,")")}}function dm(e,t){return e instanceof rm?(n=e,(i=t)instanceof rm&&n.op===i.op&&n.field.isEqual(i.field)&&qg(n.value,i.value)):e instanceof lm?function(e,t){return t instanceof lm&&e.op===t.op&&e.filters.length===t.filters.length&&e.filters.reduce((e,n,i)=>e&&dm(n,t.filters[i]),!0)}(e,t):void Rp();var n,i}function fm(e){return e instanceof rm?"".concat((t=e).field.canonicalString()," ").concat(t.op," ").concat(Hg(t.value)):e instanceof lm?function(e){return e.op.toString()+" {"+e.getFilters().map(fm).join(" ,")+"}"}(e):"Filter";var t}class pm extends rm{constructor(e,t,n){super(e,t,n),this.key=og.fromName(n.referenceValue)}matches(e){const t=og.comparator(e.key,this.key);return this.matchesComparison(t)}}class gm extends rm{constructor(e,t){super(e,"in",t),this.keys=vm("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class mm extends rm{constructor(e,t){super(e,"not-in",t),this.keys=vm("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function vm(e,t){var n;return((null===(n=t.arrayValue)||void 0===n?void 0:n.values)||[]).map(e=>og.fromName(e.referenceValue))}class ym extends rm{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return Gg(t)&&Fg(t.arrayValue,this.value)}}class bm extends rm{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return null!==t&&Fg(this.value.arrayValue,t)}}class _m extends rm{constructor(e,t){super(e,"not-in",t)}matches(e){if(Fg(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return null!==t&&!Fg(this.value.arrayValue,t)}}class wm extends rm{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!Gg(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>Fg(this.value.arrayValue,e))}} 2214/** 2215 * @license 2216 * Copyright 2019 Google LLC 2217 * 2218 * Licensed under the Apache License, Version 2.0 (the "License");
2219 * you may not use this file except in compliance with the License. 2220 * You may obtain a copy of the License at 2221 * 2222 * http://www.apache.org/licenses/LICENSE-2.0 2223 * 2224 * Unless required by applicable law or agreed to in writing, software 2225 * distributed under the License is distributed on an "AS IS" BASIS, 2226 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2227 * See the License for the specific language governing permissions and 2228 * limitations under the License. 2229 */class km{constructor(e,t=null,n=[],i=[],a=null,o=null,s=null){this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=i,this.limit=a,this.startAt=o,this.endAt=s,this.ue=null}}function xm(e,t=null,n=[],i=[],a=null,o=null,s=null){return new km(e,t,n,i,a,o,s)}function Tm(e){const t=Vp(e);if(null===t.ue){let e=t.path.canonicalString();null!==t.collectionGroup&&(e+="|cg:"+t.collectionGroup),e+="|f:",e+=t.filters.map(e=>hm(e)).join(","),e+="|ob:",e+=t.orderBy.map(e=>{return(t=e).field.canonicalString()+t.dir;var t}).join(","),pg(t.limit)||(e+="|l:",e+=t.limit),t.startAt&&(e+="|lb:",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map(e=>Hg(e)).join(",")),t.endAt&&(e+="|ub:",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map(e=>Hg(e)).join(",")),t.ue=e}return t.ue}function Cm(e,t){if(e.limit!==t.limit)return!1;if(e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;n<e.orderBy.length;n++)if(!om(e.orderBy[n],t.orderBy[n]))return!1;if(e.filters.length!==t.filters.length)return!1;for(let n=0;n<e.filters.length;n++)if(!dm(e.filters[n],t.filters[n]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!im(e.startAt,t.startAt)&&im(e.endAt,t.endAt)}function Em(e){return og.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length} 2230/** 2231 * @license 2232 * Copyright 2017 Google LLC 2233 * 2234 * Licensed under the Apache License, Version 2.0 (the "License"); 2235 * you may not use this file except in compliance with the License. 2236 * You may obtain a copy of the License at 2237 * 2238 * http://www.apache.org/licenses/LICENSE-2.0 2239 * 2240 * Unless required by applicable law or agreed to in writing, software 2241 * distributed under the License is distributed on an "AS IS" BASIS, 2242 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2243 * See the License for the specific language governing permissions and 2244 * limitations under the License. 2245 */class Sm{constructor(e,t=null,n=[],i=[],a=null,o="F",s=null,r=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=i,this.limit=a,this.limitType=o,this.startAt=s,this.endAt=r,this.ce=null,this.le=null,this.he=null,this.startAt,this.endAt}}function Im(e){return new Sm(e)}function Am(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function Dm(e){return null!==e.collectionGroup}function Pm(e){const t=Vp(e);if(null===t.ce){t.ce=[];const e=new Set;for(const i of t.explicitOrderBy)t.ce.push(i),e.add(i.field.canonicalString());const n=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";(function(e){let t=new kg(ag.comparator);return e.filters.forEach(e=>{e.getFlattenedFilters().forEach(e=>{e.isInequality()&&(t=t.add(e.field))})}),t})(t).forEach(i=>{e.has(i.canonicalString())||i.isKeyField()||t.ce.push(new am(i,n))}),e.has(ag.keyField().canonicalString())||t.ce.push(new am(ag.keyField(),n))}return t.ce}function Om(e){const t=Vp(e);return t.le||(t.le=function(e,t){if("F"===e.limitType)return xm(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(e=>{const t="desc"===e.dir?"asc":"desc";return new am(e.field,t)});const n=e.endAt?new tm(e.endAt.position,e.endAt.inclusive):null,i=e.startAt?new tm(e.startAt.position,e.startAt.inclusive):null;return xm(e.path,e.collectionGroup,t,e.filters,e.limit,n,i)}}(t,Pm(e))),t.le}function Mm(e,t){const n=e.filters.concat([t]);return new Sm(e.path,e.collectionGroup,e.explicitOrderBy.slice(),n,e.limit,e.limitType,e.startAt,e.endAt)}function Nm(e,t,n){return new Sm(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function Rm(e,t){return Cm(Om(e),Om(t))&&e.limitType===t.limitType}function Lm(e){return"".concat(Tm(Om(e)),"|lt:").concat(e.limitType)}function Vm(e){return"Query(target=".concat(function(e){let t=e.path.canonicalString();return null!==e.collectionGroup&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=", filters: [".concat(e.filters.map(e=>fm(e)).join(", "),"]")),pg(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=", orderBy: [".concat(e.orderBy.map(e=>{return"".concat((t=e).field.canonicalString()," (").concat(t.dir,")");var t}).join(", "),"]")),e.startAt&&(t+=", startAt: ",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(e=>Hg(e)).join(",")),e.endAt&&(t+=", endAt: ",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(e=>Hg(e)).join(",")),"Target(".concat(t,")")}(Om(e)),"; limitType=").concat(e.limitType,")")}function qm(e,t){return t.isFoundDocument()&&function(e,t){const n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):og.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(const n of Pm(e))if(!n.field.isKeyField()&&null===t.data.field(n.field))return!1;return!0}(e,t)&&function(e,t){for(const n of e.filters)if(!n.matches(t))return!1;return!0}(e,t)&&(i=t,!((n=e).startAt&&!function(e,t,n){const i=nm(e,t,n);return e.inclusive?i<=0:i<0}(n.startAt,Pm(n),i)||n.endAt&&!function(e,t,n){const i=nm(e,t,n);return e.inclusive?i>=0:i>0}(n.endAt,Pm(n),i)));var n,i}function Fm(e){return(t,n)=>{let i=!1;for(const a of Pm(e)){const e=Bm(a,t,n);if(0!==e)return e;i=i||a.field.isKeyField()}return 0}}function Bm(e,t,n){const i=e.field.isKeyField()?og.comparator(t.key,n.key):function(e,t,n){const i=t.data.field(e),a=n.data.field(e);return null!==i&&null!==a?Bg(i,a):Rp()}(e.field,t,n);switch(e.dir){case"asc":return i;
2245case"desc":return-1*i;default:return Rp()}} 2246/** 2247 * @license 2248 * Copyright 2017 Google LLC 2249 * 2250 * Licensed under the Apache License, Version 2.0 (the "License"); 2251 * you may not use this file except in compliance with the License. 2252 * You may obtain a copy of the License at 2253 * 2254 * http://www.apache.org/licenses/LICENSE-2.0 2255 * 2256 * Unless required by applicable law or agreed to in writing, software 2257 * distributed under the License is distributed on an "AS IS" BASIS, 2258 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2259 * See the License for the specific language governing permissions and 2260 * limitations under the License. 2261 */class Um{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(const[i,a]of n)if(this.equalsFn(i,e))return a}has(e){return void 0!==this.get(e)}set(e,t){const n=this.mapKeyFn(e),i=this.inner[n];if(void 0===i)return this.inner[n]=[[e,t]],void this.innerSize++;for(let a=0;a<i.length;a++)if(this.equalsFn(i[a][0],e))return void(i[a]=[e,t]);i.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0===n)return!1;for(let i=0;i<n.length;i++)if(this.equalsFn(n[i][0],e))return 1===n.length?delete this.inner[t]:n.splice(i,1),this.innerSize--,!0;return!1}forEach(e){vg(this.inner,(t,n)=>{for(const[i,a]of n)e(i,a)})}isEmpty(){return yg(this.inner)}size(){return this.innerSize}} 2262/** 2263 * @license 2264 * Copyright 2017 Google LLC 2265 * 2266 * Licensed under the Apache License, Version 2.0 (the "License"); 2267 * you may not use this file except in compliance with the License. 2268 * You may obtain a copy of the License at 2269 * 2270 * http://www.apache.org/licenses/LICENSE-2.0 2271 * 2272 * Unless required by applicable law or agreed to in writing, software 2273 * distributed under the License is distributed on an "AS IS" BASIS, 2274 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2275 * See the License for the specific language governing permissions and 2276 * limitations under the License. 2277 */const jm=new bg(og.comparator);function Hm(){return jm}const zm=new bg(og.comparator);function Wm(...e){let t=zm;for(const n of e)t=t.insert(n.key,n);return t}function Km(e){let t=zm;return e.forEach((e,n)=>t=t.insert(e,n.overlayedDocument)),t}function Gm(){return Qm()}function Ym(){return Qm()}function Qm(){return new Um(e=>e.toString(),(e,t)=>e.isEqual(t))}const $m=new bg(og.comparator),Xm=new kg(og.comparator);function Jm(...e){let t=Xm;for(const n of e)t=t.add(n);return t}const Zm=new kg(Xp); 2278/** 2279 * @license 2280 * Copyright 2020 Google LLC 2281 * 2282 * Licensed under the Apache License, Version 2.0 (the "License"); 2283 * you may not use this file except in compliance with the License. 2284 * You may obtain a copy of the License at 2285 * 2286 * http://www.apache.org/licenses/LICENSE-2.0 2287 * 2288 * Unless required by applicable law or agreed to in writing, software 2289 * distributed under the License is distributed on an "AS IS" BASIS, 2290 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2291 * See the License for the specific language governing permissions and 2292 * limitations under the License. 2293 */ 2294function ev(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:gg(t)?"-0":t}}function tv(e){return{integerValue:""+e}}function nv(e,t){return function(e){return"number"==typeof e&&Number.isInteger(e)&&!gg(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}(t)?tv(t):ev(e,t)} 2295/** 2296 * @license 2297 * Copyright 2018 Google LLC 2298 * 2299 * Licensed under the Apache License, Version 2.0 (the "License"); 2300 * you may not use this file except in compliance with the License. 2301 * You may obtain a copy of the License at 2302 * 2303 * http://www.apache.org/licenses/LICENSE-2.0 2304 * 2305 * Unless required by applicable law or agreed to in writing, software 2306 * distributed under the License is distributed on an "AS IS" BASIS, 2307 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2308 * See the License for the specific language governing permissions and 2309 * limitations under the License. 2310 */class iv{constructor(){this._=void 0}}function av(e,t,n){return e instanceof rv?function(e,t){const n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&Pg(t)&&(t=Og(t)),t&&(n.fields.__previous_value__=t),{mapValue:n}}(n,t):e instanceof lv?cv(e,t):e instanceof uv?hv(e,t):function(e,t){const n=sv(e,t),i=fv(n)+fv(e.Pe);return Kg(n)&&Kg(e.Pe)?tv(i):ev(e.serializer,i)}(e,t)}function ov(e,t,n){return e instanceof lv?cv(e,t):e instanceof uv?hv(e,t):n}function sv(e,t){return e instanceof dv?Kg(n=t)||(i=n)&&"doubleValue"in i?t:{integerValue:0}:null;var n,i}class rv extends iv{}class lv extends iv{constructor(e){super(),this.elements=e}}function cv(e,t){const n=pv(t);for(const i of e.elements)n.some(e=>qg(e,i))||n.push(i);return{arrayValue:{values:n}}}class uv extends iv{constructor(e){super(),this.elements=e}}function hv(e,t){let n=pv(t);for(const i of e.elements)n=n.filter(e=>!qg(e,i));return{arrayValue:{values:n}}}
2310class dv extends iv{constructor(e,t){super(),this.serializer=e,this.Pe=t}}function fv(e){return Ag(e.integerValue||e.doubleValue)}function pv(e){return Gg(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]} 2311/** 2312 * @license 2313 * Copyright 2017 Google LLC 2314 * 2315 * Licensed under the Apache License, Version 2.0 (the "License"); 2316 * you may not use this file except in compliance with the License. 2317 * You may obtain a copy of the License at 2318 * 2319 * http://www.apache.org/licenses/LICENSE-2.0 2320 * 2321 * Unless required by applicable law or agreed to in writing, software 2322 * distributed under the License is distributed on an "AS IS" BASIS, 2323 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2324 * See the License for the specific language governing permissions and 2325 * limitations under the License. 2326 */class gv{constructor(e,t){this.field=e,this.transform=t}}class mv{constructor(e,t){this.version=e,this.transformResults=t}}class vv{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new vv}static exists(e){return new vv(void 0,e)}static updateTime(e){return new vv(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function yv(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class bv{}function _v(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new Dv(e.key,vv.none()):new Cv(e.key,e.data,vv.none());{const n=e.data,i=Jg.empty();let a=new kg(ag.comparator);for(let e of t.fields)if(!a.has(e)){let t=n.field(e);null===t&&e.length>1&&(e=e.popLast(),t=n.field(e)),null===t?i.delete(e):i.set(e,t),a=a.add(e)}return new Ev(e.key,i,new Tg(a.toArray()),vv.none())}}function wv(e,t,n){var i;e instanceof Cv?function(e,t,n){const i=e.value.clone(),a=Iv(e.fieldTransforms,t,n.transformResults);i.setAll(a),t.convertToFoundDocument(n.version,i).setHasCommittedMutations()}(e,t,n):e instanceof Ev?function(e,t,n){if(!yv(e.precondition,t))return void t.convertToUnknownDocument(n.version);const i=Iv(e.fieldTransforms,t,n.transformResults),a=t.data;a.setAll(Sv(e)),a.setAll(i),t.convertToFoundDocument(n.version,a).setHasCommittedMutations()}(e,t,n):(i=n,t.convertToNoDocument(i.version).setHasCommittedMutations())}function kv(e,t,n,i){return e instanceof Cv?function(e,t,n,i){if(!yv(e.precondition,t))return n;const a=e.value.clone(),o=Av(e.fieldTransforms,i,t);return a.setAll(o),t.convertToFoundDocument(t.version,a).setHasLocalMutations(),null}(e,t,n,i):e instanceof Ev?function(e,t,n,i){if(!yv(e.precondition,t))return n;const a=Av(e.fieldTransforms,i,t),o=t.data;return o.setAll(Sv(e)),o.setAll(a),t.convertToFoundDocument(t.version,o).setHasLocalMutations(),null===n?null:n.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map(e=>e.field))}(e,t,n,i):(a=t,o=n,yv(e.precondition,a)?(a.convertToNoDocument(a.version).setHasLocalMutations(),null):o);var a,o}function xv(e,t){let n=null;for(const i of e.fieldTransforms){const e=t.data.field(i.field),a=sv(i.transform,e||null);null!=a&&(null===n&&(n=Jg.empty()),n.set(i.field,a))}return n||null}function Tv(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&(n=e.fieldTransforms,i=t.fieldTransforms,!!(void 0===n&&void 0===i||n&&i&&Jp(n,i,(e,t)=>function(e,t){return e.field.isEqual(t.field)&&(n=e.transform,i=t.transform,n instanceof lv&&i instanceof lv||n instanceof uv&&i instanceof uv?Jp(n.elements,i.elements,qg):n instanceof dv&&i instanceof dv?qg(n.Pe,i.Pe):n instanceof rv&&i instanceof rv);var n,i}(e,t)))&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask)));var n,i}class Cv extends bv{constructor(e,t,n,i=[]){super(),this.key=e,this.value=t,this.precondition=n,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class Ev extends bv{constructor(e,t,n,i,a=[]){super(),this.key=e,this.data=t,this.fieldMask=n,this.prec
2326ondition=i,this.fieldTransforms=a,this.type=1}getFieldMask(){return this.fieldMask}}function Sv(e){const t=new Map;return e.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const i=e.data.field(n);t.set(n,i)}}),t}function Iv(e,t,n){const i=new Map;Lp(e.length===n.length);for(let a=0;a<n.length;a++){const o=e[a],s=o.transform,r=t.data.field(o.field);i.set(o.field,ov(s,r,n[a]))}return i}function Av(e,t,n){const i=new Map;for(const a of e){const e=a.transform,o=n.data.field(a.field);i.set(a.field,av(e,o,t))}return i}class Dv extends bv{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class Pv extends bv{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}} 2327/** 2328 * @license 2329 * Copyright 2017 Google LLC 2330 * 2331 * Licensed under the Apache License, Version 2.0 (the "License"); 2332 * you may not use this file except in compliance with the License. 2333 * You may obtain a copy of the License at 2334 * 2335 * http://www.apache.org/licenses/LICENSE-2.0 2336 * 2337 * Unless required by applicable law or agreed to in writing, software 2338 * distributed under the License is distributed on an "AS IS" BASIS, 2339 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2340 * See the License for the specific language governing permissions and 2341 * limitations under the License. 2342 */class Ov{constructor(e,t,n,i){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=i}applyToRemoteDocument(e,t){const n=t.mutationResults;for(let i=0;i<this.mutations.length;i++){const t=this.mutations[i];t.key.isEqual(e.key)&&wv(t,e,n[i])}}applyToLocalView(e,t){for(const n of this.baseMutations)n.key.isEqual(e.key)&&(t=kv(n,e,t,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(e.key)&&(t=kv(n,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const n=Ym();return this.mutations.forEach(i=>{const a=e.get(i.key),o=a.overlayedDocument;let s=this.applyToLocalView(o,a.mutatedFields);s=t.has(i.key)?null:s;const r=_v(o,s);null!==r&&n.set(i.key,r),o.isValidDocument()||o.convertToNoDocument(eg.min())}),n}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),Jm())}isEqual(e){return this.batchId===e.batchId&&Jp(this.mutations,e.mutations,(e,t)=>Tv(e,t))&&Jp(this.baseMutations,e.baseMutations,(e,t)=>Tv(e,t))}}class Mv{constructor(e,t,n,i){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.docVersions=i}static from(e,t,n){Lp(e.mutations.length===n.length);let i=function(){return $m}();const a=e.mutations;for(let o=0;o<a.length;o++)i=i.insert(a[o].key,n[o].version);return new Mv(e,t,n,i)}} 2343/** 2344 * @license 2345 * Copyright 2022 Google LLC 2346 * 2347 * Licensed under the Apache License, Version 2.0 (the "License"); 2348 * you may not use this file except in compliance with the License. 2349 * You may obtain a copy of the License at 2350 * 2351 * http://www.apache.org/licenses/LICENSE-2.0 2352 * 2353 * Unless required by applicable law or agreed to in writing, software 2354 * distributed under the License is distributed on an "AS IS" BASIS, 2355 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2356 * See the License for the specific language governing permissions and 2357 * limitations under the License. 2358 */class Nv{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return null!==e&&this.mutation===e.mutation}toString(){return"Overlay{\n largestBatchId: ".concat(this.largestBatchId,",\n mutation: ").concat(this.mutation.toString(),"\n }")}} 2359/** 2360 * @license 2361 * Copyright 2017 Google LLC 2362 * 2363 * Licensed under the Apache License, Version 2.0 (the "License"); 2364 * you may not use this file except in compliance with the License. 2365 * You may obtain a copy of the License at 2366 * 2367 * http://www.apache.org/licenses/LICENSE-2.0 2368 * 2369 * Unless required by applicable law or agreed to in writing, software 2370 * distributed under the License is distributed on an "AS IS" BASIS, 2371 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2372 * See the License for the specific language governing permissions and 2373 * limitations under the License. 2374 */class Rv{constructor(e,t){this.count=e,this.unchangedNames=t}} 2375/** 2376 * @license 2377 * Copyright 2017 Google LLC 2378 * 2379 * Licensed under the Apache License, Version 2.0 (the "License");
2380 * you may not use this file except in compliance with the License. 2381 * You may obtain a copy of the License at 2382 * 2383 * http://www.apache.org/licenses/LICENSE-2.0 2384 * 2385 * Unless required by applicable law or agreed to in writing, software 2386 * distributed under the License is distributed on an "AS IS" BASIS, 2387 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2388 * See the License for the specific language governing permissions and 2389 * limitations under the License. 2390 */var Lv,Vv;function qv(e){if(void 0===e)return Op("GRPC error has no .code"),qp.UNKNOWN;switch(e){case Lv.OK:return qp.OK;case Lv.CANCELLED:return qp.CANCELLED;case Lv.UNKNOWN:return qp.UNKNOWN;case Lv.DEADLINE_EXCEEDED:return qp.DEADLINE_EXCEEDED;case Lv.RESOURCE_EXHAUSTED:return qp.RESOURCE_EXHAUSTED;case Lv.INTERNAL:return qp.INTERNAL;case Lv.UNAVAILABLE:return qp.UNAVAILABLE;case Lv.UNAUTHENTICATED:return qp.UNAUTHENTICATED;case Lv.INVALID_ARGUMENT:return qp.INVALID_ARGUMENT;case Lv.NOT_FOUND:return qp.NOT_FOUND;case Lv.ALREADY_EXISTS:return qp.ALREADY_EXISTS;case Lv.PERMISSION_DENIED:return qp.PERMISSION_DENIED;case Lv.FAILED_PRECONDITION:return qp.FAILED_PRECONDITION;case Lv.ABORTED:return qp.ABORTED;case Lv.OUT_OF_RANGE:return qp.OUT_OF_RANGE;case Lv.UNIMPLEMENTED:return qp.UNIMPLEMENTED;case Lv.DATA_LOSS:return qp.DATA_LOSS;default:return Rp()}}(Vv=Lv||(Lv={}))[Vv.OK=0]="OK",Vv[Vv.CANCELLED=1]="CANCELLED",Vv[Vv.UNKNOWN=2]="UNKNOWN",Vv[Vv.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Vv[Vv.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Vv[Vv.NOT_FOUND=5]="NOT_FOUND",Vv[Vv.ALREADY_EXISTS=6]="ALREADY_EXISTS",Vv[Vv.PERMISSION_DENIED=7]="PERMISSION_DENIED",Vv[Vv.UNAUTHENTICATED=16]="UNAUTHENTICATED",Vv[Vv.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Vv[Vv.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Vv[Vv.ABORTED=10]="ABORTED",Vv[Vv.OUT_OF_RANGE=11]="OUT_OF_RANGE",Vv[Vv.UNIMPLEMENTED=12]="UNIMPLEMENTED",Vv[Vv.INTERNAL=13]="INTERNAL",Vv[Vv.UNAVAILABLE=14]="UNAVAILABLE",Vv[Vv.DATA_LOSS=15]="DATA_LOSS"; 2391/** 2392 * @license 2393 * Copyright 2022 Google LLC 2394 * 2395 * Licensed under the Apache License, Version 2.0 (the "License"); 2396 * you may not use this file except in compliance with the License. 2397 * You may obtain a copy of the License at 2398 * 2399 * http://www.apache.org/licenses/LICENSE-2.0 2400 * 2401 * Unless required by applicable law or agreed to in writing, software 2402 * distributed under the License is distributed on an "AS IS" BASIS, 2403 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2404 * See the License for the specific language governing permissions and 2405 * limitations under the License. 2406 */ 2407const Fv=new pp([4294967295,4294967295],0);function Bv(e){const t=(new TextEncoder).encode(e),n=new gp;return n.update(t),new Uint8Array(n.digest())}function Uv(e){const t=new DataView(e.buffer),n=t.getUint32(0,!0),i=t.getUint32(4,!0),a=t.getUint32(8,!0),o=t.getUint32(12,!0);return[new pp([n,i],0),new pp([a,o],0)]}class jv{constructor(e,t,n){if(this.bitmap=e,this.padding=t,this.hashCount=n,t<0||t>=8)throw new Hv("Invalid padding: ".concat(t));if(n<0)throw new Hv("Invalid hash count: ".concat(n));if(e.length>0&&0===this.hashCount)throw new Hv("Invalid hash count: ".concat(n));if(0===e.length&&0!==t)throw new Hv("Invalid padding when bitmap length is 0: ".concat(t));this.Ie=8*e.length-t,this.Te=pp.fromNumber(this.Ie)}Ee(e,t,n){let i=e.add(t.multiply(pp.fromNumber(n)));return 1===i.compare(Fv)&&(i=new pp([i.getBits(0),i.getBits(1)],0)),i.modulo(this.Te).toNumber()}de(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(0===this.Ie)return!1;const t=Bv(e),[n,i]=Uv(t);for(let a=0;a<this.hashCount;a++){const e=this.Ee(n,i,a);if(!this.de(e))return!1}return!0}static create(e,t,n){const i=e%8==0?0:8-e%8,a=new Uint8Array(Math.ceil(e/8)),o=new jv(a,i,t);return n.forEach(e=>o.insert(e)),o}insert(e){if(0===this.Ie)return;const t=Bv(e),[n,i]=Uv(t);for(let a=0;a<this.hashCount;a++){const e=this.Ee(n,i,a);this.Ae(e)}}Ae(e){const t=Math.floor(e/8),n=e%8;this.bitmap[t]|=1<<n}}class Hv extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}} 2408/** 2409 * @license 2410 * Copyright 2017 Google LLC 2411 * 2412 * Licensed under the Apache License, Version 2.0 (the "License");
2413 * you may not use this file except in compliance with the License. 2414 * You may obtain a copy of the License at 2415 * 2416 * http://www.apache.org/licenses/LICENSE-2.0 2417 * 2418 * Unless required by applicable law or agreed to in writing, software 2419 * distributed under the License is distributed on an "AS IS" BASIS, 2420 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2421 * See the License for the specific language governing permissions and 2422 * limitations under the License. 2423 */class zv{constructor(e,t,n,i,a){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=n,this.documentUpdates=i,this.resolvedLimboDocuments=a}static createSynthesizedRemoteEventForCurrentChange(e,t,n){const i=new Map;return i.set(e,Wv.createSynthesizedTargetChangeForCurrentChange(e,t,n)),new zv(eg.min(),i,new bg(Xp),Hm(),Jm())}}class Wv{constructor(e,t,n,i,a){this.resumeToken=e,this.current=t,this.addedDocuments=n,this.modifiedDocuments=i,this.removedDocuments=a}static createSynthesizedTargetChangeForCurrentChange(e,t,n){return new Wv(n,t,Jm(),Jm(),Jm())}} 2424/** 2425 * @license 2426 * Copyright 2017 Google LLC 2427 * 2428 * Licensed under the Apache License, Version 2.0 (the "License"); 2429 * you may not use this file except in compliance with the License. 2430 * You may obtain a copy of the License at 2431 * 2432 * http://www.apache.org/licenses/LICENSE-2.0 2433 * 2434 * Unless required by applicable law or agreed to in writing, software 2435 * distributed under the License is distributed on an "AS IS" BASIS, 2436 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2437 * See the License for the specific language governing permissions and 2438 * limitations under the License. 2439 */class Kv{constructor(e,t,n,i){this.Re=e,this.removedTargetIds=t,this.key=n,this.Ve=i}}class Gv{constructor(e,t){this.targetId=e,this.me=t}}class Yv{constructor(e,t,n=Eg.EMPTY_BYTE_STRING,i=null){this.state=e,this.targetIds=t,this.resumeToken=n,this.cause=i}}class Qv{constructor(){this.fe=0,this.ge=Jv(),this.pe=Eg.EMPTY_BYTE_STRING,this.ye=!1,this.we=!0}get current(){return this.ye}get resumeToken(){return this.pe}get Se(){return 0!==this.fe}get be(){return this.we}De(e){e.approximateByteSize()>0&&(this.we=!0,this.pe=e)}ve(){let e=Jm(),t=Jm(),n=Jm();return this.ge.forEach((i,a)=>{switch(a){case 0:e=e.add(i);break;case 2:t=t.add(i);break;case 1:n=n.add(i);break;default:Rp()}}),new Wv(this.pe,this.ye,e,t,n)}Ce(){this.we=!1,this.ge=Jv()}Fe(e,t){this.we=!0,this.ge=this.ge.insert(e,t)}Me(e){this.we=!0,this.ge=this.ge.remove(e)}xe(){this.fe+=1}Oe(){this.fe-=1,Lp(this.fe>=0)}Ne(){this.we=!0,this.ye=!0}}class $v{constructor(e){this.Le=e,this.Be=new Map,this.ke=Hm(),this.qe=Xv(),this.Qe=new bg(Xp)}Ke(e){for(const t of e.Re)e.Ve&&e.Ve.isFoundDocument()?this.$e(t,e.Ve):this.Ue(t,e.key,e.Ve);for(const t of e.removedTargetIds)this.Ue(t,e.key,e.Ve)}We(e){this.forEachTarget(e,t=>{const n=this.Ge(t);switch(e.state){case 0:this.ze(t)&&n.De(e.resumeToken);break;case 1:n.Oe(),n.Se||n.Ce(),n.De(e.resumeToken);break;case 2:n.Oe(),n.Se||this.removeTarget(t);break;case 3:this.ze(t)&&(n.Ne(),n.De(e.resumeToken));break;case 4:this.ze(t)&&(this.je(t),n.De(e.resumeToken));break;default:Rp()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.Be.forEach((e,n)=>{this.ze(n)&&t(n)})}He(e){const t=e.targetId,n=e.me.count,i=this.Je(t);if(i){const a=i.target;if(Em(a))if(0===n){const e=new og(a.path);this.Ue(t,e,em.newNoDocument(e,eg.min()))}else Lp(1===n);else{const i=this.Ye(t);if(i!==n){const n=this.Ze(e),a=n?this.Xe(n,e,i):1;if(0!==a){this.je(t);const e=2===a?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Qe=this.Qe.insert(t,e)}}}}}Ze(e){const t=e.me.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:n="",padding:i=0},hashCount:a=0}=t;let o,s;try{o=Dg(n).toUint8Array()}catch(r){if(r instanceof Cg)return Mp("Decoding the base64 bloom filter in existence filter failed ("+r.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw r}try{s=new jv(o,i,a)}catch(r){return Mp(r instanceof Hv?"BloomFilter error: ":"Applying bloom filter failed: ",r),null}return 0===s.Ie?null:s}Xe(e,t,n){return t.me.count===n-this.nt(e,t.targetId)?0:2}nt(e,t){const n=this.Le.getRemoteKeysForTarget(t);let i=0;
2439return n.forEach(n=>{const a=this.Le.tt(),o="projects/".concat(a.projectId,"/databases/").concat(a.database,"/documents/").concat(n.path.canonicalString());e.mightContain(o)||(this.Ue(t,n,null),i++)}),i}rt(e){const t=new Map;this.Be.forEach((n,i)=>{const a=this.Je(i);if(a){if(n.current&&Em(a.target)){const t=new og(a.target.path);null!==this.ke.get(t)||this.it(i,t)||this.Ue(i,t,em.newNoDocument(t,e))}n.be&&(t.set(i,n.ve()),n.Ce())}});let n=Jm();this.qe.forEach((e,t)=>{let i=!0;t.forEachWhile(e=>{const t=this.Je(e);return!t||"TargetPurposeLimboResolution"===t.purpose||(i=!1,!1)}),i&&(n=n.add(e))}),this.ke.forEach((t,n)=>n.setReadTime(e));const i=new zv(e,t,this.Qe,this.ke,n);return this.ke=Hm(),this.qe=Xv(),this.Qe=new bg(Xp),i}$e(e,t){if(!this.ze(e))return;const n=this.it(e,t.key)?2:0;this.Ge(e).Fe(t.key,n),this.ke=this.ke.insert(t.key,t),this.qe=this.qe.insert(t.key,this.st(t.key).add(e))}Ue(e,t,n){if(!this.ze(e))return;const i=this.Ge(e);this.it(e,t)?i.Fe(t,1):i.Me(t),this.qe=this.qe.insert(t,this.st(t).delete(e)),n&&(this.ke=this.ke.insert(t,n))}removeTarget(e){this.Be.delete(e)}Ye(e){const t=this.Ge(e).ve();return this.Le.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}xe(e){this.Ge(e).xe()}Ge(e){let t=this.Be.get(e);return t||(t=new Qv,this.Be.set(e,t)),t}st(e){let t=this.qe.get(e);return t||(t=new kg(Xp),this.qe=this.qe.insert(e,t)),t}ze(e){const t=null!==this.Je(e);return t||Pp("WatchChangeAggregator","Detected inactive target",e),t}Je(e){const t=this.Be.get(e);return t&&t.Se?null:this.Le.ot(e)}je(e){this.Be.set(e,new Qv),this.Le.getRemoteKeysForTarget(e).forEach(t=>{this.Ue(e,t,null)})}it(e,t){return this.Le.getRemoteKeysForTarget(e).has(t)}}function Xv(){return new bg(og.comparator)}function Jv(){return new bg(og.comparator)}const Zv=(()=>({asc:"ASCENDING",desc:"DESCENDING"}))(),ey=(()=>({"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"}))(),ty=(()=>({and:"AND",or:"OR"}))();class ny{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function iy(e,t){return e.useProto3Json||pg(t)?t:{value:t}}function ay(e,t){return e.useProto3Json?"".concat(new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z",""),".").concat(("000000000"+t.nanoseconds).slice(-9),"Z"):{seconds:""+t.seconds,nanos:t.nanoseconds}}function oy(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function sy(e,t){return ay(e,t.toTimestamp())}function ry(e){return Lp(!!e),eg.fromTimestamp(function(e){const t=Ig(e);return new Zp(t.seconds,t.nanos)}(e))}function ly(e,t){return cy(e,t).canonicalString()}function cy(e,t){const n=(i=e,new ng(["projects",i.projectId,"databases",i.database])).child("documents");var i;return void 0===t?n:n.child(t)}function uy(e){const t=ng.fromString(e);return Lp(Iy(t)),t}function hy(e,t){return ly(e.databaseId,t.path)}function dy(e,t){const n=uy(t);if(n.get(1)!==e.databaseId.projectId)throw new Fp(qp.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new Fp(qp.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new og(gy(n))}function fy(e,t){return ly(e.databaseId,t)}function py(e){return new ng(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function gy(e){return Lp(e.length>4&&"documents"===e.get(4)),e.popFirst(5)}function my(e,t,n){return{name:hy(e,t),fields:n.value.mapValue.fields}}function vy(e,t){return{documents:[fy(e,t.path)]}}function yy(e,t){const n={structuredQuery:{}},i=t.path;let a;null!==t.collectionGroup?(a=i,n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(a=i.popLast(),n.structuredQuery.from=[{collectionId:i.lastSegment()}]),n.parent=fy(e,a);const o=function(e){if(0!==e.length)return Ey(lm.create(e,"and"))}(t.filters);o&&(n.structuredQuery.where=o);const s=function(e){if(0!==e.length)return e.map(e=>{return{field:Ty((t=e).field),direction:wy(t.dir)};var t})}(t.orderBy);s&&(n.structuredQuery.orderBy=s);const r=iy(e,t.limit);return null!==r&&(n.structuredQuery.limit=r),t.startAt&&(n.structuredQuery.startAt={before:(l=t.startAt).inclusive,values:l.position}),t.endAt&&(n.structuredQuery.endAt=function(e){return{before:!e.inclusive,values:e.position}}(t.endAt)),{_t:n,parent:a};var l}function by(e){let t=function(e){const t=uy(e);return 4===t.length?ng.emptyPath():gy(t)}(e.parent);const n=e.structuredQuery,i=n.from?n.from.length:0;let a=null;if(i>0){Lp(1===i);const e=n.from[0];e.allDescendants?a=e.collectionId:t=t.child(e.collectionId)}let o=[];n.where&&(o=function(e){const t=_y(e);return t instanceof lm&&um(t)?t.getFilters():[t]}(n.where));let s=[];n.orderBy&&(s=n.orderBy.map(e=>{return new am(Cy((t=e).field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction));var t}));let r=null;n.limit&&(r=function(e){let t;return t="object"==typeof e?e.value:e,pg(t)?null:t}(n.limit));let l=null;n.startAt&&(l=function(e){const t=!!e.before,n=e.values||[];return new tm(n,t)}(n.startAt));let c=null;return n.endAt&&(c=function(e){const t=!e.before,n=e.values||[];return new tm(n,t)}(n.endAt)),function(e,t,n,i,a,o,s,r){return new Sm(e,t,n,i,a,o,s,r)}(t,a,s,o,r,"F",l,c)}function _y(e){return void 0!==e.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":const t=Cy(e.unaryFilter.field);return rm.create(t,"==",{doubleValue:NaN});case"IS_NULL":const n=Cy(e.unaryFilter.field);return rm.create(n,"==",{nullValue:"NULL_VALUE"});
2439case"IS_NOT_NAN":const i=Cy(e.unaryFilter.field);return rm.create(i,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const a=Cy(e.unaryFilter.field);return rm.create(a,"!=",{nullValue:"NULL_VALUE"});default:return Rp()}}(e):void 0!==e.fieldFilter?(t=e,rm.create(Cy(t.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return Rp()}}(t.fieldFilter.op),t.fieldFilter.value)):void 0!==e.compositeFilter?function(e){return lm.create(e.compositeFilter.filters.map(e=>_y(e)),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return Rp()}}(e.compositeFilter.op))}(e):Rp();var t}function wy(e){return Zv[e]}function ky(e){return ey[e]}function xy(e){return ty[e]}function Ty(e){return{fieldPath:e.canonicalString()}}function Cy(e){return ag.fromServerFormat(e.fieldPath)}function Ey(e){return e instanceof rm?function(e){if("=="===e.op){if(Qg(e.value))return{unaryFilter:{field:Ty(e.field),op:"IS_NAN"}};if(Yg(e.value))return{unaryFilter:{field:Ty(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(Qg(e.value))return{unaryFilter:{field:Ty(e.field),op:"IS_NOT_NAN"}};if(Yg(e.value))return{unaryFilter:{field:Ty(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Ty(e.field),op:ky(e.op),value:e.value}}}(e):e instanceof lm?function(e){const t=e.getFilters().map(e=>Ey(e));return 1===t.length?t[0]:{compositeFilter:{op:xy(e.op),filters:t}}}(e):Rp()}function Sy(e){const t=[];return e.fields.forEach(e=>t.push(e.canonicalString())),{fieldPaths:t}}function Iy(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)} 2440/** 2441 * @license 2442 * Copyright 2017 Google LLC 2443 * 2444 * Licensed under the Apache License, Version 2.0 (the "License"); 2445 * you may not use this file except in compliance with the License. 2446 * You may obtain a copy of the License at 2447 * 2448 * http://www.apache.org/licenses/LICENSE-2.0 2449 * 2450 * Unless required by applicable law or agreed to in writing, software 2451 * distributed under the License is distributed on an "AS IS" BASIS, 2452 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2453 * See the License for the specific language governing permissions and 2454 * limitations under the License. 2455 */class Ay{constructor(e,t,n,i,a=eg.min(),o=eg.min(),s=Eg.EMPTY_BYTE_STRING,r=null){this.target=e,this.targetId=t,this.purpose=n,this.sequenceNumber=i,this.snapshotVersion=a,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=s,this.expectedCount=r}withSequenceNumber(e){return new Ay(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new Ay(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Ay(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Ay(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}} 2456/** 2457 * @license 2458 * Copyright 2017 Google LLC 2459 * 2460 * Licensed under the Apache License, Version 2.0 (the "License"); 2461 * you may not use this file except in compliance with the License. 2462 * You may obtain a copy of the License at 2463 * 2464 * http://www.apache.org/licenses/LICENSE-2.0 2465 * 2466 * Unless required by applicable law or agreed to in writing, software 2467 * distributed under the License is distributed on an "AS IS" BASIS, 2468 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2469 * See the License for the specific language governing permissions and 2470 * limitations under the License. 2471 */class Dy{constructor(e){this.ct=e}}function Py(e){const t=by({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?Nm(t,t.limit,"L"):t} 2472/** 2473 * @license 2474 * Copyright 2019 Google LLC 2475 * 2476 * Licensed under the Apache License, Version 2.0 (the "License");
2477 * you may not use this file except in compliance with the License. 2478 * You may obtain a copy of the License at 2479 * 2480 * http://www.apache.org/licenses/LICENSE-2.0 2481 * 2482 * Unless required by applicable law or agreed to in writing, software 2483 * distributed under the License is distributed on an "AS IS" BASIS, 2484 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2485 * See the License for the specific language governing permissions and 2486 * limitations under the License. 2487 */class Oy{constructor(){this.un=new My}addToCollectionParentIndex(e,t){return this.un.add(t),hg.resolve()}getCollectionParents(e,t){return hg.resolve(this.un.getEntries(t))}addFieldIndex(e,t){return hg.resolve()}deleteFieldIndex(e,t){return hg.resolve()}deleteAllFieldIndexes(e){return hg.resolve()}createTargetIndexes(e,t){return hg.resolve()}getDocumentsMatchingTarget(e,t){return hg.resolve(null)}getIndexType(e,t){return hg.resolve(0)}getFieldIndexes(e,t){return hg.resolve([])}getNextCollectionGroupToUpdate(e){return hg.resolve(null)}getMinOffset(e,t){return hg.resolve(rg.min())}getMinOffsetFromCollectionGroup(e,t){return hg.resolve(rg.min())}updateCollectionGroup(e,t,n){return hg.resolve()}updateIndexEntries(e,t){return hg.resolve()}}class My{constructor(){this.index={}}add(e){const t=e.lastSegment(),n=e.popLast(),i=this.index[t]||new kg(ng.comparator),a=!i.has(n);return this.index[t]=i.add(n),a}has(e){const t=e.lastSegment(),n=e.popLast(),i=this.index[t];return i&&i.has(n)}getEntries(e){return(this.index[e]||new kg(ng.comparator)).toArray()}} 2488/** 2489 * @license 2490 * Copyright 2017 Google LLC 2491 * 2492 * Licensed under the Apache License, Version 2.0 (the "License"); 2493 * you may not use this file except in compliance with the License. 2494 * You may obtain a copy of the License at 2495 * 2496 * http://www.apache.org/licenses/LICENSE-2.0 2497 * 2498 * Unless required by applicable law or agreed to in writing, software 2499 * distributed under the License is distributed on an "AS IS" BASIS, 2500 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2501 * See the License for the specific language governing permissions and 2502 * limitations under the License. 2503 */class Ny{constructor(e){this.Ln=e}next(){return this.Ln+=2,this.Ln}static Bn(){return new Ny(0)}static kn(){return new Ny(-1)}} 2504/** 2505 * @license 2506 * Copyright 2017 Google LLC 2507 * 2508 * Licensed under the Apache License, Version 2.0 (the "License"); 2509 * you may not use this file except in compliance with the License. 2510 * You may obtain a copy of the License at 2511 * 2512 * http://www.apache.org/licenses/LICENSE-2.0 2513 * 2514 * Unless required by applicable law or agreed to in writing, software 2515 * distributed under the License is distributed on an "AS IS" BASIS, 2516 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2517 * See the License for the specific language governing permissions and 2518 * limitations under the License. 2519 */class Ry{constructor(){this.changes=new Um(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,em.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const n=this.changes.get(t);return void 0!==n?hg.resolve(n):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}} 2520/** 2521 * @license 2522 * Copyright 2017 Google LLC 2523 * 2524 * Licensed under the Apache License, Version 2.0 (the "License"); 2525 * you may not use this file except in compliance with the License. 2526 * You may obtain a copy of the License at 2527 * 2528 * http://www.apache.org/licenses/LICENSE-2.0 2529 * 2530 * Unless required by applicable law or agreed to in writing, software 2531 * distributed under the License is distributed on an "AS IS" BASIS, 2532 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2533 * See the License for the specific language governing permissions and 2534 * limitations under the License. 2535 */ 2536/** 2537 * @license 2538 * Copyright 2022 Google LLC 2539 * 2540 * Licensed under the Apache License, Version 2.0 (the "License");
2541 * you may not use this file except in compliance with the License. 2542 * You may obtain a copy of the License at 2543 * 2544 * http://www.apache.org/licenses/LICENSE-2.0 2545 * 2546 * Unless required by applicable law or agreed to in writing, software 2547 * distributed under the License is distributed on an "AS IS" BASIS, 2548 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2549 * See the License for the specific language governing permissions and 2550 * limitations under the License. 2551 */class Ly{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}} 2552/** 2553 * @license 2554 * Copyright 2017 Google LLC 2555 * 2556 * Licensed under the Apache License, Version 2.0 (the "License"); 2557 * you may not use this file except in compliance with the License. 2558 * You may obtain a copy of the License at 2559 * 2560 * http://www.apache.org/licenses/LICENSE-2.0 2561 * 2562 * Unless required by applicable law or agreed to in writing, software 2563 * distributed under the License is distributed on an "AS IS" BASIS, 2564 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2565 * See the License for the specific language governing permissions and 2566 * limitations under the License. 2567 */class Vy{constructor(e,t,n,i){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=n,this.indexManager=i}getDocument(e,t){let n=null;return this.documentOverlayCache.getOverlay(e,t).next(i=>(n=i,this.remoteDocumentCache.getEntry(e,t))).next(e=>(null!==n&&kv(n.mutation,e,Tg.empty(),Zp.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,Jm()).next(()=>t))}getLocalViewOfDocuments(e,t,n=Jm()){const i=Gm();return this.populateOverlays(e,i,t).next(()=>this.computeViews(e,t,i,n).next(e=>{let t=Wm();return e.forEach((e,n)=>{t=t.insert(e,n.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){const n=Gm();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,Jm()))}populateOverlays(e,t,n){const i=[];return n.forEach(e=>{t.has(e)||i.push(e)}),this.documentOverlayCache.getOverlays(e,i).next(e=>{e.forEach((e,n)=>{t.set(e,n)})})}computeViews(e,t,n,i){let a=Hm();const o=Qm(),s=Qm();return t.forEach((e,t)=>{const s=n.get(t.key);i.has(t.key)&&(void 0===s||s.mutation instanceof Ev)?a=a.insert(t.key,t):void 0!==s?(o.set(t.key,s.mutation.getFieldMask()),kv(s.mutation,t,s.mutation.getFieldMask(),Zp.now())):o.set(t.key,Tg.empty())}),this.recalculateAndSaveOverlays(e,a).next(e=>(e.forEach((e,t)=>o.set(e,t)),t.forEach((e,t)=>{var n;return s.set(e,new Ly(t,null!==(n=o.get(e))&&void 0!==n?n:null))}),s))}recalculateAndSaveOverlays(e,t){const n=Qm();let i=new bg((e,t)=>
2567e-t),a=Jm();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(e=>{for(const a of e)a.keys().forEach(e=>{const o=t.get(e);if(null===o)return;let s=n.get(e)||Tg.empty();s=a.applyToLocalView(o,s),n.set(e,s);const r=(i.get(a.batchId)||Jm()).add(e);i=i.insert(a.batchId,r)})}).next(()=>{const o=[],s=i.getReverseIterator();for(;s.hasNext();){const i=s.getNext(),r=i.key,l=i.value,c=Ym();l.forEach(e=>{if(!a.has(e)){const i=_v(t.get(e),n.get(e));null!==i&&c.set(e,i),a=a.add(e)}}),o.push(this.documentOverlayCache.saveOverlays(e,r,c))}return hg.waitFor(o)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,n,i){return a=t,og.isDocumentKey(a.path)&&null===a.collectionGroup&&0===a.filters.length?this.getDocumentsMatchingDocumentQuery(e,t.path):Dm(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,n,i):this.getDocumentsMatchingCollectionQuery(e,t,n,i);var a}getNextDocuments(e,t,n,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,n,i).next(a=>{const o=i-a.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,n.largestBatchId,i-a.size):hg.resolve(Gm());let s=-1,r=a;return o.next(t=>hg.forEach(t,(t,n)=>(s<n.largestBatchId&&(s=n.largestBatchId),a.get(t)?hg.resolve():this.remoteDocumentCache.getEntry(e,t).next(e=>{r=r.insert(t,e)}))).next(()=>this.populateOverlays(e,t,a)).next(()=>this.computeViews(e,r,t,Jm())).next(e=>({batchId:s,changes:Km(e)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new og(t)).next(e=>{let t=Wm();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,n,i){const a=t.collectionGroup;let o=Wm();return this.indexManager.getCollectionParents(e,a).next(s=>hg.forEach(s,s=>{const r=(l=t,c=s.child(a),new Sm(c,null,l.explicitOrderBy.slice(),l.filters.slice(),l.limit,l.limitType,l.startAt,l.endAt));var l,c;return this.getDocumentsMatchingCollectionQuery(e,r,n,i).next(e=>{e.forEach((e,t)=>{o=o.insert(e,t)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(e,t,n,i){let a;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,n.largestBatchId).next(o=>(a=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,a,i))).next(e=>{a.forEach((t,n)=>{const i=n.getKey();null===e.get(i)&&(e=e.insert(i,em.newInvalidDocument(i)))});let n=Wm();return e.forEach((e,i)=>{const o=a.get(e);void 0!==o&&kv(o.mutation,i,Tg.empty(),Zp.now()),qm(t,i)&&(n=n.insert(e,i))}),n})}} 2568/** 2569 * @license 2570 * Copyright 2020 Google LLC 2571 * 2572 * Licensed under the Apache License, Version 2.0 (the "License"); 2573 * you may not use this file except in compliance with the License. 2574 * You may obtain a copy of the License at 2575 * 2576 * http://www.apache.org/licenses/LICENSE-2.0 2577 * 2578 * Unless required by applicable law or agreed to in writing, software 2579 * distributed under the License is distributed on an "AS IS" BASIS, 2580 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2581 * See the License for the specific language governing permissions and 2582 * limitations under the License. 2583 */class qy{constructor(e){this.serializer=e,this.hr=new Map,this.Pr=new Map}getBundleMetadata(e,t){return hg.resolve(this.hr.get(t))}saveBundleMetadata(e,t){return this.hr.set(t.id,{id:(n=t).id,version:n.version,createTime:ry(n.createTime)}),hg.resolve();var n}getNamedQuery(e,t){return hg.resolve(this.Pr.get(t))}saveNamedQuery(e,t){return this.Pr.set(t.name,{name:(n=t).name,query:Py(n.bundledQuery),readTime:ry(n.readTime)}),hg.resolve();var n}} 2584/** 2585 * @license 2586 * Copyright 2022 Google LLC 2587 * 2588 * Licensed under the Apache License, Version 2.0 (the "License"); 2589 * you may not use this file except in compliance with the License. 2590 * You may obtain a copy of the License at 2591 * 2592 * http://www.apache.org/licenses/LICENSE-2.0 2593 * 2594 * Unless required by applicable law or agreed to in writing, software 2595 * distributed under the License is distributed on an "AS IS" BASIS, 2596 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2597 * See the License for the specific language governing permissions and 2598 * limitations under the License. 2599 */class Fy{constructor(){this.overlays=new bg(og.comparator),this.Ir=new Map}getOverlay(e,t){return hg.resolve(this.overlays.get(t))}getOverlays(e,t){const n=Gm();return hg.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&n.set(t,e)})).next(()=>n)}
2599saveOverlays(e,t,n){return n.forEach((n,i)=>{this.ht(e,t,i)}),hg.resolve()}removeOverlaysForBatchId(e,t,n){const i=this.Ir.get(n);return void 0!==i&&(i.forEach(e=>this.overlays=this.overlays.remove(e)),this.Ir.delete(n)),hg.resolve()}getOverlaysForCollection(e,t,n){const i=Gm(),a=t.length+1,o=new og(t.child("")),s=this.overlays.getIteratorFrom(o);for(;s.hasNext();){const e=s.getNext().value,o=e.getKey();if(!t.isPrefixOf(o.path))break;o.path.length===a&&e.largestBatchId>n&&i.set(e.getKey(),e)}return hg.resolve(i)}getOverlaysForCollectionGroup(e,t,n,i){let a=new bg((e,t)=>e-t);const o=this.overlays.getIterator();for(;o.hasNext();){const e=o.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>n){let t=a.get(e.largestBatchId);null===t&&(t=Gm(),a=a.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}const s=Gm(),r=a.getIterator();for(;r.hasNext()&&(r.getNext().value.forEach((e,t)=>s.set(e,t)),!(s.size()>=i)););return hg.resolve(s)}ht(e,t,n){const i=this.overlays.get(n.key);if(null!==i){const e=this.Ir.get(i.largestBatchId).delete(n.key);this.Ir.set(i.largestBatchId,e)}this.overlays=this.overlays.insert(n.key,new Nv(t,n));let a=this.Ir.get(t);void 0===a&&(a=Jm(),this.Ir.set(t,a)),this.Ir.set(t,a.add(n.key))}} 2600/** 2601 * @license 2602 * Copyright 2024 Google LLC 2603 * 2604 * Licensed under the Apache License, Version 2.0 (the "License"); 2605 * you may not use this file except in compliance with the License. 2606 * You may obtain a copy of the License at 2607 * 2608 * http://www.apache.org/licenses/LICENSE-2.0 2609 * 2610 * Unless required by applicable law or agreed to in writing, software 2611 * distributed under the License is distributed on an "AS IS" BASIS, 2612 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2613 * See the License for the specific language governing permissions and 2614 * limitations under the License. 2615 */class By{constructor(){this.sessionToken=Eg.EMPTY_BYTE_STRING}getSessionToken(e){return hg.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,hg.resolve()}} 2616/** 2617 * @license 2618 * Copyright 2017 Google LLC 2619 * 2620 * Licensed under the Apache License, Version 2.0 (the "License"); 2621 * you may not use this file except in compliance with the License. 2622 * You may obtain a copy of the License at 2623 * 2624 * http://www.apache.org/licenses/LICENSE-2.0 2625 * 2626 * Unless required by applicable law or agreed to in writing, software 2627 * distributed under the License is distributed on an "AS IS" BASIS, 2628 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2629 * See the License for the specific language governing permissions and 2630 * limitations under the License. 2631 */class Uy{constructor(){this.Tr=new kg(jy.Er),this.dr=new kg(jy.Ar)}isEmpty(){return this.Tr.isEmpty()}addReference(e,t){const n=new jy(e,t);this.Tr=this.Tr.add(n),this.dr=this.dr.add(n)}Rr(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.Vr(new jy(e,t))}mr(e,t){e.forEach(e=>this.removeReference(e,t))}gr(e){const t=new og(new ng([])),n=new jy(t,e),i=new jy(t,e+1),a=[];return this.dr.forEachInRange([n,i],e=>{this.Vr(e),a.push(e.key)}),a}pr(){this.Tr.forEach(e=>this.Vr(e))}Vr(e){this.Tr=this.Tr.delete(e),this.dr=this.dr.delete(e)}yr(e){const t=new og(new ng([])),n=new jy(t,e),i=new jy(t,e+1);let a=Jm();return this.dr.forEachInRange([n,i],e=>{a=a.add(e.key)}),a}containsKey(e){const t=new jy(e,0),n=this.Tr.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)}}class jy{constructor(e,t){this.key=e,this.wr=t}static Er(e,t){return og.comparator(e.key,t.key)||Xp(e.wr,t.wr)}static Ar(e,t){return Xp(e.wr,t.wr)||og.comparator(e.key,t.key)}} 2632/** 2633 * @license 2634 * Copyright 2017 Google LLC 2635 * 2636 * Licensed under the Apache License, Version 2.0 (the "License"); 2637 * you may not use this file except in compliance with the License. 2638 * You may obtain a copy of the License at 2639 * 2640 * http://www.apache.org/licenses/LICENSE-2.0 2641 * 2642 * Unless required by applicable law or agreed to in writing, software 2643 * distributed under the License is distributed on an "AS IS" BASIS, 2644 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2645 * See the License for the specific language governing permissions and 2646 * limitations under the License. 2647 */class Hy{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutation
2647Queue=[],this.Sr=1,this.br=new kg(jy.Er)}checkEmpty(e){return hg.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,n,i){const a=this.Sr;this.Sr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new Ov(a,t,n,i);this.mutationQueue.push(o);for(const s of i)this.br=this.br.add(new jy(s.key,a)),this.indexManager.addToCollectionParentIndex(e,s.key.path.popLast());return hg.resolve(o)}lookupMutationBatch(e,t){return hg.resolve(this.Dr(t))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,i=this.vr(n),a=i<0?0:i;return hg.resolve(this.mutationQueue.length>a?this.mutationQueue[a]:null)}getHighestUnacknowledgedBatchId(){return hg.resolve(0===this.mutationQueue.length?-1:this.Sr-1)}getAllMutationBatches(e){return hg.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const n=new jy(t,0),i=new jy(t,Number.POSITIVE_INFINITY),a=[];return this.br.forEachInRange([n,i],e=>{const t=this.Dr(e.wr);a.push(t)}),hg.resolve(a)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new kg(Xp);return t.forEach(e=>{const t=new jy(e,0),i=new jy(e,Number.POSITIVE_INFINITY);this.br.forEachInRange([t,i],e=>{n=n.add(e.wr)})}),hg.resolve(this.Cr(n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,i=n.length+1;let a=n;og.isDocumentKey(a)||(a=a.child(""));const o=new jy(new og(a),0);let s=new kg(Xp);return this.br.forEachWhile(e=>{const t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===i&&(s=s.add(e.wr)),!0)},o),hg.resolve(this.Cr(s))}Cr(e){const t=[];return e.forEach(e=>{const n=this.Dr(e);null!==n&&t.push(n)}),t}removeMutationBatch(e,t){Lp(0===this.Fr(t.batchId,"removed")),this.mutationQueue.shift();let n=this.br;return hg.forEach(t.mutations,i=>{const a=new jy(i.key,t.batchId);return n=n.delete(a),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.br=n})}On(e){}containsKey(e,t){const n=new jy(t,0),i=this.br.firstAfterOrEqual(n);return hg.resolve(t.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,hg.resolve()}Fr(e,t){return this.vr(e)}vr(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}Dr(e){const t=this.vr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}} 2648/** 2649 * @license 2650 * Copyright 2017 Google LLC 2651 * 2652 * Licensed under the Apache License, Version 2.0 (the "License"); 2653 * you may not use this file except in compliance with the License. 2654 * You may obtain a copy of the License at 2655 * 2656 * http://www.apache.org/licenses/LICENSE-2.0 2657 * 2658 * Unless required by applicable law or agreed to in writing, software 2659 * distributed under the License is distributed on an "AS IS" BASIS, 2660 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2661 * See the License for the specific language governing permissions and 2662 * limitations under the License. 2663 */class zy{constructor(e){this.Mr=e,this.docs=new bg(og.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const n=t.key,i=this.docs.get(n),a=i?i.size:0,o=this.Mr(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:o}),this.size+=o-a,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const n=this.docs.get(t);return hg.resolve(n?n.document.mutableCopy():em.newInvalidDocument(t))}getEntries(e,t){let n=Hm();return t.forEach(e=>{const t=this.docs.get(e);n=n.insert(e,t?t.document.mutableCopy():em.newInvalidDocument(e))}),hg.resolve(n)}getDocumentsMatchingQuery(e,t,n,i){let a=Hm();const o=t.path,s=new og(o.child("")),r=this.docs.getIteratorFrom(s);for(;r.hasNext();){const{key:e,value:{document:s}}=r.getNext();if(!o.isPrefixOf(e.path))break;e.path.length>o.length+1||lg(sg(s),n)<=0||(i.has(s.key)||qm(t,s))&&(a=a.insert(s.key,s.mutableCopy()))}return hg.resolve(a)}getAllFromCollectionGroup(e,t,n,i){Rp()}Or(e,t){return hg.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new Wy(this)}getSize(e){return hg.resolve(this.size)}}class Wy extends Ry{constructor(e){super(),this.cr=e}applyChanges(e){const t=[];
vendor: 4,507 bytes, lines 2663-2695
2663return this.changes.forEach((n,i)=>{i.isValidDocument()?t.push(this.cr.addEntry(e,i)):this.cr.removeEntry(n)}),hg.waitFor(t)}getFromCache(e,t){return this.cr.getEntry(e,t)}getAllFromCache(e,t){return this.cr.getEntries(e,t)}} 2664/** 2665 * @license 2666 * Copyright 2017 Google LLC 2667 * 2668 * Licensed under the Apache License, Version 2.0 (the "License"); 2669 * you may not use this file except in compliance with the License. 2670 * You may obtain a copy of the License at 2671 * 2672 * http://www.apache.org/licenses/LICENSE-2.0 2673 * 2674 * Unless required by applicable law or agreed to in writing, software 2675 * distributed under the License is distributed on an "AS IS" BASIS, 2676 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2677 * See the License for the specific language governing permissions and 2678 * limitations under the License. 2679 */class Ky{constructor(e){this.persistence=e,this.Nr=new Um(e=>Tm(e),Cm),this.lastRemoteSnapshotVersion=eg.min(),this.highestTargetId=0,this.Lr=0,this.Br=new Uy,this.targetCount=0,this.kr=Ny.Bn()}forEachTarget(e,t){return this.Nr.forEach((e,n)=>t(n)),hg.resolve()}getLastRemoteSnapshotVersion(e){return hg.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return hg.resolve(this.Lr)}allocateTargetId(e){return this.highestTargetId=this.kr.next(),hg.resolve(this.highestTargetId)}setTargetsMetadata(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.Lr&&(this.Lr=t),hg.resolve()}Kn(e){this.Nr.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.kr=new Ny(t),this.highestTargetId=t),e.sequenceNumber>this.Lr&&(this.Lr=e.sequenceNumber)}addTargetData(e,t){return this.Kn(t),this.targetCount+=1,hg.resolve()}updateTargetData(e,t){return this.Kn(t),hg.resolve()}removeTargetData(e,t){return this.Nr.delete(t.target),this.Br.gr(t.targetId),this.targetCount-=1,hg.resolve()}removeTargets(e,t,n){let i=0;const a=[];return this.Nr.forEach((o,s)=>{s.sequenceNumber<=t&&null===n.get(s.targetId)&&(this.Nr.delete(o),a.push(this.removeMatchingKeysForTargetId(e,s.targetId)),i++)}),hg.waitFor(a).next(()=>i)}getTargetCount(e){return hg.resolve(this.targetCount)}getTargetData(e,t){const n=this.Nr.get(t)||null;return hg.resolve(n)}addMatchingKeys(e,t,n){return this.Br.Rr(t,n),hg.resolve()}removeMatchingKeys(e,t,n){this.Br.mr(t,n);const i=this.persistence.referenceDelegate,a=[];return i&&t.forEach(t=>{a.push(i.markPotentiallyOrphaned(e,t))}),hg.waitFor(a)}removeMatchingKeysForTargetId(e,t){return this.Br.gr(t),hg.resolve()}getMatchingKeysForTargetId(e,t){const n=this.Br.yr(t);return hg.resolve(n)}containsKey(e,t){return hg.resolve(this.Br.containsKey(t))}} 2680/** 2681 * @license 2682 * Copyright 2017 Google LLC 2683 * 2684 * Licensed under the Apache License, Version 2.0 (the "License"); 2685 * you may not use this file except in compliance with the License. 2686 * You may obtain a copy of the License at 2687 * 2688 * http://www.apache.org/licenses/LICENSE-2.0 2689 * 2690 * Unless required by applicable law or agreed to in writing, software 2691 * distributed under the License is distributed on an "AS IS" BASIS, 2692 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2693 * See the License for the specific language governing permissions and 2694 * limitations under the License. 2695 */class Gy{constructor(e,t){this.qr={},this.overlays={},this.Qr=new fg(0),this.Kr=!1,this.Kr=!0,this.$r=new By,this.referenceDelegate=e(this),this.Ur=new Ky(this),this.indexManager=new Oy,this.remoteDocumentCache=new zy(e=>this.referenceDelegate.Wr(e)),this.serializer=new Dy(t),this.Gr=new qy(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.Kr=!1,Promise.resolve()}get started(){return this.Kr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new Fy,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let n=this.qr[e.toKey()];return n||(n=new Hy(t,this.referenceDelegate),this.qr[e.toKey()]=n),n}getGlobalsCache(){return this.$r}getTargetCache(){return this.Ur}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Gr}runTransaction(e,t,n){Pp("MemoryPersistence","Starting transaction:",e);const i=new Yy(this.Qr.next());return this.referenceDelegate.zr(),n(i).next(e=>this.referenceDelegate.jr(i).next(()=>e)).toPromise().then(e=>(i.raiseOnCommittedEvent(),e))}Hr(e,t){return hg.or(Object.values(this.qr).map(n=>()=>n.containsKey(e,t)))}}class Yy extends cg{constructor(e){super(),this.currentSequenceNumber=e}}
2695class Qy{constructor(e){this.persistence=e,this.Jr=new Uy,this.Yr=null}static Zr(e){return new Qy(e)}get Xr(){if(this.Yr)return this.Yr;throw Rp()}addReference(e,t,n){return this.Jr.addReference(n,t),this.Xr.delete(n.toString()),hg.resolve()}removeReference(e,t,n){return this.Jr.removeReference(n,t),this.Xr.add(n.toString()),hg.resolve()}markPotentiallyOrphaned(e,t){return this.Xr.add(t.toString()),hg.resolve()}removeTarget(e,t){this.Jr.gr(t.targetId).forEach(e=>this.Xr.add(e.toString()));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.Xr.add(e.toString()))}).next(()=>n.removeTargetData(e,t))}zr(){this.Yr=new Set}jr(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return hg.forEach(this.Xr,n=>{const i=og.fromPath(n);return this.ei(e,i).next(e=>{e||t.removeEntry(i,eg.min())})}).next(()=>(this.Yr=null,t.apply(e)))}updateLimboDocument(e,t){return this.ei(e,t).next(e=>{e?this.Xr.delete(t.toString()):this.Xr.add(t.toString())})}Wr(e){return 0}ei(e,t){return hg.or([()=>hg.resolve(this.Jr.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Hr(e,t)])}} 2696/** 2697 * @license 2698 * Copyright 2017 Google LLC 2699 * 2700 * Licensed under the Apache License, Version 2.0 (the "License"); 2701 * you may not use this file except in compliance with the License. 2702 * You may obtain a copy of the License at 2703 * 2704 * http://www.apache.org/licenses/LICENSE-2.0 2705 * 2706 * Unless required by applicable law or agreed to in writing, software 2707 * distributed under the License is distributed on an "AS IS" BASIS, 2708 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2709 * See the License for the specific language governing permissions and 2710 * limitations under the License. 2711 */class $y{constructor(e,t,n,i){this.targetId=e,this.fromCache=t,this.$i=n,this.Ui=i}static Wi(e,t){let n=Jm(),i=Jm();for(const a of t.docChanges)switch(a.type){case 0:n=n.add(a.doc.key);break;case 1:i=i.add(a.doc.key)}return new $y(e,t.fromCache,n,i)}} 2712/** 2713 * @license 2714 * Copyright 2023 Google LLC 2715 * 2716 * Licensed under the Apache License, Version 2.0 (the "License"); 2717 * you may not use this file except in compliance with the License. 2718 * You may obtain a copy of the License at 2719 * 2720 * http://www.apache.org/licenses/LICENSE-2.0 2721 * 2722 * Unless required by applicable law or agreed to in writing, software 2723 * distributed under the License is distributed on an "AS IS" BASIS, 2724 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2725 * See the License for the specific language governing permissions and 2726 * limitations under the License. 2727 */class Xy{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}} 2728/** 2729 * @license 2730 * Copyright 2019 Google LLC 2731 * 2732 * Licensed under the Apache License, Version 2.0 (the "License"); 2733 * you may not use this file except in compliance with the License. 2734 * You may obtain a copy of the License at 2735 * 2736 * http://www.apache.org/licenses/LICENSE-2.0 2737 * 2738 * Unless required by applicable law or agreed to in writing, software 2739 * distributed under the License is distributed on an "AS IS" BASIS, 2740 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2741 * See the License for the specific language governing permissions and 2742 * limitations under the License. 2743 */class Jy{constructor(){this.Gi=!1,this.zi=!1,this.ji=100,this.Hi=hc()?8:function(e){const t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)}(sc())>0?6:4}initialize(e,t){this.Ji=e,this.indexManager=t,this.Gi=!0}getDocumentsMatchingQuery(e,t,n,i){const a={result:null};return this.Yi(e,t).next(e=>{a.result=e}).next(()=>{if(!a.result)return this.Zi(e,t,i,n).next(e=>{a.result=e})}).next(()=>{if(a.result)return;const n=new Xy;return this.Xi(e,t,n).next(i=>{if(a.result=i,this.zi)return this.es(e,t,n,i.size)})}).next(()=>a.result)}es(e,t,n,i){return n.documentReadCount<this.ji?(Dp()<=Bc.DEBUG&&Pp("QueryEngine","SDK will not create cache indexes for query:",Vm(t),"since it only creates cache indexes for collection contains","more than or equal to",this.ji,"documents"),hg.resolve()):(Dp()<=Bc.DEBUG&&Pp("QueryEngine","Query:",Vm(t),"scans",n.documentReadCount,"local documents and returns",i,"documents as results."),n.documentReadCount>this.Hi*i?(Dp()<=Bc.DEBUG&&Pp("QueryEngine","The SDK decides to create cache indexes for query:",Vm(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Om(t))):hg.resolve())}Yi(e,t){if(Am(t))return hg.resolve(null);let n=Om(t);return this.indexManager.getIndexType(e,n).next(i=>0===i?null:(null!==t.limit&&1===i&&(t=Nm(t,null,"F"),n=Om(t)),this.indexManager.getDocumentsMatchingTarget(e,n).next(i=>{const a=Jm(...i);return this.Ji.getDocuments(e,a).next(i=>this.indexManager.getMinOffset(e,n).next(n=>{const o=this.ts(t,i);return this.ns(t,o,a,n.readTime)?this.Yi(e,Nm(t,null,"F")):this.rs(e,o,t,n)}))})))}Zi(e,t,n,i){return Am(t)||i.isEqual(eg.min())?hg.resolve(null):this.Ji.getDocuments(e,n).next(a=>{const o=this.ts(t,a);return this.ns(t,o,n,i)?hg.resolve(null):(Dp()<=Bc.DEBUG&&Pp("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),Vm(t)),this.rs(e,o,t,function(e,t){const n=e.toTimestamp().seconds,i=e.toTimestamp().nanoseconds+1,a=eg.fromTimestamp(1e9===i?new Zp(n+1,0):new Zp(n,i));return new rg(a,og.empty(),t)}(i,-1)).next(e=>e))})}ts(e,t){let n=new kg(Fm(e));return t.forEach((t,i)=>{qm(e,i)&&(n=n.add(i))}),n}ns(e,t,n,i){if(null===e.limit)return!1;if(n.size!==t.size)return!0;const a="F"===e.limitType?t.last():t.first();return!!a&&(a.hasPendingWrites||a.version.compareTo(i)>0)}Xi(e,t,n){return Dp()<=Bc.DEBUG&&Pp("QueryEngine","Using full collection scan to execute query:",Vm(t)),this.Ji.getDocumentsMatchingQuery(e,t,rg.min(),n)}rs(e,t,n,i){return this.Ji.getDocumentsMatchingQuery(e,n,i).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}} 2744/** 2745 * @license 2746 * Copyright 2020 Google LLC 2747 * 2748 * Licensed under the Apache License, Version 2.0 (the "License");
2749 * you may not use this file except in compliance with the License. 2750 * You may obtain a copy of the License at 2751 * 2752 * http://www.apache.org/licenses/LICENSE-2.0 2753 * 2754 * Unless required by applicable law or agreed to in writing, software 2755 * distributed under the License is distributed on an "AS IS" BASIS, 2756 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2757 * See the License for the specific language governing permissions and 2758 * limitations under the License. 2759 */class Zy{constructor(e,t,n,i){this.persistence=e,this.ss=t,this.serializer=i,this.os=new bg(Xp),this._s=new Um(e=>Tm(e),Cm),this.us=new Map,this.cs=e.getRemoteDocumentCache(),this.Ur=e.getTargetCache(),this.Gr=e.getBundleCache(),this.ls(n)}ls(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new Vy(this.cs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.cs.setIndexManager(this.indexManager),this.ss.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.os))}}async function eb(e,t){const n=Vp(e);return await n.persistence.runTransaction("Handle user change","readonly",e=>{let i;
2759return n.mutationQueue.getAllMutationBatches(e).next(a=>(i=a,n.ls(t),n.mutationQueue.getAllMutationBatches(e))).next(t=>{const a=[],o=[];let s=Jm();for(const e of i){a.push(e.batchId);for(const t of e.mutations)s=s.add(t.key)}for(const e of t){o.push(e.batchId);for(const t of e.mutations)s=s.add(t.key)}return n.localDocuments.getDocuments(e,s).next(e=>({hs:e,removedBatchIds:a,addedBatchIds:o}))})})}function tb(e){const t=Vp(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",e=>t.Ur.getLastRemoteSnapshotVersion(e))}function nb(e,t){const n=Vp(e),i=t.snapshotVersion;let a=n.os;return n.persistence.runTransaction("Apply remote event","readwrite-primary",e=>{const o=n.cs.newChangeBuffer({trackRemovals:!0});a=n.os;const s=[];t.targetChanges.forEach((o,r)=>{const l=a.get(r);if(!l)return;s.push(n.Ur.removeMatchingKeys(e,o.removedDocuments,r).next(()=>n.Ur.addMatchingKeys(e,o.addedDocuments,r)));let c=l.withSequenceNumber(e.currentSequenceNumber);var u,h,d;null!==t.targetMismatches.get(r)?c=c.withResumeToken(Eg.EMPTY_BYTE_STRING,eg.min()).withLastLimboFreeSnapshotVersion(eg.min()):o.resumeToken.approximateByteSize()>0&&(c=c.withResumeToken(o.resumeToken,i)),a=a.insert(r,c),h=c,d=o,(0===(u=l).resumeToken.approximateByteSize()||h.snapshotVersion.toMicroseconds()-u.snapshotVersion.toMicroseconds()>=3e8||d.addedDocuments.size+d.modifiedDocuments.size+d.removedDocuments.size>0)&&s.push(n.Ur.updateTargetData(e,c))});let r=Hm(),l=Jm();if(t.documentUpdates.forEach(i=>{t.resolvedLimboDocuments.has(i)&&s.push(n.persistence.referenceDelegate.updateLimboDocument(e,i))}),s.push(function(e,t,n){let i=Jm(),a=Jm();return n.forEach(e=>i=i.add(e)),t.getEntries(e,i).next(e=>{let i=Hm();return n.forEach((n,o)=>{const s=e.get(n);o.isFoundDocument()!==s.isFoundDocument()&&(a=a.add(n)),o.isNoDocument()&&o.version.isEqual(eg.min())?(t.removeEntry(n,o.readTime),i=i.insert(n,o)):!s.isValidDocument()||o.version.compareTo(s.version)>0||0===o.version.compareTo(s.version)&&s.hasPendingWrites?(t.addEntry(o),i=i.insert(n,o)):Pp("LocalStore","Ignoring outdated watch update for ",n,". Current version:",s.version," Watch version:",o.version)}),{Ps:i,Is:a}})}(e,o,t.documentUpdates).next(e=>{r=e.Ps,l=e.Is})),!i.isEqual(eg.min())){const t=n.Ur.getLastRemoteSnapshotVersion(e).next(t=>n.Ur.setTargetsMetadata(e,e.currentSequenceNumber,i));s.push(t)}return hg.waitFor(s).next(()=>o.apply(e)).next(()=>n.localDocuments.getLocalViewOfDocuments(e,r,l)).next(()=>r)}).then(e=>(n.os=a,e))}function ib(e,t){const n=Vp(e);return n.persistence.runTransaction("Get next mutation batch","readonly",e=>(void 0===t&&(t=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(e,t)))}async function ab(e,t,n){const i=Vp(e),a=i.os.get(t),o=n?"readwrite":"readwrite-primary";try{n||await i.persistence.runTransaction("Release target",o,e=>i.persistence.referenceDelegate.removeTarget(e,a))}catch(s){if(!dg(s))throw s;Pp("LocalStore","Failed to update sequence numbers for target ".concat(t,": ").concat(s))}i.os=i.os.remove(t),i._s.delete(a.target)}function ob(e,t,n){const i=Vp(e);let a=eg.min(),o=Jm();return i.persistence.runTransaction("Execute query","readwrite",e=>function(e,t,n){const i=Vp(e),a=i._s.get(n);return void 0!==a?hg.resolve(i.os.get(a)):i.Ur.getTargetData(t,n)}(i,e,Om(t)).next(t=>{if(t)return a=t.lastLimboFreeSnapshotVersion,i.Ur.getMatchingKeysForTargetId(e,t.targetId).next(e=>{o=e})}).next(()=>i.ss.getDocumentsMatchingQuery(e,t,n?a:eg.min(),n?o:Jm())).next(e=>(function(e,t,n){let i=e.us.get(t)||eg.min();n.forEach((e,t)=>{t.readTime.compareTo(i)>0&&(i=t.readTime)}),e.us.set(t,i)}(i,function(e){return e.collectionGroup||(e.path.length%2==1?e.path.lastSegment():e.path.get(e.path.length-2))}(t),e),{documents:e,Ts:o})))}class sb{constructor(){this.activeTargetIds=Zm}fs(e){this.activeTargetIds=this.activeTargetIds.add(e)}gs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Vs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class rb{constructor(){this.so=new sb,this.oo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e,t=!0){return t&&this.so.fs(e),this.oo[e]||"not-current"}updateQueryState(e,t,n){this.oo[e]=t}removeLocalQueryTarget(e){this.so.gs(e)}isLocalQueryTarget(e){return this.so.activeTargetIds.has(e)}clearQueryState(e){delete this.oo[e]}getAllActiveQueryTargets(){return this.so.activeTargetIds}isActiveQueryTarget(e){return this.so.activeTargetIds.has(e)}start(){return this.so=new sb,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}} 2760/** 2761 * @license 2762 * Copyright 2019 Google LLC 2763 * 2764 * Licensed under the Apache License, Version 2.0 (the "License");
2765 * you may not use this file except in compliance with the License. 2766 * You may obtain a copy of the License at 2767 * 2768 * http://www.apache.org/licenses/LICENSE-2.0 2769 * 2770 * Unless required by applicable law or agreed to in writing, software 2771 * distributed under the License is distributed on an "AS IS" BASIS, 2772 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2773 * See the License for the specific language governing permissions and 2774 * limitations under the License. 2775 */class lb{_o(e){}shutdown(){}} 2776/** 2777 * @license 2778 * Copyright 2019 Google LLC 2779 * 2780 * Licensed under the Apache License, Version 2.0 (the "License"); 2781 * you may not use this file except in compliance with the License. 2782 * You may obtain a copy of the License at 2783 * 2784 * http://www.apache.org/licenses/LICENSE-2.0 2785 * 2786 * Unless required by applicable law or agreed to in writing, software 2787 * distributed under the License is distributed on an "AS IS" BASIS, 2788 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2789 * See the License for the specific language governing permissions and 2790 * limitations under the License. 2791 */class cb{constructor(){this.ao=()=>this.uo(),this.co=()=>this.lo(),this.ho=[],this.Po()}_o(e){this.ho.push(e)}shutdown(){window.removeEventListener("online",this.ao),window.removeEventListener("offline",this.co)}Po(){window.addEventListener("online",this.ao),window.addEventListener("offline",this.co)}uo(){Pp("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const e of this.ho)e(0)}lo(){Pp("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const e of this.ho)e(1)}static D(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}} 2792/** 2793 * @license 2794 * Copyright 2023 Google LLC 2795 * 2796 * Licensed under the Apache License, Version 2.0 (the "License"); 2797 * you may not use this file except in compliance with the License. 2798 * You may obtain a copy of the License at 2799 * 2800 * http://www.apache.org/licenses/LICENSE-2.0 2801 * 2802 * Unless required by applicable law or agreed to in writing, software 2803 * distributed under the License is distributed on an "AS IS" BASIS, 2804 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2805 * See the License for the specific language governing permissions and 2806 * limitations under the License. 2807 */let ub=null;function hb(){return null===ub?ub=268435456+Math.round(2147483648*Math.random()):ub++,"0x"+ub.toString(16) 2808/** 2809 * @license 2810 * Copyright 2020 Google LLC 2811 * 2812 * Licensed under the Apache License, Version 2.0 (the "License"); 2813 * you may not use this file except in compliance with the License. 2814 * You may obtain a copy of the License at 2815 * 2816 * http://www.apache.org/licenses/LICENSE-2.0 2817 * 2818 * Unless required by applicable law or agreed to in writing, software 2819 * distributed under the License is distributed on an "AS IS" BASIS, 2820 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2821 * See the License for the specific language governing permissions and 2822 * limitations under the License. 2823 */}const db={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"}; 2824/** 2825 * @license 2826 * Copyright 2017 Google LLC 2827 * 2828 * Licensed under the Apache License, Version 2.0 (the "License"); 2829 * you may not use this file except in compliance with the License. 2830 * You may obtain a copy of the License at 2831 * 2832 * http://www.apache.org/licenses/LICENSE-2.0 2833 * 2834 * Unless required by applicable law or agreed to in writing, software 2835 * distributed under the License is distributed on an "AS IS" BASIS, 2836 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2837 * See the License for the specific language governing permissions and 2838 * limitations under the License. 2839 */class fb{constructor(e){this.Io=e.Io,this.To=e.To}Eo(e){this.Ao=e}Ro(e){this.Vo=e}mo(e){this.fo=e}onMessage(e){this.po=e}close(){this.To()}send(e){this.Io(e)}yo(){this.Ao()}wo(){this.Vo()}So(e){this.fo(e)}bo(e){this.po(e)}} 2840/** 2841 * @license 2842 * Copyright 2017 Google LLC 2843 * 2844 * Licensed under the Apache License, Version 2.0 (the "License");
2845 * you may not use this file except in compliance with the License. 2846 * You may obtain a copy of the License at 2847 * 2848 * http://www.apache.org/licenses/LICENSE-2.0 2849 * 2850 * Unless required by applicable law or agreed to in writing, software 2851 * distributed under the License is distributed on an "AS IS" BASIS, 2852 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2853 * See the License for the specific language governing permissions and 2854 * limitations under the License. 2855 */const pb="WebChannelConnection";class gb extends class{constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.Do=t+"://"+e.host,this.vo="projects/".concat(n,"/databases/").concat(i),this.Co="(default)"===this.databaseId.database?"project_id=".concat(n):"project_id=".concat(n,"&database_id=").concat(i)}get Fo(){return!1}Mo(e,t,n,i,a){const o=hb(),s=this.xo(e,t.toUriEncodedString());Pp("RestConnection","Sending RPC '".concat(e,"' ").concat(o,":"),s,n);const r={"google-cloud-resource-prefix":this.vo,"x-goog-request-params":this.Co};return this.Oo(r,i,a),this.No(e,s,r,n).then(t=>(Pp("RestConnection","Received RPC '".concat(e,"' ").concat(o,": "),t),t),t=>{throw Mp("RestConnection","RPC '".concat(e,"' ").concat(o," failed with error: "),t,"url: ",s,"request:",n),t})}Lo(e,t,n,i,a,o){return this.Mo(e,t,n,i,a)}Oo(e,t,n){e["X-Goog-Api-Client"]="gl-js/ fire/"+Ip,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((t,n)=>e[n]=t),n&&n.headers.forEach((t,n)=>e[n]=t)}xo(e,t){const n=db[e];return"".concat(this.Do,"/v1/").concat(t,":").concat(n)}terminate(){}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}No(e,t,n,i){const a=hb();return new Promise((o,s)=>{const r=new vp;r.setWithCredentials(!0),r.listenOnce(bp.COMPLETE,()=>{try{switch(r.getLastErrorCode()){case _p.NO_ERROR:const t=r.getResponseJson();Pp(pb,"XHR for RPC '".concat(e,"' ").concat(a," received:"),JSON.stringify(t)),o(t);break;case _p.TIMEOUT:Pp(pb,"RPC '".concat(e,"' ").concat(a," timed out")),s(new Fp(qp.DEADLINE_EXCEEDED,"Request time out"));break;case _p.HTTP_ERROR:const n=r.getStatus();if(Pp(pb,"RPC '".concat(e,"' ").concat(a," failed with status:"),n,"response text:",r.getResponseText()),n>0){let e=r.getResponseJson();Array.isArray(e)&&(e=e[0]);const t=null==e?void 0:e.error;if(t&&t.status&&t.message){const e=function(e){const t=e.toLowerCase().replace(/_/g,"-");return Object.values(qp).indexOf(t)>=0?t:qp.UNKNOWN}(t.status);s(new Fp(e,t.message))}else s(new Fp(qp.UNKNOWN,"Server responded with status "+r.getStatus()))}else s(new Fp(qp.UNAVAILABLE,"Connection failed."));break;default:Rp()}}finally{Pp(pb,"RPC '".concat(e,"' ").concat(a," completed."))}});const l=JSON.stringify(i);Pp(pb,"RPC '".concat(e,"' ").concat(a," sending request:"),i),r.send(t,"POST",l,n,15)})}Bo(e,t,n){const i=hb(),a=[this.Do,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=Tp(),s=xp(),r={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/".concat(this.databaseId.projectId,"/databases/").concat(this.databaseId.database)},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},l=this.longPollingOptions.timeoutSeconds;void 0!==l&&(r.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(r.useFetchStreams=!0),this.Oo(r.initMessageHeaders,t,n),r.encodeInitMessageHeaders=!0;const c=a.join("");Pp(pb,"Creating RPC '".concat(e,"' stream ").concat(i,": ").concat(c),r);const u=o.createWebChannel(c,r);let h=!1,d=!1;const f=new fb({Io:t=>{d?Pp(pb,"Not sending because RPC '".concat(e,"' stream ").concat(i," is closed:"),t):(h||(Pp(pb,"Opening RPC '".concat(e,"' stream ").concat(i," transport.")),u.open(),h=!0),Pp(pb,"RPC '".concat(e,"' stream ").concat(i," sending:"),t),u.send(t))},To:()=>u.close()}),p=(e,t,n)=>{e.listen(t,e=>{try{n(e)}catch(t){setTimeout(()=>{throw t},0)}})};return p(u,yp.EventType.OPEN,()=>{d||(Pp(pb,"RPC '".concat(e,"' stream ").concat(i," transport opened.")),f.yo())}),p(u,yp.EventType.CLOSE,()=>{d||(d=!0,Pp(pb,"RPC '".concat(e,"' stream ").concat(i," transport closed")),f.So())}
2855),p(u,yp.EventType.ERROR,t=>{d||(d=!0,Mp(pb,"RPC '".concat(e,"' stream ").concat(i," transport errored:"),t),f.So(new Fp(qp.UNAVAILABLE,"The operation could not be completed")))}),p(u,yp.EventType.MESSAGE,t=>{var n;if(!d){const a=t.data[0];Lp(!!a);const o=a,s=o.error||(null===(n=o[0])||void 0===n?void 0:n.error);if(s){Pp(pb,"RPC '".concat(e,"' stream ").concat(i," received error:"),s);const t=s.status;let n=function(e){const t=Lv[e];if(void 0!==t)return qv(t)}(t),a=s.message;void 0===n&&(n=qp.INTERNAL,a="Unknown error status: "+t+" with message "+s.message),d=!0,f.So(new Fp(n,a)),u.close()}else Pp(pb,"RPC '".concat(e,"' stream ").concat(i," received:"),a),f.bo(a)}}),p(s,kp.STAT_EVENT,t=>{t.stat===wp.PROXY?Pp(pb,"RPC '".concat(e,"' stream ").concat(i," detected buffering proxy")):t.stat===wp.NOPROXY&&Pp(pb,"RPC '".concat(e,"' stream ").concat(i," detected no buffering proxy"))}),setTimeout(()=>{f.wo()},0),f}}function mb(){return"undefined"!=typeof document?document:null} 2856/** 2857 * @license 2858 * Copyright 2020 Google LLC 2859 * 2860 * Licensed under the Apache License, Version 2.0 (the "License"); 2861 * you may not use this file except in compliance with the License. 2862 * You may obtain a copy of the License at 2863 * 2864 * http://www.apache.org/licenses/LICENSE-2.0 2865 * 2866 * Unless required by applicable law or agreed to in writing, software 2867 * distributed under the License is distributed on an "AS IS" BASIS, 2868 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2869 * See the License for the specific language governing permissions and 2870 * limitations under the License. 2871 */function vb(e){return new ny(e,!0)} 2872/** 2873 * @license 2874 * Copyright 2017 Google LLC 2875 * 2876 * Licensed under the Apache License, Version 2.0 (the "License"); 2877 * you may not use this file except in compliance with the License. 2878 * You may obtain a copy of the License at 2879 * 2880 * http://www.apache.org/licenses/LICENSE-2.0 2881 * 2882 * Unless required by applicable law or agreed to in writing, software 2883 * distributed under the License is distributed on an "AS IS" BASIS, 2884 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2885 * See the License for the specific language governing permissions and 2886 * limitations under the License. 2887 */class yb{constructor(e,t,n=1e3,i=1.5,a=6e4){this.ui=e,this.timerId=t,this.ko=n,this.qo=i,this.Qo=a,this.Ko=0,this.$o=null,this.Uo=Date.now(),this.reset()}reset(){this.Ko=0}Wo(){this.Ko=this.Qo}Go(e){this.cancel();const t=Math.floor(this.Ko+this.zo()),n=Math.max(0,Date.now()-this.Uo),i=Math.max(0,t-n);i>0&&Pp("ExponentialBackoff","Backing off for ".concat(i," ms (base delay: ").concat(this.Ko," ms, delay with jitter: ").concat(t," ms, last attempt: ").concat(n," ms ago)")),this.$o=this.ui.enqueueAfterDelay(this.timerId,i,()=>(this.Uo=Date.now(),e())),this.Ko*=this.qo,this.Ko<this.ko&&(this.Ko=this.ko),this.Ko>this.Qo&&(this.Ko=this.Qo)}jo(){null!==this.$o&&(this.$o.skipDelay(),this.$o=null)}
2887cancel(){null!==this.$o&&(this.$o.cancel(),this.$o=null)}zo(){return(Math.random()-.5)*this.Ko}} 2888/** 2889 * @license 2890 * Copyright 2017 Google LLC 2891 * 2892 * Licensed under the Apache License, Version 2.0 (the "License"); 2893 * you may not use this file except in compliance with the License. 2894 * You may obtain a copy of the License at 2895 * 2896 * http://www.apache.org/licenses/LICENSE-2.0 2897 * 2898 * Unless required by applicable law or agreed to in writing, software 2899 * distributed under the License is distributed on an "AS IS" BASIS, 2900 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2901 * See the License for the specific language governing permissions and 2902 * limitations under the License. 2903 */class bb{constructor(e,t,n,i,a,o,s,r){this.ui=e,this.Ho=n,this.Jo=i,this.connection=a,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=s,this.listener=r,this.state=0,this.Yo=0,this.Zo=null,this.Xo=null,this.stream=null,this.e_=0,this.t_=new yb(e,t)}n_(){return 1===this.state||5===this.state||this.r_()}r_(){return 2===this.state||3===this.state}start(){this.e_=0,4!==this.state?this.auth():this.i_()}async stop(){this.n_()&&await this.close(0)}s_(){this.state=0,this.t_.reset()}o_(){this.r_()&&null===this.Zo&&(this.Zo=this.ui.enqueueAfterDelay(this.Ho,6e4,()=>this.__()))}a_(e){this.u_(),this.stream.send(e)}async __(){if(this.r_())return this.close(0)}u_(){this.Zo&&(this.Zo.cancel(),this.Zo=null)}c_(){this.Xo&&(this.Xo.cancel(),this.Xo=null)}async close(e,t){this.u_(),this.c_(),this.t_.cancel(),this.Yo++,4!==e?this.t_.reset():t&&t.code===qp.RESOURCE_EXHAUSTED?(Op(t.toString()),Op("Using maximum backoff delay to prevent overloading the backend."),this.t_.Wo()):t&&t.code===qp.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.l_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.mo(t)}l_(){}auth(){this.state=1;const e=this.h_(this.Yo),t=this.Yo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([e,n])=>{this.Yo===t&&this.P_(e,n)},t=>{e(()=>{const e=new Fp(qp.UNKNOWN,"Fetching auth token failed: "+t.message);return this.I_(e)})})}P_(e,t){const n=this.h_(this.Yo);this.stream=this.T_(e,t),this.stream.Eo(()=>{n(()=>this.listener.Eo())}),this.stream.Ro(()=>{n(()=>(this.state=2,this.Xo=this.ui.enqueueAfterDelay(this.Jo,1e4,()=>(this.r_()&&(this.state=3),Promise.resolve())),this.listener.Ro()))}),this.stream.mo(e=>{n(()=>this.I_(e))}),this.stream.onMessage(e=>{n(()=>1==++this.e_?this.E_(e):this.onNext(e))})}i_(){this.state=5,this.t_.Go(async()=>{this.state=0,this.start()})}I_(e){return Pp("PersistentStream","close with error: ".concat(e)),this.stream=null,this.close(4,e)}h_(e){return t=>{this.ui.enqueueAndForget(()=>this.Yo===e?t():(Pp("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class _b extends bb{constructor(e,t,n,i,a,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,n,i,o),this.serializer=a}T_(e,t){return this.connection.Bo("Listen",e,t)}E_(e){return this.onNext(e)}onNext(e){this.t_.reset();const t=function(e,t){let n;if("targetChange"in t){t.targetChange;const a="NO_CHANGE"===(i=t.targetChange.targetChangeType||"NO_CHANGE")?0:"ADD"===i?1:"REMOVE"===i?2:"CURRENT"===i?3:"RESET"===i?4:Rp(),o=t.targetChange.targetIds||[],s=function(e,t){return e.useProto3Json?(Lp(void 0===t||"string"==typeof t),Eg.fromBase64String(t||"")):(Lp(void 0===t||t instanceof Buffer||t instanceof Uint8Array),Eg.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),r=t.targetChange.cause,l=r&&function(e){const t=void 0===e.code?qp.UNKNOWN:qv(e.code);return new Fp(t,e.message||"")}(r);n=new Yv(a,o,s,l||null)}else if("documentChange"in t){t.documentChange;const i=t.documentChange;i.document,i.document.name,i.document.updateTime;const a=dy(e,i.document.name),o=ry(i.document.updateTime),s=i.document.createTime?ry(i.document.createTime):eg.min(),r=new Jg({mapValue:{fields:i.document.fields}}),l=em.newFoundDocument(a,o,s,r),c=i.targetIds||[],u=i.removedTargetIds||[];n=new Kv(c,u,l.key,l)}else if("documentDelete"in t){t.documentDelete;const i=t.documentDelete;i.document;const a=dy(e,i.document),o=i.readTime?ry(i.readTime):eg.min(),s=em.newNoDocument(a,o),r=i.removedTargetIds||[];n=new Kv([],r,s.key,s)}else if("documentRemove"in t){t.documentRemove;const i=t.documentRemove;i.document;const a=dy(e,i.document),o=i.removedTargetIds||[];n=new Kv([],o,a,null)}else{if(!("filter"in t))return Rp();{t.filter;const e=t.filter;e.targetId;const{count:i=0,unchangedNames:a}=e,o=new Rv(i,a),s=e.targetId;n=new Gv(s,o)}}var i;return n}(this.serializer,e),n=function(e){if(!("targetChange"in e))return eg.min();const t=e.targetChange;return t.targetIds&&t.targetIds.length?eg.min():t.readTime?ry(t.readTime):eg.min()}(e);return this.listener.d_(t,n)}A_(e){const t={};t.database=py(this.serializer),t.addTarget=function(e,t){let n;const i=t.target;if(n=Em(i)?{documents:vy(e,i)}:{query:yy(e,i)._t},n.targetId=t.targetId,t.resumeToken.approximateByteSize()>0){n.resumeToken=oy(e,t.resumeToken);const i=iy(e,t.expectedCount);null!==i&&(n.expectedCount=i)}else if(t.snapshotVersion.compareTo(eg.min())>0){n.readTime=ay(e,t.snapshotVersion.toTimestamp());const i=iy(e,t.expectedCount);null!==i&&(n.expectedCount=i)}return n}(this.serializer,e);const n=function(e,t){const n=function(e){switch(e){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return Rp()}}(t.purpose);return null==n?null:{"goog-listen-tags":n}}(this.serializer,e);n&&(t.labels=n),this.a_(t)}R_(e){const t={};t.database=py(this.serializer),t.removeTarget=e,this.a_(t)}}class wb extends bb{constructor(e,t,n,i,a,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,n,i,o),this.serializer
2903=a}get V_(){return this.e_>0}start(){this.lastStreamToken=void 0,super.start()}l_(){this.V_&&this.m_([])}T_(e,t){return this.connection.Bo("Write",e,t)}E_(e){return Lp(!!e.streamToken),this.lastStreamToken=e.streamToken,Lp(!e.writeResults||0===e.writeResults.length),this.listener.f_()}onNext(e){Lp(!!e.streamToken),this.lastStreamToken=e.streamToken,this.t_.reset();const t=function(e,t){return e&&e.length>0?(Lp(void 0!==t),e.map(e=>function(e,t){let n=e.updateTime?ry(e.updateTime):ry(t);return n.isEqual(eg.min())&&(n=ry(t)),new mv(n,e.transformResults||[])}(e,t))):[]}(e.writeResults,e.commitTime),n=ry(e.commitTime);return this.listener.g_(n,t)}p_(){const e={};e.database=py(this.serializer),this.a_(e)}m_(e){const t={streamToken:this.lastStreamToken,writes:e.map(e=>function(e,t){let n;if(t instanceof Cv)n={update:my(e,t.key,t.value)};else if(t instanceof Dv)n={delete:hy(e,t.key)};else if(t instanceof Ev)n={update:my(e,t.key,t.data),updateMask:Sy(t.fieldMask)};else{if(!(t instanceof Pv))return Rp();n={verify:hy(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map(e=>function(e,t){const n=t.transform;if(n instanceof rv)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof lv)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof uv)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof dv)return{fieldPath:t.field.canonicalString(),increment:n.Pe};throw Rp()}(0,e))),t.precondition.isNone||(n.currentDocument=(i=e,void 0!==(a=t.precondition).updateTime?{updateTime:sy(i,a.updateTime)}:void 0!==a.exists?{exists:a.exists}
2903:Rp())),n;var i,a}(this.serializer,e))};this.a_(t)}} 2904/** 2905 * @license 2906 * Copyright 2017 Google LLC 2907 * 2908 * Licensed under the Apache License, Version 2.0 (the "License"); 2909 * you may not use this file except in compliance with the License. 2910 * You may obtain a copy of the License at 2911 * 2912 * http://www.apache.org/licenses/LICENSE-2.0 2913 * 2914 * Unless required by applicable law or agreed to in writing, software 2915 * distributed under the License is distributed on an "AS IS" BASIS, 2916 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2917 * See the License for the specific language governing permissions and 2918 * limitations under the License. 2919 */class kb extends class{}{constructor(e,t,n,i){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=n,this.serializer=i,this.y_=!1}w_(){if(this.y_)throw new Fp(qp.FAILED_PRECONDITION,"The client has already been terminated.")}Mo(e,t,n,i){return this.w_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([a,o])=>this.connection.Mo(e,cy(t,n),i,a,o)).catch(e=>{throw"FirebaseError"===e.name?(e.code===qp.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new Fp(qp.UNKNOWN,e.toString())})}Lo(e,t,n,i,a){return this.w_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,s])=>this.connection.Lo(e,cy(t,n),i,o,s,a)).catch(e=>{throw"FirebaseError"===e.name?(e.code===qp.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new Fp(qp.UNKNOWN,e.toString())})}terminate(){this.y_=!0,this.connection.terminate()}}class xb{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.S_=0,this.b_=null,this.D_=!0}v_(){0===this.S_&&(this.C_("Unknown"),this.b_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.b_=null,this.F_("Backend didn't respond within 10 seconds."),this.C_("Offline"),Promise.resolve())))}M_(e){"Online"===this.state?this.C_("Unknown"):(this.S_++,this.S_>=1&&(this.x_(),this.F_("Connection failed 1 times. Most recent error: ".concat(e.toString())),this.C_("Offline")))}set(e){this.x_(),this.S_=0,"Online"===e&&(this.D_=!1),this.C_(e)}C_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}F_(e){const t="Could not reach Cloud Firestore backend. ".concat(e,"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.");this.D_?(Op(t),this.D_=!1):Pp("OnlineStateTracker",t)}x_(){null!==this.b_&&(this.b_.cancel(),this.b_=null)}} 2920/** 2921 * @license 2922 * Copyright 2017 Google LLC 2923 * 2924 * Licensed under the Apache License, Version 2.0 (the "License"); 2925 * you may not use this file except in compliance with the License. 2926 * You may obtain a copy of the License at 2927 * 2928 * http://www.apache.org/licenses/LICENSE-2.0 2929 * 2930 * Unless required by applicable law or agreed to in writing, software 2931 * distributed under the License is distributed on an "AS IS" BASIS, 2932 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2933 * See the License for the specific language governing permissions and 2934 * limitations under the License. 2935 */class Tb{constructor(e,t,n,i,a){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.O_=[],this.N_=new Map,this.L_=new Set,this.B_=[],this.k_=a,this.k_._o(e=>{n.enqueueAndForget(async()=>{Mb(this)&&(Pp("RemoteStore","Restarting streams for network reachability change."),await async function(e){const t=Vp(e);t.L_.add(4),await Eb(t),t.q_.set("Unknown"),t.L_.delete(4),await Cb(t)}(this))})}),this.q_=new xb(n,i)}}async function Cb(e){if(Mb(e))for(const t of e.B_)await t(!0)}async function Eb(e){for(const t of e.B_)await t(!1)}function Sb(e,t){const n=Vp(e);n.N_.has(t.targetId)||(n.N_.set(t.targetId,t),Ob(n)?Pb(n):Xb(n).r_()&&Ab(n,t))}function Ib(e,t){const n=Vp(e),i=Xb(n);n.N_.delete(t),i.r_()&&Db(n,t),0===n.N_.size&&(i.r_()?i.o_():Mb(n)&&n.q_.set("Unknown"))}function Ab(e,t){if(e.Q_.xe(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(eg.min())>0){const n=e.remoteSyncer.getRemoteKeysForTarget(t.targetId).size;t=t.withExpectedCount(n)}Xb(e).A_(t)}function Db(e,t){e.Q_.xe(t),Xb(e).R_(t)}
2935function Pb(e){e.Q_=new $v({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),ot:t=>e.N_.get(t)||null,tt:()=>e.datastore.serializer.databaseId}),Xb(e).start(),e.q_.v_()}function Ob(e){return Mb(e)&&!Xb(e).n_()&&e.N_.size>0}function Mb(e){return 0===Vp(e).L_.size}function Nb(e){e.Q_=void 0}async function Rb(e){e.q_.set("Online")}async function Lb(e){e.N_.forEach((t,n)=>{Ab(e,t)})}async function Vb(e,t){Nb(e),Ob(e)?(e.q_.M_(t),Pb(e)):e.q_.set("Unknown")}async function qb(e,t,n){if(e.q_.set("Online"),t instanceof Yv&&2===t.state&&t.cause)try{await async function(e,t){const n=t.cause;for(const i of t.targetIds)e.N_.has(i)&&(await e.remoteSyncer.rejectListen(i,n),e.N_.delete(i),e.Q_.removeTarget(i))}(e,t)}catch(i){Pp("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),i),await Fb(e,i)}else if(t instanceof Kv?e.Q_.Ke(t):t instanceof Gv?e.Q_.He(t):e.Q_.We(t),!n.isEqual(eg.min()))try{const t=await tb(e.localStore);n.compareTo(t)>=0&&await function(e,t){const n=e.Q_.rt(t);return n.targetChanges.forEac
2935h((n,i)=>{if(n.resumeToken.approximateByteSize()>0){const a=e.N_.get(i);a&&e.N_.set(i,a.withResumeToken(n.resumeToken,t))}}),n.targetMismatches.forEach((t,n)=>{const i=e.N_.get(t);if(!i)return;e.N_.set(t,i.withResumeToken(Eg.EMPTY_BYTE_STRING,i.snapshotVersion)),Db(e,t);const a=new Ay(i.target,t,n,i.sequenceNumber);Ab(e,a)}),e.remoteSyncer.applyRemoteEvent(n)}(e,n)}catch(a){Pp("RemoteStore","Failed to raise snapshot:",a),await Fb(e,a)}}async function Fb(e,t,n){if(!dg(t))throw t;e.L_.add(1),await Eb(e),e.q_.set("Offline"),n||(n=()=>tb(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{Pp("RemoteStore","Retrying IndexedDB access"),await n(),e.L_.delete(1),await Cb(e)})}function Bb(e,t){return t().catch(n=>Fb(e,n,t))}async function Ub(e){const t=Vp(e),n=Jb(t);let i=t.O_.length>0?t.O_[t.O_.length-1].batchId:-1;for(;jb(t);)try{const e=await ib(t.localStore,i);if(null===e){0===t.O_.length&&n.o_();break}i=e.batchId,Hb(t,e)}catch(a){await Fb(t,a)}zb(t)&&Wb(t)}function jb(e){return Mb(e)&&e.O_.length<10}function Hb(e,t){e.O_.push(t);const n=Jb(e);n.r_()&&n.V_&&n.m_(t.mutations)}function zb(e){return Mb(e)&&!Jb(e).n_()&&e.O_.length>0}function Wb(e){Jb(e).start()}async function Kb(e){Jb(e).p_()}async function Gb(e){const t=Jb(e);for(const n of e.O_)t.m_(n.mutations)}async function Yb(e,t,n){const i=e.O_.shift(),a=Mv.from(i,t,n);await Bb(e,()=>e.remoteSyncer.applySuccessfulWrite(a)),await Ub(e)}async function Qb(e,t){t&&Jb(e).V_&&await async function(e,t){if(function(e){switch(e){default:return Rp();case qp.CANCELLED:case qp.UNKNOWN:case qp.DEADLINE_EXCEEDED:case qp.RESOURCE_EXHAUSTED:case qp.INTERNAL:case qp.UNAVAILABLE:case qp.UNAUTHENTICATED:return!1;case qp.INVALID_ARGUMENT:case qp.NOT_FOUND:case qp.ALREADY_EXISTS:case qp.PERMISSION_DENIED:case qp.FAILED_PRECONDITION:case qp.ABORTED:case qp.OUT_OF_RANGE:case qp.UNIMPLEMENTED:case qp.DATA_LOSS:return!0}}(n=t.code)&&n!==qp.ABORTED){const n=e.O_.shift();Jb(e).s_(),await Bb(e,()=>e.remoteSyncer.rejectFailedWrite(n.batchId,t)),await Ub(e)}var n}(e,t),zb(e)&&Wb(e)}async function $b(e,t){const n=Vp(e);n.asyncQueue.verifyOperationInProgress(),Pp("RemoteStore","RemoteStore received new credentials");const i=Mb(n);n.L_.add(3),await Eb(n),i&&n.q_.set("Unknown"),await n.remoteSyncer.handleCredentialChange(t),n.L_.delete(3),await Cb(n)}function Xb(e){return e.K_||(e.K_=function(e,t,n){const i=Vp(e);return i.w_(),new _b(t,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,n)}(e.datastore,e.asyncQueue,{Eo:Rb.bind(null,e),Ro:Lb.bind(null,e),mo:Vb.bind(null,e),d_:qb.bind(null,e)}),e.B_.push(async t=>{t?(e.K_.s_(),Ob(e)?Pb(e):e.q_.set("Unknown")):(await e.K_.stop(),Nb(e))})),e.K_}function Jb(e){return e.U_||(e.U_=function(e,t,n){const i=Vp(e);return i.w_(),new wb(t,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,n)}(e.datastore,e.asyncQueue,{Eo:()=>Promise.resolve(),Ro:Kb.bind(null,e),mo:Qb.bind(null,e),f_:Gb.bind(null,e),g_:Yb.bind(null,e)}),e.B_.push(async t=>{t?(e.U_.s_(),await Ub(e)):(await e.U_.stop(),e.O_.length>0&&(Pp("RemoteStore","Stopping write stream with ".concat(e.O_.length," pending writes")),e.O_=[]))})),e.U_ 2936/** 2937 * @license 2938 * Copyright 2017 Google LLC 2939 * 2940 * Licensed under the Apache License, Version 2.0 (the "License"); 2941 * you may not use this file except in compliance with the License. 2942 * You may obtain a copy of the License at 2943 * 2944 * http://www.apache.org/licenses/LICENSE-2.0 2945 * 2946 * Unless required by applicable law or agreed to in writing, software 2947 * distributed under the License is distributed on an "AS IS" BASIS, 2948 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2949 * See the License for the specific language governing permissions and 2950 * limitations under the License. 2951 */}class Zb{constructor(e,t,n,i,a){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=i,this.removalCallback=a,this.deferred=new Bp,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(e=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,n,i,a){const o=Date.now()+n,s=new Zb(e,t,o,i,a);return s.start(n),s}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new Fp(qp.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function e_(e,t){if(Op("AsyncQueue","".concat(t,": ").concat(e)),dg(e))return new Fp(qp.UNAVAILABLE,"".concat(t,": ").concat(e));throw e} 2952/** 2953 * @license 2954 * Copyright 2017 Google LLC 2955 * 2956 * Licensed under the Apache License, Version 2.0 (the "License");
2957 * you may not use this file except in compliance with the License. 2958 * You may obtain a copy of the License at 2959 * 2960 * http://www.apache.org/licenses/LICENSE-2.0 2961 * 2962 * Unless required by applicable law or agreed to in writing, software 2963 * distributed under the License is distributed on an "AS IS" BASIS, 2964 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2965 * See the License for the specific language governing permissions and 2966 * limitations under the License. 2967 */class t_{constructor(e){this.comparator=e?(t,n)=>e(t,n)||og.comparator(t.key,n.key):(e,t)=>og.comparator(e.key,t.key),this.keyedMap=Wm(),this.sortedSet=new bg(this.comparator)}static emptySet(e){return new t_(e.comparator)}has(e){return null!=this.keyedMap.get(e)}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,n)=>(e(t),!1))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof t_))return!1;if(this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),n=e.sortedSet.getIterator();for(;t.hasNext();){const e=t.getNext().key,i=n.getNext().key;if(!e.isEqual(i))return!1}return!0}toString(){const e=[];return this.forEach(t=>{e.push(t.toString())}),0===e.length?"DocumentSet ()":"DocumentSet (\n "+e.join(" \n")+"\n)"}copy(e,t){const n=new t_;return n.comparator=this.comparator,n.keyedMap=e,n.sortedSet=t,n}} 2968/** 2969 * @license 2970 * Copyright 2017 Google LLC 2971 * 2972 * Licensed under the Apache License, Version 2.0 (the "License"); 2973 * you may not use this file except in compliance with the License. 2974 * You may obtain a copy of the License at 2975 * 2976 * http://www.apache.org/licenses/LICENSE-2.0 2977 * 2978 * Unless required by applicable law or agreed to in writing, software 2979 * distributed under the License is distributed on an "AS IS" BASIS, 2980 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2981 * See the License for the specific language governing permissions and 2982 * limitations under the License. 2983 */class n_{constructor(){this.W_=new bg(og.comparator)}track(e){const t=e.doc.key,n=this.W_.get(t);n?0!==e.type&&3===n.type?this.W_=this.W_.insert(t,e):3===e.type&&1!==n.type?this.W_=this.W_.insert(t,{type:n.type,doc:e.doc}):2===e.type&&2===n.type?this.W_=this.W_.insert(t,{type:2,doc:e.doc}):2===e.type&&0===n.type?this.W_=this.W_.insert(t,{type:0,doc:e.doc}):1===e.type&&0===n.type?this.W_=this.W_.remove(t):1===e.type&&2===n.type?this.W_=this.W_.insert(t,{type:1,doc:n.doc}):0===e.type&&1===n.type?this.W_=this.W_.insert(t,{type:2,doc:e.doc}):Rp():this.W_=this.W_.insert(t,e)}G_(){const e=[];return this.W_.inorderTraversal((t,n)=>{e.push(n)}),e}}class i_{constructor(e,t,n,i,a,o,s,r,l){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=i,this.mutatedKeys=a,this.fromCache=o,this.syncStateChanged=s,this.excludesMetadataChanges=r,this.hasCachedResults=l}static fromInitialDocuments(e,t,n,i,a){const o=[];return t.forEach(e=>{o.push({type:0,doc:e})}),new i_(e,t,t_.emptySet(t),o,n,i,!0,!1,a)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Rm(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(let i=0;i<t.length;i++)if(t[i].type!==n[i].type||!t[i].doc.isEqual(n[i].doc))return!1;return!0}} 2984/** 2985 * @license 2986 * Copyright 2017 Google LLC 2987 * 2988 * Licensed under the Apache License, Version 2.0 (the "License"); 2989 * you may not use this file except in compliance with the License. 2990 * You may obtain a copy of the License at 2991 * 2992 * http://www.apache.org/licenses/LICENSE-2.0 2993 * 2994 * Unless required by applicable law or agreed to in writing, softw
2994are 2995 * distributed under the License is distributed on an "AS IS" BASIS, 2996 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2997 * See the License for the specific language governing permissions and 2998 * limitations under the License. 2999 */class a_{constructor(){this.z_=void 0,this.j_=[]}H_(){return this.j_.some(e=>e.J_())}}class o_{constructor(){this.queries=s_(),this.onlineState="Unknown",this.Y_=new Set}terminate(){!function(e,t){const n=Vp(e),i=n.queries;n.queries=s_(),i.forEach((e,n)=>{for(const i of n.j_)i.onError(t)})}(this,new Fp(qp.ABORTED,"Firestore shutting down"))}}function s_(){return new Um(e=>Lm(e),Rm)}async function r_(e,t){const n=Vp(e);let i=3;const a=t.query;let o=n.queries.get(a);o?!o.H_()&&t.J_()&&(i=2):(o=new a_,i=t.J_()?0:1);try{switch(i){case 0:o.z_=await n.onListen(a,!0);break;case 1:o.z_=await n.onListen(a,!1);break;case 2:await n.onFirstRemoteStoreListen(a)}}catch(s){const e=e_(s,"Initialization of query '".concat(Vm(t.query),"' failed"));return void t.onError(e)}n.queries.set(a,o),o.j_.push(t),t.Z_(n.onlineState),o.z_&&t.X_(o.z_)&&h_(n)}async function l_(e,t){const n=Vp(e),i=t.query;let a=3;const o=n.queries.get(i);if(o){const e=o.j_.indexOf(t);e>=0&&(o.j_.splice(e,1),0===o.j_.length?a=t.J_()?0:1:!o.H_()&&t.J_()&&(a=2))}switch(a){case 0:return n.queries.delete(i),n.onUnlisten(i,!0);case 1:return n.queries.delete(i),n.onUnlisten(i,!1);case 2:return n.onLastRemoteStoreUnlisten(i);default:return}}function c_(e,t){const n=Vp(e);let i=!1;for(const a of t){const e=a.query,t=n.queries.get(e);if(t){for(const e of t.j_)e.X_(a)&&(i=!0);t.z_=a}}i&&h_(n)}function u_(e,t,n){const i=Vp(e),a=i.queries.get(t);if(a)for(const o of a.j_)o.onError(n);i.queries.delete(t)}function h_(e){e.Y_.forEach(e=>{e.next()})}var d_,f_;(f_=d_||(d_={})).ea="default",f_.Cache="cache";class p_{constructor(e,t,n){this.query=e,this.ta=t,this.na=!1,this.ra=null,this.onlineState="Unknown",this.options=n||{}}X_(e){if(!this.options.includeMetadataChanges){const t=[];for(const n of e.docChanges)3!==n.type&&t.push(n);e=new i_(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.na?this.ia(e)&&(this.ta.next(e),t=!0):this.sa(e,this.onlineState)&&(this.oa(e),t=!0),this.ra=e,t}onError(e){this.ta.error(e)}Z_(e){this.onlineState=e;let t=!1;return this.ra&&!this.na&&this.sa(this.ra,e)&&(this.oa(this.ra),t=!0),t}sa(e,t){if(!e.fromCache)return!0;if(!this.J_())return!0;const n="Offline"!==t;return(!this.options._a||!n)&&(!e.docs.isEmpty()||e.hasCachedResults||"Offline"===t)}ia(e){if(e.docChanges.length>0)return!0;const t=this.ra&&this.ra.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}oa(e){e=i_.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.na=!0,this.ta.next(e)}J_(){return this.options.source!==d_.Cache}} 3000/** 3001 * @license 3002 * Copyright 2017 Google LLC 3003 * 3004 * Licensed under the Apache License, Version 2.0 (the "License"); 3005 * you may not use this file except in compliance with the License. 3006 * You may obtain a copy of the License at 3007 * 3008 * http://www.apache.org/licenses/LICENSE-2.0 3009 * 3010 * Unless required by applicable law or agreed to in writing, software 3011 * distributed under the License is distributed on an "AS IS" BASIS, 3012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3013 * See the License for the specific language governing permissions and 3014 * limitations under the License. 3015 */class g_{constructor(e){this.key=e}}class m_{constructor(e){this.key=e}}class v_{constructor(e,t){this.query=e,this.Ta=t,this.Ea=null,this.hasCachedResults=!1,this.current=!1,this.da=Jm(),this.mutatedKeys=Jm(),this.Aa=Fm(e),this.Ra=new t_(this.Aa)}get Va(){return this.Ta}ma(e,t){const n=t?t.fa:new n_,i=t?t.Ra:this.Ra;let a=t?t.mutatedKeys:this.mutatedKeys,o=i,s=!1;const r="F"===this.query.limitType&&i.size===this.query.limit?i.last():null,l="L"===this.query.limitType&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((e,t)=>{const c=i.get(e),u=qm(this.query,t)?t:null,h=!!c&&this.mutatedKeys.has(c.key),d=!!u&&(u.hasLocalMutations||this.mutatedKeys.has(u.key)&&u.hasCommittedMutations);let f=!1;c&&u?c.data.isEqual(u.data)?h!==d&&(n.track({type:3,doc:u}),f=!0):this.ga(c,u)||(n.track({type:2,doc:u}),f=!0,(r&&this.Aa(u,r)>0||l&&this.Aa(u,l)<0)&&(s=!0)):!c&&u?(n.track({type:0,doc:u}),f=!0):c&&!u&&(n.track({type:1,doc:c}),f=!0,(r||l)&&(s=!0)),f&&(u?(o=o.add(u),a=d?a.add(e):a.delete(e)):(o=o.delete(e),a=a.delete(e)))}),null!==this.query.limit)for(;o.size>this.query.limit;){const e="F"===this.query.limitType?o.last():o.first();o=o.delete(e.key),a=a.delete(e.key),n.track({type:1,doc:e})}return{Ra:o,fa:n,ns:s,mutatedKeys:a}}ga(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}
3015applyChanges(e,t,n,i){const a=this.Ra;this.Ra=e.Ra,this.mutatedKeys=e.mutatedKeys;const o=e.fa.G_();o.sort((e,t)=>function(e,t){const n=e=>{switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Rp()}};return n(e)-n(t)}(e.type,t.type)||this.Aa(e.doc,t.doc)),this.pa(n),i=null!=i&&i;const s=t&&!i?this.ya():[],r=0===this.da.size&&this.current&&!i?1:0,l=r!==this.Ea;return this.Ea=r,0!==o.length||l?{snapshot:new i_(this.query,e.Ra,a,o,e.mutatedKeys,0===r,l,!1,!!n&&n.resumeToken.approximateByteSize()>0),wa:s}:{wa:s}}Z_(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({Ra:this.Ra,fa:new n_,mutatedKeys:this.mutatedKeys,ns:!1},!1)):{wa:[]}}Sa(e){return!this.Ta.has(e)&&!!this.Ra.has(e)&&!this.Ra.get(e).hasLocalMutations}pa(e){e&&(e.addedDocuments.forEach(e=>this.Ta=this.Ta.add(e)),e.modifiedDocuments.forEach(e=>{}),e.removedDocuments.forEach(e=>this.Ta=this.Ta.delete(e)),this.current=e.current)}ya(){if(!this.current)return[];const e=this.da;this.da=Jm(),this.Ra.forEach(e=>{this.Sa(e.key)&&(this.da=this.da.add(e.key))});const t=[];return e.forEach(e=>{this.da.has(e)||t.push(new m_(e))}),this.da.forEach(n=>{e.has(n)||t.push(new g_(n))}),t}ba(e){this.Ta=e.Ts,this.da=Jm();const t=this.ma(e.documents);return this.applyChanges(t,!0)}Da(){return i_.fromInitialDocuments(this.query,this.Ra,this.mutatedKeys,0===this.Ea,this.hasCachedResults)}}class y_{constructor(e,t,n){this.query=e,this.targetId=t,this.view=n}}class b_{constructor(e){this.key=e,this.va=!1}}class __{constructor(e,t,n,i,a,o){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=i,this.currentUser=a,this.maxConcurrentLimboResolutions=o,this.Ca={},this.Fa=new Um(e=>Lm(e),Rm),this.Ma=new Map,this.xa=new Set,this.Oa=new bg(og.comparator),this.Na=new Map,this.La=new Uy,this.Ba={},this.ka=new Map,this.qa=Ny.kn(),this.onlineState="Unknown",this.Qa=void 0}get isPrimaryClient(){return!0===this.Qa}}async function w_(e,t,n=!0){const i=j_(e);let a;const o=i.Fa.get(t);return o?(i.sharedClientState.addLocalQueryTarget(o.targetId),a=o.view.Da()):a=await x_(i,t,n,!0),a}async function k_(e,t){const n=j_(e);await x_(n,t,!0,!1)}async function x_(e,t,n,i){const a=await function(e,t){const n=Vp(e);return n.persistence.runTransaction("Allocate target","readwrite",e=>{let i;return n.Ur.getTargetData(e,t).next(a=>a?(i=a,hg.resolve(i)):n.Ur.allocateTargetId(e).next(a=>(i=new Ay(t,a,"TargetPurposeListen",e.currentSequenceNumber),n.Ur.addTargetData(e,i).next(()=>i))))}).then(e=>{const i=n.os.get(e.targetId);return(null===i||e.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(n.os=n.os.insert(e.targetId,e),n._s.set(t,e.targetId)),e})}(e.localStore,Om(t)),o=a.targetId,s=e.sharedClientState.addLocalQueryTarget(o,n);let r;return i&&(r=await async function(e,t,n,i,a){e.Ka=(t,n,i)=>async function(e,t,n,i){let a=t.view.ma(n);a.ns&&(a=await ob(e.localStore,t.query,!1).then(({documents:e})=>t.view.ma(e,a)));const o=i&&i.targetChanges.get(t.targetId),s=i&&null!=i.targetMismatches.get(t.targetId),r=t.view.applyChanges(a,e.isPrimaryClient,o,s);return L_(e,t.targetId,r.wa),r.snapshot}(e,t,n,i);const o=await ob(e.localStore,t,!0),s=new v_(t,o.Ts),r=s.ma(o.documents),l=Wv.createSynthesizedTargetChangeForCurrentChange(n,i&&"Offline"!==e.onlineState,a),c=s.applyChanges(r,e.isPrimaryClient,l);L_(e,n,c.wa);const u=new y_(t,n,s);return e.Fa.set(t,u),e.Ma.has(n)?e.Ma.get(n).push(t):e.Ma.set(n,[t]),c.snapshot}(e,t,o,"current"===s,a.resumeToken)),e.isPrimaryClient&&n&&Sb(e.remoteStore,a),r}async function T_(e,t,n){const i=Vp(e),a=i.Fa.get(t),o=i.Ma.get(a.targetId);if(o.length>1)return i.Ma.set(a.targetId,o.filter(e=>!Rm(e,t))),void i.Fa.delete(t);i.isPrimaryClient?(i.sharedClientState.removeLocalQueryTarget(a.targetId),i.sharedClientState.isActiveQueryTarget(a.targetId)||await ab(i.localStore,a.targetId,!1).then(()=>{i.sharedClientState.clearQueryState(a.targetId),n&&Ib(i.remoteStore,a.targetId),N_(i,a.targetId)}).catch(ug)):(N_(i,a.targetId),await ab(i.localStore,a.targetId,!0))}async function C_(e,t){const n=Vp(e),i=n.Fa.get(t),a=n.Ma.get(i.targetId);
3015n.isPrimaryClient&&1===a.length&&(n.sharedClientState.removeLocalQueryTarget(i.targetId),Ib(n.remoteStore,i.targetId))}async function E_(e,t,n){const i=function(e){const t=Vp(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=D_.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=P_.bind(null,t),t}(e);try{const e=await function(e,t){const n=Vp(e),i=Zp.now(),a=t.reduce((e,t)=>e.add(t.key),Jm());let o,s;return n.persistence.runTransaction("Locally write mutations","readwrite",e=>{let r=Hm(),l=Jm();return n.cs.getEntries(e,a).next(e=>{r=e,r.forEach((e,t)=>{t.isValidDocument()||(l=l.add(e))})}).next(()=>n.localDocuments.getOverlayedDocuments(e,r)).next(a=>{o=a;const s=[];for(const e of t){const t=xv(e,o.get(e.key).overlayedDocument);null!=t&&s.push(new Ev(e.key,t,Zg(t.value.mapValue),vv.exists(!0)))}return n.mutationQueue.addMutationBatch(e,i,s,t)}).next(t=>{s=t;const i=t.applyToLocalDocumentSet(o,l);return n.documentOverlayCache.saveOverlays(e,t.batchId,i)})}).then(()=>({batchId:s.batchId,changes:Km(o)}))}(i.localStore,t);i.sharedClientState.addPendingMutation(e.batchId),function(e,t,n){let i=e.Ba[e.currentUser.toKey()];i||(i=new bg(Xp)),i=i.insert(t,n),e.Ba[e.currentUser.toKey()]=i}(i,e.batchId,n),await F_(i,e.changes),await Ub(i.remoteStore)}catch(a){const e=e_(a,"Failed to persist write");n.reject(e)}}async function S_(e,t){const n=Vp(e);try{const e=await nb(n.localStore,t);
3015t.targetChanges.forEach((e,t)=>{const i=n.Na.get(t);i&&(Lp(e.addedDocuments.size+e.modifiedDocuments.size+e.removedDocuments.size<=1),e.addedDocuments.size>0?i.va=!0:e.modifiedDocuments.size>0?Lp(i.va):e.removedDocuments.size>0&&(Lp(i.va),i.va=!1))}),await F_(n,e,t)}catch(i){await ug(i)}}function I_(e,t,n){const i=Vp(e);if(i.isPrimaryClient&&0===n||!i.isPrimaryClient&&1===n){const e=[];i.Fa.forEach((n,i)=>{const a=i.view.Z_(t);a.snapshot&&e.push(a.snapshot)}),function(e,t){const n=Vp(e);n.onlineState=t;let i=!1;n.queries.forEach((e,n)=>{for(const a of n.j_)a.Z_(t)&&(i=!0)}),i&&h_(n)}(i.eventManager,t),e.length&&i.Ca.d_(e),i.onlineState=t,i.isPrimaryClient&&i.sharedClientState.setOnlineState(t)}}async function A_(e,t,n){const i=Vp(e);i.sharedClientState.updateQueryState(t,"rejected",n);const a=i.Na.get(t),o=a&&a.key;if(o){let e=new bg(og.comparator);e=e.insert(o,em.newNoDocument(o,eg.min()));const n=Jm().add(o),a=new zv(eg.min(),new Map,new bg(Xp),e,n);await S_(i,a),i.Oa=i.Oa.remove(o),i.Na.delete(t),q_(i)}else await ab(i.localStore,t,!1).then(()=>N_(i,t,n)).catch(ug)}async function D_(e,t){const n=Vp(e),i=t.batch.batchId;try{const e=await function(e,t){const n=Vp(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",e=>{const i=t.batch.keys(),a=n.cs.newChangeBuffer({trackRemovals:!0});return function(e,t,n,i){const a=n.batch,o=a.keys();let s=hg.resolve();return o.forEach(e=>{s=s.next(()=>i.getEntry(t,e)).next(t=>{const o=n.docVersions.get(e);Lp(null!==o),t.version.compareTo(o)<0&&(a.applyToRemoteDocument(t,n),t.isValidDocument()&&(t.setReadTime(n.commitVersion),i.addEntry(t)))})}),s.next(()=>e.mutationQueue.removeMutationBatch(t,a))}(n,e,t,a).next(()=>a.apply(e)).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,i,t.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,function(e){let t=Jm();for(let n=0;n<e.mutationResults.length;++n)e.mutationResults[n].transformResults.length>0&&(t=t.add(e.batch.mutations[n].key));return t}(t))).next(()=>n.localDocuments.getDocuments(e,i))})}(n.localStore,t);M_(n,i,null),O_(n,i),n.sharedClientState.updateMutationState(i,"acknowledged"),await F_(n,e)}catch(a){await ug(a)}}async function P_(e,t,n){const i=Vp(e);try{const e=await function(e,t){const n=Vp(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",e=>{let i;
3015return n.mutationQueue.lookupMutationBatch(e,t).next(t=>(Lp(null!==t),i=t.keys(),n.mutationQueue.removeMutationBatch(e,t))).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,i,t)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,i)).next(()=>n.localDocuments.getDocuments(e,i))})}(i.localStore,t);M_(i,t,n),O_(i,t),i.sharedClientState.updateMutationState(t,"rejected",n),await F_(i,e)}catch(a){await ug(a)}}function O_(e,t){(e.ka.get(t)||[]).forEach(e=>{e.resolve()}),e.ka.delete(t)}function M_(e,t,n){const i=Vp(e);let a=i.Ba[i.currentUser.toKey()];if(a){const e=a.get(t);e&&(n?e.reject(n):e.resolve(),a=a.remove(t)),i.Ba[i.currentUser.toKey()]=a}}function N_(e,t,n=null){e.sharedClientState.removeLocalQueryTarget(t);for(const i of e.Ma.get(t))e.Fa.delete(i),n&&e.Ca.$a(i,n);e.Ma.delete(t),e.isPrimaryClient&&e.La.gr(t).forEach(t=>{e.La.containsKey(t)||R_(e,t)})}function R_(e,t){e.xa.delete(t.path.canonicalString());const n=e.Oa.get(t);null!==n&&(Ib(e.remoteStore,n),e.Oa=e.Oa.remove(t),e.Na.delete(n),q_(e))}function L_(e,t,n){for(const i of n)i instanceof g_?(e.La.addReference(i.key,t),V_(e,i)):i instanceof m_?(Pp("SyncEngine","Document no longer in limbo: "+i.key),e.La.removeReference(i.key,t),e.La.containsKey(i.key)||R_(e,i.key)):Rp()}function V_(e,t){const n=t.key,i=n.path.canonicalString();e.Oa.get(n)||e.xa.has(i)||(Pp("SyncEngine","New document in limbo: "+n),e.xa.add(i),q_(e))}function q_(e){for(;e.xa.size>0&&e.Oa.size<e.maxConcurrentLimboResolutions;){const t=e.xa.values().next().value;e.xa.delete(t);const n=new og(ng.fromString(t)),i=e.qa.next();e.Na.set(i,new b_(n)),e.Oa=e.Oa.insert(n,i),Sb(e.remoteStore,new Ay(Om(Im(n.path)),i,"TargetPurposeLimboResolution",fg.oe))}}async function F_(e,t,n){const i=Vp(e),a=[],o=[],s=[];i.Fa.isEmpty()||(i.Fa.forEach((e,r)=>{s.push(i.Ka(r,t,n).then(e=>{var t;if((e||n)&&i.isPrimaryClient){const a=e?!e.fromCache:null===(t=null==n?void 0:n.targetChanges.get(r.targetId))||void 0===t?void 0:t.current;i.sharedClientState.updateQueryState(r.targetId,a?"current":"not-current")}if(e){a.push(e);const t=$y.Wi(r.targetId,e);o.push(t)}}))}),await Promise.all(s),i.Ca.d_(a),await async function(e,t){const n=Vp(e);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",e=>hg.forEach(t,t=>hg.forEach(t.$i,i=>n.persistence.referenceDelegate.addReference(e,t.targetId,i)).next(()=>hg.forEach(t.Ui,i=>n.persistence.referenceDelegate.removeReference(e,t.targetId,i)))))}catch(i){if(!dg(i))throw i;Pp("LocalStore","Failed to update sequence numbers: "+i)}for(const a of t){const e=a.targetId;if(!a.fromCache){const t=n.os.get(e),i=t.snapshotVersion,a=t.withLastLimboFreeSnapshotVersion(i);n.os=n.os.insert(e,a)}}}(i.localStore,o))}async function B_(e,t){const n=Vp(e);if(!n.currentUser.isEqual(t)){Pp("SyncEngine","User change. New user:",t.toKey());const e=await eb(n.localStore,t);n.currentUser=t,a="'waitForPendingWrites' promise is rejected due to a user change.",(i=n).ka.forEach(e=>{e.forEach(e=>{e.reject(new Fp(qp.CANCELLED,a))})}),i.ka.clear(),n.sharedClientState.handleUserChange(t,e.removedBatchIds,e.addedBatchIds),await F_(n,e.hs)}var i,a}function U_(e,t){const n=Vp(e),i=n.Na.get(t);if(i&&i.va)return Jm().add(i.key);{let e=Jm();const i=n.Ma.get(t);if(!i)return e;for(const t of i){const i=n.Fa.get(t);e=e.unionWith(i.view.Va)}return e}}function j_(e){const t=Vp(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=S_.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=U_.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=A_.bind(null,t),t.Ca.d_=c_.bind(null,t.eventManager),t.Ca.$a=u_.bind(null,t.eventManager),t}class H_{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=vb(e.databaseInfo.databaseId),this.sharedClientState=this.Wa(e),this.persistence=this.Ga(e),await this.persistence.start(),this.localStore=this.za(e),this.gcScheduler=this.ja(e,this.localStore),this.indexBackfillerScheduler=this.Ha(e,this.localStore)}ja(e,t){return null}Ha(e,t){return null}za(e){return function(e,t,n,i){return new Zy(e,t,n,i)}(this.persistence,new Jy,e.initialUser,this.serializer)}Ga(e){return new Gy(Qy.Zr,this.serializer)}Wa(e){return new rb}async terminate(){var e,t;null===(e=this.gcScheduler)||void 0===e||e.stop(),null===(t=this.indexBackfillerScheduler)||void 0===t||t.stop(),this.sharedCl
3015ientState.shutdown(),await this.persistence.shutdown()}}H_.provider={build:()=>new H_};class z_{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=e=>I_(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=B_.bind(null,this.syncEngine),await async function(e,t){const n=Vp(e);t?(n.L_.delete(2),await Cb(n)):t||(n.L_.add(2),await Eb(n),n.q_.set("Unknown"))}(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new o_}createDatastore(e){const t=vb(e.databaseInfo.databaseId),n=(i=e.databaseInfo,new gb(i));var i;return function(e,t,n,i){return new kb(e,t,n,i)}(e.authCredentials,e.appCheckCredentials,n,t)}createRemoteStore(e){return t=this.localStore,n=this.datastore,i=e.asyncQueue,a=e=>I_(this.syncEngine,e,0),o=cb.D()?new cb:new lb,new Tb(t,n,i,a,o);var t,n,i,a,o}createSyncEngine(e,t){return function(e,t,n,i,a,o,s){const r=new __(e,t,n,i,a,o);return s&&(r.Qa=!0),r}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e,t;await async function(e){const t=Vp(e);Pp("RemoteStore","RemoteStore shutting down."),t.L_.add(5),await Eb(t),t.k_.shutdown(),t.q_.set("Unknown")}(this.remoteStore),null===(e=this.datastore)||void 0===e||e.terminate(),null===(t=this.eventManager)||void 0===t||t.terminate()}}z_.provider={build:()=>new z_}; 3016/** 3017 * @license 3018 * Copyright 2020 Google LLC 3019 * 3020 * Licensed under the Apache License, Version 2.0 (the "License"); 3021 * you may not use this file except in compliance with the License. 3022 * You may obtain a copy of the License at 3023 * 3024 * http://www.apache.org/licenses/LICENSE-2.0 3025 * 3026 * Unless required by applicable law or agreed to in writing, software 3027 * distributed under the License is distributed on an "AS IS" BASIS, 3028 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3029 * See the License for the specific language governing permissions and 3030 * limitations under the License. 3031 */ 3032/** 3033 * @license 3034 * Copyright 2017 Google LLC 3035 * 3036 * Licensed under the Apache License, Version 2.0 (the "License"); 3037 * you may not use this file except in compliance with the License. 3038 * You may obtain a copy of the License at 3039 * 3040 * http://www.apache.org/licenses/LICENSE-2.0 3041 * 3042 * Unless required by applicable law or agreed to in writing, software 3043 * distributed under the License is distributed on an "AS IS" BASIS, 3044 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3045 * See the License for the specific language governing permissions and 3046 * limitations under the License. 3047 */ 3048class W_{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Ya(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Ya(this.observer.error,e):Op("Uncaught Error in snapshot listener:",e.toString()))}Za(){this.muted=!0}Ya(e,t){setTimeout(()=>{this.muted||e(t)},0)}} 3049/** 3050 * @license 3051 * Copyright 2017 Google LLC 3052 * 3053 * Licensed under the Apache License, Version 2.0 (the "License"); 3054 * you may not use this file except in compliance with the License. 3055 * You may obtain a copy of the License at 3056 * 3057 * http://www.apache.org/licenses/LICENSE-2.0 3058 * 3059 * Unless required by applicable law or agreed to in writing, software 3060 * distributed under the License is distributed on an "AS IS" BASIS, 3061 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3062 * See the License for the specific language governing permissions and 3063 * limitations under the License. 3064 */class K_{constructor(e,t,n,i,a){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=n,this.databaseInfo=i,this.user=Sp.UNAUTHENTICATED,this.clientId=$p.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=a,this.authCredentials.start(n,async e=>{Pp("FirestoreClient","Received user=",e.uid),await this.authCredentialListener(e),this.user=e}),this.appCheckCredentials.start(n,e=>(Pp("FirestoreClient","Received new app check token=",e),this.appCheckCredentialListener(e,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Bp;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const n=e_(t,"Failed to shutdown persistence");e.reject(n)}}),e.promise}}async function G_(e,t){e.asyncQueue.verifyOperationInProgress(),Pp("FirestoreClient","Initializing OfflineComponentProvider");const n=e.configuration;await t.initialize(n);let i=n.initialUser;e.setCredentialChangeListener(async e=>{i.isEqual(e)||(await eb(t.localStore,e),i=e)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function Y_(e,t){e.asyncQueue.verifyOperationInProgress();const n=await async function(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){Pp("FirestoreClient","Using user provided OfflineComponentProvider");try{await G_(e,e._uninitializedComponentsProvider._offline)}catch(t){const a=t;if(!("FirebaseError"===(n=a).name?n.code===qp.FAILED_PRECONDITION||n.code===qp.UNI
3064MPLEMENTED:!("undefined"!=typeof DOMException&&n instanceof DOMException)||22===n.code||20===n.code||11===n.code))throw a;Mp("Error using user provided cache. Falling back to memory cache: "+a),await G_(e,new H_)}}else Pp("FirestoreClient","Using default OfflineComponentProvider"),await G_(e,new H_);var n;return e._offlineComponents}(e);Pp("FirestoreClient","Initializing OnlineComponentProvider"),await t.initialize(n,e.configuration),e.setCredentialChangeListener(e=>$b(t.remoteStore,e)),e.setAppCheckTokenChangeListener((e,n)=>$b(t.remoteStore,n)),e._onlineComponents=t}async function Q_(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(Pp("FirestoreClient","Using user provided OnlineComponentProvider"),await Y_(e,e._uninitializedComponentsProvider._online)):(Pp("FirestoreClient","Using default OnlineComponentProvider"),await Y_(e,new z_))),e._onlineComponents}async function $_(e){const t=await Q_(e),n=t.eventManager;return n.onListen=w_.bind(null,t.syncEngine),n.onUnlisten=T_.bind(null,t.syncEngine),n.onFirstRemoteStoreListen=k_.bind(null,t.syncEngine),n.onLastRemoteStoreUnlisten=C_.bind(null,t.syncEngine),n} 3065/** 3066 * @license 3067 * Copyright 2023 Google LLC 3068 * 3069 * Licensed under the Apache License, Version 2.0 (the "License"); 3070 * you may not use this file except in compliance with the License. 3071 * You may obtain a copy of the License at 3072 * 3073 * http://www.apache.org/licenses/LICENSE-2.0 3074 * 3075 * Unless required by applicable law or agreed to in writing, software 3076 * distributed under the License is distributed on an "AS IS" BASIS, 3077 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3078 * See the License for the specific language governing permissions and 3079 * limitations under the License. 3080 */ 3081function X_(e){const t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t 3082/** 3083 * @license 3084 * Copyright 2020 Google LLC 3085 * 3086 * Licensed under the Apache License, Version 2.0 (the "License"); 3087 * you may not use this file except in compliance with the License. 3088 * You may obtain a copy of the License at 3089 * 3090 * http://www.apache.org/licenses/LICENSE-2.0 3091 * 3092 * Unless required by applicable law or agreed to in writing, software 3093 * distributed under the License is distributed on an "AS IS" BASIS, 3094 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3095 * See the License for the specific language governing permissions and 3096 * limitations under the License. 3097 */}const J_=new Map; 3098/** 3099 * @license 3100 * Copyright 2017 Google LLC 3101 * 3102 * Licensed under the Apache License, Version 2.0 (the "License"); 3103 * you may not use this file except in compliance with the License. 3104 * You may obtain a copy of the License at 3105 * 3106 * http://www.apache.org/licenses/LICENSE-2.0 3107 * 3108 * Unless required by applicable law or agreed to in writing, software 3109 * distributed under the License is distributed on an "AS IS" BASIS, 3110 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3111 * See the License for the specific language governing permissions and 3112 * limitations under the License. 3113 */function Z_(e,t,n){if(!n)throw new Fp(qp.INVALID_ARGUMENT,"Function ".concat(e,"() cannot be called with an empty ").concat(t,"."))}function ew(e){if(!og.isDocumentKey(e))throw new Fp(qp.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but ".concat(e," has ").concat(e.length,"."))}function tw(e){if(og.isDocumentKey(e))throw new Fp(qp.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but ".concat(e," has ").concat(e.length,"."))}function nw(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e="".concat(e.substring(0,20),"...")),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";{const n=(t=e).constructor?t.constructor.name:null;return n?"a custom ".concat(n," object"):"an object"}}var t;return"function"==typeof e?"a function":Rp()}function iw(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new Fp(qp.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=nw(e);throw new Fp(qp.INVALID_ARGUMENT,"Expected type '".concat(t.name,"', but it was: ").concat(n))}}return e} 3114/** 3115 * @license 3116 * Copyright 2020 Google LLC 3117 * 3118 * Licensed under the Apache License, Version 2.0 (the "License");
3119 * you may not use this file except in compliance with the License. 3120 * You may obtain a copy of the License at 3121 * 3122 * http://www.apache.org/licenses/LICENSE-2.0 3123 * 3124 * Unless required by applicable law or agreed to in writing, software 3125 * distributed under the License is distributed on an "AS IS" BASIS, 3126 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3127 * See the License for the specific language governing permissions and 3128 * limitations under the License. 3129 */ 3130class aw{constructor(e){var t,n;if(void 0===e.host){if(void 0!==e.ssl)throw new Fp(qp.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=null===(t=e.ssl)||void 0===t||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new Fp(qp.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}(function(e,t,n,i){if(!0===t&&!0===i)throw new Fp(qp.INVALID_ARGUMENT,"".concat(e," and ").concat(n," cannot be used together."))})("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=X_(null!==(n=e.experimentalLongPollingOptions)&&void 0!==n?n:{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new Fp(qp.INVALID_ARGUMENT,"invalid long polling timeout: ".concat(e.timeoutSeconds," (must not be NaN)"));if(e.timeoutSeconds<5)throw new Fp(qp.INVALID_ARGUMENT,"invalid long polling timeout: ".concat(e.timeoutSeconds," (minimum allowed value is 5)"));if(e.timeoutSeconds>30)throw new Fp(qp.INVALID_ARGUMENT,"invalid long polling timeout: ".concat(e.timeoutSeconds," (maximum allowed value is 30)"))}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&(t=this.experimentalLongPollingOptions,n=e.experimentalLongPollingOptions,t.timeoutSeconds===n.timeoutSeconds)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams;var t,n}}class ow{constructor(e,t,n,i){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new aw({}),this._settingsFrozen=!1,this._terminateTask="notTerminated"}get app(){if(!this._app)throw new Fp(qp.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return"notTerminated"!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new Fp(qp.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new aw(e),void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new jp;switch(e.type){case"firstParty":return new Kp(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new Fp(qp.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return"notTerminated"===this._terminateTask&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){"notTerminated"===this._terminateTask?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){const t=J_.get(e);t&&(Pp("ComponentProvider","Removing Datastore"),J_.delete(e),t.terminate())}(this),Promise.resolve()}} 3131/** 3132 * @license 3133 * Copyright 2020 Google LLC 3134 * 3135 * Licensed under the Apache License, Version 2.0 (the "License");
3136 * you may not use this file except in compliance with the License. 3137 * You may obtain a copy of the License at 3138 * 3139 * http://www.apache.org/licenses/LICENSE-2.0 3140 * 3141 * Unless required by applicable law or agreed to in writing, software 3142 * distributed under the License is distributed on an "AS IS" BASIS, 3143 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3144 * See the License for the specific language governing permissions and 3145 * limitations under the License. 3146 */ 3147class sw{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new sw(this.firestore,e,this._query)}}class rw{constructor(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new lw(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new rw(this.firestore,e,this._key)}}class lw extends sw{constructor(e,t,n){super(e,t,Im(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new rw(this.firestore,null,new og(e))}withConverter(e){return new lw(this.firestore,e,this._path)}}function cw(e,t,...n){if(e=Rc(e),Z_("collection","path",t),e instanceof ow){const i=ng.fromString(t,...n);return tw(i),new lw(e,null,i)}{if(!(e instanceof rw||e instanceof lw))throw new Fp(qp.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const i=e._path.child(ng.fromString(t,...n));return tw(i),new lw(e.firestore,null,i)}}function uw(e,t,...n){if(e=Rc(e),1===arguments.length&&(t=$p.newId()),Z_("doc","path",t),e instanceof ow){const i=ng.fromString(t,...n);return ew(i),new rw(e,null,new og(i))}{if(!(e instanceof rw||e instanceof lw))throw new Fp(qp.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const i=e._path.child(ng.fromString(t,...n));return ew(i),new rw(e.firestore,e instanceof lw?e.converter:null,new og(i))}} 3148/** 3149 * @license 3150 * Copyright 2020 Google LLC 3151 * 3152 * Licensed under the Apache License, Version 2.0 (the "License"); 3153 * you may not use this file except in compliance with the License. 3154 * You may obtain a copy of the License at 3155 * 3156 * http://www.apache.org/licenses/LICENSE-2.0 3157 * 3158 * Unless required by applicable law or agreed to in writing, software 3159 * distributed under the License is distributed on an "AS IS" BASIS, 3160 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3161 * See the License for the specific language governing permissions and 3162 * limitations under the License. 3163 */class hw{constructor(e=Promise.resolve()){this.Pu=[],this.Iu=!1,this.Tu=[],this.Eu=null,this.du=!1,this.Au=!1,this.Ru=[],this.t_=new yb(this,"async_queue_retry"),this.Vu=()=>{const e=mb();e&&Pp("AsyncQueue","Visibility state changed to "+e.visibilityState),this.t_.jo()},this.mu=e;const t=mb();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.Vu)}get isShuttingDown(){return this.Iu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.fu(),this.gu(e)}enterRestrictedMode(e){if(!this.Iu){this.Iu=!0,this.Au=e||!1;const t=mb();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.Vu)}}enqueue(e){if(this.fu(),this.Iu)return new Promise(()=>{});const t=new Bp;return this.gu(()=>this.Iu&&this.Au?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Pu.push(e),this.pu()))}async pu(){if(0!==this.Pu.length){try{await this.Pu[0](),this.Pu.shift(),this.t_.reset()}catch(ZNe){if(!dg(ZNe))throw ZNe;Pp("AsyncQueue","Operation failed with retryable error: "+ZNe)}this.Pu.length>0&&this.t_.Go(()=>this.pu())}}gu(e){const t=this.mu.then(()=>(this.du=!0,e().catch(e=>{this.Eu=e,this.du=!1;throw Op("INTERNAL UNHANDLED ERROR: ",function(e){let t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}(e)),e}).then(e=>(this.du=!1,e))));return this.mu=t,t}enqueueAfterDelay(e,t,n){this.fu(),this.Ru.indexOf(e)>-1&&(t=0);const i=Zb.createAndSchedule(this,e,t,n,e=>this.yu(e));return this.Tu.push(i),i}fu(){this.Eu&&Rp()}verifyOperationInProgress(){}async wu(){let e;do{e=this.mu,await e}while(e!==this.mu)}Su(e){for(const t of this.Tu)if(t.timerId===e)return!0;return!1}bu(e){return this.wu().then(()=>{this.Tu.sort((e,t)=>
3163e.targetTimeMs-t.targetTimeMs);for(const t of this.Tu)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.wu()})}Du(e){this.Ru.push(e)}yu(e){const t=this.Tu.indexOf(e);this.Tu.splice(t,1)}}function dw(e){return function(e,t){if("object"!=typeof e||null===e)return!1;const n=e;for(const i of t)if(i in n&&"function"==typeof n[i])return!0;return!1}(e,["next","error","complete"])}class fw extends ow{constructor(e,t,n,i){super(e,t,n,i),this.type="firestore",this._queue=new hw,this._persistenceKey=(null==i?void 0:i.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new hw(e),this._firestoreClient=void 0,await e}}}function pw(e){if(e._terminated)throw new Fp(qp.FAILED_PRECONDITION,"The client has already been terminated.");return e._firestoreClient||function(e){var t,n,i;const a=e._freezeSettings(),o=(s=e._databaseId,r=(null===(t=e._app)||void 0===t?void 0:t.options.appId)||"",l=e._persistenceKey,c=a,new Ng(s,r,l,c.host,c.ssl,c.experimentalForceLongPolling,c.experimentalAutoDetectLongPolling,X_(c.experimentalLongPollingOptions),c.useFetchStreams));var s,r,l,c;e._componentsProvider||(null===(n=a.localCache)||void 0===n?void 0:n._offlineComponentProvider)&&(null===(i=a.localCache)||void 0===i?void 0:i._onlineComponentProvider)&&(e._componentsProvider={_offline:a.localCache._offlineComponentProvider,_online:a.localCache._onlineComponentProvider}),e._firestoreClient=new K_(e._authCredentials,e._appCheckCredentials,e._queue,o,e._componentsProvider&&function(e){const t=null==e?void 0:e._online.build();return{_offline:null==e?void 0:e._offline.build(t),_online:t}}(e._componentsProvider))} 3164/** 3165 * @license 3166 * Copyright 2020 Google LLC 3167 * 3168 * Licensed under the Apache License, Version 2.0 (the "License"); 3169 * you may not use this file except in compliance with the License. 3170 * You may obtain a copy of the License at 3171 * 3172 * http://www.apache.org/licenses/LICENSE-2.0 3173 * 3174 * Unless required by applicable law or agreed to in writing, software 3175 * distributed under the License is distributed on an "AS IS" BASIS, 3176 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3177 * See the License for the specific language governing permissions and 3178 * limitations under the License. 3179 */(e),e._firestoreClient}class gw{constructor(e){this._byteString=e}static fromBase64String(e){try{return new gw(Eg.fromBase64String(e))}catch(t){throw new Fp(qp.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new gw(Eg.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}} 3180/** 3181 * @license 3182 * Copyright 2020 Google LLC 3183 * 3184 * Licensed under the Apache License, Version 2.0 (the "License"); 3185 * you may not use this file except in compliance with the License. 3186 * You may obtain a copy of the License at 3187 * 3188 * http://www.apache.org/licenses/LICENSE-2.0 3189 * 3190 * Unless required by applicable law or agreed to in writing, software 3191 * distributed under the License is distributed on an "AS IS" BASIS, 3192 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3193 * See the License for the specific language governing permissions and 3194 * limitations under the License. 3195 */class mw{constructor(...e){for(let t=0;t<e.length;++t)if(0===e[t].length)throw new Fp(qp.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new ag(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}} 3196/** 3197 * @license 3198 * Copyright 2020 Google LLC 3199 * 3200 * Licensed under the Apache License, Version 2.0 (the "License"); 3201 * you may not use this file except in compliance with the License. 3202 * You may obtain a copy of the License at 3203 * 3204 * http://www.apache.org/licenses/LICENSE-2.0 3205 * 3206 * Unless required by applicable law or agreed to in writing, software 3207 * distributed under the License is distributed on an "AS IS" BASIS, 3208 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3209 * See the License for the specific language governing permissions and 3210 * limitations under the License. 3211 */class vw{constructor(e){this._methodName=e}} 3212/** 3213 * @license 3214 * Copyright 2017 Google LLC 3215 * 3216 * Licensed under the Apache License, Version 2.0 (the "License");
3217 * you may not use this file except in compliance with the License. 3218 * You may obtain a copy of the License at 3219 * 3220 * http://www.apache.org/licenses/LICENSE-2.0 3221 * 3222 * Unless required by applicable law or agreed to in writing, software 3223 * distributed under the License is distributed on an "AS IS" BASIS, 3224 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3225 * See the License for the specific language governing permissions and 3226 * limitations under the License. 3227 */class yw{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new Fp(qp.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new Fp(qp.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return Xp(this._lat,e._lat)||Xp(this._long,e._long)}} 3228/** 3229 * @license 3230 * Copyright 2024 Google LLC 3231 * 3232 * Licensed under the Apache License, Version 2.0 (the "License"); 3233 * you may not use this file except in compliance with the License. 3234 * You may obtain a copy of the License at 3235 * 3236 * http://www.apache.org/licenses/LICENSE-2.0 3237 * 3238 * Unless required by applicable law or agreed to in writing, software 3239 * distributed under the License is distributed on an "AS IS" BASIS, 3240 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3241 * See the License for the specific language governing permissions and 3242 * limitations under the License. 3243 */class bw{constructor(e){this._values=(e||[]).map(e=>e)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}(this._values,e._values)}} 3244/** 3245 * @license 3246 * Copyright 2017 Google LLC 3247 * 3248 * Licensed under the Apache License, Version 2.0 (the "License"); 3249 * you may not use this file except in compliance with the License. 3250 * You may obtain a copy of the License at 3251 * 3252 * http://www.apache.org/licenses/LICENSE-2.0 3253 * 3254 * Unless required by applicable law or agreed to in writing, software 3255 * distributed under the License is distributed on an "AS IS" BASIS, 3256 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3257 * See the License for the specific language governing permissions and 3258 * limitations under the License. 3259 */const _w=/^__.*__$/;class ww{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return null!==this.fieldMask?new Ev(e,this.data,this.fieldMask,t,this.fieldTransforms):new Cv(e,this.data,t,this.fieldTransforms)}}class kw{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return new Ev(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function xw(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Rp()}}class Tw{constructor(e,t,n,i,a,o){this.settings=e,this.databaseId=t,this.serializer=n,this.ignoreUndefinedProperties=i,void 0===a&&this.vu(),this.fieldTransforms=a||[],this.fieldMask=o||[]}get path(){return this.settings.path}get Cu(){return this.settings.Cu}Fu(e){return new Tw(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Mu(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),i=this.Fu({path:n,xu:!1});return i.Ou(e),i}Nu(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),i=this.Fu({path:n,xu:!1});return i.vu(),i}Lu(e){return this.Fu({path:void 0,xu:!0})}Bu(e){return jw(e,this.settings.methodName,this.settings.ku||!1,this.path,this.settings.qu)}contains(e){return void 0!==this.fieldMask.find(t=>e.isPrefixOf(t))||void 0!==this.fieldTransforms.find(t=>e.isPrefixOf(t.field))}vu(){if(this.path)for(let e=0;e<this.path.length;e++)this.Ou(this.path.get(e))}Ou(e){if(0===e.length)throw this.Bu("Document fields must not be empty");if(xw(this.Cu)&&_w.test(e))throw this.Bu('Document fields cannot begin and end with "__"')}}class Cw{constructor(e,t,n){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer
3259=n||vb(e)}Qu(e,t,n,i=!1){return new Tw({Cu:e,methodName:t,qu:n,path:ag.emptyPath(),xu:!1,ku:i},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function Ew(e){const t=e._freezeSettings(),n=vb(e._databaseId);return new Cw(e._databaseId,!!t.ignoreUndefinedProperties,n)}function Sw(e,t,n,i,a,o={}){const s=e.Qu(o.merge||o.mergeFields?2:0,t,n,a);qw("Data must be an object, but it was:",s,i);const r=Lw(i,s);let l,c;if(o.merge)l=new Tg(s.fieldMask),c=s.fieldTransforms;else if(o.mergeFields){const e=[];for(const i of o.mergeFields){const a=Fw(t,i,n);if(!s.contains(a))throw new Fp(qp.INVALID_ARGUMENT,"Field '".concat(a,"' is specified in your field mask but missing from your input data."));Hw(e,a)||e.push(a)}l=new Tg(e),c=s.fieldTransforms.filter(e=>l.covers(e.field))}else l=null,c=s.fieldTransforms;return new ww(new Jg(r),l,c)}class Iw extends vw{_toFieldTransform(e){if(2!==e.Cu)throw 1===e.Cu?e.Bu("".concat(this._methodName,"() can only appear at the top level of your update data")):e.Bu("".concat(this._methodName,"() cannot be used with set() unless you pass {merge:true}"));return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof Iw}}function Aw(e,t,n){return new Tw({Cu:3,qu:t.settings.qu,methodName:e._methodName,xu:n},t.databaseId,t.serializer,t.ignoreUndefinedProperties)}class Dw extends vw{_toFieldTransform(e){return new gv(e.path,new rv)}isEqual(e){return e instanceof Dw}}class Pw extends vw{constructor(e,t){super(e),this.Ku=t}_toFieldTransform(e){const t=Aw(this,e,!0),n=this.Ku.map(e=>Rw(e,t)),i=new lv(n);return new gv(e.path,i)}isEqual(e){return e instanceof Pw&&Cc(this.Ku,e.Ku)}}class Ow extends vw{constructor(e,t){super(e),this.Ku=t}_toFieldTransform(e){const t=Aw(this,e,!0),n=this.Ku.map(e=>Rw(e,t)),i=new uv(n);return new gv(e.path,i)}isEqual(e){return e instanceof Ow&&Cc(this.Ku,e.Ku)}}class Mw extends vw{constructor(e,t){super(e),this.$u=t}_toFieldTransform(e){const t=new dv(e.serializer,nv(e.serializer,this.$u));return new gv(e.path,t)}isEqual(e){return e instanceof Mw&&this.$u===e.$u}}function Nw(e,t,n,i=!1){return Rw(n,e.Qu(i?4:3,t))}function Rw(e,t){if(Vw(e=Rc(e)))return qw("Unsupported field value:",t,e),Lw(e,t);if(e instanceof vw)return function(e,t){if(!xw(t.Cu))throw t.Bu("".concat(e._methodName,"() can only be used with update() and set()"));if(!t.path)throw t.Bu("".concat(e._methodName,"() is not currently supported inside arrays"));const n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.xu&&4!==t.Cu)throw t.Bu("Nested arrays are not supported");return function(e,t){const n=[];let i=0;for(const a of e){let e=Rw(a,t.Lu(i));null==e&&(e={nullValue:"NULL_VALUE"}),n.push(e),i++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===(e=Rc(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return nv(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){const n=Zp.fromDate(e);return{timestampValue:ay(t.serializer,n)}}if(e instanceof Zp){const n=new Zp(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:ay(t.serializer,n)}}if(e instanceof yw)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof gw)return{bytesValue:oy(t.serializer,e._byteString)};if(e instanceof rw){const n=t.databaseId,i=e.firestore._databaseId;if(!i.isEqual(n))throw t.Bu("Document reference is for database ".concat(i.projectId,"/").concat(i.database," but should be for database ").concat(n.projectId,"/").concat(n.database));return{referenceValue:ly(e.firestore._databaseId||t.databaseId,e._key.path)}}if(e instanceof bw)return n=t,{mapValue:{fields:{__type__:{stringValue:"__vector__"},value:{arrayValue:{values:e.toArray().map(e=>{if("number"!=typeof e)throw n.Bu("VectorValues must only contain numeric values.");return ev(n.serializer,e)})}}}}};var n;throw t.Bu("Unsupported field value: ".concat(nw(e)))}(e,t)}function Lw(e,t){const n={};return yg(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):vg(e,(e,i)=>{const a=Rw(i,t.Mu(e));null!=a&&(n[e]=a)}),{mapValue:{fields:n}}}function Vw(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof Zp||e instanceof yw||e instanceof gw||e instanceof rw||e instanceof vw||e instanceof bw)}
3259function qw(e,t,n){if(!Vw(n)||("object"!=typeof(i=n)||null===i||Object.getPrototypeOf(i)!==Object.prototype&&null!==Object.getPrototypeOf(i))){const i=nw(n);throw"an object"===i?t.Bu(e+" a custom object"):t.Bu(e+" "+i)}var i}function Fw(e,t,n){if((t=Rc(t))instanceof mw)return t._internalPath;if("string"==typeof t)return Uw(e,t);throw jw("Field path arguments must be of type string or ",e,!1,void 0,n)}const Bw=new RegExp("[~\\*/\\[\\]]");function Uw(e,t,n){if(t.search(Bw)>=0)throw jw("Invalid field path (".concat(t,"). Paths must not contain '~', '*', '/', '[', or ']'"),e,!1,void 0,n);try{return new mw(...t.split("."))._internalPath}catch(i){throw jw("Invalid field path (".concat(t,"). Paths must not be empty, begin with '.', end with '.', or contain '..'"),e,!1,void 0,n)}}function jw(e,t,n,i,a){const o=i&&!i.isEmpty(),s=void 0!==a;let r="Function ".concat(t,"() called with invalid data");n&&(r+=" (via `toFirestore()`)"),r+=". ";let l="";return(o||s)&&(l+=" (found",o&&(l+=" in field ".concat(i)),s&&(l+=" in document ".concat(a)),l+=")"),new Fp(qp.INVALID_ARGUMENT,r+e+l)}function Hw(e,t){return e.some(e=>e.isEqual(t))} 3260/** 3261 * @license 3262 * Copyright 2020 Google LLC 3263 * 3264 * Licensed under the Apache License, Version 2.0 (the "License"); 3265 * you may not use this file except in compliance with the License. 3266 * You may obtain a copy of the License at 3267 * 3268 * http://www.apache.org/licenses/LICENSE-2.0 3269 * 3270 * Unless required by applicable law or agreed to in writing, software 3271 * distributed under the License is distributed on an "AS IS" BASIS, 3272 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3273 * See the License for the specific language governing permissions and 3274 * limitations under the License. 3275 */class zw{constructor(e,t,n,i,a){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=i,this._converter=a}get id(){return this._key.path.lastSegment()}get ref(){return new rw(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new Ww(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(Kw("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class Ww extends zw{data(){return super.data()}}function Kw(e,t){return"string"==typeof t?Uw(e,t):t instanceof mw?t._internalPath:t._delegate._internalPath} 3276/** 3277 * @license 3278 * Copyright 2020 Google LLC 3279 * 3280 * Licensed under the Apache License, Version 2.0 (the "License"); 3281 * you may not use this file except in compliance with the License. 3282 * You may obtain a copy of the License at 3283 * 3284 * http://www.apache.org/licenses/LICENSE-2.0 3285 * 3286 * Unless required by applicable law or agreed to in writing, software 3287 * distributed under the License is distributed on an "AS IS" BASIS, 3288 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3289 * See the License for the specific language governing permissions and 3290 * limitations under the License. 3291 */function Gw(e){if("L"===e.limitType&&0===e.explicitOrderBy.length)throw new Fp(qp.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class Yw{}class Qw extends Yw{}function $w(e,t,...n){let i=[];t instanceof Yw&&i.push(t),i=i.concat(n),function(e){const t=e.filter(e=>e instanceof Zw).length,n=e.filter(e=>e instanceof Xw).length;if(t>1||t>0&&n>0)throw new Fp(qp.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(i);for(const a of i)e=a._apply(e);return e}class Xw extends Qw{constructor(e,t,n){super(),this._field=e,this._op=t,this._value=n,this.type="where"}static _create(e,t,n){return new Xw(e,t,n)}_apply(e){const t=this._parse(e);return lk(e._query,t),new sw(e.firestore,e.converter,Mm(e._query,t))}_parse(e){const t=Ew(e.firestore);return function(e,t,n,i,a,o,s){let r;
3291if(a.isKeyField()){if("array-contains"===o||"array-contains-any"===o)throw new Fp(qp.INVALID_ARGUMENT,"Invalid Query. You can't perform '".concat(o,"' queries on documentId()."));if("in"===o||"not-in"===o){rk(s,o);const t=[];for(const n of s)t.push(sk(i,e,n));r={arrayValue:{values:t}}}else r=sk(i,e,s)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||rk(s,o),r=Nw(n,t,s,"in"===o||"not-in"===o);return rm.create(a,o,r)}(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}}function Jw(e,t,n){const i=t,a=Kw("where",e);return Xw._create(a,i,n)}class Zw extends Yw{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new Zw(e,t)}_parse(e){const t=this._queryConstraints.map(t=>t._parse(e)).filter(e=>e.getFilters().length>0);return 1===t.length?t[0]:lm.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return 0===t.getFilters().length?e:(function(e,t){let n=e;const i=t.getFlattenedFilters();for(const a of i)lk(n,a),n=Mm(n,a)}(e._query,t),new sw(e.firestore,e.converter,Mm(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return"and"===this.type?"and":"or"}}class ek extends Qw{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new ek(e,t)}_apply(e){const t=function(e,t,n){if(null!==e.startAt)throw new Fp(qp.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new Fp(qp.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new am(t,n)}(e._query,this._field,this._direction);return new sw(e.firestore,e.converter,function(e,t){const n=e.explicitOrderBy.concat([t]);return new Sm(e.path,e.collectionGroup,n,e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(e._query,t))}}function tk(e,t="asc"){const n=t,i=Kw("orderBy",e);return ek._create(i,n)}class nk extends Qw{constructor(e,t,n){super(),this.type=e,this._limit=t,this._limitType=n}static _create(e,t,n){return new nk(e,t,n)}_apply(e){return new sw(e.firestore,e.converter,Nm(e._query,this._limit,this._limitType))}}function ik(e){return function(e,t){if(t<=0)throw new Fp(qp.INVALID_ARGUMENT,"Function ".concat(e,"() requires a positive number, but it was: ").concat(t,"."))}("limit",e),nk._create("limit",e,"F")}class ak extends Qw{constructor(e,t,n){super(),this.type=e,this._docOrFields=t,this._inclusive=n}static _create(e,t,n){return new ak(e,t,n)}_apply(e){const t=function(e,t,n,i){if(n[0]=Rc(n[0]),n[0]instanceof zw)return function(e,t,n,i,a){if(!i)throw new Fp(qp.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for ".concat(n,"()."));const o=[];for(const s of Pm(e))if(s.field.isKeyField())o.push(Wg(t,i.key));else{const e=i.data.field(s.field);if(Pg(e))throw new Fp(qp.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+s.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===e){const e=s.field.canonicalString();throw new Fp(qp.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '".concat(e,"' (used as the orderBy) does not exist."))}o.push(e)}return new tm(o,a)}(e._query,e.firestore._databaseId,t,n[0]._document,i);{const a=Ew(e.firestore);return function(e,t,n,i,a,o){const s=e.explicitOrderBy;if(a.length>s.length)throw new Fp(qp.INVALID_ARGUMENT,"Too many arguments provided to ".concat(i,"(). The number of arguments must be less than or equal to the number of orderBy() clauses"));const r=[];for(let l=0;l<a.length;l++){const o=a[l];if(s[l].field.isKeyField()){if("string"!=typeof o)throw new Fp(qp.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in ".concat(i,"(), but got a ").concat(typeof o));if(!Dm(e)&&-1!==o.indexOf("/"))throw new Fp(qp.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by documentId(), the value passed to ".concat(i,"() must be a plain document ID, but '").concat(o,"' contains a slash."));const n=e.path.child(ng.fromString(o));if(!og.isDocumentKey(n))throw new Fp(qp.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by documentId(), the value passed to ".concat(i,"() must result in a valid document path, but '").concat(n,"' is not because it c
3291ontains an odd number of segments."));const a=new og(n);r.push(Wg(t,a))}else{const e=Nw(n,i,o);r.push(e)}}return new tm(r,o)}(e._query,e.firestore._databaseId,a,t,n,i)}}(e,this.type,this._docOrFields,this._inclusive);return new sw(e.firestore,e.converter,(n=e._query,i=t,new Sm(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),n.limit,n.limitType,i,n.endAt)));var n,i}}function ok(...e){return ak._create("startAfter",e,!1)}function sk(e,t,n){if("string"==typeof(n=Rc(n))){if(""===n)throw new Fp(qp.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!Dm(t)&&-1!==n.indexOf("/"))throw new Fp(qp.INVALID_ARGUMENT,"Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '".concat(n,"' contains a '/' character."));const i=t.path.child(ng.fromString(n));if(!og.isDocumentKey(i))throw new Fp(qp.INVALID_ARGUMENT,"Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '".concat(i,"' is not because it has an odd number of segments (").concat(i.length,")."));return Wg(e,new og(i))}if(n instanceof rw)return Wg(e,n._key);throw new Fp(qp.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ".concat(nw(n),"."))}function rk(e,t){if(!Array.isArray(e)||0===e.length)throw new Fp(qp.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '".concat(t.toString(),"' filters."))}function lk(e,t){const n=function(e,t){for(const n of e)for(const e of n.getFlattenedFilters())if(t.indexOf(e.op)>=0)return e.op;return null}(e.filters,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==n)throw n===t.op?new Fp(qp.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '".concat(t.op.toString(),"' filter.")):new Fp(qp.INVALID_ARGUMENT,"Invalid query. You cannot use '".concat(t.op.toString(),"' filters with '").concat(n.toString(),"' filters."))}class ck{convertValue(e,t="none"){switch(Vg(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Ag(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(Dg(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw Rp()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const n={};return vg(e,(e,i)=>{n[e]=this.convertValue(i,t)}),n}convertVectorValue(e){var t,n,i;const a=null===(i=null===(n=null===(t=e.fields)||void 0===t?void 0:t.value.arrayValue)||void 0===n?void 0:n.values)||void 0===i?void 0:i.map(e=>Ag(e.doubleValue));return new bw(a)}convertGeoPoint(e){return new yw(Ag(e.latitude),Ag(e.longitude))}convertArray(e,t){return(e.values||[]).map(e=>this.convertValue(e,t))}convertServerTimestamp(e,t){switch(t){case"previous":const n=Og(e);return null==n?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(Mg(e));default:return null}}convertTimestamp(e){const t=Ig(e);return new Zp(t.seconds,t.nanos)}convertDocumentKey(e,t){const n=ng.fromString(e);Lp(Iy(n));const i=new Rg(n.get(1),n.get(3)),a=new og(n.popFirst(5));return i.isEqual(t)||Op("Document ".concat(a," contains a document reference within a different database (").concat(i.projectId,"/").concat(i.database,") which is not supported. It will be treated as a reference in the current database (").concat(t.projectId,"/").concat(t.database,") instead.")),a}} 3292/** 3293 * @license 3294 * Copyright 2020 Google LLC 3295 * 3296 * Licensed under the Apache License, Version 2.0 (the "License"); 3297 * you may not use this file except in compliance with the License. 3298 * You may obtain a copy of the License at 3299 * 3300 * http://www.apache.org/licenses/LICENSE-2.0 3301 * 3302 * Unless required by applicable law or agreed to in writing, softw
3302are 3303 * distributed under the License is distributed on an "AS IS" BASIS, 3304 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3305 * See the License for the specific language governing permissions and 3306 * limitations under the License. 3307 */function uk(e,t,n){let i;return i=e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t,i 3308/** 3309 * @license 3310 * Copyright 2020 Google LLC 3311 * 3312 * Licensed under the Apache License, Version 2.0 (the "License"); 3313 * you may not use this file except in compliance with the License. 3314 * You may obtain a copy of the License at 3315 * 3316 * http://www.apache.org/licenses/LICENSE-2.0 3317 * 3318 * Unless required by applicable law or agreed to in writing, software 3319 * distributed under the License is distributed on an "AS IS" BASIS, 3320 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3321 * See the License for the specific language governing permissions and 3322 * limitations under the License. 3323 */}class hk{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class dk extends zw{constructor(e,t,n,i,a,o){super(e,t,n,i,o),this._firestore=e,this._firestoreImpl=e,this.metadata=a}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new fk(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const n=this._document.data.field(Kw("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}}class fk extends dk{data(e={}){return super.data(e)}}class pk{constructor(e,t,n,i){this._firestore=e,this._userDataWriter=t,this._snapshot=i,this.metadata=new hk(i.hasPendingWrites,i.fromCache),this.query=n}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(n=>{e.call(t,new fk(this._firestore,this._userDataWriter,n.key,n,new hk(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new Fp(qp.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){let t=0;return e._snapshot.docChanges.map(n=>{const i=new fk(e._firestore,e._userDataWriter,n.doc.key,n.doc,new hk(e._snapshot.mutatedKeys.has(n.doc.key),e._snapshot.fromCache),e.query.converter);return n.doc,{type:"added",doc:i,oldIndex:-1,newIndex:t++}})}{let n=e._snapshot.oldDocs;return e._snapshot.docChanges.filter(e=>t||3!==e.type).map(t=>{const i=new fk(e._firestore,e._userDataWriter,t.doc.key,t.doc,new hk(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter);let a=-1,o=-1;return 0!==t.type&&(a=n.indexOf(t.doc.key),n=n.delete(t.doc.key)),1!==t.type&&(n=n.add(t.doc),o=n.indexOf(t.doc.key)),{type:gk(t.type),doc:i,oldIndex:a,newIndex:o}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}function gk(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Rp()}} 3324/** 3325 * @license 3326 * Copyright 2020 Google LLC 3327 * 3328 * Licensed under the Apache License, Version 2.0 (the "License"); 3329 * you may not use this file except in compliance with the License. 3330 * You may obtain a copy of the License at 3331 * 3332 * http://www.apache.org/licenses/LICENSE-2.0 3333 * 3334 * Unless required by applicable law or agreed to in writing, software 3335 * distributed under the License is distributed on an "AS IS" BASIS, 3336 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3337 * See the License for the specific language governing permissions and 3338 * limitations under the License. 3339 */function mk(e){e=iw(e,rw);const t=iw(e.firestore,fw);return function(e,t,n={}){const i=new Bp;return e.asyncQueue.enqueueAndForget(async()=>function(e,t,n,i,a){const o=new W_({next:r=>{o.Za(),t.enqueueAndForget(()=>l_(e,s));const l=r.docs.has(n);!l&&r.fromCache?a.reject(new Fp(qp.UNAVAILABLE,"Failed to get document because the client is offline.")):l&&r.fromCache&&i&&"server"===i.source?a.reject(new Fp(qp.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):a.resolve(r)},error:e=>a.reject(e)}),s=new p_(Im(n.path),o,{includeMetadataChanges:!0,_a:!0});return r_(e,s)}(await $_(e),e.asyncQueue,t,n,i)),i.promise}(pw(t),e._key).then(n=>Ck(t,e,n))}class vk extends ck{constructor(e){super(),this.firestore=e}convertBytes(e){return new gw(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);
3339return new rw(this.firestore,null,t)}}function yk(e){e=iw(e,sw);const t=iw(e.firestore,fw),n=pw(t),i=new vk(t);return Gw(e._query),function(e,t,n={}){const i=new Bp;return e.asyncQueue.enqueueAndForget(async()=>function(e,t,n,i,a){const o=new W_({next:n=>{o.Za(),t.enqueueAndForget(()=>l_(e,s)),n.fromCache&&"server"===i.source?a.reject(new Fp(qp.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):a.resolve(n)},error:e=>a.reject(e)}),s=new p_(n,o,{includeMetadataChanges:!0,_a:!0});return r_(e,s)}(await $_(e),e.asyncQueue,t,n,i)),i.promise}(n,e._query).then(n=>new pk(t,i,e,n))}function bk(e,t,n){e=iw(e,rw);const i=iw(e.firestore,fw),a=uk(e.converter,t,n);return Tk(i,[Sw(Ew(i),"setDoc",e._key,a,null!==e.converter,n).toMutation(e._key,vv.none())])}function _k(e,t,n,...i){e=iw(e,rw);const a=iw(e.firestore,fw),o=Ew(a);let s;return s="string"==typeof(t=Rc(t))||t instanceof mw?function(e,t,n,i,a,o){const s=e.Qu(1,t,n),r=[Fw(t,i,n)],l=[a];if(o.length%2!=0)throw new Fp(qp.INVALID_ARGUMENT,"Function ".concat(t,"() needs to be called with an even number of arguments that alternate between field names and values."));for(let d=0;d<o.length;d+=2)r.push(Fw(t,o[d])),l.push(o[d+1]);const c=[],u=Jg.empty();for(let d=r.length-1;d>=0;--d)if(!Hw(c,r[d])){const e=r[d];let t=l[d];t=Rc(t);const n=s.Nu(e);if(t instanceof Iw)c.push(e);else{const i=Rw(t,n);null!=i&&(c.push(e),u.set(e,i))}}const h=new Tg(c);return new kw(u,h,s.fieldTransforms)}(o,"updateDoc",e._key,t,n,i):function(e,t,n,i){const a=e.Qu(1,t,n);qw("Data must be an object, but it was:",a,i);const o=[],s=Jg.empty();vg(i,(e,i)=>{const r=Uw(t,e,n);i=Rc(i);const l=a.Nu(r);if(i instanceof Iw)o.push(r);else{const e=Rw(i,l);null!=e&&(o.push(r),s.set(r,e))}});const r=new Tg(o);return new kw(s,r,a.fieldTransforms)}(o,"updateDoc",e._key,t),Tk(a,[s.toMutation(e._key,vv.exists(!0))])}function wk(e){return Tk(iw(e.firestore,fw),[new Dv(e._key,vv.none())])}function kk(e,t){const n=iw(e.firestore,fw),i=uw(e),a=uk(e.converter,t);return Tk(n,[Sw(Ew(e.firestore),"addDoc",i._key,a,null!==e.converter,{}).toMutation(i._key,vv.exists(!1))]).then(()=>i)}function xk(e,...t){var n,i,a;e=Rc(e);let o={includeMetadataChanges:!1,source:"default"},s=0;"object"!=typeof t[s]||dw(t[s])||(o=t[s],s++);const r={includeMetadataChanges:o.includeMetadataChanges,source:o.source};if(dw(t[s])){const e=t[s];t[s]=null===(n=e.next)||void 0===n?void 0:n.bind(e),t[s+1]=null===(i=e.error)||void 0===i?void 0:i.bind(e),t[s+2]=null===(a=e.complete)||void 0===a?void 0:a.bind(e)}let l,c,u;if(e instanceof rw)c=iw(e.firestore,fw),u=Im(e._key.path),l={next:n=>{t[s]&&t[s](Ck(c,e,n))},error:t[s+1],complete:t[s+2]};else{const n=iw(e,sw);c=iw(n.firestore,fw),u=n._query;const i=new vk(c);l={next:e=>{t[s]&&t[s](new pk(c,i,n,e))},error:t[s+1],complete:t[s+2]},Gw(e._query)}return function(e,t,n,i){const a=new W_(i),o=new p_(t,a,n);return e.asyncQueue.enqueueAndForget(async()=>r_(await $_(e),o)),()=>{a.Za(),e.asyncQueue.enqueueAndForget(async()=>l_(await $_(e),o))}}(pw(c),u,r,l)}function Tk(e,t){return function(e,t){const n=new Bp;return e.asyncQueue.enqueueAndForget(async()=>E_(await function(e){return Q_(e).then(e=>e.syncEngine)}(e),t,n)),n.promise}(pw(e),t)}function Ck(e,t,n){const i=n.docs.get(t._key),a=new vk(e);return new dk(e,a,t._key,i,new hk(n.hasPendingWrites,n.fromCache),t.converter)}function Ek(){return new Dw("serverTimestamp")}function Sk(...e){return new Pw("arrayUnion",e)}function Ik(...e){return new Ow("arrayRemove",e)}function Ak(e){return new Mw("increment",e)}!function(e,t=!0){Ip=Ju,Gu(new Lc("firestore",(e,{instanceIdentifier:n,options:i})=>{const a=e.getProvider("app").getImmediate(),o=new fw(new zp(e.getProvider("auth-internal")),new Yp(e.getProvider("app-check-internal")),function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new Fp(qp.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Rg(e.options.projectId,t)}(a,n),a);return i=Object.assign({useFetchStreams:t},i),o._setSettings(i),o},"PUBLIC").setMultipleInstances(!0)),th(Ep,"4.7.3",e),th(Ep,"4.7.3","esm2017")}();function Dk(e,t){const n={};for(const i in e)e.hasOwnProperty(i)&&(n[i]=t(e[i]));return n}function Pk(e){if(null==e)return null;if(e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&isFinite(e))return e;if(!0===e||!1===e)return e;if("[object String]"===Object.prototype.toString.call(e))return e;if(e instanceof Date)return e.toISOString();if(Array.isArray(e))return e.map(e=>Pk(e));if("function"==typeof e||"object"==typeof e)return Dk(e,e=>Pk(e));throw new Error("Data cannot be encoded in JSON: "+e)}function Ok(e){if(null==e)return e;if(e["@type"])switch(e["@type"]){case"type.googleapis.com/google.protobuf.Int64Value":case"type.googleapis.com/google.protobuf.UInt64Value":{const t=Number(e.value);if(isNaN(t))throw new Error("Data cannot be decoded from JSON: "+e);return t}default:throw new Error("Data cannot be decoded from JSON: "+e)}return Array.isArray(e)?e.map(e=>Ok(e)):"function"==typeof e||"object"==typeof e?Dk(e,e=>Ok(e)):e} 3340/** 3341 * @license 3342 * Copyright 2020 Google LLC 3343 * 3344 * Licensed under the Apache License, Version 2.0 (the "License");
3345 * you may not use this file except in compliance with the License. 3346 * You may obtain a copy of the License at 3347 * 3348 * http://www.apache.org/licenses/LICENSE-2.0 3349 * 3350 * Unless required by applicable law or agreed to in writing, software 3351 * distributed under the License is distributed on an "AS IS" BASIS, 3352 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3353 * See the License for the specific language governing permissions and 3354 * limitations under the License. 3355 */const Mk="functions",Nk={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"}; 3356/** 3357 * @license 3358 * Copyright 2017 Google LLC 3359 * 3360 * Licensed under the Apache License, Version 2.0 (the "License"); 3361 * you may not use this file except in compliance with the License. 3362 * You may obtain a copy of the License at 3363 * 3364 * http://www.apache.org/licenses/LICENSE-2.0 3365 * 3366 * Unless required by applicable law or agreed to in writing, software 3367 * distributed under the License is distributed on an "AS IS" BASIS, 3368 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3369 * See the License for the specific language governing permissions and 3370 * limitations under the License. 3371 */class Rk extends gc{constructor(e,t,n){super("".concat(Mk,"/").concat(e),t||""),this.details=n}} 3372/** 3373 * @license 3374 * Copyright 2017 Google LLC 3375 * 3376 * Licensed under the Apache License, Version 2.0 (the "License"); 3377 * you may not use this file except in compliance with the License. 3378 * You may obtain a copy of the License at 3379 * 3380 * http://www.apache.org/licenses/LICENSE-2.0 3381 * 3382 * Unless required by applicable law or agreed to in writing, software 3383 * distributed under the License is distributed on an "AS IS" BASIS, 3384 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3385 * See the License for the specific language governing permissions and 3386 * limitations under the License. 3387 */ 3388class Lk{constructor(e,t,n){this.auth=null,this.messaging=null,this.appCheck=null,this.auth=e.getImmediate({optional:!0}),this.messaging=t.getImmediate({optional:!0}),this.auth||e.get().then(e=>this.auth=e,()=>{}),this.messaging||t.get().then(e=>this.messaging=e,()=>{}),this.appCheck||n.get().then(e=>this.appCheck=e,()=>{})}async getAuthToken(){if(this.auth)try{const e=await this.auth.getToken();return null==e?void 0:e.accessToken}catch(ZNe){return}}async getMessagingToken(){if(this.messaging&&"Notification"in self&&"granted"===Notification.permission)try{return await this.messaging.getToken()}catch(ZNe){return}}async getAppCheckToken(e){if(this.appCheck){const t=e?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return t.error?null:t.token}return null}async getContext(e){return{authToken:await this.getAuthToken(),messagingToken:await this.getMessagingToken(),appCheckToken:await this.getAppCheckToken(e)}}} 3389/** 3390 * @license 3391 * Copyright 2017 Google LLC 3392 * 3393 * Licensed under the Apache License, Version 2.0 (the "License"); 3394 * you may not use this file except in compliance with the License. 3395 * You may obtain a copy of the License at 3396 * 3397 * http://www.apache.org/licenses/LICENSE-2.0 3398 * 3399 * Unless required by applicable law or agreed to in writing, software 3400 * distributed under the License is distributed on an "AS IS" BASIS, 3401 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3402 * See the License for the specific language governing permissions and 3403 * limitations under the License. 3404 */const Vk="us-central1";class qk{constructor(e,t,n,i,a=Vk,o){this.app=e,this.fetchImpl=o,this.emulatorOrigin=null,this.contextProvider=new Lk(t,n,i),this.cancelAllRequests=new Promise(e=>{this.deleteService=()=>Promise.resolve(e())});try{const e=new URL(a);this.customDomain=e.origin+("/"===e.pathname?"":e.pathname),this.region=Vk}catch(ZNe){this.customDomain=null,this.region=a}}_delete(){return this.deleteService()}_url(e){const t=this.app.options.projectId;if(null!==this.emulatorOrigin){const n=this.emulatorOrigin;return"".concat(n,"/").concat(t,"/").concat(this.region,"/").concat(e)}return null!==this.customDomain?"".concat(this.customDomain,"/").concat(e):"https://".concat(this.region,"-").concat(t,".cloudfunctions.net/").concat(e)}}function Fk(e,t,n){return n=>function(e,t,n,i){const a=e._url(t);return async function(e,t,n,i){n=Pk(n);const a={data:n},o={},s=await e.contextProvider.getContext(i.limitedUseAppCheckTokens);s.authToken&&(o.Authorization="Bearer "+s.authToken);
3404s.messagingToken&&(o["Firebase-Instance-ID-Token"]=s.messagingToken);null!==s.appCheckToken&&(o["X-Firebase-AppCheck"]=s.appCheckToken);const r=i.timeout||7e4,l=function(e){let t=null;return{promise:new Promise((n,i)=>{t=setTimeout(()=>{i(new Rk("deadline-exceeded","deadline-exceeded"))},e)}),cancel:()=>{t&&clearTimeout(t)}}}(r),c=await Promise.race([Bk(t,a,o,e.fetchImpl),l.promise,e.cancelAllRequests]);if(l.cancel(),!c)throw new Rk("cancelled","Firebase Functions instance was deleted.");const u=function(e,t){let n,i=function(e){if(e>=200&&e<300)return"ok";switch(e){case 0:case 500:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(e),a=i;try{const e=t&&t.error;if(e){const t=e.status;if("string"==typeof t){if(!Nk[t])return new Rk("internal","internal");i=Nk[t],a=t}const o=e.message;"string"==typeof o&&(a=o),n=e.details,void 0!==n&&(n=Ok(n))}}catch(ZNe){}return"ok"===i?null:new Rk(i,a,n)}(c.status,c.json);if(u)throw u;if(!c.json)throw new Rk("internal","Response is not valid JSON object.");let h=c.json.data;void 0===h&&(h=c.json.result);if(void 0===h)throw new Rk("internal","Response is missing data field.");return{data:Ok(h)}}(e,a,n,i)}(e,t,n,{})}async function Bk(e,t,n,i){let a;n["Content-Type"]="application/json";try{a=await i(e,{method:"POST",body:JSON.stringify(t),headers:n})}catch(ZNe){return{status:0,json:null}}let o=null;try{o=await a.json()}catch(ZNe){}return{status:a.status,json:o}}const Uk="@firebase/functions",jk="0.11.8"; 3405/** 3406 * @license 3407 * Copyright 2020 Google LLC 3408 * 3409 * Licensed under the Apache License, Version 2.0 (the "License"); 3410 * you may not use this file except in compliance with the License. 3411 * You may obtain a copy of the License at 3412 * 3413 * http://www.apache.org/licenses/LICENSE-2.0 3414 * 3415 * Unless required by applicable law or agreed to in writing, software 3416 * distributed under the License is distributed on an "AS IS" BASIS, 3417 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3418 * See the License for the specific language governing permissions and 3419 * limitations under the License. 3420 */ 3421function Hk(e=eh(),t=Vk){const n=Yu(Rc(e),Mk).getImmediate({identifier:t}),i=tc("functions");return i&&function(e,t,n){!function(e,t,n){e.emulatorOrigin="http://".concat(t,":").concat(n)}(Rc(e),t,n)}(n,...i),n}!function(e,t){Gu(new Lc(Mk,(t,{instanceIdentifier:n})=>{const i=t.getProvider("app").getImmediate(),a=t.getProvider("auth-internal"),o=t.getProvider("messaging-internal"),s=t.getProvider("app-check-internal");return new qk(i,a,o,s,n,e)},"PUBLIC").setMultipleInstances(!0)),th(Uk,jk,t),th(Uk,jk,"esm2017")}(fetch.bind(self));const zk="@firebase/installations",Wk="0.6.9",Kk=1e4,Gk="w:".concat(Wk),Yk="FIS_v2",Qk=36e5,$k=new mc("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function Xk(e){return e instanceof gc&&e.code.includes("request-failed")} 3422/** 3423 * @license 3424 * Copyright 2019 Google LLC 3425 * 3426 * Licensed under the Apache License, Version 2.0 (the "License"); 3427 * you may not use this file except in compliance with the License. 3428 * You may obtain a copy of the License at 3429 * 3430 * http://www.apache.org/licenses/LICENSE-2.0 3431 * 3432 * Unless required by applicable law or agreed to in writing, software 3433 * distributed under the License is distributed on an "AS IS" BASIS, 3434 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3435 * See the License for the specific language governing permissions and 3436 * limitations under the License. 3437 */function Jk({projectId:e}){return"".concat("https://firebaseinstallations.googleapis.com/v1","/projects/").concat(e,"/installations")}
3437function Zk(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function ex(e,t){const n=(await t.json()).error;return $k.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function tx({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function nx(e,{refreshToken:t}){const n=tx(e);return n.append("Authorization",function(e){return"".concat(Yk," ").concat(e)} 3438/** 3439 * @license 3440 * Copyright 2019 Google LLC 3441 * 3442 * Licensed under the Apache License, Version 2.0 (the "License"); 3443 * you may not use this file except in compliance with the License. 3444 * You may obtain a copy of the License at 3445 * 3446 * http://www.apache.org/licenses/LICENSE-2.0 3447 * 3448 * Unless required by applicable law or agreed to in writing, software 3449 * distributed under the License is distributed on an "AS IS" BASIS, 3450 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3451 * See the License for the specific language governing permissions and 3452 * limitations under the License. 3453 */(t)),n}async function ix(e){const t=await e();return t.status>=500&&t.status<600?e():t} 3454/** 3455 * @license 3456 * Copyright 2019 Google LLC 3457 * 3458 * Licensed under the Apache License, Version 2.0 (the "License"); 3459 * you may not use this file except in compliance with the License. 3460 * You may obtain a copy of the License at 3461 * 3462 * http://www.apache.org/licenses/LICENSE-2.0 3463 * 3464 * Unless required by applicable law or agreed to in writing, software 3465 * distributed under the License is distributed on an "AS IS" BASIS, 3466 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3467 * See the License for the specific language governing permissions and 3468 * limitations under the License. 3469 */ 3470function ax(e){return new Promise(t=>{setTimeout(t,e)})} 3471/** 3472 * @license 3473 * Copyright 2019 Google LLC 3474 * 3475 * Licensed under the Apache License, Version 2.0 (the "License"); 3476 * you may not use this file except in compliance with the License. 3477 * You may obtain a copy of the License at 3478 * 3479 * http://www.apache.org/licenses/LICENSE-2.0 3480 * 3481 * Unless required by applicable law or agreed to in writing, software 3482 * distributed under the License is distributed on an "AS IS" BASIS, 3483 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3484 * See the License for the specific language governing permissions and 3485 * limitations under the License. 3486 */ 3487/** 3488 * @license 3489 * Copyright 2019 Google LLC 3490 * 3491 * Licensed under the Apache License, Version 2.0 (the "License"); 3492 * you may not use this file except in compliance with the License. 3493 * You may obtain a copy of the License at 3494 * 3495 * http://www.apache.org/licenses/LICENSE-2.0 3496 * 3497 * Unless required by applicable law or agreed to in writing, software 3498 * distributed under the License is distributed on an "AS IS" BASIS, 3499 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3500 * See the License for the specific language governing permissions and 3501 * limitations under the License. 3502 */ 3503const ox=/^[cdef][\w-]{21}$/;function sx(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const t=function(e){const t=(n=e,btoa(String.fromCharCode(...n)).replace(/\+/g,"-").replace(/\//g,"_"));var n;return t.substr(0,22)} 3504/** 3505 * @license 3506 * Copyright 2019 Google LLC 3507 * 3508 * Licensed under the Apache License, Version 2.0 (the "License"); 3509 * you may not use this file except in compliance with the License. 3510 * You may obtain a copy of the License at 3511 * 3512 * http://www.apache.org/licenses/LICENSE-2.0 3513 * 3514 * Unless required by applicable law or agreed to in writing, software 3515 * distributed under the License is distributed on an "AS IS" BASIS, 3516 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3517 * See the License for the specific language governing permissions and 3518 * limitations under the License. 3519 */(e);return ox.test(t)?t:""}catch(e){return""}}function rx(e){return"".concat(e.appName,"!").concat(e.appId)} 3520/** 3521 * @license 3522 * Copyright 2019 Google LLC 3523 * 3524 * Licensed under the Apache License, Version 2.0 (the "License");
3525 * you may not use this file except in compliance with the License. 3526 * You may obtain a copy of the License at 3527 * 3528 * http://www.apache.org/licenses/LICENSE-2.0 3529 * 3530 * Unless required by applicable law or agreed to in writing, software 3531 * distributed under the License is distributed on an "AS IS" BASIS, 3532 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3533 * See the License for the specific language governing permissions and 3534 * limitations under the License. 3535 */const lx=new Map;function cx(e,t){const n=rx(e);ux(n,t),function(e,t){const n=function(){!hx&&"BroadcastChannel"in self&&(hx=new BroadcastChannel("[Firebase] FID Change"),hx.onmessage=e=>{ux(e.data.key,e.data.fid)});return hx}();n&&n.postMessage({key:e,fid:t});0===lx.size&&hx&&(hx.close(),hx=null)}(n,t)}function ux(e,t){const n=lx.get(e);if(n)for(const i of n)i(t)}let hx=null; 3536/** 3537 * @license 3538 * Copyright 2019 Google LLC 3539 * 3540 * Licensed under the Apache License, Version 2.0 (the "License"); 3541 * you may not use this file except in compliance with the License. 3542 * You may obtain a copy of the License at 3543 * 3544 * http://www.apache.org/licenses/LICENSE-2.0 3545 * 3546 * Unless required by applicable law or agreed to in writing, software 3547 * distributed under the License is distributed on an "AS IS" BASIS, 3548 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3549 * See the License for the specific language governing permissions and 3550 * limitations under the License. 3551 */ 3552const dx="firebase-installations-store";let fx=null;function px(){return fx||(fx=ou("firebase-installations-database",1,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(dx)}})),fx}async function gx(e,t){const n=rx(e),i=(await px()).transaction(dx,"readwrite"),a=i.objectStore(dx),o=await a.get(n);return await a.put(t,n),await i.done,o&&o.fid===t.fid||cx(e,t.fid),t}async function mx(e){const t=rx(e),n=(await px()).transaction(dx,"readwrite");await n.objectStore(dx).delete(t),await n.done}async function vx(e,t){const n=rx(e),i=(await px()).transaction(dx,"readwrite"),a=i.objectStore(dx),o=await a.get(n),s=t(o);return void 0===s?await a.delete(n):await a.put(s,n),await i.done,!s||o&&o.fid===s.fid||cx(e,s.fid),s} 3553/** 3554 * @license 3555 * Copyright 2019 Google LLC 3556 * 3557 * Licensed under the Apache License, Version 2.0 (the "License"); 3558 * you may not use this file except in compliance with the License. 3559 * You may obtain a copy of the License at 3560 * 3561 * http://www.apache.org/licenses/LICENSE-2.0 3562 * 3563 * Unless required by applicable law or agreed to in writing, software 3564 * distributed under the License is distributed on an "AS IS" BASIS, 3565 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3566 * See the License for the specific language governing permissions and 3567 * limitations under the License. 3568 */async function yx(e){let t;const n=await vx(e.appConfig,n=>{const i=function(e){const t=e||{fid:sx(),registrationStatus:0};return wx(t)}(n),a=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine){return{installationEntry:t,registrationPromise:Promise.reject($k.create("app-offline"))}}const n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},i=async function(e,t){try{const n=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const i=Jk(e),a=tx(e),o=t.getImmediate({optional:!0});if(o){const e=await o.getHeartbeatsHeader();e&&a.append("x-firebase-client",e)}const s={fid:n,authVersion:Yk,appId:e.appId,sdkVersion:Gk},r={method:"POST",headers:a,body:JSON.stringify(s)},l=await ix(()=>fetch(i,r));if(l.ok){const e=await l.json();return{fid:e.fid||n,registrationStatus:2,refreshToken:e.refreshToken,authToken:Zk(e.authToken)}}throw await ex("Create Installation",l)}(e,t);return gx(e.appConfig,n)}catch(ZNe){throw Xk(ZNe)&&409===ZNe.customData.serverCode?await mx(e.appConfig):await gx(e.appConfig,{fid:t.fid,registrationStatus:0}),ZNe}}(e,n);return{installationEntry:n,registrationPromise:i}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:bx(e)}:{installationEntry:t}}(e,i);return t=a.registrationPromise,a.installationEntry});return""===n.fid?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}async function bx(e){let t=await _x(e.appConfig);for(;1===t.registrationStatus;)await ax(100),t=await _x(e.appConfig);if(0===t.registrationStatus){const{installationEntry:t,registrationPromise:n}=await yx(e);return n||t}return t}function _x(e){return vx(e,e=>{if(!e)throw $k.create("installation-not-found");return wx(e)})}function wx(e){return 1===(t=e).registrationStatus&&t.registrationTime+Kk<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t; 3569/** 3570 * @license 3571 * Copyright 2019 Google LLC 3572 * 3573 * Licensed under the Apache License, Version 2.0 (the "License");
3574 * you may not use this file except in compliance with the License. 3575 * You may obtain a copy of the License at 3576 * 3577 * http://www.apache.org/licenses/LICENSE-2.0 3578 * 3579 * Unless required by applicable law or agreed to in writing, software 3580 * distributed under the License is distributed on an "AS IS" BASIS, 3581 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3582 * See the License for the specific language governing permissions and 3583 * limitations under the License. 3584 */}async function kx({appConfig:e,heartbeatServiceProvider:t},n){const i=function(e,{fid:t}){return"".concat(Jk(e),"/").concat(t,"/authTokens:generate")} 3585/** 3586 * @license 3587 * Copyright 2019 Google LLC 3588 * 3589 * Licensed under the Apache License, Version 2.0 (the "License"); 3590 * you may not use this file except in compliance with the License. 3591 * You may obtain a copy of the License at 3592 * 3593 * http://www.apache.org/licenses/LICENSE-2.0 3594 * 3595 * Unless required by applicable law or agreed to in writing, software 3596 * distributed under the License is distributed on an "AS IS" BASIS, 3597 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3598 * See the License for the specific language governing permissions and 3599 * limitations under the License. 3600 */(e,n),a=nx(e,n),o=t.getImmediate({optional:!0});if(o){const e=await o.getHeartbeatsHeader();e&&a.append("x-firebase-client",e)}const s={installation:{sdkVersion:Gk,appId:e.appId}},r={method:"POST",headers:a,body:JSON.stringify(s)},l=await ix(()=>fetch(i,r));if(l.ok){return Zk(await l.json())}throw await ex("Generate Auth Token",l)}async function xx(e,t=!1){let n;const i=await vx(e.appConfig,i=>{if(!Cx(i))throw $k.create("not-registered");const a=i.authToken;if(!t&&function(e){return 2===e.requestStatus&&!function(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+Qk}(e)}(a))return i;if(1===a.requestStatus)return n=async function(e,t){let n=await Tx(e.appConfig);for(;1===n.authToken.requestStatus;)await ax(100),n=await Tx(e.appConfig);const i=n.authToken;return 0===i.requestStatus?xx(e,t):i}(e,t),i;{if(!navigator.onLine)throw $k.create("app-offline");const t=function(e){const t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}(i);return n=async function(e,t){try{const n=await kx(e,t),i=Object.assign(Object.assign({},t),{authToken:n});return await gx(e.appConfig,i),n}catch(ZNe){if(!Xk(ZNe)||401!==ZNe.customData.serverCode&&404!==ZNe.customData.serverCode){const n=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await gx(e.appConfig,n)}else await mx(e.appConfig);throw ZNe}}(e,t),t}});return n?await n:i.authToken}function Tx(e){return vx(e,e=>{if(!Cx(e))throw $k.create("not-registered");const t=e.authToken;return 1===(n=t).requestStatus&&n.requestTime+Kk<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e;var n; 3601/** 3602 * @license 3603 * Copyright 2019 Google LLC 3604 * 3605 * Licensed under the Apache License, Version 2.0 (the "License"); 3606 * you may not use this file except in compliance with the License. 3607 * You may obtain a copy of the License at 3608 * 3609 * http://www.apache.org/licenses/LICENSE-2.0 3610 * 3611 * Unless required by applicable law or agreed to in writing, software 3612 * distributed under the License is distributed on an "AS IS" BASIS, 3613 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3614 * See the License for the specific language governing permissions and 3615 * limitations under the License. 3616 */})}function Cx(e){return void 0!==e&&2===e.registrationStatus} 3617/** 3618 * @license 3619 * Copyright 2019 Google LLC 3620 * 3621 * Licensed under the Apache License, Version 2.0 (the "License"); 3622 * you may not use this file except in compliance with the License. 3623 * You may obtain a copy of the License at 3624 * 3625 * http://www.apache.org/licenses/LICENSE-2.0 3626 * 3627 * Unless required by applicable law or agreed to in writing, software 3628 * distributed under the License is distributed on an "AS IS" BASIS, 3629 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3630 * See the License for the specific language governing permissions and 3631 * limitations under the License. 3632 */ 3633async function Ex(e,t=!1){const n=e;await async function(e){const{registrationPromise:t}=await yx(e);t&&await t} 3634/** 3635 * @license 3636 * Copyright 2019 Google LLC 3637 * 3638 * Licensed under the Apache License, Version 2.0 (the "License");
3639 * you may not use this file except in compliance with the License. 3640 * You may obtain a copy of the License at 3641 * 3642 * http://www.apache.org/licenses/LICENSE-2.0 3643 * 3644 * Unless required by applicable law or agreed to in writing, software 3645 * distributed under the License is distributed on an "AS IS" BASIS, 3646 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3647 * See the License for the specific language governing permissions and 3648 * limitations under the License. 3649 */(n);return(await xx(n,t)).token}function Sx(e){return $k.create("missing-app-config-values",{valueName:e})} 3650/** 3651 * @license 3652 * Copyright 2020 Google LLC 3653 * 3654 * Licensed under the Apache License, Version 2.0 (the "License"); 3655 * you may not use this file except in compliance with the License. 3656 * You may obtain a copy of the License at 3657 * 3658 * http://www.apache.org/licenses/LICENSE-2.0 3659 * 3660 * Unless required by applicable law or agreed to in writing, software 3661 * distributed under the License is distributed on an "AS IS" BASIS, 3662 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3663 * See the License for the specific language governing permissions and 3664 * limitations under the License. 3665 */const Ix="installations",Ax=e=>{const t=e.getProvider("app").getImmediate(),n=function(e){if(!e||!e.options)throw Sx("App Configuration");if(!e.name)throw Sx("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw Sx(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:n,heartbeatServiceProvider:Yu(t,"heartbeat"),_delete:()=>Promise.resolve()}},Dx=e=>{const t=Yu(e.getProvider("app").getImmediate(),Ix).getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:i}=await yx(t);return i?i.catch(console.error):xx(t).catch(console.error),n.fid}(t),getToken:e=>Ex(t,e)}};Gu(new Lc(Ix,Ax,"PUBLIC")),Gu(new Lc("installations-internal",Dx,"PRIVATE")),th(zk,Wk),th(zk,Wk,"esm2017"); 3666/** 3667 * @license 3668 * Copyright 2019 Google LLC 3669 * 3670 * Licensed under the Apache License, Version 2.0 (the "License"); 3671 * you may not use this file except in compliance with the License. 3672 * You may obtain a copy of the License at 3673 * 3674 * http://www.apache.org/licenses/LICENSE-2.0 3675 * 3676 * Unless required by applicable law or agreed to in writing, software 3677 * distributed under the License is distributed on an "AS IS" BASIS, 3678 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3679 * See the License for the specific language governing permissions and 3680 * limitations under the License. 3681 */ 3682const Px="analytics",Ox="https://www.googletagmanager.com/gtag/js",Mx=new Kc("@firebase/analytics"),Nx=new mc("analytics","Analytics",{"already-exists":"A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"no-client-id":'The "client_id" field is empty.',"invali
3682d-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."}); 3683/** 3684 * @license 3685 * Copyright 2019 Google LLC 3686 * 3687 * Licensed under the Apache License, Version 2.0 (the "License"); 3688 * you may not use this file except in compliance with the License. 3689 * You may obtain a copy of the License at 3690 * 3691 * http://www.apache.org/licenses/LICENSE-2.0 3692 * 3693 * Unless required by applicable law or agreed to in writing, software 3694 * distributed under the License is distributed on an "AS IS" BASIS, 3695 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3696 * See the License for the specific language governing permissions and 3697 * limitations under the License. 3698 */ 3699function Rx(e){if(!e.startsWith(Ox)){const t=Nx.create("invalid-gtag-resource",{gtagURL:e});return Mx.warn(t.message),""}return e}function Lx(e){return Promise.all(e.map(e=>e.catch(e=>e)))}function Vx(e,t){const n=function(e,t){let n;return window.trustedTypes&&(n=window.trustedTypes.createPolicy(e,t)),n}("firebase-js-sdk-policy",{createScriptURL:Rx}),i=document.createElement("script"),a="".concat(Ox,"?l=").concat(e,"&id=").concat(t);i.src=n?null==n?void 0:n.createScriptURL(a):a,i.async=!0,document.head.appendChild(i)}function qx(e,t,n,i){return async function(a,...o){try{if("event"===a){const[i,a]=o;await async function(e,t,n,i,a){try{let o=[];if(a&&a.send_to){let e=a.send_to;Array.isArray(e)||(e=[e]);const i=await Lx(n);for(const n of e){const e=i.find(e=>e.measurementId===n),a=e&&t[e.appId];if(!a){o=[];break}o.push(a)}}0===o.length&&(o=Object.values(t)),await Promise.all(o),e("event",i,a||{})}catch(ZNe){Mx.error(ZNe)}}(e,t,n,i,a)}else if("config"===a){const[a,s]=o;await async function(e,t,n,i,a,o){const s=i[a];try{if(s)await t[s];else{const e=(await Lx(n)).find(e=>e.measurementId===a);e&&await t[e.appId]}}catch(ZNe){Mx.error(ZNe)}e("config",a,o)}(e,t,n,i,a,s)}else if("consent"===a){const[t,n]=o;e("consent",t,n)}else if("get"===a){const[t,n,i]=o;e("get",t,n,i)}else if("set"===a){const[t]=o;e("set",t)}else e(a,...o)}catch(ZNe){Mx.error(ZNe)}}}const Fx=new class{constructor(e={},t=1e3){this.throttleMetadata=e,this.intervalMillis=t}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,t){this.throttleMetadata[e]=t}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}};function Bx(e){return new Headers({Accept:"application/json","x-goog-api-key":e})}async function Ux(e,t=Fx,n){const{appId:i,apiKey:a,measurementId:o}=e.options;if(!i)throw Nx.create("no-app-id");if(!a){if(o)return{measurementId:o,appId:i};throw Nx.create("no-api-key")}const s=t.getThrottleMetadata(i)||{backoffCount:0,throttleEndTimeMillis:Date.now()},r=new Hx;return setTimeout(async()=>{r.abort()},6e4),jx({appId:i,apiKey:a,measurementId:o},s,r,t)}async function jx(e,{throttleEndTimeMillis:t,backoffCount:n},i,a=Fx){var o;const{appId:s,measurementId:r}=e;try{await function(e,t){return new Promise((n,i)=>{const a=Math.max(t-Date.now(),0),o=setTimeout(n,a);e.addEventListener(()=>{clearTimeout(o),i(Nx.create("fetch-throttle",{throttleEndTimeMillis:t}))})})}(i,t)}catch(ZNe){if(r)return Mx.warn("Timed out fetching this Firebase app's measurement ID from the server."+" Falling back to the measurement ID ".concat(r)+' provided in the "measurementId" field in the local Firebase config. ['.concat(null==ZNe?void 0:ZNe.message,"]")),{appId:s,measurementId:r};throw ZNe}try{const t=await async function(e){var t;const{appId:n,apiKey:i}=e,a={method:"GET",headers:Bx(i)},o="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",n),s=await fetch(o,a);if(200!==s.status&&304!==s.status){let e="";try{const n=await s.json();(null===(t=n.error)||void 0===t?void 0:t.message)&&(e=n.error.message)}catch(r){}throw Nx.create("config-fetch-failed",{httpStatus:s.status,responseMessage:e})}return s.json()}(e);return a.deleteThrottleMetadata(s),t}catch(ZNe){const l=ZNe;if(!function(e){if(!(e instanceof gc&&e.customData))return!1;const t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(l)){if(a.deleteThrottleMetadata(s),r)return Mx.warn("Failed to fetch this Firebase app's measurement ID from the server."+" Falling back to the measurement ID ".concat(r)+' provided in the "measurementId" field in the local Firebase config. ['.concat(null==l?void 0:l.message,"]")),{appId:s,measurementId:r};throw ZNe}const c=503===Number(null===(o=null==l?void 0:l.customData)||void 0===o?void 0:o.httpStatus)?Nc(n,a.intervalMillis,30):Nc(n,a.intervalMillis),u={throttleEndTimeMillis:Date.now()+c,backoffCount:n+1};return a.setThrottleMetadata(s,u),Mx.debug("Calling attemptFetch again in ".concat(c," millis")),jx(e,u,i,a)}}class Hx{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}
3699abort(){this.listeners.forEach(e=>e())}}async function zx(e,t,n,i,a,o,s){var r;const l=Ux(e);l.then(t=>{n[t.measurementId]=t.appId,e.options.measurementId&&t.measurementId!==e.options.measurementId&&Mx.warn("The measurement ID in the local Firebase config (".concat(e.options.measurementId,")")+" does not match the measurement ID fetched from the server (".concat(t.measurementId,").")+" To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.")}).catch(e=>Mx.error(e)),t.push(l);const c= 3700/** 3701 * @license 3702 * Copyright 2020 Google LLC 3703 * 3704 * Licensed under the Apache License, Version 2.0 (the "License"); 3705 * you may not use this file except in compliance with the License. 3706 * You may obtain a copy of the License at 3707 * 3708 * http://www.apache.org/licenses/LICENSE-2.0 3709 * 3710 * Unless required by applicable law or agreed to in writing, software 3711 * distributed under the License is distributed on an "AS IS" BASIS, 3712 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3713 * See the License for the specific language governing permissions and 3714 * limitations under the License. 3715 */ 3716async function(){if(!dc())return Mx.warn(Nx.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await fc()}catch(ZNe){return Mx.warn(Nx.create("indexeddb-unavailable",{errorInfo:null==ZNe?void 0:ZNe.toString()}).message),!1}return!0}().then(e=>e?i.getId():void 0),[u,h]=await Promise.all([l,c]);(function(e){const t=window.document.getElementsByTagName("script");for(const n of Object.values(t))if(n.src&&n.src.includes(Ox)&&n.src.includes(e))return n;return null} 3717/** 3718 * @license 3719 * Copyright 2020 Google LLC 3720 * 3721 * Licensed under the Apache License, Version 2.0 (the "License"); 3722 * you may not use this file except in compliance with the License. 3723 * You may obtain a copy of the License at 3724 * 3725 * http://www.apache.org/licenses/LICENSE-2.0 3726 * 3727 * Unless required by applicable law or agreed to in writing, software 3728 * distributed under the License is distributed on an "AS IS" BASIS, 3729 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3730 * See the License for the specific language governing permissions and 3731 * limitations under the License. 3732 */)(o)||Vx(o,u.measurementId),a("js",new Date);const d=null!==(r=null==s?void 0:s.config)&&void 0!==r?r:{};return d.origin="firebase",d.update=!0,null!=h&&(d.firebase_id=h),a("config",u.measurementId,d),u.measurementId} 3733/** 3734 * @license 3735 * Copyright 2019 Google LLC 3736 * 3737 * Licensed under the Apache License, Version 2.0 (the "License"); 3738 * you may not use this file except in compliance with the License. 3739 * You may obtain a copy of the License at 3740 * 3741 * http://www.apache.org/licenses/LICENSE-2.0 3742 * 3743 * Unless required by applicable law or agreed to in writing, software 3744 * distributed under the License is distributed on an "AS IS" BASIS, 3745 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3746 * See the License for the specific language governing permissions and 3747 * limitations under the License. 3748 */class Wx{constructor(e){this.app=e}_delete(){return delete Kx[this.app.options.appId],Promise.resolve()}}let Kx={},Gx=[];const Yx={};let Qx,$x,Xx="dataLayer",Jx=!1;function Zx(e,t,n){!function(){const e=[];if(lc()&&e.push("This is a browser extension environment."),pc()||e.push("Cookies are not available."),e.length>0){const t=e.map((e,t)=>"(".concat(t+1,") ").concat(e)).join(" "),n=Nx.create("invalid-analytics-context",{errorInfo:t});Mx.warn(n.message)}}();const i=e.options.appId;if(!i)throw Nx.create("no-app-id");if(!e.options.apiKey){if(!e.options.measurementId)throw Nx.create("no-api-key");Mx.warn('The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest'+" measurement ID for this Firebase app. Falling back to the measurement ID ".concat(e.options.measurementId)+' provided in the "measurementId" field in the local Firebase config.')}if(null!=Kx[i])throw Nx.create("already-exists",{id:i});if(!Jx){!function(e){let t=[];Array.isArray(window[e])?t=window[e]:window[e]=t}(Xx);const{wrappedGtag:e,gtagCore:t}=function(e,t,n,i,a){let o=function(...e){window[i].push(arguments)};
3748return window[a]&&"function"==typeof window[a]&&(o=window[a]),window[a]=qx(o,e,t,n),{gtagCore:o,wrappedGtag:window[a]}}(Kx,Gx,Yx,Xx,"gtag");$x=e,Qx=t,Jx=!0}Kx[i]=zx(e,Gx,Yx,t,Qx,Xx,n);return new Wx(e)}function eT(e,t,n,i){e=Rc(e),async function(e,t,n,i,a){if(a&&a.global)e("event",n,i);else{const a=await t;e("event",n,Object.assign(Object.assign({},i),{send_to:a}))}}($x,Kx[e.app.options.appId],t,n,i).catch(e=>Mx.error(e))}const tT="@firebase/analytics",nT="0.10.8";Gu(new Lc(Px,(e,{options:t})=>Zx(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),t),"PUBLIC")),Gu(new Lc("analytics-internal",function(e){try{const t=e.getProvider(Px).getImmediate();return{logEvent:(e,n,i)=>eT(t,e,n,i)}}catch(ZNe){throw Nx.create("interop-component-reg-failed",{reason:ZNe})}},"PRIVATE")),th(tT,nT),th(tT,nT,"esm2017");const iT={apiKey:"AIzaSyClB6DZ13gtd1zb1cObvnq7aS0r_tPJGZw",authDomain:"xephangqrcode.firebaseapp.com",projectId:"xephangqrcode",storageBucket:"xephangqrcode.firebasestorage.app",messagingSenderId:"1023069211018",appId:"1:1023069211018:web:571c06fc69cccec5fb2073",measurementId:"G-S0GNF5DFKB"},aT=Zu(iT);let oT=null;try{iT.measurementId&&(oT=function(e=eh()){const t=Yu(e=Rc(e),Px);return t.isInitialized()?t.getImmediate():function(e,t={}){const n=Yu(e,Px);if(n.isInitialized()){const e=n.getImmediate();if(Cc(t,n.getOptions()))return e;throw Nx.create("already-initialized")}return n.initialize({options:t})}(e)}(aT))}catch(eRe){}Hk(aT);const sT=function(e){const t="string"==typeof e?e:"(default)",n=Yu("object"==typeof e?e:eh(),"firestore").getImmediate({identifier:t});if(!n._initialized){const e=tc("firestore");e&&function(e,t,n,i={}){var a;const o=(e=iw(e,ow))._getSettings(),s="".concat(t,":").concat(n);if("firestore.googleapis.com"!==o.host&&o.host!==s&&Mp("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),e._setSettings(Object.assign(Object.assign({},o),{host:s,ssl:!1})),i.mockUserToken){let t,n;if("string"==typeof i.mockUserToken)t=i.mockUserToken,n=Sp.MOCK_USER;else{t=oc(i.mockUserToken,null===(a=e._app)||void 0===a?void 0:a.options.projectId);const o=i.mockUserToken.sub||i.mockUserToken.user_id;if(!o)throw new Fp(qp.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new Sp(o)}e._authCredentials=new Hp(new Up(t,n))}}(n,...e)}return n}(aT),rT=dp(aT),lT="nhat_ky_thao_tac",cT={don_vi:"ÄÆ¡n vá»",quay:"Quầy",cau_hinh_he_thong:"Cấu hình há» thá»ng",holidays:"Ngà y nghá»",thong_bao:"Thông báo",user_role:"Tà i khoản",bi_mat_don_vi:"Máºt khẩu, khoá cá»§a ÄÆ¡n vá»"},uT="Thêm má»i",hT="Chá»nh sá»a",dT="Xoá",fT=({hanhDong:e,doiTuong:t=null,doiTuongId:n=null,tenDoiTuong:i=null,donVi:a=null,chiTiet:o=null})=>{const s=rT.currentUser;return s?kk(cw(sT,lT),{uid:s.uid,email:s.email||null,hanh_dong:String(e||""),doi_tuong:t,doi_tuong_id:n?String(n):null,ten_doi_tuong:i?String(i).slice(0,200):null,don_vi:a?String(a):null,chi_tiet:o?String(o).slice(0,500):null,nguon:"trinh_duyet",luc:Ek()}).catch(e=>{}):Promise.resolve()},pT=e=>e&&(e.ten||e.name)||null,gT=e=>{const t=Object.keys(e||{});return t.length?"Trưá»ng Äã Äá»i: ".concat(t.slice(0,20).join(", ")).concat(t.length>20?"â¦":""):null},mT=(e,t,n,i=null)=>{cT[t]&&fT({hanhDong:e,doiTuong:t,doiTuongId:n,tenDoiTuong:pT(i),donVi:i&&(i.donvi||i.don_vi)||null,chiTiet:e===hT?gT(i):null})},vT=async(e,t=[],n=null,i=null)=>{try{let a=[];if(t.length&&(a=t.map(([e,t,n])=>Jw(e,t,n))),n){const[e,t]=n;a.push(tk(e,t))}i&&a.push(ik(i));const o=$w(bT(e),...a);return(await yk(o)).docs.map(e=>({id:e.id,...e.data()}))}catch(eRe){return[]}},yT=async(e,t)=>{try{const n=uw(bT(e),t),i=await mk(n);return i.exists()?{id:i.id,...i.data()}:null}catch(eRe){return null}},bT=e=>{if(!e)throw new Error("Tên collection không ÄÆ°á»£c Äá» trá»ng");return cw(sT,e)},_T=async(e,t)=>{try{const n=await kk(bT(e),t);return mT(uT,e,n.id,t),{id:n.id,...t}}catch(eRe){return null}},wT=async(e,t,n)=>{try{const i=uw(bT(e),t);return await _k(i,n),mT(hT,e,t,n),{id:t,...n}}catch(eRe){return null}},kT=async(e,t)=>{try{const n=uw(bT(e),t);let i=null;if(cT[e]){const e=await mk(n);i=e.exists()?e.data():null}return await wk(n),mT(dT,e,t,i),t}catch(eRe){return null}},xT=(e,t,n)=>{try{if(!t)throw new Error("ID không ÄÆ°á»£c Äá» trá»ng");const i=uw(bT(e),t);return xk(i,e=>{e.exists()?n({id:e.id,...e.data()}):n(null)},e=>{})}catch(eRe){}},TT=(e,t=[],n=null,i=null,a)=>{try{let o=[];if(t.length&&(o=t.map(([e,t,n])=>Jw(e,t,n))),n){const[e,t]=n;o.push(tk(e,t))}i&&o.push(ik(i));const s=$w(bT(e),...o);return xk(s,async e=>{const t=await Promise.all(e.docs.map(async e=>({id:e.id,...e.data()})));a(t)},e=>{})}catch(eRe){}},CT=async(e,t=[],n=null,i=null,a=null)=>{try{let o=[];if(t.length&&(o=t.map(([e,t,n])=>
3748Jw(e,t,n))),n){(Array.isArray(n[0])?n:[n]).forEach(([e,t])=>{o.push(tk(e,t))})}a&&o.push(ok(a)),i&&o.push(ik(i));const s=$w(bT(e),...o),r=await yk(s),l=r.docs.map(e=>({id:e.id,...e.data()}));return{data:l,lastDoc:r.docs[r.docs.length-1],hasMore:l.length===i}}catch(eRe){return{data:[],lastDoc:null,hasMore:!1}}},ET=Js("authStore",{state:()=>({userAuth:{},userRole:{}}),actions:{async getAuthUser(){try{this.userAuth=dp().currentUser}catch(eRe){}},async getUserAuthRole(){var e;try{const t=dp().currentUser;if(t){const n=await vT("user_role",[["user_id","==",t.uid]]);this.userRole=null!=(e=n[0])?e:null}}catch(eRe){}}}});var ST="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function IT(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var AT,DT,PT,OT={exports:{}}; 3749/*! 3750 * Toastify js 1.12.0 3751 * https://github.com/apvarun/toastify-js 3752 * @license MIT licensed 3753 * 3754 * Copyright (C) 2018 Varun A P 3755 */DT=ST,PT=function(e){var t=function(e){return new t.lib.init(e)};function n(e,t){return t.offset[e]?isNaN(t.offset[e])?t.offset[e]:t.offset[e]+"px":"0px"}function i(e,t){return!(!e||"string"!=typeof t||!(e.className&&e.className.trim().split(/\s+/gi).indexOf(t)>-1))}return t.defaults={oldestFirst:!0,text:"Toastify is awesome!",node:void 0,duration:3e3,selector:void 0,callback:function(){},destination:void 0,newWindow:!1,close:!1,gravity:"toastify-top",positionLeft:!1,position:"",backgroundColor:"",avatar:"",className:"",stopOnFocus:!0,onClick:function(){},offset:{x:0,y:0},escapeMarkup:!0,ariaLive:"polite",style:{background:""}},t.lib=t.prototype={toastify:"1.12.0",constructor:t,init:function(e){return e||(e={}),this.options={},this.toastElement=null,this.options.text=e.text||t.defaults.text,this.options.node=e.node||t.defaults.node,this.options.duration=0===e.duration?0:e.duration||t.defaults.duration,this.options.selector=e.selector||t.defaults.selector,this.options.callback=e.callback||t.defaults.callback,this.options.destination=e.destination||t.defaults.destination,this.options.newWindow=e.newWindow||t.defaults.newWindow,this.options.close=e.close||t.defaults.close,this.options.gravity="bottom"===e.gravity?"toastify-bottom":t.defaults.gravity,this.options.positionLeft=e.positionLeft||t.defaults.positionLeft,this.options.position=e.position||t.defaults.position,this.options.backgroundColor=e.backgroundColor||t.defaults.backgroundColor,this.options.avatar=e.avatar||t.defaults.avatar,this.options.className=e.className||t.defaults.className,this.options.stopOnFocus=void 0===e.stopOnFocus?t.defaults.stopOnFocus:e.stopOnFocus,this.options.onClick=e.onClick||t.defaults.onClick,this.options.offset=e.offset||t.defaults.offset,this.options.escapeMarkup=void 0!==e.escapeMarkup?e.escapeMarkup:t.defaults.escapeMarkup,this.options.ariaLive=e.ariaLive||t.defaults.ariaLive,this.options.style=e.style||t.defaults.style,e.backgroundColor&&(this.options.style.background=e.backgroundColor),this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var e=document.createElement("div");for(var t in e.className="toastify on "+this.options.className,this.options.position?e.className+=" toastify-"+this.options.position:!0===this.options.positionLeft?e.className+=" toastify-left":e.className+=" toastify-right",e.className+=" "+this.options.gravity,this.options.backgroundColor,this.options.style)e.style[t]=this.options.style[t];if(this.options.ariaLive&&e.setAttribute("aria-live",this.options.ariaLive),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)e.appendChild(this.options.node);else if(this.options.escapeMarkup?e.innerText=this.options.text:e.innerHTML=this.options.text,""!==this.options.avatar){var i=document.createElement("img");i.src=this.options.avatar,i.className="toastify-avatar","left"==this.options.position||!0===this.options.positionLeft?e.appendChild(i):e.insertAdjacentElement("afterbegin",i)}if(!0===this.options.close){var a=document.createElement("button");a.type="button",a.setAttribute("aria-label","Close"),a.className="toast-close",a.innerHTML="✖",a.addEventListener("click",function(e){e.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var o=window.innerWidth>0?window.innerWidth:screen.width;
3755("left"==this.options.position||!0===this.options.positionLeft)&&o>360?e.insertAdjacentElement("afterbegin",a):e.appendChild(a)}if(this.options.stopOnFocus&&this.options.duration>0){var s=this;e.addEventListener("mouseover",function(t){window.clearTimeout(e.timeOutValue)}),e.addEventListener("mouseleave",function(){e.timeOutValue=window.setTimeout(function(){s.removeElement(e)},s.options.duration)})}if(void 0!==this.options.destination&&e.addEventListener("click",function(e){e.stopPropagation(),!0===this.options.newWindow?window.open(this.options.destination,"_blank"):window.location=this.options.destination}.bind(this)),"function"==typeof this.options.onClick&&void 0===this.options.destination&&e.addEventListener("click",function(e){e.stopPropagation(),this.options.onClick()}.bind(this)),"object"==typeof this.options.offset){var r=n("x",this.options),l=n("y",this.options),c="left"==this.options.position?r:"-"+r,u="toastify-top"==this.options.gravity?l:"-"+l;e.style.transform="translate("+c+","+u+")"}return e},showToast:function(){var e;if(this.toastElement=this.buildToast(),!(e="string"==typeof this.options.selector?document.getElementById(this.options.selector):this.options.selector instanceof HTMLElement||"undefined"!=typeof ShadowRoot&&this.options.selector instanceof ShadowRoot?this.options.selector:document.body))throw"Root element is not defined";var n=t.defaults.oldestFirst?e.firstChild:e.lastChild;return e.insertBefore(this.toastElement,n),t.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout(function(){this.removeElement(this.toastElement)}.bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(e){e.className=e.className.replace(" on",""),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),e.parentNode&&e.parentNode.removeChild(e),this.options.callback.call(e),t.reposition()}.bind(this),400)}},t.reposition=function(){for(var e,t={top:15,bottom:15},n={top:15,bottom:15},a={top:15,bottom:15},o=document.getElementsByClassName("toastify"),s=0;s<o.length;s++){e=!0===i(o[s],"toastify-top")?"toastify-top":"toastify-bottom";var r=o[s].offsetHeight;e=e.substr(9,e.length-1),(window.innerWidth>0?window.innerWidth:screen.width)<=360?(o[s].style[e]=a[e]+"px",a[e]+=r+15):!0===i(o[s],"toastify-left")?(o[s].style[e]=t[e]+"px",t[e]+=r+15):(o[s].style[e]=n[e]+"px",n[e]+=r+15)}return this},t.lib.init.prototype=t.lib,t},(AT=OT).exports?AT.exports=PT():DT.Toastify=PT();const MT=IT(OT.exports),NT={duration:4e3,close:!1,gravity:"top",position:"right"},RT=(e={})=>{const t={...NT,...e};MT(t).showToast()},LT=e=>{RT({text:e||"Thao tác thà nh công!",backgroundColor:"#4caf50"})},VT=e=>{RT({text:e||"Äã xảy ra lá»i!",backgroundColor:"#f44336"})},qT=new Map,FT=(e,t)=>{const n=qT.get(e);return n&&n(),"function"==typeof t?qT.set(e,t):qT.delete(e),t},BT="admin",UT="organization",jT="operator",HT="supporter",zT="department",WT=["smspassword","emailpassword","zalopassword","sound_provider_auth_key"],KT=["image/png","image/jpeg","image/webp"],GT="Logo chá» nháºn ảnh PNG, JPEG hoặc WebP.",YT=[{value:BT,name:"Quản trá» viên há» thá»ng"},{value:UT,name:"Quản trá» ÄÆ¡n vá»"},{value:jT,name:"TÃnh nÄng công cá»ng"},{value:zT,name:"Quản trá» quầy"},{value:HT,name:"Há» trợ lấy sá» nhanh"}],QT="KÃnh thông báo, khách thuá»c diá»n ưu tiên và khách Äã Äặt lá»ch hẹn trá»±c tuyến ÄÆ°á»£c phục vụ trưá»c theo quy Äá»nh. KÃnh mong quý khách thông cảm.",$T=[{ma:"thongKe",co:"showQuickStats",ten:"Thá»ng kê nhanh",mota:"Sáu ô sá» liá»u quầy và lượt khách",icon:"fas fa-chart-bar"},{ma:"bieuDo",co:"showChart",ten:"Biá»u Äá» thá»ng kê",mota:"Biá»u Äá» lượt khách theo thá»i gian",icon:"fas fa-chart-line"},{ma:"qrBangDienTu",co:"showQrBangDienTu",ten:"QR Bảng Äiá»n tá»",mota:"Quét Äá» theo dõi hà ng Äợi từ xa",icon:"fas fa-tv"},{ma:"qrHenGio",co:"showQrHenGio",ten:"QR Hẹn giá» giao dá»ch",mota:"Quét Äá» Äặt lá»ch trưá»c theo khung giá»",icon:"fas fa-calendar-check",henGio:!0}],XT=$T.map(e=>e.ma),JT=Js("donviStore",{state:()=>({items:[],item:null}),actions:{async fetchItems(e=null){const t=[];null!==e&&t.push(["trangthai","==",e]),await this.addRoleCondition(t);const n=await vT("don_vi",t);this.items=n.sort((e,t)=>
3755e.thutu-t.thutu)},async fetchItemsByManager(e){const t=await vT("don_vi",[["quanly","array-contains",e]]);this.items=t.sort((e,t)=>e.thutu-t.thutu)},async fetchItemsByTrangThai(){return this.fetchItems(!0)},async fetchItemById(e){this.item=await yT("don_vi",e)},async realtimeItemById(e){FT("donvi:item",xT("don_vi",e,e=>{this.item=e}))},async addItem(e){const t=await _T("don_vi",e);return await this.fetchItems(),t},async updateItem(e,t){await wT("don_vi",e,t),await this.fetchItems()},async deleteItem(e){await kT("don_vi",e),await this.fetchItems()},async addRoleCondition(e){const t=ET();await Promise.all([t.getAuthUser(),t.getUserAuthRole()]);const n=t.userAuth,i=t.userRole;i&&[UT,jT].includes(i.role)&&e.push(["quanly","array-contains",null==n?void 0:n.email])}}}),ZT=e=>{if(!e||e.length<=5)return e;return"*".repeat(e.length-5)+e.slice(-5)},eC=(e,t)=>e.map(e=>e[t]),tC=(e=6)=>{let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i=0;for(;i<e;)t+=n.charAt(Math.floor(62*Math.random())),i+=1;return t},nC=e=>{const t=YT.find(t=>t.value==e);return t?t.name:""},iC=e=>{if(!e)return"";const t=e.toDate?e.toDate():new Date(e);return new Intl.DateTimeFormat("vi-VN",{day:"2-digit",month:"2-digit",year:"numeric"}).format(t)},aC=e=>{if(!e)return"";const t=e.toDate?e.toDate():new Date(e);return new Intl.DateTimeFormat("vi-VN",{timeZone:"Asia/Ho_Chi_Minh",hour:"2-digit",minute:"2-digit",day:"2-digit",month:"2-digit",year:"numeric"}).format(t)},oC=e=>{if(!e)return"";const t=e.toDate?e.toDate():new Date(e);return new Intl.DateTimeFormat("vi-VN",{timeZone:"Asia/Ho_Chi_Minh",hour:"2-digit",minute:"2-digit",hour12:!1}).format(t)},sC=(e,t="/")=>{if(!e)return"";const n=e.toDate?e.toDate():new Date(e),i=new Intl.DateTimeFormat("vi-VN",{timeZone:"Asia/Ho_Chi_Minh",day:"2-digit",month:"2-digit",year:"numeric"});return"-"==t?i.format(n).split("/").join("-"):i.format(n)},rC=e=>{const t={"à ":"a","á":"a","ạ":"a","ả":"a","ã":"a","â":"a","ầ":"a","ấ":"a","áº":"a","ẩ":"a","ẫ":"a","Ä":"a","ằ":"a","ắ":"a","ặ":"a","ẳ":"a","ẵ":"a","è":"e","é":"e","ẹ":"e","ẻ":"e","ẽ":"e","ê":"e","á»":"e","ế":"e","á»":"e","á»":"e","á»
":"e","ì":"i","Ã":"i","á»":"i","á»":"i","Ä©":"i","ò":"o","ó":"o","á»":"o","á»":"o","õ":"o","ô":"o","á»":"o","á»":"o","á»":"o","á»":"o","á»":"o","Æ¡":"o","á»":"o","á»":"o","ợ":"o","á»":"o","ỡ":"o","ù":"u","ú":"u","ụ":"u","á»§":"u","Å©":"u","ư":"u","ừ":"u","ứ":"u","á»±":"u","á»":"u","ữ":"u","ỳ":"y","ý":"y","ỵ":"y","á»·":"y","ỹ":"y","Ä":"d","Ã":"A","Ã":"A","Ạ":"A","Ả":"A","Ã":"A","Ã":"A","Ầ":"A","Ấ":"A","Ậ":"A","Ẩ":"A","Ẫ":"A","Ä":"A","Ằ":"A","Ắ":"A","Ặ":"A","Ẳ":"A","Ẵ":"A","Ã":"E","Ã":"E","Ẹ":"E","Ẻ":"E","Ẽ":"E","Ã":"E","á»":"E","Ế":"E","á»":"E","á»":"E","á»":"E","Ã":"I","Ã":"I","á»":"I","á»":"I","Ĩ":"I","Ã":"O","Ã":"O","á»":"O","á»":"O","Ã":"O","Ã":"O","á»":"O","á»":"O","á»":"O","á»":"O","á»":"O","Æ ":"O","á»":"O","á»":"O","Ợ":"O","á»":"O","á» ":"O","Ã":"U","Ã":"U","Ụ":"U","Ủ":"U","Ũ":"U","Ư":"U","Ừ":"U","Ứ":"U","á»°":"U","Ử":"U","á»®":"U","Ỳ":"Y","Ã":"Y","á»´":"Y","á»¶":"Y","Ỹ":"Y","Ä":"D"};return e.split("").map(e=>t[e]||e).join("").replace(/\s+/g,"")},lC=e=>e?String(e).replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):"",cC=e=>{if(!e)return"";const t=String(e).replace(/\D/g,"").trim().replace(/^00/,"");return/^84\d{9}$/.test(t)?"0".concat(t.slice(2)):t},uC=e=>/^0[35789]\d{8}$/.test(cC(e)),hC=e=>{if(!e)return"";const t=String(e).replace(/[^\p{L}\p{M}\s'-]/gu," ").replace(/\s+/g," ").trim();if(!t)return"";return lC(t).split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")},dC=e=>{const t={...e};return e.hoten&&(t.hoten=hC(e.hoten)),e.sodienthoai&&(t.sodienthoai=cC(e.sodienthoai)),e.email&&(t.email=lC(e.email)),t},fC=e=>e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/à |á|ạ|ả|ã|â|ầ|ấ|áº|ẩ|ẫ|Ä|ằ|ắ|ặ|ẳ|ẵ/g,"a")).replace(/è|é|ẹ|ẻ|ẽ|ê|á»|ế|á»|á»|á»
/g,"e")).replace(/ì|Ã|á
3755»|á»|Ä©/g,"i")).replace(/ò|ó|á»|á»|õ|ô|á»|á»|á»|á»|á»|Æ¡|á»|á»|ợ|á»|ỡ/g,"o")).replace(/ù|ú|ụ|á»§|Å©|ư|ừ|ứ|á»±|á»|ữ/g,"u")).replace(/ỳ|ý|ỵ|á»·|ỹ/g,"y")).replace(/Ä/g,"d")).replace(/Ã|Ã|Ạ|Ả|Ã|Ã|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ä|Ằ|Ắ|Ặ|Ẳ|Ẵ/g,"A")).replace(/Ã|Ã|Ẹ|Ẻ|Ẽ|Ã|á»|Ế|á»|á»|á»/g,"E")).replace(/Ã|Ã|á»|á»|Ĩ/g,"I")).replace(/Ã|Ã|á»|á»|Ã|Ã|á»|á»|á»|á»|á»|Æ |á»|á»|Ợ|á»|á» /g,"O")).replace(/Ã|Ã|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|á»°|Ử|á»®/g,"U")).replace(/Ỳ|Ã|á»´|á»¶|Ỹ/g,"Y")).replace(/Ä/g,"D"),pC=(e,t,n=null,i=!1)=>{var a,o;const s=n||new Date,r=(s.getDay()+6)%7,l=s.getHours(),c=60*l+s.getMinutes(),u=l<12;if(null==(a=null==t?void 0:t.ngaynghi)?void 0:a.length){const e=t.ngaynghi.find(e=>e.week_day===r.toString());if(e){if("full"===e.type)return"Ngà y nghá» trong tuần";if("morning"===e.type&&u)return"Buá»i sáng nghá»";if("afternoon"===e.type&&!u)return"Buá»i chiá»u nghá»"}}const h="".concat(String(s.getDate()).padStart(2,"0"),"/").concat(String(s.getMonth()+1).padStart(2,"0"));if(null==(o=null==t?void 0:t.ngayle)?void 0:o.length){if(t.ngayle.some(e=>e.date===h))return"Ngà y lá»
"}const d=e=>{if("string"!=typeof e)return null;const[t,n]=e.split(":").map(Number);return Number.isFinite(t)&&Number.isFinite(n)?60*t+n:null},f=(e,t)=>{const n=d(e),i=d(t);return null===n&&null===i?null:!(null!==n&&c<n)&&!(null!==i&&c>i)};if(i)return null;const p=f(null==e?void 0:e.thoigianbatdau_sang,null==e?void 0:e.thoigianketthuc_sang),g=f(null==e?void 0:e.thoigianbatdau_chieu,null==e?void 0:e.thoigianketthuc_chieu);if(null===p&&null===g)return null;if(!0===p||!0===g)return null;const m=[d(null==e?void 0:e.thoigianbatdau_sang),d(null==e?void 0:e.thoigianbatdau_chieu)].filter(e=>null!==e),v=[d(null==e?void 0:e.thoigianketthuc_sang),d(null==e?void 0:e.thoigianketthuc_chieu)].filter(e=>null!==e);return m.length&&c<Math.min(...m)?"Chưa Äến giá» là m viá»c":v.length&&c>Math.max(...v)?"Äã hết giá» là m viá»c":"Äang nghá» giữa ca"},gC=(e,t,n=null,i=null,a=!1)=>{let o=null!==i?"Lượt chá»: ".concat(i):"";if(n){const i=pC(e,t,n,a);i&&(o=i)}else e.trangthai||(o+=o?" (Dừng nháºn khách)":"Dừng nháºn khách");return o},mC="07:30",vC="11:30",yC="13:30",bC="17:30",_C=10,wC=e=>{if(!e||"string"!=typeof e)return null;const[t,n]=e.split(":").map(Number);return Number.isFinite(t)&&Number.isFinite(n)?60*t+n:null},kC=e=>{const t=Math.floor(e/60),n=e%60;return"".concat(String(t).padStart(2,"0"),":").concat(String(n).padStart(2,"0"))},xC=e=>{const t=(e,t,n)=>{var i,a;return null!=(a=null!=(i=wC(e))?i:wC(t))?a:wC(n)},n=[[t(null==e?void 0:e.hengio_batdau_sang,null==e?void 0:e.thoigianbatdau_sang,mC),t(null==e?void 0:e.hengio_ketthuc_sang,null==e?void 0:e.thoigianketthuc_sang,vC)],[t(null==e?void 0:e.hengio_batdau_chieu,null==e?void 0:e.thoigianbatdau_chieu,yC),t(null==e?void 0:e.hengio_ketthuc_chieu,null==e?void 0:e.thoigianketthuc_chieu,bC)]],i=Number(null==e?void 0:e.hengio_khoangcach),a=Number.isFinite(i)&&i>0?Math.floor(i):_C,o=[];for(const[s,r]of n)if(!(null===s||null===r||r<=s))for(let e=s;e<r;e+=a)o.push(kC(e));return o},TC=["không","má»t","hai","ba","bá»n","nÄm","sáu","bảy","tám","chÃn"],CC=(e,t)=>{const n=e.__vccOpts||e;for(const[i,a]of t)n[i]=a;return n},EC={class:"container content-container"},SC={class:"button-section"},IC={class:"search-section"},AC={class:"search-box"},DC={class:"button-section units-section"},PC={key:0,class:"no-results"},OC=CC({__name:"TheIndex",setup(e){const t=JT(),{items:n}=Zs(t),i=ET(),{userRole:a}=Zs(i),o=It(""),s=bo(()=>{if(!o.value)return n.value;const e=fC(o.value.toLowerCase());return n.value.filter(t=>fC(t.ten.toLowerCase()).includes(e))});return Zn(async()=>{RT({text:"Äang tải dữ liá»u ÄÆ¡n vá»...",backgroundColor:"#ff9800"}),await Promise.all([i.getAuthUser(),i.getUserAuthRole(),t.fetchItemsByTrangThai()]),LT("Tải dữ liá»u thà nh công!!!")}),(e,t)=>{const n=ui("router-link");return Ma(),Va("div",EC,[t[7]||(t[7]=Ha("div",{class:"header"},[Ha("h3",{class:"text-center"},"TRUNG TÃM QUẢN TRá»")],-1)),Ha("div",SC,[Ot(a).role===Ot(BT)?(Ma(),qa(n,{key:0,class:"btn btn-custom btn-gradient-blue",to:"/quan-ly-tai-khoan"},{default:pn(()=>t[1]||(t[1]=[Ga(" Quản lý tà i khoản ")])),_:1})):Qa("",!0),Ot(a).role===Ot(BT)?(Ma(),qa(n,{key:1,class:"btn btn-custom btn-gradient-blue",to:"/quan-ly-don-vi"},{default:pn(()=>t[2]||(t[2]=[Ga(" Quản lý ÄÆ¡n vá» ")])),_:1})):Qa("",!0),Ot(a).role===Ot(BT)?(Ma(),qa(n,{key:2,class:"btn btn-custom btn-gradient-blue",to:"/bao-cao-thong-ke"},{default:pn(()=>t[3]||(t[3]=[Ga(" Báo cáo - Thá»ng kê ")])),_:1})):Qa("",!0),Ot(a).role===Ot(BT)?(Ma(),qa(n,{key:3,class:"btn btn-custom btn-gradient-blue",to:"/cau
3755-hinh-he-thong"},{default:pn(()=>t[4]||(t[4]=[Ga(" Cấu hình há» thá»ng ")])),_:1})):Qa("",!0),Ot(a).role===Ot(BT)?(Ma(),qa(n,{key:4,class:"btn btn-custom btn-gradient-blue",to:"/nhat-ky-he-thong"},{default:pn(()=>t[5]||(t[5]=[Ga(" Nháºt ký há» thá»ng ")])),_:1})):Qa("",!0)]),Ha("div",IC,[Ha("div",AC,[gn(Ha("input",{type:"text","onUpdate:modelValue":t[0]||(t[0]=e=>o.value=e),placeholder:"Tìm kiếm ÄÆ¡n vá»...",class:"search-input"},null,512),[[ms,o.value]]),t[6]||(t[6]=Ha("i",{class:"fas fa-search search-icon"},null,-1))])]),Ha("div",DC,[(Ma(!0),Va(Sa,null,gi(s.value,e=>(Ma(),qa(n,{key:e.id,class:"btn btn-custom btn-gradient-light-blue",to:"/".concat(e.id,"/quan-tri-don-vi")},{default:pn(()=>[Ga(ee(e.ten),1)]),_:2},1032,["to"]))),128)),0===s.value.length?(Ma(),Va("div",PC," Không tìm thấy ÄÆ¡n vá» nà o ")):Qa("",!0)])])}}},[["__scopeId","data-v-d758204c"]]);function MC(e,t){return function(){return e.apply(t,arguments)}}const{toString:NC}=Object.prototype,{getPrototypeOf:RC}=Object,{iterator:LC,toStringTag:VC}=Symbol,qC=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),FC=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),BC=(e,t,n)=>e===Object.prototype||!n&&null===t,UC=(e,t)=>{let n=e;const i=[];for(;null!=n;){if(-1!==i.indexOf(n))return!1;i.push(n);const a=RC(n);if(BC(n,a,n===e))return!1;if(qC(n,t))return!0;n=a}return!1},jC=(e=>t=>{const n=NC.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),HC=e=>(e=e.toLowerCase(),t=>jC(t)===e),zC=e=>t=>typeof t===e,{isArray:WC}=Array,KC=zC("undefined");function GC(e){return null!==e&&!KC(e)&&null!==e.constructor&&!KC(e.constructor)&&$C(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const YC=HC("ArrayBuffer");const QC=zC("string"),$C=zC("function"),XC=zC("number"),JC=e=>null!==e&&"object"==typeof e,ZC=e=>{if(!JC(e))return!1;const t=RC(e);return!(null!==t&&t!==Object.prototype&&null!==RC(t)||UC(e,VC)||UC(e,LC))},eE=HC("Date"),tE=HC("File"),nE=HC("Blob"),iE=HC("FileList"),aE=HC("Set");const oE="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},sE=void 0!==oE.FormData?oE.FormData:void 0,rE=HC("URLSearchParams"),[lE,cE,uE,hE]=["ReadableStream","Request","Response","Headers"].map(HC);function dE(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let i,a;if("object"!=typeof e&&(e=[e]),WC(e))for(i=0,a=e.length;i<a;i++)t.call(null,e[i],i,e);else{if(GC(e))return;const a=n?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let s;for(i=0;i<o;i++)s=a[i],t.call(null,e[s],s,e)}}function fE(e,t){if(GC(e))return null;t=t.toLowerCase();const n=Object.keys(e);let i,a=n.length;for(;a-- >0;)if(i=n[a],t===i.toLowerCase())return i;return null}const pE="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,gE=e=>!KC(e)&&e!==pE;const mE=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&RC(Uint8Array)),vE=HC("HTMLFormElement"),{propertyIsEnumerable:yE}=Object.prototype,bE=HC("RegExp"),_E=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};dE(n,(n,a)=>{let o;!1!==(o=t(n,a,e))&&(i[a]=o||n)}),Object.defineProperties(e,i)};const wE=HC("AsyncFunction"),kE=(xE="function"==typeof setImmediate,TE=$C(pE.postMessage),xE?setImmediate:TE?(CE="axios@".concat(Math.random()),EE=[],pE.addEventListener("message",({source:e,data:t})=>{e===pE&&t===CE&&EE.length&&EE.shift()()},!1),e=>{EE.push(e),pE.postMessage(CE,"*")}):e=>setTimeout(e));var xE,TE,CE,EE;const SE="undefined"!=typeof queueMicrotask?queueMicrotask.bind(pE):"undefined"!=typeof process&&process.nextTick||kE,IE=e=>null!=e&&$C(e[LC]),AE={isArray:WC,isArrayBuffer:YC,isBuffer:GC,isFormData:e=>{if(!e)return!1;if(sE&&e instanceof sE)return!0;const t=RC(e);if(!t||t===Object.prototype)return!1;if(!$C(e.append))return!1;const n=jC(e);return"formdata"===n||"object"===n&&$C(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&YC(e.buffer),t},isString:QC,isNumber:XC,isBoolean:e=>!0===e||!1===e,isObject:JC,isPlainObject:ZC,isEmptyObject:e=>{if(!JC(e)||GC(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(ZNe){return!1}},isReadableStream:lE,isRequest:cE,isResponse:uE,isHeaders:hE,isUndefined:KC,isDate:eE,isFile:tE,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:nE,isRegExp:bE,isFunction:$C,isStream:e=>JC(e)&&$C(e.pipe),isURLSearchParams:rE,isTypedArray:mE,isFileList:iE,forEach:dE,merge:function e(...t){const{caseless:n,skipUndefined:i}=gE(this)&&this||{},a={},o=(t,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;const s=n&&"string"==typeof o&&fE(a,o)||o,r=qC(a,s)?a[s]:void 0;ZC(r)&&ZC(t)?a[s]=e(r,t):ZC(t)?a[s]=e({},t):WC(t)?a[s]=t.slice():i&&KC(t)||(a[s]=t)};for(let s=0,r=t.length;s<r;s++){const e=t[s];if(!e||GC(e))continue;if(dE(e,o),"object"!=typeof e||WC(e))continue;const n=Object.getOwnPropertySymbols(e);for(let t=0;t<n.length;t++){const i=n[t];yE.call(e,i)&&o(e[i],i)}}return a},extend:(e,t,n,{allOwnKeys:i}={})=>(dE(t,(t,i)=>{n&&$C(t)?Object.defineProperty(e,i,{__proto__:null,value:MC(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,i)=>
vendor: 4,538 bytes, line 3755
3755{e.prototype=Object.create(t.prototype,i),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,i)=>{let a,o,s;const r={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],i&&!i(s,e,t)||r[s]||(t[s]=e[s],r[s]=!0);e=!1!==n&&RC(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:jC,kindOfTest:HC,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return-1!==i&&i===n},toArray:e=>{if(!e)return null;if(WC(e))return e;let t=e.length;if(!XC(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[LC]).call(e);let i;for(;(i=n.next())&&!i.done;){const n=i.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const i=[];for(;null!==(n=e.exec(t));)i.push(n);return i},isHTMLForm:vE,hasOwnProperty:qC,hasOwnProp:qC,hasOwnInPrototypeChain:UC,getSafeProp:(e,t)=>null!=e&&UC(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;const t=RC(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(t=>{if(FC(t))return!1;const n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable})})(e))return e;const n=Object.create(null),i=Object.create(null),a=[];let o=e;for(;null!=o&&-1===a.indexOf(o);){a.push(o);const s=o===e?t:RC(o);if(BC(o,s,o===e))break;const r=Object.getOwnPropertyNames(o);Object.getOwnPropertySymbols&&r.push(...Object.getOwnPropertySymbols(o));for(const t of r)FC(t)||qC(i,t)||(n[t]=e[t],i[t]=!0);o=s}return n},reduceDescriptors:_E,freezeMethods:e=>{_E(e,(t,n)=>{if($C(e)&&["arguments","caller","callee"].includes(n))return!1;const i=e[n];$C(i)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},i=e=>{e.forEach(e=>{n[e]=!0})};return WC(e)?i(e):i(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:fE,global:pE,isContextDefined:gE,isSpecCompliantForm:function(e){return!!(e&&$C(e.append)&&"FormData"===e[VC]&&e[LC])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(JC(e)){if(t.has(e))return;if(GC(e))return e;if(!("toJSON"in e)){let i;if(t.add(e),aE(e)){i=[];for(const t of e){const e=n(t);!KC(e)&&i.push(e)}}else i=WC(e)?[]:{},dE(e,(e,t)=>{const a=n(e);!KC(a)&&(i[t]=a)});return t.delete(e),i}}return e};return n(e)},isAsyncFn:wE,isThenable:e=>e&&(JC(e)||$C(e))&&$C(e.then)&&$C(e.catch),setImmediate:kE,asap:SE,isIterable:IE,isSafeIterable:e=>null!=e&&UC(e,LC)&&IE(e)},DE=AE.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"]);const PE=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),OE=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ME(e,t){return AE.isArray(e)?e.map(e=>ME(e,t)):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function NE(e){const t=Object.create(null);return AE.forEach(e.toJSON(),(e,n)=>{t[n]=(e=>ME(e,OE))(e)}),t}const RE=Symbol("internals");function LE(e){return e&&String(e).trim().toLowerCase()}function VE(e){return!1===e||null==e?e:AE.isArray(e)?e.map(VE):(e=>ME(e,PE))(String(e))}const qE=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function FE(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function BE(e,t,n,i,a){return AE.isFunction(i)?i.call(this,t,n):(a&&(t=n),AE.isString(t)?AE.isString(i)?-1!==t.indexOf(i):AE.isRegExp(i)?i.test(t):void 0:void 0)}class UE{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function a(e,t,n){const a=LE(t);if(!a)return;const o=AE.findKey(i,a);(!o||void 0===i[o]||!0===n||void 0===n&&!1!==i[o])&&(i[o||t]=VE(e))}const o=(e,t)=>
vendor: 32,001 bytes, line 3755
3755AE.forEach(e,(e,n)=>a(e,n,t));if(AE.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(AE.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,i,a;return e&&e.split("\n").forEach(function(e){a=e.indexOf(":"),n=e.substring(0,a).trim().toLowerCase(),i=e.substring(a+1).trim();const o=AE.hasOwnProp(t,n);!n||o&&AE.hasOwnProp(DE,n)||("set-cookie"===n?o?t[n].push(i):t[n]=[i]:t[n]=o?t[n]+", "+i:i)}),t})(e),t);else if(AE.isObject(e)&&AE.isSafeIterable(e)){let n,i,a=Object.create(null);for(const t of e){if(!AE.isArray(t))throw new TypeError("Object iterator must return a key-value pair");i=t[0],AE.hasOwnProp(a,i)?(n=a[i],a[i]=AE.isArray(n)?[...n,t[1]]:[n,t[1]]):a[i]=t[1]}o(a,t)}else null!=e&&a(t,e,n);return this}get(e,t){if(e=LE(e)){const n=AE.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}(e);if(AE.isFunction(t))return t.call(this,e,n);if(AE.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=LE(e)){const n=AE.findKey(this,e);return!(!n||void 0===this[n]||t&&!BE(0,this[n],n,t))}return!1}delete(e,t){const n=this;let i=!1;function a(e){if(e=LE(e)){const a=AE.findKey(n,e);!a||t&&!BE(0,n[a],a,t)||(delete n[a],i=!0)}}return AE.isArray(e)?e.forEach(a):a(e),i}clear(e){const t=Object.keys(this);let n=t.length,i=!1;for(;n--;){const a=t[n];e&&!BE(0,this[a],a,e,!0)||(delete this[a],i=!0)}return i}normalize(e){const t=this,n={};return AE.forEach(this,(i,a)=>{const o=AE.findKey(n,a);if(o)return t[o]=VE(i),void delete t[a];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(a):String(a).trim();s!==a&&delete t[a],t[s]=VE(i),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return AE.forEach(this,(n,i)=>{null!=n&&!1!==n&&(t[i]=e&&AE.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("\n")}getSetCookie(){const e=this.get("set-cookie");return AE.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let i=0,a=!1,o=!1;function s(e){const a=FE(n.slice(i,e)),o=a.indexOf("=");if(o<1)return;const s=FE(a.slice(0,o));if(!qE.test(s))return;const r=s.toLowerCase();if("__proto__"===r||"constructor"===r||"prototype"===r)return;const l=FE(a.slice(o+1));t[r]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let i=1;i<t;i++){const a=e.charCodeAt(i);if(34===a)return e;if(92===a&&(i+=1,i>=t))return e;n+=e[i]}return n}(l)}for(let r=0;r<n.length;r++){const e=n.charCodeAt(r);a?o?o=!1:92===e?o=!0:34===e&&(a=!1):34===e?a=!0:44!==e&&59!==e||(s(r),i=r+1)}return s(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[RE]=this[RE]={accessors:{}}).accessors,n=this.prototype;function i(e){const i=LE(e);t[i]||(!function(e,t){const n=AE.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{__proto__:null,value:function(e,n,a){return this[i].call(this,t,e,n,a)},configurable:!0})})}(n,e),t[i]=!0)}return AE.isArray(e)?e.forEach(i):i(e),this}}UE.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),AE.reduceDescriptors(UE.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),AE.freezeMethods(UE);const jE="[REDACTED ****]";function HE(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),i=[],a=e=>{if(null===e||"object"!=typeof e)return e;if(AE.isBuffer(e))return e;if(-1!==i.indexOf(e))return;let t;if(e instanceof UE&&(e=e.toJSON()),i.push(e),AE.isArray(e))t=[],e.forEach((e,n)=>{const i=a(e);AE.isUndefined(i)||(t[n]=i)});else{if(!AE.isPlainObject(e)&&function(e){if(AE.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(AE.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return i.pop(),e;t=Object.create(null);for(const[i,o]of Object.entries(e)){const e=n.has(i.toLowerCase())?jE:a(o);AE.isUndefined(e)||(t[i]=e)}}return i.pop(),t};return a(e)}function zE(e){try{return String(e)}catch(t){return""}}class WE extends Error{static from(e,t,n,i,a,o){let s=e.message;!s&&AE.isArray(e.errors)&&e.errors.length&&(s=function(e){return e.errors.map(e=>{try{return e&&e.message?zE(e.message):zE(e)}catch(t){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));const r=new WE(s,t||e.code,n,i,a);return Object.defineProperty(r,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),r.name=e.name,null!=e.status&&null==r.status&&(r.status=e.status),o&&Object.assign(r,o),r}constructor(e,t,n,i,a){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),a&&(this.response=a,this.status=a.status)}toJSON(){const e=this.config,t=e&&AE.hasOwnProp(e,"redact")?e.redact:void 0,n=AE.isArray(t)&&t.length>0?HE(e,t):AE.toJSONObject(e);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:n,code:this.code,status:this.status}}}WE.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",WE.ERR_BAD_OPTION="ERR_BAD_OPTION",WE.ECONNABORTED="ECONNABORTED",WE.ETIMEDOUT="ETIMEDOUT",WE.ECONNREFUSED="ECONNREFUSED",WE.ERR_NETWORK="ERR_NETWORK",WE.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",WE.ERR_DEPRECATED="ERR_DEPRECATED",WE.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",WE.ERR_BAD_REQUEST="ERR_BAD_REQUEST",WE.ERR_CANCELED="ERR_CANCELED",WE.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",WE.ERR_INVALID_URL="ERR_INVALID_URL",WE.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";function KE(e){return AE.isPlainObject(e)||AE.isArray(e)}function GE(e){return AE.endsWith(e,"[]")?e.slice(0,-2):e}function YE(e,t,n){return e?e.concat(t).map(function(e,t){return e=GE(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const QE=AE.toFlatObject(AE,{},null,function(e){return/^is[A-Z]/.test(e)});function $E(e,t,n){if(!AE.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const i=(e,t)=>{const i=AE.getSafeProp(n,e);return AE.isUndefined(i)?t:i},a=i("metaTokens",!0),o=i("visitor")||p,s=i("dots",!1),r=i("indexes",!1),l=i("Blob")||"undefined"!=typeof Blob&&Blob,c=i("maxDepth",100),u=l&&AE.isSpecCompliantForm(t),h=[];if(!AE.isFunction(o))throw new TypeError("visitor must be a function");function d(e){if(null===e)return"";if(AE.isDate(e))return e.toISOString();if(AE.isBoolean(e))return e.toString();if(!u&&AE.isBlob(e))throw new WE("Blob is not supported. Use a Buffer instead.");if(AE.isArrayBuffer(e)||AE.isTypedArray(e)){if(u&&"function"==typeof l)return new l([e]);throw new WE("Blob is not supported. Use a Buffer instead.",WE.ERR_NOT_SUPPORT)}return e}function f(e){if(e>c)throw new WE("Object is too deeply nested ("+e+" levels). Max depth: "+c,WE.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,n,i){let o=e;if(AE.isReactNative(t)&&AE.isReactNativeBlob(e))return t.append(YE(i,n,s),d(e)),!1;if(e&&!i&&"object"==typeof e)if(AE.endsWith(n,"{}"))n=a?n:n.slice(0,-2),e=function(e,t){if(c===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,function(e,i){if(!AE.isObject(i))return i;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(i),f(t+n.length-1),i})}(e,1);else if(AE.isArray(e)&&function(e){return AE.isArray(e)&&!e.some(KE)}(e)||(AE.isFileList(e)||AE.endsWith(n,"[]"))&&(o=AE.toArray(e)))return n=GE(n),o.forEach(function(e,i){!AE.isUndefined(e)&&null!==e&&t.append(!0===r?YE([n],i,s):null===r?n:n+"[]",d(e))}),!1;return!!KE(e)||(t.append(YE(i,n,s),d(e)),!1)}const g=Object.assign(QE,{defaultVisitor:p,convertValue:d,isVisitable:KE});if(!AE.isObject(e))throw new TypeError("data must be an object");return function e(n,i,a=0){if(!AE.isUndefined(n)){if(f(a),-1!==h.indexOf(n))throw new Error("Circular reference detected in "+i.join("."));h.push(n),AE.forEach(n,function(n,s){!0===(!(AE.isUndefined(n)||null===n)&&o.call(t,n,AE.isString(s)?s.trim():s,i,g))&&e(n,i?i.concat(s):[s],a+1)}),h.pop()}}(e),t}function XE(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function JE(e,t){this._pairs=[],e&&$E(e,this,t)}const ZE=JE.prototype;function eS(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function tS(e,t,n){if(!t)return e;e=e||"";const i=AE.isFunction(n)?{serialize:n}:n,a=AE.getSafeProp(i,"encode")||eS,o=AE.getSafeProp(i,"serialize");let s;if(s=o?o(t,i):AE.isURLSearchParams(t)?t.toString():new JE(t,i).toString(a),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}ZE.append=function(e,t){this._pairs.push([e,t])},ZE.toString=function(e){const t=e?t=>e.call(this,t,XE):XE;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const nS=Symbol("internals");function iS(e){return e?e.length:0}function aS(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function oS(e,t){const n=e.handlers,i=iS(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):i!==t.handlersLength&&(i?t.handlerEntries.forEach(function(e,i){n[e.index]!==e.handler&&t.handlerEntries.delete(i)}):t.handlerEntries.clear()),t.handlersLength=i}class sS{constructor(){this.handlers=[],this[nS]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){const i={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},a=this[nS];null==this.handlers&&(this.handlers=[]),oS(this,a);const o=a.nextId++;return this.handlers.push(i),a.handlerEntries.set(o,{handler:i,index:this.handlers.length-1}),a.handlersLength=this.handlers.length,o}eject(e){const t=this[nS];oS(this,t);const n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(aS(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],oS(this,this[nS]))}forEach(e){const t=this[nS];oS(this,t),t.iterationDepth++;try{AE.forEach(this.handlers,function(t){null!==t&&e(t)})}finally{--t.iterationDepth||(oS(this,t),aS(this.handlers),t.handlersLength=iS(this.handlers))}}}const rS={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},lS={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:JE,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},cS="undefined"!=typeof window&&"undefined"!=typeof document,uS="object"==typeof navigator&&navigator||void 0,hS=cS&&(!uS||["ReactNative","NativeScript","NS"].indexOf(uS.product)<0),dS="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,fS=cS&&window.location.href||"http://localhost",pS={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:cS,hasStandardBrowserEnv:hS,hasStandardBrowserWebWorkerEnv:dS,navigator:uS,origin:fS},Symbol.toStringTag,{value:"Module"})),...lS};function gS(e){if(e>100)throw new WE("FormData field is too deeply nested ("+e+" levels). Max depth: 100",WE.ERR_FORM_DATA_DEPTH_EXCEEDED)}function mS(e){function t(e,n,i,a){gS(a);let o=e[a++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),r=a>=e.length;if(o=!o&&AE.isArray(i)?i.length:o,r)return AE.hasOwnProp(i,o)?i[o]=AE.isArray(i[o])?i[o].concat(n):[i[o],n]:i[o]=n,!s;AE.hasOwnProp(i,o)&&AE.isObject(i[o])||(i[o]=[]);return t(e,n,i[o],a)&&AE.isArray(i[o])&&(i[o]=function(e){const t={},n=Object.keys(e);let i;const a=n.length;let o;for(i=0;i<a;i++)o=n[i],t[o]=e[o];return t}(i[o])),!s}if(AE.isFormData(e)&&AE.isFunction(e.entries)){const n={};return AE.forEachEntry(e,(e,i)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let i;for(;null!==(i=n.exec(e));)gS(t.length),t.push("[]"===i[0]?"":i[1]||i[0]);return t}(e),i,n,0)}),n}return null}const vS=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),yS=(e,t)=>null!=e&&AE.hasOwnProp(e,t)?e[t]:void 0;const bS={transitional:rS,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,a=AE.isObject(e);a&&AE.isHTMLForm(e)&&(e=new FormData(e));if(AE.isFormData(e))return i?JSON.stringify(mS(e)):e;if(AE.isArrayBuffer(e)||AE.isBuffer(e)||AE.isStream(e)||AE.isFile(e)||AE.isBlob(e)||AE.isReadableStream(e))return e;if(AE.isArrayBufferView(e))return e.buffer;if(AE.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){const t=yS(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return $E(e,new pS.classes.URLSearchParams,{visitor:function(e,t,n,i){return pS.isNode&&AE.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((o=AE.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=yS(this,"env"),i=n&&n.FormData;return $E(o?{"files[]":e}:e,i&&new i,t)}}return a||i?(t.setContentType("application/json",!1),function(e,t){if(AE.isString(e))try{return(t||JSON.parse)(e),AE.trim(e)}catch(ZNe){if("SyntaxError"!==ZNe.name)throw ZNe}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=yS(this,"transitional")||bS.transitional,n=t&&t.forcedJSONParsing,i=yS(this,"responseType"),a="json"===i;if(AE.isResponse(e)||AE.isReadableStream(e))return e;if(e&&AE.isString(e)&&(n&&!i||a)){const n=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e,yS(this,"parseReviver"))}catch(ZNe){if(n){if("SyntaxError"===ZNe.name)throw WE.from(ZNe,WE.ERR_BAD_RESPONSE,this,null,yS(this,"response"));throw ZNe}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pS.classes.FormData,Blob:pS.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function _S(e,t){const n=this||bS,i=t||n,a=UE.from(i.headers);let o=i.data;return AE.forEach(e,function(e){o=e.call(n,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function wS(e){return!(!e||!e.__CANCEL__)}AE.forEach(vS,e=>{bS.headers[e]={}});class kS extends WE{constructor(e,t,n){super(null==e?"canceled":e,WE.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}}function xS(e,t,n){const i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new WE("Request failed with status code "+n.status,n.status>=400&&n.status<500?WE.ERR_BAD_REQUEST:WE.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const TS=/[\t\n\r]/g;function CS(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(TS,"")}function ES(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}const SS=(e,t,n=3)=>{let i=0;const a=function(e,t){e=e||10;const n=new Array(e),i=new Array(e);let a,o=0,s=0;return t=void 0!==t?t:1e3,function(r){const l=Date.now(),c=i[s];a||(a=l),n[o]=r,i[o]=l;let u=s,h=0;for(;u!==o;)h+=n[u++],u%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),l-a<t)return;const d=c&&l-c;return d?Math.round(1e3*h/d):void 0}}(50,250);return function(e,t){let n,i,a=0,o=1e3/t;const s=(t,o=Date.now())=>{a=o,n=null,i&&(clearTimeout(i),i=null),e(...t)};return[(...e)=>{const t=Date.now(),r=t-a;r>=o?s(e,t):(n=e,i||(i=setTimeout(()=>{i=null,s(n)},o-r)))},()=>n&&s(n),(...e)=>s(e)]}(n=>{if(!n||!AE.isNumber(n.loaded))return;const o=n.loaded,s=n.lengthComputable?n.total:void 0,r=Math.max(0,null!=s?Math.min(o,s):o),l=Math.max(0,r-i),c=a(l);i=Math.max(i,r);e({loaded:r,total:s,progress:s?r/s:void 0,bytes:l,rate:c||void 0,estimated:c&&s?(s-r)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},IS=(e,t)=>{const n=null!=e;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},AS=(e,t=AE.asap)=>(...n)=>t(()=>e(...n)),DS=pS.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,pS.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(pS.origin),pS.navigator&&/(msie|trident)/i.test(pS.navigator.userAgent)):()=>!0,PS=pS.hasStandardBrowserEnv?{write(e,t,n,i,a,o,s){if("undefined"==typeof document)return;const r=["".concat(e,"=").concat(encodeURIComponent(t))];AE.isNumber(n)&&r.push("expires=".concat(new Date(n).toUTCString())),AE.isString(i)&&r.push("path=".concat(i)),AE.isString(a)&&r.push("domain=".concat(a)),!0===o&&r.push("secure"),AE.isString(s)&&r.push("SameSite=".concat(s)),document.cookie=r.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const i=t[n].replace(/^\s+/,""),a=i.indexOf("=");if(-1!==a&&i.slice(0,a)===e)try{return decodeURIComponent(i.slice(a+1))}catch(ZNe){return i.slice(a+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};const OS=/^https?:(?!\/\/)/i;function MS(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,"$1".concat(jE,"@")),n=t.indexOf("#"),i=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,"$1".concat(jE));return-1===n?i:"".concat(i,"#").concat((a=t.slice(n+1))?a.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n="")=>"".concat(t).concat(n).concat(jE)):a);var a}function NS(e,t){if("string"==typeof e){const n=CS(e);if(OS.test(n))throw new WE("Invalid URL ".concat(JSON.stringify(MS(n)),': missing "//" after protocol'),WE.ERR_INVALID_URL,t)}}function RS(e,t,n,i){NS(t,i);let a=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(a||!1===n)?(NS(e,i),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}const LS=e=>e instanceof UE?{...e}:e;function VS(e,t){e=e||{},t=t||{};const n=Object.create(null);function i(e,t,n,i){return AE.isPlainObject(e)&&AE.isPlainObject(t)?AE.merge.call({caseless:i},e,t):AE.isPlainObject(t)?AE.merge({},t):AE.isArray(t)?t.slice():t}function a(e,t,n,a){return AE.isUndefined(t)?AE.isUndefined(e)?void 0:i(void 0,e,0,a):i(e,t,0,a)}function o(e,t){if(!AE.isUndefined(t))return i(void 0,t)}function s(e,t){return AE.isUndefined(t)?AE.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function r(n,a,o){return AE.hasOwnProp(t,o)?i(n,a):AE.hasOwnProp(e,o)?i(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutErrorMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:r,headers:(e,t,n)=>a(LS(e),LS(t),0,!0)};var c;return AE.forEach((c={...e,...t},Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(c).concat(Object.getOwnPropertySymbols(c).filter(e=>Object.getOwnPropertyDescriptor(c,e).enumerable)):Object.keys(c)),function(i){if("__proto__"===i||"constructor"===i||"prototype"===i)return;const o=AE.hasOwnProp(l,i)?l[i]:a,s=o(AE.hasOwnProp(e,i)?e[i]:void 0,AE.hasOwnProp(t,i)?t[i]:void 0,i);AE.isUndefined(s)&&o!==r||(n[i]=s)}),AE.hasOwnProp(t,"validateStatus")&&AE.isUndefined(t.validateStatus)&&!1===function(n){const i=AE.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!AE.isUndefined(i)){if(!AE.isPlainObject(i))return;if(AE.hasOwnProp(i,n))return i[n]}const a=AE.hasOwnProp(e,"transitional")?e.transitional:void 0;if(AE.isPlainObject(a)&&AE.hasOwnProp(a,n))return a[n]}("validateStatusUndefinedResolves")&&(AE.hasOwnProp(e,"validateStatus")?n.validateStatus=i(void 0,e.validateStatus):delete n.validateStatus),n}const qS=["content-type","content-length"];function FS(e){const t=VS({},e),n=e=>AE.hasOwnProp(t,e)?t[e]:void 0,i=n("data");let a=n("withXSRFToken");const o=n("xsrfHeaderName"),s=n("xsrfCookieName");let r=n("headers");const l=n("auth"),c=n("baseURL"),u=n("allowAbsoluteUrls"),h=n("url");if(t.headers=r=UE.from(r),t.url=tS(RS(c,h,u,t),n("params"),n("paramsSerializer")),l){const t=AE.getSafeProp(l,"username")||"",n=AE.getSafeProp(l,"password")||"";try{r.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(ZNe){throw WE.from(ZNe,WE.ERR_BAD_OPTION_VALUE,e)}}if(AE.isFormData(i)){const e=AE.getSafeProp(i,"getHeaders");pS.hasStandardBrowserEnv||pS.hasStandardBrowserWebWorkerEnv||AE.isReactNative(i)?r.setContentType(void 0):AE.isFunction(e)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(([t,n])=>{qS.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}(r,e.call(i),n("formDataHeaderPolicy"))}if(pS.hasStandardBrowserEnv){AE.isFunction(a)&&(a=a(t));if(!0===a||null==a&&DS(t.url)){const e=o&&s&&PS.read(s);e&&r.set(o,e)}}return t}const BS="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const i=FS(e);let a=i.data;const o=UE.from(i.headers).normalize();let s,r,l,c,u,h,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=i;function g(){c&&c(),u&&u(),i.cancelToken&&i.cancelToken.unsubscribe(s),i.signal&&i.signal.removeEventListener("abort",s)}let m=new XMLHttpRequest;function v(a){if(!m)return;if(!(0!==m.status||"file"===(ES(CS(i.url))||ES(pS.origin))||m.responseURL&&m.responseURL.startsWith("file:")))return n(new WE("Request aborted",WE.ECONNABORTED,e,m)),g(),void(m=null);try{a?h&&h(a):u&&u()}catch(s){setTimeout(()=>{throw s})}if(!m)return;const o=UE.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());xS(function(e){t(e),g()},function(e){n(e),g()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:o,config:e,request:m}),m=null}m.open(i.method.toUpperCase(),i.url,!0),m.timeout=i.timeout,"onloadend"in m?m.onloadend=v:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&m.responseURL.startsWith("file:"))&&setTimeout(v)},m.onabort=function(){m&&(n(new WE("Request aborted",WE.ECONNABORTED,e,m)),g(),m=null)},m.onerror=function(t){const i=t&&t.message?t.message:"Network Error",a=new WE(i,WE.ERR_NETWORK,e,m);a.event=t||null,n(a),g(),m=null},m.ontimeout=function(){let t=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const a=i.transitional||rS;i.timeoutErrorMessage&&(t=i.timeoutErrorMessage),n(new WE(t,a.clarifyTimeoutError?WE.ETIMEDOUT:WE.ECONNABORTED,e,m)),g(),m=null},void 0===a&&o.setContentType(null),"setRequestHeader"in m&&AE.forEach(NE(o),function(e,t){m.setRequestHeader(t,e)}),AE.isUndefined(i.withCredentials)||(m.withCredentials=!!i.withCredentials),d&&"json"!==d&&(m.responseType=i.responseType),p&&([l,u,h]=SS(p,!0),m.addEventListener("progress",l)),f&&m.upload&&([r,c]=SS(f),m.upload.addEventListener("progress",r),m.upload.addEventListener("loadend",c)),(i.cancelToken||i.signal)&&(s=t=>{m&&(n(!t||t.type?new kS(null,e,m):t),m.abort(),g(),m=null)},i.cancelToken&&i.cancelToken.subscribe(s),i.signal&&(i.signal.aborted?s():i.signal.addEventListener("abort",s)));const y=ES(i.url);if(y&&!pS.protocols.includes(y))return n(new WE("Unsupported protocol "+y+":",WE.ERR_BAD_REQUEST,e)),void g();m.send(a||null)})},US=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let i=!1;const a=function(e){if(!i){i=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof WE?t:new kS(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,a(new WE("timeout of ".concat(t,"ms exceeded"),WE.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(a):e.removeEventListener("abort",a)}),e=null)};e.forEach(e=>{i||(e.aborted?a.call(e):e.addEventListener("abort",a,{once:!0}))});const{signal:r}=n;return r.unsubscribe=()=>AE.asap(s),r},jS=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let i,a=0;for(;a<n;)i=a+t,yield e.slice(a,i),a=i},HS=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},zS=(e,t,n,i)=>{const a=async function*(e,t){for await(const n of HS(e))yield*jS(n,t)}(e,t);let o,s=0,r=e=>{o||(o=!0,i&&i(e))};return new ReadableStream({async pull(e){try{const{done:t,value:i}=await a.next();if(t)return r(),void e.close();let o=i.byteLength;if(n){let e=s+=o;n(e)}e.enqueue(new Uint8Array(i))}catch(t){throw r(t),t}},cancel:e=>(r(e),a.return())},{highWaterMark:2})},WS=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,KS=(e,t,n)=>t+2<n&&WS(e.charCodeAt(t+1))&&WS(e.charCodeAt(t+2)),GS=e=>e<=57?e-48:(223&e)-55,YS=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,QS=e=>9===e||10===e||12===e||13===e||32===e,$S=e=>{const t=e.length;let n=0,i=0,a=!1;for(let o=0;o<t;o++){let s=e.charCodeAt(o);37===s&&KS(e,o,t)&&(s=16*GS(e.charCodeAt(o+1))+GS(e.charCodeAt(o+2)),o+=2),QS(s)||(61!==s?!YS(s)||i>0?a=!0:n++:i++)}return a||i>2||i>0&&(n+i)%4!=0||n%4==1?(e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)})(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)};function XS(e){const t="string"==typeof e?e.indexOf("#"):-1;return((e,t)=>{if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const i=e.slice(5,n),a=e.slice(n+1);if(/;base64/i.test(i))return t(a);let o=0;for(let s=0,r=a.length;s<r;s++){const e=a.charCodeAt(s);if(37===e&&KS(a,s,r))o+=1,s+=2;else if(e<128)o+=1;else if(e<2048)o+=2;else if(e>=55296&&e<=56319&&s+1<r){const e=a.charCodeAt(s+1);e>=56320&&e<=57343?(o+=4,s++):o+=3}else o+=3}return o})(-1===t?e:e.slice(0,t),$S)}const JS="1.20.0",ZS={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:eI}=AE,tI=e=>{if(!AE.isString(e))return e;try{return decodeURIComponent(e)}catch(eRe){return e}},nI=(e,...t)=>{try{return!!e(...t)}catch(ZNe){return!1}},iI=e=>{const t=void 0!==AE.global&&null!==AE.global?AE.global:globalThis,{ReadableStream:n,TextEncoder:i}=t;e=AE.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:a,Request:o,Response:s}=e,r=a?eI(a):"function"==typeof fetch,l=eI(o),c=eI(s);if(!r)return!1;const u=r&&eI(n),h=r&&("function"==typeof i?(e=>t=>e.encode(t))(new i):async e=>new Uint8Array(await new o(e).arrayBuffer())),d=l&&u&&nI(()=>{let e=!1;const t=new o(pS.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),i=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!i}),f=c&&u&&nI(()=>AE.isReadableStream(new s("").body)),p={stream:f&&(e=>e.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!p[e]&&(p[e]=(t,n)=>{let i=t&&t[e];if(i)return i.call(t);throw new WE("Response type '".concat(e,"' is not supported"),WE.ERR_NOT_SUPPORT,n)})});const g=async e=>{if(null==e)return 0;if(AE.isBlob(e))return e.size;if(AE.isSpecCompliantForm(e)){const t=new o(pS.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return AE.isArrayBufferView(e)||AE.isArrayBuffer(e)?e.byteLength:(AE.isURLSearchParams(e)&&(e+=""),AE.isString(e)?(await h(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:r,signal:c,cancelToken:h,timeout:m,onDownloadProgress:v,onUploadProgress:y,responseType:b,headers:_,withCredentials:w="same-origin",fetchOptions:k,maxContentLength:x,maxBodyLength:T,maxRedirects:C}=FS(e);const E=AE.isNumber(x)&&x>-1,S=AE.isNumber(T)&&T>-1;let I=a||fetch;b=b?(b+"").toLowerCase():"text";let A=US([c,h&&h.toAbortSignal()],m),D=null;const P=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let O,M=null;const N=()=>new WE("Request body larger than maxBodyLength limit",WE.ERR_BAD_REQUEST,e,D);try{let a;const c=(L="auth",AE.hasOwnProp(e,L)?e[L]:void 0);if(c){const e=AE.getSafeProp(c,"username")||"";a={username:e,password:AE.getSafeProp(c,"password")||""}}if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,pS.origin);if(!a&&(e.username||e.password)){const t=tI(e.username);a={username:t,password:tI(e.password)}}(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(a&&(_.delete("authorization"),_.set("Authorization","Basic "+btoa((R=(a.username||"")+":"+(a.password||""),encodeURIComponent(R).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))),E&&"string"==typeof t&&t.startsWith("data:")){if(XS(t)>x)throw new WE("maxContentLength size of "+x+" exceeded",WE.ERR_BAD_RESPONSE,e,D)}if(S&&"get"!==n&&"head"!==n){const e=await g(r);if("number"==typeof e&&isFinite(e)&&(O=e,e>T))throw N()}const h=S&&(AE.isReadableStream(r)||AE.isStream(r)),m=(e,t,n)=>zS(e,65536,e=>{if(S&&e>T)throw M=N();t&&t(e)},n);if(d&&"get"!==n&&"head"!==n&&(y||h)){if(O=null==O?await(async(e,t)=>{const n=AE.toFiniteNumber(e.getContentLength());return null==n?g(t):n})(_,r):O,0!==O||h){let e,n=new o(t,{method:"POST",body:r,duplex:"half"});if(AE.isFormData(r)&&(e=n.headers.get("content-type"))&&_.setContentType(e),n.body){const[e,t]=y&&IS(O,SS(AS(y)))||[];r=m(n.body,e,t)}}}else if(h&&!l&&u&&"get"!==n&&"head"!==n)r=m(r);else if(h&&l&&!d&&"get"!==n&&"head"!==n)throw new WE("Stream request bodies are not supported by the current fetch implementation",WE.ERR_NOT_SUPPORT,e,D);AE.isString(w)||(w=w?"include":"omit");const V=l&&"credentials"in o.prototype;if(AE.isFormData(r)){const e=_.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&_.delete("content-type")}_.set("User-Agent","axios/"+JS,!1);const q=null==k?k:Object.assign(Object.create(null),k);q&&(delete q.body,delete q.headers,delete q.method,delete q.signal,delete q.duplex,delete q.credentials);const F=Object.assign(Object.create(null),q,{signal:A,method:n.toUpperCase(),headers:NE(_.normalize()),body:r,duplex:"half",credentials:V?w:void 0});l&&(AE.forEach(ZS,(e,t)=>{void 0===F[t]&&(F[t]=e)}),void 0===F.signal&&(F.signal=null),void 0===F.body&&(F.body=null)),0===C&&(F.redirect="manual",q&&(q.redirect="manual")),D=l&&new o(t,F);let B=await(l?I(D,q):I(t,F));const U=UE.from(B.headers);if(E){const t=AE.toFiniteNumber(U.getContentLength());if(null!=t&&t>x)throw new WE("maxContentLength size of "+x+" exceeded",WE.ERR_BAD_RESPONSE,e,D)}const j=f&&("stream"===b||"response"===b);if(f&&B.body&&(v||E||j&&P)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=B[e]});const n=AE.toFiniteNumber(U.getContentLength()),[i,a]=v&&IS(n,SS(AS(v),!0))||[];let o=0;const r=t=>{if(E&&(o=t,o>x))throw new WE("maxContentLength size of "+x+" exceeded",WE.ERR_BAD_RESPONSE,e,D);i&&i(t)};B=new s(zS(B.body,65536,r,()=>{a&&a(),P&&P()}),t)}b=b||"text";let H=await p[AE.findKey(p,b)||"text"](B,e);if(E&&!f&&!j){let t;if(null!=H&&("number"==typeof H.byteLength?t=H.byteLength:"number"==typeof H.size?t=H.size:"string"==typeof H&&(t="function"==typeof i?(new i).encode(H).byteLength:H.length)),"number"==typeof t&&t>
vendor: 1,560 bytes, line 3755
3755x)throw new WE("maxContentLength size of "+x+" exceeded",WE.ERR_BAD_RESPONSE,e,D)}return!j&&P&&P(),await new Promise((t,n)=>{xS(t,n,{data:H,headers:UE.from(B.headers),status:B.status,statusText:B.statusText,config:e,request:D})})}catch(V){if(P&&P(),A&&A.aborted&&A.reason instanceof WE){const t=A.reason;throw t.config=e,D&&(t.request=D),V!==t&&Object.defineProperty(t,"cause",{__proto__:null,value:V,writable:!0,enumerable:!1,configurable:!0}),t}if(M)throw D&&!M.request&&(M.request=D),M;if(V instanceof WE)throw D&&!V.request&&(V.request=D),V;if(V&&"TypeError"===V.name&&/Load failed|fetch/i.test(V.message)){const t=new WE("Network Error",WE.ERR_NETWORK,e,D,V&&V.response);throw Object.defineProperty(t,"cause",{__proto__:null,value:V.cause||V,writable:!0,enumerable:!1,configurable:!0}),t}throw WE.from(V,V&&V.code,e,D,V&&V.response)}var R,L}},aI=new Map,oI=e=>{let t=e&&e.env||{};const{fetch:n,Request:i,Response:a}=t,o=[i,a,n];let s,r,l=o.length,c=aI;for(;l--;)s=o[l],r=c.get(s),void 0===r&&c.set(s,r=l?new Map:iI(t)),c=r;return r};oI();const sI={http:null,xhr:BS,fetch:{get:oI}};AE.forEach(sI,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(ZNe){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const rI=e=>"- ".concat(e),lI=e=>AE.isFunction(e)||null===e||!1===e;const cI={getAdapter:function(e,t){e=AE.isArray(e)?e:[e];const{length:n}=e;let i,a;const o={};for(let s=0;s<n;s++){let n;if(i=e[s],a=i,!lI(i)&&(a=sI[(n=String(i)).toLowerCase()],void 0===a))throw new WE("Unknown adapter '".concat(n,"'"));
vendor: 4,467 bytes, line 3755
3755if(a&&(AE.isFunction(a)||(a=a.get(t))))break;o[n||"#"+s]=a}if(!a){const e=Object.entries(o).map(([e,t])=>"adapter ".concat(e," ")+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(rI).join("\n"):" "+rI(e[0]):"as no adapter specified";throw new WE("There is no suitable adapter to dispatch the request "+t,WE.ERR_NOT_SUPPORT)}return a},adapters:sI};function uI(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new kS(null,e)}function hI(e){const t=AE.toSafeFlatObject(e);uI(t),t.headers=UE.from(AE.getSafeProp(t,"headers")),t.data=_S.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return cI.getAdapter(t.adapter||bS.adapter,t)(t).then(function(e){uI(t),t.response=e;try{e.data=_S.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=UE.from(e.headers),e},function(e){if(!wS(e)&&(uI(t),e&&e.response)){t.response=e.response;try{e.response.data=_S.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=UE.from(e.response.headers)}return Promise.reject(e)})}const dI={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{dI[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const fI={};dI.transitional=function(e,t,n){return(i,a,o)=>{if(!1===e)throw new WE(function(e,t){return"[Axios v"+JS+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}(a," has been removed"+(t?" in "+t:"")),WE.ERR_DEPRECATED);return t&&!fI[a]&&(fI[a]=!0),!e||e(i,a,o)}},dI.spelling=function(e){return(e,t)=>!0};const pI={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new WE("options must be an object",WE.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let a=i.length;for(;a-- >0;){const o=i[a],s=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new WE("option "+o+" must be "+n,WE.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new WE("Unknown option "+o,WE.ERR_BAD_OPTION)}},validators:dI},gI=pI.validators;class mI{constructor(e){this.defaults=e||{},this.interceptors={request:new sS,response:new sS}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error)try{let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack;let i="";if("string"==typeof t){const e=t.indexOf("\n");i=-1===e?"":t.slice(e+1)}if(n.stack){if(i){const e=i.indexOf("\n"),t=-1===e?-1:i.indexOf("\n",e+1),a=-1===t?"":i.slice(t+1);String(n.stack).endsWith(a)||(n.stack+="\n"+i)}}else n.stack=i}catch(ZNe){}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=VS(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:a}=t;void 0!==n&&pI.assertOptions(n,{silentJSONParsing:gI.transitional(gI.boolean),forcedJSONParsing:gI.transitional(gI.boolean),clarifyTimeoutError:gI.transitional(gI.boolean),legacyInterceptorReqResOrdering:gI.transitional(gI.boolean),advertiseZstdAcceptEncoding:gI.transitional(gI.boolean),validateStatusUndefinedResolves:gI.transitional(gI.boolean)},!1),null!=i&&(AE.isFunction(i)?t.paramsSerializer={serialize:i}:pI.assertOptions(i,{encode:gI.function,serialize:gI.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),pI.assertOptions(t,{baseUrl:gI.spelling("baseURL"),withXsrfToken:gI.spelling("withXSRFToken")},!0),t.method=(AE.getSafeProp(t,"method")||AE.getSafeProp(this.defaults,"method")||"get").toLowerCase();let o=a&&AE.merge(a.common,a[t.method]);a&&AE.forEach(vS.concat("common"),e=>{delete a[e]}),t.headers=UE.concat(o,a);const s=[];let r=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;r=r&&e.synchronous;const n=t.transitional||rS;n&&n.legacyInterceptorReqResOrdering?s.unshift(e.fulfilled,e.rejected):s.push(e.fulfilled,e.rejected)});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,h=0;if(!r){const e=[hI.bind(this),void 0];for(e.unshift(...s),e.push(...l),u=e.length,c=Promise.resolve(t);h<u;)c=c.then(e[h++],e[h++]);return c}u=s.length;let d=t;for(;h<u;){const e=s[h++],t=s[h++];try{d=e?e(d):d}catch(eRe){if(!t){c=Promise.reject(eRe);break}try{const n=t.call(this,eRe);AE.isThenable(n)&&(c=Promise.resolve(n).then(()=>
vendor: 1,870 bytes, line 3755
3755hI.call(this,d)))}catch(f){c=Promise.reject(f)}break}}if(!c)try{c=hI.call(this,d)}catch(eRe){c=Promise.reject(eRe)}for(h=0,u=l.length;h<u;)c=c.then(l[h++],l[h++]);return c}getUri(e){return tS(RS((e=VS(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}AE.forEach(["delete","get","head","options"],function(e){mI.prototype[e]=function(t,n){return this.request(VS(n||{},{method:e,url:t,data:n&&AE.hasOwnProp(n,"data")?n.data:void 0}))}}),AE.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,i,a){return this.request(VS(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}mI.prototype[e]=t(),"query"!==e&&(mI.prototype[e+"Form"]=t(!0))});class vI{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const i=new Promise(e=>{n.subscribe(e),t=e}).then(e);return i.cancel=function(){n.unsubscribe(t)},i},e(function(e,i,a){n.reason||(n.reason=new kS(e,i,a),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new vI(function(t){e=t}),cancel:e}}}const yI={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
3755alContent: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,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent: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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(yI).forEach(([e,t])=>{void 0===yI[t]&&(yI[t]=e)});const bI=function e(t){const n=new mI(t),i=MC(mI.prototype.request,n);return AE.extend(i,mI.prototype,n,{allOwnKeys:!0}),AE.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(VS(t,n))},i}(bS);bI.Axios=mI,bI.CanceledError=kS,bI.CancelToken=vI,bI.isCancel=wS,bI.VERSION=JS,bI.toFormData=$E,bI.AxiosError=WE,bI.Cancel=bI.CanceledError,bI.all=function(e){return Promise.all(e)},bI.spread=function(e){return function(t){return e.apply(null,t)}},bI.isAxiosError=function(e){return AE.isObject(e)&&!0===e.isAxiosError},bI.mergeConfig=VS,bI.AxiosHeaders=UE,bI.formToJSON=e=>mS(AE.isHTMLForm(e)?new FormData(e):e),bI.getAdapter=cI.getAdapter,bI.HttpStatusCode=yI,bI.default=bI;const _I=bI.create({baseURL:"https://asia-southeast1-xephangqrcode.cloudfunctions.net"});_I.interceptors.request.use(async e=>{if(/^https?:\/\//i.test(e.url||""))return e;try{const t=dp().currentUser;if(t){const n=await t.getIdToken();e.headers.Authorization="Bearer ".concat(n)}}catch(eRe){}return e});const wI=Js("quayStore",{state:()=>({items:[],item:null}),actions:{async fetchItems(){const e=await vT("quay");this.items=e.sort((e,t)=>e.thutu-t.thutu)},async fetchEnableItems(){const e=await vT("quay",[["hoatdong","==",!0]]);this.items=e.sort((e,t)=>e.thutu-t.thutu)},async fetchEnableItemsByDonVi(e){const t=await vT("quay",[["donvi","==",e],["hoatdong","==",!0]]);this.items=t.sort((e,t)=>e.thutu-t.thutu)},async fetchItemsByDonVi(e){const t=await vT("quay",[["donvi","==",e]]);this.items=t.sort((e,t)=>e.thutu-t.thutu)},async realtimeItemsByDonViAndStatus(e,t=!0,n=null){const i=[["donvi","==",e],["hoatdong","==",t]];null!==n&&i.push(["trangthai","==",n]),FT("quay:items",TT("quay",i,null,null,e=>{this.items=e.sort((e,t)=>e.thutu-t.thutu)}))},async fetchItemsByDonViAndManger(e,t,n=!0){const i=await vT("quay",[["donvi","==",e],["quanly","array-contains",t],["hoatdong","==",n]]);this.items=i.sort((e,t)=>e.thutu-t.thutu)},async fetchItemsByManager(e){const t=await vT("quay",[["quanly","array-contains",e]]);this.items=t.sort((e,t)=>e.thutu-t.thutu)},async realtimeItemsForDonVi(e){FT("quay:items",TT("quay",[["donvi","==",e]],null,null,e=>{this.items=e.sort((e,t)=>e.thutu-t.thutu)}))},async realtimeItemsForDonViAndManager(e,t){FT("quay:items",TT("quay",[["donvi","==",e],["quanly","array-contains",t]],null,null,e=>{this.items=e.sort((e,t)=>e.thutu-t.thutu)}))},async fetchItemById(e){this.item=await yT("quay",e)},async realtimeItemById(e){FT("quay:item",xT("quay",e,e=>{this.item=e}))},async addItem(e){await _T("quay",e),await this.fetchItemsByDonVi(e.donvi)},async updateItem(e,t){var n;await wT("quay",e,t);const i=this.items.findIndex(t=>t.id===e);-1!==i&&(this.items[i]={...this.items[i],...t}),(null==(n=this.item)?void 0:n.id)===e&&(this.item={...this.item,...t}),t.donvi&&await this.fetchItemsByDonVi(t.donvi)},async deleteItem(e,t){var n;await kT("quay",e),this.items=this.items.filter(t=>t.id!==e),(null==(n=this.item)?void 0:n.id)===e&&(this.item=null),(null==t?void 0:t.donvi)&&await this.fetchItemsByDonVi(t.donvi)}}}),kI=(e,t)=>{var n,i,a,o;const s=null==(n=null==e?void 0:e.response)?void 0:n.status,r=String(null!=(o=null!=(a=null==(i=null==e?void 0:e.response)?void 0:i.data)?a:null==e?void 0:e.message)?o:"");return(null==e?void 0:e.response)?404===s?"".concat(t,": chưa deploy Cloud Functions cho môi trưá»ng nà y."):/email-already-exists|EMAIL_EXISTS/i.test(r)?"".concat(t,": email nà y Äã ÄÆ°á»£c sá» dụng."):/invalid-email/i.test(r)?"".concat(t,": email không hợp lá»."):/weak.?password|PASSWORD/i.test(r)?"".concat(t,": máºt khẩu phải từ 6 ký tá»± trá» lên."):"".concat(t).concat(r?": ".concat(r):"."):"".concat(t,": không kết ná»i ÄÆ°á»£c máy chá»
3755§. Kiá»m tra API_BASE_URL và Cloud Functions Äã deploy chưa.")},xI=Js("userStore",{state:()=>({users:[],userRole:{}}),actions:{async fetchUsers(){try{const e=ET(),t=JT(),n=wI();await Promise.all([e.getAuthUser(),e.getUserAuthRole(),t.fetchItems()]);const i=e.userAuth,a=e.userRole,o=t.items;let s=[];if((null==a?void 0:a.role)===zT)return void(this.users=[]);let r=(await _I.get("/listUsers")).data;if((null==a?void 0:a.role)===UT){for(const e of o)await Promise.all([n.fetchItemsByDonVi(e.id)]),n.items.length&&s.push(...new Set(eC(n.items,"quanly").flat().map(e=>e.trim())));s=[...new Set(s.flat())],r=r.filter(e=>e.uid===i.uid||s.includes(e.email))}this.users=await Promise.all(r.map(async e=>{const t={},n=await vT("user_role",[["user_id","==",e.uid]]);return n.length&&Object.assign(t,n[0]),a.role==UT&&t.role==BT?null:{...e,role:t}})).then(e=>e.filter(e=>null!==e))}catch(eRe){}},async addUser(e){const t=await _I.post("/createUser",e).catch(e=>{throw new Error(kI(e,"Tạo tà i khoản thất bại"))});return this.users.push({...e,uid:t.data.uid}),t.data},async deleteUser(e){await _I.post("/deleteUser",{uid:e}).catch(e=>{throw new Error(kI(e,"Xoá tà i khoản thất bại"))}),this.users=this.users.filter(t=>t.uid!==e)},async fetchUserRoleByUserId(e){var t;try{const n=await vT("user_role",[["user_id","==",e]]);this.userRole=null!=(t=n[0])?t:null}catch(eRe){}},async addRoleCondition(e){const t=ET();await Promise.all([t.getAuthUser(),t.getUserAuthRole()]);const n=t.userAuth,i=t.userRole;i&&i.role===UT&&e.push(["quanly","array-contains",null==n?void 0:n.email])},async fetchUsersByDonVi(e=null){try{const t=ET(),n=JT(),i=wI();await Promise.all([t.getAuthUser(),t.getUserAuthRole()]);const a=t.userAuth,o=t.userRole;let s=(await _I.get("/listUsers")).data;if(e){await Promise.all([n.fetchItemById(e),i.fetchItemsByDonVi(e)]);const t=n.item,r=i.items.length?[...new Set(eC(i.items,"quanly").flat().map(e=>e.trim()))]:[];if((null==o?void 0:o.role)===BT&&t){const e=(null==t?void 0:t.quanly)||[];s=s.filter(t=>e.includes(t.email)||r.includes(t.email))}(null==o?void 0:o.role)===UT&&(s=s.filter(e=>e.uid===a.uid||r.includes(e.email)))}this.users=await Promise.all(s.map(async e=>{const t={},n=await vT("user_role",[["user_id","==",e.uid]]);return n.length&&Object.assign(t,n[0]),o.role==UT&&t.role==BT?null:{...e,role:t}})).then(e=>e.filter(e=>null!==e))}catch(eRe){}},async updateUserRole(e,t){await _I.post("/setUserRole",{uid:e,role:t}).catch(e=>{throw new Error(kI(e,"Cáºp nháºt vai trò thất bại"))});const n=this.users.findIndex(t=>t.uid===e);return-1!==n&&(this.users[n].role?this.users[n].role.role=t:this.users[n].role={role:t}),!0},resetPassword:async(e,t)=>(await _I.post("/resetPassword",{uid:e,password:t}).catch(e=>{throw new Error(kI(e,"Äá»i máºt khẩu thất bại"))}),!0)}}); 3756/*! 3757* sweetalert2 v11.26.25 3758* Released under the MIT License. 3759*/ 3760function TI(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function CI(e,t){return e.get(TI(e,t))}function EI(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}const SI={},II=e=>new Promise(t=>{if(!e)return t();const n=window.scrollX,i=window.scrollY;SI.restoreFocusTimeout=setTimeout(()=>{SI.previousActiveElement instanceof HTMLElement?(SI.previousActiveElement.focus(),SI.previousActiveElement=null):document.body&&document.body.focus(),t()},100),window.scrollTo(n,i)}),AI="swal2-",DI=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error","draggable","dragging"].reduce((e,t)=>
3760(e[t]=AI+t,e),{}),PI=["success","warning","info","question","error"].reduce((e,t)=>(e[t]=AI+t,e),{}),OI=e=>e.charAt(0).toUpperCase()+e.slice(1),MI=[],NI=(e,t=null)=>{var n;n='"'.concat(e,'" is deprecated and will be removed in the next major release.').concat(t?' Use "'.concat(t,'" instead.'):""),MI.includes(n)||MI.push(n)},RI=e=>"function"==typeof e?e():e,LI=e=>e&&"function"==typeof e.toPromise,VI=e=>LI(e)?e.toPromise():Promise.resolve(e),qI=e=>e&&Promise.resolve(e)===e,FI=()=>document.body.querySelector(".".concat(DI.container)),BI=e=>{const t=FI();return t?t.querySelector(e):null},UI=e=>BI(".".concat(e)),jI=()=>UI(DI.popup),HI=()=>UI(DI.icon),zI=()=>UI(DI.title),WI=()=>UI(DI["html-container"]),KI=()=>UI(DI.image),GI=()=>UI(DI["progress-steps"]),YI=()=>UI(DI["validation-message"]),QI=()=>BI(".".concat(DI.actions," .").concat(DI.confirm)),$I=()=>BI(".".concat(DI.actions," .").concat(DI.cancel)),XI=()=>BI(".".concat(DI.actions," .").concat(DI.deny)),JI=()=>BI(".".concat(DI.loader)),ZI=()=>UI(DI.actions),eA=()=>UI(DI.footer),tA=()=>UI(DI["timer-progress-bar"]),nA=()=>UI(DI.close),iA=()=>{const e=jI();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(t).sort((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0"),i=parseInt(t.getAttribute("tabindex")||"0");return n>i?1:n<i?-1:0}),i=e.querySelectorAll('\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n'),a=Array.from(i).filter(e=>"-1"!==e.getAttribute("tabindex"));return[...new Set(n.concat(a))].filter(e=>wA(e))},aA=()=>rA(document.body,DI.shown)&&!rA(document.body,DI["toast-shown"])&&!rA(document.body,DI["no-backdrop"]),oA=()=>{const e=jI();return!!e&&rA(e,DI.toast)},sA=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html"),i=n.querySelector("head");i&&Array.from(i.childNodes).forEach(t=>{e.appendChild(t)});const a=n.querySelector("body");a&&Array.from(a.childNodes).forEach(t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)})}},rA=(e,t)=>!!t&&t.split(/\s+/).every(t=>e.classList.contains(t)),lA=(e,t,n)=>{if(((e,t)=>{Array.from(e.classList).forEach(n=>{Object.values(DI).includes(n)||Object.values(PI).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)})})(e,t),!t.customClass)return;const i=t.customClass[n];i&&("string"==typeof i||i.forEach?dA(e,i):"Invalid type of customClass.".concat(n,'! Expected string or iterable object, got "').concat(typeof i,'"'))},cA=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(".".concat(DI.popup," > .").concat(DI[t]));case"checkbox":return e.querySelector(".".concat(DI.popup," > .").concat(DI.checkbox," input"));case"radio":return e.querySelector(".".concat(DI.popup," > .").concat(DI.radio," input:checked"))||e.querySelector(".".concat(DI.popup," > .").concat(DI.radio," input:first-child"));case"range":return e.querySelector(".".concat(DI.popup," > .").concat(DI.range," input"));default:return e.querySelector(".".concat(DI.popup," > .").concat(DI.input))}},uA=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},hA=(e,t,n)=>{if(!e||!t)return;const i="string"==typeof t?t.split(/\s+/).filter(Boolean):t;(Array.isArray(e)?e:[e]).forEach(e=>{i.forEach(t=>{n?e.classList.add(t):e.classList.remove(t)})})},dA=(e,t)=>{hA(e,t,!0)},fA=(e,t)=>{hA(e,t,!1)},pA=(e,t)=>Array.from(e.children).find(e=>e instanceof HTMLElement&&rA(e,t)),gA=(e,t,n)=>{n==="".concat(parseInt("".concat(n)))&&(n=parseInt(n)),n||0===n?e.style.setProperty(t,"number"==typeof n?"".concat(n,"px"):n):e.style.removeProperty(t)},mA=(e,t="flex")=>{e&&(e.style.display=t)},vA=e=>{e&&(e.style.display="none")},yA=(e,t="block")=>{e&&new MutationObserver(()=>{_A(e,e.innerHTML,t)}).observe(e,{childList:!0,subtree:!0})},bA=(e,t,n,i)=>{const a=e.querySelector(t);a&&a.style.setProperty(n,i)},_A=(e,t,n="flex")=>{t?mA(e,n):vA(e)},wA=e=>Boolean(e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),kA=e=>Boolean(e.scrollHeight>e.clientHeight),xA=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),i=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||i>0},TA=(e,t=!1)=>{const n=tA();n&&wA(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout(()=>{n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"},10))},CA='\n <div aria-labelledby="'.concat(DI.title,'" aria-describedby="').concat(DI["html-container"],'" class="').concat(DI.popup,'" tabindex="-1">\n <button type="button" class="').concat(DI.close,'"></button>\n <ul class="').concat(DI["progress-steps"],'"></ul>\n <div class="').concat(DI.icon,'"></div>\n <img class="').concat(DI.image,'" />\n <h2 class="').concat(DI.title,'" id="').concat(DI.title,'"></h2>\n <div class="').concat(DI["html-container"],'" id="').concat(DI["html-container"],'"></div>\n <input class="').concat(DI.input,'" id="').concat(DI.input,'" />\n <input type="file" class="').concat(DI.file,'" />\n <div class="').concat(DI.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat(DI.select,'" id="').concat(DI.select,'"></select>\n <div class="').concat(DI.radio,'"></div>\n <label class="').concat(DI.checkbox,'">\n <input type="checkbox" id="').concat(DI.checkbox,'" />\n <span class="').concat(DI.label,'"></span>\n </label>\n <textarea class="').concat(DI.textarea,'" id="').concat(DI.textarea,'"></textarea>\n <div class="').concat(DI["validation-message"],'" id="').concat(DI["validation-message"],'"></div>\n <div class="').concat(DI.actions,'">\n <div class="').concat(DI.loader,'"></div>\n <button type="button" class="').concat(DI.confirm,'"></button>\n <button type="button" class="').concat(DI.deny,'"></button>\n <button type="button" class="').concat(DI.cancel,'"></button>\n </div>\n <div class="').concat(DI.footer,'"></div>\n <div class="').concat(DI["timer-progress-bar-container"],'">\n <div class="').concat(DI["timer-progress-bar"],'"></div>\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),EA=()=>{SI.currentInstance&&SI.currentInstance.resetValidationMessage()},SA=e=>{const t=(()=>{const e=FI();return!!e&&(e.remove(),fA([document.documentElement,document.body],[DI["no-backdrop"],DI["toast-shown"],DI["has-column"]]),!0)})();if("undefined"==typeof window||"undefined"==typeof document)return;const n=document.createElement("div");n.className=DI.container,t&&dA(n,DI["no-transition"]),sA(n,CA),n.dataset.swal2Theme=e.theme;const i=(e=>{if("string"==typeof e){const t=document.querySelector(e);
3760if(!t)throw new Error('Target element "'.concat(e,'" not found'));return t}return e})(e.target||"body");i.appendChild(n),e.topLayer&&(n.setAttribute("popover",""),n.showPopover()),(e=>{const t=jI();t&&(t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true"))})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&(dA(FI(),DI.rtl),SI.isRTL=!0)})(i),(()=>{const e=jI();if(!e)return;const t=pA(e,DI.input),n=pA(e,DI.file),i=e.querySelector(".".concat(DI.range," input")),a=e.querySelector(".".concat(DI.range," output")),o=pA(e,DI.select),s=e.querySelector(".".concat(DI.checkbox," input")),r=pA(e,DI.textarea);t&&(t.oninput=EA),n&&(n.onchange=EA),o&&(o.onchange=EA),s&&(s.onchange=EA),r&&(r.oninput=EA),i&&a&&(i.oninput=()=>{EA(),a.value=i.value},i.onchange=()=>{EA(),a.value=i.value})})()},IA=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?AA(e,t):e&&sA(t,e)},AA=(e,t)=>{"jquery"in e?DA(t,e):sA(t,e.toString())},DA=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},PA=(e,t)=>{const n=ZI(),i=JI();n&&i&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?mA(n):vA(n),lA(n,t,"actions"),function(e,t,n){const i=QI(),a=XI(),o=$I();if(!i||!a||!o)return;OA(i,"confirm",n),OA(a,"deny",n),OA(o,"cancel",n),function(e,t,n,i){if(!i.buttonsStyling)return void fA([e,t,n],DI.styled);dA([e,t,n],DI.styled);const a=[[e,"confirm",i.confirmButtonColor],[t,"deny",i.denyButtonColor],[n,"cancel",i.cancelButtonColor]];a.forEach(([e,t,n])=>{n&&e.style.setProperty("--swal2-".concat(t,"-button-background-color"),n),function(e){const t=window.getComputedStyle(e);if(t.getPropertyValue("--swal2-action-button-focus-box-shadow"))return;const n=t.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/,"rgba($1, $2, $3, 0.5)");e.style.setProperty("--swal2-action-button-focus-box-shadow",t.getPropertyValue("--swal2-outline").replace(/ rgba\(.*/," ".concat(n)))}(e)})}(i,a,o,n),n.reverseButtons&&(n.toast?(e.insertBefore(o,i),e.insertBefore(a,i)):(e.insertBefore(o,t),e.insertBefore(a,t),e.insertBefore(i,t)))}(n,i,t),sA(i,t.loaderHtml||""),lA(i,t,"loader"))};function OA(e,t,n){const i=OI(t);_A(e,n["show".concat(i,"Button")],"inline-block"),sA(e,n["".concat(t,"ButtonText")]||""),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]||""),e.className=DI[t],lA(e,n,"".concat(t,"Button"))}const MA=(e,t)=>{const n=FI();n&&(!function(e,t){"string"==typeof t?e.style.background=t:t||dA([document.documentElement,document.body],DI["no-backdrop"])}(n,t.backdrop),function(e,t){if(!t)return;dA(e,t in DI?DI[t]:DI.center)}(n,t.position),function(e,t){if(!t)return;dA(e,DI["grow-".concat(t)])}(n,t.grow),lA(n,t,"container"))};var NA={innerParams:new WeakMap,domCache:new WeakMap,focusedElement:new WeakMap};const RA=["input","file","range","select","radio","checkbox","textarea"],LA=e=>{if(!e.input)return;if(!HA[e.input])return void"Unexpected type of input! Expected ".concat(Object.keys(HA).join(" | "),', got "').concat(e.input,'"');const t=UA(e.input);if(!t)return;const n=HA[e.input](t,e);mA(t),e.inputAutoFocus&&setTimeout(()=>{uA(n)})},VA=(e,t)=>{const n=jI();if(!n)return;const i=cA(n,e);if(i){(e=>{for(const{name:t}of Array.from(e.attributes))["id","type","value","style"].includes(t)||e.removeAttribute(t)})(i);for(const e in t)i.setAttribute(e,t[e])}},qA=e=>{if(!e.input)return;const t=UA(e.input);t&&lA(t,e,"input")},FA=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},BA=(e,t,n)=>{if(n.inputLabel){const i=document.createElement("label"),a=DI["input-label"];i.setAttribute("for",e.id),i.className=a,"object"==typeof n.customClass&&dA(i,n.customClass.inputLabel),i.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",i)}},UA=e=>{const t=jI();if(t)return pA(t,DI[e]||DI.input)},jA=(e,t)=>{["string","number"].includes(typeof t)?e.value="".concat(t):qI(t)||'Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof t,'"')},HA={};HA.text=HA.email=HA.password=HA.number=HA.tel=HA.url=HA.search=HA.date=HA["datetime-local"]=HA.time=HA.week=HA.month=(e,t)=>{const n=e;return jA(n,t.inputValue),BA(n,n,t),FA(n,t),n.type=t.input,n},HA.file=(e,t)=>
vendor: 2,810 bytes, line 3760
3760{const n=e;return BA(n,n,t),FA(n,t),n},HA.range=(e,t)=>{const n=e,i=n.querySelector("input"),a=n.querySelector("output");return i&&(jA(i,t.inputValue),i.type=t.input,BA(i,e,t)),a&&jA(a,t.inputValue),e},HA.select=(e,t)=>{const n=e;if(n.textContent="",t.inputPlaceholder){const e=document.createElement("option");sA(e,t.inputPlaceholder),e.value="",e.disabled=!0,e.selected=!0,n.appendChild(e)}return BA(n,n,t),n},HA.radio=e=>(e.textContent="",e),HA.checkbox=(e,t)=>{const n=jI();if(!n)throw new Error("Popup not found");const i=cA(n,"checkbox");if(!i)throw new Error("Checkbox input not found");i.value="1",i.checked=Boolean(t.inputValue);const a=e.querySelector("span");if(a){const e=t.inputPlaceholder||t.inputLabel;e&&sA(a,e)}return i},HA.textarea=(e,t)=>{const n=e;jA(n,t.inputValue),FA(n,t),BA(n,n,t);return setTimeout(()=>{if("MutationObserver"in window){const e=jI();if(!e)return;const i=parseInt(window.getComputedStyle(e).width);new MutationObserver(()=>{if(!document.body.contains(n))return;const e=n.offsetWidth+(a=n,parseInt(window.getComputedStyle(a).marginLeft)+parseInt(window.getComputedStyle(a).marginRight));var a;const o=jI();o&&(e>i?o.style.width="".concat(e,"px"):gA(o,"width",t.width))}).observe(n,{attributes:!0,attributeFilter:["style"]})}}),n};const zA=(e,t)=>{const n=WI();n&&(yA(n),lA(n,t,"htmlContainer"),t.html?(IA(t.html,n),mA(n,"block")):t.text?(n.textContent=t.text,mA(n,"block")):vA(n),((e,t)=>{const n=jI();if(!n)return;const i=NA.innerParams.get(e),a=!i||t.input!==i.input;RA.forEach(e=>{const i=pA(n,DI[e]);i&&(VA(e,t.inputAttributes),i.className=DI[e],a&&vA(i))}),t.input&&(a&&LA(t),qA(t))})(e,t))},WA=(e,t)=>{for(const[n,i]of Object.entries(PI))t.icon!==n&&fA(e,i);dA(e,t.icon&&PI[t.icon]),YA(e,t),KA(),lA(e,t,"icon")},KA=()=>{const e=jI();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color");e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix").forEach(e=>{e.style.backgroundColor=t})},GA=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,i="";if(t.iconHtml)i=QA(t.iconHtml);else if("success"===t.icon)i=(e=>"\n ".concat(e.animation?'<div class="swal2-success-circular-line-left"></div>':"",'\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div>\n ').concat(e.animation?'<div class="swal2-success-fix"></div>':"","\n ").concat(e.animation?'<div class="swal2-success-circular-line-right"></div>':"","\n"))(t),n=n.replace(/ style=".*?"/g,"");else if("error"===t.icon)i='\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n';else if(t.icon){i=QA({question:"?",warning:"!",info:"i"}[t.icon])}n.trim()!==i.trim()&&sA(e,i)},YA=(e,t)=>
3760{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])bA(e,n,"background-color",t.iconColor);bA(e,".swal2-success-ring","border-color",t.iconColor)}},QA=e=>'<div class="'.concat(DI["icon-content"],'">').concat(e,"</div>");let $A=!1,XA=0,JA=0,ZA=0,eD=0;const tD=e=>{const t=jI();if(!t)return;const n=HI();if(e.target===t||n&&n.contains(e.target)){$A=!0;const n=aD(e);XA=n.clientX,JA=n.clientY,ZA=parseInt(t.style.insetInlineStart)||0,eD=parseInt(t.style.insetBlockStart)||0,dA(t,"swal2-dragging")}},nD=e=>{const t=jI();if(t&&$A){let{clientX:n,clientY:i}=aD(e);const a=n-XA;t.style.insetInlineStart="".concat(ZA+(SI.isRTL?-a:a),"px"),t.style.insetBlockStart="".concat(eD+(i-JA),"px")}},iD=()=>{const e=jI();$A=!1,fA(e,"swal2-dragging")},aD=e=>{const t=e.type.startsWith("touch")?e.touches[0]:e;return{clientX:t.clientX,clientY:t.clientY}},oD=(e,t)=>{const n=FI(),i=jI();if(n&&i){if(t.toast){gA(n,"width",t.width),i.style.width="100%";const e=JI();e&&i.insertBefore(e,HI())}else gA(i,"width",t.width);gA(i,"padding",t.padding),t.color&&(i.style.color=t.color),t.background&&(i.style.background=t.background),vA(YI()),sD(i,t),t.draggable&&!t.toast?(dA(i,DI.draggable),(e=>{e.addEventListener("mousedown",tD),document.body.addEventListener("mousemove",nD),e.addEventListener("mouseup",iD),e.addEventListener("touchstart",tD),document.body.addEventListener("touchmove",nD),e.addEventListener("touchend",iD)})(i)):(fA(i,DI.draggable),(e=>{e.removeEventListener("mousedown",tD),document.body.removeEventListener("mousemove",nD),e.removeEventListener("mouseup",iD),e.removeEventListener("touchstart",tD),document.body.removeEventListener("touchmove",nD),e.removeEventListener("touchend",iD)})(i))}},sD=(e,t)=>{const n=t.showClass||{};e.className="".concat(DI.popup," ").concat(wA(e)?n.popup:""),t.toast?(dA([document.documentElement,document.body],DI["toast-shown"]),dA(e,DI.toast)):dA(e,DI.modal),lA(e,t,"popup"),"string"==typeof t.customClass&&dA(e,t.customClass),t.icon&&dA(e,DI["icon-".concat(t.icon)])},rD=e=>{const t=document.createElement("li");return dA(t,DI["progress-step"]),sA(t,e),t},lD=e=>{const t=document.createElement("li");return dA(t,DI["progress-step-line"]),e.progressStepsDistance&&gA(t,"width",e.progressStepsDistance),t},cD=(e,t)=>{var n;oD(0,t),MA(0,t),((e,t)=>{const n=GI();if(!n)return;const{progressSteps:i,currentProgressStep:a}=t;i&&0!==i.length&&void 0!==a?(mA(n),n.textContent="",i.length,i.forEach((e,o)=>{const s=rD(e);if(n.appendChild(s),o===a&&dA(s,DI["active-progress-step"]),o!==i.length-1){const e=lD(t);n.appendChild(e)}})):vA(n)})(0,t),((e,t)=>{const n=NA.innerParams.get(e),i=HI();if(!i)return;if(n&&t.icon===n.icon)return GA(i,t),void WA(i,t);if(!t.icon&&!t.iconHtml)return void vA(i);if(t.icon&&-1===Object.keys(PI).indexOf(t.icon))return'Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"'),void vA(i);mA(i),GA(i,t),WA(i,t),dA(i,t.showClass&&t.showClass.icon),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",KA)})(e,t),((e,t)=>{const n=KI();n&&(t.imageUrl?(mA(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),gA(n,"width",t.imageWidth),gA(n,"height",t.imageHeight),n.className=DI.image,lA(n,t,"image")):vA(n))})(0,t),((e,t)=>{const n=zI();
vendor: 12,736 bytes, line 3760
3760n&&(yA(n),_A(n,Boolean(t.title||t.titleText),"block"),t.title&&IA(t.title,n),t.titleText&&(n.innerText=t.titleText),lA(n,t,"title"))})(0,t),((e,t)=>{const n=nA();n&&(sA(n,t.closeButtonHtml||""),lA(n,t,"closeButton"),_A(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))})(0,t),zA(e,t),PA(0,t),((e,t)=>{const n=eA();n&&(yA(n),_A(n,Boolean(t.footer),"block"),t.footer&&IA(t.footer,n),lA(n,t,"footer"))})(0,t);const i=jI();"function"==typeof t.didRender&&i&&t.didRender(i),null===(n=SI.eventEmitter)||void 0===n||n.emit("didRender",i)},uD=()=>{var e;return null===(e=QI())||void 0===e?void 0:e.click()},hD=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),dD=e=>{if(e.keydownTarget&&e.keydownHandlerAdded&&e.keydownHandler){const t=e.keydownHandler;e.keydownTarget.removeEventListener("keydown",t,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1}},fD=(e,t)=>{var n;const i=iA();return i.length?(-2===(e+=t)&&(e=i.length-1),e===i.length?e=0:-1===e&&(e=i.length-1),i[e].focus(),!(navigator.userAgent.includes("Firefox")&&i[e]instanceof HTMLIFrameElement)):(null===(n=jI())||void 0===n||n.focus(),!0)},pD=["ArrowRight","ArrowDown"],gD=["ArrowLeft","ArrowUp"],mD=(e,t,n)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?vD(t,e):"Tab"===t.key?yD(t):[...pD,...gD].includes(t.key)?bD(t.key):"Escape"===t.key&&_D(t,e,n)))},vD=(e,t)=>{if(!RI(t.allowEnterKey))return;const n=jI();if(!n||!t.input)return;const i=cA(n,t.input);if(e.target&&i&&e.target instanceof HTMLElement&&e.target.outerHTML===i.outerHTML){if(["textarea","file"].includes(t.input))return;uD(),e.preventDefault()}},yD=e=>{const t=e.target,n=iA().findIndex(e=>e===t);let i=!0;i=e.shiftKey?fD(n,-1):fD(n,1),e.stopPropagation(),i&&e.preventDefault()},bD=e=>{const t=ZI(),n=QI(),i=XI(),a=$I();if(!(t&&n&&i&&a))return;const o=[n,i,a];if(document.activeElement instanceof HTMLElement&&!o.includes(document.activeElement))return;const s=pD.includes(e)?"nextElementSibling":"previousElementSibling";let r=document.activeElement;if(r){for(let e=0;e<t.children.length;e++){if(r=r[s],!r)return;if(r instanceof HTMLButtonElement&&wA(r))break}r instanceof HTMLButtonElement&&r.focus()}},_D=(e,t,n)=>{e.preventDefault(),RI(t.allowEscapeKey)&&n(hD.esc)};var wD={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const kD=()=>{Array.from(document.body.children).forEach(e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")})},xD="undefined"!=typeof window&&Boolean(window.GestureEvent),TD=xD&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,CD=()=>{const e=FI();if(!e)return;let t;e.ontouchstart=e=>{t=ED(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},ED=e=>{const t=e.target,n=FI(),i=WI();return!(!n||!i)&&(!SD(e)&&!ID(e)&&(t===n||!(kA(n)||!(t instanceof HTMLElement)||((e,t)=>{let n=e;for(;n&&n!==t;){if(kA(n))return!0;n=n.parentElement}return!1})(t,i)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||kA(i)&&i.contains(t))))},SD=e=>Boolean(e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType),ID=e=>e.touches&&e.touches.length>1;let AD=null;const DD=e=>{null===AD&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(AD=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(AD+(()=>{const e=document.createElement("div");e.className=DI["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})(),"px"))};function PD(e,t,n,i){oA()?FD(e,i):(II(n).then(()=>FD(e,i)),dD(SI)),xD?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),aA()&&(null!==AD&&(document.body.style.paddingRight="".concat(AD,"px"),AD=null),(()=>{if(rA(document.body,DI.iosfix)){const e=parseInt(document.body.style.top,10);fA(document.body,DI.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),kD()),fA([document.documentElement,document.body],[DI.shown,DI["height-auto"],DI["no-backdrop"],DI["toast-shown"]])}function OD(e){e=LD(e);const t=wD.swalPromiseResolve.get(this),n=MD(this);this.isAwaitingPromise?e.isDismissed||(RD(this),t(e)):n&&t(e)}const MD=e=>{const t=jI();if(!t)return!1;const n=NA.innerParams.get(e);if(!n||rA(t,n.hideClass.popup))return!1;fA(t,n.showClass.popup),dA(t,n.hideClass.popup);const i=FI();return fA(i,n.showClass.backdrop),dA(i,n.hideClass.backdrop),VD(e,t,n),!0};function ND(e){const t=wD.swalPromiseReject.get(this);RD(this),t&&t(e)}const RD=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,NA.innerParams.get(e)||e._destroy())},LD=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),VD=(e,t,n)=>{var i;const a=FI(),o=xA(t);"function"==typeof n.willClose&&n.willClose(t),null===(i=SI.eventEmitter)||void 0===i||i.emit("willClose",t),o&&a?qD(e,t,a,Boolean(n.returnFocus),n.didClose):a&&PD(e,a,Boolean(n.returnFocus),n.didClose)},qD=(e,t,n,i,a)=>{SI.swalCloseEventFinishedCallback=PD.bind(null,e,n,i,a);const o=function(e){var n;e.target===t&&(null===(n=SI.swalCloseEventFinishedCallback)||void 0===n||n.call(SI),delete SI.swalCloseEventFinishedCallback,t.removeEventListener("animationend",o),t.removeEventListener("transitionend",o))};t.addEventListener("animationend",o),t.addEventListener("transitionend",o)},FD=(e,t)=>{setTimeout(()=>{var n;"function"==typeof t&&t.bind(e.params)(),null===(n=SI.eventEmitter)||void 0===n||n.emit("didClose"),e._destroy&&e._destroy()})},BD=e=>{let t=jI();if(t||new yO,t=jI(),!t)return;const n=JI();oA()?vA(HI()):UD(t,e),mA(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},UD=(e,t)=>{const n=ZI(),i=JI();n&&i&&(!t&&wA(QI())&&(t=QI()),mA(n),t&&(vA(t),i.setAttribute("data-button-to-replace",t.className),n.insertBefore(i,t)),dA([e,n],DI.loading))},jD=e=>e.checked?1:0,HD=e=>e.checked?e.value:null,zD=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,WD=(e,t)=>{const n=jI();if(!n)return;const i=e=>{"select"===t.input?function(e,t,n){const i=pA(e,DI.select);if(!i)return;const a=(e,t,i)=>{const a=document.createElement("option");a.value=i,sA(a,t),a.selected=YD(i,n.inputValue),e.appendChild(a)};t.forEach(e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,i.appendChild(e),n.forEach(t=>a(e,t[1],t[0]))}else a(i,n,t)}),i.focus()}(n,GD(e),t):"radio"===t.input&&function(e,t,n){const i=pA(e,DI.radio);if(!i)return;t.forEach(e=>{const t=e[0],a=e[1],o=document.createElement("input"),s=document.createElement("label");o.type="radio",o.name=DI.radio,o.value=t,YD(t,n.inputValue)&&(o.checked=!0);const r=document.createElement("span");sA(r,a),r.className=DI.label,s.appendChild(o),s.appendChild(r),i.appendChild(s)});const a=i.querySelectorAll("input");a.length&&a[0].focus()}(n,GD(e),t)};LI(t.inputOptions)||qI(t.inputOptions)?(BD(QI()),VI(t.inputOptions).then(t=>{e.hideLoading(),i(t)})):"object"==typeof t.inputOptions?i(t.inputOptions):"Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof t.inputOptions)},KD=(e,t)=>{const n=e.getInput();n&&(vA(n),VI(t.inputValue).then(i=>{n.value="number"===t.input?"".concat(parseFloat(i)||0):"".concat(i),mA(n),n.focus(),e.hideLoading()}).catch(t=>{"Error in inputValue promise: ".concat(t),n.value="",mA(n),n.focus(),e.hideLoading()}))};const GD=e=>(e instanceof Map?Array.from(e):Object.entries(e)).map(([e,t])=>[e,"object"==typeof t?GD(t):t]),YD=(e,t)=>Boolean(t)&&null!=t&&t.toString()===e.toString(),QD=(e,t)=>{const n=NA.innerParams.get(e);if(!n.input)return void'The "input" parameter is needed to be set when using returnInputValueOn'.concat(OI(t));const i=e.getInput(),a=((e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return jD(n);case"radio":return HD(n);case"file":return zD(n);default:return t.inputAutoTrim?n.value.trim():n.value}})(e,n);n.inputValidator?$D(e,a,t):i&&!i.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||i.validationMessage)):"deny"===t?XD(e,a):eP(e,a)},$D=(e,t,n)=>{const i=NA.innerParams.get(e);e.disableInput();Promise.resolve().then(()=>VI(i.inputValidator(t,i.validationMessage))).then(i=>{e.enableButtons(),e.enableInput(),i?e.showValidationMessage(i):"deny"===n?XD(e,t):eP(e,t)})},XD=(e,t)=>{const n=NA.innerParams.get(e);if(n.showLoaderOnDeny&&BD(XI()),n.preDeny){e.isAwaitingPromise=!0;Promise.resolve().then(()=>VI(n.preDeny(t,n.validationMessage))).then(n=>{!1===n?(e.hideLoading(),RD(e)):e.close({isDenied:!0,value:void 0===n?t:n})}).catch(t=>ZD(e,t))}else e.close({isDenied:!0,value:t})},JD=(e,t)=>{e.close({isConfirmed:!0,value:t})},ZD=(e,t)=>{e.rejectPromise(t)},eP=(e,t)=>{const n=NA.innerParams.get(e);if(n.showLoaderOnConfirm&&BD(),n.preConfirm){e.resetValidationMessage(),e.isAwaitingPromise=!0;Promise.resolve().then(()=>VI(n.preConfirm(t,n.validationMessage))).then(n=>{wA(YI())||!1===n?(e.hideLoading(),RD(e)):JD(e,void 0===n?t:n)}).catch(t=>ZD(e,t))}else JD(e,t)};function tP(){const e=NA.innerParams.get(this);if(!e)return;const t=NA.domCache.get(this);vA(t.loader),oA()?e.icon&&mA(HI()):nP(t),fA([t.popup,t.actions],DI.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),this.enableButtons()}const nP=e=>{const t=e.loader.getAttribute("data-button-to-replace"),n=t?e.popup.getElementsByClassName(t):[];n.length?mA(n[0],"inline-block"):wA(QI())||wA(XI())||wA($I())||vA(e.actions)};function iP(){const e=NA.innerParams.get(this),t=NA.domCache.get(this);return t?cA(t.popup,e.input):null}function aP(e,t,n){const i=NA.domCache.get(e);t.forEach(e=>{i[e].disabled=n})}function oP(e,t){const n=jI();if(n&&e)if("radio"===e.type){n.querySelectorAll('[name="'.concat(DI.radio,'"]')).forEach(e=>{e.disabled=t})}else e.disabled=t}function sP(){aP(this,["confirmButton","denyButton","cancelButton"],!1);const e=NA.focusedElement.get(this);e instanceof HTMLElement&&document.activeElement===document.body&&e.focus(),NA.focusedElement.delete(this)}function rP(){NA.focusedElement.set(this,document.activeElement),aP(this,["confirmButton","denyButton","cancelButton"],!0)}function lP(){oP(this.getInput(),!1)}function cP(){oP(this.getInput(),!0)}function uP(e){const t=NA.domCache.get(this),n=NA.innerParams.get(this);sA(t.validationMessage,e),t.validationMessage.className=DI["validation-message"],n.customClass&&n.customClass.validationMessage&&dA(t.validationMessage,n.customClass.validationMessage),mA(t.validationMessage);const i=this.getInput();i&&(i.setAttribute("aria-invalid","true"),i.setAttribute("aria-describedby",DI["validation-message"]),uA(i),dA(i,DI.inputerror))}function hP(){const e=NA.domCache.get(this);e.validationMessage&&vA(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),fA(t,DI.inputerror))}const dP={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,draggable:!1,animation:!0,theme:"light",showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose
3760:void 0,didDestroy:void 0,scrollbarPadding:!0,topLayer:!1},fP=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","draggable","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","theme","willClose"],pP={allowEnterKey:void 0},gP=["allowOutsideClick","allowEnterKey","backdrop","draggable","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],mP=e=>Object.prototype.hasOwnProperty.call(dP,e),vP=e=>-1!==fP.indexOf(e),yP=e=>pP[e],bP=e=>{mP(e)||'Unknown parameter "'.concat(e,'"')},_P=e=>{gP.includes(e)&&'The parameter "'.concat(e,'" is incompatible with toasts')},wP=e=>{const t=yP(e);t&&NI(e,t)},kP=e=>{!1===e.backdrop&&e.allowOutsideClick,e.theme&&!["light","dark","auto","minimal","borderless","bootstrap-4","bootstrap-4-light","bootstrap-4-dark","bootstrap-5","bootstrap-5-light","bootstrap-5-dark","material-ui","material-ui-light","material-ui-dark","embed-iframe","bulma","bulma-light","bulma-dark"].includes(e.theme)&&'Invalid theme "'.concat(e.theme,'"');for(const t in e)bP(t),e.toast&&_P(t),wP(t)};function xP(e){const t=FI(),n=jI(),i=NA.innerParams.get(this);if(!n||rA(n,i.hideClass.popup))return;const a=TP(e),o=Object.assign({},i,a);kP(o),t&&(t.dataset.swal2Theme=o.theme),cD(this,o),NA.innerParams.set(this,o),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const TP=e=>{const t={};return Object.keys(e).forEach(n=>{if(vP(n)){const i=e;t[n]=i[n]}else"Invalid parameter to update: ".concat(n)}),t};function CP(){var e;const t=NA.domCache.get(this),n=NA.innerParams.get(this);n?(t.popup&&SI.swalCloseEventFinishedCallback&&(SI.swalCloseEventFinishedCallback(),delete SI.swalCloseEventFinishedCallback),"function"==typeof n.didDestroy&&n.didDestroy(),null===(e=SI.eventEmitter)||void 0===e||e.emit("didDestroy"),EP(this)):SP(this)}const EP=e=>{SP(e),delete e.params,delete SI.keydownHandler,delete SI.keydownTarget,delete SI.currentInstance},SP=e=>{e.isAwaitingPromise?(IP(NA,e),e.isAwaitingPromise=!0):(IP(wD,e),IP(NA,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},IP=(e,t)=>{for(const n in e)e[n].delete(t)};var AP=Object.freeze({__proto__:null,_destroy:CP,close:OD,closeModal:OD,closePopup:OD,closeToast:OD,disableButtons:rP,disableInput:cP,disableLoading:tP,enableButtons:sP,enableInput:lP,getInput:iP,handleAwaitingPromise:RD,hideLoading:tP,rejectPromise:ND,resetValidationMessage:hP,showValidationMessage:uP,update:xP});const DP=(e,t,n)=>{t.popup.onclick=()=>{e&&(PP(e)||e.timer||e.input)||n(hD.close)}},PP=e=>Boolean(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let OP=!1;const MP=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(OP=!0)}}},NP=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(OP=!0)}}},RP=(e,t,n)=>{t.container.onclick=i=>{OP?OP=!1:i.target===t.container&&RI(e.allowOutsideClick)&&n(hD.backdrop)}},LP=e=>e instanceof Element||(e=>"object"==typeof e&&null!==e&&"jquery"in e)(e);const VP=()=>{if(SI.timeout)return(()=>{const e=tA();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width="".concat(n,"%")})(),SI.timeout.stop()},qP=()=>{if(SI.timeout){const e=SI.timeout.start();return TA(e),e}};let FP=!1;const BP={};const UP=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in BP){const n=t.getAttribute&&t.getAttribute(e);
vendor: 3,214 bytes, line 3760
3760if(n)return void BP[e].fire({template:n})}};SI.eventEmitter=new class{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)}once(e,t){const n=(...i)=>{this.removeListener(e,n),t.apply(this,i)};this.on(e,n)}emit(e,...t){this._getHandlersByEventName(e).forEach(e=>{try{e.apply(this,t)}catch(eRe){}})}removeListener(e,t){const n=this._getHandlersByEventName(e),i=n.indexOf(t);i>-1&&n.splice(i,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}};var jP=Object.freeze({__proto__:null,argsToParams:e=>{const t={};return"object"!=typeof e[0]||LP(e[0])?["title","html","icon"].forEach((n,i)=>{const a=e[i];"string"==typeof a||LP(a)?t[n]=a:void 0!==a&&"Unexpected type of ".concat(n,'! Expected "string" or "Element", got ').concat(typeof a)}):Object.assign(t,e[0]),t},bindClickHandler:function(e="data-swal-template"){BP[e]=this,FP||(document.body.addEventListener("click",UP),FP=!0)},clickCancel:()=>{var e;return null===(e=$I())||void 0===e?void 0:e.click()},clickConfirm:uD,clickDeny:()=>{var e;return null===(e=XI())||void 0===e?void 0:e.click()},enableLoading:BD,fire:function(...e){return new this(...e)},getActions:ZI,getCancelButton:$I,getCloseButton:nA,getConfirmButton:QI,getContainer:FI,getDenyButton:XI,getFocusableElements:iA,getFooter:eA,getHtmlContainer:WI,getIcon:HI,getIconContent:()=>UI(DI["icon-content"]),getImage:KI,getInputLabel:()=>UI(DI["input-label"]),getLoader:JI,getPopup:jI,getProgressSteps:GI,getTimerLeft:()=>SI.timeout&&SI.timeout.getTimerLeft(),getTimerProgressBar:tA,getTitle:zI,getValidationMessage:YI,increaseTimer:e=>{if(SI.timeout){const t=SI.timeout.increase(e);return TA(t,!0),t}},isDeprecatedParameter:yP,isLoading:()=>{const e=jI();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:()=>Boolean(SI.timeout&&SI.timeout.isRunning()),isUpdatableParameter:vP,isValidParameter:mP,isVisible:()=>wA(jI()),mixin:function(e){return class extends(this){_main(t,n){return super._main(t,Object.assign({},e,n))}}},off:(e,t)=>{SI.eventEmitter&&(e?t?SI.eventEmitter.removeListener(e,t):SI.eventEmitter.removeAllListeners(e):SI.eventEmitter.reset())},on:(e,t)=>{SI.eventEmitter&&SI.eventEmitter.on(e,t)},once:(e,t)=>{SI.eventEmitter&&SI.eventEmitter.once(e,t)},resumeTimer:qP,showLoading:BD,stopTimer:VP,toggleTimer:()=>{const e=SI.timeout;return e&&(e.running?VP():qP())}});class HP{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const zP=["swal-title","swal-html","swal-footer"],WP=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach(e=>
3760{ZP(e,["name","value"]);const n=e.getAttribute("name"),i=e.getAttribute("value");n&&i&&(t[n]=n in dP&&"boolean"==typeof dP[n]?"false"!==i:n in dP&&"object"==typeof dP[n]?JSON.parse(i):i)}),t},KP=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach(e=>{const n=e.getAttribute("name"),i=e.getAttribute("value");n&&i&&(t[n]=new Function("return ".concat(i))())}),t},GP=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach(e=>{ZP(e,["type","color","aria-label"]);const n=e.getAttribute("type");if(!n||!["confirm","cancel","deny"].includes(n))return;t["".concat(n,"ButtonText")]=e.innerHTML,t["show".concat(OI(n),"Button")]=!0;const i=e.getAttribute("color");null!==i&&(t["".concat(n,"ButtonColor")]=i);const a=e.getAttribute("aria-label");null!==a&&(t["".concat(n,"ButtonAriaLabel")]=a)}),t},YP=e=>{const t={},n=e.querySelector("swal-image");if(n){ZP(n,["src","width","height","alt"]);const e=n.getAttribute("src");null!==e&&(t.imageUrl=e||void 0);const i=n.getAttribute("width");null!==i&&(t.imageWidth=i||void 0);const a=n.getAttribute("height");null!==a&&(t.imageHeight=a||void 0);const o=n.getAttribute("alt");null!==o&&(t.imageAlt=o||void 0)}return t},QP=e=>{const t={},n=e.querySelector("swal-icon");return n&&(ZP(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},$P=e=>{const t={},n=e.querySelector("swal-input");n&&(ZP(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const i=Array.from(e.querySelectorAll("swal-input-option"));return i.length&&(t.inputOptions={},i.forEach(e=>{ZP(e,["value"]);const n=e.getAttribute("value");if(!n)return;const i=e.innerHTML;t.inputOptions[n]=i})),t},XP=(e,t)=>{const n={};for(const i in t){const a=t[i],o=e.querySelector(a);o&&(ZP(o,[]),n[a.replace(/^swal-/,"")]=o.innerHTML.trim())}return n},JP=e=>{const t=zP.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach(e=>{const n=e.tagName.toLowerCase();t.includes(n)||"Unrecognized element <".concat(n,">")})},ZP=(e,t)=>{Array.from(e.attributes).forEach(n=>{-1===t.indexOf(n.name)&&('Unrecognized attribute "'.concat(n.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(t.length?"Allowed attributes are: ".concat(t.join(", ")):"To set the value, use HTML within the element."))})},eO=e=>{var t,n;const i=FI(),a=jI();if(!i||!a)return;"function"==typeof e.willOpen&&e.willOpen(a),null===(t=SI.eventEmitter)||void 0===t||t.emit("willOpen",a);const o=window.getComputedStyle(document.body).overflowY;if(aO(i,a,e),setTimeout(()=>{nO(i,a)},10),aA()&&(iO(i,void 0!==e.scrollbarPadding&&e.scrollbarPadding,o),(()=>{const e=FI();Array.from(document.body.children).forEach(t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))})})()),TD&&!1===e.backdrop&&a.scrollHeight>i.clientHeight&&(i.style.pointerEvents="auto"),oA()||SI.previousActiveElement||(SI.previousActiveElement=document.activeElement),"function"==typeof e.didOpen){const t=e.didOpen;setTimeout(()=>t(a))}null===(n=SI.eventEmitter)||void 0===n||n.emit("didOpen",a)},tO=e=>{const t=jI();if(!t||e.target!==t)return;const n=FI();n&&(t.removeEventListener("animationend",tO),t.removeEventListener("transitionend",tO),n.style.overflowY="auto",fA(n,DI["no-transition"]))},nO=(e,t)=>{xA(t)?(e.style.overflowY="hidden",t.addEventListener("animationend",tO),t.addEventListener("transitionend",tO)):e.style.overflowY="auto"},iO=(e,t,n)=>{(()=>{if(xD&&!rA(document.body,DI.iosfix)){const e=document.body.scrollTop;document.body.style.top="".concat(-1*e,"px"),dA(document.body,DI.iosfix),CD()}})(),t&&"hidden"!==n&&DD(n),setTimeout(()=>{e.scrollTop=0})}
vendor: 2,480 bytes, line 3760
3760,aO=(e,t,n)=>{var i;null!==(i=n.showClass)&&void 0!==i&&i.backdrop&&dA(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),mA(t,"grid"),setTimeout(()=>{var e;null!==(e=n.showClass)&&void 0!==e&&e.popup&&dA(t,n.showClass.popup),t.style.removeProperty("opacity")},10)):mA(t,"grid"),dA([document.documentElement,document.body],DI.shown),n.heightAuto&&n.backdrop&&!n.toast&&dA([document.documentElement,document.body],DI["height-auto"])};var oO=(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),sO=(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL");function rO(e){!function(e){e.inputValidator||("email"===e.input&&(e.inputValidator=oO),"url"===e.input&&(e.inputValidator=sO))}(e),e.showLoaderOnConfirm&&e.preConfirm,function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),SA(e)}let lO;var cO=new WeakMap;class uO{constructor(...e){if(EI(this,cO,Promise.resolve({isConfirmed:!1,isDenied:!1,isDismissed:!0})),"undefined"==typeof window)return;lO=this;const t=Object.freeze(this.constructor.argsToParams(e));var n,i,a;this.params=t,this.isAwaitingPromise=!1,n=cO,i=this,a=this._main(lO.params),n.set(TI(n,i),a)}_main(e,t={}){if(kP(Object.assign({},t,e)),SI.currentInstance){const e=wD.swalPromiseResolve.get(SI.currentInstance),{isAwaitingPromise:t}=SI.currentInstance;SI.currentInstance._destroy(),t||e({isDismissed:!0}),aA()&&kD()}SI.currentInstance=lO;const n=dO(e,t);rO(n),Object.freeze(n),SI.timeout&&(SI.timeout.stop(),delete SI.timeout),clearTimeout(SI.restoreFocusTimeout);const i=fO(lO);return cD(lO,n),NA.innerParams.set(lO,n),hO(lO,i,n)}then(e){return CI(cO,this).then(e)}finally(e){return CI(cO,this).finally(e)}}const hO=(e,t,n)=>new Promise((i,a)=>{const o=t=>{e.close({isDismissed:!0,dismiss:t,isConfirmed:!1,isDenied:!1})};wD.swalPromiseResolve.set(e,i),wD.swalPromiseReject.set(e,a),t.confirmButton.onclick=()=>{(e=>{const t=NA.innerParams.get(e);e.disableButtons(),t.input?QD(e,"confirm"):eP(e,!0)})(e)},t.denyButton.onclick=()=>{(e=>{const t=NA.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?QD(e,"deny"):XD(e,!1)})(e)},t.cancelButton.onclick=()=>{((e,t)=>
vendor: 4,529 bytes, line 3760
3760{e.disableButtons(),t(hD.cancel)})(e,o)},t.closeButton.onclick=()=>{o(hD.close)},((e,t,n)=>{e.toast?DP(e,t,n):(MP(t),NP(t),RP(e,t,n))})(n,t,o),((e,t,n)=>{if(dD(e),!t.toast){const i=e=>mD(t,e,n);e.keydownHandler=i;const a=t.keydownListenerCapture?window:jI();if(a){e.keydownTarget=a,e.keydownListenerCapture=t.keydownListenerCapture;const n=i;e.keydownTarget.addEventListener("keydown",n,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0}}})(SI,n,o),((e,t)=>{"select"===t.input||"radio"===t.input?WD(e,t):["text","email","number","tel","textarea"].some(e=>e===t.input)&&(LI(t.inputValue)||qI(t.inputValue))&&(BD(QI()),KD(e,t))})(e,n),eO(n),pO(SI,n,o),gO(t,n),setTimeout(()=>{t.container.scrollTop=0})}),dO=(e,t)=>{const n=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return JP(n),Object.assign(WP(n),KP(n),GP(n),YP(n),QP(n),$P(n),XP(n,zP))})(e),i=Object.assign({},dP,t,n,e);return i.showClass=Object.assign({},dP.showClass,i.showClass),i.hideClass=Object.assign({},dP.hideClass,i.hideClass),!1===i.animation&&(i.showClass={backdrop:"swal2-noanimation"},i.hideClass={}),i},fO=e=>{const t={popup:jI(),container:FI(),actions:ZI(),confirmButton:QI(),denyButton:XI(),cancelButton:$I(),loader:JI(),closeButton:nA(),validationMessage:YI(),progressSteps:GI()};return NA.domCache.set(e,t),t},pO=(e,t,n)=>{const i=tA();vA(i),t.timer&&(e.timeout=new HP(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&i&&(mA(i),lA(i,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&TA(t.timer)})))},gO=(e,t)=>{if(!t.toast)return RI(t.allowEnterKey)?void(mO(e)||vO(e,t)||fD(-1,1)):(NI("allowEnterKey","preConfirm: () => false"),void e.popup.focus())},mO=e=>{const t=Array.from(e.popup.querySelectorAll("[autofocus]"));for(const n of t)if(n instanceof HTMLElement&&wA(n))return n.focus(),!0;return!1},vO=(e,t)=>t.focusDeny&&wA(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&wA(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!wA(e.confirmButton))&&(e.confirmButton.focus(),!0);uO.prototype.disableButtons=rP,uO.prototype.enableButtons=sP,uO.prototype.getInput=iP,uO.prototype.disableInput=cP,uO.prototype.enableInput=lP,uO.prototype.hideLoading=tP,uO.prototype.disableLoading=tP,uO.prototype.showValidationMessage=uP,uO.prototype.resetValidationMessage=hP,uO.prototype.close=OD,uO.prototype.closePopup=OD,uO.prototype.closeModal=OD,uO.prototype.closeToast=OD,uO.prototype.rejectPromise=ND,uO.prototype.update=xP,uO.prototype._destroy=CP,Object.assign(uO,jP),Object.keys(AP).forEach(e=>{uO[e]=function(...t){if(lO&&lO[e])return lO[e](...t)}}),uO.DismissReason=hD,uO.version="11.26.25";const yO=uO;yO.default=yO,"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(i){n.innerText=t}}(document,':root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.15s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: transparent;--swal2-input-transition: border-color 0.2s, box-shadow 0.2s;--swal2-input-hover-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-focus-border: 1px solid #b4dbed;--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-footer-border-color: #eee;--swal2-footer-background: transparent;--swal2-footer-color: inherit;--swal2-timer-progress-bar-background: rgba(0, 0, 0, 0.3);--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.2s, box-shadow 0.2s;--swal2-close-button-outline: initial;
3760--swal2-close-button-box-shadow: inset 0 0 0 3px transparent;--swal2-close-button-focus-box-shadow: inset var(--swal2-outline);--swal2-close-button-hover-transform: none;--swal2-actions-justify-content: center;--swal2-actions-width: auto;--swal2-actions-margin: 1.25em auto 0;--swal2-actions-padding: 0;--swal2-actions-border-radius: 0;--swal2-actions-background: transparent;--swal2-action-button-transition: background-color 0.2s, box-shadow 0.2s;--swal2-action-button-hover: black 10%;--swal2-action-button-active: black 10%;--swal2-confirm-button-box-shadow: none;--swal2-confirm-button-border-radius: 0.25em;--swal2-confirm-button-background-color: #7066e0;--swal2-confirm-button-color: #fff;--swal2-deny-button-box-shadow: none;--swal2-deny-button-border-radius: 0.25em;--swal2-deny-button-background-color: #dc3741;--swal2-deny-button-color: #fff;--swal2-cancel-button-box-shadow: none;--swal2-cancel-button-border-radius: 0.25em;--swal2-cancel-button-background-color: #6e7881;--swal2-cancel-button-color: #fff;--swal2-toast-show-animation: swal2-toast-show 0.5s;--swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards;--swal2-toast-border: none;--swal2-toast-box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.075), 0 1px 2px hsl(0deg 0% 0% / 0.075), 1px 2px 4px hsl(0deg 0% 0% / 0.075), 1px 3px 8px hsl(0deg 0% 0% / 0.075), 2px 4px 16px hsl(0deg 0% 0% / 0.075)}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:auto}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end
vendor: 12,791 bytes, line 3760
3760";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:var(--swal2-backdrop-transition);-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container)[popover]{width:auto;border:0}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;overflow-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:var(--swal2-actions-justify-content);width:var(--swal2-actions-width);margin:var(--swal2-actions-margin);padding:var(--swal2-actions-padding);border-radius:var(--swal2-actions-border-radius);background:var(--swal2-actions-background)}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:var(--swal2-action-button-transition);border:none;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border-radius:var(--swal2-confirm-button-border-radius);background:initial;background-color:var(--swal2-confirm-button-background-color);box-shadow:var(--swal2-confirm-button-box-shadow);color:var(--swal2-confirm-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):active{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border-radius:var(--swal2-deny-button-border-radius);background:initial;background-color:var(--swal2-deny-button-background-color);box-shadow:var(--swal2-deny-button-box-shadow);color:var(--swal2-deny-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):active{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border-radius:var(--swal2-cancel-button-border-radius);background:initial;background-color:var(--swal2-cancel-button-background-color);box-shadow:var(--swal2-cancel-button-box-shadow);color:var(--swal2-cancel-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):active{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none;box-shadow:var(--swal2-action-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-styled)[disabled]:not(.swal2-loading){opacity:.4}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);background:var(--swal2-footer-background);color:var(--swal2-footer-color);font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:var(--swal2-timer-progress-bar-background)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:var(--swal2-close-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;overflow-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:var(--swal2-input-transition);border:var(--swal2-input-border);border-radius:var(--swal2-input-border-radius);background:var(--swal2-input-background);box-shadow:var(--swal2-input-box-shadow);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):hover,div:where(.swal2-container) input:where(.swal2-file):hover,div:where(.swal2-container) textarea:where(.swal2-textarea):hover{box-shadow:var(--swal2-input-hover-box-shadow)}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:var(--swal2-input-focus-border);outline:none;box-shadow:var(--swal2-input-focus-box-shadow)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:
3760"!
vendor: 11,078 bytes, line 3760
3760";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;zoom:var(--swal2-icon-zoom);border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;border:var(--swal2-toast-border);background:var(--swal2-background);box-shadow:var(--swal2-toast-box-shadow);pointer-events:auto}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-toast.swal2-show{animation:var(--swal2-toast-show-animation)}.swal2-toast.swal2-hide{animation:var(--swal2-toast-hide-animation)}@keyframes swal2-show{0%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}100%{transform:translate3d(0, 0, 0) scale(1);opacity:1}}@keyframes swal2-hide{0%{transform:translate3d(0, 0, 0) scale(1);opacity:1}100%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}
3760');const bO=({title:e,text:t="",confirmButtonText:n="Äá»ng ý",nguyHiem:i=!1})=>yO.fire({title:e,text:t,showCancelButton:!0,confirmButtonText:n,cancelButtonText:"Huá»·",buttonsStyling:!1,reverseButtons:!1,customClass:{popup:"hop-thoai",title:"hop-thoai-dau",htmlContainer:"hop-thoai-than",actions:"hop-thoai-nut",confirmButton:"hop-thoai-nut-cai ".concat(i?"nut-nguy-hiem":"nut-dong-y"),cancelButton:"hop-thoai-nut-cai nut-huy"}}),_O=e=>{yO.fire({icon:"success",title:"Success",text:e,timer:2e3,showConfirmButton:!1})},wO=(e,t)=>bO({title:e,text:t}),kO=()=>bO({title:"Bạn muá»n xoá dữ liá»u?",text:"Dữ liá»u Äã xoá không khôi phục lại ÄÆ°á»£c.",confirmButtonText:"Xoá",nguyHiem:!0});function xO(e){return 0!==e&&(!(!Array.isArray(e)||0!==e.length)||!e)}function TO(e){return e.filter(e=>!e.$isLabel)}function CO(e,t){return n=>n.reduce((n,i)=>i[e]&&i[e].length?(n.push({$groupLabel:i[t],$isLabel:!0}),n.concat(i[e])):n,[])}const EO=(...e)=>t=>e.reduce((e,t)=>t(e),t);var SO={data(){return{search:"",isOpen:!1,preferredOpenDirection:"below",optimizedHeight:this.maxHeight}},props:{internalSearch:{type:Boolean,default:!0},options:{type:Array,required:!0},multiple:{type:Boolean,default:!1},trackBy:{type:String},label:{type:String},searchable:{type:Boolean,default:!0},clearOnSelect:{type:Boolean,default:!0},hideSelected:{type:Boolean,default:!1},placeholder:{type:String,default:"Select option"},allowEmpty:{type:Boolean,default:!0},resetAfter:{type:Boolean,default:!1},closeOnSelect:{type:Boolean,default:!0},customLabel:{type:Function,default:(e,t)=>xO(e)?"":t?e[t]:e},taggable:{type:Boolean,default:!1},tagPlaceholder:{type:String,default:"Press enter to create a tag"},tagPosition:{type:String,default:"top"},max:{type:[Number,Boolean],default:!1},id:{default:null},optionsLimit:{type:Number,default:1e3},groupValues:{type:String},groupLabel:{type:String},groupSelect:{type:Boolean,default:!1},blockKeys:{type:Array,default:()=>[]},preserveSearch:{type:Boolean,default:!1},preselectFirst:{type:Boolean,default:!1},preventAutofocus:{type:Boolean,default:!1},filteringSortFunc:{type:Function,default:null}},mounted(){!this.multiple&&this.max,this.preselectFirst&&!this.internalValue.length&&this.options.length&&this.select(this.filteredOptions[0])},computed:{internalValue(){return this.modelValue||0===this.modelValue?Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]:[]},filteredOptions(){const e=this.search||"",t=e.toLowerCase().trim();let n=this.options.concat();var i;return n=this.internalSearch?this.groupValues?this.filterAndFlat(n,t,this.label):this.filterOptions(n,t,this.label,this.customLabel):this.groupValues?CO(this.groupValues,this.groupLabel)(n):n,n=this.hideSelected?n.filter((i=this.isSelected,(...e)=>!i(...e))):n,this.taggable&&t.length&&!this.isExistingOption(t)&&("bottom"===this.tagPosition?n.push({isTag:!0,label:e}):n.unshift({isTag:!0,label:e})),n.slice(0,this.optionsLimit)},valueKeys(){return this.trackBy?this.internalValue.map(e=>e[this.trackBy]):this.internalValue},optionKeys(){return(this.groupValues?this.flatAndStrip(this.options):this.options).map(e=>this.customLabel(e,this.label).toString().toLowerCase())},currentOptionLabel(){return this.multiple?this.searchable?"":this.placeholder:this.internalValue.length?this.getOptionLabel(this.internalValue[0]):this.searchable?"":this.placeholder}},watch:{internalValue:{handler(){this.resetAfter&&this.internalValue.length&&(this.search="",this.$emit("update:modelValue",this.multiple?[]:null))},deep:!0},search(){this.$emit("search-change",this.search)}},emits:["open","search-change","close","select","update:modelValue","remove","tag"],methods:{getValue(){return this.multiple?this.internalValue:0===this.internalValue.length?null:this.internalValue[0]},filterAndFlat(e,t,n){return EO(this.filterGroups(t,n,this.groupValues,this.groupLabel,this.customLabel),CO(this.groupValues,this.groupLabel))(e)},flatAndStrip(e){return EO(CO(this.groupValues,this.groupLabel),TO)(e)},updateSearch(e){this.search=e},isExistingOption(e){return!!this.options&&this.optionKeys.indexOf(e)>-1},isSelected(e){const t=this.trackBy?e[this.trackBy]:e;return this.valueKeys.indexOf(t)>-1},isOptionDisabled:e=>!!e.$isDisabled,getOptionLabel(e){if(xO(e))return"";if(e.isTag)return e.label;if(e.$isLabel)return e.$groupLabel;const t=this.customLabel(e,this.label);return xO(t)?"":t},select(e,t){if(e.$isLabel&&this.groupSelect)this.selectGroup(e);else if(!(-1!==this.blockKeys.indexOf(t)||this.disabled||e.$isDisabled||e.$isLabel)&&(!this.max||!this.multiple||this.internalValue.length!==this.max)&&("Tab"!==t||this.pointerDirty)){if(e.isTag)this.$emit("tag",e.label,this.id),this.search="",this.closeOnSelect&&!this.multiple&&this.deactivate();else{if(this.isSelected(e))return void("Tab"!==t&&this.removeElement(e));this.multiple?this.$emit("update:modelValue",this.internalValue.concat([e])):this.$emit("update:modelValue",e),this.$emit("select",e,this.id),this.clearOnSelect&&(this.search="")}this.closeOnSelect&&this.deactivate()}},selectGroup(e){const t=this.options.find(t=>t[this.groupLabel]===e.$groupLabel);if(t){if(this.wholeGroupSelected(t)){this.$emit("remove",t[this.groupValues],this.id);const e=this.trackBy?t[this.groupValues].map(e=>e[this.trackBy]):t[this.groupValues],n=this.internalValue.filter(t=>-1===e.indexOf(this.trackBy?t[this.trackBy]:t));this.$emit("update:modelValue",n)}else{const e=t[this.groupValues].filter(e=>!(this.isOptionDisabled(e)||this.isSelected(e)));this.max&&e.splice(this.max-this.internalValue.length),this.$emit("select",e,this.id),this.$emit("update:modelValue",this.internalValue.concat(e))}this.closeOnSelect&&this.deactivate()}},wholeGroupSelected(e){return e[this.groupValues].every(e=>this.isSelected(e)||this.isOptionDisabled(e))},wholeGroupDisabled(e){return e[this.groupValues].every(this.isOptionDisabled)}
3760,removeElement(e,t=!0){if(this.disabled)return;if(e.$isDisabled)return;if(!this.allowEmpty&&this.internalValue.length<=1)return void this.deactivate();const n="object"==typeof e?this.valueKeys.indexOf(e[this.trackBy]):this.valueKeys.indexOf(e);if(this.multiple){const e=this.internalValue.slice(0,n).concat(this.internalValue.slice(n+1));this.$emit("update:modelValue",e)}else this.$emit("update:modelValue",null);this.$emit("remove",e,this.id),this.closeOnSelect&&t&&this.deactivate()},removeLastElement(){-1===this.blockKeys.indexOf("Delete")&&0===this.search.length&&Array.isArray(this.internalValue)&&this.internalValue.length&&this.removeElement(this.internalValue[this.internalValue.length-1],!1)},activate(){this.isOpen||this.disabled||(this.adjustPosition(),this.groupValues&&0===this.pointer&&this.filteredOptions.length&&(this.pointer=1),this.isOpen=!0,this.searchable?(this.preserveSearch||(this.search=""),this.preventAutofocus||this.$nextTick(()=>this.$refs.search&&this.$refs.search.focus())):this.preventAutofocus||void 0!==this.$el&&this.$el.focus(),this.$emit("open",this.id))},deactivate(){this.isOpen&&(this.isOpen=!1,this.searchable?null!==this.$refs.search&&void 0!==this.$refs.search&&this.$refs.search.blur():void 0!==this.$el&&this.$el.blur(),this.preserveSearch||(this.search=""),this.$emit("close",this.getValue(),this.id))},toggle(){this.isOpen?this.deactivate():this.activate()},adjustPosition(){if("undefined"==typeof window)return;const e=this.$el.getBoundingClientRect().top,t=window.innerHeight-this.$el.getBoundingClientRect().bottom;t>this.maxHeight||t>e||"below"===this.openDirection||"bottom"===this.openDirection?(this.preferredOpenDirection="below",this.optimizedHeight=Math.min(t-40,this.maxHeight)):(this.preferredOpenDirection="above",this.optimizedHeight=Math.min(e-40,this.maxHeight))},filterOptions(e,t,n,i){return t?e.filter(e=>{return a=i(e,n),o=t,void 0===a&&(a="undefined"),null===a&&(a="null"),!1===a&&(a="false"),-1!==a.toString().toLowerCase().indexOf(o.trim());var a,o}).sort((e,t)=>"function"==typeof this.filteringSortFunc?this.filteringSortFunc(e,t):i(e,n).length-i(t,n).length):e},filterGroups(e,t,n,i,a){return o=>o.map(o=>{if(!o[n])return[];const s=this.filterOptions(o[n],e,t,a);return s.length?{[i]:o[i],[n]:s}:[]})}}},IO={name:"vue-multiselect",mixins:[SO,{data:()=>({pointer:0,pointerDirty:!1}),props:{showPointer:{type:Boolean,default:!0},optionHeight:{type:Number,default:40}},computed:{pointerPosition(){return this.pointer*this.optionHeight},visibleElements(){return this.optimizedHeight/this.optionHeight}},watch:{filteredOptions(){this.pointerAdjust()},isOpen(){this.pointerDirty=!1},pointer(){this.$refs.search&&this.$refs.search.setAttribute("aria-activedescendant",this.id+"-"+this.pointer.toString())}},methods:{optionHighlight(e,t){return{"multiselect__option--highlight":e===this.pointer&&this.showPointer,"multiselect__option--selected":this.isSelected(t)}},groupHighlight(e,t){if(!this.groupSelect)return["multiselect__option--disabled",{"multiselect__option--group":t.$isLabel}];const n=this.options.find(e=>e[this.groupLabel]===t.$groupLabel);return n&&!this.wholeGroupDisabled(n)?["multiselect__option--group",{"multiselect__option--highlight":e===this.pointer&&this.showPointer},{"multiselect__option--group-selected":this.wholeGroupSelected(n)}]:"multiselect__option--disabled"},addPointerElement({key:e}="Enter"){this.filteredOptions.length>0&&this.select(this.filteredOptions[this.pointer],e),this.pointerReset()},pointerForward(){this.pointer<this.filteredOptions.length-1&&(this.pointer++,this.$refs.list.scrollTop<=this.pointerPosition-(this.visibleElements-1)*this.optionHeight&&(this.$refs.list.scrollTop=this.pointerPosition-(this.visibleElements-1)*this.optionHeight),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()),this.pointerDirty=!0},pointerBackward(){this.pointer>0?(this.pointer--,this.$refs.list.scrollTop>=this.pointerPosition&&(this.$refs.list.scrollTop=this.pointerPosition),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerBackward()):this.filteredOptions[this.pointer]&&this.filteredOptions[0].$isLabel&&!this.groupSelect&&this.pointerForward(),this.pointerDirty=!0}
3760,pointerReset(){this.closeOnSelect&&(this.pointer=0,this.$refs.list&&(this.$refs.list.scrollTop=0))},pointerAdjust(){this.pointer>=this.filteredOptions.length-1&&(this.pointer=this.filteredOptions.length?this.filteredOptions.length-1:0),this.filteredOptions.length>0&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()},pointerSet(e){this.pointer=e,this.pointerDirty=!0}}}],compatConfig:{MODE:3,ATTR_ENUMERATED_COERCION:!1},props:{name:{type:String,default:""},modelValue:{type:null,default:()=>[]},selectLabel:{type:String,default:"Press enter to select"},selectGroupLabel:{type:String,default:"Press enter to select group"},selectedLabel:{type:String,default:"Selected"},deselectLabel:{type:String,default:"Press enter to remove"},deselectGroupLabel:{type:String,default:"Press enter to deselect group"},showLabels:{type:Boolean,default:!0},limit:{type:Number,default:99999},maxHeight:{type:Number,default:300},limitText:{type:Function,default:e=>"and ".concat(e," more")},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},spellcheck:{type:Boolean,default:!1},openDirection:{type:String,default:""},showNoOptions:{type:Boolean,default:!0},showNoResults:{type:Boolean,default:!0},tabindex:{type:Number,default:0},required:{type:Boolean,default:!1}},computed:{hasOptionGroup(){return this.groupValues&&this.groupLabel&&this.groupSelect},isSingleLabelVisible(){return(this.singleValue||0===this.singleValue)&&(!this.isOpen||!this.searchable)&&!this.visibleValues.length},isPlaceholderVisible(){return!(this.internalValue.length||this.searchable&&this.isOpen)},visibleValues(){return this.multiple?this.internalValue.slice(0,this.limit):[]},singleValue(){return this.internalValue[0]},deselectLabelText(){return this.showLabels?this.deselectLabel:""},deselectGroupLabelText(){return this.showLabels?this.deselectGroupLabel:""},selectLabelText(){return this.showLabels?this.selectLabel:""},selectGroupLabelText(){return this.showLabels?this.selectGroupLabel:""},selectedLabelText(){return this.showLabels?this.selectedLabel:""},inputStyle(){return this.searchable||this.multiple&&this.modelValue&&this.modelValue.length?this.isOpen?{width:"100%"}:{width:"0",position:"absolute",padding:"0"}:""},contentStyle(){return this.options.length?{display:"inline-block"}:{display:"block"}},isAbove(){return"above"===this.openDirection||"top"===this.openDirection||"below"!==this.openDirection&&"bottom"!==this.openDirection&&"above"===this.preferredOpenDirection},showSearchInput(){return this.searchable&&(!this.hasSingleSelectedSlot||!this.visibleSingleValue&&0!==this.visibleSingleValue||this.isOpen)},isRequired(){return!1!==this.required&&this.internalValue.length<=0}}};const AO=["tabindex","aria-expanded","aria-owns","aria-activedescendant"],DO={ref:"tags",class:"multiselect__tags"},PO={class:"multiselect__tags-wrap"},OO=["textContent"],MO=["onKeypress","onMousedown"],NO=["textContent"],RO={class:"multiselect__spinner"},LO=["name","id","spellcheck","placeholder","required","value","disabled","tabindex","aria-label","aria-controls"],VO=["id","aria-multiselectable"],qO={key:0},FO={class:"multiselect__option"},BO=["aria-selected","id","role"],UO=["onClick","onMouseenter","data-select","data-selected","data-deselect"],jO=["data-select","data-deselect","onMouseenter","onMousedown"],HO={class:"multiselect__option"},zO={class:"multiselect__option"};IO.render=function(e,t,n,i,a,o){return Ma(),Va("div",{tabindex:e.searchable?-1:n.tabindex,class:G([{"multiselect--active":e.isOpen,"multiselect--disabled":n.disabled,"multiselect--above":o.isAbove,"multiselect--has-options-group":o.hasOptionGroup},"multiselect"]),onFocus:t[14]||(t[14]=t=>e.activate()),onBlur:t[15]||(t[15]=t=>!e.searchable&&e.deactivate()),onKeydown:[t[16]||(t[16]=Is(Es(t=>e.pointerForward(),["self","prevent"]),["down"])),t[17]||(t[17]=Is(Es(t=>e.pointerBackward(),["self","prevent"]),["up"]))],onKeypress:t[18]||(t[18]=Is(Es(t=>e.addPointerElement(t),["stop","self"]),["enter","tab"])),onKeyup:t[19]||(t[19]=Is(t=>e.deactivate(),["esc"])),role:"combobox","aria-expanded":e.isOpen,"aria-owns":"listbox-"+e.id,"aria-activedescendant":e.isOpen&&null!==e.pointer?e.id+"-"+e.pointer:null}
3760,[vi(e.$slots,"caret",{toggle:e.toggle},()=>[Ha("div",{onMousedown:t[0]||(t[0]=Es(t=>e.toggle(),["prevent","stop"])),class:"multiselect__select"},null,32)]),vi(e.$slots,"clear",{search:e.search}),Ha("div",DO,[vi(e.$slots,"selection",{search:e.search,remove:e.removeElement,values:o.visibleValues,isOpen:e.isOpen},()=>[gn(Ha("div",PO,[(Ma(!0),Va(Sa,null,gi(o.visibleValues,(n,i)=>vi(e.$slots,"tag",{option:n,search:e.search,remove:e.removeElement},()=>[(Ma(),Va("span",{class:"multiselect__tag",key:i,onMousedown:t[1]||(t[1]=Es(()=>{},["prevent"]))},[Ha("span",{textContent:ee(e.getOptionLabel(n))},null,8,OO),Ha("i",{tabindex:"1",onKeypress:Is(Es(t=>e.removeElement(n),["prevent"]),["enter"]),onMousedown:Es(t=>e.removeElement(n),["prevent"]),class:"multiselect__tag-icon"},null,40,MO)],32))])),256))],512),[[Go,o.visibleValues.length>0]]),e.internalValue&&e.internalValue.length>n.limit?vi(e.$slots,"limit",{key:0},()=>[Ha("strong",{class:"multiselect__strong",textContent:ee(n.limitText(e.internalValue.length-n.limit))},null,8,NO)]):Qa("v-if",!0)]),za(Mo,{name:"multiselect__loading"},{default:pn(()=>[vi(e.$slots,"loading",{},()=>[gn(Ha("div",RO,null,512),[[Go,n.loading]])])]),_:3}),e.searchable?(Ma(),Va("input",{key:0,ref:"search",name:n.name,id:e.id,type:"text",autocomplete:"off",spellcheck:n.spellcheck,placeholder:e.placeholder,required:o.isRequired,style:j(o.inputStyle),value:e.search,disabled:n.disabled,tabindex:n.tabindex,"aria-label":n.name+"-searchbox",onInput:t[2]||(t[2]=t=>e.updateSearch(t.target.value)),onFocus:t[3]||(t[3]=Es(t=>e.activate(),["prevent"])),onBlur:t[4]||(t[4]=Es(t=>e.deactivate(),["prevent"])),onKeyup:t[5]||(t[5]=Is(t=>e.deactivate(),["esc"])),onKeydown:[t[6]||(t[6]=Is(Es(t=>e.pointerForward(),["prevent"]),["down"])),t[7]||(t[7]=Is(Es(t=>e.pointerBackward(),["prevent"]),["up"])),t[9]||(t[9]=Is(Es(t=>e.removeLastElement(),["stop"]),["delete"]))],onKeypress:t[8]||(t[8]=Is(Es(t=>e.addPointerElement(t),["prevent","stop","self"]),["enter"])),class:"multiselect__input","aria-controls":"listbox-"+e.id},null,44,LO)):Qa("v-if",!0),o.isSingleLabelVisible?(Ma(),Va("span",{key:1,class:"multiselect__single",onMousedown:t[10]||(t[10]=Es((...t)=>e.toggle&&e.toggle(...t),["prevent"]))},[vi(e.$slots,"singleLabel",{option:o.singleValue},()=>[Ga(ee(e.currentOptionLabel),1)])],32)):Qa("v-if",!0),o.isPlaceholderVisible?(Ma(),Va("span",{key:2,class:"multiselect__placeholder",onMousedown:t[11]||(t[11]=Es((...t)=>e.toggle&&e.toggle(...t),["prevent"]))},[vi(e.$slots,"placeholder",{},()=>[Ga(ee(e.placeholder),1)])],32)):Qa("v-if",!0)],512),za(Mo,{name:"multiselect",persisted:""},{default:pn(()=>[gn(Ha("div",{class:"multiselect__content-wrapper",onFocus:t[12]||(t[12]=(...t)=>e.activate&&e.activate(...t)),tabindex:"-1",onMousedown:t[13]||(t[13]=Es(()=>{},["prevent"])),style:j({maxHeight:e.optimizedHeight+"px"}),ref:"list"},[Ha("ul",{class:"multiselect__content",style:j(o.contentStyle),role:"listbox",id:"listbox-"+e.id,"aria-multiselectable":e.multiple},[vi(e.$slots,"beforeList"),e.multiple&&e.max===e.internalValue.length?(Ma(),Va("li",qO,[Ha("span",FO,[vi(e.$slots,"maxElements",{},()=>[Ga("Maximum of "+ee(e.max)+" options selected. First remove a selected option to select another.",1)])])])):Qa("v-if",!0),!e.max||e.internalValue.length<e.max?(Ma(!0),Va(Sa,{key:1},gi(e.filteredOptions,(t,n)=>(Ma(),Va("li",{class:"multiselect__element",key:n,"aria-selected":e.isSelected(t),id:e.id+"-"+n,role:t&&(t.$isLabel||t.$isDisabled)?null:"option"},[t&&(t.$isLabel||t.$isDisabled)?Qa("v-if",!0):(Ma(),Va("span",{key:0,class:G([e.optionHighlight(n,t),"multiselect__option"]),onClick:Es(n=>e.select(t),["stop"]),onMouseenter:Es(t=>e.pointerSet(n),["self"]),"data-select":t&&t.isTag?e.tagPlaceholder:o.selectLabelText,"data-selected":o.selectedLabelText,"data-deselect":o.deselectLabelText},[vi(e.$slots,"option",{option:t,search:e.search,index:n},()=>[Ha("span",null,ee(e.getOptionLabel(t)),1)])],42,UO)),t&&(t.$isLabel||t.$isDisabled)?(Ma(),Va("span",{key:1,"data-select":e.groupSelect&&o.selectGroupLabelText,"data-deselect":e.groupSelect&&o.deselectGroupLabelText,class:G([e.groupHighlight(n,t),"multiselect__option"]),onMouseenter:Es(t=>e.groupSelect&&e.pointerSet(n),["self"]),onMousedown:Es(n=>e.selectGroup(t),["prevent"])}
3760,[vi(e.$slots,"option",{option:t,search:e.search,index:n},()=>[Ha("span",null,ee(e.getOptionLabel(t)),1)])],42,jO)):Qa("v-if",!0)],8,BO))),128)):Qa("v-if",!0),gn(Ha("li",null,[Ha("span",HO,[vi(e.$slots,"noResult",{search:e.search},()=>[t[20]||(t[20]=Ga("No elements found. Consider changing the search query."))])])],512),[[Go,n.showNoResults&&0===e.filteredOptions.length&&e.search&&!n.loading]]),gn(Ha("li",null,[Ha("span",zO,[vi(e.$slots,"noOptions",{},()=>[t[21]||(t[21]=Ga("List is empty."))])])],512),[[Go,n.showNoOptions&&(0===e.options.length||!0===o.hasOptionGroup&&0===e.filteredOptions.length)&&!e.search&&!n.loading]]),vi(e.$slots,"afterList")],12,VO)],36),[[Go,e.isOpen]])]),_:3})],42,AO)};var WO="top",KO="bottom",GO="right",YO="left",QO="auto",$O=[WO,KO,GO,YO],XO="start",JO="end",ZO="clippingParents",eM="viewport",tM="popper",nM="reference",iM=$O.reduce(function(e,t){return e.concat([t+"-"+XO,t+"-"+JO])},[]),aM=[].concat($O,[QO]).reduce(function(e,t){return e.concat([t,t+"-"+XO,t+"-"+JO])},[]),oM="beforeRead",sM="read",rM="afterRead",lM="beforeMain",cM="main",uM="afterMain",hM="beforeWrite",dM="write",fM="afterWrite",pM=[oM,sM,rM,lM,cM,uM,hM,dM,fM];function gM(e){return e?(e.nodeName||"").toLowerCase():null}function mM(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function vM(e){return e instanceof mM(e).Element||e instanceof Element}function yM(e){return e instanceof mM(e).HTMLElement||e instanceof HTMLElement}function bM(e){return"undefined"!=typeof ShadowRoot&&(e instanceof mM(e).ShadowRoot||e instanceof ShadowRoot)}const _M={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},a=t.elements[e];
vendor: 9,060 bytes, line 3760
3760yM(a)&&gM(a)&&(Object.assign(a.style,n),Object.keys(i).forEach(function(e){var t=i[e];!1===t?a.removeAttribute(e):a.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var i=t.elements[e],a=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});yM(i)&&gM(i)&&(Object.assign(i.style,o),Object.keys(a).forEach(function(e){i.removeAttribute(e)}))})}},requires:["computeStyles"]};function wM(e){return e.split("-")[0]}var kM=Math.max,xM=Math.min,TM=Math.round;function CM(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function EM(){return!/^((?!chrome|android).)*safari/i.test(CM())}function SM(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var i=e.getBoundingClientRect(),a=1,o=1;t&&yM(e)&&(a=e.offsetWidth>0&&TM(i.width)/e.offsetWidth||1,o=e.offsetHeight>0&&TM(i.height)/e.offsetHeight||1);var s=(vM(e)?mM(e):window).visualViewport,r=!EM()&&n,l=(i.left+(r&&s?s.offsetLeft:0))/a,c=(i.top+(r&&s?s.offsetTop:0))/o,u=i.width/a,h=i.height/o;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l,x:l,y:c}}function IM(e){var t=SM(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function AM(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&bM(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function DM(e){return mM(e).getComputedStyle(e)}function PM(e){return["table","td","th"].indexOf(gM(e))>=0}function OM(e){return((vM(e)?e.ownerDocument:e.document)||window.document).documentElement}function MM(e){return"html"===gM(e)?e:e.assignedSlot||e.parentNode||(bM(e)?e.host:null)||OM(e)}function NM(e){return yM(e)&&"fixed"!==DM(e).position?e.offsetParent:null}function RM(e){for(var t=mM(e),n=NM(e);n&&PM(n)&&"static"===DM(n).position;)n=NM(n);return n&&("html"===gM(n)||"body"===gM(n)&&"static"===DM(n).position)?t:n||function(e){var t=/firefox/i.test(CM());if(/Trident/i.test(CM())&&yM(e)&&"fixed"===DM(e).position)return null;var n=MM(e);for(bM(n)&&(n=n.host);yM(n)&&["html","body"].indexOf(gM(n))<0;){var i=DM(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}function LM(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function VM(e,t,n){return kM(e,xM(t,n))}function qM(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function FM(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}const BM={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,a=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,r=wM(n.placement),l=LM(r),c=[YO,GO].indexOf(r)>=0?"height":"width";if(o&&s){var u=function(e,t){return qM("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:FM(e,$O))}(a.padding,n),h=IM(o),d="y"===l?WO:YO,f="y"===l?KO:GO,p=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],g=s[l]-n.rects.reference[l],m=RM(o),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,y=p/2-g/2,b=u[d],_=v-h[c]-u[f],w=v/2-h[c]/2+y,k=VM(b,w,_),x=l;n.modifiersData[i]=((t={})[x]=k,t.centerOffset=k-w,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&AM(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function UM(e){return e.split("-")[1]}var jM={top:"auto",right:"auto",bottom:"auto",left:"auto"};function HM(e){var t,n=e.popper,i=e.popperRect,a=e.placement,o=e.variation,s=e.offsets,r=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,h=e.isFixed,d=s.x,f=void 0===d?0:d,p=s.y,g=void 0===p?0:p,m="function"==typeof u?u({x:f,y:g}):{x:f,y:g};f=m.x,g=m.y;var v=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),b=YO,_=WO,w=window;if(c){var k=RM(n),x="clientHeight",T="clientWidth";if(k===mM(n)&&"static"!==DM(k=OM(n)).position&&"absolute"===r&&(x="scrollHeight",T="scrollWidth"),a===WO||(a===YO||a===GO)&&o===JO)_=KO,g-=(h&&k===w&&w.visualViewport?w.visualViewport.height:k[x])-i.height,g*=l?1:-1;if(a===YO||(a===WO||a===KO)&&o===JO)b=GO,f-=(h&&k===w&&w.visualViewport?w.visualViewport.width:k[T])-i.width,f*=l?1:-1}var C,E=Object.assign({position:r},c&&jM),S=!0===u?function(e,t){var n=e.x,i=e.y,a=t.devicePixelRatio||1;return{x:TM(n*a)/a||0,y:TM(i*a)/a||0}}({x:f,y:g},mM(n)):{x:f,y:g};return f=S.x,g=S.y,l?Object.assign({},E,((C={})[_]=y?"0":"",C[b]=v?"0":"",C.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",C)):Object.assign({},E,((t={})[_]=y?g+"px":"",t[b]=v?f+"px":"",t.transform="",t))}const zM={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,a=void 0===i||i,o=n.adaptive,s=void 0===o||o,r=n.roundOffsets,l=void 0===r||r,c={placement:wM(t.placement),variation:UM(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:a,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,HM(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,HM(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var WM={passive:!0};const KM={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,a=i.scroll,o=void 0===a||a,s=i.resize,r=void 0===s||s,l=mM(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(e){e.addEventListener("scroll",n.update,WM)}),r&&l.addEventListener("resize",n.update,WM),function(){o&&c.forEach(function(e){e.removeEventListener("scroll",n.update,WM)}),r&&l.removeEventListener("resize",n.update,WM)}},data:{}};var GM={left:"right",right:"left",bottom:"top",top:"bottom"};function YM(e){return e.replace(/left|right|bottom|top/g,function(e){return GM[e]})}var QM={start:"end",end:"start"};function $M(e){return e.replace(/start|end/g,function(e){return QM[e]})}function XM(e){var t=mM(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function JM(e){return SM(OM(e)).left+XM(e).scrollLeft}function ZM(e){var t=DM(e),n=t.overflow,i=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+i)}function eN(e){return["html","body","#document"].indexOf(gM(e))>=0?e.ownerDocument.body:yM(e)&&ZM(e)?e:eN(MM(e))}function tN(e,t){var n;void 0===t&&(t=[]);var i=eN(e),a=i===(null==(n=e.ownerDocument)?void 0:n.body),o=mM(i),s=a?[o].concat(o.visualViewport||[],ZM(i)?i:[]):i,r=t.concat(s);return a?r:r.concat(tN(MM(s)))}function nN(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function iN(e,t,n){return t===eM?nN(function(e,t){var n=mM(e),i=OM(e),a=n.visualViewport,o=i.clientWidth,s=i.clientHeight,r=0,l=0;if(a){o=a.width,s=a.height;var c=EM();(c||!c&&"fixed"===t)&&(r=a.offsetLeft,l=a.offsetTop)}return{width:o,height:s,x:r+JM(e),y:l}}(e,n)):vM(t)?function(e,t){var n=SM(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):nN(function(e){var t,n=OM(e),i=XM(e),a=null==(t=e.ownerDocument)?void 0:t.body,o=kM(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=kM(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),r=-i.scrollLeft+JM(e),l=-i.scrollTop;return"rtl"===DM(a||n).direction&&(r+=kM(n.clientWidth,a?a.clientWidth:0)-o),{width:o,height:s,x:r,y:l}}(OM(e)))}function aN(e,t,n,i){var a="clippingParents"===t?function(e){var t=tN(MM(e)),n=["absolute","fixed"].indexOf(DM(e).position)>=0&&yM(e)?RM(e):e;return vM(n)?t.filter(function(e){return vM(e)&&AM(e,n)&&"body"!==gM(e)}):[]}(e):[].concat(t),o=[].concat(a,[n]),s=o[0],r=o.reduce(function(t,n){var a=iN(e,n,i);return t.top=kM(a.top,t.top),t.right=xM(a.right,t.right),t.bottom=xM(a.bottom,t.bottom),t.left=kM(a.left,t.left),t},iN(e,s,i));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function oN(e){var t,n=e.reference,i=e.element,a=e.placement,o=a?wM(a):null,
vendor: 1,137 bytes, line 3760
3760s=a?UM(a):null,r=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(o){case WO:t={x:r,y:n.y-i.height};break;case KO:t={x:r,y:n.y+n.height};break;case GO:t={x:n.x+n.width,y:l};break;case YO:t={x:n.x-i.width,y:l};break;default:t={x:n.x,y:n.y}}var c=o?LM(o):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case XO:t[c]=t[c]-(n[u]/2-i[u]/2);break;case JO:t[c]=t[c]+(n[u]/2-i[u]/2)}}return t}function sN(e,t){void 0===t&&(t={});var n=t,i=n.placement,a=void 0===i?e.placement:i,o=n.strategy,s=void 0===o?e.strategy:o,r=n.boundary,l=void 0===r?ZO:r,c=n.rootBoundary,u=void 0===c?eM:c,h=n.elementContext,d=void 0===h?tM:h,f=n.altBoundary,p=void 0!==f&&f,g=n.padding,m=void 0===g?0:g,v=qM("number"!=typeof m?m:FM(m,$O)),y=d===tM?nM:tM,b=e.rects.popper,_=e.elements[p?y:d],w=aN(vM(_)?_:_.contextElement||OM(e.elements.popper),l,u,s),k=SM(e.elements.reference),x=oN({reference:k,element:b,strategy:"absolute",placement:a}),T=nN(Object.assign({},b,x)),C=d===tM?T:k,E={top:w.top-C.top+v.top,bottom:C.bottom-w.bottom+v.bottom,left:w.left-C.left+v.left,right:C.right-w.right+v.right},S=e.modifiersData.offset;if(d===tM&&S){var I=S[a];
vendor: 5,084 bytes, line 3760
3760Object.keys(E).forEach(function(e){var t=[GO,KO].indexOf(e)>=0?1:-1,n=[WO,KO].indexOf(e)>=0?"y":"x";E[e]+=I[n]*t})}return E}const rN={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var a=n.mainAxis,o=void 0===a||a,s=n.altAxis,r=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,h=n.rootBoundary,d=n.altBoundary,f=n.flipVariations,p=void 0===f||f,g=n.allowedAutoPlacements,m=t.options.placement,v=wM(m),y=l||(v===m||!p?[YM(m)]:function(e){if(wM(e)===QO)return[];var t=YM(e);return[$M(e),t,$M(t)]}(m)),b=[m].concat(y).reduce(function(e,n){return e.concat(wM(n)===QO?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,a=n.boundary,o=n.rootBoundary,s=n.padding,r=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?aM:l,u=UM(i),h=u?r?iM:iM.filter(function(e){return UM(e)===u}):$O,d=h.filter(function(e){return c.indexOf(e)>=0});0===d.length&&(d=h);var f=d.reduce(function(t,n){return t[n]=sN(e,{placement:n,boundary:a,rootBoundary:o,padding:s})[wM(n)],t},{});return Object.keys(f).sort(function(e,t){return f[e]-f[t]})}(t,{placement:n,boundary:u,rootBoundary:h,padding:c,flipVariations:p,allowedAutoPlacements:g}):n)},[]),_=t.rects.reference,w=t.rects.popper,k=new Map,x=!0,T=b[0],C=0;C<b.length;C++){var E=b[C],S=wM(E),I=UM(E)===XO,A=[WO,KO].indexOf(S)>=0,D=A?"width":"height",P=sN(t,{placement:E,boundary:u,rootBoundary:h,altBoundary:d,padding:c}),O=A?I?GO:YO:I?KO:WO;_[D]>w[D]&&(O=YM(O));var M=YM(O),N=[];if(o&&N.push(P[S]<=0),r&&N.push(P[O]<=0,P[M]<=0),N.every(function(e){return e})){T=E,x=!1;break}k.set(E,N)}if(x)for(var R=function(e){var t=b.find(function(t){var n=k.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return T=t,"break"},L=p?3:1;L>0;L--){if("break"===R(L))break}t.placement!==T&&(t.modifiersData[i]._skip=!0,t.placement=T,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function lN(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function cN(e){return[WO,GO,KO,YO].some(function(t){return e[t]>=0})}const uN={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,a=t.rects.popper,o=t.modifiersData.preventOverflow,s=sN(t,{elementContext:"reference"}),r=sN(t,{altBoundary:!0}),l=lN(s,i),c=lN(r,a,o),u=cN(l),h=cN(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}};const hN={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,a=n.offset,o=void 0===a?[0,0]:a,s=aM.reduce(function(e,n){return e[n]=function(e,t,n){var i=wM(e),a=[YO,WO].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],r=o[1];return s=s||0,r=(r||0)*a,[YO,GO].indexOf(i)>=0?{x:r,y:s}:{x:s,y:r}}(n,t.rects,o),e},{}),r=s[t.placement],l=r.x,c=r.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=s}};const dN={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=oN({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};const fN={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,a=n.mainAxis,o=void 0===a||a,s=n.altAxis,r=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,h=n.padding,d=n.tether,f=void 0===d||d,p=n.tetherOffset,g=void 0===p?0:p,m=sN(t,{boundary:l,rootBoundary:c,padding:h,altBoundary:u}),v=wM(t.placement),y=UM(t.placement),b=!y,_=LM(v),w="x"===_?"y":"x",k=t.modifiersData.popperOffsets,x=t.rects.reference,T=t.rects.popper,C="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,E="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(k){if(o){var A,D="y"===_?WO:YO,P="y"===_?KO:GO,O="y"===_?"height":"width",M=k[_],N=M+m[D],R=M-m[P],L=f?-T[O]/2:0,V=y===XO?x[O]:T[O],q=y===XO?-T[O]:-x[O],F=t.elements.arrow,B=f&&F?IM(F):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},j=U[D],H=U[P],z=VM(0,x[O],B[O]),W=b?x[O]/2-L-z-j-E.mainAxis:V-z-j-E.mainAxis,K=b?-x[O]/2+L+z+H+E.mainAxis:q+z+H+E.mainAxis,G=t.elements.arrow&&RM(t.elements.arrow),Y=G?"y"===_?G.clientTop||0:G.clientLeft||0:0,Q=null!=(A=null==S?void 0:S[_])?A:0,$=M+K-Q,X=VM(f?xM(N,M+W-Q-Y):N,M,f?kM(R,$):R);k[_]=X,I[_]=X-M}if(r){var J,Z="x"===_?WO:YO,ee="x"===_?KO:GO,te=k[w],ne="y"===w?"height":"width",ie=te+m[Z],ae=te-m[ee],oe=-1!==[WO,YO].indexOf(v),se=null!=(J=null==S?void 0:S[w])?J:0,re=oe?ie:te-x[ne]-T[ne]-se+E.altAxis,le=oe?te+x[ne]+T[ne]-se-E.altAxis:ae,ce=f&&oe?function(e,t,n){var i=VM(e,t,n
vendor: 4,462 bytes, line 3760
3760);return i>n?n:i}(re,te,le):VM(f?re:ie,te,f?le:ae);k[w]=ce,I[w]=ce-te}t.modifiersData[i]=I}},requiresIfExists:["offset"]};function pN(e,t,n){void 0===n&&(n=!1);var i,a,o=yM(t),s=yM(t)&&function(e){var t=e.getBoundingClientRect(),n=TM(t.width)/e.offsetWidth||1,i=TM(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(t),r=OM(t),l=SM(e,s,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==gM(t)||ZM(r))&&(c=(i=t)!==mM(i)&&yM(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:XM(i)),yM(t)?((u=SM(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):r&&(u.x=JM(r))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function gN(e){var t=new Map,n=new Set,i=[];function a(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var i=t.get(e);i&&a(i)}}),i.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){n.has(e.name)||a(e)}),i}var mN={placement:"bottom",modifiers:[],strategy:"absolute"};function vN(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function yN(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,i=void 0===n?[]:n,a=t.defaultOptions,o=void 0===a?mN:a;return function(e,t,n){void 0===n&&(n=o);var a,s,r={placement:"bottom",orderedModifiers:[],options:Object.assign({},mN,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,u={state:r,setOptions:function(n){var a="function"==typeof n?n(r.options):n;h(),r.options=Object.assign({},o,r.options,a),r.scrollParents={reference:vM(e)?tN(e):e.contextElement?tN(e.contextElement):[],popper:tN(t)};var s,c,d=function(e){var t=gN(e);return pM.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}((s=[].concat(i,r.options.modifiers),c=s.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{}),Object.keys(c).map(function(e){return c[e]})));return r.orderedModifiers=d.filter(function(e){return e.enabled}),r.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,i=void 0===n?{}:n,a=e.effect;if("function"==typeof a){var o=a({state:r,name:t,instance:u,options:i}),s=function(){};l.push(o||s)}}),u.update()},forceUpdate:function(){if(!c){var e=r.elements,t=e.reference,n=e.popper;if(vN(t,n)){r.rects={reference:pN(t,RM(n),"fixed"===r.options.strategy),popper:IM(n)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach(function(e){return r.modifiersData[e.name]=Object.assign({},e.data)});for(var i=0;i<r.orderedModifiers.length;i++)if(!0!==r.reset){var a=r.orderedModifiers[i],o=a.fn,s=a.options,l=void 0===s?{}:s,h=a.name;"function"==typeof o&&(r=o({state:r,options:l,name:h,instance:u})||r)}else r.reset=!1,i=-1}}},update:(a=function(){return new Promise(function(e){u.forceUpdate(),e(r)})},function(){return s||(s=new Promise(function(e){Promise.resolve().then(function(){s=void 0,e(a())})})),s}),destroy:function(){h(),c=!0}};if(!vN(e,t))return u;function h(){l.forEach(function(e){return e()}),l=[]}return u.setOptions(n).then(function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)}),u}}var bN=yN(),_N=yN({defaultModifiers:[KM,dN,zM,_M]}),wN=yN({defaultModifiers:[KM,dN,zM,_M,hN,rN,fN,BM,uN]});const kN=Object.freeze(Object.defineProperty({__proto__:null,afterMain:uM,afterRead:rM,afterWrite:fM,applyStyles:_M,arrow:BM,auto:QO,basePlacements:$O,beforeMain:lM,beforeRead:oM,beforeWrite:hM,bottom:KO,clippingParents:ZO,computeStyles:zM,createPopper:wN,createPopperBase:bN,createPopperLite:_N,detectOverflow:sN,end:JO,eventListeners:KM,flip:rN,hide:uN,left:YO,main:cM,modifierPhases:pM,offset:hN,placements:aM,popper:tM,popperGenerator:yN,popperOffsets:dN,preventOverflow:fN,read:sM,reference:nM,right:GO,start:XO,top:WO,variationPlacements:iM,viewport:eM,write:dM},Symbol.toStringTag,{value:"Module"})),xN=new Map,TN={set(e,t,n){xN.has(e)||xN.set(e,new Map);const i=xN.get(e);(i.has(t)||0===i.size)&&i.set(t,n)},get:(e,t)=>xN.has(e)&&xN.get(e).get(t)||null,remove(e,t){if(!xN.has(e))return;const n=xN.get(e);n.delete(t),0===n.size&&xN.delete(e)}},CN="transitionend",EN=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(e,t)=>"#".concat(CSS.escape(t)))),e),SN=e=>null==e?"".concat(e):Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),IN=e
vendor: 2,295 bytes, lines 3760-3765
3760=>{e.dispatchEvent(new Event(CN))},AN=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),DN=e=>AN(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(EN(e)):null,PN=e=>{if(!AN(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const t=e.closest("summary");if(t&&t.parentNode!==n)return!1;if(null===t)return!1}return t},ON=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),MN=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?MN(e.parentNode):null},NN=()=>{},RN=e=>{e.offsetHeight},LN=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,VN=[],qN=()=>"rtl"===document.documentElement.dir,FN=e=>{(e=>{"loading"===document.readyState?(VN.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of VN)e()}),VN.push(e)):e()})(()=>{const t=LN();if(t){const n=e.NAME,i=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=i,e.jQueryInterface)}})},BN=(e,t=[],n=e)=>"function"==typeof e?e(...t):n,UN=(e,t,n=!0)=>{if(!n)return void BN(e);const i=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const i=Number.parseFloat(t),a=Number.parseFloat(n);return i||a?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0})(t)+5;let a=!1;const o=({target:n})=>{n===t&&(a=!0,t.removeEventListener(CN,o),BN(e))};t.addEventListener(CN,o),setTimeout(()=>{a||IN(t)},i)},jN=(e,t,n,i)=>{const a=e.length;let o=e.indexOf(t);return-1===o?!n&&i?e[a-1]:e[0]:(o+=n?1:-1,i&&(o=(o+a)%a),e[Math.max(0,Math.min(o,a-1))])},HN=/[^.]*(?=\..*)\.|.*/,zN=/\..*/,WN=/::\d+$/,KN={}; 3761/*! 3762 * Bootstrap v5.3.3 (https://getbootstrap.com/) 3763 * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 3764 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 3765 */let GN=1;
3765const YN={mouseenter:"mouseover",mouseleave:"mouseout"},QN=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function $N(e,t){return t&&"".concat(t,"::").concat(GN++)||e.uidEvent||GN++}function XN(e){const t=$N(e);return e.uidEvent=t,KN[t]=KN[t]||{},KN[t]}function JN(e,t,n=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===n)}function ZN(e,t,n){const i="string"==typeof t,a=i?n:t||n;let o=iR(e);return QN.has(o)||(o=e),[i,a,o]}function eR(e,t,n,i,a){if("string"!=typeof t||!e)return;let[o,s,r]=ZN(t,n,i);if(t in YN){s=(e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)})(s)}const l=XN(e),c=l[r]||(l[r]={}),u=JN(c,s,o?n:null);if(u)return void(u.oneOff=u.oneOff&&a);const h=$N(s,t.replace(HN,"")),d=o?function(e,t,n){return function i(a){const o=e.querySelectorAll(t);for(let{target:s}=a;s&&s!==this;s=s.parentNode)for(const r of o)if(r===s)return oR(a,{delegateTarget:s}),i.oneOff&&aR.off(e,a.type,t,n),n.apply(s,[a])}}(e,n,s):function(e,t){return function n(i){return oR(i,{delegateTarget:e}),n.oneOff&&aR.off(e,i.type,t),t.apply(e,[i])}}(e,s);d.delegationSelector=o?n:null,d.callable=s,d.oneOff=a,d.uidEvent=h,c[h]=d,e.addEventListener(r,d,o)}function tR(e,t,n,i,a){const o=JN(t[n],i,a);o&&(e.removeEventListener(n,o,Boolean(a)),delete t[n][o.uidEvent])}function nR(e,t,n,i){const a=t[n]||{};for(const[o,s]of Object.entries(a))o.includes(i)&&tR(e,t,n,s.callable,s.delegationSelector)}function iR(e){return e=e.replace(zN,""),YN[e]||e}const aR={on(e,t,n,i){eR(e,t,n,i,!1)},one(e,t,n,i){eR(e,t,n,i,!0)},off(e,t,n,i){if("string"!=typeof t||!e)return;const[a,o,s]=ZN(t,n,i),r=s!==t,l=XN(e),c=l[s]||{},u=t.startsWith(".");if(void 0===o){if(u)for(const n of Object.keys(l))nR(e,l,n,t.slice(1));for(const[n,i]of Object.entries(c)){const a=n.replace(WN,"");r&&!t.includes(a)||tR(e,l,s,i.callable,i.delegationSelector)}}else{if(!Object.keys(c).length)return;tR(e,l,s,o,a?n:null)}},trigger(e,t,n){if("string"!=typeof t||!e)return null;const i=LN();let a=null,o=!0,s=!0,r=!1;t!==iR(t)&&i&&(a=i.Event(t,n),i(e).trigger(a),o=!a.isPropagationStopped(),s=!a.isImmediatePropagationStopped(),r=a.isDefaultPrevented());const l=oR(new Event(t,{bubbles:o,cancelable:!0}),n);return r&&l.preventDefault(),s&&e.dispatchEvent(l),l.defaultPrevented&&a&&a.preventDefault(),l}};function oR(e,t={}){for(const[i,a]of Object.entries(t))try{e[i]=a}catch(n){Object.defineProperty(e,i,{configurable:!0,get:()=>a})}return e}function sR(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function rR(e){return e.replace(/[A-Z]/g,e=>"-".concat(e.toLowerCase()))}const lR={setDataAttribute(e,t,n){e.setAttribute("data-bs-".concat(rR(t)),n)},removeDataAttribute(e,t){e.removeAttribute("data-bs-".concat(rR(t)))},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter(e=>e.startsWith("bs")&&!e.startsWith("bsConfig"));for(const i of n){let n=i.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),t[n]=sR(e.dataset[i])}return t},getDataAttribute:(e,t)=>sR(e.getAttribute("data-bs-".concat(rR(t))))};let cR=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=AN(t)?lR.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...AN(t)?lR.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[n,i]of Object.entries(t)){const t=e[
3765n],a=AN(t)?"element":SN(t);if(!new RegExp(i).test(a))throw new TypeError("".concat(this.constructor.NAME.toUpperCase(),': Option "').concat(n,'" provided type "').concat(a,'" but expected type "').concat(i,'".'))}}};class uR extends cR{constructor(e,t){super(),(e=DN(e))&&(this._element=e,this._config=this._getConfig(t),TN.set(this._element,this.constructor.DATA_KEY,this))}dispose(){TN.remove(this._element,this.constructor.DATA_KEY),aR.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){UN(e,t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return TN.get(DN(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.3.3"}static get DATA_KEY(){return"bs.".concat(this.NAME)}static get EVENT_KEY(){return".".concat(this.DATA_KEY)}static eventName(e){return"".concat(e).concat(this.EVENT_KEY)}}const hR=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n="#".concat(n.split("#")[1])),t=n&&"#"!==n?n.trim():null}return t?t.split(",").map(e=>EN(e)).join(","):null},dR={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter(e=>e.matches(t)),parents(e,t){const n=[];let i=e.parentNode.closest(t);for(;i;)n.push(i),i=i.parentNode.closest(t);return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(e=>"".concat(e,':not([tabindex^="-"])')).join(",");return this.find(t,e).filter(e=>!ON(e)&&PN(e))},getSelectorFromElement(e){const t=hR(e);return t&&dR.findOne(t)?t:null},getElementFromSelector(e){const t=hR(e);return t?dR.findOne(t):null},getMultipleElementsFromSelector(e){const t=hR(e);return t?dR.find(t):[]}},fR=(e,t="hide")=>{const n="click.dismiss".concat(e.EVENT_KEY),i=e.NAME;aR.on(document,n,'[data-bs-dismiss="'.concat(i,'"]'),function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),ON(this))return;const a=dR.getElementFromSelector(this)||this.closest(".".concat(i));e.getOrCreateInstance(a)[t]()})},pR=".".concat("bs.alert"),gR="close".concat(pR),mR="closed".concat(pR);class vR extends uR{static get NAME(){return"alert"}close(){if(aR.trigger(this._element,gR).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,e)}_destroyElement(){this._element.remove(),aR.trigger(this._element,mR),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=vR.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}})}}fR(vR,"close"),FN(vR);const yR=".".concat("bs.button"),bR='[data-bs-toggle="button"]',_R="click".concat(yR).concat(".data-api");class wR extends uR{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each(function(){const t=wR.getOrCreateInstance(this);"toggle"===e&&t[e]()})}}aR.on(document,_R,bR,e=>{e.preventDefault();const t=e.target.closest(bR);wR.getOrCreateInstance(t).toggle()}),FN(wR);const kR=".bs.swipe",xR="touchstart".concat(kR),TR="touchmove".concat(kR),CR="touchend".concat(kR),ER="pointerdown".concat(kR),SR="pointerup".concat(kR),IR={endCallback:null,leftCallback:null,rightCallback:null},AR={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class DR extends cR{constructor(e,t){super(),this._element=e,e&&DR.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return IR}static get DefaultType(){return AR}static get NAME(){return"swipe"}dispose(){aR.off(this._element,kR)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),BN(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&BN(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(aR.on(this._element,ER,e=>this._start(e)),aR.on(this._element,SR,e=>this._end(e)),this._element.classList.add("pointer-event")):(aR.on(this._element,xR,e=>this._start(e)),aR.on(this._element,TR,e=>this._move(e)),aR.on(this._element,CR,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const PR=".".concat("bs.carousel"),OR=".data-api",MR="ArrowLeft",NR="ArrowRight",RR="next",LR="prev",VR="left",qR="right",FR="slide".concat(PR),BR="slid".concat(PR),UR="keydown".concat(PR),jR="mouseenter".concat(PR),HR="mouseleave".concat(PR),zR="dragstart".concat(PR),WR="load".concat(PR).c
vendor: 4,351 bytes, line 3765
3765oncat(OR),KR="click".concat(PR).concat(OR),GR="carousel",YR="active",QR=".active",$R=".carousel-item",XR=QR+$R,JR={[MR]:qR,[NR]:VR},ZR={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},eL={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class tL extends uR{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=dR.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===GR&&this.cycle()}static get Default(){return ZR}static get DefaultType(){return eL}static get NAME(){return"carousel"}next(){this._slide(RR)}nextWhenVisible(){!document.hidden&&PN(this._element)&&this.next()}prev(){this._slide(LR)}pause(){this._isSliding&&IN(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?aR.one(this._element,BR,()=>this.cycle()):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void aR.one(this._element,BR,()=>this.to(e));const n=this._getItemIndex(this._getActive());if(n===e)return;const i=e>n?RR:LR;this._slide(i,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&aR.on(this._element,UR,e=>this._keydown(e)),"hover"===this._config.pause&&(aR.on(this._element,jR,()=>this.pause()),aR.on(this._element,HR,()=>this._maybeEnableCycle())),this._config.touch&&DR.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of dR.find(".carousel-item img",this._element))aR.on(t,zR,e=>e.preventDefault());const e={leftCallback:()=>this._slide(this._directionToOrder(VR)),rightCallback:()=>this._slide(this._directionToOrder(qR)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new DR(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=JR[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=dR.findOne(QR,this._indicatorsElement);t.classList.remove(YR),t.removeAttribute("aria-current");const n=dR.findOne('[data-bs-slide-to="'.concat(e,'"]'),this._indicatorsElement);n&&(n.classList.add(YR),n.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const n=this._getActive(),i=e===RR,a=t||jN(this._getItems(),n,i,this._config.wrap);if(a===n)return;const o=this._getItemIndex(a),s=t=>aR.trigger(this._element,t,{relatedTarget:a,direction:this._orderToDirection(e),from:this._getItemIndex(n),to:o});if(s(FR).defaultPrevented)return;if(!n||!a)return;const r=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=a;const l=i?"carousel-item-start":"carousel-item-end",c=i?"carousel-item-next":"carousel-item-prev";a.classList.add(c),RN(a),n.classList.add(l),a.classList.add(l);this._queueCallback(()=>{a.classList.remove(l,c),a.classList.add(YR),n.classList.remove(YR,c,l),this._isSliding=!1,s(BR)},n,this._isAnimated()),r&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return dR.findOne(XR,this._element)}_getItems(){return dR.find($R,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return qN()?e===VR?LR:RR:e===VR?RR:LR}_orderToDirection(e){return qN()?e===LR?VR:qR:e===LR?qR:VR}static jQueryInterface(e){return this.each(function(){const t=tL.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method n
3765amed "'.concat(e,'"'));t[e]()}}else t.to(e)})}}aR.on(document,KR,"[data-bs-slide], [data-bs-slide-to]",function(e){const t=dR.getElementFromSelector(this);if(!t||!t.classList.contains(GR))return;e.preventDefault();const n=tL.getOrCreateInstance(t),i=this.getAttribute("data-bs-slide-to");return i?(n.to(i),void n._maybeEnableCycle()):"next"===lR.getDataAttribute(this,"slide")?(n.next(),void n._maybeEnableCycle()):(n.prev(),void n._maybeEnableCycle())}),aR.on(window,WR,()=>{const e=dR.find('[data-bs-ride="carousel"]');for(const t of e)tL.getOrCreateInstance(t)}),FN(tL);const nL=".".concat("bs.collapse"),iL="show".concat(nL),aL="shown".concat(nL),oL="hide".concat(nL),sL="hidden".concat(nL),rL="click".concat(nL).concat(".data-api"),lL="show",cL="collapse",uL="collapsing",hL=":scope .".concat(cL," .").concat(cL),dL='[data-bs-toggle="collapse"]',fL={parent:null,toggle:!0},pL={parent:"(null|element)",toggle:"boolean"};class gL extends uR{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const n=dR.find(dL);for(const i of n){const e=dR.getSelectorFromElement(i),t=dR.find(e).filter(e=>e===this._element);null!==e&&t.length&&this._triggerArray.push(i)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return fL}static get DefaultType(){return pL}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];
3765if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(e=>e!==this._element).map(e=>gL.getOrCreateInstance(e,{toggle:!1}))),e.length&&e[0]._isTransitioning)return;if(aR.trigger(this._element,iL).defaultPrevented)return;for(const a of e)a.hide();const t=this._getDimension();this._element.classList.remove(cL),this._element.classList.add(uL),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const n=t[0].toUpperCase()+t.slice(1),i="scroll".concat(n);this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(uL),this._element.classList.add(cL,lL),this._element.style[t]="",aR.trigger(this._element,aL)},this._element,!0),this._element.style[t]="".concat(this._element[i],"px")}hide(){if(this._isTransitioning||!this._isShown())return;if(aR.trigger(this._element,oL).defaultPrevented)return;const e=this._getDimension();this._element.style[e]="".concat(this._element.getBoundingClientRect()[e],"px"),RN(this._element),this._element.classList.add(uL),this._element.classList.remove(cL,lL);for(const t of this._triggerArray){const e=dR.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0;this._element.style[e]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(uL),this._element.classList.add(cL),aR.trigger(this._element,sL)},this._element,!0)}_isShown(e=this._element){return e.classList.contains(lL)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=DN(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(dL);for(const t of e){const e=dR.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=dR.find(hL,this._config.parent);return dR.find(e,this._config.parent).filter(e=>!t.includes(e))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const n of e)n.classList.toggle("collapsed",!t),n.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const n=gL.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e]()}})}}aR.on(document,rL,dL,function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const t of dR.getMultipleElementsFromSelector(this))gL.getOrCreateInstance(t,{toggle:!1}).toggle()}),FN(gL);const mL="dropdown",vL=".".concat("bs.dropdown"),yL=".data-api",bL="ArrowUp",_L="ArrowDown",wL="hide".concat(vL),kL="hidden".concat(vL),xL="show".concat(vL),TL="shown".concat(vL),CL="click".concat(vL).concat(yL),EL="keydown".concat(vL).concat(yL),SL="keyup".concat(vL).concat(yL),IL="show",AL='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',DL="".concat(AL,".").concat(IL),PL=".dropdown-menu",OL=qN()?"top-end":"top-start",ML=qN()?"top-start":"top-end",NL=qN()?"bottom-end":"bottom-start",RL=qN()?"bottom-start":"bottom-end",LL=qN()?"left-start":"right-start",VL=qN()?"right-start":"left-start",qL={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},FL={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class BL extends uR{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=dR.next(this._element,PL)[0]||dR.prev(this._element,PL)[0]||dR.findOne(PL,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return qL}static get DefaultType(){return FL}static get NAME(){return mL}toggle(){return this._isShown()?this.hide():this.show()}show(){if(ON(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!aR.trigger(this._element,xL,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".
3765navbar-nav"))for(const e of[].concat(...document.body.children))aR.on(e,"mouseover",NN);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(IL),this._element.classList.add(IL),aR.trigger(this._element,TL,e)}}hide(){if(ON(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!aR.trigger(this._element,wL,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))aR.off(e,"mouseover",NN);this._popper&&this._popper.destroy(),this._menu.classList.remove(IL),this._element.classList.remove(IL),this._element.setAttribute("aria-expanded","false"),lR.removeDataAttribute(this._menu,"popper"),aR.trigger(this._element,kL,e)}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!AN(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError("".concat(mL.toUpperCase(),': Option "reference" provided type "object" without a required "getBoundingClientRect" method.'));return e}_createPopper(){if(void 0===kN)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;"parent"===this._config.reference?e=this._parent:AN(this._config.reference)?e=DN(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=wN(e,this._menu,t)}_isShown(){return this._menu.classList.contains(IL)}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return LL;if(e.classList.contains("dropstart"))return VL;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?ML:OL:t?RL:NL}
vendor: 9,971 bytes, line 3765
3765_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(lR.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...BN(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const n=dR.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(e=>PN(e));n.length&&jN(n,t,e===_L,!n.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=BL.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e]()}})}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=dR.find(DL);for(const n of t){const t=BL.getInstance(n);if(!t||!1===t._config.autoClose)continue;const i=e.composedPath(),a=i.includes(t._menu);if(i.includes(t._element)||"inside"===t._config.autoClose&&!a||"outside"===t._config.autoClose&&a)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const o={relatedTarget:t._element};"click"===e.type&&(o.clickEvent=e),t._completeHide(o)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),n="Escape"===e.key,i=[bL,_L].includes(e.key);if(!i&&!n)return;if(t&&!n)return;e.preventDefault();const a=this.matches(AL)?this:dR.prev(this,AL)[0]||dR.next(this,AL)[0]||dR.findOne(AL,e.delegateTarget.parentNode),o=BL.getOrCreateInstance(a);if(i)return e.stopPropagation(),o.show(),void o._selectMenuItem(e);o._isShown()&&(e.stopPropagation(),o.hide(),a.focus())}}aR.on(document,EL,AL,BL.dataApiKeydownHandler),aR.on(document,EL,PL,BL.dataApiKeydownHandler),aR.on(document,CL,BL.clearMenus),aR.on(document,SL,BL.clearMenus),aR.on(document,CL,AL,function(e){e.preventDefault(),BL.getOrCreateInstance(this).toggle()}),FN(BL);const UL="backdrop",jL="show",HL="mousedown.bs.".concat(UL),zL={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},WL={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class KL extends cR{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return zL}static get DefaultType(){return WL}static get NAME(){return UL}show(e){if(!this._config.isVisible)return void BN(e);this._append();const t=this._getElement();this._config.isAnimated&&RN(t),t.classList.add(jL),this._emulateAnimation(()=>{BN(e)})}hide(e){this._config.isVisible?(this._getElement().classList.remove(jL),this._emulateAnimation(()=>{this.dispose(),BN(e)})):BN(e)}dispose(){this._isAppended&&(aR.off(this._element,HL),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=DN(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),aR.on(e,HL,()=>{BN(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){UN(e,this._getElement(),this._config.isAnimated)}}const GL=".".concat("bs.focustrap"),YL="focusin".concat(GL),QL="keydown.tab".concat(GL),$L="backward",XL={autofocus:!0,trapElement:null},JL={autofocus:"boolean",trapElement:"element"};class ZL extends cR{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return XL}static get DefaultType(){return JL}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),aR.off(document,GL),aR.on(document,YL,e=>this._handleFocusin(e)),aR.on(document,QL,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,aR.off(document,GL))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const n=dR.focusableChildren(t);0===n.length?t.focus():this._lastTabNavDirection===$L?n[n.length-1].focus():n[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?$L:"forward")}}const eV=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",tV=".sticky-top",nV="padding-right",iV="margin-right";class aV{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,nV,t=>t+e),this._setElementAttributes(eV,nV,t=>t+e),this._setElementAttributes(tV,iV,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,nV),this._resetElementAttributes(eV,nV),this._resetElementAttributes(tV,iV)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,n){const i=this.getWidth();this._applyManipulationCallback(e,e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+i)return;this._saveInitialAttribute(e,t);const a=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,"".concat(n(Number.parseFloat(a)),"px"))})}_saveInitialAttribute(e,t){const n=e.style.getPropertyValue(t);n&&lR.setDataAttribute(e,t,n)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,e=>{const n=lR.getDataAttribute(e,t);null!==n?(lR.removeDataAttribute(e,t),e.style.setProperty(t,n)):e.style.removeProperty(t)})}_applyManipulationCallback(e,t){if(AN(e))t(e);else for(const n of dR.find(e,this._element))t(n)}}const oV=".".concat("bs.modal"),sV="hide".concat(oV),rV="hidePrevented".concat(oV),lV="hidden".concat(oV),cV="show".concat(oV),uV="shown".concat(oV),hV="resize".concat(oV),dV="click.dismiss".concat(oV),fV="mousedown.dismiss".concat(oV),pV="keydown.dismiss".concat(oV),gV="click".concat(oV).concat(".data-api"),mV="modal-open",vV="show",yV="modal-static",bV={backdrop:!0,focus:!0,keyboard:!0},_V={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class wV extends uR{constructor(e,t){super(e,t),this._dialog=dR.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new aV,this._addEventListeners()}static get Default(){return bV}static get DefaultType(){return _V}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||this._isTransitioning)return;aR.trigger(this._element,cV,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(mV),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){if(!this._isShown||this._isTransitioning)return;aR.trigger(this._element,sV).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(vV),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){aR.off(window,oV),aR.off(this._dialog,oV),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new KL({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new ZL({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=dR.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),RN(this._element),this._element.classList.add(vV);this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,aR.trigger(this._element,uV,{relatedTarget:e})},this._dialog,this._isAnimated())}_addEventListeners(){aR.on(this._element,pV,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),aR.on(window,hV,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),aR.on(this._element,fV,e=>{aR.one(this._element,dV,t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(mV),this._resetAdjustments(),this._scrollBar.reset(),aR.trigger(this._element,lV)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(aR.trigger(this._element,rV).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(yV)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(yV),this._queueCallback(()=>{this._element.classList.remove(yV),this._queueCallback(()=>{this._element.style.overflowY=t},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;
3765if(n&&!e){const e=qN()?"paddingLeft":"paddingRight";this._element.style[e]="".concat(t,"px")}if(!n&&e){const e=qN()?"paddingRight":"paddingLeft";this._element.style[e]="".concat(t,"px")}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const n=wV.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e](t)}})}}aR.on(document,gV,'[data-bs-toggle="modal"]',function(e){const t=dR.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),aR.one(t,cV,e=>{e.defaultPrevented||aR.one(t,lV,()=>{PN(this)&&this.focus()})});const n=dR.findOne(".modal.show");n&&wV.getInstance(n).hide();wV.getOrCreateInstance(t).toggle(this)}),fR(wV),FN(wV);const kV=".".concat("bs.offcanvas"),xV=".data-api",TV="load".concat(kV).concat(xV),CV="show",EV="showing",SV="hiding",IV=".offcanvas.show",AV="show".concat(kV),DV="shown".concat(kV),PV="hide".concat(kV),OV="hidePrevented".concat(kV),MV="hidden".concat(kV),NV="resize".concat(kV),RV="click".concat(kV).concat(xV),LV="keydown.dismiss".concat(kV),VV={backdrop:!0,keyboard:!0,scroll:!1},qV={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class FV extends uR{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return VV}static get DefaultType(){return qV}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown)return;if(aR.trigger(this._element,AV,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new aV).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(EV);this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(CV),this._element.classList.remove(EV),aR.trigger(this._element,DV,{relatedTarget:e})},this._element,!0)}hide(){if(!this._isShown)return;if(aR.trigger(this._element,PV).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(SV),this._backdrop.hide();this._queueCallback(()=>{this._element.classList.remove(CV,SV),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new aV).reset(),aR.trigger(this._element,MV)},this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new KL({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():aR.trigger(this._element,OV)}:null})}_initializeFocusTrap(){return new ZL({trapElement:this._element})}_addEventListeners(){aR.on(this._element,LV,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():aR.trigger(this._element,OV))})}static jQueryInterface(e){return this.each(function(){const t=FV.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}})}}aR.on(document,RV,'[data-bs-toggle="offcanvas"]',function(e){const t=dR.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),ON(this))return;aR.one(t,MV,()=>{PN(this)&&this.focus()});const n=dR.findOne(IV);n&&n!==t&&FV.getInstance(n).hide();FV.getOrCreateInstance(t).toggle(this)}),aR.on(window,TV,()=>{for(const e of dR.find(IV))FV.getOrCreateInstance(e).show()}),aR.on(window,NV,()=>{for(const e of dR.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&FV.getOrCreateInstance(e).hide()}),fR(FV),FN(FV);const BV={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},UV=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),jV=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,HV=(e,t)=>{const n=e.nodeName.toLowerCase();return t.includes(n)?!UV.has(n)||Boolean(jV.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(n))};const zV={allowList:BV,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},WV={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},KV={entry:"(string|element|function|null)",selector:"(string|element)"};class GV extends cR{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return zV}static get DefaultType(){return WV}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(e=>
vendor: 4,655 bytes, line 3765
3765this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[i,a]of Object.entries(this._config.content))this._setContent(e,a,i);const t=e.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&t.classList.add(...n.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,n]of Object.entries(e))super._typeCheckConfig({selector:t,entry:n},KV)}_setContent(e,t,n){const i=dR.findOne(n,e);i&&((t=this._resolvePossibleFunction(t))?AN(t)?this._putElementInTemplate(DN(t),i):this._config.html?i.innerHTML=this._maybeSanitize(t):i.textContent=t:i.remove())}_maybeSanitize(e){return this._config.sanitize?function(e,t,n){if(!e.length)return e;if(n&&"function"==typeof n)return n(e);const i=(new window.DOMParser).parseFromString(e,"text/html"),a=[].concat(...i.body.querySelectorAll("*"));for(const o of a){const e=o.nodeName.toLowerCase();if(!Object.keys(t).includes(e)){o.remove();continue}const n=[].concat(...o.attributes),i=[].concat(t["*"]||[],t[e]||[]);for(const t of n)HV(t,i)||o.removeAttribute(t.nodeName)}return i.body.innerHTML}(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return BN(e,[this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const YV=new Set(["sanitize","allowList","sanitizeFn"]),QV="fade",$V="show",XV=".tooltip-inner",JV=".".concat("modal"),ZV="hide.bs.modal",eq="hover",tq="focus",nq={AUTO:"auto",TOP:"top",RIGHT:qN()?"left":"right",BOTTOM:"bottom",LEFT:qN()?"right":"left"},iq={allowList:BV,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},aq={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};let oq=class e extends uR{constructor(e,t){if(void 0===kN)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return iq}static get DefaultType(){return aq}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),aR.off(this._element.closest(JV),ZV,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=aR.trigger(this._element,this.constructor.eventName("show")),t=(MN(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));const{container:i}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(i.append(n),aR.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(n),n.classList.add($V),"ontouchstart"in document.documentElement)for(const a of[].concat(...document.body.children))aR.on(a,"mouseover",NN);this._queueCallback(()=>{aR.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}
vendor: 5,413 bytes, line 3765
3765hide(){if(!this._isShown())return;if(aR.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove($V),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))aR.off(e,"mouseover",NN);this._activeTrigger.click=!1,this._activeTrigger[tq]=!1,this._activeTrigger[eq]=!1,this._isHovered=null;this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),aR.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(QV,$V),t.classList.add("bs-".concat(this.constructor.NAME,"-auto"));const n=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add(QV),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new GV({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[XV]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(QV)}_isShown(){return this.tip&&this.tip.classList.contains($V)}_createPopper(e){const t=BN(this._config.placement,[this,e,this._element]),n=nq[t.toUpperCase()];return wN(this._element,e,this._getPopperConfig(n))}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return BN(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:".".concat(this.constructor.NAME,"-arrow")}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return{...t,...BN(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)aR.on(this._element,this.constructor.eventName("click"),this._config.selector,e=>{this._initializeOnDelegatedTarget(e).toggle()});else if("manual"!==t){const e=t===eq?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),n=t===eq?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");aR.on(this._element,e,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?tq:eq]=!0,t._enter()}),aR.on(this._element,n,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?tq:eq]=t._element.contains(e.relatedTarget),t._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},aR.on(this._element.closest(JV),ZV,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=lR.getDataAttributes(this._element);for(const n of Object.keys(t))YV.has(n)&&delete t[n];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:DN(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,n]of Object.entries(this._config))this.constructor.Default[t]!==n&&(e[t]=n);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each(function(){const n=e.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===n[t])throw new TypeError('No method n
3765amed "'.concat(t,'"'));n[t]()}})}};FN(oq);const sq=".popover-header",rq=".popover-body",lq={...oq.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},cq={...oq.DefaultType,content:"(null|string|element|function)"};class uq extends oq{static get Default(){return lq}static get DefaultType(){return cq}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[sq]:this._getTitle(),[rq]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=uq.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e]()}})}}FN(uq);const hq=".".concat("bs.scrollspy"),dq="activate".concat(hq),fq="click".concat(hq),pq="load".concat(hq).concat(".data-api"),gq="active",mq="[href]",vq=".nav-link",yq="".concat(vq,", ").concat(".nav-item"," > ").concat(vq,", ").concat(".list-group-item"),bq={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},_q={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class wq extends uR{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return bq}static get DefaultType(){return _q}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=DN(e.target)||document.body,e.rootMargin=e.offset?"".concat(e.offset,"px 0px -30%"):e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map(e=>Number.parseFloat(e))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(aR.off(this._config.target,fq),aR.on(this._config.target,fq,mq,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const n=this._rootElement||window,i=t.offsetTop-this._element.offsetTop;if(n.scrollTo)return void n.scrollTo({top:i,behavior:"smooth"});n.scrollTop=i}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(e=>this._observerCallback(e),e)}_observerCallback(e){const t=e=>this._targetLinks.get("#".concat(e.target.id)),n=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},i=(this._rootElement||document.documentElement).scrollTop,a=i>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=i;for(const o of e){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(o));continue}const e=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(a&&e){if(n(o),!i)return}else a||e||n(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=dR.find(mq,this._config.target);for(const t of e){if(!t.hash||ON(t))continue;const e=dR.findOne(decodeURI(t.hash),this._element);PN(e)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(gq),this._activateParents(e),aR.trigger(this._element,dq,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))dR.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(gq);else for(const t of dR.parents(e,".nav, .list-group"))for(const e of dR.prev(t,yq))e.classList.add(gq)}
3765_clearActiveClass(e){e.classList.remove(gq);const t=dR.find("".concat(mq,".").concat(gq),e);for(const n of t)n.classList.remove(gq)}static jQueryInterface(e){return this.each(function(){const t=wq.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e]()}})}}aR.on(window,pq,()=>{for(const e of dR.find('[data-bs-spy="scroll"]'))wq.getOrCreateInstance(e)}),FN(wq);const kq=".".concat("bs.tab"),xq="hide".concat(kq),Tq="hidden".concat(kq),Cq="show".concat(kq),Eq="shown".concat(kq),Sq="click".concat(kq),Iq="keydown".concat(kq),Aq="load".concat(kq),Dq="ArrowLeft",Pq="ArrowRight",Oq="ArrowUp",Mq="ArrowDown",Nq="Home",Rq="End",Lq="active",Vq="fade",qq="show",Fq=".dropdown-toggle",Bq=":not(".concat(Fq,")"),Uq=".nav-link".concat(Bq,", .list-group-item").concat(Bq,', [role="tab"]').concat(Bq),jq='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Hq="".concat(Uq,", ").concat(jq),zq=".".concat(Lq,'[data-bs-toggle="tab"], .').concat(Lq,'[data-bs-toggle="pill"], .').concat(Lq,'[data-bs-toggle="list"]');class Wq extends uR{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),aR.on(this._element,Iq,e=>this._keydown(e)))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),n=t?aR.trigger(t,xq,{relatedTarget:e}):null;aR.trigger(e,Cq,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(Lq),this._activate(dR.getElementFromSelector(e));this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),aR.trigger(e,Eq,{relatedTarget:t})):e.classList.add(qq)},e,e.classList.contains(Vq))}_deactivate(e,t){if(!e)return;e.classList.remove(Lq),e.blur(),this._deactivate(dR.getElementFromSelector(e));this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),aR.trigger(e,Tq,{relatedTarget:t})):e.classList.remove(qq)},e,e.classList.contains(Vq))}_keydown(e){if(![Dq,Pq,Oq,Mq,Nq,Rq].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(e=>!ON(e));let n;if([Nq,Rq].includes(e.key))n=t[e.key===Nq?0:t.length-1];else{const i=[Pq,Mq].includes(e.key);n=jN(t,e.target,i,!0)}n&&(n.focus({preventScroll:!0}),Wq.getOrCreateInstance(n).show())}_getChildren(){return dR.find(Hq,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const n of t)this._setInitialAttributesOnChild(n)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute("aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=dR.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby","".concat(e.id)))}_toggleDropDown(e,t){const n=this._getOuterElement(e);if(!n.classList.contains("dropdown"))return;const i=(e,i)=>{const a=dR.findOne(e,n);a&&a.classList.toggle(i,t)};i(Fq,Lq),i(".dropdown-menu",qq),n.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}_elemIsActive(e){return e.classList.contains(Lq)}_getInnerElement(e){return e.matches(Hq)?e:dR.findOne(Hq,e)}
3765_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}static jQueryInterface(e){return this.each(function(){const t=Wq.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e]()}})}}aR.on(document,Sq,jq,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),ON(this)||Wq.getOrCreateInstance(this).show()}),aR.on(window,Aq,()=>{for(const e of dR.find(zq))Wq.getOrCreateInstance(e)}),FN(Wq);const Kq=".".concat("bs.toast"),Gq="mouseover".concat(Kq),Yq="mouseout".concat(Kq),Qq="focusin".concat(Kq),$q="focusout".concat(Kq),Xq="hide".concat(Kq),Jq="hidden".concat(Kq),Zq="show".concat(Kq),eF="shown".concat(Kq),tF="hide",nF="show",iF="showing",aF={animation:"boolean",autohide:"boolean",delay:"number"},oF={animation:!0,autohide:!0,delay:5e3};class sF extends uR{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return oF}static get DefaultType(){return aF}static get NAME(){return"toast"}show(){if(aR.trigger(this._element,Zq).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(tF),RN(this._element),this._element.classList.add(nF,iF),this._queueCallback(()=>{this._element.classList.remove(iF),aR.trigger(this._element,eF),this._maybeScheduleHide()},this._element,this._config.animation)}hide(){if(!this.isShown())return;if(aR.trigger(this._element,Xq).defaultPrevented)return;this._element.classList.add(iF),this._queueCallback(()=>{this._element.classList.add(tF),this._element.classList.remove(iF,nF),aR.trigger(this._element,Jq)},this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(nF),super.dispose()}isShown(){return this._element.classList.contains(nF)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){aR.on(this._element,Gq,e=>this._onInteraction(e,!0)),aR.on(this._element,Yq,e=>this._onInteraction(e,!1)),aR.on(this._element,Qq,e=>this._onInteraction(e,!0)),aR.on(this._element,$q,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=sF.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}})}}fR(sF),FN(sF);const rF={class:"container content-container"},lF={class:"form-section"},cF={class:"row"},uF={class:"col-md-12 mb-4"},hF={class:"form-group shadow-sm"},dF={class:"col-md-12 mb-4"},fF={class:"form-group shadow-sm"},pF={class:"col-md-12 mb-4"},gF={class:"form-group shadow-sm"},mF=["value"],vF={key:0,class:"col-md-12 mb-4"},yF={class:"form-group shadow-sm"},bF={class:"multiselect-wrapper"},_F={key:1,class:"col-md-12 mb-4"},wF={class:"form-group shadow-sm"},kF={class:"multiselect-wrapper"},xF={class:"d-flex justify-content-between mt-4"},TF=["disabled"],CF=["disabled"],EF={class:"mt-4 px-3"},SF={class:"row mb-3"},IF={class:"col-md-6 mb-4"},AF={class:"form-group shadow-sm"},DF={class:"col-md-6 mb-4"},PF={class:"form-group shadow-sm"},OF=["value"],MF={class:"table-responsive"},NF={class:"table table-striped custom-table"},RF={class:"d-flex gap-2 justify-content-center"},LF=["onClick"],VF=["onClick"],qF=["onClick"],FF={class:"modal fade",id:"editUserModal",tabindex:"-1","aria-labelledby":"editUserModalLabel","aria-hidden":"true"},BF={class:"modal-dialog modal-lg"},UF={class:"modal-content"},jF={class:"modal-body"},HF={class:"mb-3"},zF={class:"mb-3"},WF=["value"],KF={key:0,class:"mb-3"},GF={class:"multiselect-wrapper"}
3765,YF={key:1,class:"mb-3"},QF={class:"multiselect-wrapper"},$F={class:"modal-footer"},XF=["disabled"],JF={class:"modal fade",id:"resetPasswordModal",tabindex:"-1","aria-labelledby":"resetPasswordModalLabel","aria-hidden":"true"},ZF={class:"modal-dialog modal-md"},eB={class:"modal-content"},tB={class:"modal-body"},nB={class:"mb-3"},iB={class:"mb-3"},aB={class:"mb-3"},oB={class:"modal-footer"},sB=["disabled"],rB=CC({__name:"QuanLyTaiKhoan",setup(e){const t=Ll(),n=gt({email:"",password:"",role:""}),i=It([]),a=It([]),o=It([]),s=It(!1),r=It(""),l=It("");let c=null,u=null;const h=JT(),{items:d}=Zs(h),f=wI(),{items:p}=Zs(f),g=xI(),{users:m}=Zs(g),v=ET(),{userRole:y}=Zs(v),{userAuth:b}=Zs(v),_=bo(()=>y.value.role==zT?[]:y.value.role==UT?YT.filter(e=>e.value==zT):YT),w=bo(()=>d.value.map(e=>({id:e.id,name:e.ten}))),k=It([]),x=It(!1),T=It(!1),C=It(!1);fa(()=>{x.value=[UT,jT,HT].includes(n.role)&&y.value.role==BT,T.value=n.role==zT&&y.value.role==BT,C.value=[UT].includes(n.role)&&y.value.role==BT}),ei(async()=>{await Promise.all([v.getAuthUser(),v.getUserAuthRole(),g.fetchUsers(),h.fetchItems(),f.fetchEnableItems()]),k.value=p.value,c=new wV(document.getElementById("editUserModal")),u=new wV(document.getElementById("resetPasswordModal"))});const E=bo(()=>m.value.filter(e=>{const t=e.email.toLowerCase().includes(r.value.toLowerCase()),n=!l.value||e.role.role===l.value;return t&&n})),S=()=>{i.value=[],o.value=[],a.value=[]},I=async e=>{if(n.role==zT&&e){const t=Array.isArray(e)&&e.length?e[0]:e;await Promise.all([f.fetchEnableItemsByDonVi(t.id)]),o.value=[];const n=p.value.length?p.value.map(e=>({id:e.id,name:e.ten})):[];o.value.push({organization:t.name,departments:n})}},A=()=>{o.value=[],a.value=[]},D=async()=>{try{if(s.value=!0,!n.email||!n.password||!n.role)return void VT("Vui lòng nháºp Äầy Äá»§ thông tin!");if([UT,jT].includes(y.value.role)&&n.role!=zT)return void VT("Dữ liá»u không hợp lá»!");const e=i.value&&Array.isArray(i.value)?i.value:[i.value];if(n.role==UT&&!e.length)return void VT("Vui lòng chá»n ÄÆ¡n vá»!");const t=a.value||[];if(n.role==zT&&!e.length&&!t.length)return void VT("Vui lòng chá»n ÄÆ¡n vá» và quầy!");if(await g.addUser({...n}),[UT,jT,HT].includes(n.role))for(const i of e)await h.updateItem(i.id,{quanly:Sk(n.email)});if(n.role==zT)for(const i of t)await f.updateItem(i.id,{quanly:Sk(n.email)});g.fetchUsers(),P(),LT("Thêm má»i tà i khoản thà nh công!")}catch(eRe){VT((null==eRe?void 0:eRe.message)||"Thêm má»i tà i khoản thất bại!")}finally{s.value=!1}},P=()=>{n.email="",n.password="",n.role="",i.value=[],o.value=[],a.value=[]},O=()=>{t.back()},M=gt({email:"",role:"",uid:""}),N=It([]),R=It([]),L=It([]),V=It(!1),q=It(!1),F=It(!1),B=It(!1),U=gt({email:"",password:"",confirmPassword:"",uid:""}),j=It(!1);fa(()=>{q.value=[UT,jT].includes(M.role)&&y.value.role==BT,F.value=M.role==zT&&y.value.role==BT,B.value=[UT].includes(M.role)&&y.value.role==BT});const H=async e=>{if(M.role==zT&&e){const t=Array.isArray(e)&&e.length?e[0]:e;await Promise.all([f.fetchEnableItemsByDonVi(t.id)]),L.value=[];const n=p.value.length?p.value.map(e=>({id:e.id,name:e.ten})):[];L.value.push({organization:t.name,departments:n})}},z=()=>{L.value=[],R.value=[]},W=async()=>{try{if(V.value=!0,!M.email||!M.role)return void VT("Vui lòng nháºp Äầy Äá»§ thông tin!");await g.updateUserRole(M.uid,M.role);const e=N.value&&Array.isArray(N.value)?N.value:N.value?[N.value]:[];for(const t of d.value)t.quanly&&t.quanly.includes(M.email)&&await h.updateItem(t.id,{quanly:Ik(M.email)});for(const t of p.value)t.quanly&&t.quanly.includes(M.email)&&await f.updateItem(t.id,{quanly:Ik(M.email)});if([UT,jT].includes(M.role))for(const t of e)await h.updateItem(t.id,{quanly:Sk(M.email)});if(M.role===zT){const e=R.value||[];for(const t of e)await f.updateItem(t.id,{quanly:Sk(M.email)})}await g.fetchUsers(),LT("Cáºp nháºt tà i khoản thà nh công!"),c.hide()}catch(eRe){VT("Cáºp nháºt tà i khoản thất bại!")}finally{V.value=!1}},K=async()=>{try{if(j.value=!0,!U.password||!U.confirmPassword)return void VT("Vui lòng nháºp Äầy Äá»§ thông tin!");if(U.password!==U.confirmPassword)return void VT("Máºt khẩu xác nháºn không khá»p!");await g.resetPassword(U.uid,U.password),LT("Äặt lại máºt khẩu thà nh công!"),u.hide()}catch(eRe){VT("Äặt lại máºt khẩu thất bại!")}finally{j.value=!1}};return(e,t)=>(Ma(),Va("div",rF,[t[39]||(t[39]=Ha("div",{class:"header"},[Ha("h3",{class:"text-center"},"ÄÄNG Kà TÃI KHOẢN")],-1)),Ha("form",{onSubmit:Es(D,["prevent"]),class:"form-container"},[Ha("div",lF,[Ha("div",cF,[Ha("div",uF,[Ha("div",hF,[t[14]||(t[14]=Ha("label",{for:"username",class:"form-label"},"Tên tà i khoản",-1)),gn(Ha("input",{type:"email",class:"form-control",placeholder:"Nháºp tên tà i khoản",required:"","onUpdate:modelValue":t[0]||(t[0]=e=>n.email=e)},null,512),[[ms,n.email]])])]),Ha("div",dF,[Ha("div",fF,[t[15]||(t[15]=H
3765a("label",{for:"password",class:"form-label"},"Máºt khẩu",-1)),gn(Ha("input",{type:"password",class:"form-control",placeholder:"Nháºp máºt khẩu",required:"","onUpdate:modelValue":t[1]||(t[1]=e=>n.password=e)},null,512),[[ms,n.password]])])]),Ha("div",pF,[Ha("div",gF,[t[17]||(t[17]=Ha("label",{for:"role",class:"form-label"},"Vai trò",-1)),gn(Ha("select",{id:"role",class:"form-control",required:"","onUpdate:modelValue":t[2]||(t[2]=e=>n.role=e),onChange:S},[t[16]||(t[16]=Ha("option",{value:"",disabled:"",selected:""},"Vui lòng chá»n vai trò",-1)),(Ma(!0),Va(Sa,null,gi(_.value,e=>(Ma(),Va("option",{value:e.value,key:e.value},ee(e.name),9,mF))),128))],544),[[_s,n.role]])])]),x.value||T.value?(Ma(),Va("div",vF,[Ha("div",yF,[t[18]||(t[18]=Ha("label",{for:"organization",class:"form-label"},"ÄÆ¡n vá»",-1)),Ha("div",bF,[za(Ot(IO),{id:"organization",modelValue:i.value,"onUpdate:modelValue":[t[3]||(t[3]=e=>i.value=e),I],options:w.value,multiple:C.value,taggable:!1,"close-on-select":!C.value,"clear-on-select":!0,showNoResults:!1,showNoOptions:!1,onRemove:A,selectLabel:"Chá»n ÄÆ¡n vá»",selectedLabel:"Äã chá»n",placeholder:"Vui lòng chá»n ÄÆ¡n vá»",deselectLabel:"Nhấn Äá» xoá ÄÆ¡n vá» Äã chá»n",label:"name","track-by":"id"},null,8,["modelValue","options","multiple","close-on-select"])])])])):Qa("",!0),T.value&&o.value.length?(Ma(),Va("div",_F,[Ha("div",wF,[t[19]||(t[19]=Ha("label",{for:"departments",class:"form-label"},"Quầy",-1)),Ha("div",kF,[za(Ot(IO),{id:"departments",modelValue:a.value,"onUpdate:modelValue":t[4]||(t[4]=e=>a.value=e),options:o.value,multiple:!0,taggable:!1,"group-select":!0,"close-on-select":!1,"clear-on-select":!0,showNoResults:!1,showNoOptions:!1,selectLabel:"Chá»n quầy quản lý",selectedLabel:"Äã chá»n",placeholder:"Vui lòng chá»n quầy",deselectLabel:"Nhấn Äá» xoá quầy Äã chá»n","group-values":"departments","group-label":"organization",label:"name","track-by":"id"},null,8,["modelValue","options"])])])])):Qa("",!0)])]),Ha("div",xF,[Ha("button",{type:"submit",class:"btn btn-custom btn-gradient-orange me-2",disabled:s.value}," Thêm má»i ",8,TF),Ha("button",{type:"button",class:"btn btn-custom btn-gradient-blue",onClick:O,disabled:s.value}," Quay lại ",8,CF)])],32),Ha("div",EF,[Ha("div",SF,[Ha("div",IF,[Ha("div",AF,[t[20]||(t[20]=Ha("label",{for:"searchEmail",class:"form-label"},"Tìm kiếm theo email",-1)),gn(Ha("input",{id:"searchEmail",type:"text",class:"form-control",placeholder:"Nháºp email...","onUpdate:modelValue":t[5]||(t[5]=e=>r.value=e)},null,512),[[ms,r.value]])])]),Ha("div",DF,[Ha("div",PF,[t[22]||(t[22]=Ha("label",{for:"filterRole",class:"form-label"},"Tìm kiếm theo vai trò",-1)),gn(Ha("select",{id:"filterRole",class:"form-control","onUpdate:modelValue":t[6]||(t[6]=e=>l.value=e)},[t[21]||(t[21]=Ha("option",{value:""},"Tất cả vai trò",-1)),(Ma(!0),Va(Sa,null,gi(_.value,e=>(Ma(),Va("option",{value:e.value,key:e.value},ee(e.name),9,OF))),128))],512),[[_s,l.value]])])])]),Ha("div",MF,[Ha("table",NF,[t[27]||(t[27]=Ha("thead",null,[Ha("tr",null,[Ha("th",{colspan:"5"},[Ha("h4",{class:"text-center mb-0"},"DANH SÃCH TÃI KHOẢN")])]),Ha("tr",null,[Ha("th",null,"#"),Ha("th",null,"Tên tà i khoản"),Ha("th",null,"Vai trò"),Ha("th",null,"Máºt khẩu"),Ha("th",null,"Hà nh Äá»ng")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(E.value,(e,n)=>{var i;return Ma(),Va("tr",{key:e.uid},[Ha("td",null,ee(n+1),1),Ha("td",null,ee(e.email),1),Ha("td",null,ee(Ot(nC)(null==(i=e.role)?void 0:i.role)),1),t[26]||(t[26]=Ha("td",null,"******",-1)),Ha("td",null,[Ha("div",RF,[Ha("button",{class:"btn btn-icon btn-primary",onClick:t=>(async e=>{var t;if(M.email=e.email,M.role=(null==(t=e.role)?void 0:t.role)||"",M.uid=e.uid,N.value=[],R.value=[],L.value=[],[UT,jT].includes(M.role)){const t=[];for(const n of d.value)n.quanly&&n.quanly.includes(e.email)&&t.push({id:n.id,name:n.ten});N.value=B.value?t:t.length?t[0]:null}if(M.role===zT){const t=[],n=new Set;for(const a of p.value)a.quanly&&a.quanly.includes(e.email)&&(t.push({id:a.id,name:a.ten}),n.add(a.donvi));const i=[];for(const e of n){const t=d.value.find(t=>
3765t.id===e);t&&i.push({id:t.id,name:t.ten})}N.value=i.length?i[0]:null,N.value&&(await H(N.value),R.value=t)}c.show()})(e)},t[23]||(t[23]=[Ha("i",{class:"fas fa-edit"},null,-1)]),8,LF),Ha("button",{class:"btn btn-icon btn-warning",onClick:t=>(e=>{U.email=e.email,U.password="",U.confirmPassword="",U.uid=e.uid,u.show()})(e)},t[24]||(t[24]=[Ha("i",{class:"fas fa-key"},null,-1)]),8,VF),Ha("button",{class:"btn btn-icon btn-danger",onClick:t=>(async e=>{if(e.uid==b.value.uid)return void VT("Bạn không có quyá»n xoá tà i khoản nà y!");if((await kO()).isConfirmed)try{await g.deleteUser(e.uid);const t=d.value||[];for(const i of t)await h.updateItem(i.id,{quanly:Ik(e.email)});const n=k.value||[];for(const i of n)await f.updateItem(i.id,{quanly:Ik(e.email)});LT("Xóa tà i khoản thà nh công!")}catch(eRe){VT((null==eRe?void 0:eRe.message)||"Xóa tà i khoản thất bại!")}})(e)},t[25]||(t[25]=[Ha("i",{class:"fas fa-trash-alt"},null,-1)]),8,qF)])])])}),128))])])])]),Ha("div",FF,[Ha("div",BF,[Ha("div",UF,[t[33]||(t[33]=Ha("div",{class:"modal-header"},[Ha("h5",{class:"modal-title",id:"editUserModalLabel"},"Chá»nh sá»a tà i khoản"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("div",jF,[Ha("form",null,[Ha("div",HF,[t[28]||(t[28]=Ha("label",{class:"form-label"},"Email",-1)),gn(Ha("input",{type:"email",class:"form-control",disabled:"","onUpdate:modelValue":t[7]||(t[7]=e=>M.email=e)},null,512),[[ms,M.email]])]),Ha("div",zF,[t[29]||(t[29]=Ha("label",{class:"form-label"},"Vai trò",-1)),gn(Ha("select",{class:"form-control","onUpdate:modelValue":t[8]||(t[8]=e=>M.role=e)},[(Ma(!0),Va(Sa,null,gi(_.value,e=>(Ma(),Va("option",{value:e.value,key:e.value},ee(e.name),9,WF))),128))],512),[[_s,M.role]])]),q.value||F.value?(Ma(),Va("div",KF,[t[30]||(t[30]=Ha("label",{class:"form-label"},"ÄÆ¡n vá»",-1)),Ha("div",GF,[za(Ot(IO),{modelValue:N.value,"onUpdate:modelValue":[t[9]||(t[9]=e=>N.value=e),H],options:w.value,multiple:B.value,taggable:!1,"close-on-select":!B.value,"clear-on-select":!0,showNoResults:!1,showNoOptions:!1,onRemove:z,selectLabel:"Chá»n ÄÆ¡n vá»",selectedLabel:"Äã chá»n",placeholder:"Vui lòng chá»n ÄÆ¡n vá»",deselectLabel:"Nhấn Äá» xoá ÄÆ¡n vá» Äã chá»n",label:"name","track-by":"id"},null,8,["modelValue","options","multiple","close-on-select"])])])):Qa("",!0),F.value&&L.value.length?(Ma(),Va("div",YF,[t[31]||(t[31]=Ha("label",{class:"form-label"},"Quầy",-1)),Ha("div",QF,[za(Ot(IO),{modelValue:R.value,"onUpdate:modelValue":t[10]||(t[10]=e=>R.value=e),options:L.value,multiple:!0,taggable:!1,"group-select":!0,"close-on-select":!1,"clear-on-select":!0,showNoResults:!1,showNoOptions:!1,selectLabel:"Chá»n quầy quản lý",selectedLabel:"Äã chá»n",placeholder:"Vui lòng chá»n quầy",deselectLabel:"Nhấn Äá» xoá quầy Äã chá»n","group-values":"departments","group-label":"organization",label:"name","track-by":"id"},null,8,["modelValue","options"])])])):Qa("",!0)])]),Ha("div",$F,[t[32]||(t[32]=Ha("button",{type:"button",class:"btn btn-secondary btn-gradient-gray","data-bs-dismiss":"modal"},"Äóng",-1)),Ha("button",{type:"button",class:"btn btn-custom btn-gradient-blue",onClick:W,disabled:V.value},"Cáºp nháºt",8,XF)])])])]),Ha("div",JF,[Ha("div",ZF,[Ha("div",eB,[t[38]||(t[38]=Ha("div",{class:"modal-header"},[Ha("h5",{class:"modal-title",id:"resetPasswordModalLabel"},"Äặt lại máºt khẩu"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("div",tB,[Ha("form",null,[Ha("div",nB,[t[34]||(t[34]=Ha("label",{class:"form-label"},"Email",-1)),gn(Ha("input",{type:"email",class:"form-control",disabled:"","onUpdate:modelValue":t[11]||(t[11]=e=>U.email=e)},null,512),[[ms,U.email]])]),Ha("div",iB,[t[35]||(t[35]=Ha("label",{class:"form-label"},"Máºt khẩu má»i",-1)),gn(Ha("input",{type:"password",class:"form-control","onUpdate:modelValue":t[12]||(t[12]=e=>U.password=e),placeholder:"Nháºp máºt khẩu má»i"},null,512),[[ms,U.password]])]),Ha("div",aB,[t[36]||(t[36]=Ha("label",{class:"form-label"},"Xác nháºn máºt khẩu",-1)),gn(Ha("input",{type:"password",class:"form-control","onUpdate:modelValue":t[13]||(t[13]=e=>U.confirmPassword=e),placeholder:"Xác nháºn máºt khẩu má»i"},null,512),[[ms,U.confirmPassword]])])])]),Ha("div",oB,[t[37]||(t[37]=Ha("button",{type:"button",class:"btn btn-secondary btn-gradient-gray","data-bs-dismiss":"modal"},"Äóng",-1)),Ha("button",{type:"button",class:"btn btn-custom btn-gradient-orange",onClick:K,disabled:j.value},"Äặt lại máºt khẩu",8,sB)])])])])]))}},[["__scopeId","data-v-7e4e89be"]]),lB={class:"container content-container"},cB={class:"header"},uB={class:"text-center"},hB={key:0,class:"alert alert-custom alert-danger shadow-sm mb-4",role:"alert"},dB={class:"form-group shadow-sm mb-4"},fB={class:"form-group shadow-sm mb-4"},pB={class:"text-end mb-2"}
3765,gB={key:0,class:"alert alert-custom alert-success shadow-sm mb-4",role:"alert"},mB={class:"form-group shadow-sm mb-4"},vB={class:"text-end mb-4"};const yB=CC(jn({data:()=>({email:"",password:"",loginError:!1,showFormResetPass:!1,emailForgot:"",emailForgotSent:!1}),methods:{toggleForm(){this.showFormResetPass=!this.showFormResetPass,this.loginError=!1,this.emailForgotSent=!1},async loginByEmail(){var e,t;try{await ef(dp(),this.email,this.password),this.loginError=!1;const n=ET(),i=wI(),a=JT();await Promise.all([n.getUserAuthRole()]);const o=async(e,t,i)=>{var a,o,s;return(null==(a=n.userRole)?void 0:a.role)!==e?null:(await t.fetchItemsByManager(this.email),(null==(s=null==(o=t.items)?void 0:o[0])?void 0:s[i])||null)},s=null!=(t=null!=(e=await o(zT,i,"donvi"))?e:await o(jT,a,"id"))?t:await o(HT,a,"id");this.$router.push({path:s?"/".concat(s,"/quan-tri-don-vi"):"/"})}catch(ZNe){this.loginError=!0}},async resetPassword(){try{await async function(e,t){const n=Td(e),i={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};await Dd(n,i,"getOobCode",Vd)}(dp(),this.emailForgot),this.emailForgotSent=!0}catch(eRe){}}}}),[["render",function(e,t,n,i,a,o){return Ma(),Va("div",lB,[Ha("div",cB,[Ha("h3",uB,ee(e.showFormResetPass?"LẤY LẠI MẬT KHẨU":"ÄÄNG NHẬP"),1)]),e.showFormResetPass?(Ma(),Va("form",{key:1,onSubmit:t[6]||(t[6]=Es((...t)=>e.resetPassword&&e.resetPassword(...t),["prevent"])),class:"form-container"},[e.emailForgotSent?(Ma(),Va("div",gB,t[11]||(t[11]=[Ha("i",{class:"fas fa-check-circle me-2"},null,-1),Ga(" Vui lòng kiá»m tra há»p thư Äá» Äá»i máºt khẩu! ")]))):Qa("",!0),Ha("div",mB,[t[12]||(t[12]=Ha("label",{for:"email",class:"form-label"},"Nháºp Äá»a chá» email ÄÄng ký",-1)),gn(Ha("input",{type:"email",id:"email",class:"form-control",placeholder:"Nháºp Äá»a chá» email",required:"","onUpdate:modelValue":t[4]||(t[4]=t=>e.emailForgot=t)},null,512),[[ms,e.emailForgot]])]),Ha("div",vB,[Ha("a",{href:"#",class:"text-link",onClick:t[5]||(t[5]=(...t)=>e.toggleForm&&e.toggleForm(...t))},"Vá» ÄÄng nháºp?")]),t[13]||(t[13]=Ha("div",{class:"d-flex justify-content-center"},[Ha("button",{type:"submit",class:"btn btn-custom btn-gradient-orange"},"Lấy lại máºt khẩu")],-1))],32)):(Ma(),Va("form",{key:0,onSubmit:t[3]||(t[3]=Es((...t)=>e.loginByEmail&&e.loginByEmail(...t),["prevent"])),class:"form-container"},[e.loginError?(Ma(),Va("div",hB,t[7]||(t[7]=[Ha("i",{class:"fas fa-exclamation-circle me-2"},null,-1),Ga(" Tên ÄÄng nháºp hoặc máºt khẩu không chÃnh xác! ")]))):Qa("",!0),Ha("div",dB,[t[8]||(t[8]=Ha("label",{for:"username",class:"form-label"},"Tên ÄÄng nháºp",-1)),gn(Ha("input",{type:"email",id:"username",class:"form-control",placeholder:"Nháºp tên ÄÄng nháºp","onUpdate:modelValue":t[0]||(t[0]=t=>e.email=t),required:""},null,512),[[ms,e.email]])]),Ha("div",fB,[t[9]||(t[9]=Ha("label",{for:"password",class:"form-label"},"Máºt khẩu",-1)),gn(Ha("input",{type:"password",id:"password",class:"form-control",placeholder:"Nháºp máºt khẩu","onUpdate:modelValue":t[1]||(t[1]=t=>e.password=t),required:""},null,512),[[ms,e.password]])]),Ha("div",pB,[Ha("a",{href:"#",class:"text-link",onClick:t[2]||(t[2]=(...t)=>e.toggleForm&&e.toggleForm(...t))},"Quên máºt khẩu?")]),t[10]||(t[10]=Ha("div",{class:"d-flex justify-content-center"},[Ha("button",{id:"login-btn",type:"submit",class:"btn btn-custom btn-gradient-orange"},"ÄÄng nháºp")],-1))],32))])}],["__scopeId","data-v-e4beb3c4"]]);function bB(e){return!!re()&&(le(e),!0)}function _B(){const e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);const i=()=>t(n);return bB(i),{off:i}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}const wB="undefined"!=typeof window&&"undefined"!=typeof document;"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope);const kB=()=>{};function xB(...e){if(1!==e.length)return Ft(...e);const t=e[0];return"function"==typeof t?vt(function(e){return new Lt(e)}(()=>({get:t,set:kB}))):It(t)}const TB=wB?window:void 0,CB=wB?window.document:void 0;function EB(e){const t=function(){const e=It(!1),t=ao();return t&&ei(()=>{e.value=!0},t),e}();return bo(()=>(t.value,Boolean(e())))}const SB={multiple:!0,accept:"*",reset:!1,directory:!1};function IB(e={}){const{document:t=CB}=e,n=It(function(e){if(!e)return null;if(e instanceof FileList)return e;const t=new DataTransfer;for(const n of e)t.items.add(n);return t.files}(e.initialFiles)),{on:i,trigger:a}=_B(),{on:o,trigger:s}=_B();let r;t&&(r=t.createElement("input"),r.type="file",r.onchange=e=>{const t=e.target;n.value=t.files,a(n.value)},r.oncancel=()=>{s()});const l=()=>{n.value=null,r&&r.value&&(r.value="",a(null))};return{files:vt(n),open:t=>{if(!r)return;const n={...SB,...e,...t};var i,a;r.multiple=n.multiple,r.accept=n.accept,r.webkitdirectory=n.directory,i=n,a="capture",Object.prototype.hasOwnProperty.call(i,a)&&(r.capture=n.capture),n.reset&&l(),r.click()},reset:l,onCancel:o,onChange:i}} 3766/** 3767 * @license 3768 * Copyright 2017 Google LLC 3769 * 3770 * Licensed under the Apache License, Version 2.0 (the "License");
3771 * you may not use this file except in compliance with the License. 3772 * You may obtain a copy of the License at 3773 * 3774 * http://www.apache.org/licenses/LICENSE-2.0 3775 * 3776 * Unless required by applicable law or agreed to in writing, software 3777 * distributed under the License is distributed on an "AS IS" BASIS, 3778 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3779 * See the License for the specific language governing permissions and 3780 * limitations under the License. 3781 */ 3782const AB="firebasestorage.googleapis.com",DB="storageBucket"; 3783/** 3784 * @license 3785 * Copyright 2017 Google LLC 3786 * 3787 * Licensed under the Apache License, Version 2.0 (the "License"); 3788 * you may not use this file except in compliance with the License. 3789 * You may obtain a copy of the License at 3790 * 3791 * http://www.apache.org/licenses/LICENSE-2.0 3792 * 3793 * Unless required by applicable law or agreed to in writing, software 3794 * distributed under the License is distributed on an "AS IS" BASIS, 3795 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3796 * See the License for the specific language governing permissions and 3797 * limitations under the License. 3798 */ 3799class PB extends gc{constructor(e,t,n=0){super(LB(e),"Firebase Storage: ".concat(t," (").concat(LB(e),")")),this.status_=n,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,PB.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return LB(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message="".concat(this._baseMessage,"\n").concat(this.customData.serverResponse):this.message=this._baseMessage}}var OB,MB,NB,RB;function LB(e){return"storage/"+e}function VB(){return new PB(OB.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function qB(){return new PB(OB.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function FB(){return new PB(OB.CANCELED,"User canceled the upload/download.")}function BB(){return new PB(OB.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function UB(e){return new PB(OB.INVALID_ARGUMENT,e)}function jB(){return new PB(OB.APP_DELETED,"The Firebase app was deleted.")}function HB(e,t){return new PB(OB.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function zB(e){throw new PB(OB.INTERNAL_ERROR,"Internal error: "+e)} 3800/** 3801 * @license 3802 * Copyright 2017 Google LLC 3803 * 3804 * Licensed under the Apache License, Version 2.0 (the "License"); 3805 * you may not use this file except in compliance with the License. 3806 * You may obtain a copy of the License at 3807 * 3808 * http://www.apache.org/licenses/LICENSE-2.0 3809 * 3810 * Unless required by applicable law or agreed to in writing, software 3811 * distributed under the License is distributed on an "AS IS" BASIS, 3812 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3813 * See the License for the specific language governing permissions and 3814 * limitations under the License. 3815 */(MB=OB||(OB={})).UNKNOWN="unknown",MB.OBJECT_NOT_FOUND="object-not-found",MB.BUCKET_NOT_FOUND="bucket-not-found",MB.PROJECT_NOT_FOUND="project-not-found",MB.QUOTA_EXCEEDED="quota-exceeded",MB.UNAUTHENTICATED="unauthenticated",MB.UNAUTHORIZED="unauthorized",MB.UNAUTHORIZED_APP="unauthorized-app",MB.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",MB.INVALID_CHECKSUM="invalid-checksum",MB.CANCELED="canceled",MB.INVALID_EVENT_NAME="invalid-event-name",MB.INVALID_URL="invalid-url",MB.INVALID_DEFAULT_BUCKET="invalid-default-bucket",MB.NO_DEFAULT_BUCKET="no-default-bucket",MB.CANNOT_SLICE_BLOB="cannot-slice-blob",MB.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",MB.NO_DOWNLOAD_URL="no-download-url",MB.INVALID_ARGUMENT="invalid-argument",MB.INVALID_ARGUMENT_COUNT="invalid-argument-count",MB.APP_DELETED="app-deleted",MB.INVALID_ROOT_OPERATION="invalid-root-operation",MB.INVALID_FORMAT="invalid-format",MB.INTERNAL_ERROR="internal-error",MB.UNSUPPORTED_ENVIRONMENT="unsupported-environment";class WB{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let n;try{n=WB.makeFromUrl(e,t)}catch(ZNe){return new WB(e,"")}if(""===n.path)return n;throw i=e,new PB(OB.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+i+"'.");var i}static makeFromUrl(e,t){let n=null;const i="([A-Za-z0-9.\\-_]+)";const a=new RegExp("^gs://"+i+"(/(.*))?$","i");function o(e){e.path_=decodeURIComponent(e.path)}const s=t.replace(/[.]/g,"\\."),r=[{regex:a,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:new RegExp("^https?://".concat(s,"/").concat("v[A-Za-z0-9_]+","/b/").concat(i,"/o").concat("(/([^?#]*).*)?$"),"i"),indices:{bucket:1,path:3},postModify:o},{regex:new RegExp("^https?://".concat(t===AB?"(?:storage.googleapis.com|storage.cloud.google.com)":t,"/").concat(i,"/").concat("([^?#]*)"),"i"),indices:{bucket:1,path:2},postModify:o}];for(let l=0;l<r.length;l++){const t=r[l],i=t.regex.exec(e);if(i){const e=i[t.indices.bucket];let a=i[t.indices.path];a||(a=""),n=new WB(e,a),t.postModify(n);break}}if(null==n)throw function(e){return new PB(OB.INVALID_URL,"Invalid URL '"+e+"'.")}(e);return n}}class KB{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}} 3816/** 3817 * @license 3818 * Copyright 2017 Google LLC 3819 * 3820 * Licensed under the Apache License, Version 2.0 (the "License");
3821 * you may not use this file except in compliance with the License. 3822 * You may obtain a copy of the License at 3823 * 3824 * http://www.apache.org/licenses/LICENSE-2.0 3825 * 3826 * Unless required by applicable law or agreed to in writing, software 3827 * distributed under the License is distributed on an "AS IS" BASIS, 3828 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3829 * See the License for the specific language governing permissions and 3830 * limitations under the License. 3831 */function GB(e){return"string"==typeof e||e instanceof String}function YB(e){return QB()&&e instanceof Blob}function QB(){return"undefined"!=typeof Blob}function $B(e,t,n,i){if(i<t)throw UB("Invalid value for '".concat(e,"'. Expected ").concat(t," or greater."));if(i>n)throw UB("Invalid value for '".concat(e,"'. Expected ").concat(n," or less."))} 3832/** 3833 * @license 3834 * Copyright 2017 Google LLC 3835 * 3836 * Licensed under the Apache License, Version 2.0 (the "License"); 3837 * you may not use this file except in compliance with the License. 3838 * You may obtain a copy of the License at 3839 * 3840 * http://www.apache.org/licenses/LICENSE-2.0 3841 * 3842 * Unless required by applicable law or agreed to in writing, software 3843 * distributed under the License is distributed on an "AS IS" BASIS, 3844 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3845 * See the License for the specific language governing permissions and 3846 * limitations under the License. 3847 */function XB(e,t,n){let i=t;return null==n&&(i="https://".concat(t)),"".concat(n,"://").concat(i,"/v0").concat(e)}function JB(e){const t=encodeURIComponent;let n="?";for(const i in e)if(e.hasOwnProperty(i)){n=n+(t(i)+"="+t(e[i]))+"&"}return n=n.slice(0,-1),n} 3848/** 3849 * @license 3850 * Copyright 2022 Google LLC 3851 * 3852 * Licensed under the Apache License, Version 2.0 (the "License"); 3853 * you may not use this file except in compliance with the License. 3854 * You may obtain a copy of the License at 3855 * 3856 * http://www.apache.org/licenses/LICENSE-2.0 3857 * 3858 * Unless required by applicable law or agreed to in writing, software 3859 * distributed under the License is distributed on an "AS IS" BASIS, 3860 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3861 * See the License for the specific language governing permissions and 3862 * limitations under the License. 3863 */ 3864function ZB(e,t){const n=e>=500&&e<600,i=-1!==[408,429].indexOf(e),a=-1!==t.indexOf(e);return n||i||a} 3865/** 3866 * @license 3867 * Copyright 2017 Google LLC 3868 * 3869 * Licensed under the Apache License, Version 2.0 (the "License"); 3870 * you may not use this file except in compliance with the License. 3871 * You may obtain a copy of the License at 3872 * 3873 * http://www.apache.org/licenses/LICENSE-2.0 3874 * 3875 * Unless required by applicable law or agreed to in writing, software 3876 * distributed under the License is distributed on an "AS IS" BASIS, 3877 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3878 * See the License for the specific language governing permissions and 3879 * limitations under the License. 3880 */(RB=NB||(NB={}))[RB.NO_ERROR=0]="NO_ERROR",RB[RB.NETWORK_ERROR=1]="NETWORK_ERROR",RB[RB.ABORT=2]="ABORT";class eU{constructor(e,t,n,i,a,o,s,r,l,c,u,h=!0){this.url_=e,this.method_=t,this.headers_=n,this.body_=i,this.successCodes_=a,this.additionalRetryCodes_=o,this.callback_=s,this.errorCallback_=r,this.timeout_=l,this.progressCallback_=c,this.connectionFactory_=u,this.retry=h,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((e,t)=>{this.resolve_=e,this.reject_=t,this.start_()})}start_(){const e=(e,t)=>{if(t)return void e(!1,new tU(!1,null,!0));const n=this.connectionFactory_();this.pendingConnection_=n;const i=e=>{const t=e.loaded,n=e.lengthComputable?e.total:-1;null!==this.progressCallback_&&this.progressCallback_(t,n)};null!==this.progressCallback_&&n.addUploadProgressListener(i),n.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&n.removeUploadProgressListener(i),this.pendingConnection_=null;const t=n.getErrorCode()===NB.NO_ERROR,a=n.getStatus();if(!t||ZB(a,this.additionalRetryCodes_)&&this.retry){const t=n.getErrorCode()===NB.ABORT;return void e(!1,new tU(!1,null,t))}const o=-1!==this.successCodes_.indexOf(a);
3880e(!0,new tU(o,n))})},t=(e,t)=>{const n=this.resolve_,i=this.reject_,a=t.connection;if(t.wasSuccessCode)try{const e=this.callback_(a,a.getResponse());! 3881/** 3882 * @license 3883 * Copyright 2017 Google LLC 3884 * 3885 * Licensed under the Apache License, Version 2.0 (the "License"); 3886 * you may not use this file except in compliance with the License. 3887 * You may obtain a copy of the License at 3888 * 3889 * http://www.apache.org/licenses/LICENSE-2.0 3890 * 3891 * Unless required by applicable law or agreed to in writing, software 3892 * distributed under the License is distributed on an "AS IS" BASIS, 3893 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3894 * See the License for the specific language governing permissions and 3895 * limitations under the License. 3896 */ 3897function(e){return void 0!==e}(e)?n():n(e)}catch(ZNe){i(ZNe)}else if(null!==a){const e=VB();e.serverResponse=a.getErrorText(),this.errorCallback_?i(this.errorCallback_(a,e)):i(e)}else if(t.canceled){i(this.appDelete_?jB():FB())}else{i(qB())}};this.canceled_?t(0,new tU(!1,null,!0)):this.backoffId_=function(e,t,n){let i=1,a=null,o=null,s=!1,r=0;function l(){return 2===r}let c=!1;function u(...e){c||(c=!0,t.apply(null,e))}function h(t){a=setTimeout(()=>{a=null,e(f,l())},t)}function d(){o&&clearTimeout(o)}function f(e,...t){if(c)return void d();if(e)return d(),void u.call(null,e,...t);if(l()||s)return d(),void u.call(null,e,...t);let n;i<64&&(i*=2),1===r?(r=2,n=0):n=1e3*(i+Math.random()),h(n)}let p=!1;function g(e){p||(p=!0,d(),c||(null!==a?(e||(r=2),clearTimeout(a),h(0)):e||(r=1)))}return h(0),o=setTimeout(()=>{s=!0,g(!0)},n),g}(e,t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class tU{constructor(e,t,n){this.wasSuccessCode=e,this.connection=t,this.canceled=!!n}}function nU(...e){const t="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0;if(void 0!==t){const n=new t;for(let t=0;t<e.length;t++)n.append(e[t]);return n.getBlob()}if(QB())return new Blob(e);throw new PB(OB.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")} 3898/** 3899 * @license 3900 * Copyright 2021 Google LLC 3901 * 3902 * Licensed under the Apache License, Version 2.0 (the "License"); 3903 * you may not use this file except in compliance with the License. 3904 * You may obtain a copy of the License at 3905 * 3906 * http://www.apache.org/licenses/LICENSE-2.0 3907 * 3908 * Unless required by applicable law or agreed to in writing, software 3909 * distributed under the License is distributed on an "AS IS" BASIS, 3910 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3911 * See the License for the specific language governing permissions and 3912 * limitations under the License. 3913 */ 3914function iU(e){if("undefined"==typeof atob)throw t="base-64",new PB(OB.UNSUPPORTED_ENVIRONMENT,"".concat(t," is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information."));var t;return atob(e)} 3915/** 3916 * @license 3917 * Copyright 2017 Google LLC 3918 * 3919 * Licensed under the Apache License, Version 2.0 (the "License"); 3920 * you may not use this file except in compliance with the License. 3921 * You may obtain a copy of the License at 3922 * 3923 * http://www.apache.org/licenses/LICENSE-2.0 3924 * 3925 * Unless required by applicable law or agreed to in writing, software 3926 * distributed under the License is distributed on an "AS IS" BASIS, 3927 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3928 * See the License for the specific language governing permissions and 3929 * limitations under the License. 3930 */const aU="raw",oU="base64",sU="base64url",rU="data_url";class lU{constructor(e,t){this.data=e,this.contentType=t||null}}function cU(e,t){switch(e){case aU:return new lU(uU(t));case oU:case sU:return new lU(hU(e,t));case rU:return new lU(function(e){const t=new dU(e);return t.base64?hU(oU,t.rest):function(e){let t;try{t=decodeURIComponent(e)}catch(ZNe){throw HB(rU,"Malformed data URL.")}return uU(t)}(t.rest)}(t),new dU(t).contentType)}throw VB()}function uU(e){const t=[];for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);if(i<=127)t.push(i);else if(i<=2047)t.push(192|i>>6,128|63&i);else if(55296==(64512&i)){if(n<e.length-1&&56320==(64512&e.charCodeAt(n+1))){i=65536|(1023&i)<<10|1023&e.charCodeAt(++n),t.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i)}else t.push(239,191,189)}else 56320==(64512&i)?t.push(239,191,189):t.push(224|i>>12,128|i>>6&63,128|63&i)}return new Uint8Array(t)}function hU(e,t){switch(e){case oU:{const n=-1!==t.indexOf("-"),i=-1!==t.indexOf("_");if(n||i){throw HB(e,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?")}break}case sU:{const n=-1!==t.indexOf("+"),i=-1!==t.indexOf("/");if(n||i){throw HB(e,"Invalid character '"+(n?"+":"/")+"' found: is it base64 encoded?")}t=t.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=iU(t)}
3930catch(ZNe){if(ZNe.message.includes("polyfill"))throw ZNe;throw HB(e,"Invalid character found")}const i=new Uint8Array(n.length);for(let a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return i}class dU{constructor(e){this.base64=!1,this.contentType=null;const t=e.match(/^data:([^,]+)?,/);if(null===t)throw HB(rU,"Must be formatted 'data:[<mediatype>][;base64],<data>");const n=t[1]||null;null!=n&&(this.base64=function(e,t){if(!(e.length>=t.length))return!1;return e.substring(e.length-t.length)===t} 3931/** 3932 * @license 3933 * Copyright 2017 Google LLC 3934 * 3935 * Licensed under the Apache License, Version 2.0 (the "License"); 3936 * you may not use this file except in compliance with the License. 3937 * You may obtain a copy of the License at 3938 * 3939 * http://www.apache.org/licenses/LICENSE-2.0 3940 * 3941 * Unless required by applicable law or agreed to in writing, software 3942 * distributed under the License is distributed on an "AS IS" BASIS, 3943 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3944 * See the License for the specific language governing permissions and 3945 * limitations under the License. 3946 */(n,";base64"),this.contentType=this.base64?n.substring(0,n.length-7):n),this.rest=e.substring(e.indexOf(",")+1)}}class fU{constructor(e,t){let n=0,i="";YB(e)?(this.data_=e,n=e.size,i=e.type):e instanceof ArrayBuffer?(t?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),n=this.data_.length):e instanceof Uint8Array&&(t?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),n=e.length),this.size_=n,this.type_=i}size(){return this.size_}type(){return this.type_}slice(e,t){if(YB(this.data_)){const o=this.data_,s=(i=e,a=t,(n=o).webkitSlice?n.webkitSlice(i,a):n.mozSlice?n.mozSlice(i,a):n.slice?n.slice(i,a):null);return null===s?null:new fU(s)}{const n=new Uint8Array(this.data_.buffer,e,t-e);return new fU(n,!0)}var n,i,a}static getBlob(...e){if(QB()){const t=e.map(e=>e instanceof fU?e.data_:e);return new fU(nU.apply(null,t))}{const t=e.map(e=>GB(e)?cU(aU,e).data:e.data_);let n=0;t.forEach(e=>{n+=e.byteLength});const i=new Uint8Array(n);let a=0;return t.forEach(e=>{for(let t=0;t<e.length;t++)i[a++]=e[t]}),new fU(i,!0)}}uploadData(){return this.data_}} 3947/** 3948 * @license 3949 * Copyright 2017 Google LLC 3950 * 3951 * Licensed under the Apache License, Version 2.0 (the "License"); 3952 * you may not use this file except in compliance with the License. 3953 * You may obtain a copy of the License at 3954 * 3955 * http://www.apache.org/licenses/LICENSE-2.0 3956 * 3957 * Unless required by applicable law or agreed to in writing, software 3958 * distributed under the License is distributed on an "AS IS" BASIS, 3959 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3960 * See the License for the specific language governing permissions and 3961 * limitations under the License. 3962 */function pU(e){let t;try{t=JSON.parse(e)}catch(ZNe){return null}return function(e){return"object"==typeof e&&!Array.isArray(e)}(t)?t:null} 3963/** 3964 * @license 3965 * Copyright 2017 Google LLC 3966 * 3967 * Licensed under the Apache License, Version 2.0 (the "License"); 3968 * you may not use this file except in compliance with the License. 3969 * You may obtain a copy of the License at 3970 * 3971 * http://www.apache.org/licenses/LICENSE-2.0 3972 * 3973 * Unless required by applicable law or agreed to in writing, software 3974 * distributed under the License is distributed on an "AS IS" BASIS, 3975 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3976 * See the License for the specific language governing permissions and 3977 * limitations under the License. 3978 */function gU(e){const t=e.lastIndexOf("/",e.length-2);return-1===t?e:e.slice(t+1)} 3979/** 3980 * @license 3981 * Copyright 2017 Google LLC 3982 * 3983 * Licensed under the Apache License, Version 2.0 (the "License"); 3984 * you may not use this file except in compliance with the License. 3985 * You may obtain a copy of the License at 3986 * 3987 * http://www.apache.org/licenses/LICENSE-2.0 3988 * 3989 * Unless required by applicable law or agreed to in writing, software 3990 * distributed under the License is distributed on an "AS IS" BASIS, 3991 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3992 * See the License for the specific language governing permissions and 3993 * limitations under the License. 3994 */function mU(e,t){return t}class vU{constructor(e,t,n,i){this.server=e,this.local=t||e,this.writable=!!n,this.xform=i||mU}}let yU=null;function bU(){if(yU)return yU;const e=[];e.push(new vU("bucket")),e.push(new vU("generation")),e.push(new vU("metageneration")),e.push(new vU("name","fullPath",!0));const t=new vU("name");t.xform=function(e,t){return function(e){return!GB(e)||e.length<2?e:gU(e)}(t)},e.push(t);const n=new vU("size");return n.xform=function(e,t){return void 0!==t?Number(t):t},e.push(n),e.push(new vU("timeCreated")),e.push(new vU("updated")),e.push(new vU("md5Hash",null,!0)),e.push(new vU("cacheControl",null,!0)),e.push(new vU("contentDisposition",null,!0)),e.push(new vU("contentEncoding",null,!0)),e.push(new vU("contentLanguage",null,!0)),e.push(new vU("contentType",null,!0)),e.push(new vU("metadata","customMetadata",!0)),yU=e,yU}
3994function _U(e,t,n){const i={type:"file"},a=n.length;for(let o=0;o<a;o++){const e=n[o];i[e.local]=e.xform(i,t[e.server])}return function(e,t){Object.defineProperty(e,"ref",{get:function(){const n=e.bucket,i=e.fullPath,a=new WB(n,i);return t._makeStorageReference(a)}})}(i,e),i}function wU(e,t,n){const i=pU(t);if(null===i)return null;return _U(e,i,n)}function kU(e,t){const n={},i=t.length;for(let a=0;a<i;a++){const i=t[a];i.writable&&(n[i.server]=e[i.local])}return JSON.stringify(n)}class xU{constructor(e,t,n,i){this.url=e,this.method=t,this.handler=n,this.timeout=i,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}} 3995/** 3996 * @license 3997 * Copyright 2017 Google LLC 3998 * 3999 * Licensed under the Apache License, Version 2.0 (the "License"); 4000 * you may not use this file except in compliance with the License. 4001 * You may obtain a copy of the License at 4002 * 4003 * http://www.apache.org/licenses/LICENSE-2.0 4004 * 4005 * Unless required by applicable law or agreed to in writing, software 4006 * distributed under the License is distributed on an "AS IS" BASIS, 4007 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4008 * See the License for the specific language governing permissions and 4009 * limitations under the License. 4010 */function TU(e){if(!e)throw VB()}function CU(e,t){return function(n,i){const a=wU(e,i,t);return TU(null!==a),a}}function EU(e,t){return function(n,i){const a=wU(e,i,t);return TU(null!==a),function(e,t,n,i){const a=pU(t);if(null===a)return null;if(!GB(a.downloadTokens))return null;const o=a.downloadTokens;if(0===o.length)return null;const s=encodeURIComponent,r=o.split(",").map(t=>{const a=e.bucket,o=e.fullPath;return XB("/b/"+s(a)+"/o/"+s(o),n,i)+JB({alt:"media",token:t})});return r[0]}(a,i,e.host,e._protocol)}}function SU(e){return function(t,n){let i;var a,o;return 401===t.getStatus()?i=t.getErrorText().includes("Firebase App Check token is invalid")?new PB(OB.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project."):new PB(OB.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again."):402===t.getStatus()?(o=e.bucket,i=new PB(OB.QUOTA_EXCEEDED,"Quota for bucket '"+o+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===t.getStatus()?(a=e.path,i=new PB(OB.UNAUTHORIZED,"User does not have permission to access '"+a+"'.")):i=n,i.status=t.getStatus(),i.serverResponse=n.serverResponse,i}}function IU(e){const t=SU(e);return function(n,i){let a=t(n,i);var o;return 404===n.getStatus()&&(o=e.path,a=new PB(OB.OBJECT_NOT_FOUND,"Object '"+o+"' does not exist.")),a.serverResponse=i.serverResponse,a}}function AU(e,t,n){const i=XB(t.fullServerUrl(),e.host,e._protocol),a=e.maxOperationRetryTime,o=new xU(i,"GET",CU(e,n),a);return o.errorHandler=IU(t),o}function DU(e,t,n){const i=Object.assign({},n);return i.fullPath=e.path,i.size=t.size(),i.contentType||(i.contentType=function(e,t){return e&&e.contentType||t&&t.type()||"application/octet-stream"}(null,t)),i}class PU{constructor(e,t,n,i){this.current=e,this.total=t,this.finalized=!!n,this.metadata=i||null}}function OU(e,t){let n=null;try{n=e.getResponseHeader("X-Goog-Upload-Status")}catch(ZNe){TU(!1)}return TU(!!n&&-1!==(t||["active"]).indexOf(n)),n}const MU=262144;function NU(e,t,n,i,a,o,s,r){const l=new PU(0,0);if(s?(l.current=s.current,l.total=s.total):(l.current=0,l.total=i.size()),i.size()!==l.total)throw new PB(OB.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.");const c=l.total-l.current;let u=c;a>0&&(u=Math.min(u,a));const h=l.current,d=h+u;let f="";f=0===u?"finalize":c===u?"upload, finalize":"upload";const p={"X-Goog-Upload-Command":f,"X-Goog-Upload-Offset":"".concat(l.current)},g=i.slice(h,d);if(null===g)throw BB();const m=t.maxUploadRetryTime,v=new xU(n,"POST",function(e,n){const a=OU(e,["active","final"]),s=l.current+u,r=i.size();let c;
4010return c="final"===a?CU(t,o)(e,n):null,new PU(s,r,"final"===a,c)},m);return v.headers=p,v.body=g.uploadData(),v.progressCallback=r||null,v.errorHandler=SU(e),v}const RU="running",LU="paused",VU="success",qU="canceled",FU="error";function BU(e){switch(e){case"running":case"pausing":case"canceling":return RU;case"paused":return LU;case"success":return VU;case"canceled":return qU;default:return FU}} 4011/** 4012 * @license 4013 * Copyright 2017 Google LLC 4014 * 4015 * Licensed under the Apache License, Version 2.0 (the "License"); 4016 * you may not use this file except in compliance with the License. 4017 * You may obtain a copy of the License at 4018 * 4019 * http://www.apache.org/licenses/LICENSE-2.0 4020 * 4021 * Unless required by applicable law or agreed to in writing, software 4022 * distributed under the License is distributed on an "AS IS" BASIS, 4023 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4024 * See the License for the specific language governing permissions and 4025 * limitations under the License. 4026 */class UU{constructor(e,t,n){const i=function(e){return"function"==typeof e}(e)||null!=t||null!=n;if(i)this.next=e,this.error=null!=t?t:void 0,this.complete=null!=n?n:void 0;else{const t=e;this.next=t.next,this.error=t.error,this.complete=t.complete}}} 4027/** 4028 * @license 4029 * Copyright 2017 Google LLC 4030 * 4031 * Licensed under the Apache License, Version 2.0 (the "License"); 4032 * you may not use this file except in compliance with the License. 4033 * You may obtain a copy of the License at 4034 * 4035 * http://www.apache.org/licenses/LICENSE-2.0 4036 * 4037 * Unless required by applicable law or agreed to in writing, software 4038 * distributed under the License is distributed on an "AS IS" BASIS, 4039 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4040 * See the License for the specific language governing permissions and 4041 * limitations under the License. 4042 */function jU(e){return(...t)=>{Promise.resolve().then(()=>e(...t))}}class HU{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=NB.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=NB.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=NB.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,t,n,i){if(this.sent_)throw zB("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(t,e,!0),void 0!==i)for(const a in i)i.hasOwnProperty(a)&&this.xhr_.setRequestHeader(a,i[a].toString());return void 0!==n?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw zB("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw zB("cannot .getStatus() before sending");try{return this.xhr_.status}catch(ZNe){return-1}}getResponse(){if(!this.sent_)throw zB("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw zB("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",e)}}class zU extends HU{initXhr(){this.xhr_.responseType="text"}}function WU(){return new zU} 4043/** 4044 * @license 4045 * Copyright 2017 Google LLC 4046 * 4047 * Licensed under the Apache License, Version 2.0 (the "License"); 4048 * you may not use this file except in compliance with the License. 4049 * You may obtain a copy of the License at 4050 * 4051 * http://www.apache.org/licenses/LICENSE-2.0 4052 * 4053 * Unless required by applicable law or agreed to in writing, software 4054 * distributed under the License is distributed on an "AS IS" BASIS, 4055 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4056 * See the License for the specific language governing permissions and 4057 * limitations under the License. 4058 */class KU{constructor(e,t,n=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=t,this._metadata=n,this._mappings=bU(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=e=>{if(this._request=void 0,this._chunkMultiplier=1,e._codeEquals(OB.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{const t=this.isExponentialBackoffExpired();if(ZB(e.status,[])){if(!t)return this.sleepTime=Math.max(2*this.sleepTime,1e3),this._needToFetchStatus=!0,void this.completeTransitions_();e=qB()}this._error=e,this._transition("error")}},this._metadataErrorHandler=e=>{this._request=void 0,e._codeEquals(OB.CANCELED)?this.completeTransitions_():(this._error=e,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((e,t)=>
4058{this._resolve=e,this._reject=t,this._start()}),this._promise.then(null,()=>{})}isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}_makeProgressCallback(){const e=this._transferred;return t=>this._updateProgress(e+t)}_shouldDoResumable(e){return e.size()>262144}_start(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(e){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([t,n])=>{switch(this._state){case"running":e(t,n);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused")}})}_createResumable(){this._resolveToken((e,t)=>{const n=function(e,t,n,i,a){const o=t.bucketOnlyServerUrl(),s=DU(t,i,a),r={name:s.fullPath},l=XB(o,e.host,e._protocol),c={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":"".concat(i.size()),"X-Goog-Upload-Header-Content-Type":s.contentType,"Content-Type":"application/json; charset=utf-8"},u=kU(s,n),h=e.maxUploadRetryTime,d=new xU(l,"POST",function(e){let t;OU(e);try{t=e.getResponseHeader("X-Goog-Upload-URL")}catch(ZNe){TU(!1)}return TU(GB(t)),t},h);return d.urlParams=r,d.headers=c,d.body=u,d.errorHandler=SU(t),d}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),i=this._ref.storage._makeRequest(n,WU,e,t);this._request=i,i.getPromise().then(e=>{this._request=void 0,this._uploadUrl=e,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){const e=this._uploadUrl;this._resolveToken((t,n)=>{const i=function(e,t,n,i){const a=e.maxUploadRetryTime,o=new xU(n,"POST",function(e){const t=OU(e,["active","final"]);let n=null;try{n=e.getResponseHeader("X-Goog-Upload-Size-Received")}catch(ZNe){TU(!1)}n||TU(!1);const a=Number(n);return TU(!isNaN(a)),new PU(a,i.size(),"final"===t)},a);return o.headers={"X-Goog-Upload-Command":"query"},o.errorHandler=SU(t),o}(this._ref.storage,this._ref._location,e,this._blob),a=this._ref.storage._makeRequest(i,WU,t,n);this._request=a,a.getPromise().then(e=>{this._request=void 0,this._updateProgress(e.current),this._needToFetchStatus=!1,e.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){const e=MU*this._chunkMultiplier,t=new PU(this._transferred,this._blob.size()),n=this._uploadUrl;this._resolveToken((i,a)=>{let o;try{o=NU(this._ref._location,this._ref.storage,n,this._blob,e,this._mappings,t,this._makeProgressCallback())}catch(ZNe){return this._error=ZNe,void this._transition("error")}const s=this._ref.storage._makeRequest(o,WU,i,a,!1);this._request=s,s.getPromise().then(e=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(e.current),e.finalized?(this._metadata=e.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){2*(MU*this._chunkMultiplier)<33554432&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((e,t)=>{const n=AU(this._ref.storage,this._ref._location,this._mappings),i=this._ref.storage._makeRequest(n,WU,e,t);this._request=i,i.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((e,t)=>{const n=function(e,t,n,i,a){const o=t.bucketOnlyServerUrl(),s={"X-Goog-Upload-Protocol":"multipart"},r=function(){let e="";for(let t=0;t<2;t++)e+=Math.random().toString().slice(2);return e}();s["Content-Type"]="multipart/related; boundary="+r;const l=DU(t,i,a),c="--"+r+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+kU(l,n)+"\r\n--"+r+"\r\nContent-Type: "+l.contentType+"\r\n\r\n",u="\r\n--"+r+"--",h=fU.getBlob(c,i,u);if(null===h)throw BB();const d={name:l.fullPath},f=XB(o,e.host,e._protocol),p=e.maxUploadRetryTime,g=new xU(f,"POST",CU(e,n),p);
4058return g.urlParams=d,g.headers=s,g.body=h.uploadData(),g.errorHandler=SU(t),g}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),i=this._ref.storage._makeRequest(n,WU,e,t);this._request=i,i.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(e){const t=this._transferred;this._transferred=e,this._transferred!==t&&this._notifyObservers()}_transition(e){if(this._state!==e)switch(e){case"canceling":case"pausing":this._state=e,void 0!==this._request?this._request.cancel():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":const t="paused"===this._state;this._state=e,t&&(this._notifyObservers(),this._start());break;case"paused":case"error":case"success":this._state=e,this._notifyObservers();break;case"canceled":this._error=FB(),this._state=e,this._notifyObservers()}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}}get snapshot(){const e=BU(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}}on(e,t,n,i){const a=new UU(t||void 0,n||void 0,i||void 0);return this._addObserver(a),()=>{this._removeObserver(a)}}then(e,t){return this._promise.then(e,t)}catch(e){return this.then(null,e)}_addObserver(e){this._observers.push(e),this._notifyObserver(e)}_removeObserver(e){const t=this._observers.indexOf(e);-1!==t&&this._observers.splice(t,1)}_notifyObservers(){this._finishPromise();this._observers.slice().forEach(e=>{this._notifyObserver(e)})}_finishPromise(){if(void 0!==this._resolve){let e=!0;switch(BU(this._state)){case VU:jU(this._resolve.bind(null,this.snapshot))();break;case qU:case FU:jU(this._reject.bind(null,this._error))();break;default:e=!1}e&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(e){switch(BU(this._state)){case RU:case LU:e.next&&jU(e.next.bind(e,this.snapshot))();break;case VU:e.complete&&jU(e.complete.bind(e))();break;default:e.error&&jU(e.error.bind(e,this._error))()}}resume(){const e="paused"===this._state||"pausing"===this._state;return e&&this._transition("running"),e}pause(){const e="running"===this._state;return e&&this._transition("pausing"),e}cancel(){const e="running"===this._state||"pausing"===this._state;return e&&this._transition("canceling"),e}} 4059/** 4060 * @license 4061 * Copyright 2019 Google LLC 4062 * 4063 * Licensed under the Apache License, Version 2.0 (the "License"); 4064 * you may not use this file except in compliance with the License. 4065 * You may obtain a copy of the License at 4066 * 4067 * http://www.apache.org/licenses/LICENSE-2.0 4068 * 4069 * Unless required by applicable law or agreed to in writing, software 4070 * distributed under the License is distributed on an "AS IS" BASIS, 4071 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4072 * See the License for the specific language governing permissions and 4073 * limitations under the License. 4074 */class GU{constructor(e,t){this._service=e,this._location=t instanceof WB?t:WB.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new GU(e,t)}get root(){const e=new WB(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return gU(this._location.path)}get storage(){return this._service}get parent(){const e=function(e){if(0===e.length)return null;const t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}(this._location.path);if(null===e)return null;const t=new WB(this._location.bucket,e);return new GU(this._service,t)}_throwIfRoot(e){if(""===this._location.path)throw function(e){return new PB(OB.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}(e)}}function YU(e,t){e._throwIfRoot("updateMetadata");const n=function(e,t,n,i){const a=XB(t.fullServerUrl(),e.host,e._protocol),o=kU(n,i),s=e.maxOperationRetryTime,r=new xU(a,"PATCH",CU(e,i),s);return r.headers={"Content-Type":"application/json; charset=utf-8"},r.body=o,r.errorHandler=IU(t),r}(e.storage,e._location,t,bU());return e.storage.makeRequestWithTokens(n,WU)}function QU(e){e._throwIfRoot("getDownloadURL");const t=function(e,t,n){const i=XB(t.fullServerUrl(),e.host,e._protocol),a=e.maxOperationRetryTime,o=new xU(i,"GET",EU(e,n),a);return o.errorHandler=IU(t),o}
4074(e.storage,e._location,bU());return e.storage.makeRequestWithTokens(t,WU).then(e=>{if(null===e)throw new PB(OB.NO_DOWNLOAD_URL,"The given file does not have any download URLs.");return e})}function $U(e,t){if(e instanceof ZU){const n=e;if(null==n._bucket)throw new PB(OB.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+DB+"' property when initializing the app?");const i=new GU(n,n._bucket);return null!=t?$U(i,t):i}return void 0!==t?function(e,t){const n=function(e,t){const n=t.split("/").filter(e=>e.length>0).join("/");return 0===e.length?n:e+"/"+n}(e._location.path,t),i=new WB(e._location.bucket,n);return new GU(e.storage,i)} 4075/** 4076 * @license 4077 * Copyright 2017 Google LLC 4078 * 4079 * Licensed under the Apache License, Version 2.0 (the "License"); 4080 * you may not use this file except in compliance with the License. 4081 * You may obtain a copy of the License at 4082 * 4083 * http://www.apache.org/licenses/LICENSE-2.0 4084 * 4085 * Unless required by applicable law or agreed to in writing, software 4086 * distributed under the License is distributed on an "AS IS" BASIS, 4087 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4088 * See the License for the specific language governing permissions and 4089 * limitations under the License. 4090 */(e,t):e}function XU(e,t){if(t&&/^[A-Za-z]+:\/\//.test(t)){if(e instanceof ZU)return new GU(e,t);throw UB("To use ref(service, url), the first argument must be a Storage instance.")}return $U(e,t)}function JU(e,t){const n=null==t?void 0:t[DB];return null==n?null:WB.makeFromBucketSpec(n,e)}class ZU{constructor(e,t,n,i,a){this.app=e,this._authProvider=t,this._appCheckProvider=n,this._url=i,this._firebaseVersion=a,this._bucket=null,this._host=AB,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=i?WB.makeFromBucketSpec(i,this._host):JU(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,null!=this._url?this._bucket=WB.makeFromBucketSpec(this._url,e):this._bucket=JU(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){$B("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){$B("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const t=await e.getToken();if(null!==t)return t.accessToken}return null}async _getAppCheckToken(){const e=this._appCheckProvider.getImmediate({optional:!0});if(e){return(await e.getToken()).token}return null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new GU(this,e)}_makeRequest(e,t,n,i,a=!0){if(this._deleted)return new KB(jB());{const o=function(e,t,n,i,a,o,s=!0){const r=JB(e.urlParams),l=e.url+r,c=Object.assign({},e.headers);return function(e,t){t&&(e["X-Firebase-GMPID"]=t)}(c,t),function(e,t){null!==t&&t.length>0&&(e.Authorization="Firebase "+t)}(c,n),function(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(null!=t?t:"AppManager")}(c,o),function(e,t){null!==t&&(e["X-Firebase-AppCheck"]=t)}(c,i),new eU(l,e.method,c,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,a,s)} 4091/** 4092 * @license 4093 * Copyright 2017 Google LLC 4094 * 4095 * Licensed under the Apache License, Version 2.0 (the "License"); 4096 * you may not use this file except in compliance with the License. 4097 * You may obtain a copy of the License at 4098 * 4099 * http://www.apache.org/licenses/LICENSE-2.0 4100 * 4101 * Unless required by applicable law or agreed to in writing, software 4102 * distributed under the License is distributed on an "AS IS" BASIS, 4103 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4104 * See the License for the specific language governing permissions and 4105 * limitations under the License. 4106 */(e,this._appId,n,i,t,this._firebaseVersion,a);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(e,t){const[n,i]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);
4106return this._makeRequest(e,t,n,i).getPromise()}}const ej="@firebase/storage",tj="0.13.2",nj="storage";function ij(e,t,n){return function(e,t,n){return e._throwIfRoot("uploadBytesResumable"),new KU(e,new fU(t),n)}(e=Rc(e),t,n)}function aj(e){return function(e){e._throwIfRoot("getMetadata");const t=AU(e.storage,e._location,bU());return e.storage.makeRequestWithTokens(t,WU)}(e=Rc(e))}function oj(e,t){return XU(e=Rc(e),t)}function sj(e=eh(),t){const n=Yu(e=Rc(e),nj).getImmediate({identifier:t}),i=tc("storage");return i&&function(e,t,n,i={}){!function(e,t,n,i={}){e.host="".concat(t,":").concat(n),e._protocol="http";const{mockUserToken:a}=i;a&&(e._overrideAuthToken="string"==typeof a?a:oc(a,e.app.options.projectId))}(e,t,n,i)}(n,...i),n}function rj(e,{instanceIdentifier:t}){const n=e.getProvider("app").getImmediate(),i=e.getProvider("auth-internal"),a=e.getProvider("app-check-internal");return new ZU(n,i,a,t,Ju)}Gu(new Lc(nj,rj,"PUBLIC").setMultipleInstances(!0)),th(ej,tj,""),th(ej,tj,"esm2017"); 4107/** 4108 * @license 4109 * Copyright 2020 Google LLC 4110 * 4111 * Licensed under the Apache License, Version 2.0 (the "License"); 4112 * you may not use this file except in compliance with the License. 4113 * You may obtain a copy of the License at 4114 * 4115 * http://www.apache.org/licenses/LICENSE-2.0 4116 * 4117 * Unless required by applicable law or agreed to in writing, software 4118 * distributed under the License is distributed on an "AS IS" BASIS, 4119 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4120 * See the License for the specific language governing permissions and 4121 * limitations under the License. 4122 */ 4123const lj=new Map,cj={activated:!1,tokenObservers:[]};function uj(e){return lj.get(e)||Object.assign({},cj)}const hj=3e4,dj=96e4; 4124/** 4125 * @license 4126 * Copyright 2020 Google LLC 4127 * 4128 * Licensed under the Apache License, Version 2.0 (the "License"); 4129 * you may not use this file except in compliance with the License. 4130 * You may obtain a copy of the License at 4131 * 4132 * http://www.apache.org/licenses/LICENSE-2.0 4133 * 4134 * Unless required by applicable law or agreed to in writing, software 4135 * distributed under the License is distributed on an "AS IS" BASIS, 4136 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4137 * See the License for the specific language governing permissions and 4138 * limitations under the License. 4139 */class fj{constructor(e,t,n,i,a){if(this.operation=e,this.retryPolicy=t,this.getWaitDuration=n,this.lowerBound=i,this.upperBound=a,this.pending=null,this.nextErrorWaitInterval=i,i>a)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}async process(e){this.stop();try{this.pending=new ac,this.pending.promise.catch(e=>{}),await(t=this.getNextRun(e),new Promise(e=>{setTimeout(e,t)})),this.pending.resolve(),await this.pending.promise,this.pending=new ac,this.pending.promise.catch(e=>{}),await this.operation(),this.pending.resolve(),await this.pending.promise,this.process(!0).catch(()=>{})}catch(eRe){this.retryPolicy(eRe)?this.process(!1).catch(()=>{}):this.stop()}var t; 4140/** 4141 * @license 4142 * Copyright 2020 Google LLC 4143 * 4144 * Licensed under the Apache License, Version 2.0 (the "License"); 4145 * you may not use this file except in compliance with the License. 4146 * You may obtain a copy of the License at 4147 * 4148 * http://www.apache.org/licenses/LICENSE-2.0 4149 * 4150 * Unless required by applicable law or agreed to in writing, software 4151 * distributed under the License is distributed on an "AS IS" BASIS, 4152 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4153 * See the License for the specific language governing permissions and 4154 * limitations under the License. 4155 */}getNextRun(e){if(e)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{const e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}}const pj=new mc("appCheck","AppCheck",{"already-initialized":"You have already called
4155initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"});function gj(e){if(!uj(e).activated)throw pj.create("use-before-activation",{appName:e.name})} 4156/** 4157 * @license 4158 * Copyright 2020 Google LLC 4159 * 4160 * Licensed under the Apache License, Version 2.0 (the "License"); 4161 * you may not use this file except in compliance with the License. 4162 * You may obtain a copy of the License at 4163 * 4164 * http://www.apache.org/licenses/LICENSE-2.0 4165 * 4166 * Unless required by applicable law or agreed to in writing, software 4167 * distributed under the License is distributed on an "AS IS" BASIS, 4168 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4169 * See the License for the specific language governing permissions and 4170 * limitations under the License. 4171 */const mj="firebase-app-check-store";let vj=null;function yj(e,t){return async function(e,t){const n=(await(vj||(vj=new Promise((e,t)=>{try{const n=indexedDB.open("firebase-app-check-database",1);n.onsuccess=t=>{e(t.target.result)},n.onerror=e=>{var n;t(pj.create("storage-open",{originalErrorMessage:null===(n=e.target.error)||void 0===n?void 0:n.message}))},n.onupgradeneeded=e=>{const t=e.target.result;0===e.oldVersion&&t.createObjectStore(mj,{keyPath:"compositeKey"})}}catch(ZNe){t(pj.create("storage-open",{originalErrorMessage:null==ZNe?void 0:ZNe.message}))}}),vj))).transaction(mj,"readwrite"),i=n.objectStore(mj).put({compositeKey:e,value:t});return new Promise((e,t)=>{i.onsuccess=t=>{e()},n.onerror=e=>{var n;t(pj.create("storage-set",{originalErrorMessage:null===(n=e.target.error)||void 0===n?void 0:n.message}))}})}(function(e){return"".concat(e.options.appId,"-").concat(e.name)} 4172/** 4173 * @license 4174 * Copyright 2020 Google LLC 4175 * 4176 * Licensed under the Apache License, Version 2.0 (the "License"); 4177 * you may not use this file except in compliance with the License. 4178 * You may obtain a copy of the License at 4179 * 4180 * http://www.apache.org/licenses/LICENSE-2.0 4181 * 4182 * Unless required by applicable law or agreed to in writing, software 4183 * distributed under the License is distributed on an "AS IS" BASIS, 4184 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4185 * See the License for the specific language governing permissions and 4186 * limitations under the License. 4187 */(e),t)}const bj=new Kc("@firebase/app-check");function _j(e,t){return dc()?yj(e,t).catch(e=>{bj.warn("Failed to write token to IndexedDB. Error: ".concat(e))}):Promise.resolve()} 4188/** 4189 * @license 4190 * Copyright 2020 Google LLC 4191 * 4192 * Licensed under the Apache License, Version 2.0 (the "License"); 4193 * you may not use this file except in compliance with the License. 4194 * You may obtain a copy of the License at 4195 * 4196 * http://www.apache.org/licenses/LICENSE-2.0 4197 * 4198 * Unless required by applicable law or agreed to in writing, software 4199 * distributed under the License is distributed on an "AS IS" BASIS, 4200 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4201 * See the License for the specific language governing permissions and 4202 * limitations under the License. 4203 */const wj={error:"UNKNOWN_ERROR"};async function kj(e,t=!1){const n=e.app;gj(n);
4203const i=uj(n);let a,o=i.token;if(o&&!Cj(o)&&(i.token=void 0,o=void 0),!o){const e=await i.cachedTokenPromise;e&&(Cj(e)?o=e:await _j(n,void 0))}if(!t&&o&&Cj(o))return{token:o.token};let s,r=!1;try{i.exchangeTokenPromise||(i.exchangeTokenPromise=i.provider.getToken().finally(()=>{i.exchangeTokenPromise=void 0}),r=!0),o=await uj(n).exchangeTokenPromise}catch(ZNe){ZNe.code==="appCheck/".concat("throttled")?bj.warn(ZNe.message):bj.error(ZNe),a=ZNe}return o?a?s=Cj(o)?{token:o.token,internalError:a}:Ej(a):(s={token:o.token},i.token=o,await _j(n,o)):s=Ej(a),r&&function(e,t){const n=uj(e).tokenObservers;for(const i of n)try{"EXTERNAL"===i.type&&null!=t.error?i.error(t.error):i.next(t)}catch(ZNe){}}(n,s),s}function xj(e,t){const n=uj(e),i=n.tokenObservers.filter(e=>e.next!==t);0===i.length&&n.tokenRefresher&&n.tokenRefresher.isRunning()&&n.tokenRefresher.stop(),n.tokenObservers=i}function Tj(e){const{app:t}=e,n=uj(t);let i=n.tokenRefresher;i||(i=function(e){const{app:t}=e;return new fj(async()=>{let n;if(n=uj(t).token?await kj(e,!0):await kj(e),n.error)throw n.error;if(n.internalError)throw n.internalError},()=>!0,()=>{const e=uj(t);if(e.token){let t=e.token.issuedAtTimeMillis+.5*(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)+3e5;const n=e.token.expireTimeMillis-3e5;return t=Math.min(t,n),Math.max(0,t-Date.now())}return 0},hj,dj)}(e),n.tokenRefresher=i),!i.isRunning()&&n.isTokenAutoRefreshEnabled&&i.start()}function Cj(e){return e.expireTimeMillis-Date.now()>0}function Ej(e){return{token:(t=wj,zl.encodeString(JSON.stringify(t),!1)),error:e};var t} 4204/** 4205 * @license 4206 * Copyright 2020 Google LLC 4207 * 4208 * Licensed under the Apache License, Version 2.0 (the "License"); 4209 * you may not use this file except in compliance with the License. 4210 * You may obtain a copy of the License at 4211 * 4212 * http://www.apache.org/licenses/LICENSE-2.0 4213 * 4214 * Unless required by applicable law or agreed to in writing, software 4215 * distributed under the License is distributed on an "AS IS" BASIS, 4216 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4217 * See the License for the specific language governing permissions and 4218 * limitations under the License. 4219 */class Sj{constructor(e,t){this.app=e,this.heartbeatServiceProvider=t}_delete(){const{tokenObservers:e}=uj(this.app);for(const t of e)xj(this.app,t.next);return Promise.resolve()}}function Ij(e){return{getToken:t=>kj(e,t),getLimitedUseToken:()=>async function(e){const t=e.app;gj(t);const{provider:n}=uj(t);{const{token:e}=await n.getToken();return{token:e}}}(e),addTokenListener:t=>function(e,t,n,i){const{app:a}=e,o=uj(a),s={next:n,error:i,type:t};if(o.tokenObservers=[...o.tokenObservers,s],o.token&&Cj(o.token)){const t=o.token;Promise.resolve().then(()=>{n({token:t.token}),Tj(e)}).catch(()=>{})}o.cachedTokenPromise.then(()=>Tj(e))}(e,"INTERNAL",t),removeTokenListener:t=>xj(e.app,t)}}const Aj="app-check-internal";Gu(new Lc("app-check",e=>function(e,t){return new Sj(e,t)}(e.getProvider("app").getImmediate(),e.getProvider("heartbeat")),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider(Aj).initialize()})),Gu(new Lc(Aj,e=>Ij(e.getProvider("app-check").getImmediate()),"PUBLIC").setInstantiationMode("EXPLICIT")),th("@firebase/app-check","0.8.8");const Dj=Symbol("firebaseApp");function Pj(e){return ao()&&Hi(Dj,null)||eh(e)}const Oj=()=>{};function Mj(e){return!!e&&"object"==typeof e}function Nj(e){return Mj(t=e)&&"document"===t.type||function(e){return Mj(e)&&"collection"===e.type}(e);var t}var Rj={};const Lj="@firebase/database",Vj="1.0.8"; 4220/** 4221 * @license 4222 * Copyright 2019 Google LLC 4223 * 4224 * Licensed under the Apache License, Version 2.0 (the "License"); 4225 * you may not use this file except in compliance with the License. 4226 * You may obtain a copy of the License at 4227 * 4228 * http://www.apache.org/licenses/LICENSE-2.0 4229 * 4230 * Unless required by applicable law or agreed to in writing, software 4231 * distributed under the License is distributed on an "AS IS" BASIS, 4232 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4233 * See the License for the specific language governing permissions and 4234 * limitations under the License. 4235 */ 4236let qj=""; 4237/** 4238 * @license 4239 * Copyright 2017 Google LLC 4240 * 4241 * Licensed under the Apache License, Version 2.0 (the "License");
4242 * you may not use this file except in compliance with the License. 4243 * You may obtain a copy of the License at 4244 * 4245 * http://www.apache.org/licenses/LICENSE-2.0 4246 * 4247 * Unless required by applicable law or agreed to in writing, software 4248 * distributed under the License is distributed on an "AS IS" BASIS, 4249 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4250 * See the License for the specific language governing permissions and 4251 * limitations under the License. 4252 */ 4253class Fj{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,t){null==t?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),bc(t))}get(e){const t=this.domStorage_.getItem(this.prefixedName_(e));return null==t?null:yc(t)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}} 4254/** 4255 * @license 4256 * Copyright 2017 Google LLC 4257 * 4258 * Licensed under the Apache License, Version 2.0 (the "License"); 4259 * you may not use this file except in compliance with the License. 4260 * You may obtain a copy of the License at 4261 * 4262 * http://www.apache.org/licenses/LICENSE-2.0 4263 * 4264 * Unless required by applicable law or agreed to in writing, software 4265 * distributed under the License is distributed on an "AS IS" BASIS, 4266 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4267 * See the License for the specific language governing permissions and 4268 * limitations under the License. 4269 */class Bj{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,t){null==t?delete this.cache_[e]:this.cache_[e]=t}get(e){return wc(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}} 4270/** 4271 * @license 4272 * Copyright 2017 Google LLC 4273 * 4274 * Licensed under the Apache License, Version 2.0 (the "License"); 4275 * you may not use this file except in compliance with the License. 4276 * You may obtain a copy of the License at 4277 * 4278 * http://www.apache.org/licenses/LICENSE-2.0 4279 * 4280 * Unless required by applicable law or agreed to in writing, software 4281 * distributed under the License is distributed on an "AS IS" BASIS, 4282 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4283 * See the License for the specific language governing permissions and 4284 * limitations under the License. 4285 */const Uj=function(e){try{if("undefined"!=typeof window&&void 0!==window[e]){const t=window[e];return t.setItem("firebase:sentinel","cache"),t.removeItem("firebase:sentinel"),new Fj(t)}}catch(ZNe){}return new Bj},jj=Uj("localStorage"),Hj=Uj("sessionStorage"),zj=new Kc("@firebase/database"),Wj=function(){let e=1;return function(){return e++}}(),Kj=function(e){const t=function(e){const t=[];let n=0;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);if(a>=55296&&a<=56319){const t=a-55296;i++,Ul(i<e.length,"Surrogate pair missing trail surrogate."),a=65536+(t<<10)+(e.charCodeAt(i)-56320)}a<128?t[n++]=a:a<2048?(t[n++]=a>>6|192,t[n++]=63&a|128):a<65536?(t[n++]=a>>12|224,t[n++]=a>>6&63|128,t[n++]=63&a|128):(t[n++]=a>>18|240,t[n++]=a>>12&63|128,t[n++]=a>>6&63|128,t[n++]=63&a|128)}return t}(e),n=new Dc;n.update(t);const i=n.digest();return zl.encodeByteArray(i)},Gj=function(...e){let t="";for(let n=0;n<e.length;n++){const i=e[n];Array.isArray(i)||i&&"object"==typeof i&&"number"==typeof i.length?t+=Gj.apply(null,i):t+="object"==typeof i?bc(i):i,t+=" "}return t};let Yj=null,Qj=!0;const $j=function(...e){var t;if(!0===Qj&&(Qj=!1,null===Yj&&!0===Hj.get("logging_enabled")&&(Ul(!t,"Can't turn on custom loggers persistently."),zj.logLevel=Bc.VERBOSE,Yj=zj.log.bind(zj))),Yj){const t=Gj.apply(null,e);Yj(t)}},Xj=function(e){return function(...t){$j(e,...t)}},Jj=function(...e){const t="FIREBASE INTERNAL ERROR: "+Gj(...e);zj.error(t)},Zj=function(...e){const t="FIREBASE FATAL ERROR: ".concat(Gj(...e));throw zj.error(t),new Error(t)},eH=function(...e){const t="FIREBASE WARNING: "+Gj(...e);zj.warn(t)},tH=function(e){return"number"==typeof e&&(e!=e||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY)},nH="[MIN_NAME]",iH="[MAX_NAME]",aH=function(e,t){if(e===t)return 0;if(e===nH||t===iH)return-1;if(t===nH||e===iH)return 1;{const n=dH(e),i=dH(t);return null!==n?null!==i?n-i===0?e.length-t.length:n-i:-1:null!==i?1:e<t?-1:1}},oH=function(e,t){return e===t?0:e<t?-1:1},sH=function(e,t){if(t&&e in t)return t[e];throw new Error("Missing required key ("+e+") in object: "+bc(t))},rH=function(e){if("object"!=typeof e||null===e)return bc(e);const t=[];for(const i in e)t.push(i);
4285t.sort();let n="{";for(let i=0;i<t.length;i++)0!==i&&(n+=","),n+=bc(t[i]),n+=":",n+=rH(e[t[i]]);return n+="}",n},lH=function(e,t){const n=e.length;if(n<=t)return[e];const i=[];for(let a=0;a<n;a+=t)a+t>n?i.push(e.substring(a,n)):i.push(e.substring(a,a+t));return i};function cH(e,t){for(const n in e)e.hasOwnProperty(n)&&t(n,e[n])}const uH=function(e){Ul(!tH(e),"Invalid JSON number");const t=1023;let n,i,a,o,s;0===e?(i=0,a=0,n=1/e==-1/0?1:0):(n=e<0,(e=Math.abs(e))>=Math.pow(2,-1022)?(o=Math.min(Math.floor(Math.log(e)/Math.LN2),t),i=o+t,a=Math.round(e*Math.pow(2,52-o)-Math.pow(2,52))):(i=0,a=Math.round(e/Math.pow(2,-1074))));const r=[];for(s=52;s;s-=1)r.push(a%2?1:0),a=Math.floor(a/2);for(s=11;s;s-=1)r.push(i%2?1:0),i=Math.floor(i/2);r.push(n?1:0),r.reverse();const l=r.join("");let c="";for(s=0;s<64;s+=8){let e=parseInt(l.substr(s,8),2).toString(16);1===e.length&&(e="0"+e),c+=e}return c.toLowerCase()},hH=new RegExp("^-?(0*)\\d{1,10}$"),dH=function(e){if(hH.test(e)){const t=Number(e);if(t>=-2147483648&&t<=2147483647)return t}return null},fH=function(e){try{e()}catch(ZNe){setTimeout(()=>{const t=ZNe.stack||"";throw eH("Exception was thrown by user callback.",t),ZNe},Math.floor(0))}},pH=function(e,t){const n=setTimeout(e,t);return"number"==typeof n&&"undefined"!=typeof Deno&&Deno.unrefTimer?Deno.unrefTimer(n):"object"==typeof n&&n.unref&&n.unref(),n}; 4286/** 4287 * @license 4288 * Copyright 2021 Google LLC 4289 * 4290 * Licensed under the Apache License, Version 2.0 (the "License"); 4291 * you may not use this file except in compliance with the License. 4292 * You may obtain a copy of the License at 4293 * 4294 * http://www.apache.org/licenses/LICENSE-2.0 4295 * 4296 * Unless required by applicable law or agreed to in writing, software 4297 * distributed under the License is distributed on an "AS IS" BASIS, 4298 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4299 * See the License for the specific language governing permissions and 4300 * limitations under the License. 4301 */ 4302class gH{constructor(e,t){this.appName_=e,this.appCheckProvider=t,this.appCheck=null==t?void 0:t.getImmediate({optional:!0}),this.appCheck||null==t||t.get().then(e=>this.appCheck=e)}getToken(e){return this.appCheck?this.appCheck.getToken(e):new Promise((t,n)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(t,n):t(null)},0)})}addTokenChangeListener(e){var t;null===(t=this.appCheckProvider)||void 0===t||t.get().then(t=>t.addTokenListener(e))}notifyForInvalidToken(){eH('Provided AppCheck credentials for the app named "'.concat(this.appName_,'" are invalid. This usually indicates your app was not initialized correctly.'))}} 4303/** 4304 * @license 4305 * Copyright 2017 Google LLC 4306 * 4307 * Licensed under the Apache License, Version 2.0 (the "License"); 4308 * you may not use this file except in compliance with the License. 4309 * You may obtain a copy of the License at 4310 * 4311 * http://www.apache.org/licenses/LICENSE-2.0 4312 * 4313 * Unless required by applicable law or agreed to in writing, software 4314 * distributed under the License is distributed on an "AS IS" BASIS, 4315 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4316 * See the License for the specific language governing permissions and 4317 * limitations under the License. 4318 */class mH{constructor(e,t,n){this.appName_=e,this.firebaseOptions_=t,this.authProvider_=n,this.auth_=null,this.auth_=n.getImmediate({optional:!0}),this.auth_||n.onInit(e=>this.auth_=e)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(e=>e&&"auth/token-not-initialized"===e.code?($j("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(e)):new Promise((t,n)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(t,n):t(null)},0)})}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(t=>t.addAuthTokenListener(e))}removeTokenChangeListener(e){this.authProvider_.get().then(t=>t.removeAuthTokenListener(e))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',eH(e)}} 4319/** 4320 * @license 4321 * Copyright 2017 Google LLC 4322 * 4323 * Licensed under the Apache License, Version 2.0 (the "License");
4324 * you may not use this file except in compliance with the License. 4325 * You may obtain a copy of the License at 4326 * 4327 * http://www.apache.org/licenses/LICENSE-2.0 4328 * 4329 * Unless required by applicable law or agreed to in writing, software 4330 * distributed under the License is distributed on an "AS IS" BASIS, 4331 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4332 * See the License for the specific language governing permissions and 4333 * limitations under the License. 4334 */const vH=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,yH="ac",bH="websocket",_H="long_polling"; 4335/** 4336 * @license 4337 * Copyright 2017 Google LLC 4338 * 4339 * Licensed under the Apache License, Version 2.0 (the "License"); 4340 * you may not use this file except in compliance with the License. 4341 * You may obtain a copy of the License at 4342 * 4343 * http://www.apache.org/licenses/LICENSE-2.0 4344 * 4345 * Unless required by applicable law or agreed to in writing, software 4346 * distributed under the License is distributed on an "AS IS" BASIS, 4347 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4348 * See the License for the specific language governing permissions and 4349 * limitations under the License. 4350 */ 4351class wH{constructor(e,t,n,i,a=!1,o="",s=!1,r=!1){this.secure=t,this.namespace=n,this.webSocketOnly=i,this.nodeAdmin=a,this.persistenceKey=o,this.includeNamespaceInQueryParams=s,this.isUsingEmulator=r,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=jj.get("host:"+e)||this._host}isCacheableHost(){return"s-"===this.internalHost.substr(0,2)}isCustomHost(){return"firebaseio.com"!==this._domain&&"firebaseio-demo.com"!==this._domain}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&jj.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){const e=this.secure?"https://":"http://",t=this.includeNamespaceInQueryParams?"?ns=".concat(this.namespace):"";return"".concat(e).concat(this.host,"/").concat(t)}}function kH(e,t,n){let i;if(Ul("string"==typeof t,"typeof type must == string"),Ul("object"==typeof n,"typeof params must == object"),t===bH)i=(e.secure?"wss://":"ws://")+e.internalHost+"/.ws?";else{if(t!==_H)throw new Error("Unknown connection type: "+t);i=(e.secure?"https://":"http://")+e.internalHost+"/.lp?"}(function(e){return e.host!==e.internalHost||e.isCustomHost()||e.includeNamespaceInQueryParams})(e)&&(n.ns=e.namespace);const a=[];return cH(n,(e,t)=>{a.push(e+"="+t)}),i+a.join("&")} 4352/** 4353 * @license 4354 * Copyright 2017 Google LLC 4355 * 4356 * Licensed under the Apache License, Version 2.0 (the "License"); 4357 * you may not use this file except in compliance with the License. 4358 * You may obtain a copy of the License at 4359 * 4360 * http://www.apache.org/licenses/LICENSE-2.0 4361 * 4362 * Unless required by applicable law or agreed to in writing, software 4363 * distributed under the License is distributed on an "AS IS" BASIS, 4364 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4365 * See the License for the specific language governing permissions and 4366 * limitations under the License. 4367 */class xH{constructor(){this.counters_={}}incrementCounter(e,t=1){wc(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t}get(){return Ql(this.counters_)}} 4368/** 4369 * @license 4370 * Copyright 2017 Google LLC 4371 * 4372 * Licensed under the Apache License, Version 2.0 (the "License"); 4373 * you may not use this file except in compliance with the License. 4374 * You may obtain a copy of the License at 4375 * 4376 * http://www.apache.org/licenses/LICENSE-2.0 4377 * 4378 * Unless required by applicable law or agreed to in writing, software 4379 * distributed under the License is distributed on an "AS IS" BASIS, 4380 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4381 * See the License for the specific language governing permissions and 4382 * limitations under the License. 4383 */const TH={},CH={};function EH(e){const t=e.toString();return TH[t]||(TH[t]=new xH),TH[t]} 4384/** 4385 * @license 4386 * Copyright 2017 Google LLC 4387 * 4388 * Licensed under the Apache License, Version 2.0 (the "License");
4389 * you may not use this file except in compliance with the License. 4390 * You may obtain a copy of the License at 4391 * 4392 * http://www.apache.org/licenses/LICENSE-2.0 4393 * 4394 * Unless required by applicable law or agreed to in writing, software 4395 * distributed under the License is distributed on an "AS IS" BASIS, 4396 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4397 * See the License for the specific language governing permissions and 4398 * limitations under the License. 4399 */ 4400class SH{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)}handleResponse(e,t){for(this.pendingResponses[e]=t;this.pendingResponses[this.currentResponseNum];){const e=this.pendingResponses[this.currentResponseNum];delete this.pendingResponses[this.currentResponseNum];for(let t=0;t<e.length;++t)e[t]&&fH(()=>{this.onMessage_(e[t])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}} 4401/** 4402 * @license 4403 * Copyright 2017 Google LLC 4404 * 4405 * Licensed under the Apache License, Version 2.0 (the "License"); 4406 * you may not use this file except in compliance with the License. 4407 * You may obtain a copy of the License at 4408 * 4409 * http://www.apache.org/licenses/LICENSE-2.0 4410 * 4411 * Unless required by applicable law or agreed to in writing, software 4412 * distributed under the License is distributed on an "AS IS" BASIS, 4413 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4414 * See the License for the specific language governing permissions and 4415 * limitations under the License. 4416 */const IH="start";class AH{constructor(e,t,n,i,a,o,s){this.connId=e,this.repoInfo=t,this.applicationId=n,this.appCheckToken=i,this.authToken=a,this.transportSessionId=o,this.lastSessionId=s,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=Xj(e),this.stats_=EH(t),this.urlFn=e=>(this.appCheckToken&&(e[yH]=this.appCheckToken),kH(t,_H,e))}open(e,t){this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new SH(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(3e4)),function(e){if("complete"===document.readyState)e();else{let t=!1;const n=function(){document.body?t||(t=!0,e()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&n()}),window.attachEvent("onload",n))}}(()=>{if(this.isClosed_)return;this.scriptTagHolder=new DH((...e)=>{const[t,n,i,a,o]=e;if(this.incrementIncomingBytes_(e),this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,t===IH)this.id=n,this.password=i;else{if("close"!==t)throw new Error("Unrecognized command received: "+t);n?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(n,()=>{this.onClosed_()})):this.onClosed_()}},(...e)=>{const[t,n]=e;this.incrementIncomingBytes_(e),this.myPacketOrderer.handleResponse(t,n)},()=>{this.onClosed_()},this.urlFn);const e={};e[IH]="t",e.ser=Math.floor(1e8*Math.random()),this.scriptTagHolder.uniqueCallbackIdentifier&&(e.cb=this.scriptTagHolder.uniqueCallbackIdentifier),e.v="5",this.transportSessionId&&(e.s=this.transportSessionId),this.lastSessionId&&(e.ls=this.lastSessionId),this.applicationId&&(e.p=this.applicationId),this.appCheckToken&&(e[yH]=this.appCheckToken),"undefined"!=typeof location&&location.hostname&&vH.test(location.hostname)&&(e.r="f");const t=this.urlFn(e);this.log_("Connecting via long-poll to "+t),this.scriptTagHolder.addTag(t,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){AH.forceAllow_=!0}static forceDisallow(){AH.forceDisallow_=!0}static isAvailable(){return!!AH.forceAllow_||!(AH.forceDisallow_||"undefined"==typeof document||null==document.createElement||"object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href)||"object"==typeof Windows&&"object"==typeof Windows.UI)}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){const t=bc(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);const n=Kl(t),i=lH(n,1840);for(let a=0;a<i.length;a++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,i.length,i[a]),this.curSegmentNum++}addDisconnectPingFrame(e,t){this.myDisconnFrame=document.createElement("iframe");const n={dframe:"t"};n.id=e,n.pw=t,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}incrementIncomingBytes_(e){const t=bc(e).length;this.bytesReceived+=t,this.stats_.incrementCounter("bytes_received",t)}}class DH{constructor(e,t,n,i){this.onDisconnect=n,this.urlFn=i,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0;{this.uniqueCallbackIdentifier=Wj(),window["pLPCommand"+this.uniqueCallbackIdentifier]=e,window["pRTLPCB"+this.uniqueCallbackIdentifier]=t,this.myIFrame=DH.createIFrame_();let n="";if(this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,11)){n='<script>document.domain="'+document.domain+'";<\/script>'}const i="<html><body>"+n+"</body></html>";
vendor: 6,628 bytes, lines 4416-4437
4416try{this.myIFrame.doc.open(),this.myIFrame.doc.write(i),this.myIFrame.doc.close()}catch(ZNe){$j("frame writing exception"),ZNe.stack&&$j(ZNe.stack),$j(ZNe)}}}static createIFrame_(){const e=document.createElement("iframe");if(e.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(e);try{e.contentWindow.document||$j("No IE domain setting required")}catch(ZNe){const n=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+n+"';document.close();})())"}return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout(()=>{null!==this.myIFrame&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));const e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;const e={};e.id=this.myID,e.pw=this.myPW,e.ser=this.currentSerial;let t=this.urlFn(e),n="",i=0;for(;this.pendingSegs.length>0;){if(!(this.pendingSegs[0].d.length+30+n.length<=1870))break;{const e=this.pendingSegs.shift();n=n+"&seg"+i+"="+e.seg+"&ts"+i+"="+e.ts+"&d"+i+"="+e.d,i++}}return t+=n,this.addLongPollTag_(t,this.currentSerial),!0}return!1}enqueueSegment(e,t,n){this.pendingSegs.push({seg:e,ts:t,d:n}),this.alive&&this.newRequest_()}addLongPollTag_(e,t){this.outstandingRequests.add(t);const n=()=>{this.outstandingRequests.delete(t),this.newRequest_()},i=setTimeout(n,Math.floor(25e3));this.addTag(e,()=>{clearTimeout(i),n()})}addTag(e,t){setTimeout(()=>{try{if(!this.sendNewPolls)return;const n=this.myIFrame.doc.createElement("script");n.type="text/javascript",n.async=!0,n.src=e,n.onload=n.onreadystatechange=function(){const e=n.readyState;e&&"loaded"!==e&&"complete"!==e||(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),t())},n.onerror=()=>{$j("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(n)}catch(ZNe){}},Math.floor(1))}} 4417/** 4418 * @license 4419 * Copyright 2017 Google LLC 4420 * 4421 * Licensed under the Apache License, Version 2.0 (the "License"); 4422 * you may not use this file except in compliance with the License. 4423 * You may obtain a copy of the License at 4424 * 4425 * http://www.apache.org/licenses/LICENSE-2.0 4426 * 4427 * Unless required by applicable law or agreed to in writing, software 4428 * distributed under the License is distributed on an "AS IS" BASIS, 4429 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4430 * See the License for the specific language governing permissions and 4431 * limitations under the License. 4432 */let PH=null;"undefined"!=typeof MozWebSocket?PH=MozWebSocket:"undefined"!=typeof WebSocket&&(PH=WebSocket);class OH{constructor(e,t,n,i,a,o,s){this.connId=e,this.applicationId=n,this.appCheckToken=i,this.authToken=a,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=Xj(this.connId),this.stats_=EH(t),this.connURL=OH.connectionURL_(t,o,s,i,n),this.nodeAdmin=t.nodeAdmin}static connectionURL_(e,t,n,i,a){const o={v:"5"};return"undefined"!=typeof location&&location.hostname&&vH.test(location.hostname)&&(o.r="f"),t&&(o.s=t),n&&(o.ls=n),i&&(o[yH]=i),a&&(o.p=a),kH(e,bH,o)}open(e,t){this.onDisconnect=t,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,jj.set("previous_websocket_failure",!0);try{let e;uc(),this.mySock=new PH(this.connURL,[],e)}catch(ZNe){this.log_("Error instantiating WebSocket.");const t=ZNe.message||ZNe.data;return t&&this.log_(t),void this.onClosed_()}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=e=>{this.handleIncomingFrame(e)},this.mySock.onerror=e=>{this.log_("WebSocket error. Closing connection.");const t=e.message||e.data;t&&this.log_(t),this.onClosed_()}}start(){}static forceDisallow(){OH.forceDisallow_=!0}static isAvailable(){let e=!1;if("undefined"!=typeof navigator&&navigator.userAgent){const t=/Android ([0-9]{0,}\.[0-9]{0,})/,n=navigator.userAgent.match(t);n&&n.length>1&&parseFloat(n[1])<4.4&&(e=!0)}return!e&&null!==PH&&!OH.forceDisallow_}static previouslyFailed(){return jj.isInMemoryStorage||!0===jj.get("previous_websocket_failure")}markConnectionHealthy(){jj.remove("previous_websocket_failure")}appendFrame_(e){if(this.frames.push(e),this.frames.length===this.totalFrames){const e=this.frames.join("");this.frames=null;const t=yc(e);this.onMessage(t)}}handleNewFrameCount_(e){this.totalFrames=e,this.frames=[]}extractFrameCount_(e){if(Ul(null===this.frames,"We already have a frame buffer"),e.length<=6){const t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e}handleIncomingFrame(e){if(null===this.mySock)return;const t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(t);else{const e=this.extractFrameCount_(t);null!==e&&this.appendFrame_(e)}}send(e){this.resetKeepAlive();const t=bc(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);const n=lH(t,16384);n.length>1&&this.sendString_(String(n.length));for(let i=0;i<n.length;i++)this.sendString_(n[i])}shutdown_(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)}onClosed_(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))}close(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())}resetKeepAlive(){clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(()=>{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(45e3))}sendString_(e){try{this.mySock.send(e)}catch(ZNe){this.log_("Exception thrown from WebSocket.send():",ZNe.message||ZNe.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}OH.responsesRequiredToBeHealthy=2,OH.healthyTimeout=3e4; 4433/** 4434 * @license 4435 * Copyright 2017 Google LLC 4436 * 4437 * Licensed under the Apache License, Version 2.0 (the "License");
4438 * you may not use this file except in compliance with the License. 4439 * You may obtain a copy of the License at 4440 * 4441 * http://www.apache.org/licenses/LICENSE-2.0 4442 * 4443 * Unless required by applicable law or agreed to in writing, software 4444 * distributed under the License is distributed on an "AS IS" BASIS, 4445 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4446 * See the License for the specific language governing permissions and 4447 * limitations under the License. 4448 */ 4449class MH{constructor(e){this.initTransports_(e)}static get ALL_TRANSPORTS(){return[AH,OH]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}initTransports_(e){const t=OH&&OH.isAvailable();let n=t&&!OH.previouslyFailed();if(e.webSocketOnly&&(t||eH("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),n=!0),n)this.transports_=[OH];else{const e=this.transports_=[];for(const t of MH.ALL_TRANSPORTS)t&&t.isAvailable()&&e.push(t);MH.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}MH.globalTransportInitialized_=!1;class NH{constructor(e,t,n,i,a,o,s,r,l,c){this.id=e,this.repoInfo_=t,this.applicationId_=n,this.appCheckToken_=i,this.authToken_=a,this.onMessage_=o,this.onReady_=s,this.onDisconnect_=r,this.onKill_=l,this.lastSessionId=c,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=Xj("c:"+this.id+":"),this.transportManager_=new MH(t),this.log_("Connection created"),this.start_()}start_(){const e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const t=this.connReceiver_(this.conn_),n=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(t,n)},Math.floor(0));const i=e.healthyTimeout||0;i>0&&(this.healthyTimeout_=pH(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>102400?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>10240?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(i)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return t=>{e===this.conn_?this.onConnectionLost_(t):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return t=>{2!==this.state_&&(e===this.rx_?this.onPrimaryMessageReceived_(t):e===this.secondaryConn_?this.onSecondaryMessageReceived_(t):this.log_("message on old connection"))}}sendRequest(e){const t={t:"d",d:e};this.sendData_(t)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if("t"in e){const t=e.t;"a"===t?this.upgradeIfSecondaryHealthy_():"r"===t?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===t&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){const t=sH("t",e),n=sH("d",e);if("c"===t)this.onSecondaryControl_(n);else{if("d"!==t)throw new Error("Unknown protocol layer: "+t);this.pendingDataMessages.push(n)}}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t
vendor: 4,270 bytes, lines 4449-4460
4449:"c",d:{t:"p",d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){const t=sH("t",e),n=sH("d",e);"c"===t?this.onControl_(n):"d"===t&&this.onDataMessage_(n)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){const t=sH("t",e);if("d"in e){const n=e.d;if("h"===t){const e=Object.assign({},n);this.repoInfo_.isUsingEmulator&&(e.h=this.repoInfo_.host),this.onHandshake_(e)}else if("n"===t){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let e=0;e<this.pendingDataMessages.length;++e)this.onDataMessage_(this.pendingDataMessages[e]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===t?this.onConnectionShutdown_(n):"r"===t?this.onReset_(n):"e"===t?Jj("Server Error: "+n):"o"===t?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):Jj("Unknown control packet command: "+t)}}onHandshake_(e){const t=e.ts,n=e.v,i=e.h;this.sessionId=e.s,this.repoInfo_.host=i,0===this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,t),"5"!==n&&eH("Protocol version mismatch detected"),this.tryStartUpgrade_())}tryStartUpgrade_(){const e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)}startUpgrade_(e){this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const t=this.connReceiver_(this.secondaryConn_),n=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(t,n),pH(()=>{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(6e4))}onReset_(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.host=e,1===this.state_?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,t){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):pH(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(5e3))}sendPingOnPrimaryIfNecessary_(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))}onSecondaryConnectionLost_(){const e=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==e&&this.rx_!==e||this.close()}onConnectionLost_(e){this.conn_=null,e||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(jj.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(e)}close(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}} 4450/** 4451 * @license 4452 * Copyright 2017 Google LLC 4453 * 4454 * Licensed under the Apache License, Version 2.0 (the "License"); 4455 * you may not use this file except in compliance with the License. 4456 * You may obtain a copy of the License at 4457 * 4458 * http://www.apache.org/licenses/LICENSE-2.0 4459 * 4460 * Unless required by applicable law or agreed to in writing, softw
4460are 4461 * distributed under the License is distributed on an "AS IS" BASIS, 4462 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4463 * See the License for the specific language governing permissions and 4464 * limitations under the License. 4465 */class RH{put(e,t,n,i){}merge(e,t,n,i){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,t,n){}onDisconnectMerge(e,t,n){}onDisconnectCancel(e,t){}reportStats(e){}} 4466/** 4467 * @license 4468 * Copyright 2017 Google LLC 4469 * 4470 * Licensed under the Apache License, Version 2.0 (the "License"); 4471 * you may not use this file except in compliance with the License. 4472 * You may obtain a copy of the License at 4473 * 4474 * http://www.apache.org/licenses/LICENSE-2.0 4475 * 4476 * Unless required by applicable law or agreed to in writing, software 4477 * distributed under the License is distributed on an "AS IS" BASIS, 4478 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4479 * See the License for the specific language governing permissions and 4480 * limitations under the License. 4481 */class LH{constructor(e){this.allowedEvents_=e,this.listeners_={},Ul(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e,...t){if(Array.isArray(this.listeners_[e])){const n=[...this.listeners_[e]];for(let e=0;e<n.length;e++)n[e].callback.apply(n[e].context,t)}}on(e,t,n){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:t,context:n});const i=this.getInitialEvent(e);i&&t.apply(n,i)}off(e,t,n){this.validateEventType_(e);const i=this.listeners_[e]||[];for(let a=0;a<i.length;a++)if(i[a].callback===t&&(!n||n===i[a].context))return void i.splice(a,1)}validateEventType_(e){Ul(this.allowedEvents_.find(t=>t===e),"Unknown event: "+e)}} 4482/** 4483 * @license 4484 * Copyright 2017 Google LLC 4485 * 4486 * Licensed under the Apache License, Version 2.0 (the "License"); 4487 * you may not use this file except in compliance with the License. 4488 * You may obtain a copy of the License at 4489 * 4490 * http://www.apache.org/licenses/LICENSE-2.0 4491 * 4492 * Unless required by applicable law or agreed to in writing, software 4493 * distributed under the License is distributed on an "AS IS" BASIS, 4494 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4495 * See the License for the specific language governing permissions and 4496 * limitations under the License. 4497 */class VH extends LH{constructor(){super(["online"]),this.online_=!0,"undefined"==typeof window||void 0===window.addEventListener||rc()||(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}static getInstance(){return new VH}getInitialEvent(e){return Ul("online"===e,"Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}} 4498/** 4499 * @license 4500 * Copyright 2017 Google LLC 4501 * 4502 * Licensed under the Apache License, Version 2.0 (the "License"); 4503 * you may not use this file except in compliance with the License. 4504 * You may obtain a copy of the License at 4505 * 4506 * http://www.apache.org/licenses/LICENSE-2.0 4507 * 4508 * Unless required by applicable law or agreed to in writing, software 4509 * distributed under the License is distributed on an "AS IS" BASIS, 4510 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4511 * See the License for the specific language governing permissions and 4512 * limitations under the License. 4513 */class qH{constructor(e,t){if(void 0===t){this.pieces_=e.split("/");let t=0;for(let e=0;e<this.pieces_.length;e++)this.pieces_[e].length>0&&(this.pieces_[t]=this.pieces_[e],t++);this.pieces_.length=t,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}toString(){let e="";for(let t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+this.pieces_[t]);return e||"/"}}function FH(){return new qH("")}function BH(e){return e.pieceNum_>=e.pieces_.length?null:e.pieces_[e.pieceNum_]}function UH(e){return e.pieces_.length-e.pieceNum_}function jH(e){let t=e.pieceNum_;return t<e.pieces_.length&&t++,new qH(e.pieces_,t)}function HH(e){return e.pieceNum_<e.pieces_.length?e.pieces_[e.pieces_.length-1]:null}function zH(e,t=0){return e.pieces_.slice(e.pieceNum_+t)}function WH(e){if(e.pieceNum_>=e.pieces_.length)return null;const t=[];for(let n=e.pieceNum_;n<e.pieces_.length-1;n++)t.push(e.pieces_[n]);return new qH(t,0)}function KH(e,t){const n=[];for(let i=e.pieceNum_;i<e.pieces_.length;i++)n.push(e.pieces_[i]);if(t instanceof qH)for(let i=t.pieceNum_;i<t.pieces_.length;i++)n.push(t.pieces_[i]);else{const e=t.split("/");for(let t=0;t<e.length;t++)e[t].length>0&&n.push(e[t])}return new qH(n,0)}function GH(e){return e.pieceNum_>=e.pieces_.length}function YH(e,t){const n=BH(e),i=BH(t);if(null===n)return t;if(n===i)return YH(jH(e),jH(t));
vendor: 15,947 bytes, lines 4513-4550
4513throw new Error("INTERNAL ERROR: innerPath ("+t+") is not within outerPath ("+e+")")}function QH(e,t){if(UH(e)!==UH(t))return!1;for(let n=e.pieceNum_,i=t.pieceNum_;n<=e.pieces_.length;n++,i++)if(e.pieces_[n]!==t.pieces_[i])return!1;return!0}function $H(e,t){let n=e.pieceNum_,i=t.pieceNum_;if(UH(e)>UH(t))return!1;for(;n<e.pieces_.length;){if(e.pieces_[n]!==t.pieces_[i])return!1;++n,++i}return!0}class XH{constructor(e,t){this.errorPrefix_=t,this.parts_=zH(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(let n=0;n<this.parts_.length;n++)this.byteLength_+=Mc(this.parts_[n]);JH(this)}}function JH(e){if(e.byteLength_>768)throw new Error(e.errorPrefix_+"has a key path longer than 768 bytes ("+e.byteLength_+").");if(e.parts_.length>32)throw new Error(e.errorPrefix_+"path specified exceeds the maximum depth that can be written (32) or object contains a cycle "+ZH(e))}function ZH(e){return 0===e.parts_.length?"":"in property '"+e.parts_.join(".")+"'"} 4514/** 4515 * @license 4516 * Copyright 2017 Google LLC 4517 * 4518 * Licensed under the Apache License, Version 2.0 (the "License"); 4519 * you may not use this file except in compliance with the License. 4520 * You may obtain a copy of the License at 4521 * 4522 * http://www.apache.org/licenses/LICENSE-2.0 4523 * 4524 * Unless required by applicable law or agreed to in writing, software 4525 * distributed under the License is distributed on an "AS IS" BASIS, 4526 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4527 * See the License for the specific language governing permissions and 4528 * limitations under the License. 4529 */class ez extends LH{constructor(){let e,t;super(["visible"]),"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(t="visibilitychange",e="hidden"):void 0!==document.mozHidden?(t="mozvisibilitychange",e="mozHidden"):void 0!==document.msHidden?(t="msvisibilitychange",e="msHidden"):void 0!==document.webkitHidden&&(t="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,t&&document.addEventListener(t,()=>{const t=!document[e];t!==this.visible_&&(this.visible_=t,this.trigger("visible",t))},!1)}static getInstance(){return new ez}getInitialEvent(e){return Ul("visible"===e,"Unknown event type: "+e),[this.visible_]}} 4530/** 4531 * @license 4532 * Copyright 2017 Google LLC 4533 * 4534 * Licensed under the Apache License, Version 2.0 (the "License"); 4535 * you may not use this file except in compliance with the License. 4536 * You may obtain a copy of the License at 4537 * 4538 * http://www.apache.org/licenses/LICENSE-2.0 4539 * 4540 * Unless required by applicable law or agreed to in writing, software 4541 * distributed under the License is distributed on an "AS IS" BASIS, 4542 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4543 * See the License for the specific language governing permissions and 4544 * limitations under the License. 4545 */const tz=1e3;class nz extends RH{constructor(e,t,n,i,a,o,s,r){if(super(),this.repoInfo_=e,this.applicationId_=t,this.onDataUpdate_=n,this.onConnectStatus_=i,this.onServerInfoUpdate_=a,this.authTokenProvider_=o,this.appCheckTokenProvider_=s,this.authOverride_=r,this.id=nz.nextPersistentConnectionId_++,this.log_=Xj("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=tz,this.maxReconnectDelay_=3e5,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,r&&!uc())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");ez.getInstance().on("visible",this.onVisible_,this),-1===e.host.indexOf("fblocal")&&VH.getInstance().on("online",this.onOnline_,this)}sendRequest(e,t,n){const i=++this.requestNumber_,a={r:i,a:e,b:t};this.log_(bc(a)),Ul(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(a),n&&(this.requestCBHash_[i]=n)}get(e){this.initConnection_();const t=new ac,n={action:"g",request:{p:e._path.toString(),q:e._queryObject},onComplete:e=>{const n=e.d;"ok"===e.s?t.resolve(n):t.reject(n)}};this.outstandingGets_.push(n),this.outstandingGetCount_++;const i=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(i),t.promise}listen(e,t,n,i){this.initConnection_();const a=e._queryIdentifier,o=e._path.toString();this.log_("Listen called for "+o+" "+a),this.listens.has(o)||this.listens.set(o,new Map),Ul(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),Ul(!this.listens.get(o).has(a),"listen() called twice for same path/queryId.");const s={onComplete:i,hashFn:t,query:e,tag:n};this.listens.get(o).set(a,s),this.connected_&&this.sendListen_(s)}sendGet_(e){const t=this.outstandingGets_[e];this.sendRequest("g",t.request,n=>{delete this.outstandingGets_[e],this.outstandingGetCount_--,0===this.outstandingGetCount_&&(this.outstandingGets_=[]),t.onComplete&&t.onComplete(n)})}sendListen_(e){const t=e.query,n=t._path.toString(),i=t._queryIdentifier;this.log_("Listen on "+n+" for "+i);const a={p:n};e.tag&&(a.q=t._queryObject,a.t=e.tag),a.h=e.hashFn(),this.sendRequest("q",a,a=>{const o=a.d,s=a.s;nz.warnOnListenWarnings_(o,t);(this.listens.get(n)&&this.listens.get(n).get(i))===e&&(this.log_("listen response",a),"ok"!==s&&this.removeListen_(n,i),e.onComplete&&e.onComplete(s,o))})}static warnOnListenWarnings_(e,t){if(e&&"object"==typeof e&&wc(e,"w")){const n=kc(e,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){const e='".indexOn": "'+t._queryParams.getIndex().toString()+'"',n=t._path.toString();eH("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ".concat(e," at ").concat(n," to your security rules for better performance."))}}}refreshAuthToken(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(e)}reduceReconnectDelayIfAdminCredential_(e){(e&&40===e.length||function(e){const t=_c(e).claims;return"object"==typeof t&&!0===t.admin}(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=3e4)}refreshAppCheckToken(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){const e=this.authToken_,t=function(e){const t=_c(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")}(e)?"auth":"gauth",n={cred:e};null===this.authOverride_?n.noauth=!0:"object"==typeof this.authOverride_&&(n.authvar=this.authOverride_),this.sendRequest(t,n,t=>{const n=t.s,i=t.d||"error";this.authToken_===e&&("ok"===n?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(n,i))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},e=>{const t=e.s,n=e.d||"error";"ok"===t?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(t,n)})}unlisten(e,t){const n=e._path.toString(),i=e._queryIdentifier;this.log_("Unlisten called for "+n+" "+i),Ul(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query");this.removeListen_(n,i)&&this.connected_&&this.sendUnlisten_(n,i,e._queryObject,t)}sendUnlisten_(e,t,n,i){this.log_("Unlisten on "+e+" for "+t);const a={p:e};i&&(a.q=n,a.t=i),this.sendRequest("n",a)}onDisconnectPut(e,t,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:n})}onDisconnectMerge(e,t,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:n})}onDisconnectCancel(e,t){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})}sendOnDisconnect_(e,t,n,i){const a={p:t,d:n};this.log_("onDisconnect "+e,a),this.sendRequest(e,a,e=>{i&&setTimeout(()=>{i(e.s,e.d)},Math.floor(0))})}put(e,t,n,i){this.putInternal("p",e,t,n,i)}merge(e,t,n,i){this.putInternal("m",e,t,n,i)}putInternal(e,t,n,i,a){this.initConnection_();const o={p:t,d:n};void 0!==a&&(o.h=a),this.outstandingPuts_.push({action:e,request:o,onComplete:i}),this.outstandingPutCount_++;const s=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(s):this.log_("Buffering put: "+t)}sendPut_(e){const t=this.outstandingPuts_[e].action,n=this.outstandingPuts_[e].request,i=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(t,n,n=>{this.log_(t+" response",n),delete this.outstandingPuts_[e],this.outstandingPutCount_--,0===this.outstandingPutCount_&&(this.outstandingPuts_=[]),i&&i(n.s,n.d)})}reportStats(e){if(this.connected_){const t={c:e};this.log_("reportStats",t),this.sendRequest("s",t,e=>{if("ok"!==e.s){const t=e.d;this.log_("reportStats","Error sending stats: "+t)}})}}onDataMessage_(e){if("r"in e){this.log_("from server: "+bc(e));const t=e.r,n=this.requestCBHash_[t];n&&(delete this.requestCBHash_[t],n(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}}onDataPush_(e,t){this.log_("handleServerMessage",e,t),"d"===e?this.onDataUpdate_(t.p,t.d,!1,t.t):"m"===e?this.onDataUpdate_(t.p,t.d,!0,t.t):"c"===e?this.onListenRevoked_(t.p,t.q):"ac"===e?this.onAuthRevoked_(t.s,t.d):"apc"===e?this.onAppCheckRevoked_(t.s,t.d):"sd"===e?this.onSecurityDebugPacket_(t):Jj("Unrecognized action received from server: "+bc(e)+"\nAre you using the latest client?")}onReady_(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){Ul(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=tz,this.realtime_||this.scheduleConnect_(0)),this.visible_=e}onOnline_(e){e?(this.log_("Browser went online."),this.reconnectDelay_=tz,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){(new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=tz),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();const e=(new Date).getTime()-this.lastConnectionAttemptTime_;let t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;const e=this.onDataMessage_.bind(this),t=this.onReady_.bind(this),n=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+nz.nextConnectionId_++,a=this.lastSessionId;let o=!1,s=null;const r=function(){s?s.close():(o=!0,n())},l=function(e){Ul(s,"sendRequest call when we're not connected not allowed."),s.sendRequest(e)};this.realtime_={close:r,sendRequest:l};const c=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const[r,l]=await Promise.all([this.authTokenProvider_.getToken(c),this.appCheckTokenProvider_.getToken(c)]);o?$j("getToken() completed but was canceled"):($j("getToken() completed. Creating connection."),this.authToken_=r&&r.accessToken,this.appCheckToken_=l&&l.token,s=new NH(i,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,t,n,e=>{eH(e+" ("+this.repoInfo_.toString()+")"),this.interrupt("server_kill")},a))}catch(eRe){this.log_("Failed to get token: "+eRe),o||(this.repoInfo_.nodeAdmin&&eH(eRe),r())}}}interrupt(e){$j("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(e){$j("Resuming connection for reason: "+e),delete this.interruptReasons_[e],xc(this.interruptReasons_)&&(this.reconnectDelay_=tz,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(e){const t=e-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:t})}cancelSentTransactions_(){for(let e=0;e<this.outstandingPuts_.length;e++){const t=this.outstandingPuts_[e];t&&"h"in t.request&&t.queued&&(t.onComplete&&t.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])}onListenRevoked_(e,t){let n;n=t?t.map(e=>rH(e)).join("$"):"default";const i=this.removeListen_(e,n);i&&i.onComplete&&i.onComplete("permission_denied")}removeListen_(e,t){const n=new qH(e).toString();let i;if(this.listens.has(n)){const e=this.listens.get(n);i=e.get(t),e.delete(t),0===e.size&&this.listens.delete(n)}else i=void 0;return i}onAuthRevoked_(e,t){$j("Auth token revoked: "+e+"/"+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(e,t){$j("App check token revoked: "+e+"/"+t),this.appCheckToken_=null,this.forceTokenRefresh_=!0,"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=3&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(e){this.securityDebugCallback_&&this.securityDebugCallback_(e)}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of this.listens.values())for(const t of e.values())this.sendListen_(t);for(let e=0;e<this.outstandingPuts_.length;e++)this.outstandingPuts_[e]&&this.sendPut_(e);for(;this.onDisconnectRequestQueue_.length;){const e=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(e.action,e.pathString,e.data,e.onComplete)}for(let e=0;e<this.outstandingGets_.length;e++)this.outstandingGets_[e]&&this.sendGet_(e)}sendConnectStats_(){const e={};e["sdk.js."+qj.replace(/\./g,"-")]=1,rc()?e["framework.cordova"]=1:cc()&&(e["framework.reactnative"]=1),this.reportStats(e)}shouldReconnect_(){const e=VH.getInstance().currentlyOnline();return xc(this.interruptReasons_)&&e}}nz.nextPersistentConnectionId_=0,nz.nextConnectionId_=0; 4546/** 4547 * @license 4548 * Copyright 2017 Google LLC 4549 * 4550 * Licensed under the Apache License, Version 2.0 (the "License");
vendor: 6,485 bytes, lines 4551-4610
4551 * you may not use this file except in compliance with the License. 4552 * You may obtain a copy of the License at 4553 * 4554 * http://www.apache.org/licenses/LICENSE-2.0 4555 * 4556 * Unless required by applicable law or agreed to in writing, software 4557 * distributed under the License is distributed on an "AS IS" BASIS, 4558 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4559 * See the License for the specific language governing permissions and 4560 * limitations under the License. 4561 */ 4562class iz{constructor(e,t){this.name=e,this.node=t}static Wrap(e,t){return new iz(e,t)}} 4563/** 4564 * @license 4565 * Copyright 2017 Google LLC 4566 * 4567 * Licensed under the Apache License, Version 2.0 (the "License"); 4568 * you may not use this file except in compliance with the License. 4569 * You may obtain a copy of the License at 4570 * 4571 * http://www.apache.org/licenses/LICENSE-2.0 4572 * 4573 * Unless required by applicable law or agreed to in writing, software 4574 * distributed under the License is distributed on an "AS IS" BASIS, 4575 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4576 * See the License for the specific language governing permissions and 4577 * limitations under the License. 4578 */class az{getCompare(){return this.compare.bind(this)}indexedValueChanged(e,t){const n=new iz(nH,e),i=new iz(nH,t);return 0!==this.compare(n,i)}minPost(){return iz.MIN}} 4579/** 4580 * @license 4581 * Copyright 2017 Google LLC 4582 * 4583 * Licensed under the Apache License, Version 2.0 (the "License"); 4584 * you may not use this file except in compliance with the License. 4585 * You may obtain a copy of the License at 4586 * 4587 * http://www.apache.org/licenses/LICENSE-2.0 4588 * 4589 * Unless required by applicable law or agreed to in writing, software 4590 * distributed under the License is distributed on an "AS IS" BASIS, 4591 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4592 * See the License for the specific language governing permissions and 4593 * limitations under the License. 4594 */let oz;class sz extends az{static get __EMPTY_NODE(){return oz}static set __EMPTY_NODE(e){oz=e}compare(e,t){return aH(e.name,t.name)}isDefinedOn(e){throw jl("KeyIndex.isDefinedOn not expected to be called.")}indexedValueChanged(e,t){return!1}minPost(){return iz.MIN}maxPost(){return new iz(iH,oz)}makePost(e,t){return Ul("string"==typeof e,"KeyIndex indexValue must always be a string."),new iz(e,oz)}toString(){return".key"}}const rz=new sz; 4595/** 4596 * @license 4597 * Copyright 2017 Google LLC 4598 * 4599 * Licensed under the Apache License, Version 2.0 (the "License"); 4600 * you may not use this file except in compliance with the License. 4601 * You may obtain a copy of the License at 4602 * 4603 * http://www.apache.org/licenses/LICENSE-2.0 4604 * 4605 * Unless required by applicable law or agreed to in writing, software 4606 * distributed under the License is distributed on an "AS IS" BASIS, 4607 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4608 * See the License for the specific language governing permissions and 4609 * limitations under the License. 4610 */class lz{constructor(e,t,n,i,a=null){this.isReverse_=i,this.resultGenerator_=a,this.nodeStack_=[];let o=1;for(;!e.isEmpty();)if(o=t?n(e.key,t):1,i&&(o*=-1),o<0)e=this.isReverse_?e.left:e.right;else{if(0===o){this.nodeStack_.push(e);break}this.nodeStack_.push(e),e=this.isReverse_?e.right:e.left}}getNext(){if(0===this.nodeStack_.length)return null;let e,t=this.nodeStack_.pop();if(e=this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value},this.isReverse_)for(t=t.left;!t.isEmpty();)this.nodeStack_.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack_.push(t),t=t.left;return e}hasNext(){return this.nodeStack_.length>0}peek(){if(0===this.nodeStack_.length)return null;const e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}}class cz{constructor(e,t,n,i,a){this.key=e,this.value=t,this.color=null!=n?n:cz.RED,this.left=null!=i?i:uz.EMPTY_NODE,this.right=null!=a?a:uz.EMPTY_NODE}copy(e,t,n,i,a){return new cz(null!=e?e:this.key,null!=t?t:this.value,null!=n?n:this.color,null!=i?i:this.left,null!=a?a:this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let i=this;const a=n(e,i.key);return i=a<0?i.copy(null,null,null,i.left.insert(e,t,n),null):0===a?i.copy(null,t,null,null,null):i.copy(null,null,null,null,i.right.insert(e,t,n)),i.fixUp_()}removeMin_(){if(this.left.isEmpty())return uz.EMPTY_NODE;let e=this;return e.left.isRed_()||e.left.left.isRed_()||(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()}remove(e,t){let n,i;if(n=this,t(e,n.key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===t(e,n.key)){if(n.right.isEmpty())return uz.EMPTY_NODE;i=n.right.min_(),n=n.copy(i.key,i.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.fixUp_()}isRed_(){return this.color}fixUp_(){let e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e}moveRedLeft_(){let e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e}moveRedRight_(){let e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e}rotateLeft_(){const e=this.copy(null,null,cz.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight_(){const e=this.copy(null,null,cz.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip_(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth_(){const e=this.check_();return Math.pow(2,e)<=this.count()+1}
vendor: 25,469 bytes, lines 4610-4795
4610check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");const e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)}}cz.RED=!0,cz.BLACK=!1;class uz{constructor(e,t=uz.EMPTY_NODE){this.comparator_=e,this.root_=t}insert(e,t){return new uz(this.comparator_,this.root_.insert(e,t,this.comparator_).copy(null,null,cz.BLACK,null,null))}remove(e){return new uz(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,cz.BLACK,null,null))}get(e){let t,n=this.root_;for(;!n.isEmpty();){if(t=this.comparator_(e,n.key),0===t)return n.value;t<0?n=n.left:t>0&&(n=n.right)}return null}getPredecessorKey(e){let t,n=this.root_,i=null;for(;!n.isEmpty();){if(t=this.comparator_(e,n.key),0===t){if(n.left.isEmpty())return i?i.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}t<0?n=n.left:t>0&&(i=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new lz(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,t){return new lz(this.root_,e,this.comparator_,!1,t)}getReverseIteratorFrom(e,t){return new lz(this.root_,e,this.comparator_,!0,t)}getReverseIterator(e){return new lz(this.root_,null,this.comparator_,!0,e)}} 4611/** 4612 * @license 4613 * Copyright 2017 Google LLC 4614 * 4615 * Licensed under the Apache License, Version 2.0 (the "License"); 4616 * you may not use this file except in compliance with the License. 4617 * You may obtain a copy of the License at 4618 * 4619 * http://www.apache.org/licenses/LICENSE-2.0 4620 * 4621 * Unless required by applicable law or agreed to in writing, software 4622 * distributed under the License is distributed on an "AS IS" BASIS, 4623 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4624 * See the License for the specific language governing permissions and 4625 * limitations under the License. 4626 */ 4627function hz(e,t){return aH(e.name,t.name)}function dz(e,t){return aH(e,t)} 4628/** 4629 * @license 4630 * Copyright 2017 Google LLC 4631 * 4632 * Licensed under the Apache License, Version 2.0 (the "License"); 4633 * you may not use this file except in compliance with the License. 4634 * You may obtain a copy of the License at 4635 * 4636 * http://www.apache.org/licenses/LICENSE-2.0 4637 * 4638 * Unless required by applicable law or agreed to in writing, software 4639 * distributed under the License is distributed on an "AS IS" BASIS, 4640 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4641 * See the License for the specific language governing permissions and 4642 * limitations under the License. 4643 */let fz;uz.EMPTY_NODE=new class{copy(e,t,n,i,a){return this}insert(e,t,n){return new cz(e,t,null)}remove(e,t){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}};const pz=function(e){return"number"==typeof e?"number:"+uH(e):"string:"+e},gz=function(e){if(e.isLeafNode()){const t=e.val();Ul("string"==typeof t||"number"==typeof t||"object"==typeof t&&wc(t,".sv"),"Priority must be a string or number.")}else Ul(e===fz||e.isEmpty(),"priority of unexpected type.");Ul(e===fz||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")}; 4644/** 4645 * @license 4646 * Copyright 2017 Google LLC 4647 * 4648 * Licensed under the Apache License, Version 2.0 (the "License"); 4649 * you may not use this file except in compliance with the License. 4650 * You may obtain a copy of the License at 4651 * 4652 * http://www.apache.org/licenses/LICENSE-2.0 4653 * 4654 * Unless required by applicable law or agreed to in writing, software 4655 * distributed under the License is distributed on an "AS IS" BASIS, 4656 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4657 * See the License for the specific language governing permissions and 4658 * limitations under the License. 4659 */ 4660let mz,vz,yz;class bz{constructor(e,t=bz.__childrenNodeConstructor.EMPTY_NODE){this.value_=e,this.priorityNode_=t,this.lazyHash_=null,Ul(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),gz(this.priorityNode_)}static set __childrenNodeConstructor(e){mz=e}static get __childrenNodeConstructor(){return mz}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(e){return new bz(this.value_,e)}getImmediateChild(e){return".priority"===e?this.priorityNode_:bz.__childrenNodeConstructor.EMPTY_NODE}getChild(e){return GH(e)?this:".priority"===BH(e)?this.priorityNode_:bz.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(e,t){return null}updateImmediateChild(e,t){return".priority"===e?this.updatePriority(t):t.isEmpty()&&".priority"!==e?this:bz.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,t).updatePriority(this.priorityNode_)}updateChild(e,t){const n=BH(e);return null===n?t:t.isEmpty()&&".priority"!==n?this:(Ul(".priority"!==n||1===UH(e),".priority must be the last token in a path"),this.updateImmediateChild(n,bz.__childrenNodeConstructor.EMPTY_NODE.updateChild(jH(e),t)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(e,t){return!1}val(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(null===this.lazyHash_){let e="";this.priorityNode_.isEmpty()||(e+="priority:"+pz(this.priorityNode_.val())+":");const t=typeof this.value_;e+=t+":",e+="number"===t?uH(this.value_):this.value_,this.lazyHash_=Kj(e)}return this.lazyHash_}getValue(){return this.value_}compareTo(e){return e===bz.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof bz.__childrenNodeConstructor?-1:(Ul(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))}compareToLeafNode_(e){const t=typeof e.value_,n=typeof this.value_,i=bz.VALUE_TYPE_ORDER.indexOf(t),a=bz.VALUE_TYPE_ORDER.indexOf(n);return Ul(i>=0,"Unknown leaf type: "+t),Ul(a>=0,"Unknown leaf type: "+n),i===a?"object"===n?0:this.value_<e.value_?-1:this.value_===e.value_?0:1:a-i}withIndex(){return this}isIndexed(){return!0}equals(e){if(e===this)return!0;if(e.isLeafNode()){const t=e;return this.value_===t.value_&&this.priorityNode_.equals(t.priorityNode_)}return!1}}bz.VALUE_TYPE_ORDER=["object","boolean","number","string"];const _z=new class extends az{compare(e,t){const n=e.node.getPriority(),i=t.node.getPriority(),a=n.compareTo(i);return 0===a?aH(e.name,t.name):a}isDefinedOn(e){return!e.getPriority().isEmpty()}indexedValueChanged(e,t){return!e.getPriority().equals(t.getPriority())}minPost(){return iz.MIN}maxPost(){return new iz(iH,new bz("[PRIORITY-POST]",yz))}makePost(e,t){const n=vz(e);return new iz(t,new bz("[PRIORITY-POST]",n))}toString(){return".priority"}},wz=Math.log(2); 4661/** 4662 * @license 4663 * Copyright 2017 Google LLC 4664 * 4665 * Licensed under the Apache License, Version 2.0 (the "License"); 4666 * you may not use this file except in compliance with the License. 4667 * You may obtain a copy of the License at 4668 * 4669 * http://www.apache.org/licenses/LICENSE-2.0 4670 * 4671 * Unless required by applicable law or agreed to in writing, software 4672 * distributed under the License is distributed on an "AS IS" BASIS, 4673 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4674 * See the License for the specific language governing permissions and 4675 * limitations under the License. 4676 */class kz{constructor(e){var t;this.count=(t=e+1,parseInt(Math.log(t)/wz,10)),this.current_=this.count-1;const n=(i=this.count,parseInt(Array(i+1).join("1"),2));var i;this.bits_=e+1&n}nextBitIsOne(){const e=!(this.bits_&1<<this.current_);return this.current_--,e}}const xz=function(e,t,n,i){e.sort(t);const a=function(t,i){const o=i-t;let s,r;if(0===o)return null;if(1===o)return s=e[t],r=n?n(s):s,new cz(r,s.node,cz.BLACK,null,null);{const l=parseInt(o/2,10)+t,c=a(t,l),u=a(l+1,i);return s=e[l],r=n?n(s):s,new cz(r,s.node,cz.BLACK,c,u)}},o=function(t){let i=null,o=null,s=e.length;const r=function(t,i){const o=s-t,r=s;s-=t;const c=a(o+1,r),u=e[o],h=n?n(u):u;l(new cz(h,u.node,i,null,c))},l=function(e){i?(i.left=e,i=e):(o=e,i=e)};for(let e=0;e<t.count;++e){const n=t.nextBitIsOne(),i=Math.pow(2,t.count-(e+1));n?r(i,cz.BLACK):(r(i,cz.BLACK),r(i,cz.RED))}return o}(new kz(e.length));return new uz(i||t,o)}; 4677/** 4678 * @license 4679 * Copyright 2017 Google LLC 4680 * 4681 * Licensed under the Apache License, Version 2.0 (the "License"); 4682 * you may not use this file except in compliance with the License. 4683 * You may obtain a copy of the License at 4684 * 4685 * http://www.apache.org/licenses/LICENSE-2.0 4686 * 4687 * Unless required by applicable law or agreed to in writing, software 4688 * distributed under the License is distributed on an "AS IS" BASIS, 4689 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4690 * See the License for the specific language governing permissions and 4691 * limitations under the License. 4692 */let Tz;const Cz={};class Ez{constructor(e,t){this.indexes_=e,this.indexSet_=t}static get Default(){return Ul(Cz&&_z,"ChildrenNode.ts has not been loaded"),Tz=Tz||new Ez({".priority":Cz},{".priority":_z}),Tz}get(e){const t=kc(this.indexes_,e);if(!t)throw new Error("No index defined for "+e);return t instanceof uz?t:null}hasIndex(e){return wc(this.indexSet_,e.toString())}addIndex(e,t){Ul(e!==rz,"KeyIndex always exists and isn't meant to be added to the IndexMap.");const n=[];let i=!1;const a=t.getIterator(iz.Wrap);let o,s=a.getNext();for(;s;)i=i||e.isDefinedOn(s.node),n.push(s),s=a.getNext();o=i?xz(n,e.getCompare()):Cz;const r=e.toString(),l=Object.assign({},this.indexSet_);l[r]=e;const c=Object.assign({},this.indexes_);return c[r]=o,new Ez(c,l)}addToIndexes(e,t){const n=Tc(this.indexes_,(n,i)=>{const a=kc(this.indexSet_,i);if(Ul(a,"Missing index implementation for "+i),n===Cz){if(a.isDefinedOn(e.node)){const n=[],i=t.getIterator(iz.Wrap);let o=i.getNext();for(;o;)o.name!==e.name&&n.push(o),o=i.getNext();return n.push(e),xz(n,a.getCompare())}return Cz}{const i=t.get(e.name);let a=n;return i&&(a=a.remove(new iz(e.name,i))),a.insert(e,e.node)}});return new Ez(n,this.indexSet_)}removeFromIndexes(e,t){const n=Tc(this.indexes_,n=>{if(n===Cz)return n;{const i=t.get(e.name);return i?n.remove(new iz(e.name,i)):n}});return new Ez(n,this.indexSet_)}} 4693/** 4694 * @license 4695 * Copyright 2017 Google LLC 4696 * 4697 * Licensed under the Apache License, Version 2.0 (the "License"); 4698 * you may not use this file except in compliance with the License. 4699 * You may obtain a copy of the License at 4700 * 4701 * http://www.apache.org/licenses/LICENSE-2.0 4702 * 4703 * Unless required by applicable law or agreed to in writing, software 4704 * distributed under the License is distributed on an "AS IS" BASIS, 4705 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4706 * See the License for the specific language governing permissions and 4707 * limitations under the License. 4708 */let Sz;class Iz{constructor(e,t,n){this.children_=e,this.priorityNode_=t,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&gz(this.priorityNode_),this.children_.isEmpty()&&Ul(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}static get EMPTY_NODE(){return Sz||(Sz=new Iz(new uz(dz),null,Ez.Default))}isLeafNode(){return!1}getPriority(){return this.priorityNode_||Sz}updatePriority(e){return this.children_.isEmpty()?this:new Iz(this.children_,e,this.indexMap_)}getImmediateChild(e){if(".priority"===e)return this.getPriority();{const t=this.children_.get(e);return null===t?Sz:t}}getChild(e){const t=BH(e);return null===t?this:this.getImmediateChild(t).getChild(jH(e))}hasChild(e){return null!==this.children_.get(e)}updateImmediateChild(e,t){if(Ul(t,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(t);{const n=new iz(e,t);let i,a;t.isEmpty()?(i=this.children_.remove(e),a=this.indexMap_.removeFromIndexes(n,this.children_)):(i=this.children_.insert(e,t),a=this.indexMap_.addToIndexes(n,this.children_));const o=i.isEmpty()?Sz:this.priorityNode_;return new Iz(i,o,a)}}updateChild(e,t){const n=BH(e);if(null===n)return t;{Ul(".priority"!==BH(e)||1===UH(e),".priority must be the last token in a path");const i=this.getImmediateChild(n).updateChild(jH(e),t);return this.updateImmediateChild(n,i)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(e){if(this.isEmpty())return null;const t={};let n=0,i=0,a=!0;if(this.forEachChild(_z,(o,s)=>{t[o]=s.val(e),n++,a&&Iz.INTEGER_REGEXP_.test(o)?i=Math.max(i,Number(o)):a=!1}),!e&&a&&i<2*n){const e=[];for(const n in t)e[n]=t[n];return e}return e&&!this.getPriority().isEmpty()&&(t[".priority"]=this.getPriority().val()),t}hash(){if(null===this.lazyHash_){let e="";this.getPriority().isEmpty()||(e+="priority:"+pz(this.getPriority().val())+":"),this.forEachChild(_z,(t,n)=>{const i=n.hash();""!==i&&(e+=":"+t+":"+i)}),this.lazyHash_=""===e?"":Kj(e)}return this.lazyHash_}getPredecessorChildName(e,t,n){const i=this.resolveIndex_(n);if(i){const n=i.getPredecessorKey(new iz(e,t));return n?n.name:null}return this.children_.getPredecessorKey(e)}getFirstChildName(e){const t=this.resolveIndex_(e);if(t){const e=t.minKey();return e&&e.name}return this.children_.minKey()}getFirstChild(e){const t=this.getFirstChildName(e);return t?new iz(t,this.children_.get(t)):null}getLastChildName(e){const t=this.resolveIndex_(e);if(t){const e=t.maxKey();return e&&e.name}return this.children_.maxKey()}getLastChild(e){const t=this.getLastChildName(e);return t?new iz(t,this.children_.get(t)):null}forEachChild(e,t){const n=this.resolveIndex_(e);return n?n.inorderTraversal(e=>t(e.name,e.node)):this.children_.inorderTraversal(t)}getIterator(e){return this.getIteratorFrom(e.minPost(),e)}getIteratorFrom(e,t){const n=this.resolveIndex_(t);if(n)return n.getIteratorFrom(e,e=>e);{const n=this.children_.getIteratorFrom(e.name,iz.Wrap);let i=n.peek();for(;null!=i&&t.compare(i,e)<0;)n.getNext(),i=n.peek();return n}}getReverseIterator(e){return this.getReverseIteratorFrom(e.maxPost(),e)}getReverseIteratorFrom(e,t){const n=this.resolveIndex_(t);if(n)return n.getReverseIteratorFrom(e,e=>e);{const n=this.children_.getReverseIteratorFrom(e.name,iz.Wrap);let i=n.peek();for(;null!=i&&t.compare(i,e)>0;)n.getNext(),i=n.peek();return n}}compareTo(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===Az?-1:0}withIndex(e){if(e===rz||this.indexMap_.hasIndex(e))return this;{const t=this.indexMap_.addIndex(e,this.children_);return new Iz(this.children_,this.priorityNode_,t)}}isIndexed(e){return e===rz||this.indexMap_.hasIndex(e)}equals(e){if(e===this)return!0;if(e.isLeafNode())return!1;{const t=e;if(this.getPriority().equals(t.getPriority())){if(this.children_.count()===t.children_.count()){const e=this.getIterator(_z),n=t.getIterator(_z);let i=e.getNext(),a=n.getNext();for(;i&&a;){if(i.name!==a.name||!i.node.equals(a.node))return!1;i=e.getNext(),a=n.getNext()}return null===i&&null===a}return!1}return!1}}resolveIndex_(e){return e===rz?null:this.indexMap_.get(e.toString())}}Iz.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;const Az=new class extends Iz{constructor(){super(new uz(dz),Iz.EMPTY_NODE,Ez.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return Iz.EMPTY_NODE}isEmpty(){return!1}};Object.defineProperties(iz,{MIN:{value:new iz(nH,Iz.EMPTY_NODE)},MAX:{value:new iz(iH,Az)}}),sz.__EMPTY_NODE=Iz.EMPTY_NODE,bz.__childrenNodeConstructor=Iz,fz=Az,function(e){yz=e}(Az);function Dz(e,t=null){if(null===e)return Iz.EMPTY_NODE;if("object"==typeof e&&".priority"in e&&(t=e[".priority"]),Ul(null===t||"string"==typeof t||"number"==typeof t||"object"==typeof t&&".sv"in t,"Invalid priority type found: "+typeof t),"object"==typeof e&&".value"in e&&null!==e[".value"]&&(e=e[".value"]),"object"!=typeof e||".sv"in e){return new bz(e,Dz(t))}if(e instanceof Array){let n=Iz.EMPTY_NODE;return cH(e,(t,i)=>{if(wc(e,t)&&"."!==t.substring(0,1)){const e=Dz(i);!e.isLeafNode()&&e.isEmpty()||(n=n.updateImmediateChild(t,e))}}),n.updatePriority(Dz(t))}{const n=[];let i=!1;if(cH(e,(e,t)=>{if("."!==e.substring(0,1)){const a=Dz(t);a.isEmpty()||(i=i||!a.getPriority().isEmpty(),n.push(new iz(e,a)))}}),0===n.length)return Iz.EMPTY_NODE;const a=xz(n,hz,e=>e.name,dz);if(i){const e=xz(n,_z.getCompare());return new Iz(a,Dz(t),new Ez({".priority":e},{".priority":_z}))}return new Iz(a,Dz(t),Ez.Default)}}!function(e){vz=e}(Dz); 4709/** 4710 * @license 4711 * Copyright 2017 Google LLC 4712 * 4713 * Licensed under the Apache License, Version 2.0 (the "License"); 4714 * you may not use this file except in compliance with the License. 4715 * You may obtain a copy of the License at 4716 * 4717 * http://www.apache.org/licenses/LICENSE-2.0 4718 * 4719 * Unless required by applicable law or agreed to in writing, software 4720 * distributed under the License is distributed on an "AS IS" BASIS, 4721 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4722 * See the License for the specific language governing permissions and 4723 * limitations under the License. 4724 */ 4725class Pz extends az{constructor(e){super(),this.indexPath_=e,Ul(!GH(e)&&".priority"!==BH(e),"Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,t){const n=this.extractChild(e.node),i=this.extractChild(t.node),a=n.compareTo(i);return 0===a?aH(e.name,t.name):a}makePost(e,t){const n=Dz(e),i=Iz.EMPTY_NODE.updateChild(this.indexPath_,n);return new iz(t,i)}maxPost(){const e=Iz.EMPTY_NODE.updateChild(this.indexPath_,Az);return new iz(iH,e)}toString(){return zH(this.indexPath_,0).join("/")}} 4726/** 4727 * @license 4728 * Copyright 2017 Google LLC 4729 * 4730 * Licensed under the Apache License, Version 2.0 (the "License"); 4731 * you may not use this file except in compliance with the License. 4732 * You may obtain a copy of the License at 4733 * 4734 * http://www.apache.org/licenses/LICENSE-2.0 4735 * 4736 * Unless required by applicable law or agreed to in writing, software 4737 * distributed under the License is distributed on an "AS IS" BASIS, 4738 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4739 * See the License for the specific language governing permissions and 4740 * limitations under the License. 4741 */const Oz=new class extends az{compare(e,t){const n=e.node.compareTo(t.node);return 0===n?aH(e.name,t.name):n}isDefinedOn(e){return!0}indexedValueChanged(e,t){return!e.equals(t)}minPost(){return iz.MIN}maxPost(){return iz.MAX}makePost(e,t){const n=Dz(e);return new iz(t,n)}toString(){return".value"}}; 4742/** 4743 * @license 4744 * Copyright 2017 Google LLC 4745 * 4746 * Licensed under the Apache License, Version 2.0 (the "License"); 4747 * you may not use this file except in compliance with the License. 4748 * You may obtain a copy of the License at 4749 * 4750 * http://www.apache.org/licenses/LICENSE-2.0 4751 * 4752 * Unless required by applicable law or agreed to in writing, software 4753 * distributed under the License is distributed on an "AS IS" BASIS, 4754 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4755 * See the License for the specific language governing permissions and 4756 * limitations under the License. 4757 */function Mz(e,t,n){return{type:"child_changed",snapshotNode:t,childName:e,oldSnap:n}} 4758/** 4759 * @license 4760 * Copyright 2017 Google LLC 4761 * 4762 * Licensed under the Apache License, Version 2.0 (the "License"); 4763 * you may not use this file except in compliance with the License. 4764 * You may obtain a copy of the License at 4765 * 4766 * http://www.apache.org/licenses/LICENSE-2.0 4767 * 4768 * Unless required by applicable law or agreed to in writing, software 4769 * distributed under the License is distributed on an "AS IS" BASIS, 4770 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4771 * See the License for the specific language governing permissions and 4772 * limitations under the License. 4773 */ 4774class Nz{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=_z}hasStart(){return this.startSet_}isViewFromLeft(){return""===this.viewFrom_?this.startSet_:"l"===this.viewFrom_}getIndexStartValue(){return Ul(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return Ul(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:nH}hasEnd(){return this.endSet_}getIndexEndValue(){return Ul(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return Ul(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:iH}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&""!==this.viewFrom_}getLimit(){return Ul(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===_z}copy(){const e=new Nz;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}}function Rz(e){const t={};if(e.isDefault())return t;let n;if(e.index_===_z?n="$priority":e.index_===Oz?n="$value":e.index_===rz?n="$key":(Ul(e.index_ instanceof Pz,"Unrecognized index type!"),n=e.index_.toString()),t.orderBy=bc(n),e.startSet_){const n=e.startAfterSet_?"startAfter":"startAt";t[n]=bc(e.indexStartValue_),e.startNameSet_&&(t[n]+=","+bc(e.indexStartName_))}if(e.endSet_){const n=e.endBeforeSet_?"endBefore":"endAt";t[n]=bc(e.indexEndValue_),e.endNameSet_&&(t[n]+=","+bc(e.indexEndName_))}return e.limitSet_&&(e.isViewFromLeft()?t.limitToFirst=e.limit_:t.limitToLast=e.limit_),t}function Lz(e){const t={};if(e.startSet_&&(t.sp=e.indexStartValue_,e.startNameSet_&&(t.sn=e.indexStartName_),t.sin=!e.startAfterSet_),e.endSet_&&(t.ep=e.indexEndValue_,e.endNameSet_&&(t.en=e.indexEndName_),t.ein=!e.endBeforeSet_),e.limitSet_){t.l=e.limit_;let n=e.viewFrom_;""===n&&(n=e.isViewFromLeft()?"l":"r"),t.vf=n}return e.index_!==_z&&(t.i=e.index_.toString()),t} 4775/** 4776 * @license 4777 * Copyright 2017 Google LLC 4778 * 4779 * Licensed under the Apache License, Version 2.0 (the "License"); 4780 * you may not use this file except in compliance with the License. 4781 * You may obtain a copy of the License at 4782 * 4783 * http://www.apache.org/licenses/LICENSE-2.0 4784 * 4785 * Unless required by applicable law or agreed to in writing, software 4786 * distributed under the License is distributed on an "AS IS" BASIS, 4787 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4788 * See the License for the specific language governing permissions and 4789 * limitations under the License. 4790 */class Vz extends RH{constructor(e,t,n,i){super(),this.repoInfo_=e,this.onDataUpdate_=t,this.authTokenProvider_=n,this.appCheckTokenProvider_=i,this.log_=Xj("p:rest:"),this.listens_={}}reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,t){return void 0!==t?"tag$"+t:(Ul(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}listen(e,t,n,i){const a=e._path.toString();this.log_("Listen called for "+a+" "+e._queryIdentifier);const o=Vz.getListenId_(e,n),s={};this.listens_[o]=s;const r=Rz(e._queryParams);this.restRequest_(a+".json",r,(e,t)=>{let r=t;if(404===e&&(r=null,e=null),null===e&&this.onDataUpdate_(a,r,!1,n),kc(this.listens_,o)===s){let t;t=e?401===e?"permission_denied":"rest_error:"+e:"ok",i(t,null)}})}unlisten(e,t){const n=Vz.getListenId_(e,t);delete this.listens_[n]}get(e){const t=Rz(e._queryParams),n=e._path.toString(),i=new ac;return this.restRequest_(n+".json",t,(e,t)=>{let a=t;404===e&&(a=null,e=null),null===e?(this.onDataUpdate_(n,a,!1,null),i.resolve(a)):i.reject(new Error(a))}),i.promise}refreshAuthToken(e){}restRequest_(e,t={},n){return t.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([i,a])=>{i&&i.accessToken&&(t.auth=i.accessToken),a&&a.token&&(t.ac=a.token);const o=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+Sc(t);this.log_("Sending REST request for "+o);const s=new XMLHttpRequest;s.onreadystatechange=()=>{if(n&&4===s.readyState){this.log_("REST Response for "+o+" received. status:",s.status,"response:",s.responseText);let e=null;if(s.status>=200&&s.status<300){try{e=yc(s.responseText)}catch(ZNe){eH("Failed to parse JSON response for "+o+": "+s.responseText)}n(null,e)}else 401!==s.status&&404!==s.status&&eH("Got unsuccessful REST response for "+o+" Status: "+s.status),n(s.status);n=null}},s.open("GET",o,!0),s.send()})}} 4791/** 4792 * @license 4793 * Copyright 2017 Google LLC 4794 * 4795 * Licensed under the Apache License, Version 2.0 (the "License");
4796 * you may not use this file except in compliance with the License. 4797 * You may obtain a copy of the License at 4798 * 4799 * http://www.apache.org/licenses/LICENSE-2.0 4800 * 4801 * Unless required by applicable law or agreed to in writing, software 4802 * distributed under the License is distributed on an "AS IS" BASIS, 4803 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4804 * See the License for the specific language governing permissions and 4805 * limitations under the License. 4806 */class qz{constructor(){this.rootNode_=Iz.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)}} 4807/** 4808 * @license 4809 * Copyright 2017 Google LLC 4810 * 4811 * Licensed under the Apache License, Version 2.0 (the "License"); 4812 * you may not use this file except in compliance with the License. 4813 * You may obtain a copy of the License at 4814 * 4815 * http://www.apache.org/licenses/LICENSE-2.0 4816 * 4817 * Unless required by applicable law or agreed to in writing, software 4818 * distributed under the License is distributed on an "AS IS" BASIS, 4819 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4820 * See the License for the specific language governing permissions and 4821 * limitations under the License. 4822 */function Fz(){return{value:null,children:new Map}}function Bz(e,t,n){if(GH(t))e.value=n,e.children.clear();else if(null!==e.value)e.value=e.value.updateChild(t,n);else{const i=BH(t);e.children.has(i)||e.children.set(i,Fz());Bz(e.children.get(i),t=jH(t),n)}}function Uz(e,t,n){null!==e.value?n(t,e.value):function(e,t){e.children.forEach((e,n)=>{t(n,e)})} 4823/** 4824 * @license 4825 * Copyright 2017 Google LLC 4826 * 4827 * Licensed under the Apache License, Version 2.0 (the "License"); 4828 * you may not use this file except in compliance with the License. 4829 * You may obtain a copy of the License at 4830 * 4831 * http://www.apache.org/licenses/LICENSE-2.0 4832 * 4833 * Unless required by applicable law or agreed to in writing, software 4834 * distributed under the License is distributed on an "AS IS" BASIS, 4835 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4836 * See the License for the specific language governing permissions and 4837 * limitations under the License. 4838 */(e,(e,i)=>{Uz(i,new qH(t.toString()+"/"+e),n)})}class jz{constructor(e){this.collection_=e,this.last_=null}get(){const e=this.collection_.get(),t=Object.assign({},e);return this.last_&&cH(this.last_,(e,n)=>{t[e]=t[e]-n}),this.last_=e,t}} 4839/** 4840 * @license 4841 * Copyright 2017 Google LLC 4842 * 4843 * Licensed under the Apache License, Version 2.0 (the "License"); 4844 * you may not use this file except in compliance with the License. 4845 * You may obtain a copy of the License at 4846 * 4847 * http://www.apache.org/licenses/LICENSE-2.0 4848 * 4849 * Unless required by applicable law or agreed to in writing, software 4850 * distributed under the License is distributed on an "AS IS" BASIS, 4851 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4852 * See the License for the specific language governing permissions and 4853 * limitations under the License. 4854 */class Hz{constructor(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new jz(e);const n=1e4+2e4*Math.random();pH(this.reportStats_.bind(this),Math.floor(n))}reportStats_(){const e=this.statsListener_.get(),t={};let n=!1;cH(e,(e,i)=>{i>0&&wc(this.statsToReport_,e)&&(t[e]=i,n=!0)}),n&&this.server_.reportStats(t),pH(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))}} 4855/** 4856 * @license 4857 * Copyright 2017 Google LLC 4858 * 4859 * Licensed under the Apache License, Version 2.0 (the "License"); 4860 * you may not use this file except in compliance with the License. 4861 * You may obtain a copy of the License at 4862 * 4863 * http://www.apache.org/licenses/LICENSE-2.0 4864 * 4865 * Unless required by applicable law or agreed to in writing, software 4866 * distributed under the License is distributed on an "AS IS" BASIS, 4867 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4868 * See the License for the specific language governing permissions and 4869 * limitations under the License. 4870 */var zz,Wz;function Kz(e){return{fromUser:!1,fromServer:!0,queryId:e,tagged:!0}} 4871/** 4872 * @license 4873 * Copyright 2017 Google LLC 4874 * 4875 * Licensed under the Apache License, Version 2.0 (the "License");
4876 * you may not use this file except in compliance with the License. 4877 * You may obtain a copy of the License at 4878 * 4879 * http://www.apache.org/licenses/LICENSE-2.0 4880 * 4881 * Unless required by applicable law or agreed to in writing, software 4882 * distributed under the License is distributed on an "AS IS" BASIS, 4883 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4884 * See the License for the specific language governing permissions and 4885 * limitations under the License. 4886 */(Wz=zz||(zz={}))[Wz.OVERWRITE=0]="OVERWRITE",Wz[Wz.MERGE=1]="MERGE",Wz[Wz.ACK_USER_WRITE=2]="ACK_USER_WRITE",Wz[Wz.LISTEN_COMPLETE=3]="LISTEN_COMPLETE";class Gz{constructor(e,t,n){this.path=e,this.affectedTree=t,this.revert=n,this.type=zz.ACK_USER_WRITE,this.source={fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}operationForChild(e){if(GH(this.path)){if(null!=this.affectedTree.value)return Ul(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{const t=this.affectedTree.subtree(new qH(e));return new Gz(FH(),t,this.revert)}}return Ul(BH(this.path)===e,"operationForChild called for unrelated child."),new Gz(jH(this.path),this.affectedTree,this.revert)}} 4887/** 4888 * @license 4889 * Copyright 2017 Google LLC 4890 * 4891 * Licensed under the Apache License, Version 2.0 (the "License"); 4892 * you may not use this file except in compliance with the License. 4893 * You may obtain a copy of the License at 4894 * 4895 * http://www.apache.org/licenses/LICENSE-2.0 4896 * 4897 * Unless required by applicable law or agreed to in writing, software 4898 * distributed under the License is distributed on an "AS IS" BASIS, 4899 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4900 * See the License for the specific language governing permissions and 4901 * limitations under the License. 4902 */class Yz{constructor(e,t,n){this.source=e,this.path=t,this.snap=n,this.type=zz.OVERWRITE}operationForChild(e){return GH(this.path)?new Yz(this.source,FH(),this.snap.getImmediateChild(e)):new Yz(this.source,jH(this.path),this.snap)}} 4903/** 4904 * @license 4905 * Copyright 2017 Google LLC 4906 * 4907 * Licensed under the Apache License, Version 2.0 (the "License"); 4908 * you may not use this file except in compliance with the License. 4909 * You may obtain a copy of the License at 4910 * 4911 * http://www.apache.org/licenses/LICENSE-2.0 4912 * 4913 * Unless required by applicable law or agreed to in writing, software 4914 * distributed under the License is distributed on an "AS IS" BASIS, 4915 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4916 * See the License for the specific language governing permissions and 4917 * limitations under the License. 4918 */class Qz{constructor(e,t,n){this.source=e,this.path=t,this.children=n,this.type=zz.MERGE}operationForChild(e){if(GH(this.path)){const t=this.children.subtree(new qH(e));return t.isEmpty()?null:t.value?new Yz(this.source,FH(),t.value):new Qz(this.source,FH(),t)}return Ul(BH(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new Qz(this.source,jH(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}} 4919/** 4920 * @license 4921 * Copyright 2017 Google LLC 4922 * 4923 * Licensed under the Apache License, Version 2.0 (the "License"); 4924 * you may not use this file except in compliance with the License. 4925 * You may obtain a copy of the License at 4926 * 4927 * http://www.apache.org/licenses/LICENSE-2.0 4928 * 4929 * Unless required by applicable law or agreed to in writing, software 4930 * distributed under the License is distributed on an "AS IS" BASIS, 4931 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4932 * See the License for the specific language governing permissions and 4933 * limitations under the License. 4934 */class $z{constructor(e,t,n){this.node_=e,this.fullyInitialized_=t,this.filtered_=n}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(GH(e))return this.isFullyInitialized()&&!this.filtered_;const t=BH(e);return this.isCompleteForChild(t)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}}function Xz(e,t,n,i,a,o){const s=i.filter(e=>e.type===n);s.sort((t,n)=>function(e,t,n){if(null==t.childName||null==n.childName)throw jl("Should only compare child_ events.");const i=new iz(t.childName,t.snapshotNode),a=new iz(n.childName,n.snapshotNode);return e.index_.compare(i,a)} 4935/** 4936 * @license 4937 * Copyright 2017 Google LLC 4938 * 4939 * Licensed under the Apache License, Version 2.0 (the "License");
4940 * you may not use this file except in compliance with the License. 4941 * You may obtain a copy of the License at 4942 * 4943 * http://www.apache.org/licenses/LICENSE-2.0 4944 * 4945 * Unless required by applicable law or agreed to in writing, software 4946 * distributed under the License is distributed on an "AS IS" BASIS, 4947 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4948 * See the License for the specific language governing permissions and 4949 * limitations under the License. 4950 */(e,t,n)),s.forEach(n=>{const i=function(e,t,n){return"value"===t.type||"child_removed"===t.type||(t.prevName=n.getPredecessorChildName(t.childName,t.snapshotNode,e.index_)),t}(e,n,o);a.forEach(a=>{a.respondsTo(n.type)&&t.push(a.createEvent(i,e.query_))})})}function Jz(e,t){return{eventCache:e,serverCache:t}}function Zz(e,t,n,i){return Jz(new $z(t,n,i),e.serverCache)}function eW(e,t,n,i){return Jz(e.eventCache,new $z(t,n,i))}function tW(e){return e.eventCache.isFullyInitialized()?e.eventCache.getNode():null}function nW(e){return e.serverCache.isFullyInitialized()?e.serverCache.getNode():null} 4951/** 4952 * @license 4953 * Copyright 2017 Google LLC 4954 * 4955 * Licensed under the Apache License, Version 2.0 (the "License"); 4956 * you may not use this file except in compliance with the License. 4957 * You may obtain a copy of the License at 4958 * 4959 * http://www.apache.org/licenses/LICENSE-2.0 4960 * 4961 * Unless required by applicable law or agreed to in writing, software 4962 * distributed under the License is distributed on an "AS IS" BASIS, 4963 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4964 * See the License for the specific language governing permissions and 4965 * limitations under the License. 4966 */let iW;class aW{constructor(e,t=(()=>(iW||(iW=new uz(oH)),iW))()){this.value=e,this.children=t}static fromObject(e){let t=new aW(null);return cH(e,(e,n)=>{t=t.set(new qH(e),n)}),t}isEmpty(){return null===this.value&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,t){if(null!=this.value&&t(this.value))return{path:FH(),value:this.value};if(GH(e))return null;{const n=BH(e),i=this.children.get(n);if(null!==i){const a=i.findRootMostMatchingPathAndValue(jH(e),t);if(null!=a){return{path:KH(new qH(n),a.path),value:a.value}}return null}return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(e){if(GH(e))return this;{const t=BH(e),n=this.children.get(t);return null!==n?n.subtree(jH(e)):new aW(null)}}set(e,t){if(GH(e))return new aW(t,this.children);{const n=BH(e),i=(this.children.get(n)||new aW(null)).set(jH(e),t),a=this.children.insert(n,i);return new aW(this.value,a)}}remove(e){if(GH(e))return this.children.isEmpty()?new aW(null):new aW(null,this.children);{const t=BH(e),n=this.children.get(t);if(n){const i=n.remove(jH(e));let a;return a=i.isEmpty()?this.children.remove(t):this.children.insert(t,i),null===this.value&&a.isEmpty()?new aW(null):new aW(this.value,a)}return this}}get(e){if(GH(e))return this.value;{const t=BH(e),n=this.children.get(t);return n?n.get(jH(e)):null}}setTree(e,t){if(GH(e))return t;{const n=BH(e),i=(this.children.get(n)||new aW(null)).setTree(jH(e),t);let a;return a=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),new aW(this.value,a)}}fold(e){return this.fold_(FH(),e)}fold_(e,t){const n={};return this.children.inorderTraversal((i,a)=>{n[i]=a.fold_(KH(e,i),t)}),t(e,this.value,n)}findOnPath(e,t){return this.findOnPath_(e,FH(),t)}findOnPath_(e,t,n){const i=!!this.value&&n(t,this.value);if(i)return i;if(GH(e))return null;{const i=BH(e),a=this.children.get(i);return a?a.findOnPath_(jH(e),KH(t,i),n):null}}foreachOnPath(e,t){return this.foreachOnPath_(e,FH(),t)}foreachOnPath_(e,t,n){if(GH(e))return this;{this.value&&n(t,this.value);const i=BH(e),a=this.children.get(i);return a?a.foreachOnPath_(jH(e),KH(t,i),n):new aW(null)}}foreach(e){this.foreach_(FH(),e)}foreach_(e,t){this.children.inorderTraversal((n,i)=>{i.foreach_(KH(e,n),t)}),this.value&&t(e,this.value)}foreachChild(e){this.children.inorderTraversal((t,n)=>{n.value&&e(t,n.value)})}} 4967/** 4968 * @license 4969 * Copyright 2017 Google LLC 4970 * 4971 * Licensed under the Apache License, Version 2.0 (the "License");
4972 * you may not use this file except in compliance with the License. 4973 * You may obtain a copy of the License at 4974 * 4975 * http://www.apache.org/licenses/LICENSE-2.0 4976 * 4977 * Unless required by applicable law or agreed to in writing, software 4978 * distributed under the License is distributed on an "AS IS" BASIS, 4979 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4980 * See the License for the specific language governing permissions and 4981 * limitations under the License. 4982 */class oW{constructor(e){this.writeTree_=e}static empty(){return new oW(new aW(null))}}function sW(e,t,n){if(GH(t))return new oW(new aW(n));{const i=e.writeTree_.findRootMostValueAndPath(t);if(null!=i){const a=i.path;let o=i.value;const s=YH(a,t);return o=o.updateChild(s,n),new oW(e.writeTree_.set(a,o))}{const i=new aW(n),a=e.writeTree_.setTree(t,i);return new oW(a)}}}function rW(e,t,n){let i=e;return cH(n,(e,n)=>{i=sW(i,KH(t,e),n)}),i}function lW(e,t){if(GH(t))return oW.empty();{const n=e.writeTree_.setTree(t,new aW(null));return new oW(n)}}function cW(e,t){return null!=uW(e,t)}function uW(e,t){const n=e.writeTree_.findRootMostValueAndPath(t);return null!=n?e.writeTree_.get(n.path).getChild(YH(n.path,t)):null}function hW(e){const t=[],n=e.writeTree_.value;return null!=n?n.isLeafNode()||n.forEachChild(_z,(e,n)=>{t.push(new iz(e,n))}):e.writeTree_.children.inorderTraversal((e,n)=>{null!=n.value&&t.push(new iz(e,n.value))}),t}function dW(e,t){if(GH(t))return e;{const n=uW(e,t);return new oW(null!=n?new aW(n):e.writeTree_.subtree(t))}}function fW(e){return e.writeTree_.isEmpty()}function pW(e,t){return gW(FH(),e.writeTree_,t)}function gW(e,t,n){if(null!=t.value)return n.updateChild(e,t.value);{let i=null;return t.children.inorderTraversal((t,a)=>{".priority"===t?(Ul(null!==a.value,"Priority writes must always be leaf nodes"),i=a.value):n=gW(KH(e,t),a,n)}),n.getChild(e).isEmpty()||null===i||(n=n.updateChild(KH(e,".priority"),i)),n}} 4983/** 4984 * @license 4985 * Copyright 2017 Google LLC 4986 * 4987 * Licensed under the Apache License, Version 2.0 (the "License"); 4988 * you may not use this file except in compliance with the License. 4989 * You may obtain a copy of the License at 4990 * 4991 * http://www.apache.org/licenses/LICENSE-2.0 4992 * 4993 * Unless required by applicable law or agreed to in writing, software 4994 * distributed under the License is distributed on an "AS IS" BASIS, 4995 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4996 * See the License for the specific language governing permissions and 4997 * limitations under the License. 4998 */function mW(e,t){return AW(t,e)}function vW(e,t){const n=e.allWrites.findIndex(e=>e.writeId===t);Ul(n>=0,"removeWrite called with nonexistent writeId.");const i=e.allWrites[n];e.allWrites.splice(n,1);let a=i.visible,o=!1,s=e.allWrites.length-1;for(;a&&s>=0;){const t=e.allWrites[s];t.visible&&(s>=n&&yW(t,i.path)?a=!1:$H(i.path,t.path)&&(o=!0)),s--}if(a){if(o)return function(e){e.visibleWrites=_W(e.allWrites,bW,FH()),e.allWrites.length>0?e.lastWriteId=e.allWrites[e.allWrites.length-1].writeId:e.lastWriteId=-1}(e),!0;if(i.snap)e.visibleWrites=lW(e.visibleWrites,i.path);else{cH(i.children,t=>{e.visibleWrites=lW(e.visibleWrites,KH(i.path,t))})}return!0}return!1}function yW(e,t){if(e.snap)return $H(e.path,t);for(const n in e.children)if(e.children.hasOwnProperty(n)&&$H(KH(e.path,n),t))return!0;return!1}function bW(e){return e.visible}function _W(e,t,n){let i=oW.empty();for(let a=0;a<e.length;++a){const o=e[a];if(t(o)){const e=o.path;let t;if(o.snap)$H(n,e)?(t=YH(n,e),i=sW(i,t,o.snap)):$H(e,n)&&(t=YH(e,n),i=sW(i,FH(),o.snap.getChild(t)));else{if(!o.children)throw jl("WriteRecord should have .snap or .children");if($H(n,e))t=YH(n,e),i=rW(i,t,o.children);else if($H(e,n))if(t=YH(e,n),GH(t))i=rW(i,FH(),o.children);else{const e=kc(o.children,BH(t));if(e){const n=e.getChild(jH(t));i=sW(i,FH(),n)}}}}}return i}function wW(e,t,n,i,a){if(i||a){const o=dW(e.visibleWrites,t);if(!a&&fW(o))return n;if(a||null!=n||cW(o,FH())){const o=function(e){return(e.visible||a)&&(!i||!~i.indexOf(e.writeId))&&($H(e.path,t)||$H(t,e.path))};return pW(_W(e.allWrites,o,t),n||Iz.EMPTY_NODE)}return null}{const i=uW(e.visibleWrites,t);
4998if(null!=i)return i;{const i=dW(e.visibleWrites,t);if(fW(i))return n;if(null!=n||cW(i,FH())){return pW(i,n||Iz.EMPTY_NODE)}return null}}}function kW(e,t,n,i){return wW(e.writeTree,e.treePath,t,n,i)}function xW(e,t){return function(e,t,n){let i=Iz.EMPTY_NODE;const a=uW(e.visibleWrites,t);if(a)return a.isLeafNode()||a.forEachChild(_z,(e,t)=>{i=i.updateImmediateChild(e,t)}),i;if(n){const a=dW(e.visibleWrites,t);return n.forEachChild(_z,(e,t)=>{const n=pW(dW(a,new qH(e)),t);i=i.updateImmediateChild(e,n)}),hW(a).forEach(e=>{i=i.updateImmediateChild(e.name,e.node)}),i}return hW(dW(e.visibleWrites,t)).forEach(e=>{i=i.updateImmediateChild(e.name,e.node)}),i}(e.writeTree,e.treePath,t)}function TW(e,t,n,i){return function(e,t,n,i,a){Ul(i||a,"Either existingEventSnap or existingServerSnap must exist");const o=KH(t,n);if(cW(e.visibleWrites,o))return null;{const t=dW(e.visibleWrites,o);return fW(t)?a.getChild(n):pW(t,a.getChild(n))}}(e.writeTree,e.treePath,t,n,i)}function CW(e,t){return function(e,t){return uW(e.visibleWrites,t)}(e.writeTree,KH(e.treePath,t))}function EW(e,t,n,i,a,o){return function(e,t,n,i,a,o,s){let r;const l=dW(e.visibleWrites,t),c=uW(l,FH());if(null!=c)r=c;else{if(null==n)return[];r=pW(l,n)}if(r=r.withIndex(s),r.isEmpty()||r.isLeafNode())return[];{const e=[],t=s.getCompare(),n=o?r.getReverseIteratorFrom(i,s):r.getIteratorFrom(i,s);let l=n.getNext();for(;l&&e.length<a;)0!==t(l,i)&&e.push(l),l=n.getNext();return e}}(e.writeTree,e.treePath,t,n,i,a,o)}function SW(e,t,n){return function(e,t,n,i){const a=KH(t,n),o=uW(e.visibleWrites,a);if(null!=o)return o;if(i.isCompleteForChild(n))return pW(dW(e.visibleWrites,a),i.getNode().getImmediateChild(n));return null}(e.writeTree,e.treePath,t,n)}function IW(e,t){return AW(KH(e.treePath,t),e.writeTree)}function AW(e,t){return{treePath:e,writeTree:t}} 4999/** 5000 * @license 5001 * Copyright 2017 Google LLC 5002 * 5003 * Licensed under the Apache License, Version 2.0 (the "License"); 5004 * you may not use this file except in compliance with the License. 5005 * You may obtain a copy of the License at 5006 * 5007 * http://www.apache.org/licenses/LICENSE-2.0 5008 * 5009 * Unless required by applicable law or agreed to in writing, software 5010 * distributed under the License is distributed on an "AS IS" BASIS, 5011 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5012 * See the License for the specific language governing permissions and 5013 * limitations under the License. 5014 */class DW{constructor(){this.changeMap=new Map}trackChildChange(e){const t=e.type,n=e.childName;Ul("child_added"===t||"child_changed"===t||"child_removed"===t,"Only child changes supported for tracking"),Ul(".priority"!==n,"Only non-priority child changes can be tracked.");const i=this.changeMap.get(n);if(i){const o=i.type;if("child_added"===t&&"child_removed"===o)this.changeMap.set(n,Mz(n,e.snapshotNode,i.snapshotNode));else if("child_removed"===t&&"child_added"===o)this.changeMap.delete(n);else if("child_removed"===t&&"child_changed"===o)this.changeMap.set(n,(a=n,{type:"child_removed",snapshotNode:i.oldSnap,childName:a}));else if("child_changed"===t&&"child_added"===o)this.changeMap.set(n,function(e,t){return{type:"child_added",snapshotNode:t,childName:e}}(n,e.snapshotNode));else{if("child_changed"!==t||"child_changed"!==o)throw jl("Illegal combination of changes: "+e+" occurred after "+i);this.changeMap.set(n,Mz(n,e.snapshotNode,i.oldSnap))}}else this.changeMap.set(n,e);var a}getChanges(){return Array.from(this.changeMap.values())}} 5015/** 5016 * @license 5017 * Copyright 2017 Google LLC 5018 * 5019 * Licensed under the Apache License, Version 2.0 (the "License"); 5020 * you may not use this file except in compliance with the License. 5021 * You may obtain a copy of the License at 5022 * 5023 * http://www.apache.org/licenses/LICENSE-2.0 5024 * 5025 * Unless required by applicable law or agreed to in writing, software 5026 * distributed under the License is distributed on an "AS IS" BASIS, 5027 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5028 * See the License for the specific language governing permissions and 5029 * limitations under the License. 5030 */const PW=new class{getCompleteChild(e){return null}getChildAfterChild(e,t,n){return null}};class OW{constructor(e,t,n=null){this.writes_=e,this.viewCache_=t,this.optCompleteServerCache_=n}getCompleteChild(e){const t=this.viewCache_.eventCache;if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);{const t=null!=this.optCompleteServerCache_?new $z(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;
vendor: 6,083 bytes, line 5030
5030return SW(this.writes_,e,t)}}getChildAfterChild(e,t,n){const i=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:nW(this.viewCache_),a=EW(this.writes_,i,t,1,n,e);return 0===a.length?null:a[0]}}function MW(e,t,n,i,a){const o=new DW;let s,r;if(n.type===zz.OVERWRITE){const l=n;l.source.fromUser?s=LW(e,t,l.path,l.snap,i,a,o):(Ul(l.source.fromServer,"Unknown source."),r=l.source.tagged||t.serverCache.isFiltered()&&!GH(l.path),s=RW(e,t,l.path,l.snap,i,a,r,o))}else if(n.type===zz.MERGE){const l=n;l.source.fromUser?s=function(e,t,n,i,a,o,s){let r=t;return i.foreach((i,l)=>{const c=KH(n,i);VW(t,BH(c))&&(r=LW(e,r,c,l,a,o,s))}),i.foreach((i,l)=>{const c=KH(n,i);VW(t,BH(c))||(r=LW(e,r,c,l,a,o,s))}),r}(e,t,l.path,l.children,i,a,o):(Ul(l.source.fromServer,"Unknown source."),r=l.source.tagged||t.serverCache.isFiltered(),s=FW(e,t,l.path,l.children,i,a,r,o))}else if(n.type===zz.ACK_USER_WRITE){const r=n;s=r.revert?function(e,t,n,i,a,o){let s;if(null!=CW(i,n))return t;{const r=new OW(i,t,a),l=t.eventCache.getNode();let c;if(GH(n)||".priority"===BH(n)){let n;if(t.serverCache.isFullyInitialized())n=kW(i,nW(t));else{const e=t.serverCache.getNode();Ul(e instanceof Iz,"serverChildren would be complete if leaf node"),n=xW(i,e)}c=e.filter.updateFullNode(l,n,o)}else{const a=BH(n);let u=SW(i,a,t.serverCache);null==u&&t.serverCache.isCompleteForChild(a)&&(u=l.getImmediateChild(a)),c=null!=u?e.filter.updateChild(l,a,u,jH(n),r,o):t.eventCache.getNode().hasChild(a)?e.filter.updateChild(l,a,Iz.EMPTY_NODE,jH(n),r,o):l,c.isEmpty()&&t.serverCache.isFullyInitialized()&&(s=kW(i,nW(t)),s.isLeafNode()&&(c=e.filter.updateFullNode(c,s,o)))}return s=t.serverCache.isFullyInitialized()||null!=CW(i,FH()),Zz(t,c,s,e.filter.filtersNodes())}}(e,t,r.path,i,a,o):function(e,t,n,i,a,o,s){if(null!=CW(a,n))return t;const r=t.serverCache.isFiltered(),l=t.serverCache;if(null!=i.value){if(GH(n)&&l.isFullyInitialized()||l.isCompleteForPath(n))return RW(e,t,n,l.getNode().getChild(n),a,o,r,s);if(GH(n)){let i=new aW(null);return l.getNode().forEachChild(rz,(e,t)=>{i=i.set(new qH(e),t)}),FW(e,t,n,i,a,o,r,s)}return t}{let c=new aW(null);return i.foreach((e,t)=>{const i=KH(n,e);l.isCompleteForPath(i)&&(c=c.set(e,l.getNode().getChild(i)))}),FW(e,t,n,c,a,o,r,s)}}(e,t,r.path,r.affectedTree,i,a,o)}else{if(n.type!==zz.LISTEN_COMPLETE)throw jl("Unknown operation type: "+n.type);s=function(e,t,n,i,a){const o=t.serverCache,s=eW(t,o.getNode(),o.isFullyInitialized()||GH(n),o.isFiltered());return NW(e,s,n,i,PW,a)}(e,t,n.path,i,o)}const l=o.getChanges();return function(e,t,n){const i=t.eventCache;if(i.isFullyInitialized()){const a=i.getNode().isLeafNode()||i.getNode().isEmpty(),o=tW(e);(n.length>0||!e.eventCache.isFullyInitialized()||a&&!i.getNode().equals(o)||!i.getNode().getPriority().equals(o.getPriority()))&&n.push({type:"value",snapshotNode:tW(t)})}}(t,s,l),{viewCache:s,changes:l}}function NW(e,t,n,i,a,o){const s=t.eventCache;if(null!=CW(i,n))return t;{let r,l;if(GH(n))if(Ul(t.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),t.serverCache.isFiltered()){const n=nW(t),a=xW(i,n instanceof Iz?n:Iz.EMPTY_NODE);r=e.filter.updateFullNode(t.eventCache.getNode(),a,o)}else{const n=kW(i,nW(t));r=e.filter.updateFullNode(t.eventCache.getNode(),n,o)}else{const c=BH(n);if(".priority"===c){Ul(1===UH(n),"Can't have a priority with additional path components");const a=s.getNode();l=t.serverCache.getNode();const o=TW(i,n,a,l);r=null!=o?e.filter.updatePriority(a,o):s.getNode()}else{const u=jH(n);let h;if(s.isCompleteForChild(c)){l=t.serverCache.getNode();const e=TW(i,n,s.getNode(),l);h=null!=e?s.getNode().getImmediateChild(c).updateChild(u,e):s.getNode().getImmediateChild(c)}else h=SW(i,c,t.serverCache);r=null!=h?e.filter.updateChild(s.getNode(),c,h,u,a,o):s.getNode()}}return Zz(t,r,s.isFullyInitialized()||GH(n),e.filter.filtersNodes())}}function RW(e,t,n,i,a,o,s,r){const l=t.serverCache;let c;const u=s?e.filter:e.filter.getIndexedFilter();if(GH(n))c=u.updateFullNode(l.getNode(),i,null);else if(u.filtersNodes()&&!l.isFiltered()){const e=l.getNode().updateChild(n,i);c=u.updateFullNode(l.getNode(),e,null)}else{const e=BH(n);if(!l.isCompleteForPath(n)&&UH(n)>1)return t;const a=jH(n),o=l.getNode().getImmediateChild(e).updateChild(a,i);c=".priority"===e?u.updatePriority(l.getNode(),o):u.updateChild(l.getNode(),e,o,a,PW,null)}const h=eW(t,c,l.isFullyInitialized()||GH(n),u.filtersNodes());return NW(e,h,n,a,new OW(a,h,o),r)}function LW(e,t,n,i,a,o,s){const r=t.eventCache;let l,c;const u=new OW(a,t,o);if(GH(n))c=e.filter.updateFullNode(t.eventCache.getNode(),i,s),l=Zz(t,c,!0,e.filter.filtersNodes());else{const a=BH(n);if(".priority"===a)c=e.filter.updatePriority(t.eventCache.getNode(),i),l=Zz(t,c,r.isFullyInitialized(),r.isFiltered());else{const o=jH(n),c=r.getNode().getImmediateChild(a);let h;if(GH(o))h=i;else{const e=u.getCompleteChild(a);h=null!=e?".priority"===HH(o)&&e.getChild(WH(o)).isEmpty()?e:e.updateChild(o,i):Iz.EMPTY_NODE}if(c.equals(h))l=t;else{l=Zz(t,e.filter.updateChild(r.getNode(),a,h,o,u,s),r.isFullyInitialized(),e.filter.filtersNodes())}}}return l}function VW(e,t){return e.eventCache.isCompleteForChild(t)}function qW(e,t,n){return n.foreach((e,n)=>{t=t.updateChild(e,n)}),t}function FW(e,t,n,i,a,o,s,r){if(t.serverCache.getNode().isEmpty()&&!t.serverCache.isFullyInitialized())return t;let l,c=t;l=GH(n)?i:new aW(null).setTree(n,i);const u=t.serverCache.getNode();return l.children.inorderTraversal((n,i)=>{if(u.hasChild(n)){const l=qW(0,t.serverCache.getNode().getImmediateChild(n),i);c=RW(e,c,new qH(n),l,a,o,s,r)}}),l.children.inorderTraversal((n,i)=>{const l=!t.serverCache.isCompleteForChild(n)&&null===i.value;if(!u.hasChild(n)&&!l){const l=qW(0,t.serverCache.getNode().getImmediateChild(n),i);c=RW(e,c,new qH(n),l,a,o,s,r)}}),c}function BW(e,t){const n=nW(e.viewCache_);return n&&(e.query._queryParams.loadsAllData()||!GH(t)&&!n.getImmediateChild(BH(t)).isEmpty())?n.getChild(t):null}function UW(e,t,n,i){t.type===zz.MERGE&&null!==t.source.queryId&&(Ul(nW(e.viewCache_),"We should always have a full c
5030ache before handling merges"),Ul(tW(e.viewCache_),"Missing event cache, even though we have a server cache"));const a=e.viewCache_,o=MW(e.processor_,a,t,n,i);var s,r;return s=e.processor_,r=o.viewCache,Ul(r.eventCache.getNode().isIndexed(s.filter.getIndex()),"Event snap not indexed"),Ul(r.serverCache.getNode().isIndexed(s.filter.getIndex()),"Server snap not indexed"),Ul(o.viewCache.serverCache.isFullyInitialized()||!a.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),e.viewCache_=o.viewCache,function(e,t,n){const i=e.eventRegistrations_;return function(e,t,n,i){const a=[],o=[];return t.forEach(t=>{var n;"child_changed"===t.type&&e.index_.indexedValueChanged(t.oldSnap,t.snapshotNode)&&o.push((n=t.childName,{type:"child_moved",snapshotNode:t.snapshotNode,childName:n}))}),Xz(e,a,"child_removed",t,i,n),Xz(e,a,"child_added",t,i,n),Xz(e,a,"child_moved",o,i,n),Xz(e,a,"child_changed",t,i,n),Xz(e,a,"value",t,i,n),a}(e.eventGenerator_,t,n,i)} 5031/** 5032 * @license 5033 * Copyright 2017 Google LLC 5034 * 5035 * Licensed under the Apache License, Version 2.0 (the "License"); 5036 * you may not use this file except in compliance with the License. 5037 * You may obtain a copy of the License at 5038 * 5039 * http://www.apache.org/licenses/LICENSE-2.0 5040 * 5041 * Unless required by applicable law or agreed to in writing, software 5042 * distributed under the License is distributed on an "AS IS" BASIS, 5043 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5044 * See the License for the specific language governing permissions and 5045 * limitations under the License. 5046 */(e,o.changes,o.viewCache.eventCache.getNode())}let jW,HW;function zW(e,t,n,i){const a=t.source.queryId;if(null!==a){const o=e.views.get(a);return Ul(null!=o,"SyncTree gave us an op for an invalid query."),UW(o,t,n,i)}{let a=[];for(const o of e.views.values())a=a.concat(UW(o,t,n,i));return a}}function WW(e,t){let n=null;for(const i of e.views.values())n=n||BW(i,t);return n} 5047/** 5048 * @license 5049 * Copyright 2017 Google LLC 5050 * 5051 * Licensed under the Apache License, Version 2.0 (the "License"); 5052 * you may not use this file except in compliance with the License. 5053 * You may obtain a copy of the License at 5054 * 5055 * http://www.apache.org/licenses/LICENSE-2.0 5056 * 5057 * Unless required by applicable law or agreed to in writing, software 5058 * distributed under the License is distributed on an "AS IS" BASIS, 5059 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5060 * See the License for the specific language governing permissions and 5061 * limitations under the License. 5062 */class KW{constructor(e){this.listenProvider_=e,this.syncPointTree_=new aW(null),this.pendingWriteTree_={visibleWrites:oW.empty(),allWrites:[],lastWriteId:-1},this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}function GW(e,t,n,i,a){return function(e,t,n,i,a){Ul(i>e.lastWriteId,"Stacking an older write on top of newer ones"),void 0===a&&(a=!0),e.allWrites.push({path:t,snap:n,writeId:i,visible:a}),a&&(e.visibleWrites=sW(e.visibleWrites,t,n)),e.lastWriteId=i}(e.pendingWriteTree_,t,n,i,a),a?XW(e,new Yz({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},t,n)):[]}function YW(e,t,n=!1){const i=function(e,t){for(let n=0;n<e.allWrites.length;n++){const i=e.allWrites[n];if(i.writeId===t)return i}return null}(e.pendingWriteTree_,t);if(vW(e.pendingWriteTree_,t)){let t=new aW(null);return null!=i.snap?t=t.set(FH(),!0):cH(i.children,e=>{t=t.set(new qH(e),!0)}),XW(e,new Gz(i.path,t,n))}return[]}function QW(e,t,n){return XW(e,new Yz({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t,n))}function $W(e,t,n){const i=e.pendingWriteTree_,a=e.syncPointTree_.findOnPath(t,(e,n)=>{const i=WW(n,YH(e,t));if(i)return i});return wW(i,t,a,n,!0)}function XW(e,t){return JW(t,e.syncPointTree_,null,mW(e.pendingWriteTree_,FH()))}function JW(e,t,n,i){if(GH(e.path))return ZW(e,t,n,i);{const a=t.get(FH());null==n&&null!=a&&(n=WW(a,FH()));let o=[];const s=BH(e.path),r=e.operationForChild(s),l=t.children.get(s);if(l&&r){const e=n?n.getImmediateChild(s):null,t=IW(i,s);o=o.concat(JW(r,l,e,t))}return a&&(o=o.concat(zW(a,e,i,n))),o}}function ZW(e,t,n,i){const a=t.get(FH());null==n&&null!=a&&(n=WW(a,FH()));let o=[];return t.children.inorderTraversal((t,a)=>{const s=n?n.getImmediateChild(t):null,r=IW(i,t),l=e.operationForChild(t);l&&(o=o.concat(ZW(l,a,s,r)))}
vendor: 4,261 bytes, lines 5062-5105
5062),a&&(o=o.concat(zW(a,e,i,n))),o}function eK(e,t){return e.tagToQueryMap.get(t)}function tK(e){const t=e.indexOf("$");return Ul(-1!==t&&t<e.length-1,"Bad queryKey."),{queryId:e.substr(t+1),path:new qH(e.substr(0,t))}}function nK(e,t,n){const i=e.syncPointTree_.get(t);Ul(i,"Missing sync point for query tag that we're tracking");return zW(i,n,mW(e.pendingWriteTree_,t),null)} 5063/** 5064 * @license 5065 * Copyright 2017 Google LLC 5066 * 5067 * Licensed under the Apache License, Version 2.0 (the "License"); 5068 * you may not use this file except in compliance with the License. 5069 * You may obtain a copy of the License at 5070 * 5071 * http://www.apache.org/licenses/LICENSE-2.0 5072 * 5073 * Unless required by applicable law or agreed to in writing, software 5074 * distributed under the License is distributed on an "AS IS" BASIS, 5075 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5076 * See the License for the specific language governing permissions and 5077 * limitations under the License. 5078 */class iK{constructor(e){this.node_=e}getImmediateChild(e){const t=this.node_.getImmediateChild(e);return new iK(t)}node(){return this.node_}}class aK{constructor(e,t){this.syncTree_=e,this.path_=t}getImmediateChild(e){const t=KH(this.path_,e);return new aK(this.syncTree_,t)}node(){return $W(this.syncTree_,this.path_)}}const oK=function(e,t,n){return e&&"object"==typeof e?(Ul(".sv"in e,"Unexpected leaf node or priority contents"),"string"==typeof e[".sv"]?sK(e[".sv"],t,n):"object"==typeof e[".sv"]?rK(e[".sv"],t):void Ul(!1,"Unexpected server value: "+JSON.stringify(e,null,2))):e},sK=function(e,t,n){if("timestamp"===e)return n.timestamp;Ul(!1,"Unexpected server value: "+e)},rK=function(e,t,n){e.hasOwnProperty("increment")||Ul(!1,"Unexpected server value: "+JSON.stringify(e,null,2));const i=e.increment;"number"!=typeof i&&Ul(!1,"Unexpected increment value: "+i);const a=t.node();if(Ul(null!=a,"Expected ChildrenNode.EMPTY_NODE for nulls"),!a.isLeafNode())return i;const o=a.getValue();return"number"!=typeof o?i:o+i},lK=function(e,t,n){return cK(e,new iK(t),n)};function cK(e,t,n){const i=e.getPriority().val(),a=oK(i,t.getImmediateChild(".priority"),n);let o;if(e.isLeafNode()){const i=e,o=oK(i.getValue(),t,n);return o!==i.getValue()||a!==i.getPriority().val()?new bz(o,Dz(a)):e}{const i=e;return o=i,a!==i.getPriority().val()&&(o=o.updatePriority(new bz(a))),i.forEachChild(_z,(e,i)=>{const a=cK(i,t.getImmediateChild(e),n);a!==i&&(o=o.updateImmediateChild(e,a))}),o}} 5079/** 5080 * @license 5081 * Copyright 2017 Google LLC 5082 * 5083 * Licensed under the Apache License, Version 2.0 (the "License"); 5084 * you may not use this file except in compliance with the License. 5085 * You may obtain a copy of the License at 5086 * 5087 * http://www.apache.org/licenses/LICENSE-2.0 5088 * 5089 * Unless required by applicable law or agreed to in writing, software 5090 * distributed under the License is distributed on an "AS IS" BASIS, 5091 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5092 * See the License for the specific language governing permissions and 5093 * limitations under the License. 5094 */class uK{constructor(e="",t=null,n={children:{},childCount:0}){this.name=e,this.parent=t,this.node=n}}function hK(e,t){let n=t instanceof qH?t:new qH(t),i=e,a=BH(n);for(;null!==a;){const e=kc(i.node.children,a)||{children:{},childCount:0};i=new uK(a,i,e),n=jH(n),a=BH(n)}return i}function dK(e){return e.node.value}function fK(e,t){e.node.value=t,yK(e)}function pK(e){return e.node.childCount>0}function gK(e,t){cH(e.node.children,(n,i)=>{t(new uK(n,e,i))})}function mK(e,t,n,i){n&&!i&&t(e),gK(e,e=>{mK(e,t,!0,i)}),n&&i&&t(e)}function vK(e){return new qH(null===e.parent?e.name:vK(e.parent)+"/"+e.name)}function yK(e){null!==e.parent&&function(e,t,n){const i=function(e){return void 0===dK(e)&&!pK(e)}(n),a=wc(e.node.children,t);i&&a?(delete e.node.children[t],e.node.childCount--,yK(e)):i||a||(e.node.children[t]=n.node,e.node.childCount++,yK(e))} 5095/** 5096 * @license 5097 * Copyright 2017 Google LLC 5098 * 5099 * Licensed under the Apache License, Version 2.0 (the "License"); 5100 * you may not use this file except in compliance with the License. 5101 * You may obtain a copy of the License at 5102 * 5103 * http://www.apache.org/licenses/LICENSE-2.0 5104 * 5105 * Unless required by applicable law or agreed to in writing, softw
5105are 5106 * distributed under the License is distributed on an "AS IS" BASIS, 5107 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5108 * See the License for the specific language governing permissions and 5109 * limitations under the License. 5110 */(e.parent,e.name,e)}const bK=/[\[\].#$\/\u0000-\u001F\u007F]/,_K=/[\[\].#$\u0000-\u001F\u007F]/,wK=10485760,kK=function(e){return"string"==typeof e&&0!==e.length&&!bK.test(e)},xK=function(e){return e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),function(e){return"string"==typeof e&&0!==e.length&&!_K.test(e)}(e)},TK=function(e,t,n){const i=n instanceof qH?new XH(n,e):n;if(void 0===t)throw new Error(e+"contains undefined "+ZH(i));if("function"==typeof t)throw new Error(e+"contains a function "+ZH(i)+" with contents = "+t.toString());if(tH(t))throw new Error(e+"contains "+t.toString()+" "+ZH(i));if("string"==typeof t&&t.length>wK/3&&Mc(t)>wK)throw new Error(e+"contains a string greater than "+wK+" utf8 bytes "+ZH(i)+" ('"+t.substring(0,50)+"...')");if(t&&"object"==typeof t){let n=!1,a=!1;if(cH(t,(t,o)=>{if(".value"===t)n=!0;else if(".priority"!==t&&".sv"!==t&&(a=!0,!kK(t)))throw new Error(e+" contains an invalid key ("+t+") "+ZH(i)+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');var s,r;r=t,(s=i).parts_.length>0&&(s.byteLength_+=1),s.parts_.push(r),s.byteLength_+=Mc(r),JH(s),TK(e,o,i),function(e){const t=e.parts_.pop();e.byteLength_-=Mc(t),e.parts_.length>0&&(e.byteLength_-=1)}(i)}),n&&a)throw new Error(e+' contains ".value" child '+ZH(i)+" in addition to actual children.")}}; 5111/** 5112 * @license 5113 * Copyright 2017 Google LLC 5114 * 5115 * Licensed under the Apache License, Version 2.0 (the "License"); 5116 * you may not use this file except in compliance with the License. 5117 * You may obtain a copy of the License at 5118 * 5119 * http://www.apache.org/licenses/LICENSE-2.0 5120 * 5121 * Unless required by applicable law or agreed to in writing, software 5122 * distributed under the License is distributed on an "AS IS" BASIS, 5123 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5124 * See the License for the specific language governing permissions and 5125 * limitations under the License. 5126 */ 5127class CK{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function EK(e,t,n){!function(e,t){let n=null;for(let i=0;i<t.length;i++){const a=t[i],o=a.getPath();null===n||QH(o,n.path)||(e.eventLists_.push(n),n=null),null===n&&(n={events:[],path:o}),n.events.push(a)}n&&e.eventLists_.push(n)}(e,n),function(e,t){e.recursionDepth_++;let n=!0;for(let i=0;i<e.eventLists_.length;i++){const a=e.eventLists_[i];if(a){t(a.path)?(SK(e.eventLists_[i]),e.eventLists_[i]=null):n=!1}}n&&(e.eventLists_=[]);e.recursionDepth_--}(e,e=>$H(e,t)||$H(t,e))}function SK(e){for(let t=0;t<e.events.length;t++){const n=e.events[t];if(null!==n){e.events[t]=null;const i=n.getEventRunner();Yj&&$j("event: "+n.toString()),fH(i)}}} 5128/** 5129 * @license 5130 * Copyright 2017 Google LLC 5131 * 5132 * Licensed under the Apache License, Version 2.0 (the "License"); 5133 * you may not use this file except in compliance with the License. 5134 * You may obtain a copy of the License at 5135 * 5136 * http://www.apache.org/licenses/LICENSE-2.0 5137 * 5138 * Unless required by applicable law or agreed to in writing, software 5139 * distributed under the License is distributed on an "AS IS" BASIS, 5140 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5141 * See the License for the specific language governing permissions and 5142 * limitations under the License. 5143 */class IK{constructor(e,t,n,i){this.repoInfo_=e,this.forceRestClient_=t,this.authTokenProvider_=n,this.appCheckProvider_=i,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new CK,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=Fz(),this.transactionQueueTree_=new uK,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host}}function AK(e,t,n){if(e.stats_=EH(e.repoInfo_),e.forceRestClient_||("object"==typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0)e.server_=new Vz(e.repoInfo_,(t,n,i,a)=>{OK(e,t,n,i,a)},e.authTokenProvider_,e.appCheckProvider_),setTimeout(()=>MK(e,!0),0);else{if(null!=n){if("object"!=typeof n)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{bc(n)}catch(ZNe){throw new Error("Invalid authOverride provided: "+ZNe)}}e.persistentConnection_=new nz(e.repoInfo_,t,(t,n,i,a)=>{OK(e,t,n,i,a)},t=>{MK(e,t)},t=>{!function(e,t){cH(t,(t,n)=>{NK(e,t,n)})}(e,t)},e.authTokenProvider_,e.appCheckProvider_,n),e.server_=e.persistentConnection_}e.authTokenProvider_.addTokenChangeListener(t=>{e.server_.refreshAuthToken(t)}),e.appCheckProvider_.addTokenChangeListener(t=>{e.server_.refreshAppCheckToken(t.token)}),e.statsReporter_=function(e,t){const n=e.toString();return CH[n]||(CH[n]=t()),CH[n]}(e.repoInfo_,()=>new Hz(e.stats_,e.server_)),e.infoData_=new qz,e.infoSyncTree_=new KW({startListening:(t,n,i,a)=>{let o=[];const s=e.infoData_.getNode(t._path);return s.isEmpty()||(o=QW(e.infoSyncTree_,t._path,s),setTimeout(()=>{a("ok")},0)),o},stopListening:()=>{}}),NK(e,"connected",!1),e.serverSyncTree_=new KW({startListening:(t,n,i,a)=>(e.server_.listen(t,i,n,(n,i)=>{const o=a(n,i);EK(e.eventQueue_,t._path,o)}),[]),stopListening:(t,n)=>{e.server_.unlisten(t,n)}})}function DK(e){const t=e.infoData_.getNode(new qH(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+t}function PK(e){return(t=(t={timestamp:DK(e)})||{}).timestamp=t.timestamp||(new Date).getTime(),t;var t}function OK(e,t,n,i,a){e.dataUpdateCount++;const o=new qH(t);n=e.interceptServerDataCallback_?e.interceptServerDataCallback_(t,n):n;let s=[];if(a)if(i){const t=Tc(n,e=>Dz(e));s=function(e,t,n,i){const a=eK(e,i);if(a){const i=tK(a),o=i.path,s=i.queryId,r=YH(o,t),l=aW.fromObject(n);return nK(e,o,new Qz(Kz(s),r,l))}return[]}(e.serverSyncTree_,o,t,a)}else{const t=Dz(n);s=function(e,t,n,i){const a=eK(e,i);if(null!=a){const i=tK(a),o=i.path,s=i.queryId,r=YH(o,t);return nK(e,o,new Yz(Kz(s),r,n))}return[]}(e.serverSyncTree_,o,t,a)}else if(i){const t=Tc(n,e=>Dz(e));s=function(e,t,n){const i=aW.fromObject(n);return XW(e,new Qz({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t,i))}(e.serverSyncTree_,o,t)}else{const t=Dz(n);s=QW(e.serverSyncTree_,o,t)}let r=o;s.length>0&&(r=FK(e,o)),EK(e.eventQueue_,r,s)}function MK(e,t){NK(e,"connected",t),!1===t&&function(e){LK(e,"onDisconnectEvents");const t=PK(e),n=Fz();Uz(e.onDisconnect_,FH(),(i,a)=>{const o=function(e,t,n,i){return cK(t,new aK(n,e),i)}(i,a,e.serverSyncTree_,t);Bz(n,i,o)});let i=[];Uz(n,FH(),(t,n)=>{i=i.concat(QW(e.serverSyncTree_,t,n));const a=function(e,t){const n=vK(BK(e,t)),i=hK(e.transactionQueueTree_,t);return function(e,t){let n=e.parent;for(;null!==n;){if(t(n))return!0;n=n.parent}}(i,t=>{zK(e,t)}),zK(e,i),mK(i,t=>{zK(e,t)}),n}(e,t);FK(e,a)}),e.onDisconnect_=Fz(),EK(e.eventQueue_,FH(),i)}(e)}function NK(e,t,n){const i=new qH("/.info/"+t),a=Dz(n);e.infoData_.updateSnapshot(i,a);const o=QW(e.infoSyncTree_,i,a);EK(e.eventQueue_,i,o)}function RK(e){return e.nextWriteId_++}function LK(e,...t){let n="";e.persistentConnection_&&(n=e.persistentConnection_.id+":"),$j(n,...t)}
5143function VK(e,t,n){return $W(e.serverSyncTree_,t,n)||Iz.EMPTY_NODE}function qK(e,t=e.transactionQueueTree_){if(t||HK(e,t),dK(t)){const n=UK(e,t);Ul(n.length>0,"Sending zero length transaction queue");n.every(e=>0===e.status)&&function(e,t,n){const i=n.map(e=>e.currentWriteId),a=VK(e,t,i);let o=a;const s=a.hash();for(let c=0;c<n.length;c++){const e=n[c];Ul(0===e.status,"tryToSendTransactionQueue_: items in queue should all be run."),e.status=1,e.retryCount++;const i=YH(t,e.path);o=o.updateChild(i,e.currentOutputSnapshotRaw)}const r=o.val(!0),l=t;e.server_.put(l.toString(),r,i=>{LK(e,"transaction put response",{path:l.toString(),status:i});let a=[];if("ok"===i){const i=[];for(let t=0;t<n.length;t++)n[t].status=2,a=a.concat(YW(e.serverSyncTree_,n[t].currentWriteId)),n[t].onComplete&&i.push(()=>n[t].onComplete(null,!0,n[t].currentOutputSnapshotResolved)),n[t].unwatcher();HK(e,hK(e.transactionQueueTree_,t)),qK(e,e.transactionQueueTree_),EK(e.eventQueue_,t,a);for(let e=0;e<i.length;e++)fH(i[e])}else{if("datastale"===i)for(let e=0;e<n.length;e++)3===n[e].status?n[e].status=4:n[e].status=0;else{eH("transaction at "+l.toString()+" failed: "+i);for(let e=0;e<n.length;e++)n[e].status=4,n[e].abortReason=i}FK(e,t)}},s)}(e,vK(t),n)}else pK(t)&&gK(t,t=>{qK(e,t)})}function FK(e,t){const n=BK(e,t),i=vK(n);return function(e,t,n){if(0===t.length)return;const i=[];let a=[];const o=t.filter(e=>0===e.status),s=o.map(e=>e.currentWriteId);for(let r=0;r<t.length;r++){const o=t[r],l=YH(n,o.path);let c,u=!1;if(Ul(null!==l,"rerunTransactionsUnderNode_: relativePath should not be null."),4===o.status)u=!0,c=o.abortReason,a=a.concat(YW(e.serverSyncTree_,o.currentWriteId,!0));else if(0===o.status)if(o.retryCount>=25)u=!0,c="maxretry",a=a.concat(YW(e.serverSyncTree_,o.currentWriteId,!0));else{const n=VK(e,o.path,s);o.currentInputSnapshot=n;const i=t[r].update(n.val());if(void 0!==i){TK("transaction failed: Data returned ",i,o.path);let t=Dz(i);"object"==typeof i&&null!=i&&wc(i,".priority")||(t=t.updatePriority(n.getPriority()));const r=o.currentWriteId,l=PK(e),c=lK(t,n,l);o.currentOutputSnapshotRaw=t,o.currentOutputSnapshotResolved=c,o.currentWriteId=RK(e),s.splice(s.indexOf(r),1),a=a.concat(GW(e.serverSyncTree_,o.path,c,o.currentWriteId,o.applyLocally)),a=a.concat(YW(e.serverSyncTree_,r,!0))}else u=!0,c="nodata",a=a.concat(YW(e.serverSyncTree_,o.currentWriteId,!0))}EK(e.eventQueue_,n,a),a=[],u&&(t[r].status=2,function(e){setTimeout(e,Math.floor(0))}(t[r].unwatcher),t[r].onComplete&&("nodata"===c?i.push(()=>t[r].onComplete(null,!1,t[r].currentInputSnapshot)):i.push(()=>t[r].onComplete(new Error(c),!1,null))))}HK(e,e.transactionQueueTree_);for(let r=0;r<i.length;r++)fH(i[r]);qK(e,e.transactionQueueTree_)}(e,UK(e,n),i),i}function BK(e,t){let n,i=e.transactionQueueTree_;for(n=BH(t);null!==n&&void 0===dK(i);)i=hK(i,n),n=BH(t=jH(t));return i}function UK(e,t){const n=[];return jK(e,t,n),n.sort((e,t)=>e.order-t.order),n}function jK(e,t,n){const i=dK(t);if(i)for(let a=0;a<i.length;a++)n.push(i[a]);gK(t,t=>{jK(e,t,n)})}function HK(e,t){const n=dK(t);if(n){let e=0;for(let t=0;t<n.length;t++)2!==n[t].status&&(n[e]=n[t],e++);n.length=e,fK(t,n.length>0?n:void 0)}gK(t,t=>{HK(e,t)})}function zK(e,t){const n=dK(t);if(n){const i=[];let a=[],o=-1;for(let t=0;t<n.length;t++)3===n[t].status||(1===n[t].status?(Ul(o===t-1,"All SENT items should be at beginning of queue."),o=t,n[t].status=3,n[t].abortReason="set"):(Ul(0===n[t].status,"Unexpected transaction status in abort"),n[t].unwatcher(),a=a.concat(YW(e.serverSyncTree_,n[t].currentWriteId,!0)),n[t].onComplete&&i.push(n[t].onComplete.bind(null,new Error("set"),!1,null))));-1===o?fK(t,void 0):n.length=o+1,EK(e.eventQueue_,vK(t),a);for(let e=0;e<i.length;e++)fH(i[e])}} 5144/** 5145 * @license 5146 * Copyright 2017 Google LLC 5147 * 5148 * Licensed under the Apache License, Version 2.0 (the "License"); 5149 * you may not use this file except in compliance with the License. 5150 * You may obtain a copy of the License at 5151 * 5152 * http://www.apache.org/licenses/LICENSE-2.0 5153 * 5154 * Unless required by applicable law or agreed to in writing, software 5155 * distributed under the License is distributed on an "AS IS" BASIS, 5156 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5157 * See the License for the specific language governing permissions and 5158 * limitations under the License. 5159 */const WK=function(e,t){const n=KK(e),i=n.namespace;"firebase.com"===n.domain&&Zj(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),i&&"undefined"!==i||"localhost"===n.domain||Zj("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&eH("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");const a="ws"===n.scheme||"wss"===n.scheme;return{repoInfo:new wH(n.host,n.secure,i,a,t,"",i!==n.subdomain),path:new qH(n.pathString)}},KK=function(e){let t="",n="",i="",a="",o="",s=!0,r="https",l=443;if("string"==typeof e){let c=e.indexOf("//");c>=0&&(r=e.substring(0,c-1),e=e.substring(c+2));let u=e.indexOf("/");-1===u&&(u=e.length);let h=e.indexOf("?");-1===h&&(h=e.length),t=e.substring(0,Math.min(u,h)),u<h&&(a=function(e){let t="";const n=e.split("/");for(let i=0;i<n.length;i++)if(n[i].length>0){let e=n[i];try{e=decodeURIComponent(e.replace(/\+/g," "))}catch(ZNe){}t+="/"+e}return t}(e.substring(u,h)));const d=function(e){const t={};"?"===e.charAt(0)&&(e=e.substring(1));for(const n of e.split("&")){if(0===n.length)continue;const i=n.split("=");
51592===i.length?t[decodeURIComponent(i[0])]=decodeURIComponent(i[1]):eH("Invalid query segment '".concat(n,"' in query '").concat(e,"'"))}return t}(e.substring(Math.min(e.length,h)));c=t.indexOf(":"),c>=0?(s="https"===r||"wss"===r,l=parseInt(t.substring(c+1),10)):c=t.length;const f=t.slice(0,c);if("localhost"===f.toLowerCase())n="localhost";else if(f.split(".").length<=2)n=f;else{const e=t.indexOf(".");i=t.substring(0,e).toLowerCase(),n=t.substring(e+1),o=i}"ns"in d&&(o=d.ns)}return{host:t,port:l,domain:n,subdomain:i,secure:s,scheme:r,pathString:a,namespace:o}}; 5160/** 5161 * @license 5162 * Copyright 2020 Google LLC 5163 * 5164 * Licensed under the Apache License, Version 2.0 (the "License"); 5165 * you may not use this file except in compliance with the License. 5166 * You may obtain a copy of the License at 5167 * 5168 * http://www.apache.org/licenses/LICENSE-2.0 5169 * 5170 * Unless required by applicable law or agreed to in writing, software 5171 * distributed under the License is distributed on an "AS IS" BASIS, 5172 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5173 * See the License for the specific language governing permissions and 5174 * limitations under the License. 5175 */ 5176class GK{constructor(e,t,n,i){this._repo=e,this._path=t,this._queryParams=n,this._orderByCalled=i}get key(){return GH(this._path)?null:HH(this._path)}get ref(){return new YK(this._repo,this._path)}get _queryIdentifier(){const e=Lz(this._queryParams),t=rH(e);return"{}"===t?"default":t}get _queryObject(){return Lz(this._queryParams)}isEqual(e){if(!((e=Rc(e))instanceof GK))return!1;const t=this._repo===e._repo,n=QH(this._path,e._path),i=this._queryIdentifier===e._queryIdentifier;return t&&n&&i}toJSON(){return this.toString()}toString(){return this._repo.toString()+function(e){let t="";for(let n=e.pieceNum_;n<e.pieces_.length;n++)""!==e.pieces_[n]&&(t+="/"+encodeURIComponent(String(e.pieces_[n])));return t||"/"}(this._path)}}class YK extends GK{constructor(e,t){super(e,t,new Nz,!1)}get parent(){const e=WH(this._path);return null===e?null:new YK(this._repo,e)}get root(){let e=this;for(;null!==e.parent;)e=e.parent;return e}}!function(e){Ul(!jW,"__referenceConstructor has already been defined"),jW=e}(YK),function(e){Ul(!HW,"__referenceConstructor has already been defined"),HW=e}(YK); 5177/** 5178 * @license 5179 * Copyright 2020 Google LLC 5180 * 5181 * Licensed under the Apache License, Version 2.0 (the "License"); 5182 * you may not use this file except in compliance with the License. 5183 * You may obtain a copy of the License at 5184 * 5185 * http://www.apache.org/licenses/LICENSE-2.0 5186 * 5187 * Unless required by applicable law or agreed to in writing, software 5188 * distributed under the License is distributed on an "AS IS" BASIS, 5189 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5190 * See the License for the specific language governing permissions and 5191 * limitations under the License. 5192 */ 5193const QK={};let $K=!1;function XK(e,t,n,i,a){let o=i||e.options.databaseURL;void 0===o&&(e.options.projectId||Zj("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),$j("Using default host for project ",e.options.projectId),o="".concat(e.options.projectId,"-default-rtdb.firebaseio.com"));let s,r=WK(o,a),l=r.repoInfo;"undefined"!=typeof process&&Rj&&(s=Rj.FIREBASE_DATABASE_EMULATOR_HOST),s?(o="http://".concat(s,"?ns=").concat(l.namespace),r=WK(o,a),l=r.repoInfo):r.repoInfo.secure;const c=new mH(e.name,e.options,t);!function(e,t){const n=t.path.toString();if("string"!=typeof t.repoInfo.host||0===t.repoInfo.host.length||!kK(t.repoInfo.namespace)&&"localhost"!==t.repoInfo.host.split(":")[0]||0!==n.length&&!xK(n))throw new Error(function(e,t){return"".concat(e," failed: ").concat(t," argument ")}(e,"url")+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')}("Invalid Firebase Database URL",r),GH(r.path)||Zj("Database URL must point to the root of a Firebase Database (not including a child path).");const u=function(e,t,n,i){let a=QK[t.name];a||(a={},QK[t.name]=a);let o=a[e.toURLString()];o&&Zj("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.");return o=new IK(e,$K,n,i),a[e.toURLString()]=o,o}(l,e,c,new gH(e.name,n));return new JK(u,e)}class JK{constructor(e,t){this._repoInternal=e,this.app=t,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(AK(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new YK(this._repo,FH())),this._rootInternal}_delete(){return null!==this._rootInternal&&(!function(e,t){const n=QK[t];n&&n[e.key]===e||Zj("Database ".concat(t,"(").concat(e.repoInfo_,") has already been deleted.")),function(e){e.persistentConnection_&&e.persistentConnection_.interrupt("repo_interrupt")}(e),delete n[e.key]}(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){null===this._rootInternal&&Zj("Cannot call "+e+" on a deleted database.")}} 5194/** 5195 * @license 5196 * Copyright 2021 Google LLC 5197 * 5198 * Licensed under the Apache License, Version 2.0 (the "License");
5199 * you may not use this file except in compliance with the License. 5200 * You may obtain a copy of the License at 5201 * 5202 * http://www.apache.org/licenses/LICENSE-2.0 5203 * 5204 * Unless required by applicable law or agreed to in writing, software 5205 * distributed under the License is distributed on an "AS IS" BASIS, 5206 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5207 * See the License for the specific language governing permissions and 5208 * limitations under the License. 5209 */nz.prototype.simpleListen=function(e,t){this.sendRequest("q",{p:e},t)},nz.prototype.echo=function(e,t){this.sendRequest("echo",{d:e},t)},function(e){qj=Ju,Gu(new Lc("database",(e,{instanceIdentifier:t})=>XK(e.getProvider("app").getImmediate(),e.getProvider("auth-internal"),e.getProvider("app-check-internal"),t),"PUBLIC").setMultipleInstances(!0)),th(Lj,Vj,e),th(Lj,Vj,"esm2017")}();const ZK=new WeakMap;function eG(e,t){return ZK.has(t)||ZK.set(t,{f:{},r:{},s:{},u:{}}),ZK.get(t)}function tG(e,t,n,i){if(!e)return n;const[a,o]=nG(e);if(!a)return n;const s=eG(0,i)[a]||{},r=t||o;return r&&r in s?s[r]:n}function nG(e){return Nj(e)||Mj(t=e)&&"query"===t.type?["f",e.path]:function(e){return Mj(e)&&"ref"in e}(e)?["r",e.toString()]:function(e){return Mj(e)&&"string"==typeof e.bucket}(e)?["s",e.toString()]:[];var t}const iG=new WeakMap;function aG(e,t,n){const i=Pj();iG.has(i)||iG.set(i,new Map);const a=iG.get(i),o=function(e,t,n,i){if(!e)return;const[a,o]=nG(e);if(!a)return;const s=eG(0,i)[a],r=o;return r?(n.then(e=>{s[r]=e}).catch(Oj),r):void 0}(t,0,e,i);return o&&a.set(o,e),o?()=>a.delete(o):Oj}function oG(e){return sj(Pj(e))}function sG(e){const t=Mt(e),n=It();n.value=tG(t,void 0,n.value,Pj());const i=At(Promise.resolve(null));let a=Oj;function o(){const t=Mt(e);var a;return i.value=t?(a=t,QU(a=Rc(a))).then(e=>n.value=e).catch(()=>null):Promise.resolve(n.value=null),i.value}return o(),(St(e)||"function"==typeof e)&&pa(e,o),t&&(a=aG(i.value,t)),re()&&le(a),ao()&&oi(()=>i.value),{url:n,refresh:o,promise:i}}function rG(e){const t=Mt(e),n=At();t&&(n.value=tG(t,"m "+t.toString(),n.value,Pj()));const i=At(Promise.resolve(null));let a=Oj;function o(){const t=Mt(e);return i.value=t?aj(t).then(e=>n.value=e).catch(()=>null):Promise.resolve(n.value=null),i.value}return o(),St(e)&&pa(e,o),t&&(a=aG(i.value,t)),re()&&le(a),ao()&&oi(()=>i.value),{metadata:n,update:function(t){const a=Mt(e);return a&&(i.value=function(e,t){return YU(e=Rc(e),t)}(a,t).then(e=>n.value=e)),i.value},refresh:o,promise:i}}function lG(e){const{url:t,refresh:n}=sG(e),{metadata:i,update:a,refresh:o}=rG(e),s=At(),r=At(),l=At(),c=bo(()=>{const e=Mt(r);return e?e.bytesTransferred/e.totalBytes:null});let u=Oj;function h(){return Promise.all([n(),o()])}return(St(e)||"function"==typeof e)&&pa(e,e=>{e||(s.value&&(u(),s.value.cancel()),s.value=null,r.value=null),h()}),re()&&le(u),{url:t,metadata:i,snapshot:r,uploadTask:s,uploadError:l,uploadProgress:c,upload:function(a,o){const c=Mt(e),h=Mt(s);if(h&&h.cancel(),l.value=null,r.value=null,s.value=null,t.value=null,i.value=null,u(),c){const e=ij(c,a,o);return s.value=e,r.value=e.snapshot,u=e.on("state_changed",e=>{r.value=e}),e.then(e=>{i.value=e.metadata,n()}).catch(e=>(l.value=e,Promise.reject(e))).finally(()=>{u(),s.value=null})}},updateMetadata:a,refresh:h}}var cG={},uG={};let hG;const dG=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];uG.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},uG.getSymbolTotalCodewords=function(e){return dG[e]},uG.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},uG.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');hG=e},uG.isKanjiModeEnabled=function(){return void 0!==hG},uG.toSJIS=function(e){return hG(e)};var fG,pG={};function gG(){this.buffer=[],this.length=0}(fG=pG).L={bit:1},fG.M={bit:0},fG.Q={bit:3},fG.H={bit:2},fG.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},fG.from=function(e,t){if(fG.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return fG.L;case"m":case"medium":return fG.M;case"q":case"quartile":return fG.Q;case"h":case"high":return fG.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(ZNe){return t}},gG.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var mG=gG;function vG(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}vG.prototype.set=function(e,t,n,i){const a=e*this.size+t;this.data[a]=n,i&&(this.reservedBit[a]=!0)},vG.prototype.get=function(e,t){return this.data[e*this.size+t]},vG.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},vG.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var yG=vG,bG={};!function(e){const t=uG.getSymbolSize;e.getRowColCoords=function(e){if(1===e)return[];const n=Math.floor(e/7)+2,i=t(e),a=145===i?26:2*Math.ceil((i-13)/(2*n-2)),o=[i-7];for(let t=1;t<n-1;t++)o[t]=o[t-1]-a;return o.push(6),o.reverse()},e.getPositions=function(t){const n=[],i=e.getRowColCoords(t),a=i.length;for(let e=0;e<a;e++)for(let t=0;t<a;t++)0===e&&0===t||0===e&&t===a-1||e===a-1&&0===t||n.push([i[e],i[t]]);return n}}(bG);var _G={};const wG=uG.getSymbolSize;_G.getPositions=function(e){const t=wG(e);return[[0,0],[t-7,0],[0,t-7]]};var kG={};!function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t=3,n=3,i=40,a=10;function o(t,n,i){switch(t){case e.Patterns.PATTERN000:return(n+i)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return i%3==0;case e.Patterns.PATTERN011:return(n+i)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(i/3))%2==0;case e.Patterns.PATTERN101:return n*i%2+n*i%3==0;case e.Patterns.PATTERN110:return(n*i%2+n*i%3)%2==0;case e.Patterns.PATTERN111:return(n*i%3+(n+i)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}e.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){const n=e.size;let i=0,a=0,o=0,s=null,r=null;for(let l=0;l<n;l++){a=o=0,s=r=null;for(let c=0;c<n;c++){let n=e.get(l,c);n===s?a++:(a>=5&&(i+=t+(a-5)),s=n,a=1),n=e.get(c,l),n===r?o++:(o>=5&&(i+=t+(o-5)),r=n,o=1)}a>=5&&(i+=t+(a-5)),o>=5&&(i+=t+(o-5))}return i},e.getPenaltyN2=function(e){const t=e.size;let i=0;for(let n=0;n<t-1;n++)for(let a=0;a<t-1;a++){const t=e.get(n,a)+e.get(n,a+1)+e.get(n+1,a)+e.get(n+1,a+1);4!==t&&0!==t||i++}return i*n},e.getPenaltyN3=function(e){const t=e.size;let n=0,a=0,o=0;for(let i=0;i<t;i++){a=o=0;for(let s=0;s<t;s++)a=a<<1&2047|e.get(i,s),s>=10&&(1488===a||93===a)&&n++,o=o<<1&2047|e.get(s,i),s>=10&&(1488===o||93===o)&&n++}return n*i},e.getPenaltyN4=function(e){let t=0;const n=e.data.length;for(let i=0;i<n;i++)t+=e.data[i];return Math.abs(Math.ceil(100*t/n/5)-10)*a},e.applyMask=function(e,t){const n=t.size;
5209for(let i=0;i<n;i++)for(let a=0;a<n;a++)t.isReserved(a,i)||t.xor(a,i,o(e,a,i))},e.getBestMask=function(t,n){const i=Object.keys(e.Patterns).length;let a=0,o=1/0;for(let s=0;s<i;s++){n(s),e.applyMask(s,t);const i=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(s,t),i<o&&(o=i,a=s)}return a}}(kG);var xG={};const TG=pG,CG=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],EG=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];xG.getBlocksCount=function(e,t){switch(t){case TG.L:return CG[4*(e-1)+0];case TG.M:return CG[4*(e-1)+1];case TG.Q:return CG[4*(e-1)+2];case TG.H:return CG[4*(e-1)+3];default:return}},xG.getTotalCodewordsCount=function(e,t){switch(t){case TG.L:return EG[4*(e-1)+0];case TG.M:return EG[4*(e-1)+1];case TG.Q:return EG[4*(e-1)+2];case TG.H:return EG[4*(e-1)+3];default:return}};var SG={},IG={};const AG=new Uint8Array(512),DG=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)AG[t]=e,DG[e]=t,e<<=1,256&e&&(e^=285);for(let t=255;t<512;t++)AG[t]=AG[t-255]}(),IG.log=function(e){if(e<1)throw new Error("log("+e+")");return DG[e]},IG.exp=function(e){return AG[e]},IG.mul=function(e,t){return 0===e||0===t?0:AG[DG[e]+DG[t]]},function(e){const t=IG;e.mul=function(e,n){const i=new Uint8Array(e.length+n.length-1);for(let a=0;a<e.length;a++)for(let o=0;o<n.length;o++)i[a+o]^=t.mul(e[a],n[o]);return i},e.mod=function(e,n){let i=new Uint8Array(e);for(;i.length-n.length>=0;){const e=i[0];for(let o=0;o<n.length;o++)i[o]^=t.mul(n[o],e);let a=0;for(;a<i.length&&0===i[a];)a++;i=i.slice(a)}return i},e.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let a=0;a<n;a++)i=e.mul(i,new Uint8Array([1,t.exp(a)]));return i}}(SG);const PG=SG;function OG(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}OG.prototype.initialize=function(e){this.degree=e,this.genPoly=PG.generateECPolynomial(this.degree)},OG.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=PG.mod(t,this.genPoly),i=this.degree-n.length;if(i>0){const e=new Uint8Array(this.degree);return e.set(n,i),e}return n};var MG=OG,NG={},RG={},LG={isValid:function(e){return!isNaN(e)&&e>=1&&e<=40}},VG={};const qG="[0-9]+";let FG="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";FG=FG.replace(/u/g,"\\u");const BG="(?:(?![A-Z0-9 $%*+\\-./:]|"+FG+")(?:.|[\r\n]))+";VG.KANJI=new RegExp(FG,"g"),VG.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),VG.BYTE=new RegExp(BG,"g"),VG.NUMERIC=new RegExp(qG,"g"),VG.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const UG=new RegExp("^"+FG+"$"),jG=new RegExp("^"+qG+"$"),HG=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");VG.testKanji=function(e){return UG.test(e)},VG.testNumeric=function(e){return jG.test(e)},VG.testAlphanumeric=function(e){return HG.test(e)},function(e){const t=LG,n=VG;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!t.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},e.isValid=function(e){return e&&e.bit&&e.ccBits},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(ZNe){return n}}}
vendor: 13,369 bytes, line 5209
5209(RG),function(e){const t=uG,n=xG,i=pG,a=RG,o=LG,s=t.getBCHDigit(7973);function r(e,t){return a.getCharCountIndicator(e,t)+4}function l(e,t){let n=0;return e.forEach(function(e){const i=r(e.mode,t);n+=i+e.getBitsLength()}),n}e.from=function(e,t){return o.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,i,s){if(!o.isValid(e))throw new Error("Invalid QR Code version");void 0===s&&(s=a.BYTE);const l=8*(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,i));if(s===a.MIXED)return l;const c=l-r(s,e);switch(s){case a.NUMERIC:return Math.floor(c/10*3);case a.ALPHANUMERIC:return Math.floor(c/11*2);case a.KANJI:return Math.floor(c/13);case a.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(t,n){let o;const s=i.from(n,i.M);if(Array.isArray(t)){if(t.length>1)return function(t,n){for(let i=1;i<=40;i++)if(l(t,i)<=e.getCapacity(i,n,a.MIXED))return i}(t,s);if(0===t.length)return 1;o=t[0]}else o=t;return function(t,n,i){for(let a=1;a<=40;a++)if(n<=e.getCapacity(a,i,t))return a}(o.mode,o.getLength(),s)},e.getEncodedBits=function(e){if(!o.isValid(e)||e<7)throw new Error("Invalid QR Code version");let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=7973<<t.getBCHDigit(n)-s;return e<<12|n}}(NG);var zG={};const WG=uG,KG=WG.getBCHDigit(1335);zG.getEncodedBits=function(e,t){const n=e.bit<<3|t;let i=n<<10;for(;WG.getBCHDigit(i)-KG>=0;)i^=1335<<WG.getBCHDigit(i)-KG;return 21522^(n<<10|i)};var GG={};const YG=RG;function QG(e){this.mode=YG.NUMERIC,this.data=e.toString()}QG.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},QG.prototype.getLength=function(){return this.data.length},QG.prototype.getBitsLength=function(){return QG.getBitsLength(this.data.length)},QG.prototype.write=function(e){let t,n,i;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),i=parseInt(n,10),e.put(i,10);const a=this.data.length-t;a>0&&(n=this.data.substr(t),i=parseInt(n,10),e.put(i,3*a+1))};var $G=QG;const XG=RG,JG=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function ZG(e){this.mode=XG.ALPHANUMERIC,this.data=e}ZG.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},ZG.prototype.getLength=function(){return this.data.length},ZG.prototype.getBitsLength=function(){return ZG.getBitsLength(this.data.length)},ZG.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=45*JG.indexOf(this.data[t]);n+=JG.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(JG.indexOf(this.data[t]),6)};var eY=ZG;const tY=RG;function nY(e){this.mode=tY.BYTE,this.data="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}nY.getBitsLength=function(e){return 8*e},nY.prototype.getLength=function(){return this.data.length},nY.prototype.getBitsLength=function(){return nY.getBitsLength(this.data.length)},nY.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};var iY=nY;const aY=RG,oY=uG;function sY(e){this.mode=aY.KANJI,this.data=e}sY.getBitsLength=function(e){return 13*e},sY.prototype.getLength=function(){return this.data.length},sY.prototype.getBitsLength=function(){return sY.getBitsLength(this.data.length)},sY.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=oY.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),e.put(n,13)}};var rY,lY=sY,cY={exports:{}},uY=cY.exports=rY={single_source_shortest_paths:function(e,t,n){var i={},a={};a[t]=0;var o,s,r,l,c,u,h,d=rY.PriorityQueue.make();for(d.push(t,0);!d.empty();)for(r in s=(o=d.pop()).value,l=o.cost,c=e[s]||{})c.hasOwnProperty(r)&&(u=l+c[r],h=a[r],(void 0===a[r]||h>u)&&(a[r]=u,d.push(r,u),i[r]=s));if(void 0!==n&&void 0===a[n]){var f=["Could not find a path from ",t," to ",n,"."].join("");throw new Error(f)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],i=t;i;)n.push(i),e[i],i=e[i];return n.reverse(),n},find_path:function(e,t,n){var i=rY.single_source_shortest_paths(e,t,n);return rY.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(e){var t,n=rY.PriorityQueue,i={};for(t in e=e||{},n)n.hasOwnProperty(t)&&(i[t]=n[t]);return i.queue=[],i.sorter=e.sorter||n.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};!function(e){const t=RG,n=$G,i=eY,a=iY,o=lY,s=VG,r=uG,l=uY;function c(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){const i=[];let a;for(;null!==(a=e.exec(n));)i.push({data:a[0],index:a.index,mode:t,length:a[0].length});return i}function h(e){const n=u(s.NUMERIC,t.NUMERIC,e),i=u(s.ALPHANUMERIC,t.ALPHANUMERIC,e);let a,o;r.isKanjiModeEnabled()?(a=u(s.BYTE,t.BYTE,e),o=u(s.KANJI,t.KANJI,e)):(a=u(s.BYTE_KANJI,t.BYTE,e),o=[]);return n.concat(i,a,o).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function d(e,s){switch(s){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return i.getBitsLength(e);case t.KANJI:return o.getBitsLength(e);case t.BYTE:return a.getBitsLength(e)}}function f(e,s){let l;const c=t.getBestModeForData(e);if(l=t.from(s,c),l!==t.BYTE&&l.bit<c.bit)throw new Error('"'+e+'" cannot be encoded with mode '+t.toString(l)+".\n Suggested mode is: "+t.toString(c));switch(l!==t.KANJI||r.isKanjiModeEnabled()||(l=t.BYTE),l){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new i(e);case t.KANJI:return new o(e);case t.BYTE:return new a(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(f(t,null)):t.data&&e.push(f(t.data,t.mode)),e},[])},e.fromString=function(n,i){const a=function(e){const n=[];for(let i=0;i<e.length;i++){const a=e[i];switch(a.mode){case t.NUMERIC:n.push([a,{data:a.data,mode:t.ALPHANUMERIC,length:a.length},{data:a.data,mode:t.BYTE,length:a.length}]);break;case t.ALPHANUMERIC:n.push([a,{data:a.data,mode:t.BYTE,length:a.length}]);break;case t.KANJI:n.push([a,{data:a.data,mode:t.BYTE,length:c(a.data)}]);break;case t.BYTE:n.push([{data:a.data,mode:t.BYTE,length:c(a.data)}])}}return n}(h(n,r.isKanjiModeEnabled())),o=function(e,n){const i={},a={start:{}};let o=["start"];for(let s=0;s<e.length;s++){const r=e[s],l=[];for(let e=0;e<r.length;e++){const c=r[e],u=""+s+e;l.push(u),i[u]={node:c,lastCount:0},a[u]={};for(let e=0;e<o.length;e++){const s=o[e];i[s]&&i[s].node.mode===c.mode?(a[s][u]=d(i[s].lastCount+c.length,c.mode)-d(i[s].lastCount,c.mode),i[s].lastCount+=c.length):(i[s]&&(i[s].lastCount=c.length),a[s][u]=d(c.length,c.mode)+4+t.getCharCountIndicator(c.mode,n))}}o=l}for(let t=0;t<o.length;t++)a[o[t]].end=0;return{map:a,table:i}}(a,i),s=l.find_path(o.map,"start","end"),u=[];for(let e=1;e<s.length-1;e++)u.push(o.table[s[e]].node);return e.fromArray(function(e){return e.reduce(function(e,t){const n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}(u))},e.rawSplit=function(t){return e.fromArray(h(t,r.isKanjiModeEnabled()))}}(GG);const hY=uG,dY=pG,fY=mG,pY=yG,gY=bG,mY=_G,vY=kG,yY=xG,bY=MG,_Y=NG,wY=zG,kY=RG,xY=GG;function TY(e,t,n){const i=e.size,a=wY.getEncodedBits(t,n);let o,s;for(o=0;o<15;o++)s=1==(a>>o&1),o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(i-15+o,8,s,!0),o<8?e.set(8,i-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(i-8,8,1,!0)}function CY(e,t,n){const i=new fY;n.forEach(function(t){i.put(t.mode.bit,4),i.put(t.getLength(),kY.getCharCountIndicator(t.mode,e)),t.write(i)});const a=8*(hY.getSymbolTotalCodewords(e)-yY.getTotalCodewordsCount(e,t));for(i.getLengthInBits()+4<=a&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const o=(a-i.getLengthInBits())/8;for(let s=0;s<o;s++)i.put(s%2?17:236,8);return function(e,t,n){const i=hY.getSymbolTotalCodewords(t),a=yY.getTotalCodewordsCount(t,n),o=i-a,s=yY.getBlocksCount(t,n),r=i%s,l=s-r,c=Math.floor(i/s),u=Math.floor(o/s),h=u+1,d=c-u,f=new bY(d);let p=0;const g=new Array(s),m=new Array(s);let v=0;const y=new Uint8Array(e.buffer);for(let x=0;x<s;x++){const e=x<l?u:h;g[x]=y.slice(p,p+e),m[x]=f.encode(g[x]),p+=e,v=Math.max(v,e)}const b=new Uint8Array(i);let _,w,k=0;for(_=0;_<v;_++)for(w=0;w<s;w++)_<g[w].length&&(b[k++]=g[w][_]);for(_=0;_<d;_++)for(w=0;w<s;w++)b[k++]=m[w][_];return b}(i,e,t)}function EY(e,t,n,i){let a;if(Array.isArray(e))a=xY.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let i=t;if(!i){const t=xY.rawSplit(e);i=_Y.getBestVersionForData(t,n)}a=xY.fromString(e,i||40)}}const o=_Y.getBestVersionForData(a,n);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<o)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+o+".\n")}else t=o;const s=CY(t,n,a),r=hY.getSymbolSize(t),l=new pY(r);return function(e,t){const n=e.size,i=mY.getPositions(t);for(let a=0;a<i.length;a++){const t=i[a][0],o=i[a][1];for(let i=-1;i<=7;i++)if(!(t+i<=-1||n<=t+i))for(let a=-1;a<=7;a++)o+a<=-1||n<=o+a||(i>=0&&i<=6&&(0===a||6===a)||a>=0&&a<=6&&(0===i||6===i)||i>=2&&i<=4&&a>=2&&a<=4?e.set(t+i,o+a,!0,!0):e.set(t+i,o+a,!1,!0))}}(l,t),function(e){const t=e.size;for(let n=8;n<t-8;n++){const t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}(l),function(e,t){const n=gY.getPositions(t);for(let i=0;i<n.length;i++){const t=n[i][0],a=n[i][1];for(let n=-2;n<=2;n++)for(let i=-2;i<=2;i++)-2===n||2===n||-2===i||2===i||0===n&&0===i?e.set(t+n,a+i,!0,!0):e.set(t+n,a+i,!1,!0)}}(l,t),TY(l,n,0),t>=7&&function(e,t){const n=e.size,i=_Y.getEncodedBits(t);let a,o,s;for(let r=0;r<18;r++)a=Math.floor(r/3),o=r%3+n-8-3,s=1==(i>>r&1),e.set(a,o,s,!0),e.set(o,a,s,!0)}(l,t),function(e,t){const n=e.size;let i=-1,a=n-1,o=7,s=0;for(let r=n-1;r>0;r-=2)for(6===r&&r--;;){for(let n=0;n<2;n++)if(!e.isReserved(a,r-n)){let i=!1;s<t.length&&(i=1==(t[s]>>>o&1)),e.set(a,r-n,i),o--,-1===o&&(s++,o=7)}if(a+=i,a<0||n<=a){a-=i,i=-i;break}}}(l,s),isNaN(i)&&(i=vY.getBestMask(l,TY.bind(null,l,n))),vY.applyMask(i,l),TY(l,n,i),{modules:l,version:t,errorCorrectionLevel:n,maskPattern:i,segments:a}}cG.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let n,i,a=dY.M;return void 0!==t&&(a=dY.from(t.errorCorrectionLevel,dY.M),n=_Y.from(t.version),i=vY.from(t.maskPattern),t.toSJISFunc&&hY.setToSJISFunction(t.toSJISFunc)),EY(e,n,a,i)};var SY={},IY={};!function(e){function t(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");const n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+t.slice(0,6).join("")}}e.getOptions=function(e){e||(e={}),e.color||(e.color={});const n=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,i=e.width&&e.width>=21?e.width:void 0,a=e.scale||4;return{width:i,scale:i?4:a,margin:n,color:{dark:t(e.color.dark||"#000000ff"),light:t(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},e.getImageWidth=function(t,n){const i=e.getScale(t,n);return Math.floor((t+2*n.margin)*i)},e.qrToImageData=function(t,n,i){const a=n.modules.size,o=n.modules.data,s=e.getScale(a,i),r=Math.floor((a+2*i.margin)*s),l=i.margin*s,c=[i.color.light,i.color.dark];for(let e=0;e<r;e++)for(let n=0;n<r;n++){let u=4*(e*r+n),h=i.color.light;if(e>=l&&n>=l&&e<r-l&&n<r-l){h=c[o[Math.floor((e-l)/s)*a+Math.floor((n-l)/s)]?1:0]}t[u++]=h.r,t[u++]=h.g,t[u++]=h.b,t[u]=h.a}}}(IY),function(e){const t=IY;e.render=function(e,n,i){let a=i,o=n;void 0!==a||n&&n.getContext||(a=n,n=void 0),n||(o=function(){try{return document.createElement("canvas")}catch(ZNe){throw new Error("You need to specify a canvas element")}}()),a=t.getOptions(a);const s=t.getImageWidth(e.modules.size,a),r=o.getContext("2d"),l=r.createImageData(s,s);return t.qrToImageData(l.data,e,a),function(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}(r,o,s),r.putImageData(l,0,0),o},e.renderToDataURL=function(t,n,i){let a=i;void 0!==a||n&&n.getContext||(a=n,n=void 0),a||(a={});const o=e.render(t,n,a),s=a.type||"image/png",r=a.rendererOpts||{};return o.toDataURL(s,r.quality)}}(SY);var AY={};const DY=IY;function PY(e,t){const n=e.a/255,i=t+'="'+e.hex+'"';return n<1?i+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':i}function OY(e,t,n){let i=e+t;return void 0!==n&&(i+=" "+n),i}AY.render=function(e,t,n){const i=DY.getOptions(t),a=e.modules.size,o=e.modules.data,s=a+2*i.margin,r=i.color.light.a?"<path "+PY(i.color.light,"fill")+' d="M0 0h'+s+"v"+s+'H0z"/>':"",l="<path "+PY(i.color.dark,"stroke")+' d="'+function(e,t,n){let i="",a=0,o=!1,s=0;for(let r=0;r<e.length;r++){const l=Math.floor(r%t),c=Math.floor(r/t);l||o||(o=!0),e[r]?(s++,r>0&&l>
52090&&e[r-1]||(i+=o?OY("M",l+n,.5+c+n):OY("m",a,0),a=0,o=!1),l+1<t&&e[r+1]||(i+=OY("h",s),s=0)):a++}return i}(o,a,i.margin)+'"/>',c='viewBox="0 0 '+s+" "+s+'"',u='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+c+' shape-rendering="crispEdges">'+r+l+"</svg>\n";return"function"==typeof n&&n(null,u),u};const MY=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},NY=cG,RY=SY,LY=AY;function VY(e,t,n,i,a){const o=[].slice.call(arguments,1),s=o.length,r="function"==typeof o[s-1];if(!r&&!MY())throw new Error("Callback required as last argument");if(!r){if(s<1)throw new Error("Too few arguments provided");return 1===s?(n=t,t=i=void 0):2!==s||t.getContext||(i=n,n=t,t=void 0),new Promise(function(a,o){try{const o=NY.create(n,i);a(e(o,t,i))}catch(ZNe){o(ZNe)}})}if(s<2)throw new Error("Too few arguments provided");2===s?(a=n,n=t,t=i=void 0):3===s&&(t.getContext&&void 0===a?(a=i,i=void 0):(a=i,i=n,n=t,t=void 0));try{const o=NY.create(n,i);a(null,e(o,t,i))}catch(ZNe){a(ZNe)}}NY.create;var qY=VY.bind(null,RY.render),FY=VY.bind(null,RY.renderToDataURL),BY=VY.bind(null,function(e,t,n){return LY.render(e,n)}); 5210/*! vue-qrcode v2.0.0 | (c) 2018-present Chen Fengyuan | MIT */ 5211const UY="ready";var jY=jn({name:"VueQrcode",props:{value:{type:String,default:void 0},options:{type:Object,default:void 0},tag:{type:String,default:"canvas"}},emits:[UY],watch:{$props:{deep:!0,immediate:!0,handler(){this.$el&&this.generate()}}},mounted(){this.generate()},methods:{generate(){const e=this.options||{},t=String(this.value),n=()=>{this.$emit(UY,this.$el)};switch(this.tag){case"canvas":qY(this.$el,t,e,e=>{if(e)throw e;n()});break;case"img":FY(t,e,(e,t)=>{if(e)throw e;this.$el.src=t,this.$el.onload=n});break;case"svg":BY(t,e,(e,t)=>{if(e)throw e;const i=document.createElement("div");i.innerHTML=t;const a=i.querySelector("svg");if(a){const{attributes:e,childNodes:t}=a;Object.keys(e).forEach(t=>{const n=e[Number(t)];this.$el.setAttribute(n.name,n.value)}),Object.keys(t).forEach(e=>{const n=t[Number(e)];this.$el.appendChild(n.cloneNode(!0))}),n()}})}}},render(){return _o(this.tag,this.$slots.default)}});const HY=Js("holiday",{state:()=>({items:[],loading:!1,error:null}),actions:{async fetchItems(){this.loading=!0;try{const e=await vT("holidays");this.items=e}catch(eRe){this.error=eRe.message}finally{this.loading=!1}},async fetchItemById(e){try{return await yT("holidays",e)}catch(eRe){throw eRe}},async addItem(e){try{const t=await _T("holidays",{...e,created_at:new Date});return this.items.push({id:t.id,...e}),t}catch(eRe){throw eRe}},async updateItem(e,t){try{await wT("holidays",e,{...t,updated_at:new Date});const n=this.items.findIndex(t=>t.id===e);-1!==n&&(this.items[n]={...this.items[n],...t})}catch(eRe){throw eRe}},async deleteItem(e){try{await kT("holidays",e),this.items=this.items.filter(t=>t.id!==e)}catch(eRe){throw eRe}}}});function zY(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function WY(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function KY(e,t){const n=zY(e);return isNaN(t)?WY(e,NaN):t?(n.setDate(n.getDate()+t),n):n}function GY(e,t){const n=zY(e);if(isNaN(t))return WY(e,NaN);if(!t)return n;const i=n.getDate(),a=WY(e,n.getTime());a.setMonth(n.getMonth()+t+1,0);return i>=a.getDate()?a:(n.setFullYear(a.getFullYear(),a.getMonth(),i),n)}function YY(e,t){const{years:n=0,months:i=0,weeks:a=0,days:o=0,hours:s=0,minutes:r=0,seconds:l=0}=t,c=zY(e),u=i||n?GY(c,i+12*n):c,h=1e3*(l+60*(r+60*s));return WY(e,(o||a?KY(u,o+7*a):u).getTime()+h)}function QY(e,t){return WY(e,+zY(e)+t)}const $Y=6048e5,XY=36e5;let JY={};function ZY(){return JY}function eQ(e,t){var n,i,a,o,s,r,l,c;const u=ZY(),h=null!=(c=null!=(l=null!=(o=null!=(a=null==t?void 0:t.weekStartsOn)?a:null==(i=null==(n=null==t?void 0:t.locale)?void 0:n.options)?void 0:i.weekStartsOn)?o:u.weekStartsOn)?l:null==(r=null==(s=u.locale)?void 0:s.options)?void 0:r.weekStartsOn)?c:0,d=zY(e),f=d.getDay(),p=(f<h?7:0)+f-h;return d.setDate(d.getDate()-p),d.setHours(0,0,0,0),d}function tQ(e){return eQ(e,{weekStartsOn:1}
5211)}function nQ(e){const t=zY(e),n=t.getFullYear(),i=WY(e,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const a=tQ(i),o=WY(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const s=tQ(o);return t.getTime()>=a.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function iQ(e){const t=zY(e);return t.setHours(0,0,0,0),t}function aQ(e){const t=zY(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function oQ(e,t){const n=iQ(e),i=iQ(t),a=+n-aQ(n),o=+i-aQ(i);return Math.round((a-o)/864e5)}function sQ(e,t){return QY(e,6e4*t)}function rQ(e,t){return GY(e,3*t)}function lQ(e,t){return GY(e,12*t)}function cQ(e,t){const n=zY(e),i=zY(t),a=n.getTime()-i.getTime();return a<0?-1:a>0?1:a}function uQ(e,t){return+iQ(e)===+iQ(t)}function hQ(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function dQ(e){if(!hQ(e)&&"number"!=typeof e)return!1;const t=zY(e);return!isNaN(Number(t))}function fQ(e){const t=zY(e);return Math.trunc(t.getMonth()/3)+1}function pQ(e){const t=zY(e);return t.setHours(23,59,59,999),t}function gQ(e,t){const n=zY(e),i=zY(t),a=cQ(n,i),o=Math.abs(function(e,t){const n=zY(e),i=zY(t);return n.getFullYear()-i.getFullYear()}(n,i));n.setFullYear(1584),i.setFullYear(1584);const s=a*(o-+(cQ(n,i)===-a));return 0===s?0:s}function mQ(e,t){const n=zY(e.start),i=zY(e.end);let a=+n>+i;const o=a?+n:+i,s=a?i:n;s.setHours(0,0,0,0);const r=[];for(;+s<=o;)r.push(zY(s)),s.setDate(s.getDate()+1),s.setHours(0,0,0,0);return a?r.reverse():r}function vQ(e){const t=zY(e),n=t.getMonth(),i=n-n%3;return t.setMonth(i,1),t.setHours(0,0,0,0),t}function yQ(e){const t=zY(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}function bQ(e){const t=zY(e),n=WY(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function _Q(e,t){var n,i,a,o,s,r,l,c;const u=ZY(),h=null!=(c=null!=(l=null!=(o=null!=(a=null==t?void 0:t.weekStartsOn)?a:null==(i=null==(n=null==t?void 0:t.locale)?void 0:n.options)?void 0:i.weekStartsOn)?o:u.weekStartsOn)?l:null==(r=null==(s=u.locale)?void 0:s.options)?void 0:r.weekStartsOn)?c:0,d=zY(e),f=d.getDay(),p=6+(f<h?-7:0)-(f-h);return d.setDate(d.getDate()+p),d.setHours(23,59,59,999),d}function wQ(e){const t=zY(e),n=t.getMonth(),i=n-n%3+3;return t.setMonth(i,0),t.setHours(23,59,59,999),t}const kQ={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function xQ(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const TQ={date:xQ({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:xQ({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:xQ({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},CQ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function EQ(e){return(t,n)=>{let i;if("formatting"===((null==n?void 0:n.context)?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,a=(null==n?void 0:n.width)?String(n.width):t;i=e.formattingValues[a]||e.formattingValues[t]}else{const t=e.defaultWidth,a=(null==n?void 0:n.width)?String(n.width):e.defaultWidth;i=e.values[a]||e.values[t]}return i[e.argumentCallback?e.argumentCallback(t):t]}}function SQ(e){return(t,n={})=>{const i=n.width,a=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(a);if(!o)return null;const s=o[0],r=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(r)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(r,e=>e.test(s)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(r,e=>e.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(s.length)}}}var IQ;const AQ={code:"en-US",formatDistance:(e,t,n)=>{let i;const a=kQ[e];return i="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),(null==n?void 0:n.addSuffix)?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:TQ,formatRelative:(e,t,n,i)=>CQ[e],localize:{ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:EQ({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:EQ({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:EQ({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:EQ({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
5211ay","Saturday"]},defaultWidth:"wide"}),dayPeriod:EQ({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(IQ={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(IQ.matchPattern);if(!n)return null;const i=n[0],a=e.match(IQ.parsePattern);if(!a)return null;let o=IQ.valueCallback?IQ.valueCallback(a[0]):a[0];return o=t.valueCallback?t.valueCallback(o):o,{value:o,rest:e.slice(i.length)}}),era:SQ({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:SQ({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:SQ({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:SQ({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:SQ({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function DQ(e){const t=zY(e),n=+tQ(t)-+function(e){const t=nQ(e),n=WY(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),tQ(n)}(t);return Math.round(n/$Y)+1}function PQ(e,t){var n,i,a,o,s,r,l,c;const u=zY(e),h=u.getFullYear(),d=ZY(),f=null!=(c=null!=(l=null!=(o=null!=(a=null==t?void 0:t.firstWeekContainsDate)?a:null==(i=null==(n=null==t?void 0:t.locale)?void 0:n.options)?void 0:i.firstWeekContainsDate)?o:d.firstWeekContainsDate)?l:null==(r=null==(s=d.locale)?void 0:s.options)?void 0:r.firstWeekContainsDate)?c:1,p=WY(e,0);p.setFullYear(h+1,0,f),p.setHours(0,0,0,0);const g=eQ(p,t),m=WY(e,0);m.setFullYear(h,0,f),m.setHours(0,0,0,0);const v=eQ(m,t);return u.getTime()>=g.getTime()?h+1:u.getTime()>=v.getTime()?h:h-1}function OQ(e,t){const n=zY(e),i=+eQ(n,t)-+function(e,t){var n,i,a,o,s,r,l,c;const u=ZY(),h=null!=(c=null!=(l=null!=(o=null!=(a=null==t?void 0:t.firstWeekContainsDate)?a:null==(i=null==(n=null==t?void 0:t.locale)?void 0:n.options)?void 0:i.firstWeekContainsDate)?o:u.firstWeekContainsDate)?l:null==(r=null==(s=u.locale)?void 0:s.options)?void 0:r.firstWeekContainsDate)?c:1,d=PQ(e,t),f=WY(e,0);return f.setFullYear(d,0,h),f.setHours(0,0,0,0),eQ(f,t)}(n,t);return Math.round(i/$Y)+1}function MQ(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const NQ={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return MQ("yy"===t?i%100:i,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):MQ(n+1,2)},d:(e,t)=>MQ(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];
vendor: 4,907 bytes, line 5211
5211default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>MQ(e.getHours()%12||12,t.length),H:(e,t)=>MQ(e.getHours(),t.length),m:(e,t)=>MQ(e.getMinutes(),t.length),s:(e,t)=>MQ(e.getSeconds(),t.length),S(e,t){const n=t.length,i=e.getMilliseconds();return MQ(Math.trunc(i*Math.pow(10,n-3)),t.length)}},RQ="midnight",LQ="noon",VQ="morning",qQ="afternoon",FQ="evening",BQ="night",UQ={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),i=t>0?t:1-t;return n.ordinalNumber(i,{unit:"year"})}return NQ.y(e,t)},Y:function(e,t,n,i){const a=PQ(e,i),o=a>0?a:1-a;if("YY"===t){return MQ(o%100,2)}return"Yo"===t?n.ordinalNumber(o,{unit:"year"}):MQ(o,t.length)},R:function(e,t){return MQ(nQ(e),t.length)},u:function(e,t){return MQ(e.getFullYear(),t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return MQ(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return MQ(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return NQ.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return MQ(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const a=OQ(e,i);return"wo"===t?n.ordinalNumber(a,{unit:"week"}):MQ(a,t.length)},I:function(e,t,n){const i=DQ(e);return"Io"===t?n.ordinalNumber(i,{unit:"week"}):MQ(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):NQ.d(e,t)},D:function(e,t,n){const i=function(e){const t=zY(e);return oQ(t,bQ(t))+1}(e);return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):MQ(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const a=e.getDay(),o=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return MQ(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const a=e.getDay(),o=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return MQ(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),a=0===i?7:i;switch(t){case"i":return String(a);case"ii":return MQ(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let a;switch(a=12===i?LQ:0===i?RQ:i/12>
vendor: 3,349 bytes, line 5211
5211=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let a;switch(a=i>=17?FQ:i>=12?qQ:i>=4?VQ:BQ,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return NQ.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):NQ.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return"Ko"===t?n.ordinalNumber(i,{unit:"hour"}):MQ(i,t.length)},k:function(e,t,n){let i=e.getHours();return 0===i&&(i=24),"ko"===t?n.ordinalNumber(i,{unit:"hour"}):MQ(i,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):NQ.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):NQ.s(e,t)},S:function(e,t){return NQ.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return HQ(i);case"XXXX":case"XX":return zQ(i);default:return zQ(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return HQ(i);case"xxxx":case"xx":return zQ(i);default:return zQ(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+jQ(i,":");default:return"GMT"+zQ(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+jQ(i,":");default:return"GMT"+zQ(i,":")}},t:function(e,t,n){return MQ(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return MQ(e.getTime(),t.length)}};function jQ(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),a=Math.trunc(i/60),o=i%60;return 0===o?n+String(a):n+String(a)+t+MQ(o,2)}function HQ(e,t){if(e%60==0){return(e>0?"-":"+")+MQ(Math.abs(e)/60,2)}return zQ(e,t)}function zQ(e,t=""){const n=e>0?"-":"+",i=Math.abs(e);return n+MQ(Math.trunc(i/60),2)+t+MQ(i%60,2)}const WQ=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},KQ=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},GQ={p:KQ,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return WQ(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"})}return o.replace("{{date}}",WQ(i,t)).replace("{{time}}",KQ(a,t))}},YQ=/^D+$/,QQ=/^Y+$/,$Q=["D","DD","YY","YYYY"];function XQ(e){return YQ.test(e)}function JQ(e){return QQ.test(e)}function ZQ(e,t,n){const i=function(e,t,n){const i="Y"===e[0]?"years":"days of the month";return"Use `".concat(e.toLowerCase(),"` instead of `").concat(e,"` (in `").concat(t,"`) for formatting ").concat(i," to the input `").
5211concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md")}(e,t,n);if($Q.includes(e))throw new RangeError(i)}const e$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,t$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,n$=/^'([^]*?)'?$/,i$=/''/g,a$=/[a-zA-Z]/;function o$(e,t,n){var i,a,o,s,r,l,c,u,h,d,f,p,g,m,v,y,b,_;const w=ZY(),k=null!=(a=null!=(i=null==n?void 0:n.locale)?i:w.locale)?a:AQ,x=null!=(d=null!=(h=null!=(l=null!=(r=null==n?void 0:n.firstWeekContainsDate)?r:null==(s=null==(o=null==n?void 0:n.locale)?void 0:o.options)?void 0:s.firstWeekContainsDate)?l:w.firstWeekContainsDate)?h:null==(u=null==(c=w.locale)?void 0:c.options)?void 0:u.firstWeekContainsDate)?d:1,T=null!=(_=null!=(b=null!=(m=null!=(g=null==n?void 0:n.weekStartsOn)?g:null==(p=null==(f=null==n?void 0:n.locale)?void 0:f.options)?void 0:p.weekStartsOn)?m:w.weekStartsOn)?b:null==(y=null==(v=w.locale)?void 0:v.options)?void 0:y.weekStartsOn)?_:0,C=zY(e);if(!dQ(C))throw new RangeError("Invalid time value");let E=t.match(t$).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,GQ[t])(e,k.formatLong)}return e}).join("").match(e$).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:s$(e)};if(UQ[t])return{isToken:!0,value:e};if(t.match(a$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});k.localize.preprocessor&&(E=k.localize.preprocessor(C,E));const S={firstWeekContainsDate:x,weekStartsOn:T,locale:k};return E.map(i=>{if(!i.isToken)return i.value;const a=i.value;(!(null==n?void 0:n.useAdditionalWeekYearTokens)&&JQ(a)||!(null==n?void 0:n.useAdditionalDayOfYearTokens)&&XQ(a))&&ZQ(a,t,String(e));return(0,UQ[a[0]])(C,a,k.localize,S)}).join("")}function s$(e){const t=e.match(n$);return t?t[1].replace(i$,"'"):e}function r$(e){const t=zY(e),n=t.getFullYear(),i=t.getMonth(),a=WY(e,0);return a.setFullYear(n,i+1,0),a.setHours(0,0,0,0),a.getDate()}function l$(e){return zY(e).getHours()}function c$(e){return zY(e).getMinutes()}function u$(e){return zY(e).getMonth()}function h$(e){return zY(e).getSeconds()}function d$(e){return zY(e).getFullYear()}function f$(e,t){const n=zY(e),i=zY(t);return n.getTime()>i.getTime()}function p$(e,t){return+zY(e)<+zY(t)}function g$(e,t){return+zY(e)===+zY(t)}class m${constructor(){n(this,"subPriority",0)}validate(e,t){return!0}}class v$ extends m${constructor(e,t,n,i,a){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=i,a&&(this.subPriority=a)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}}class y$ extends m${constructor(){super(...arguments),n(this,"priority",10),n(this,"subPriority",-1)}set(e,t){return t.timestampIsSet?e:WY(e,function(e,t){const n=t instanceof Date?WY(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}(e,Date))}}class b${run(e,t,n,i){const a=this.parse(e,t,n,i);return a?{setter:new v$(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(e,t,n){return!0}}const _$=/^(1[0-2]|0?\d)/,w$=/^(3[0-1]|[0-2]?\d)/,k$=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,x$=/^(5[0-3]|[0-4]?\d)/,T$=/^(2[0-3]|[0-1]?\d)/,C$=/^(2[0-4]|[0-1]?\d)/,E$=/^(1[0-1]|0?\d)/,S$=/^(1[0-2]|0?\d)/,I$=/^[0-5]?\d/,A$=/^[0-5]?\d/,D$=/^\d/,P$=/^\d{1,2}/,O$=/^\d{1,3}/,M$=/^\d{1,4}/,N$=/^-?\d+/,R$=/^-?\d/,L$=/^-?\d{1,2}/,V$=/^-?\d{1,3}/,q$=/^-?\d{1,4}/,F$=/^([+-])(\d{2})(\d{2})?|Z/,B$=/^([+-])(\d{2})(\d{2})|Z/,U$=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,j$=/^([+-])(\d{2}):(\d{2})|Z/,H$=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function z$(e,t){return e?{value:t(e.value),rest:e.rest}:e}function W$(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function K$(e,t){const n=t.match(e);if(!n)return null;if("Z"===n[0])return{value:0,rest:t.slice(1)};const i="+"===n[1]?1:-1,a=n[2]?parseInt(n[2],10):0,o=n[3]?parseInt(n[3],10):0,s=n[5]?parseInt(n[5],10):0;return{value:i*(a*XY+6e4*o+1e3*s),rest:t.slice(n[0].length)}}function G$(e){return W$(N$,e)}function Y$(e,t){switch(e){case 1:return W$(D$,t);case 2:return W$(P$,t);case 3:return W$(O$,t);case 4:return W$(M$,t);default:return W$(new RegExp("^\\d{1,"+e+"}"),t)}}function Q$(e,t){switch(e){case 1:return W$(R$,t);case 2:return W$(L$,t);case 3:return W$(V$,t);case 4:return W$(q$,t);default:return W$(new RegExp("^-?\\d{1,"+e+"}"),t)}}function $$(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}
5211function X$(e,t){const n=t>0,i=n?t:1-t;let a;if(i<=50)a=e||100;else{const t=i+50;a=e+100*Math.trunc(t/100)-(e>=t%100?100:0)}return n?a:1-a}function J$(e){return e%400==0||e%4==0&&e%100!=0}const Z$=[31,28,31,30,31,30,31,31,30,31,30,31],eX=[31,29,31,30,31,30,31,31,30,31,30,31];function tX(e,t,n){var i,a,o,s,r,l,c,u;const h=ZY(),d=null!=(u=null!=(c=null!=(s=null!=(o=null==n?void 0:n.weekStartsOn)?o:null==(a=null==(i=null==n?void 0:n.locale)?void 0:i.options)?void 0:a.weekStartsOn)?s:h.weekStartsOn)?c:null==(l=null==(r=h.locale)?void 0:r.options)?void 0:l.weekStartsOn)?u:0,f=zY(e),p=f.getDay(),g=7-d;return KY(f,t<0||t>6?t-(p+g)%7:((t%7+7)%7+g)%7-(p+g)%7)}function nX(e,t){const n=zY(e),i=function(e){let t=zY(e).getDay();return 0===t&&(t=7),t}(n);return KY(n,t-i)}const iX={G:new class extends b${constructor(){super(...arguments),n(this,"priority",140),n(this,"incompatibleTokens",["R","u","t","T"])}parse(e,t,n){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}},y:new class extends b${constructor(){super(...arguments),n(this,"priority",130),n(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,t,n){const i=e=>({year:e,isTwoDigitYear:"yy"===t});switch(t){case"y":return z$(Y$(4,e),i);case"yo":return z$(n.ordinalNumber(e,{unit:"year"}),i);default:return z$(Y$(t.length,e),i)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){const i=e.getFullYear();if(n.isTwoDigitYear){const t=X$(n.year,i);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}const a="era"in t&&1!==t.era?1-n.year:n.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}},Y:new class extends b${constructor(){super(...arguments),n(this,"priority",130),n(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,t,n){const i=e=>({year:e,isTwoDigitYear:"YY"===t});switch(t){case"Y":return z$(Y$(4,e),i);case"Yo":return z$(n.ordinalNumber(e,{unit:"year"}),i);default:return z$(Y$(t.length,e),i)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,i){const a=PQ(e,i);if(n.isTwoDigitYear){const t=X$(n.year,a);return e.setFullYear(t,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),eQ(e,i)}const o="era"in t&&1!==t.era?1-n.year:n.year;return e.setFullYear(o,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),eQ(e,i)}},R:new class extends b${constructor(){super(...arguments),n(this,"priority",130),n(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,t){return Q$("R"===t?4:t.length,e)}set(e,t,n){const i=WY(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),tQ(i)}},u:new class extends b${constructor(){super(...arguments),n(this,"priority",130),n(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,t){return Q$("u"===t?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}},Q:new class extends b${constructor(){super(...arguments),n(this,"priority",120),n(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,n){switch(t){case"Q":case"QQ":return Y$(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth(3*(n-1),1),e.setHours(0,0,0,0),e}},q:new class extends b${constructor(){super(...arguments),n(this,"priority",120),n(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,t,n){switch(t){case"q":case"qq":return Y$(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth(3*(n-1),1),e.setHours(0,0,0,0),e}},M:new class extends b${constructor(){super(...arguments),n(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),n(this,"priority",110)}parse(e,t,n){const i=e=>e-1;switch(t){case"M":return z$(W$(_$,e),i);case"MM":return z$(Y$(2,e),i);case"Mo":return z$(n.ordinalNumber(e,{unit:"month"}),i);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}},L:new class extends b${constructor(){super(...arguments),n(this,"priority",110),n(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,t,n){const i=e=>e-1;switch(t){case"L":return z$(W$(_$,e),i);case"LL":return z$(Y$(2,e),i);case"Lo":return z$(n.ordinalNumber(e,{unit:"month"}),i);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}},w:new class extends b${constructor(){super(...arguments),n(this,"priority",100),n(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,t,n){switch(t){case"w":return W$(x$,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return Y$(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,i){return eQ(function(e,t,n){const i=zY(e),a=OQ(i,n)-t;return i.setDate(i.getDate()-7*a),i}(e,n,i),i)}},I:new class extends b${constructor(){super(...arguments),n(this,"priority",100),n(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,t,n){switch(t){case"I":return W$(x$,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return Y$(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return tQ(function(e,t){const n=zY(e),i=DQ(n)-t;return n.setDate(n.getDate()-7*i),n}(e,n))}},d:new class extends b${constructor(){super(...arguments),n(this,"priority",90),n(this,"subPriority",1),n(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,t,n){switch(t){case"d":return W$(w$,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return Y$(t.length,e)}}validate(e,t){const n=J$(e.getFullYear()),i=e.getMonth();return n?t>=1&&t<=eX[i]:t>=1&&t<=Z$[i]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}},D:new class extends b${constructor(){super(...arguments),n(this,"priority",90),n(this,"subpriority",1),n(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,t,n){switch(t){case"D":case"DD":return W$(k$,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return Y$(t.length,e)}}validate(e,t){return J$(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}},E:new class extends b${constructor(){super(...arguments),n(this,"priority",90),n(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,t,n){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,i){return(e=tX(e,n,i)).setHours(0,0,0,0),e}},e:new class extends b${constructor(){super(...arguments),n(this,"priority",90),n(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,t,n,i){const a=e=>{const t=7*Math.floor((e-1)/7);return(e+i.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return z$(Y$(t.length,e),a);case"eo":return z$(n.ordinalNumber(e,{unit:"day"}),a);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,i){return(e=tX(e,n,i)).setHours(0,0,0,0),e}},c:new class extends b${constructor(){super(...arguments),n(this,"priority",90),n(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,t,n,i){const a=e=>{const t=7*Math.floor((e-1)/7);return(e+i.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return z$(Y$(t.length,e),a);case"co":return z$(n.ordinalNumber(e,{unit:"day"}),a);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,i){return(e=tX(e,n,i)).setHours(0,0,0,0),e}},i:new class extends b${constructor(){super(...arguments),n(this,"priority",90),n(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,t,n){const i=e=>0===e?7:e;switch(t){case"i":case"ii":return Y$(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return z$(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),i);case"iiiii":return z$(n.day(e,{width:"narrow",context:"formatting"}),i);case"iiiiii":return z$(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),i);default:return z$(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),i)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return(e=nX(e,n)).setHours(0,0,0,0),e}},a:new class extends b${constructor(){super(...arguments),n(this,"priority",80),n(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,t,n){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours($$(n),0,0,0),e}},b:new class extends b${constructor(){super(...arguments),n(this,"priority",80),n(this,"incompatibleTokens",["a","B","H","k","t","T"])}
5211parse(e,t,n){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours($$(n),0,0,0),e}},B:new class extends b${constructor(){super(...arguments),n(this,"priority",80),n(this,"incompatibleTokens",["a","b","t","T"])}parse(e,t,n){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours($$(n),0,0,0),e}},h:new class extends b${constructor(){super(...arguments),n(this,"priority",70),n(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,t,n){switch(t){case"h":return W$(S$,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return Y$(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){const i=e.getHours()>=12;return i&&n<12?e.setHours(n+12,0,0,0):i||12!==n?e.setHours(n,0,0,0):e.setHours(0,0,0,0),e}},H:new class extends b${constructor(){super(...arguments),n(this,"priority",70),n(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,t,n){switch(t){case"H":return W$(T$,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return Y$(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}},K:new class extends b${constructor(){super(...arguments),n(this,"priority",70),n(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,t,n){switch(t){case"K":return W$(E$,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return Y$(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}},k:new class extends b${constructor(){super(...arguments),n(this,"priority",70),n(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,t,n){switch(t){case"k":return W$(C$,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return Y$(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){const i=n<=24?n%24:n;return e.setHours(i,0,0,0),e}},m:new class extends b${constructor(){super(...arguments),n(this,"priority",60),n(this,"incompatibleTokens",["t","T"])}parse(e,t,n){switch(t){case"m":return W$(I$,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return Y$(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}},s:new class extends b${constructor(){super(...arguments),n(this,"priority",50),n(this,"incompatibleTokens",["t","T"])}parse(e,t,n){switch(t){case"s":return W$(A$,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return Y$(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}},S:new class extends b${constructor(){super(...arguments),n(this,"priority",30),n(this,"incompatibleTokens",["t","T"])}parse(e,t){return z$(Y$(t.length,e),e=>Math.trunc(e*Math.pow(10,3-t.length)))}set(e,t,n){return e.setMilliseconds(n),e}},X:new class extends b${constructor(){super(...arguments),n(this,"priority",10),n(this,"incompatibleTokens",["t","T","x"])}parse(e,t){switch(t){case"X":return K$(F$,e);case"XX":return K$(B$,e);case"XXXX":return K$(U$,e);case"XXXXX":return K$(H$,e);default:return K$(j$,e)}}set(e,t,n){return t.timestampIsSet?e:WY(e,e.getTime()-aQ(e)-n)}},x:new class extends b${constructor(){super(...arguments),n(this,"priority",10),n(this,"incompatibleTokens",["t","T","X"])}parse(e,t){switch(t){case"x":return K$(F$,e);case"xx":return K$(B$,e);case"xxxx":return K$(U$,e);case"xxxxx":return K$(H$,e);default:return K$(j$,e)}}set(e,t,n){return t.timestampIsSet?e:WY(e,e.getTime()-aQ(e)-n)}},t:new class extends b${constructor(){super(...arguments),n(this,"priority",40),n(this,"incompatibleTokens","*")}parse(e){return G$(e)}set(e,t,n){return[WY(e,1e3*n),{timestampIsSet:!0}]}},T:new class extends b${constructor(){super(...arguments),n(this,"priority",20),n(this,"incompatibleTokens","*")}parse(e){return G$(e)}set(e,t,n){return[WY(e,n),{timestampIsSet:!0}]}}},aX=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,oX=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sX=/^'([^]*?)'?$/,rX=/''/g,lX=/\S/,cX=/[a-zA-Z]/;function uX(e,t,n,i){var a,o,s,r,l,c,u,h,d,f,p,g,m,v,y,b,_,w;const k=Object.assign({},ZY()),x=null!=(o=null!=(a=null==i?void 0:i.locale)?a:k.locale)?o:AQ,T=null!=(f=null!=(d=null!=(c=null!=(l=null==i?void 0:i.firstWeekContainsDate)?l:null==(r=null==(s=null==i?void 0:i.locale)?void 0:s.options)?void 0:r.firstWeekContainsDate)?c:k.firstWeekContainsDate)?d:null==(h=null==(u=k.locale)?void 0:u.options)?void 0:h.firstWeekContainsDate)?f:1,C=null!=(w=null!=(_=null!=(v=null!=(m=null==i?void 0:i.weekStartsOn)?m:null==(g=null==(p=null==i?void 0:i.locale)?void 0:p.options)?void 0:g.weekStartsOn)?v:k.weekStartsOn)?_:null==(b=null==(y=k.locale)?void 0:y.options)?void 0:b.weekStartsOn)?w:0;if(""===t)return""===e?zY(n):WY(n,NaN);const E={firstWeekContainsDate:T,weekStartsOn:C,locale:x},S=[new y$],I=t.match(oX).map(e=>{const t=e[0];if(t in GQ){return(0,GQ[t])(e,x.formatLong)}return e}).join("").match(aX),A=[];for(let M of I){!(null==i?void 0:i.useAdditionalWeekYearTokens)&&JQ(M)&&ZQ(M,t,e),!(null==i?void 0:i.useAdditionalDayOfYearTokens)&&XQ(M)&&ZQ(M,t,e);const a=M[0],o=iX[a];if(o){const{incompatibleTokens:t}=o;if(Array.isArray(t)){const e=A.find(e=>t.includes(e.token)||e.token===a);
5211if(e)throw new RangeError("The format string mustn't contain `".concat(e.fullToken,"` and `").concat(M,"` at the same time"))}else if("*"===o.incompatibleTokens&&A.length>0)throw new RangeError("The format string mustn't contain `".concat(M,"` and any other token at the same time"));A.push({token:a,fullToken:M});const i=o.run(e,M,x.match,E);if(!i)return WY(n,NaN);S.push(i.setter),e=i.rest}else{if(a.match(cX))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");if("''"===M?M="'":"'"===a&&(M=hX(M)),0!==e.indexOf(M))return WY(n,NaN);e=e.slice(M.length)}}if(e.length>0&&lX.test(e))return WY(n,NaN);const D=S.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,n)=>n.indexOf(e)===t).map(e=>S.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]);let P=zY(n);if(isNaN(P.getTime()))return WY(n,NaN);const O={};for(const M of D){if(!M.validate(P,E))return WY(n,NaN);const e=M.set(P,O,E);Array.isArray(e)?(P=e[0],Object.assign(O,e[1])):P=e}return WY(n,P)}function hX(e){return e.match(sX)[1].replace(rX,"'")}function dX(e,t){return+vQ(e)===+vQ(t)}function fX(e,t){const n=zY(e),i=n.getFullYear(),a=n.getDate(),o=WY(e,0);o.setFullYear(i,t,15),o.setHours(0,0,0,0);const s=r$(o);return n.setMonth(t,Math.min(a,s)),n}function pX(e,t){let n=zY(e);return isNaN(+n)?WY(e,NaN):(null!=t.year&&n.setFullYear(t.year),null!=t.month&&(n=fX(n,t.month)),null!=t.date&&n.setDate(t.date),null!=t.hours&&n.setHours(t.hours),null!=t.minutes&&n.setMinutes(t.minutes),null!=t.seconds&&n.setSeconds(t.seconds),null!=t.milliseconds&&n.setMilliseconds(t.milliseconds),n)}function gX(e,t){const n=zY(e);return n.setMilliseconds(t),n}function mX(e,t){const n=zY(e);return n.setSeconds(t),n}function vX(e,t){const n=zY(e);return isNaN(+n)?WY(e,NaN):(n.setFullYear(t),n)}function yX(e,t){return GY(e,-t)}function bX(e,t){const{years:n=0,months:i=0,weeks:a=0,days:o=0,hours:s=0,minutes:r=0,seconds:l=0}=t,c=function(e,t){return KY(e,-t)}(yX(e,i+12*n),o+7*a),u=1e3*(l+60*(r+60*s));return WY(e,c.getTime()-u)}function _X(e,t){return lQ(e,-t)}function wX(){const e=Ti().attrs;return Ma(),Va("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img",...e},[Ha("path",{d:"M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z"}),Ha("path",{d:"M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),Ha("path",{d:"M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),Ha("path",{d:"M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"})])}function kX(){return Ma(),Va("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[Ha("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"}),Ha("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}function xX(){return Ma(),Va("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[Ha("path",{d:"M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}function TX(){return Ma(),Va("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[Ha("path",{d:"M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z"})])}function CX(){return Ma(),Va("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"
5211currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[Ha("path",{d:"M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z"}),Ha("path",{d:"M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"})])}function EX(){return Ma(),Va("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[Ha("path",{d:"M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}function SX(){return Ma(),Va("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[Ha("path",{d:"M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}wX.compatConfig={MODE:3},kX.compatConfig={MODE:3},xX.compatConfig={MODE:3},TX.compatConfig={MODE:3},CX.compatConfig={MODE:3},EX.compatConfig={MODE:3},SX.compatConfig={MODE:3};const IX=(e,t)=>t?new Date(e.toLocaleString("en-US",{timeZone:t})):new Date(e),AX=(e,t,n)=>DX(e,t,n)||sJ(),DX=(e,t,n)=>{if(!e)return null;const i=n?rJ(sJ(e),!0):sJ(e);return t?t.exactMatch?((e,t,n)=>{const i=t.dateInTz?IX(new Date(e),t.dateInTz):sJ(e);return n?rJ(i,!0):i})(e,t,n):IX(i,t.timezone):i};var PX=(e=>(e.month="month",e.year="year",e))(PX||{}),OX=(e=>(e.top="top",e.bottom="bottom",e))(OX||{}),MX=(e=>(e.header="header",e.calendar="calendar",e.timePicker="timePicker",e))(MX||{}),NX=(e=>(e.month="month",e.year="year",e.calendar="calendar",e.time="time",e.minutes="minutes",e.hours="hours",e.seconds="seconds",e))(NX||{});const RX=["timestamp","date","iso"];var LX=(e=>(e.up="up",e.down="down",e.left="left",e.right="right",e))(LX||{}),VX=(e=>(e.arrowUp="ArrowUp",e.arrowDown="ArrowDown",e.arrowLeft="ArrowLeft",e.arrowRight="ArrowRight",e.enter="Enter",e.space=" ",e.esc="Escape",e.tab="Tab",e.home="Home",e.end="End",e.pageUp="PageUp",e.pageDown="PageDown",e))(VX||{});function qX(e){return t=>new Intl.DateTimeFormat(e,{weekday:"short",timeZone:"UTC"}).format(new Date("2017-01-0".concat(t,"T00:00:00+00:00"))).slice(0,2)}const FX=(e,t,n)=>{const i=[1,2,3,4,5,6,7];let a;if(null!==e)try{a=i.map(function(e){return t=>o$(IX(new Date("2017-01-0".concat(t,"T00:00:00+00:00")),"UTC"),"EEEEEE",{locale:e})}(e))}catch(r){a=i.map(qX(t))}else a=i.map(qX(t));const o=a.slice(0,n),s=a.slice(n+1,a.length);return[a[n]].concat(...s).concat(...o)},BX=(e,t,n)=>{const i=[];for(let a=+e[0];a<=+e[1];a++)i.push({value:+a,text:ZX(a,t)});return n?i.reverse():i},UX=(e,t,n)=>{const i=[1,2,3,4,5,6,7,8,9,10,11,12].map(e=>{const t=e<10?"0".concat(e):e;return new Date("2017-".concat(t,"-01T00:00:00+00:00"))});if(null!==e)try{const t="long"===n?"LLLL":"LLL";return i.map((n,i)=>{const a=o$(IX(n,"UTC"),t,{locale:e});return{text:a.charAt(0).toUpperCase()+a.substring(1),value:i}})}catch(o){}const a=new Intl.DateTimeFormat(t,{month:n,timeZone:"UTC"});return i.map((e,t)=>{const n=a.format(e);return{text:n.charAt(0).toUpperCase()+n.substring(1),value:t}})},jX=e=>{const t=Ot(e);return null!=t&&t.$el?null==t?void 0:t.$el:t},HX=e=>!!Array.isArray(e)&&(!!e[0]&&!!e[1]),zX=e=>'"'.concat(e,'" prop must be enabled!'),WX=e=>'You need to use array as "model-value" binding in order to support "'.concat(e,'"'),KX=e=>0===e?e:!e||isNaN(+e)?null:+e,GX=e=>null===e,YX=e=>{if(e)return[...e.querySelectorAll("input, button, select, textarea, a[href]")][0]},QX=(e,t,n)=>{const i=null!=n,a=null!=t;if(!i&&!a)return!1;const o=+n,s=+t;return i&&a?+e>o||+e<s:i?+e>o:!!a&&+e<s},$X=(e,t)=>(e=>{const t=[],n=e=>e.filter(e=>e);for(let i=0;i<e.length;i+=3){const a=[e[i],e[i+1],e[i+2]];t.push(n(a))}return t})(e).map(e=>e.map(e=>{const{active:n,disabled:i,isBetween:a,highlighted:o}=t(e);return{...e,active:n,disabled:i,className:{dp__overlay_cell_active:n,dp__overlay_cell:!n,dp__overlay_cell_disabled:i,dp__overlay_cell_pad:!0,dp__overlay_cell_active_disabled:i&&n,dp__cell_in_between:a,"dp--highlighted":o}}})),XX=(e,t,n=!1)=>{e&&t.allowStopPropagation&&(n&&e.stopImmediatePropagation(),e.stopPropagation())};const JX=(e,t)=>null==e?void 0:e.querySelector('[data-dp-element="'.concat(t,'"]')),ZX=(e,t)=>new Intl.NumberFormat(t,{useGrouping:!1,style:"decimal"}).format(e),eJ=e=>o$(e,"dd-MM-yyyy"),tJ=e=>Array.isArray(e),nJ=(e,t)=>t.get(eJ(e)),iJ=(e,t,n=!1,i)=>
5211e.key===VX.enter||e.key===VX.space?(n&&e.preventDefault(),t()):i?i(e):void 0,aJ=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].some(e=>navigator.userAgent.includes(e))||navigator.userAgent.includes("Mac")&&"ontouchend"in document,oJ=(e,t,n,i,a,o)=>{const s=uX(e,t.slice(0,e.length),new Date,{locale:o});return dQ(s)&&hQ(s)?i||a?s:pX(s,{hours:+n.hours,minutes:+(null==n?void 0:n.minutes),seconds:+(null==n?void 0:n.seconds),milliseconds:0}):null},sJ=e=>e?new Date(e):new Date,rJ=(e,t)=>{const n=pX(sJ(JSON.parse(JSON.stringify(e))),{hours:0,minutes:0,seconds:0,milliseconds:0});return t?function(e){const t=zY(e);return t.setDate(1),t.setHours(0,0,0,0),t}(n):n},lJ=(e,t,n,i)=>{let a=e?sJ(e):sJ();return(t||0===t)&&(a=function(e,t){const n=zY(e);return n.setHours(t),n}(a,+t)),(n||0===n)&&(a=function(e,t){const n=zY(e);return n.setMinutes(t),n}(a,+n)),(i||0===i)&&(a=mX(a,+i)),gX(a,0)},cJ=(e,t)=>!(!e||!t)&&p$(rJ(e),rJ(t)),uJ=(e,t)=>!(!e||!t)&&g$(rJ(e),rJ(t)),hJ=(e,t)=>!(!e||!t)&&f$(rJ(e),rJ(t)),dJ=(e,t,n)=>null!=e&&e[0]&&null!=e&&e[1]?hJ(n,e[0])&&cJ(n,e[1]):!(null==e||!e[0]||!t)&&(hJ(n,e[0])&&cJ(n,t)||cJ(n,e[0])&&hJ(n,t)),fJ=e=>{const t=pX(new Date(e),{date:1});return rJ(t)},pJ=(e,t,n)=>t&&(n||0===n)?Object.fromEntries(["hours","minutes","seconds"].map(i=>i===t?[i,n]:[i,isNaN(+e[i])?void 0:+e[i]])):{hours:isNaN(+e.hours)?void 0:+e.hours,minutes:isNaN(+e.minutes)?void 0:+e.minutes,seconds:isNaN(+e.seconds)?void 0:+e.seconds},gJ=e=>({hours:l$(e),minutes:c$(e),seconds:h$(e)}),mJ=(e,t)=>{if(t){const n=d$(sJ(t));if(n>e)return 12;if(n===e)return u$(sJ(t))}},vJ=(e,t)=>{if(t){const n=d$(sJ(t));return n<e?-1:n===e?u$(sJ(t)):void 0}},yJ=e=>{if(e)return d$(sJ(e))},bJ=(e,t)=>mQ({start:hJ(e,t)?t:e,end:hJ(t,e)?t:e}),_J=e=>{const t=GY(e,1);return{month:u$(t),year:d$(t)}},wJ=(e,t)=>[eQ(e,{weekStartsOn:+t}),_Q(e,{weekStartsOn:+t})],kJ=(e,t)=>{const n={hours:l$(sJ()),minutes:c$(sJ()),seconds:t?h$(sJ()):0};return Object.assign(n,e)},xJ=(e,t,n)=>[pX(sJ(e),{date:1}),pX(sJ(),{month:t,year:n,date:1})],TJ=(e,t,n)=>{let i=e?sJ(e):sJ();return(t||0===t)&&(i=fX(i,t)),n&&(i=vX(i,n)),i},CJ=(e,t,n,i,a)=>{if(!i||a&&!t||!a&&!n)return!1;const o=a?GY(e,1):yX(e,1),s=[u$(o),d$(o)];return a?!SJ(...s,t):!EJ(...s,n)},EJ=(e,t,n)=>cJ(...xJ(n,e,t))||uJ(...xJ(n,e,t)),SJ=(e,t,n)=>hJ(...xJ(n,e,t))||uJ(...xJ(n,e,t)),IJ=(e,t,n,i,a,o,s)=>{if("function"==typeof t&&!s)return t(e);const r=n?{locale:n}:void 0;return Array.isArray(e)?"".concat(o$(e[0],o,r)).concat(a&&!e[1]?"":i).concat(e[1]?o$(e[1],o,r):""):o$(e,o,r)},AJ=e=>{if(e)return null;throw new Error(zX("partial-range"))},DJ=(e,t)=>{if(t)return e();throw new Error(zX("range"))},PJ=e=>Array.isArray(e)?dQ(e[0])&&(!e[1]||dQ(e[1])):!!e&&dQ(e),OJ=(e,t,n,i)=>{if(!e)return!0;if(i){const i={seconds:0,milliseconds:0};return("max"===n?p$(e,t):f$(e,t))||g$(pX(e,i),pX(t,i))}return"max"===n?e.getTime()<=t.getTime():e.getTime()>=t.getTime()},MJ=(e,t,n)=>e?((e,t)=>pX(null!=t?t:sJ(),{hours:+e.hours||0,minutes:+e.minutes||0,seconds:+e.seconds||0}))(e,t):sJ(null!=n?n:t),NJ=(e,t,n,i,a)=>{if(Array.isArray(i)){const o=MJ(e,i[0],t),s=MJ(e,i[1],t);return OJ(i[0],o,n,!!t)&&OJ(i[1],s,n,!!t)&&a}const o=MJ(e,i,t);return OJ(i,o,n,!!t)&&a},RJ=e=>pX(sJ(),gJ(e)),LJ=(e,t,n)=>"function"==typeof e?e({month:t,year:n}):!!e.months.find(e=>e.month===t&&e.year===n),VJ=(e,t)=>"function"==typeof e?e(t):e.years.includes(t),qJ=e=>o$(e,"yyyy-MM-dd"),FJ=gt({menuFocused:!1,shiftKeyInMenu:!1}),BJ=()=>({control:bo(()=>({shiftKeyInMenu:FJ.shiftKeyInMenu,menuFocused:FJ.menuFocused})),setMenuFocused:e=>{FJ.menuFocused=e},setShiftKey:e=>{FJ.shiftKeyInMenu!==e&&(FJ.shiftKeyInMenu=e)}}),UJ=gt({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),jJ=It(null),HJ=It(!1),zJ=It(!1),WJ=It(!1),KJ=It(!1),GJ=It(0),YJ=It(0),QJ=()=>{const e=bo(()=>HJ.value?[...UJ.selectionGrid,UJ.actionRow].filter(e=>e.length):zJ.value?[...UJ.timePicker[0],...UJ.timePicker[1],KJ.value?[]:[jJ.value],UJ.actionRow].filter(e=>e.length):WJ.value?[...UJ.monthPicker,UJ.actionRow]:[UJ.monthYear,...UJ.calendar,UJ.time,UJ.actionRow].filter(e=>e.length)),t=t=>{GJ.value=t?GJ.value+1:GJ.value-1;let n=null;e.value[YJ.value]&&(n=e.value[YJ.value][GJ.value]),!n&&e.value[YJ.value+(t?1:-1)]?(YJ.value=YJ.value+(t?1:-1),GJ.value=t?0:e.value[YJ.value].length-1):n||(GJ.value=t?GJ.value-1:GJ.value+1)},n=t=>{0===YJ.value&&!t||YJ.value===e.value.length&&t||(YJ.value=t?YJ.value+1:YJ.value-1,e.value[YJ.value]?e.value[YJ.value]&&!e.value[YJ.value][GJ.value]&&0!==GJ.value&&(GJ.value=e.value[YJ.value].length-1):YJ.value=t?YJ.value-1:YJ.value+1)},i=t=>{let n=null;e.value[YJ.value]&&(n=e.value[YJ.value][GJ.value]),n?n.focus({preventScroll:!HJ.value}):GJ.value=t?GJ.value-1:GJ.value+1},a=()=>{GJ.value=0,YJ.value=0};return{buildMatrix:(e,t)=>{UJ[t]=e},buildMultiLevelMatrix:(e,t)=>{UJ[t]=e},setTimePickerBackRef:e=>{jJ.value=e},setSelectionGrid:e=>{HJ.value=e,a(),e||(UJ.selectionGrid=[])},setTimePicker:(e,t=!1)=>{zJ.value=e,KJ.value=t,a(),e||(UJ.timePicker[0]=[],UJ.timePicker[1]=[])},setTimePickerElements:(e,t=0)=>{UJ.timePicker[t]=e},arrowRight:()=>{t(!0),i(!0)},arrowLeft:()=>{t(!1),i(!1)},arrowUp:()=>{n(!1),i(!0)},arrowDown:()=>{n(!0),i(!0)},clearArrowNav:()=>{UJ.monthYear=[],UJ.calendar=[],UJ.time=[],UJ.actionRow=[],UJ.selectionGrid=[],UJ.timePicker[0]=[],UJ.timePicker[1]=[],HJ.value=!1,zJ.value=!1,KJ.value=!1,WJ.value=!1,a(),jJ.value=null},setMonthPicker:e=>{WJ.value=e,a()},refSets:UJ}},$J=e=>({menuAppearTop:"dp-menu-appear-top",menuAppearBottom:"dp-menu-appear-bottom",open:"dp-slide-down",close:"dp-slide-up",
5211next:"calendar-next",previous:"calendar-prev",vNext:"dp-slide-up",vPrevious:"dp-slide-down",...null!=e?e:{}}),XJ=e=>e?"boolean"==typeof e?e?2:0:+e>=2?+e:2:0,JJ=(e,t,n)=>new Map(e.map(e=>{const i=AX(e,t,n);return[eJ(i),i]})),ZJ=(e,t)=>e.length?new Map(e.map(e=>{const n=AX(e.date,t);return[eJ(n),e]})):null,eZ=e=>{const t=()=>{const t=e.enableSeconds?":ss":"",n=e.enableMinutes?":mm":"";return e.is24?"HH".concat(n).concat(t):"hh".concat(n).concat(t," aa")},n=()=>{var n;return e.format?e.format:e.monthPicker?"MM/yyyy":e.timePicker?t():e.weekPicker?"".concat("iso"===(null==(n=m.value)?void 0:n.type)?"RR":"ww","-yyyy"):e.yearPicker?"yyyy":e.quarterPicker?"QQQ/yyyy":e.enableTimePicker?"MM/dd/yyyy, ".concat(t()):"MM/dd/yyyy"},i=t=>kJ(t,e.enableSeconds),a=()=>_.value.enabled?e.startTime&&Array.isArray(e.startTime)?[i(e.startTime[0]),i(e.startTime[1])]:null:e.startTime&&!Array.isArray(e.startTime)?i(e.startTime):null,o=bo(()=>(e=>{var t;const n="object"==typeof e&&e,i={static:!0,solo:!1};if(!e)return{...i,count:XJ(!1)};const a=n?e:{},o=n?null==(t=a.count)||t:e,s=XJ(o);return Object.assign(i,a,{count:s})})(e.multiCalendars)),s=bo(()=>a()),r=bo(()=>(e=>({toggleOverlay:"Toggle overlay",menu:"Datepicker menu",input:"Datepicker input",openTimePicker:"Open time picker",closeTimePicker:"Close time Picker",incrementValue:e=>"Increment ".concat(e),decrementValue:e=>"Decrement ".concat(e),openTpOverlay:e=>"Open ".concat(e," overlay"),amPmButton:"Switch AM/PM mode",openYearsOverlay:"Open years overlay",openMonthsOverlay:"Open months overlay",nextMonth:"Next month",prevMonth:"Previous month",nextYear:"Next year",prevYear:"Previous year",day:void 0,weekDay:void 0,clearInput:"Clear value",calendarIcon:"Calendar icon",timePicker:"Time picker",monthPicker:e=>"Month picker".concat(e?" overlay":""),yearPicker:e=>"Year picker".concat(e?" overlay":""),timeOverlay:e=>"".concat(e," overlay"),...null!=e?e:{}}))(e.ariaLabels)),l=bo(()=>(e=>({months:[],years:[],times:{hours:[],minutes:[],seconds:[]},...null!=e?e:{}}))(e.filters)),c=bo(()=>(e=>"boolean"==typeof e?!!e&&$J({}):$J(e))(e.transitions)),u=bo(()=>(e=>({showSelect:!0,showCancel:!0,showNow:!1,showPreview:!0,...null!=e?e:{}}))(e.actionRow)),h=bo(()=>((e,t,n)=>e||("string"==typeof n?n:t))(e.previewFormat,e.format,n())),d=bo(()=>(e=>{const t={enterSubmit:!0,tabSubmit:!0,openMenu:"open",selectOnFocus:!1,rangeSeparator:" - "};return"object"==typeof e?{...t,...null!=e?e:{},enabled:!0}:{...t,enabled:e}})(e.textInput)),f=bo(()=>(e=>{const t={input:!1};return"object"==typeof e?{...t,...null!=e?e:{},enabled:!0}:{enabled:e,...t}})(e.inline)),p=bo(()=>(e=>({allowStopPropagation:!0,closeOnScroll:!1,modeHeight:255,allowPreventDefault:!1,closeOnClearValue:!0,closeOnAutoApply:!0,noSwipe:!1,keepActionRow:!1,onClickOutside:void 0,tabOutClosesMenu:!0,arrowLeft:void 0,keepViewOnOffsetClick:!1,timeArrowHoldThreshold:0,shadowDom:!1,...null!=e?e:{}}))(e.config)),g=bo(()=>(e=>{const t={dates:Array.isArray(e)?e.map(e=>sJ(e)):[],years:[],months:[],quarters:[],weeks:[],weekdays:[],options:{highlightDisabled:!1}};return"function"==typeof e?e:{...t,...null!=e?e:{}}})(e.highlight)),m=bo(()=>(e=>{var t,n;return"object"==typeof e?{type:null!=(t=null==e?void 0:e.type)?t:"local",hideOnOffsetDates:null!=(n=null==e?void 0:e.hideOnOffsetDates)&&n}:{type:e,hideOnOffsetDates:!1}})(e.weekNumbers)),v=bo(()=>(e=>{var t,n,i,a;return e?"string"==typeof e?{timezone:e,exactMatch:!1,dateInTz:void 0,emitTimezone:void 0,convertModel:!0}:{timezone:e.timezone,exactMatch:null!=(t=e.exactMatch)&&t,dateInTz:null!=(n=e.dateInTz)?n:void 0,emitTimezone:null!=(i=e.emitTimezone)?i:void 0,convertModel:null==(a=e.convertModel)||a}:{timezone:void 0,exactMatch:!1,emitTimezone:void 0}})(e.timezone)),y=bo(()=>(e=>{var t;return"boolean"==typeof e?{enabled:e,dragSelect:!0,limit:null}:{enabled:!!e,limit:e.limit?+e.limit:null,dragSelect:null==(t=e.dragSelect)||t}})(e.multiDates)),b=bo(()=>(e=>{var t;return{minDate:DX(e.minDate,e.timezone,e.isSpecific),maxDate:DX(e.maxDate,e.timezone,e.isSpecific),disabledDates:tJ(e.disabledDates)?JJ(e.disabledDates,e.timezone,e.isSpecific):e.disabledDates,allowedDates:tJ(e.allowedDates)?JJ(e.allowedDates,e.t
5211imezone,e.isSpecific):null,highlight:"object"==typeof e.highlight&&tJ(null==(t=e.highlight)?void 0:t.dates)?JJ(e.highlight.dates,e.timezone):e.highlight,markers:ZJ(e.markers,e.timezone)}})({minDate:e.minDate,maxDate:e.maxDate,disabledDates:e.disabledDates,allowedDates:e.allowedDates,highlight:g.value,markers:e.markers,timezone:v.value,isSpecific:e.monthPicker||e.yearPicker||e.quarterPicker})),_=bo(()=>(e=>{const t={noDisabledRange:!1,showLastInRange:!0,minMaxRawRange:!1,partialRange:!0,disableTimeRangeValidation:!1,maxRange:void 0,minRange:void 0,autoRange:void 0,fixedStart:!1,fixedEnd:!1};return"object"==typeof e?{enabled:!0,...t,...e}:{enabled:e,...t}})(e.range)),w=bo(()=>(e=>({...Object.fromEntries(Object.keys(e).map(t=>{const n=t,i=e[n];return[t,"string"==typeof e[n]?{[i]:!0}:Object.fromEntries(i.map(e=>[e,!0]))]}))}))(e.ui));return{defaultedTransitions:c,defaultedMultiCalendars:o,defaultedStartTime:s,defaultedAriaLabels:r,defaultedFilters:l,defaultedActionRow:u,defaultedPreviewFormat:h,defaultedTextInput:d,defaultedInline:f,defaultedConfig:p,defaultedHighlight:g,defaultedWeekNumbers:m,defaultedRange:_,propDates:b,defaultedTz:v,defaultedMultiDates:y,defaultedUI:w,getDefaultPattern:n,getDefaultStartTime:a}},tZ=(e,t,n)=>{const i=It(),{defaultedTextInput:a,defaultedRange:o,defaultedTz:s,defaultedMultiDates:r,getDefaultPattern:l}=eZ(t),c=It(""),u=Ft(t,"format"),h=Ft(t,"formatLocale");pa(i,()=>{"function"==typeof t.onInternalModelChange&&e("internal-model-change",i.value,I(!0))},{deep:!0}),pa(o,(e,t)=>{e.enabled!==t.enabled&&(i.value=null)}),pa(u,()=>{k()});const d=e=>s.value.timezone&&s.value.convertModel?IX(e,s.value.timezone):e,f=e=>{if(s.value.timezone&&s.value.convertModel){const t=(e=>{if(!e)return 0;const t=new Date,n=new Date(t.toLocaleString("en-US",{timeZone:"UTC"})),i=new Date(t.toLocaleString("en-US",{timeZone:e})),a=i.getTimezoneOffset()/60;return(+n-+i)/36e5-a})(s.value.timezone);return QY(e,t*XY)}return e},p=(e,n,i=!1)=>IJ(e,t.format,t.formatLocale,a.value.rangeSeparator,t.modelAuto,null!=n?n:l(),i),g=e=>e?t.modelType?T(e):{hours:l$(e),minutes:c$(e),seconds:t.enableSeconds?h$(e):0}:null,m=e=>t.modelType?T(e):{month:u$(e),year:d$(e)},v=(e,n)=>"string"!=typeof e&&"number"!=typeof e||!t.modelType?n:x(e),y=()=>{const e=i.value;return[T(e[0]),e[1]?T(e[1]):AJ(o.value.partialRange)]},b=(e=!1)=>(e||Array.isArray(i.value)&&o.value.enabled&&1===i.value.length&&i.value.push(AJ(o.value.partialRange)),t.modelAuto?i.value[1]?y():T(i.value[0]):r.value.enabled?(i.value||[]).map(e=>T(e)):Array.isArray(i.value)?DJ(()=>y(),o.value.enabled):T(i.value)),_=e=>!e||Array.isArray(e)&&!e.length?null:t.timePicker?(e=>Array.isArray(e)?[v(e[0],lJ(null,+e[0].hours,+e[0].minutes,e[0].seconds)),v(e[1],lJ(null,+e[1].hours,+e[1].minutes,e[1].seconds))]:v(e,lJ(null,e.hours,e.minutes,e.seconds)))(e):t.monthPicker?(e=>{const t=pX(sJ(),{date:1});return Array.isArray(e)?r.value.enabled?e.map(e=>v(e,TJ(t,+e.month,+e.year))):DJ(()=>[v(e[0],TJ(t,+e[0].month,+e[0].year)),v(e[1],e[1]?TJ(t,+e[1].month,+e[1].year):AJ(o.value.partialRange))],o.value.enabled):v(e,TJ(t,+e.month,+e.year))})(e):t.yearPicker?(e=>Array.isArray(e)?r.value.enabled?e.map(e=>v(e,vX(sJ(),e))):DJ(()=>[vX(sJ(),e[0]),e[1]?vX(sJ(),e[1]):AJ(o.value.partialRange)],o.value.enabled):vX(sJ(),+e))(e):r.value.enabled?(e=>{if(Array.isArray(e))return e.map(e=>x(e));throw new Error(WX("multi-dates"))})(e):t.weekPicker?(e=>{if(Array.isArray(e)&&o.value.enabled){const t=e[0],n=e[1];return[sJ(Array.isArray(t)?t[0]:null),Array.isArray(n)&&n.length?sJ(n[0]):null]}return sJ(e[0])})(e):(e=>t.modelAuto?Array.isArray(e)?[x(e[0]),x(e[1])]:t.autoApply?[x(e)]:[x(e),null]:Array.isArray(e)?DJ(()=>e[1]?[x(e[0]),e[1]?x(e[1]):AJ(o.value.partialRange)]:[x(e[0])],o.value.enabled):x(e))(e),w=()=>n.value&&i.value?Array.isArray(i.value)?(()=>{const e=e=>o$(e,a.value.format);return"".concat(e(i.value[0])," ").concat(a.value.rangeSeparator," ").concat(i.value[1]?e(i.value[1]):"")})():o$(i.value,a.value.format):p(i.value),k=()=>{!t.format||"string"==typeof t.format||a.value.enabled&&"string"==typeof a.value.format?c.value=i.value?r.value.enabled?i.value.map(e=>p(e)).join("; "):a.value.enabled&&"string"==typeof a.value.format?w():p(i.value):"":c.value=t.format(i.value)},x=e=>{if(t.utc){const n=new Date(e);return"preserve"===t.utc?new Date(n.getTime()+6e4*n.getTimezoneOffset()):n}return t.modelType?RX.includes(t.modelType)?d(new Date(e)):"format"!==t.modelType||"string"!=typeof t.format&&t.format?d(uX(e,t.modelType,new Date,{locale:h.value})):d(uX(e,l(),new Date,{locale:h.value})):d(new Date(e))},T=e=>
5211e?t.utc?((e,t,n)=>{if(t){const t=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),a=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0"),s=n?e.getSeconds().toString().padStart(2,"0"):"00";return"".concat(e.getFullYear(),"-").concat(t,"-").concat(i,"T").concat(a,":").concat(o,":").concat(s,".000Z")}const i=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());return new Date(i).toISOString()})(e,"preserve"===t.utc,t.enableSeconds):t.modelType?"timestamp"===t.modelType?+f(e):"iso"===t.modelType?f(e).toISOString():"format"!==t.modelType||"string"!=typeof t.format&&t.format?p(f(e),t.modelType,!0):p(f(e)):f(e):"",C=(t,n=!1,i=!1)=>{if(i)return t;if(e("update:model-value",t),s.value.emitTimezone&&n){const n=Array.isArray(t)?t.map(e=>IX(e,s.value.emitTimezone)):IX(t,s.value.emitTimezone);e("update:model-timezone-value",n)}},E=()=>{if(Array.isArray(i.value)){const e=wJ(i.value[0],t.weekStart),n=i.value[1]?wJ(i.value[1],t.weekStart):[];return[e.map(e=>sJ(e)),n.map(e=>sJ(e))]}return wJ(i.value,t.weekStart).map(e=>sJ(e))},S=(e,t)=>C((e=>Array.isArray(i.value)?r.value.enabled?i.value.map(t=>e(t)):[e(i.value[0]),i.value[1]?e(i.value[1]):AJ(o.value.partialRange)]:e(i.value))(e),!1,t),I=(n=!1)=>(n||k(),t.monthPicker?S(m,n):t.timePicker?S(g,n):t.yearPicker?S(d$,n):t.weekPicker?(t=>{const n=E();return t?n:e("update:model-value",E())})(n):C(b(n),!0,n));return{inputValue:c,internalModelValue:i,checkBeforeEmit:()=>!!i.value&&(o.value.enabled?o.value.partialRange?i.value.length>=1:2===i.value.length:!!i.value),parseExternalModelValue:e=>{const t=_(e);PJ(t)?(i.value=t,k()):(i.value=null,c.value="")},formatInputValue:k,emitModelValue:I}},nZ={multiCalendars:{type:[Boolean,Number,String,Object],default:void 0},modelValue:{type:[String,Date,Array,Object,Number],default:null},modelType:{type:String,default:null},position:{type:String,default:"center"},dark:{type:Boolean,default:!1},format:{type:[String,Function],default:()=>null},autoPosition:{type:Boolean,default:!0},altPosition:{type:Function,default:null},transitions:{type:[Boolean,Object],default:!0},formatLocale:{type:Object,default:null},utc:{type:[Boolean,String],default:!1},ariaLabels:{type:Object,default:()=>({})},offset:{type:[Number,String],default:10},hideNavigation:{type:Array,default:()=>[]},timezone:{type:[String,Object],default:null},vertical:{type:Boolean,default:!1},disableMonthYearSelect:{type:Boolean,default:!1},disableYearSelect:{type:Boolean,default:!1},dayClass:{type:Function,default:null},yearRange:{type:Array,default:()=>[1900,2100]},enableTimePicker:{type:Boolean,default:!0},autoApply:{type:Boolean,default:!1},disabledDates:{type:[Array,Function],default:()=>[]},monthNameFormat:{type:String,default:"short"},startDate:{type:[Date,String],default:null},startTime:{type:[Object,Array],default:null},hideOffsetDates:{type:Boolean,default:!1},noToday:{type:Boolean,default:!1},disabledWeekDays:{type:Array,default:()=>[]},allowedDates:{type:Array,default:null},nowButtonLabel:{type:String,default:"Now"},markers:{type:Array,default:()=>[]},escClose:{type:Boolean,default:!0},spaceConfirm:{type:Boolean,default:!0},monthChangeOnArrows:{type:Boolean,default:!0},presetDates:{type:Array,default:()=>[]},flow:{type:Array,default:()=>[]},partialFlow:{type:Boolean,default:!1},preventMinMaxNavigation:{type:Boolean,default:!1},reverseYears:{type:Boolean,default:!1},weekPicker:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},arrowNavigation:{type:Boolean,default:!1},highlight:{type:[Function,Object],default:null},teleport:{type:[Boolean,String,Object],default:null},teleportCenter:{type:Boolean,default:!1},locale:{type:String,default:"en-Us"},weekNumName:{type:String,default:"W"},weekStart:{type:[Number,String],default:1},weekNumbers:{type:[String,Function,Object],default:null},monthChangeOnScroll:{type:[Boolean,String],default:!0},dayNames:{type:[Function,Array],default:null},monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1},modelAuto:{type:Boolean,default:!1},selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:[Object,Boolean],default:!1},ignoreTimeValidation:{type:Boolean,default:!1},minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null},minTime:{type:Object,default:null},maxTime:{type:Object,default:null},name:{type:String,default:null},placeholder:{type:String,default:""},hideInputIcon:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},state:{type:Boolean,default:null},required:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},timePicker:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},is24:{type:Boolean,default:!0},noHoursOverlay:{type:Boolean,default:!1},noMinutesOverlay:{type:Boolean,default:!1},noSecondsOverlay:{type:Boolean,default:!1},hoursGridIncrement:{type:[String,Number],default:1},minutesGridIncrement:{type:[String,Number],default:5},secondsGridIncrement:{type:[String,Number],default:5},hoursIncrement:{type:[Number,String],default:1},minutesIncrement:{type:[Number,String],default:1},secondsIncrement:{type:[Number,String],default:1},range:{type:[Boolean,Object],default:!1},uid:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},inline:{type:[Boolean,Object],default:!1},textInput:{type:[Boolean,Object],default:!1},sixWeeks:{type:[Boolean,String],default:!1},actionRow:{type:Object,default:()=>({})},focusStartDate:{type:Boolean,default:!1},disabledTimes:{type:[Function,Array],default:void 0},timePickerInline:{type:Boolean,default:!1},calendar:{type:Function,default:null},config:{type:Object,default:void 0},quarterPicker:{type:Boolean,default:!1},yearFirst:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},onInternalModelChange:{type:[Function,Object],default:null},enableMinutes:{type:Boolean,default:!0},ui:{type:Object,default:()=>({})}},iZ={...nZ,shadow:{type:Boolean,default:!1},flowStep:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},menuWrapRef:{type:Object,default:null},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},aZ=["title"],oZ=["disabled"],sZ=jn({compatConfig:{MODE:3},__name:"ActionRow",props:{menuMount:{type:Boolean,default:!1},calendarWidth:{type:Number,default:0},...iZ}
5211,emits:["close-picker","select-date","select-now","invalid-select"],setup(e,{emit:t}){const n=t,i=e,{defaultedActionRow:a,defaultedPreviewFormat:o,defaultedMultiCalendars:s,defaultedTextInput:r,defaultedInline:l,defaultedRange:c,defaultedMultiDates:u}=eZ(i),{isTimeValid:h,isMonthValid:d}=E0(i),{buildMatrix:f}=QJ(),p=It(null),g=It(null),m=It(!1),v=It({}),y=It(null),b=It(null);ei(()=>{i.arrowNavigation&&f([jX(p),jX(g)],"actionRow"),_(),window.addEventListener("resize",_)}),ai(()=>{window.removeEventListener("resize",_)});const _=()=>{m.value=!1,setTimeout(()=>{var e,t;const n=null==(e=y.value)?void 0:e.getBoundingClientRect(),i=null==(t=b.value)?void 0:t.getBoundingClientRect();n&&i&&(v.value.maxWidth="".concat(i.width-n.width-20,"px")),m.value=!0},0)},w=bo(()=>!(c.value.enabled&&!c.value.partialRange&&i.internalModelValue)||2===i.internalModelValue.length),k=bo(()=>!h.value(i.internalModelValue)||!d.value(i.internalModelValue)||!w.value),x=e=>IJ(e,o.value,i.formatLocale,r.value.rangeSeparator,i.modelAuto,o.value),T=bo(()=>i.internalModelValue&&i.menuMount?"string"==typeof o.value?Array.isArray(i.internalModelValue)?2===i.internalModelValue.length&&i.internalModelValue[1]?(()=>{const e=i.internalModelValue;return s.value.count>0?"".concat(x(e[0])," - ").concat(x(e[1])):[x(e[0]),x(e[1])]})():u.value.enabled?i.internalModelValue.map(e=>"".concat(x(e))):i.modelAuto?"".concat(x(i.internalModelValue[0])):"".concat(x(i.internalModelValue[0])," -"):x(i.internalModelValue):(()=>{const e=o.value;return i.timePicker||i.monthPicker,e(i.internalModelValue)})():""),C=bo(()=>Array.isArray(T.value)?T.value.join(u.value.enabled?"; ":" - "):T.value),E=()=>{h.value(i.internalModelValue)&&d.value(i.internalModelValue)&&w.value?n("select-date"):n("invalid-select")};return(e,t)=>(Ma(),Va("div",{ref_key:"actionRowRef",ref:b,class:"dp__action_row"},[e.$slots["action-row"]?vi(e.$slots,"action-row",Y(Za({key:0},{internalModelValue:e.internalModelValue,disabled:k.value,selectDate:()=>e.$emit("select-date"),closePicker:()=>e.$emit("close-picker")}))):(Ma(),Va(Sa,{key:1},[Ot(a).showPreview?(Ma(),Va("div",{key:0,class:"dp__selection_preview",title:C.value,style:j(v.value)},[e.$slots["action-preview"]&&m.value?vi(e.$slots,"action-preview",{key:0,value:e.internalModelValue}):Qa("",!0),!e.$slots["action-preview"]&&m.value?(Ma(),Va(Sa,{key:1},[Ga(ee(C.value),1)],64)):Qa("",!0)],12,aZ)):Qa("",!0),Ha("div",{ref_key:"actionBtnContainer",ref:y,class:"dp__action_buttons","data-dp-element":"action-row"},[e.$slots["action-buttons"]?vi(e.$slots,"action-buttons",{key:0,value:e.internalModelValue}):Qa("",!0),e.$slots["action-buttons"]?Qa("",!0):(Ma(),Va(Sa,{key:1},[!Ot(l).enabled&&Ot(a).showCancel?(Ma(),Va("button",{key:0,ref_key:"cancelButtonRef",ref:p,type:"button",class:"dp__action_button dp__action_cancel",onClick:t[0]||(t[0]=t=>e.$emit("close-picker")),onKeydown:t[1]||(t[1]=t=>Ot(iJ)(t,()=>e.$emit("close-picker")))},ee(e.cancelText),545)):Qa("",!0),Ot(a).showNow?(Ma(),Va("button",{key:1,type:"button",class:"dp__action_button dp__action_cancel",onClick:t[2]||(t[2]=t=>e.$emit("select-now")),onKeydown:t[3]||(t[3]=t=>Ot(iJ)(t,()=>e.$emit("select-now")))},ee(e.nowButtonLabel),33)):Qa("",!0),Ot(a).showSelect?(Ma(),Va("button",{key:2,ref_key:"selectButtonRef",ref:g,type:"button",class:"dp__action_button dp__action_select",disabled:k.value,"data-test":"select-button",onKeydown:t[4]||(t[4]=e=>Ot(iJ)(e,()=>E())),onClick:E},ee(e.selectText),41,oZ)):Qa("",!0)],64))],512)],64))],512))}}),rZ=["role","aria-label","tabindex"],lZ={class:"dp__selection_grid_header"},cZ=["aria-selected","aria-disabled","data-test","onClick","onKeydown","onMouseover"],uZ=["aria-label"],hZ=jn({__name:"SelectionOverlay",props:{items:{},type:{},isLast:{type:Boolean},arrowNavigation:{type:Boolean},skipButtonRef:{type:Boolean},headerRefs:{},hideNavigation:{},escClose:{type:Boolean},useRelative:{type:Boolean},height:{},textInput:{type:[Boolean,Object]},config:{},noOverlayFocus:{type:Boolean},focusValue:{},menuWrapRef:{},ariaLabels:{},overlayLabel:{}},emits:["selected","toggle","reset-flow","hover-value"],setup(e,{expose:t,emit:n}){const{setSelectionGrid:i,buildMultiLevelMatrix:a,setMonthPicker:o}=QJ(),s=n,r=e,{defaultedAriaLabels:l,defaultedTextInput:c,defaultedConfig:u}=eZ(r),{hideNavigationButtons:h}
5211=S0(),d=It(!1),f=It(null),p=It(null),g=It([]),m=It(),v=It(null),y=It(0),b=It(null);ti(()=>{f.value=null}),ei(()=>{an().then(()=>S()),r.noOverlayFocus||w(),_(!0)}),ai(()=>_(!1));const _=e=>{var t;r.arrowNavigation&&(null!=(t=r.headerRefs)&&t.length?o(e):i(e))},w=()=>{var e;const t=jX(p);t&&(c.value.enabled||(f.value?null==(e=f.value)||e.focus({preventScroll:!0}):t.focus({preventScroll:!0})),d.value=t.clientHeight<t.scrollHeight)},k=bo(()=>({dp__overlay:!0,"dp--overlay-absolute":!r.useRelative,"dp--overlay-relative":r.useRelative})),x=bo(()=>r.useRelative?{height:"".concat(r.height,"px"),width:"var(--dp-menu-min-width)"}:void 0),T=bo(()=>({dp__overlay_col:!0})),C=bo(()=>({dp__btn:!0,dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:d.value,dp__button_bottom:r.isLast})),E=bo(()=>{var e,t;return{dp__overlay_container:!0,dp__container_flex:(null==(e=r.items)?void 0:e.length)<=6,dp__container_block:(null==(t=r.items)?void 0:t.length)>6}});pa(()=>r.items,()=>S(!1),{deep:!0});const S=(e=!0)=>{an().then(()=>{const t=jX(f),n=jX(p),i=jX(v),a=jX(b),o=i?i.getBoundingClientRect().height:0;n&&(n.getBoundingClientRect().height?y.value=n.getBoundingClientRect().height-o:y.value=u.value.modeHeight-o),t&&a&&e&&(a.scrollTop=t.offsetTop-a.offsetTop-(y.value/2-t.getBoundingClientRect().height)-o)})},I=e=>{e.disabled||s("selected",e.value)},A=()=>{s("toggle"),s("reset-flow")},D=()=>{var e,t;const n=null!=(e=r.headerRefs)&&e.length?[r.headerRefs].concat(g.value):g.value.concat([r.skipButtonRef?[]:[v.value]]);a(n,null!=(t=r.headerRefs)&&t.length?"monthPicker":"selectionGrid")},P=e=>{r.arrowNavigation||XX(e,u.value,!0)},O=e=>{switch(e.key){case VX.esc:return void(r.escClose&&A());case VX.arrowLeft:case VX.arrowRight:case VX.arrowUp:case VX.arrowDown:return P(e);default:return}},M=e=>e.key===VX.enter?A():e.key===VX.tab?(()=>{var e;if(A(),!r.isLast){const t=JX(null!=(e=r.menuWrapRef)?e:null,"action-row");if(t){const e=YX(t);null==e||e.focus()}}})():void 0;return t({focusGrid:w}),(e,t)=>{var n;return Ma(),Va("div",{ref_key:"gridWrapRef",ref:p,class:G(k.value),style:j(x.value),role:e.useRelative?void 0:"dialog","aria-label":e.overlayLabel,tabindex:e.useRelative?void 0:"0",onKeydown:O,onClick:t[0]||(t[0]=Es(()=>{},["prevent"]))},[Ha("div",{ref_key:"containerRef",ref:b,class:G(E.value),style:j({"--dp-overlay-height":"".concat(y.value,"px")}),role:"grid"},[Ha("div",lZ,[vi(e.$slots,"header")]),e.$slots.overlay?vi(e.$slots,"overlay",{key:0}):(Ma(!0),Va(Sa,{key:1},gi(e.items,(t,n)=>(Ma(),Va("div",{key:n,class:G(["dp__overlay_row",{dp__flex_row:e.items.length>=3}]),role:"row"},[(Ma(!0),Va(Sa,null,gi(t,(t,i)=>(Ma(),Va("div",{key:t.value,ref_for:!0,ref:e=>((e,t,n,i)=>{e&&((t.active||t.value===r.focusValue)&&(f.value=e),r.arrowNavigation&&(Array.isArray(g.value[n])?g.value[n][i]=e:g.value[n]=[e],D()))})(e,t,n,i),role:"gridcell",class:G(T.value),"aria-selected":t.active||void 0,"aria-disabled":t.disabled||void 0,tabindex:"0","data-test":t.text,onClick:Es(e=>I(t),["prevent"]),onKeydown:e=>Ot(iJ)(e,()=>I(t),!0),onMouseover:e=>(e=>{m.value=e,s("hover-value",e)})(t.value)},[Ha("div",{class:G(t.className)},[e.$slots.item?vi(e.$slots,"item",{key:0,item:t}):Qa("",!0),e.$slots.item?Qa("",!0):(Ma(),Va(Sa,{key:1},[Ga(ee(t.text),1)],64))],2)],42,cZ))),128))],2))),128))],6),e.$slots["button-icon"]?gn((Ma(),Va("button",{key:0,ref_key:"toggleButton",ref:v,type:"button","aria-label":null==(n=Ot(l))?void 0:n.toggleOverlay,class:G(C.value),tabindex:"0",onClick:A,onKeydown:M},[vi(e.$slots,"button-icon")],42,uZ)),[[Go,!Ot(h)(e.hideNavigation,e.type)]]):Qa("",!0)],46,rZ)}}}),dZ=jn({__name:"InstanceWrap",props:{multiCalendars:{},stretch:{type:Boolean},collapse:{type:Boolean}},setup(e){const t=e,n=bo(()=>t.multiCalendars>0?[...Array(t.multiCalendars).keys()]:[0]),i=bo(()=>({dp__instance_calendar:t.multiCalendars>0}));return(e,t)=>(Ma(),Va("div",{class:G({dp__menu_inner:!e.stretch,"dp--menu--inner-stretched":e.stretch,dp__flex_display:e.multiCalendars>0,"dp--flex-display-collapsed":e.collapse})},[(Ma(!0),Va(Sa,null,gi(n.value,(t,n)=>(Ma(),Va("div",{key:t,class:G(i.value)}
5211,[vi(e.$slots,"default",{instance:t,index:n})],2))),128))],2))}}),fZ=["data-dp-element","aria-label","aria-disabled"],pZ=jn({compatConfig:{MODE:3},__name:"ArrowBtn",props:{ariaLabel:{},elName:{},disabled:{type:Boolean}},emits:["activate","set-ref"],setup(e,{emit:t}){const n=t,i=It(null);return ei(()=>n("set-ref",i)),(e,t)=>(Ma(),Va("button",{ref_key:"elRef",ref:i,type:"button","data-dp-element":e.elName,class:"dp__btn dp--arrow-btn-nav",tabindex:"0","aria-label":e.ariaLabel,"aria-disabled":e.disabled||void 0,onClick:t[0]||(t[0]=t=>e.$emit("activate")),onKeydown:t[1]||(t[1]=t=>Ot(iJ)(t,()=>e.$emit("activate"),!0))},[Ha("span",{class:G(["dp__inner_nav",{dp__inner_nav_disabled:e.disabled}])},[vi(e.$slots,"default")],2)],40,fZ))}}),gZ=["aria-label","data-test"],mZ=jn({__name:"YearModePicker",props:{...iZ,showYearPicker:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},instance:{type:Number,default:0},year:{type:Number,default:0},isDisabled:{type:Function,default:()=>!1}},emits:["toggle-year-picker","year-select","handle-year"],setup(e,{emit:t}){const n=t,i=e,{showRightIcon:a,showLeftIcon:o}=S0(),{defaultedConfig:s,defaultedMultiCalendars:r,defaultedAriaLabels:l,defaultedTransitions:c,defaultedUI:u}=eZ(i),{showTransition:h,transitionName:d}=x0(c),f=It(!1),p=(e=!1,t)=>{f.value=!f.value,n("toggle-year-picker",{flow:e,show:t})},g=(e=!1)=>{n("handle-year",e)};return(t,i)=>{var c,m,v,y,b;return Ma(),Va(Sa,null,[Ha("div",{class:G(["dp--year-mode-picker",{"dp--hidden-el":f.value}])},[Ot(o)(Ot(r),e.instance)?(Ma(),qa(pZ,{key:0,ref:"mpPrevIconRef","aria-label":null==(c=Ot(l))?void 0:c.prevYear,disabled:e.isDisabled(!1),class:G(null==(m=Ot(u))?void 0:m.navBtnPrev),onActivate:i[0]||(i[0]=e=>g(!1))},{default:pn(()=>[t.$slots["arrow-left"]?vi(t.$slots,"arrow-left",{key:0}):Qa("",!0),t.$slots["arrow-left"]?Qa("",!0):(Ma(),qa(Ot(xX),{key:1}))]),_:3},8,["aria-label","disabled","class"])):Qa("",!0),Ha("button",{ref:"mpYearButtonRef",class:"dp__btn dp--year-select",type:"button","aria-label":"".concat(e.year,"-").concat(null==(v=Ot(l))?void 0:v.openYearsOverlay),"data-test":"year-mode-btn-".concat(e.instance),onClick:i[1]||(i[1]=()=>p(!1)),onKeydown:i[2]||(i[2]=Is(()=>p(!1),["enter"]))},[t.$slots.year?vi(t.$slots,"year",{key:0,year:e.year}):Qa("",!0),t.$slots.year?Qa("",!0):(Ma(),Va(Sa,{key:1},[Ga(ee(e.year),1)],64))],40,gZ),Ot(a)(Ot(r),e.instance)?(Ma(),qa(pZ,{key:1,ref:"mpNextIconRef","aria-label":null==(y=Ot(l))?void 0:y.nextYear,disabled:e.isDisabled(!0),class:G(null==(b=Ot(u))?void 0:b.navBtnNext),onActivate:i[3]||(i[3]=e=>g(!0))},{default:pn(()=>[t.$slots["arrow-right"]?vi(t.$slots,"arrow-right",{key:0}):Qa("",!0),t.$slots["arrow-right"]?Qa("",!0):(Ma(),qa(Ot(TX),{key:1}))]),_:3},8,["aria-label","disabled","class"])):Qa("",!0)],2),za(Mo,{name:Ot(d)(e.showYearPicker),css:Ot(h)},{default:pn(()=>{var a,o;return[e.showYearPicker?(Ma(),qa(hZ,{key:0,items:e.items,"text-input":t.textInput,"esc-close":t.escClose,config:t.config,"is-last":t.autoApply&&!Ot(s).keepActionRow,"hide-navigation":t.hideNavigation,"aria-labels":t.ariaLabels,"overlay-label":null==(o=null==(a=Ot(l))?void 0:a.yearPicker)?void 0:o.call(a,!0),type:"year",onToggle:p,onSelected:i[4]||(i[4]=e=>(e=>{f.value=!1,n("year-select",e)})(e))},mi({"button-icon":pn(()=>[t.$slots["calendar-icon"]?vi(t.$slots,"calendar-icon",{key:0}):Qa("",!0),t.$slots["calendar-icon"]?Qa("",!0):(Ma(),qa(Ot(wX),{key:1}))]),_:2},[t.$slots["year-overlay-value"]?{name:"item",fn:pn(({item:e})=>[vi(t.$slots,"year-overlay-value",{text:e.text,value:e.value})]),key:"0"}:void 0]),1032,["items","text-input","esc-close","config","is-last","hide-navigation","aria-labels","overlay-label"])):Qa("",!0)]}),_:3},8,["name","css"])],64)}}}),vZ=(e,t,n)=>{if(t.value&&Array.isArray(t.value))if(t.value.some(t=>uJ(e,t))){const n=t.value.filter(t=>!uJ(t,e));t.value=n.length?n:null}else(n&&+n>t.value.length||!n)&&t.value.push(e);else t.value=[e]},yZ=(e,t,n)=>{let i=e.value?e.value.slice():[];return 2===i.length&&null!==i[1]&&(i=[]),i.length?cJ(t,i[0])?(i.unshift(t),n("range-start",i[0]),n("range-start",i[1])):(i[1]=t,n("range-end",t)):(i=[t],n("range-start",t)),i},bZ=(e,t,n,i)=>{e&&(e[0]&&e[1]&&n&&t("auto-apply"),e[0]&&!e[1]&&i&&n&&t("auto-apply"))}
5211,_Z=e=>{Array.isArray(e.value)&&e.value.length<=2&&e.range?e.modelValue.value=e.value.map(t=>IX(sJ(t),e.timezone)):Array.isArray(e.value)||(e.modelValue.value=IX(sJ(e.value),e.timezone))},wZ=(e,t,n,i)=>Array.isArray(t.value)&&(2===t.value.length||1===t.value.length&&i.value.partialRange)?i.value.fixedStart&&(hJ(e,t.value[0])||uJ(e,t.value[0]))?[t.value[0],e]:i.value.fixedEnd&&(cJ(e,t.value[1])||uJ(e,t.value[1]))?[e,t.value[1]]:(n("invalid-fixed-range",e),t.value):[],kZ=({multiCalendars:e,range:t,highlight:n,propDates:i,calendars:a,modelValue:o,props:s,filters:r,year:l,month:c,emit:u})=>{const h=bo(()=>BX(s.yearRange,s.locale,s.reverseYears)),d=It([!1]),f=bo(()=>(e,t)=>{const n=pX(fJ(new Date),{month:c.value(e),year:l.value(e)}),a=t?yQ(n):bQ(n);return CJ(a,i.value.maxDate,i.value.minDate,s.preventMinMaxNavigation,t)}),p=()=>Array.isArray(o.value)&&e.value.solo&&o.value[1],g=()=>{for(let t=0;t<e.value.count;t++)if(0===t)a.value[t]=a.value[0];else if(t===e.value.count-1&&p())a.value[t]={month:u$(o.value[1]),year:d$(o.value[1])};else{const e=pX(sJ(),a.value[t-1]);a.value[t]={month:u$(e),year:d$(lQ(e,1))}}},m=n=>s.focusStartDate||e.value.solo?n[0]:n[1]?((e,n)=>{const i=gQ(n,e);return t.value.showLastInRange&&i>1?n:e})(n[0],n[1]):n[0],v=()=>{(()=>{if(o.value){const e=Array.isArray(o.value)?m(o.value):o.value;a.value[0]={month:u$(e),year:d$(e)}}})(),e.value.count&&g()};pa(o,(e,t)=>{s.isTextInputDate&&JSON.stringify(null!=e?e:{})!==JSON.stringify(null!=t?t:{})&&v()}),ei(()=>{v()});const y=(t,n)=>{a.value[n].year=t,u("update-month-year",{instance:n,year:t,month:a.value[n].month}),e.value.count&&!e.value.solo&&(t=>{if(!t)return g();const n=pX(sJ(),a.value[t]);a.value[0].year=d$(_X(n,e.value.count-1)),g()})(n)},b=bo(()=>e=>$X(h.value,t=>{var a;return{active:l.value(e)===t.value,disabled:QX(t.value,yJ(i.value.minDate),yJ(i.value.maxDate))||(null==(a=r.value.years)?void 0:a.includes(l.value(e))),highlighted:VJ(n.value,t.value)}})),_=(e,t=!1,n)=>{t||u("reset-flow"),d.value[e]=void 0!==n?n:!d.value[e],d.value[e]?u("overlay-toggle",{open:!0,overlay:NX.year}):(u("overlay-closed"),u("overlay-toggle",{open:!1,overlay:NX.year}))};return{isDisabled:f,groupedYears:b,showYearPicker:d,selectYear:y,toggleYearPicker:_,handleYearSelect:(e,t)=>{y(e,t),_(t)},handleYear:(e,t=!1)=>{if(!f.value(e,t)){const n=t?l.value(e)+1:l.value(e)-1;y(n,e)}}}},xZ=(e,t)=>{const{defaultedMultiCalendars:n,defaultedAriaLabels:i,defaultedTransitions:a,defaultedConfig:o,defaultedRange:s,defaultedHighlight:r,propDates:l,defaultedTz:c,defaultedFilters:u,defaultedMultiDates:h}=eZ(e),{modelValue:d,year:f,month:p,calendars:g}=T0(e,t,()=>{e.isTextInputDate&&b(d$(sJ(e.startDate)),0)}),m=bo(()=>UX(e.formatLocale,e.locale,e.monthNameFormat)),v=It(null),{checkMinMaxRange:y}=E0(e),{selectYear:b,groupedYears:_,showYearPicker:w,toggleYearPicker:k,handleYearSelect:x,handleYear:T,isDisabled:C}=kZ({modelValue:d,multiCalendars:n,range:s,highlight:r,calendars:g,year:f,propDates:l,month:p,filters:u,props:e,emit:t});ei(()=>{e.startDate&&(d.value&&e.focusStartDate||!d.value)&&b(d$(sJ(e.startDate)),0)});const E=e=>e?{month:u$(e),year:d$(e)}:{month:null,year:null},S=()=>d.value?Array.isArray(d.value)?d.value.map(e=>E(e)):E(d.value):E(),I=(e,t,n)=>{var i,a;const o=S();return!!Array.isArray(o)&&(f.value(t)===(null==(i=o[n])?void 0:i.year)&&e===(null==(a=o[n])?void 0:a.month))},A=bo(()=>e=>$X(m.value,t=>{var n;const i=((e,t)=>{const n=g.value[e],i=S();return Array.isArray(i)?i.some(e=>e.year===(null==n?void 0:n.year)&&e.month===t):(null==n?void 0:n.year)===i.year&&t===i.month})(e,t.value),a=QX(t.value,mJ(f.value(e),l.value.minDate),vJ(f.value(e),l.value.maxDate))||((e,t)=>e instanceof Map?Array.from(e.values()).filter(e=>d$(sJ(e))===t).map(e=>u$(e)):[])(l.value.disabledDates,f.value(e)).includes(t.value)||(null==(n=u.value.months)?void 0:n.includes(t.value)),o=((e,t)=>{if(s.value.enabled){const n=S();if(Array.isArray(d.value)&&Array.isArray(n)){const n=I(e,t,0)||I(e,t,1),i=TJ(fJ(sJ()),e,f.value(t));return dJ(d.value,v.value,i)&&!n}return!1}return!1})(t.value,e);return{active:i,disabled:a,isBetween:o,highlighted:LJ(r.value,t.value,f.value(e))}})),D=(e,t)=>TJ(fJ(sJ()),e,f.value(t)),P=(e,n,i)=>{let a=i;if(!a&&0!==a){const t=S();a=Array.isArray(t)?t[e].month:t.month}
5211t("update-month-year",{instance:e,year:n,month:a})};return{groupedMonths:A,groupedYears:_,year:f,isDisabled:C,defaultedMultiCalendars:n,defaultedAriaLabels:i,defaultedTransitions:a,defaultedConfig:o,showYearPicker:w,modelValue:d,presetDate:(e,n)=>{_Z({value:e,modelValue:d,range:s.value.enabled,timezone:n?void 0:c.value.timezone}),t("auto-apply")},setHoverDate:(e,t)=>{v.value=D(e,t)},selectMonth:(n,i)=>(g.value[i].month=n,P(i,g.value[i].year,n),h.value.enabled?((e,n)=>{vZ(D(e,n),d,h.value.limit),t("auto-apply",!0)})(n,i):s.value.enabled?((n,i)=>{const a=D(n,i);s.value.fixedEnd||s.value.fixedStart?d.value=wZ(a,d,t,s):d.value?y(a,d.value)&&(d.value=yZ(d,D(n,i),t)):d.value=[D(n,i)],an().then(()=>{bZ(d.value,t,e.autoApply,e.modelAuto)})})(n,i):((e,n)=>{const i=d.value?d.value:fJ(new Date);d.value=TJ(i,e,f.value(n)),t("auto-apply"),t("update-flow-step")})(n,i)),selectYear:(e,t)=>{b(e,t),P(t,e,null)},toggleYearPicker:k,handleYearSelect:x,handleYear:T,getModelMonthYear:S}},TZ=jn({compatConfig:{MODE:3},__name:"MonthPicker",props:{...iZ},emits:["update:internal-model-value","overlay-closed","reset-flow","range-start","range-end","auto-apply","update-month-year","update-flow-step","mount","invalid-fixed-range","overlay-toggle"],setup(e,{expose:t,emit:n}){const i=n,a=xi(),o=k0(a,"yearMode"),s=e;ei(()=>{s.shadow||i("mount",null)});const{groupedMonths:r,groupedYears:l,year:c,isDisabled:u,defaultedMultiCalendars:h,defaultedConfig:d,showYearPicker:f,modelValue:p,presetDate:g,setHoverDate:m,selectMonth:v,selectYear:y,toggleYearPicker:b,handleYearSelect:_,handleYear:w,getModelMonthYear:k}=xZ(s,i);return t({getSidebarProps:()=>({modelValue:p,year:c,getModelMonthYear:k,selectMonth:v,selectYear:y,handleYear:w}),presetDate:g,toggleYearPicker:e=>b(0,e)}),(e,t)=>(Ma(),qa(dZ,{"multi-calendars":Ot(h).count,collapse:e.collapse,stretch:""},{default:pn(({instance:t})=>[e.$slots["top-extra"]?vi(e.$slots,"top-extra",{key:0,value:e.internalModelValue}):Qa("",!0),e.$slots["month-year"]?vi(e.$slots,"month-year",Y(Za({key:1},{year:Ot(c),months:Ot(r)(t),years:Ot(l)(t),selectMonth:Ot(v),selectYear:Ot(y),instance:t}))):(Ma(),qa(hZ,{key:2,items:Ot(r)(t),"arrow-navigation":e.arrowNavigation,"is-last":e.autoApply&&!Ot(d).keepActionRow,"esc-close":e.escClose,height:Ot(d).modeHeight,config:e.config,"no-overlay-focus":!(!e.noOverlayFocus&&!e.textInput),"use-relative":"",type:"month",onSelected:e=>Ot(v)(e,t),onHoverValue:e=>Ot(m)(e,t)},mi({header:pn(()=>[za(mZ,Za(e.$props,{items:Ot(l)(t),instance:t,"show-year-picker":Ot(f)[t],year:Ot(c)(t),"is-disabled":e=>Ot(u)(t,e),onHandleYear:e=>Ot(w)(t,e),onYearSelect:e=>Ot(_)(e,t),onToggleYearPicker:e=>Ot(b)(t,null==e?void 0:e.flow,null==e?void 0:e.show)}),mi({_:2},[gi(Ot(o),(t,n)=>({name:t,fn:pn(n=>[vi(e.$slots,t,Y(Wa(n)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),_:2},[e.$slots["month-overlay-value"]?{name:"item",fn:pn(({item:t})=>[vi(e.$slots,"month-overlay-value",{text:t.text,value:t.value})]),key:"0"}:void 0]),1032,["items","arrow-navigation","is-last","esc-close","height","config","no-overlay-focus","onSelected","onHoverValue"]))]),_:3},8,["multi-calendars","collapse"]))}}),CZ=(e,t)=>{const{modelValue:n}=T0(e,t,()=>{e.isTextInputDate&&(c.value=d$(sJ(e.startDate)))}),i=It(null),{defaultedHighlight:a,defaultedMultiDates:o,defaultedFilters:s,defaultedRange:r,propDates:l}=eZ(e),c=It();ei(()=>{e.startDate&&(n.value&&e.focusStartDate||!n.value)&&(c.value=d$(sJ(e.startDate)))});const u=bo(()=>$X(BX(e.yearRange,e.locale,e.reverseYears),e=>{const t=(e=>Array.isArray(n.value)?n.value.some(t=>d$(t)===e):!!n.value&&d$(n.value)===e)(e.value),o=QX(e.value,yJ(l.value.minDate),yJ(l.value.maxDate))||s.value.years.includes(e.value),c=(e=>!(!r.value.enabled||!Array.isArray(n.value))&&dJ(n.value,i.value,h(e)))(e.value)&&!t;return{active:t,disabled:o,isBetween:c,highlighted:VJ(a.value,e.value)}})),h=e=>vX(fJ(bQ(new Date)),e);return{groupedYears:u,modelValue:n,focusYear:c,setHoverValue:e=>{i.value=vX(fJ(new Date),e)},selectYear:i=>{var a;if(t("update-month-year",{instance:0,year:i}),o.value.enabled)return n.value?Array.isArray(n.value)&&((null==(a=n.value)?void 0:a.map(e=>d$(e))).includes(i)?n.value=n.value.filter(e=>d$(e)!==i):n.value.push(vX(rJ(sJ()),i))):n.value=[vX(rJ(bQ(sJ())),i)],t("auto-apply",!0);r.value.enabled?(n.value=yZ(n,h(i),t),an().then(()=>{bZ(n.value,t,e.autoApply,e.modelAuto)})):(n.value=h(i),t("auto-apply"))}}},EZ=jn({compatConfig:{MODE:3},__name:"YearPicker",props:{...iZ},emits:["update:internal-model-value","reset-flow","range-start","range-end","auto-apply","update-month-year"],setup(e,{expose:t,emit:n}){const i=n,a=e,{groupedYears:o,modelValue:s,focusYear:r,selectYear:l,setHoverValue:c}=CZ(a,i),{defaultedConfig:u}=eZ(a);return t({getSidebarProps:()=>({modelValue:s,selectYear:l})}),(e,t)=>(Ma(),Va("div",null,[e.$slots["top-extra"]?vi(e.$slots,"top-extra",{key:0,value:e.internalModelValue}):Qa("",!0),e.$slots["month-year"]?vi(e.$slots,"month-year",Y(Za({key:1},{years:Ot(o),selectYear:Ot(l)}))):(Ma(),qa(hZ,{key:2,items:Ot(o),"is-last":e.autoApply&&!Ot(u).keepActionRow,height:Ot(u).modeHeight,config:e.config,"no-overlay-focus":!(!e.noOverlayFocus&&!e.textInput),"focus-value":Ot(r),type:"year","use-relative":"",onSelected:Ot(l),on
5211HoverValue:Ot(c)},mi({_:2},[e.$slots["year-overlay-value"]?{name:"item",fn:pn(({item:t})=>[vi(e.$slots,"year-overlay-value",{text:t.text,value:t.value})]),key:"0"}:void 0]),1032,["items","is-last","height","config","no-overlay-focus","focus-value","onSelected","onHoverValue"]))]))}}),SZ={key:0,class:"dp__time_input"},IZ=["data-test","aria-label","onKeydown","onClick","onMousedown"],AZ=["aria-label","disabled","data-test","onKeydown","onClick"],DZ=["data-test","aria-label","onKeydown","onClick","onMousedown"],PZ={key:0},OZ=["aria-label"],MZ=jn({compatConfig:{MODE:3},__name:"TimeInput",props:{hours:{type:Number,default:0},minutes:{type:Number,default:0},seconds:{type:Number,default:0},closeTimePickerBtn:{type:Object,default:null},order:{type:Number,default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...iZ},emits:["set-hours","set-minutes","update:hours","update:minutes","update:seconds","reset-flow","mounted","overlay-closed","overlay-opened","am-pm-change"],setup(e,{expose:t,emit:n}){const i=n,a=e,{setTimePickerElements:o,setTimePickerBackRef:s}=QJ(),{defaultedAriaLabels:r,defaultedTransitions:l,defaultedFilters:c,defaultedConfig:u,defaultedRange:h}=eZ(a),{transitionName:d,showTransition:f}=x0(l),p=gt({hours:!1,minutes:!1,seconds:!1}
5211),g=It("AM"),m=It(null),v=It([]),y=It(),b=It(!1);ei(()=>{i("mounted")});const _=e=>pX(new Date,{hours:e.hours,minutes:e.minutes,seconds:a.enableSeconds?e.seconds:0,milliseconds:0}),w=bo(()=>e=>M(e,a[e])||x(e,a[e])),k=bo(()=>({hours:a.hours,minutes:a.minutes,seconds:a.seconds})),x=(e,t)=>!(!h.value.enabled||h.value.disableTimeRangeValidation)&&!a.validateTime(e,t),T=(e,t)=>{if(h.value.enabled&&!h.value.disableTimeRangeValidation){const n=t?+a["".concat(e,"Increment")]:-+a["".concat(e,"Increment")],i=a[e]+n;return!a.validateTime(e,i)}return!1},C=bo(()=>e=>!L(+a[e]+ +a["".concat(e,"Increment")],e)||T(e,!0)),E=bo(()=>e=>!L(+a[e]-+a["".concat(e,"Increment")],e)||T(e,!1)),S=(e,t)=>YY(pX(sJ(),e),t),I=(e,t)=>bX(pX(sJ(),e),t),A=bo(()=>({dp__time_col:!0,dp__time_col_block:!a.timePickerInline,dp__time_col_reg_block:!a.enableSeconds&&a.is24&&!a.timePickerInline,dp__time_col_reg_inline:!a.enableSeconds&&a.is24&&a.timePickerInline,dp__time_col_reg_with_button:!a.enableSeconds&&!a.is24,dp__time_col_sec:a.enableSeconds&&a.is24,dp__time_col_sec_with_button:a.enableSeconds&&!a.is24})),D=bo(()=>{const e=[{type:"hours"}];return a.enableMinutes&&e.push({type:"",separator:!0},{type:"minutes"}),a.enableSeconds&&e.push({type:"",separator:!0},{type:"seconds"}),e}),P=bo(()=>D.value.filter(e=>!e.separator)),O=bo(()=>e=>{if("hours"===e){const e=U(+a.hours);return{text:e<10?"0".concat(e):"".concat(e),value:e}}return{text:a[e]<10?"0".concat(a[e]):"".concat(a[e]),value:a[e]}}),M=(e,t)=>{var n;if(!a.disabledTimesConfig)return!1;const i=a.disabledTimesConfig(a.order,"hours"===e?t:void 0);return!i[e]||!(null==(n=i[e])||!n.includes(t))},N=(e,t)=>"hours"!==t||"AM"===g.value?e:e+12,R=e=>{const t=a.is24?24:12,n="hours"===e?t:60,i=+a["".concat(e,"GridIncrement")],o=[];for(let s="hours"!==e||a.is24?0:i;s<n;s+=i)o.push({value:a.is24?s:N(s,e),text:s<10?"0".concat(s):"".concat(s)});return"hours"===e&&!a.is24&&o.unshift({value:"PM"===g.value?12:0,text:"12"}),$X(o,t=>({active:!1,disabled:c.value.times[e].includes(t.value)||!L(t.value,e)||M(e,t.value)||x(e,t.value)}))},L=(e,t)=>{const n=a.minTime?_(pJ(a.minTime)):null,i=a.maxTime?_(pJ(a.maxTime)):null,o=_(pJ(k.value,t,"minutes"===t||"seconds"===t?(e=>e>=0?e:59)(e):(e=>e>=0?e:23)(e)));return n&&i?(p$(o,i)||g$(o,i))&&(f$(o,n)||g$(o,n)):n?f$(o,n)||g$(o,n):!i||(p$(o,i)||g$(o,i))},V=e=>a["no".concat(e[0].toUpperCase()+e.slice(1),"Overlay")],q=e=>{V(e)||(p[e]=!p[e],p[e]?(b.value=!0,i("overlay-opened",e)):(b.value=!1,i("overlay-closed",e)))},F=()=>{y.value&&clearTimeout(y.value)},B=(e,t=!0,n)=>{const o=t?S:I,s=t?+a["".concat(e,"Increment")]:-+a["".concat(e,"Increment")];L(+a[e]+s,e)&&i("update:".concat(e),(e=>"hours"===e?l$:"minutes"===e?c$:h$)(e)(o({[e]:+a[e]},{[e]:+a["".concat(e,"Increment")]}))),(null==n||!n.keyboard)&&u.value.timeArrowHoldThreshold&&(y.value=setTimeout(()=>{B(e,t)},u.value.timeArrowHoldThreshold))},U=e=>a.is24?e:(g.value=e>=12?"PM":"AM",(e=>[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11][e])(e)),j=()=>{"PM"===g.value?(g.value="AM",i("update:hours",a.hours-12)):(g.value="PM",i("update:hours",a.hours+12)),i("am-pm-change",g.value)},H=(e,t,n)=>{if(e&&a.arrowNavigation){Array.isArray(v.value[t])?v.value[t][n]=e:v.value[t]=[e];const i=v.value.reduce((e,t)=>t.map((n,i)=>[...e[i]||[],t[i]]),[]);s(a.closeTimePickerBtn),m.value&&(i[1]=i[1].concat(m.value)),o(i,a.order)}};return t({openChildCmp:e=>{p[e]=!0}}),(e,t)=>{var n;return e.disabled?Qa("",!0):(Ma(),Va("div",SZ,[(Ma(!0),Va(Sa,null,gi(D.value,(n,i)=>{var o,s,l;return Ma(),Va("div",{key:i,class:G(A.value)},[n.separator?(Ma(),Va(Sa,{key:0},[b.value?Qa("",!0):(Ma(),Va(Sa,{key:0},[Ga(":")],64))],64)):(Ma(),Va(Sa,{key:1},[Ha("button",{ref_for:!0,ref:e=>H(e,i,0),type:"button",class:G({dp__btn:!0,dp__inc_dec_button:!e.timePickerInline,dp__inc_dec_button_inline:e.timePickerInline,dp__tp_inline_btn_top:e.timePickerInline,dp__inc_dec_button_disabled:C.value(n.type),"dp--hidden-el":b.value}),"data-test":"".concat(n.type,"-time-inc-btn-").concat(a.order),"aria-label":null==(o=Ot(r))?void 0:o.incrementValue(n.type),tabindex:"0",onKeydown:e=>Ot(iJ)(e,()=>B(n.type,!0,{keyboard:!0}),!0),onClick:e=>Ot(u).timeArrowHoldThreshold?void 0:B(n.type,!0),onMousedown:e=>Ot(u).timeArrowHoldThreshold?B(n.type,!0):void 0,onMouseup:F},[a.timePickerInline?(Ma(),Va(Sa,{key:1},[e.$slots["tp-inline-arrow-up"]?vi(e.$slots,"tp-inline-arrow-up",{key:0}):(Ma(),Va(Sa,{key:1},[t[2]||(t[2]=Ha("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1)),t[3]||(t[3]=Ha("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1))],64))],64)):(Ma(),Va(Sa,{key:0},[e.$slots["arrow-up"]?vi(e.$slots,"arrow-up",{key:0}):Qa("",!0),e.$slots["arrow-up"]?Qa("",!0):(Ma(),qa(Ot(EX),{key:1}))],64))],42,IZ),Ha("button",{ref_for:!0,ref:e=>H(e,i,1),type:"button","aria-label":"".concat(O.value(n.type).text,"-").concat(null==(s=Ot(r))?void 0:s.openTpOverlay(n.type)),class:G({dp__time_display:!0,dp__time_display_block:!e.timePickerInline,dp__time_display_inline:e.timePickerInline,"dp--time-invalid":w.value(n.type),"dp--time-overlay-btn":!w.value(n.type),"dp--hidden-el":b.value}),disabled:V(n.type),tabindex:"0","data-test":"".concat(n.type,"-toggle-overlay-btn-").concat(a.order),onKeydown:e=>Ot(iJ)(e,()=>q(n.type),!0),onClick:e=>q(n.type)},[e.$slots[n.type]?vi(e.$slots,n.type,{key:0,text:O.value(n.type).text,value:O.value(n.type).value}):Qa("",!0),e.$slots[n.type]?Qa("",!0):(Ma(),Va(Sa,{key:1},[Ga(ee(O.value(n.type).text),1)],64))],42,AZ),Ha("button",{ref_for:!0,ref:e=>H(e,i,2),type:"button",class:G({dp__btn:!0,dp__inc_dec_button:!e.timePickerInline,dp__inc_dec_button_inline:e.timePickerInline,dp__tp_inline_btn_bottom:e.timePickerInline,dp__inc_dec_button_disabled:E.value(n.type),"dp--hidden-el":b.value}),"data-test":"".concat(n.type,"-time-dec-btn-").concat(a.order),"aria-label":null==(l=Ot(r))?void 0:l.decrementValue(n.type),tabindex:"0",onKeydown:e=>Ot(iJ)(e,()=>B(n.type,!1,{keyboard:!0}),!0),onClick:e=>Ot(u).timeArrowHoldThreshold?void 0:B(n.type,!1),onMousedown:e=>Ot(u).timeArrowHoldThreshold?B(n.type,!1):void 0,onMouseup:F},[a.timePickerInline?(Ma(),Va(Sa,{key:1},[e.$slots["tp-inline-arrow-down"]?vi(e.$slots,"tp-inline-arrow-down",{key:0}):(Ma(),Va(Sa,{key:1},[t[4]||(t[4]=Ha("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1)),t[5]||(t[5]=Ha("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1))],64))],64)):(Ma(),Va(Sa,{key:0},[e.$slots["arrow-down"]?vi(e.$slots,"arrow-down",{key:0}):Qa("",!0),e.$slots["arrow-down"]?Qa("",!0):(Ma(),qa(Ot(SX),{key:1}))],64))],42,DZ)],64))],2)}
5211),128)),e.is24?Qa("",!0):(Ma(),Va("div",PZ,[e.$slots["am-pm-button"]?vi(e.$slots,"am-pm-button",{key:0,toggle:j,value:g.value}):Qa("",!0),e.$slots["am-pm-button"]?Qa("",!0):(Ma(),Va("button",{key:1,ref_key:"amPmButton",ref:m,type:"button",class:"dp__pm_am_button",role:"button","aria-label":null==(n=Ot(r))?void 0:n.amPmButton,tabindex:"0",onClick:j,onKeydown:t[0]||(t[0]=e=>Ot(iJ)(e,()=>j(),!0))},ee(g.value),41,OZ))])),(Ma(!0),Va(Sa,null,gi(P.value,(n,a)=>(Ma(),qa(Mo,{key:a,name:Ot(d)(p[n.type]),css:Ot(f)},{default:pn(()=>{var a,o;return[p[n.type]?(Ma(),qa(hZ,{key:0,items:R(n.type),"is-last":e.autoApply&&!Ot(u).keepActionRow,"esc-close":e.escClose,type:n.type,"text-input":e.textInput,config:e.config,"arrow-navigation":e.arrowNavigation,"aria-labels":e.ariaLabels,"overlay-label":null==(o=(a=Ot(r)).timeOverlay)?void 0:o.call(a,n.type),onSelected:e=>((e,t)=>(q(e),i("update:".concat(e),t)))(n.type,e),onToggle:e=>q(n.type),onResetFlow:t[1]||(t[1]=t=>e.$emit("reset-flow"))},mi({"button-icon":pn(()=>[e.$slots["clock-icon"]?vi(e.$slots,"clock-icon",{key:0}):Qa("",!0),e.$slots["clock-icon"]?Qa("",!0):(Ma(),qa(di(e.timePickerInline?Ot(wX):Ot(CX)),{key:1}))]),_:2},[e.$slots["".concat(n.type,"-overlay-value")]?{name:"item",fn:pn(({item:t})=>[vi(e.$slots,"".concat(n.type,"-overlay-value"),{text:t.text,value:t.value})]),key:"0"}:void 0,e.$slots["".concat(n.type,"-overlay-header")]?{name:"header",fn:pn(()=>[vi(e.$slots,"".concat(n.type,"-overlay-header"),{toggle:()=>q(n.type)})]),key:"1"}:void 0]),1032,["items","is-last","esc-close","type","text-input","config","arrow-navigation","aria-labels","overlay-label","onSelected","onToggle"])):Qa("",!0)]}),_:2},1032,["name","css"]))),128))]))}}}),NZ={class:"dp--tp-wrap"},RZ=["aria-label","tabindex"],LZ=["role","aria-label","tabindex"],VZ=["aria-label"],qZ=jn({compatConfig:{MODE:3},__name:"TimePicker",props:{hours:{type:[Number,Array],default:0},minutes:{type:[Number,Array],default:0},seconds:{type:[Number,Array],default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...iZ},emits:["update:hours","update:minutes","update:seconds","mount","reset-flow","overlay-opened","overlay-closed","am-pm-change"],setup(e,{expose:t,emit:n}){const i=n,a=e,{buildMatrix:o,setTimePicker:s}=QJ(),r=xi(),{defaultedTransitions:l,defaultedAriaLabels:c,defaultedTextInput:u,defaultedConfig:h,defaultedRange:d}=eZ(a),{transitionName:f,showTransition:p}=x0(l),{hideNavigationButtons:g}
5211=S0(),m=It(null),v=It(null),y=It([]),b=It(null),_=It(!1);ei(()=>{i("mount"),!a.timePicker&&a.arrowNavigation?o([jX(m.value)],"time"):s(!0,a.timePicker)});const w=bo(()=>!d.value.enabled||!a.modelAuto||HX(a.internalModelValue)),k=It(!1),x=e=>({hours:Array.isArray(a.hours)?a.hours[e]:a.hours,minutes:Array.isArray(a.minutes)?a.minutes[e]:a.minutes,seconds:Array.isArray(a.seconds)?a.seconds[e]:a.seconds}),T=bo(()=>{const e=[];if(d.value.enabled)for(let t=0;t<2;t++)e.push(x(t));else e.push(x(0));return e}),C=(e,t=!1,n="")=>{t||i("reset-flow"),k.value=e,i(e?"overlay-opened":"overlay-closed",NX.time),a.arrowNavigation&&s(e),an(()=>{""!==n&&y.value[0]&&y.value[0].openChildCmp(n)})},E=bo(()=>({dp__btn:!0,dp__button:!0,dp__button_bottom:a.autoApply&&!h.value.keepActionRow})),S=k0(r,"timePicker"),I=(e,t,n)=>d.value.enabled?0===t?[e,T.value[1][n]]:[T.value[0][n],e]:e,A=e=>{i("update:hours",e)},D=e=>{i("update:minutes",e)},P=e=>{i("update:seconds",e)},O=()=>{if(b.value&&!u.value.enabled&&!a.noOverlayFocus){const e=YX(b.value);e&&e.focus({preventScroll:!0})}},M=e=>{_.value=!1,i("overlay-closed",e)},N=e=>{_.value=!0,i("overlay-opened",e)};return t({toggleTimePicker:C}),(t,n)=>{var i;return Ma(),Va("div",NZ,[t.timePicker||t.timePickerInline?Qa("",!0):gn((Ma(),Va("button",{key:0,ref_key:"openTimePickerBtn",ref:m,type:"button",class:G({...E.value,"dp--hidden-el":k.value}),"aria-label":null==(i=Ot(c))?void 0:i.openTimePicker,tabindex:t.noOverlayFocus?void 0:0,"data-test":"open-time-picker-btn",onKeydown:n[0]||(n[0]=e=>Ot(iJ)(e,()=>C(!0))),onClick:n[1]||(n[1]=e=>C(!0))},[t.$slots["clock-icon"]?vi(t.$slots,"clock-icon",{key:0}):Qa("",!0),t.$slots["clock-icon"]?Qa("",!0):(Ma(),qa(Ot(CX),{key:1}))],42,RZ)),[[Go,!Ot(g)(t.hideNavigation,"time")]]),za(Mo,{name:Ot(f)(k.value),css:Ot(p)&&!t.timePickerInline},{default:pn(()=>{var i,o;return[k.value||t.timePicker||t.timePickerInline?(Ma(),Va("div",{key:0,ref_key:"overlayRef",ref:b,role:t.timePickerInline?void 0:"dialog",class:G({dp__overlay:!t.timePickerInline,"dp--overlay-absolute":!a.timePicker&&!t.timePickerInline,"dp--overlay-relative":a.timePicker}),style:j(t.timePicker?{height:"".concat(Ot(h).modeHeight,"px")}:void 0),"aria-label":null==(i=Ot(c))?void 0:i.timePicker,tabindex:t.timePickerInline?void 0:0},[Ha("div",{class:G(t.timePickerInline?"dp__time_picker_inline_container":"dp__overlay_container dp__container_flex dp__time_picker_overlay_container"),style:{display:"flex"}},[t.$slots["time-picker-overlay"]?vi(t.$slots,"time-picker-overlay",{key:0,hours:e.hours,minutes:e.minutes,seconds:e.seconds,setHours:A,setMinutes:D,setSeconds:P}):Qa("",!0),t.$slots["time-picker-overlay"]?Qa("",!0):(Ma(),Va("div",{key:1,class:G(t.timePickerInline?"dp__flex":"dp__overlay_row dp__flex_row")},[(Ma(!0),Va(Sa,null,gi(T.value,(i,a)=>gn((Ma(),qa(MZ,Za({key:a,ref_for:!0},{...t.$props,order:a,hours:i.hours,minutes:i.minutes,seconds:i.seconds,closeTimePickerBtn:v.value,disabledTimesConfig:e.disabledTimesConfig,disabled:0===a?Ot(d).fixedStart:Ot(d).fixedEnd},{ref_for:!0,ref_key:"timeInputRefs",ref:y,"validate-time":(t,n)=>e.validateTime(t,I(n,a,t)),"onUpdate:hours":e=>A(I(e,a,"hours")),"onUpdate:minutes":e=>D(I(e,a,"minutes")),"onUpdate:seconds":e=>P(I(e,a,"seconds")),onMounted:O,onOverlayClosed:M,onOverlayOpened:N,onAmPmChange:n[2]||(n[2]=e=>t.$emit("am-pm-change",e))}),mi({_:2},[gi(Ot(S),(e,n)=>({name:e,fn:pn(n=>[vi(t.$slots,e,Za({ref_for:!0},n))])}))]),1040,["validate-time","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"])),[[Go,0===a||w.value]])),128))],2)),t.timePicker||t.timePickerInline?Qa("",!0):gn((Ma(),Va("button",{key:2,ref_key:"closeTimePickerBtn",ref:v,type:"button",class:G({...E.value,"dp--hidden-el":_.value}),"aria-label":null==(o=Ot(c))?void 0:o.closeTimePicker,tabindex:"0",onKeydown:n[3]||(n[3]=e=>Ot(iJ)(e,()=>C(!1))),onClick:n[4]||(n[4]=e=>C(!1))},[t.$slots["calendar-icon"]?vi(t.$slots,"calendar-icon",{key:0}):Qa("",!0),t.$slots["calendar-icon"]?Qa("",!0):(Ma(),qa(Ot(wX),{key:1}))],42,VZ)),[[Go,!Ot(g)(t.hideNavigation,"time")]])],2)],14,LZ)):Qa("",!0)]}),_:3},8,["name","css"])])}}}),FZ=(e,t,n,i)=>{const{defaultedRange:a}=eZ(e),o=(e,n)=>Array.isArray(t[e])?t[e][n]:t[e],s=n=>e.enableSeconds?Array.isArray(t.seconds)?t.seconds[n]:t.seconds:0,r=(e,n)=>{t[e]=n},l=bo(()=>e.modelAuto&&a.value.enabled?!!Array.isArray(n.value)&&n.value.length>1:a.value.enabled),c=(e,i)=>{const o=Object.fromEntries(Object.keys(t).map(n=>n===e?[n,i]:[n,t[n]].slice()));if(l.value&&!a.value.disableTimeRangeValidation){const e=e=>n.value?lJ(n.value[e],o.hours[e],o.minutes[e],o.seconds[e]):null,t=e=>gX(n.value[e],0);
5211return!(uJ(e(0),e(1))&&(f$(e(0),t(1))||p$(e(1),t(0))))}return!0},u=(e,t)=>{c(e,t)&&(r(e,t),i&&i())},h=e=>{u("hours",e)},d=e=>{u("minutes",e)},f=e=>{u("seconds",e)},p=bo(()=>(n,i)=>{var o,s,r;if(Array.isArray(e.disabledTimes)){const{disabledArr:l,hours:c}=((n,i)=>{const o={hours:Array.isArray(t.hours)?t.hours[n]:t.hours,disabledArr:[]};return(i||0===i)&&(o.hours=i),Array.isArray(e.disabledTimes)&&(o.disabledArr=a.value.enabled&&Array.isArray(e.disabledTimes[n])?e.disabledTimes[n]:e.disabledTimes),o})(n,i),u=l.filter(e=>+e.hours===c);return"*"===(null==(r=u[0])?void 0:r.minutes)?{hours:[c],minutes:void 0,seconds:void 0}:{hours:[],minutes:null!=(o=null==u?void 0:u.map(e=>+e.minutes))?o:[],seconds:null!=(s=null==u?void 0:u.map(e=>e.seconds?+e.seconds:void 0))?s:[]}}return{hours:[],minutes:[],seconds:[]}});return{setTime:r,updateHours:h,updateMinutes:d,updateSeconds:f,getSetDateTime:(e,n)=>e?void 0!==n?lJ(e,o("hours",n),o("minutes",n),s(n)):lJ(e,t.hours,t.minutes,s()):mX(sJ(),s(n)),updateTimeValues:(e,t,i,a)=>{t&&h(e),!t&&!i&&d(e),i&&f(e),n.value&&a(n.value)},getSecondsValue:s,assignStartTime:t=>{if(t){const n=Array.isArray(t),i=n?[+t[0].hours,+t[1].hours]:+t.hours,a=n?[+t[0].minutes,+t[1].minutes]:+t.minutes,o=n?[+t[0].seconds,+t[1].seconds]:+t.seconds;r("hours",i),r("minutes",a),e.enableSeconds&&r("seconds",o)}},validateTime:c,disabledTimesConfig:p}},BZ=(e,t)=>{const{modelValue:n,time:i}=T0(e,t,()=>{e.isTextInputDate&&m()}),{defaultedStartTime:a,defaultedRange:o,defaultedTz:s}=eZ(e),{updateTimeValues:r,getSetDateTime:l,setTime:c,assignStartTime:u,disabledTimesConfig:h,validateTime:d}=FZ(e,i,n,function(){t("update-flow-step")});const f=e=>{const{hours:t,minutes:n,seconds:i}=e;return{hours:+t,minutes:+n,seconds:i?+i:0}},p=()=>{if(e.startTime){if(Array.isArray(e.startTime)){const t=f(e.startTime[0]),n=f(e.startTime[1]);return[pX(sJ(),t),pX(sJ(),n)]}const t=f(e.startTime);return pX(sJ(),t)}return o.value.enabled?[null,null]:null},g=(t,n,i)=>{c("hours",t),c("minutes",n),c("seconds",e.enableSeconds?i:0)},m=()=>{const[e,t]=(e=>Array.isArray(e)?[gJ(sJ(e[0])),gJ(sJ(e[1]))]:[gJ(null!=e?e:sJ())])(n.value);return o.value.enabled?g([e.hours,t.hours],[e.minutes,t.minutes],[e.seconds,t.seconds]):g(e.hours,e.minutes,e.seconds)};ei(()=>{if(!e.shadow)return u(a.value),n.value?m():(()=>{if(o.value.enabled){const[e,t]=p();n.value=[IX(l(e,0),s.value.timezone),IX(l(t,1),s.value.timezone)]}else n.value=IX(l(p()),s.value.timezone)})()});const v=()=>{Array.isArray(n.value)?n.value=n.value.map((e,t)=>e&&l(e,t)):n.value=l(n.value),t("time-update")};return{modelValue:n,time:i,disabledTimesConfig:h,updateTime:(e,t=!0,n=!1)=>{r(e,t,n,v)},validateTime:d}},UZ=jn({compatConfig:{MODE:3},__name:"TimePickerSolo",props:{...iZ},emits:["update:internal-model-value","time-update","am-pm-change","mount","reset-flow","update-flow-step","overlay-toggle"],setup(e,{expose:t,emit:n}){const i=n,a=e,o=xi(),s=k0(o,"timePicker"),r=It(null),{time:l,modelValue:c,disabledTimesConfig:u,updateTime:h,validateTime:d}=BZ(a,i);return ei(()=>{a.shadow||i("mount",null)}),t({getSidebarProps:()=>({modelValue:c,time:l,updateTime:h}),toggleTimePicker:(e,t=!1,n="")=>{var i;null==(i=r.value)||i.toggleTimePicker(e,t,n)}}),(e,t)=>(Ma(),qa(dZ,{"multi-calendars":0,stretch:""},{default:pn(()=>[za(qZ,Za({ref_key:"tpRef",ref:r},e.$props,{hours:Ot(l).hours,minutes:Ot(l).minutes,seconds:Ot(l).seconds,"internal-model-value":e.internalModelValue,"disabled-times-config":Ot(u),"validate-time":Ot(d),"onUpdate:hours":t[0]||(t[0]=e=>Ot(h)(e)),"onUpdate:minutes":t[1]||(t[1]=e=>Ot(h)(e,!1)),"onUpdate:seconds":t[2]||(t[2]=e=>Ot(h)(e,!1,!0)),onAmPmChange:t[3]||(t[3]=t=>e.$emit("am-pm-change",t)),onResetFlow:t[4]||(t[4]=t=>e.$emit("reset-flow")),onOverlayClosed:t[5]||(t[5]=t=>e.$emit("overlay-toggle",{open:!1,overlay:t})),onOverlayOpened:t[6]||(t[6]=t=>e.$emit("overlay-toggle",{open:!0,overlay:t}))}),mi({_:2},[gi(Ot(s),(t,n)=>({name:t,fn:pn(n=>[vi(e.$slots,t,Y(Wa(n)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"])]),_:3}))}}),jZ={class:"dp--header-wrap"},HZ={key:0,class:"dp__month_year_wrap"},zZ={key:0},WZ={class:"dp__month_year_wrap"},KZ=["data-dp-element","aria-label","data-test","onClick","onKeydown"],GZ=jn({compatConfig:{MODE:3},__name:"DpHeader",props:{month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:0},years:{type:Array,default:()=>[]},months:{type:Array,default:()=>[]},...iZ},emits:["update-month-year","mount","reset-flow","overlay-closed","overlay-opened"],setup(e,{expose:t,emit:n}){const i=n,a=e,{defaultedTransitions:o,defaultedAriaLabels:s,defaultedMultiCalendars:r,defaultedFilters:l,defaultedConfig:c,defaultedHighlight:u,propDates:h,defaultedUI:d}=eZ(a),{transitionName:f,showTransition:p}=x0(o),{buildMatrix:g}=QJ(),{handleMonthYearChange:m,isDisabled:v,updateMonthYear:y}=((e,t)=>{const{defaultedFilters:n,propDates:i}=eZ(e),{validateMonthYearInRange:a}=E0(e),o=(e,t)=>{let i=e;return n.value.months.includes(u$(i))?(i=t?GY(e,1):yX(e,1),o(i,t)):i},s=(e,t)=>{let i=e;return n.value.years.includes(d$(i))?(i=t?lQ(e,1):_X(e,1),s(i,t)):i},r=(e,n,i)=>
5211{t("update-month-year",{month:e,year:n,fromNav:i})};return{handleMonthYearChange:(t,i=!1)=>{const l=pX(sJ(),{month:e.month,year:e.year});let c=t?GY(l,1):yX(l,1);e.disableYearSelect&&(c=vX(c,e.year));let u=u$(c),h=d$(c);n.value.months.includes(u)&&(c=o(c,t),u=u$(c),h=d$(c)),n.value.years.includes(h)&&(c=s(c,t),h=d$(c)),a(u,h,t,e.preventMinMaxNavigation)&&r(u,h,i)},isDisabled:bo(()=>t=>CJ(pX(sJ(),{month:e.month,year:e.year}),i.value.maxDate,i.value.minDate,e.preventMinMaxNavigation,t)),updateMonthYear:r}})(a,i),{showLeftIcon:b,showRightIcon:_}=S0(),w=It(!1),k=It(!1),x=It(!1),T=It([null,null,null,null]);ei(()=>{i("mount")});const C=e=>({get:()=>a[e],set:t=>{const n=e===PX.month?PX.year:PX.month;i("update-month-year",{[e]:t,[n]:a[n]}),e===PX.month?M(!0):N(!0)}}),E=bo(C(PX.month)),S=bo(C(PX.year)),I=bo(()=>e=>({month:a.month,year:a.year,items:e===PX.month?a.months:a.years,instance:a.instance,updateMonthYear:y,toggle:e===PX.month?M:N})),A=bo(()=>a.months.find(e=>e.value===a.month)||{text:"",value:0}),D=bo(()=>$X(a.months,e=>({active:a.month===e.value,disabled:QX(e.value,mJ(a.year,h.value.minDate),vJ(a.year,h.value.maxDate))||l.value.months.includes(e.value),highlighted:LJ(u.value,e.value,a.year)}))),P=bo(()=>$X(a.years,e=>({active:a.year===e.value,disabled:QX(e.value,yJ(h.value.minDate),yJ(h.value.maxDate))||l.value.years.includes(e.value),highlighted:VJ(u.value,e.value)}))),O=(e,t,n)=>{e.value=void 0!==n?n:!e.value,e.value?(x.value=!0,i("overlay-opened",t)):(x.value=!1,i("overlay-closed",t))},M=(e=!1,t)=>{R(e),O(w,NX.month,t)},N=(e=!1,t)=>{R(e),O(k,NX.year,t)},R=e=>{e||i("reset-flow")},L=(e,t)=>{a.arrowNavigation&&(T.value[t]=jX(e),g(T.value,"monthYear"))},V=bo(()=>{var e,t,n,i,o,r,l,c;return[{type:PX.month,index:1,toggle:M,modelValue:E.value,updateModelValue:e=>E.value=e,text:A.value.text,showSelectionGrid:w.value,items:D.value,ariaLabel:null==(n=s.value)?void 0:n.openMonthsOverlay,overlayLabel:null!=(e=null==(o=(i=s.value).monthPicker)?void 0:o.call(i,!0))?e:void 0},{type:PX.year,index:2,toggle:N,modelValue:S.value,updateModelValue:e=>S.value=e,text:ZX(a.year,a.locale),showSelectionGrid:k.value,items:P.value,ariaLabel:null==(r=s.value)?void 0:r.openYearsOverlay,overlayLabel:null!=(t=null==(c=(l=s.value).yearPicker)?void 0:c.call(l,!0))?t:void 0}]}),q=bo(()=>a.disableYearSelect?[V.value[0]]:a.yearFirst?[...V.value].reverse():V.value);return t({toggleMonthPicker:M,toggleYearPicker:N,handleMonthYearChange:m}),(t,n)=>{var i,o,l,u,h,g;return Ma(),Va("div",jZ,[t.$slots["month-year"]?(Ma(),Va("div",HZ,[vi(t.$slots,"month-year",Y(Wa({month:e.month,year:e.year,months:e.months,years:e.years,updateMonthYear:Ot(y),handleMonthYearChange:Ot(m),instance:e.instance})))])):(Ma(),Va(Sa,{key:1},[t.$slots["top-extra"]?(Ma(),Va("div",zZ,[vi(t.$slots,"top-extra",{value:t.internalModelValue})])):Qa("",!0),Ha("div",WZ,[Ot(b)(Ot(r),e.instance)&&!t.vertical?(Ma(),qa(pZ,{key:0,"aria-label":null==(i=Ot(s))?void 0:i.prevMonth,disabled:Ot(v)(!1),class:G(null==(o=Ot(d))?void 0:o.navBtnPrev),"el-name":"action-prev",onActivate:n[0]||(n[0]=e=>Ot(m)(!1,!0)),onSetRef:n[1]||(n[1]=e=>L(e,0))},{default:pn(()=>[t.$slots["arrow-left"]?vi(t.$slots,"arrow-left",{key:0}):Qa("",!0),t.$slots["arrow-left"]?Qa("",!0):(Ma(),qa(Ot(xX),{key:1}))]),_:3},8,["aria-label","disabled","class"])):Qa("",!0),Ha("div",{class:G(["dp__month_year_wrap",{dp__year_disable_select:t.disableYearSelect}])},[(Ma(!0),Va(Sa,null,gi(q.value,(n,i)=>(Ma(),Va(Sa,{key:n.type},[Ha("button",{ref_for:!0,ref:e=>L(e,i+1),type:"button","data-dp-element":"overlay-".concat(n.type),class:G(["dp__btn dp__month_year_select",{"dp--hidden-el":x.value}]),"aria-label":"".concat(n.text,"-").concat(n.ariaLabel),"data-test":"".concat(n.type,"-toggle-overlay-").concat(e.instance),onClick:n.toggle,onKeydown:e=>Ot(iJ)(e,()=>n.toggle(),!0)},[t.$slots[n.type]?vi(t.$slots,n.type,{key:0,text:n.text,value:a[n.type]}):Qa("",!0),t.$slots[n.type]?Qa("",!0):(Ma(),Va(Sa,{key:1},[Ga(ee(n.text),1)],64))],42,KZ),za(Mo,{name:Ot(f)(n.showSelectionGrid),css:Ot(p)},{default:pn(()=>[n.showSelectionGrid?(Ma(),qa(hZ,{key:0,items:n.items,"arrow-navigation":t.arrowNavigation,"hide-navigation":t.hideNavigation,"is-last":t.autoApply&&!Ot(c).keepActionRow,"skip-button-ref":!1,config:t.config,type:n.type,"header-refs":[],"esc-close":t.escClose,"menu-wrap-ref":t.menuWrapRef,"text-input"
5211:t.textInput,"aria-labels":t.ariaLabels,"overlay-label":n.overlayLabel,onSelected:n.updateModelValue,onToggle:n.toggle},mi({"button-icon":pn(()=>[t.$slots["calendar-icon"]?vi(t.$slots,"calendar-icon",{key:0}):Qa("",!0),t.$slots["calendar-icon"]?Qa("",!0):(Ma(),qa(Ot(wX),{key:1}))]),_:2},[t.$slots["".concat(n.type,"-overlay-value")]?{name:"item",fn:pn(({item:e})=>[vi(t.$slots,"".concat(n.type,"-overlay-value"),{text:e.text,value:e.value})]),key:"0"}:void 0,t.$slots["".concat(n.type,"-overlay")]?{name:"overlay",fn:pn(()=>[vi(t.$slots,"".concat(n.type,"-overlay"),Za({ref_for:!0},I.value(n.type)))]),key:"1"}:void 0,t.$slots["".concat(n.type,"-overlay-header")]?{name:"header",fn:pn(()=>[vi(t.$slots,"".concat(n.type,"-overlay-header"),{toggle:n.toggle})]),key:"2"}:void 0]),1032,["items","arrow-navigation","hide-navigation","is-last","config","type","esc-close","menu-wrap-ref","text-input","aria-labels","overlay-label","onSelected","onToggle"])):Qa("",!0)]),_:2},1032,["name","css"])],64))),128))],2),Ot(b)(Ot(r),e.instance)&&t.vertical?(Ma(),qa(pZ,{key:1,"aria-label":null==(l=Ot(s))?void 0:l.prevMonth,"el-name":"action-prev",disabled:Ot(v)(!1),class:G(null==(u=Ot(d))?void 0:u.navBtnPrev),onActivate:n[2]||(n[2]=e=>Ot(m)(!1,!0))},{default:pn(()=>[t.$slots["arrow-up"]?vi(t.$slots,"arrow-up",{key:0}):Qa("",!0),t.$slots["arrow-up"]?Qa("",!0):(Ma(),qa(Ot(EX),{key:1}))]),_:3},8,["aria-label","disabled","class"])):Qa("",!0),Ot(_)(Ot(r),e.instance)?(Ma(),qa(pZ,{key:2,ref:"rightIcon","el-name":"action-next",disabled:Ot(v)(!0),"aria-label":null==(h=Ot(s))?void 0:h.nextMonth,class:G(null==(g=Ot(d))?void 0:g.navBtnNext),onActivate:n[3]||(n[3]=e=>Ot(m)(!0,!0)),onSetRef:n[4]||(n[4]=e=>L(e,t.disableYearSelect?2:3))},{default:pn(()=>[t.$slots[t.vertical?"arrow-down":"arrow-right"]?vi(t.$slots,t.vertical?"arrow-down":"arrow-right",{key:0}):Qa("",!0),t.$slots[t.vertical?"arrow-down":"arrow-right"]?Qa("",!0):(Ma(),qa(di(t.vertical?Ot(SX):Ot(TX)),{key:1}))]),_:3},8,["disabled","aria-label","class"])):Qa("",!0)])],64))])}}}),YZ={class:"dp__calendar_header",role:"row"},QZ={key:0,class:"dp__calendar_header_item",role:"gridcell"},$Z=["aria-label"],XZ={key:0,class:"dp__calendar_item dp__week_num",role:"gridcell"},JZ={class:"dp__cell_inner"},ZZ=["id","aria-pressed","aria-disabled","aria-label","tabindex","data-test","onClick","onTouchend","onKeydown","onMouseenter","onMouseleave","onMousedown"],e0=jn({compatConfig:{MODE:3},__name:"DpCalendar",props:{mappedDates:{type:Array,default:()=>[]},instance:{type:Number,default:0},month:{type:Number,default:0},year:{type:Number,default:0},...iZ},emits:["select-date","set-hover-date","handle-scroll","mount","handle-swipe","handle-space","tooltip-open","tooltip-close"],setup(e,{expose:t,emit:n}){const i=n,a=e,{buildMultiLevelMatrix:o}=QJ(),{defaultedTransitions:s,defaultedConfig:r,defaultedAriaLabels:l,defaultedMultiCalendars:c,defaultedWeekNumbers:u,defaultedMultiDates:h,defaultedUI:d}=eZ(a),f=It(null),p=It({bottom:"",left:"",transform:""}
5211),g=It([]),m=It(null),v=It(!0),y=It(""),b=It({startX:0,endX:0,startY:0,endY:0}),_=It([]),w=It({left:"50%"}),k=It(!1),x=bo(()=>a.calendar?a.calendar(a.mappedDates):a.mappedDates),T=bo(()=>a.dayNames?Array.isArray(a.dayNames)?a.dayNames:a.dayNames(a.locale,+a.weekStart):FX(a.formatLocale,a.locale,+a.weekStart));ei(()=>{i("mount",{cmp:"calendar",refs:g}),r.value.noSwipe||m.value&&(m.value.addEventListener("touchstart",O,{passive:!1}),m.value.addEventListener("touchend",M,{passive:!1}),m.value.addEventListener("touchmove",N,{passive:!1})),a.monthChangeOnScroll&&m.value&&m.value.addEventListener("wheel",L,{passive:!1})});const C=e=>e?a.vertical?"vNext":"next":a.vertical?"vPrevious":"previous",E=bo(()=>{var e;return{...null!=(e=d.value.calendar)?e:{}}}),S=bo(()=>e=>{const t=(e=>({type:"dot",...null!=e?e:{}}))(e);return{dp__marker_dot:"dot"===t.type,dp__marker_line:"line"===t.type}}),I=bo(()=>e=>uJ(e,f.value)),A=bo(()=>({dp__calendar:!0,dp__calendar_next:c.value.count>0&&0!==a.instance})),D=bo(()=>e=>!a.hideOffsetDates||e.current),P=async(e,t,n)=>{var a,o,s;const r=jX(g.value[t][n]);r&&(null!=(a=e.marker)&&a.customPosition&&null!=(s=null==(o=e.marker)?void 0:o.tooltip)&&s.length?p.value=e.marker.customPosition(r):await(async(e,t)=>{const{width:n,height:i}=e.getBoundingClientRect();f.value=t.value;let a={left:"".concat(n/2,"px")},o=-50;if(await an(),_.value[0]){const{left:e,width:t}=_.value[0].getBoundingClientRect();e<0&&(a={left:"0"},o=0,w.value.left="".concat(n/2,"px")),window.innerWidth<e+t&&(a={right:"0"},o=0,w.value.left="".concat(t-n/2,"px"))}p.value={bottom:"".concat(i,"px"),...a,transform:"translateX(".concat(o,"%)")}})(r,e),i("tooltip-open",e.marker))},O=e=>{b.value.startX=e.changedTouches[0].screenX,b.value.startY=e.changedTouches[0].screenY},M=e=>{b.value.endX=e.changedTouches[0].screenX,b.value.endY=e.changedTouches[0].screenY,R()},N=e=>{a.vertical&&!a.inline&&e.preventDefault()},R=()=>{const e=a.vertical?"Y":"X";Math.abs(b.value["start".concat(e)]-b.value["end".concat(e)])>10&&i("handle-swipe",b.value["start".concat(e)]>b.value["end".concat(e)]?"right":"left")},L=e=>{a.monthChangeOnScroll&&(e.preventDefault(),i("handle-scroll",e))},V=e=>"local"===u.value.type?OQ(e.value,{weekStartsOn:+a.weekStart}):"iso"===u.value.type?DQ(e.value):"function"==typeof u.value.type?u.value.type(e.value):"",q=e=>{const t=e[0];return u.value.hideOnOffsetDates?e.some(e=>e.current)?V(t):"":V(t)},F=(e,t,n=!0)=>{n&&aJ()||!n&&!aJ()||h.value.enabled||(XX(e,r.value),i("select-date",t))},B=e=>{XX(e,r.value)};return t({triggerTransition:(e,t)=>{if(a.transitions){const n=rJ(TJ(sJ(),a.month,a.year));y.value=hJ(rJ(TJ(sJ(),e,t)),n)?s.value[C(!0)]:s.value[C(!1)],v.value=!1,an(()=>{v.value=!0})}}}),(e,t)=>(Ma(),Va("div",{class:G(A.value)},[Ha("div",{ref_key:"calendarWrapRef",ref:m,class:G(E.value),role:"grid"},[Ha("div",YZ,[e.weekNumbers?(Ma(),Va("div",QZ,ee(e.weekNumName),1)):Qa("",!0),(Ma(!0),Va(Sa,null,gi(T.value,(t,n)=>{var i,a;return Ma(),Va("div",{key:n,class:"dp__calendar_header_item",role:"gridcell","data-test":"calendar-header","aria-label":null==(a=null==(i=Ot(l))?void 0:i.weekDay)?void 0:a.call(i,n)},[e.$slots["calendar-header"]?vi(e.$slots,"calendar-header",{key:0,day:t,index:n}):Qa("",!0),e.$slots["calendar-header"]?Qa("",!0):(Ma(),Va(Sa,{key:1},[Ga(ee(t),1)],64))],8,$Z)}),128))]),t[2]||(t[2]=Ha("div",{class:"dp__calendar_header_separator"},null,-1)),za(Mo,{name:y.value,css:!!e.transitions},{default:pn(()=>[v.value?(Ma(),Va("div",{key:0,class:"dp__calendar",role:"rowgroup",onMouseleave:t[1]||(t[1]=e=>k.value=!1)},[(Ma(!0),Va(Sa,null,gi(x.value,(n,s)=>(Ma(),Va("div",{key:s,class:"dp__calendar_row",role:"row"},[e.weekNumbers?(Ma(),Va("div",XZ,[Ha("div",JZ,ee(q(n.days)),1)])):Qa("",!0),(Ma(!0),Va(Sa,null,gi(n.days,(n,r)=>{var c,u,d,m;return Ma(),Va("div",{id:Ot(qJ)(n.value),ref_for:!0,ref:e=>((e,t,n)=>{e&&(Array.isArray(g.value[t])?g.value[t][n]=e:g.value[t]=[e]),a.arrowNavigation&&o(g.value,"calendar")})(e,s,r),key:r+s,role:"gridcell",class:"dp__calendar_item","aria-pressed":null!=(c=n.classData.dp__active_date||n.classData.dp__range_start||n.classData.dp__range_start)?c:void 0,"aria-disabled":n.classData.dp__cell_disabled||void 0,"aria-label":null==(d=null==(u=Ot(l))?void 0:u.day)?void 0:d.call(u,n),tabindex:!n.current&&e.hideOffsetDates?void 0:0,"data-test":n.value,onClick:Es(e=>F(e,n),["prevent"]),onTouchend:e=>F(e,n,!1),onKeydown:t=>Ot(iJ)(t,()=>e.$emit("select-date",n)),onMouseenter:e=>(async(e,t,n)=>{var a,o;if(k.value&&h.value.enabled&&h.value.dragSelect)return i("select-date",e);i("set-hover-date",e),null!=(o=null==(a=e.marker)?void 0:a.tooltip)&&o.length&&await P(e,t,n)})(n,s,r),onMouseleave:e=>(e=>{f.value&&(f.value=null,p.value=JSON.parse(JSON.stringify({bottom:"",left:"",transform:""})),i("tooltip-close",e.marker))})(n),onMousedown:e=>(e=>{h.value.enabled&&h.value.dragSelect?(k.value=!0,i("select-date",e)):h.value.enabled&&i("select-date",e)})(n),onMouseup:t[0]||(t[0]=e=>k.value=!1)},[Ha("div",{class:G(["dp__cell_inner",n.classData])}
5211,[e.$slots.day&&D.value(n)?vi(e.$slots,"day",{key:0,day:+n.text,date:n.value}):Qa("",!0),e.$slots.day?Qa("",!0):(Ma(),Va(Sa,{key:1},[Ga(ee(n.text),1)],64)),n.marker&&D.value(n)?(Ma(),Va(Sa,{key:2},[e.$slots.marker?vi(e.$slots,"marker",{key:0,marker:n.marker,day:+n.text,date:n.value}):(Ma(),Va("div",{key:1,class:G(S.value(n.marker)),style:j(n.marker.color?{backgroundColor:n.marker.color}:{})},null,6))],64)):Qa("",!0),I.value(n.value)?(Ma(),Va("div",{key:3,ref_for:!0,ref_key:"activeTooltip",ref:_,class:"dp__marker_tooltip",style:j(p.value)},[null!=(m=n.marker)&&m.tooltip?(Ma(),Va("div",{key:0,class:"dp__tooltip_content",onClick:B},[(Ma(!0),Va(Sa,null,gi(n.marker.tooltip,(t,i)=>(Ma(),Va("div",{key:i,class:"dp__tooltip_text"},[e.$slots["marker-tooltip"]?vi(e.$slots,"marker-tooltip",{key:0,tooltip:t,day:n.value}):Qa("",!0),e.$slots["marker-tooltip"]?Qa("",!0):(Ma(),Va(Sa,{key:1},[Ha("div",{class:"dp__tooltip_mark",style:j(t.color?{backgroundColor:t.color}:{})},null,4),Ha("div",null,ee(t.text),1)],64))]))),128)),Ha("div",{class:"dp__arrow_bottom_tp",style:j(w.value)},null,4)])):Qa("",!0)],4)):Qa("",!0)],2)],40,ZZ)}),128))]))),128))],32)):Qa("",!0)]),_:3},8,["name","css"])],2)],2))}}),t0=e=>Array.isArray(e),n0=(e,t,n,i)=>{const a=It([]),o=It(new Date),s=It(),{modelValue:r,calendars:l,time:c,today:u}=T0(e,t,()=>M(e.isTextInputDate)),{defaultedMultiCalendars:h,defaultedStartTime:d,defaultedRange:f,defaultedConfig:p,defaultedTz:g,propDates:m,defaultedMultiDates:v}=eZ(e),{validateMonthYearInRange:y,isDisabled:b,isDateRangeAllowed:_,checkMinMaxRange:w}=E0(e),{updateTimeValues:k,getSetDateTime:x,setTime:T,assignStartTime:C,validateTime:E,disabledTimesConfig:S}=FZ(e,c,r,i),I=bo(()=>e=>l.value[e]?l.value[e].month:0),A=bo(()=>e=>l.value[e]?l.value[e].year:0),D=(e,t,n,i=!1)=>{var a,o;(e=>!(p.value.keepViewOnOffsetClick&&!e&&s.value))(i)&&(l.value[e]||(l.value[e]={month:0,year:0}),l.value[e].month=GX(t)?null==(a=l.value[e])?void 0:a.month:t,l.value[e].year=GX(n)?null==(o=l.value[e])?void 0:o.year:n)},P=()=>{e.autoApply&&t("select-date")};ei(()=>{e.shadow||(r.value||(U(),d.value&&C(d.value)),M(!0),e.focusStartDate&&e.startDate&&U())});const O=bo(()=>{var t;return!(null!=(t=e.flow)&&t.length&&!e.partialFlow)||e.flowStep===e.flow.length}),M=(t=!1)=>r.value?Array.isArray(r.value)?(a.value=r.value,V(t)):R(r.value,t):h.value.count&&t&&!e.startDate?N(sJ(),t):void 0,N=(e=new Date,t=!1)=>{if((!h.value.count||!h.value.static||t)&&D(0,u$(e),d$(e)),h.value.count&&(!h.value.solo||!r.value||Array.isArray(r.value)&&f.value.enabled&&u$(r.value[0])===u$(null!=(n=r.value[1])?n:r.value[0])))for(let i=1;i<h.value.count;i++){const e=YY(pX(sJ(),{month:I.value(i-1),year:A.value(i-1)}),{months:1});l.value[i]={month:u$(e),year:d$(e)}}var n},R=(e,t)=>{N(e),T("hours",l$(e)),T("minutes",c$(e)),T("seconds",h$(e)),h.value.count&&t&&B()},L=(e,t)=>{e[1]&&f.value.showLastInRange?N(e[(e=>{if(h.value.count){if(h.value.solo)return 0;const t=u$(e[0]),n=u$(e[1]);return Math.abs(n-t)<h.value.count?0:1}return 1})(e)],t):N(e[0],t);const n=(t,n)=>[t(e[0]),e[1]?t(e[1]):c[n][1]];T("hours",n(l$,"hours")),T("minutes",n(c$,"minutes")),T("seconds",n(h$,"seconds"))},V=t=>{((t,n)=>{if((f.value.enabled||e.weekPicker)&&!v.value.enabled)return L(t,n);if(v.value.enabled&&n){const e=t[t.length-1];R(e,n)}})(r.value,t),h.value.count&&h.value.solo&&B()},q=(i,a)=>{const o=pX(sJ(),{month:I.value(a),year:A.value(a)}),s=i<0?GY(o,1):yX(o,1);y(u$(s),d$(s),i<0,e.preventMinMaxNavigation)&&(D(a,u$(s),d$(s)),t("update-month-year",{instance:a,month:u$(s),year:d$(s)}),h.value.count&&!h.value.solo&&F(a),n())},F=e=>{for(let t=e-1;t>=0;t--){const e=yX(pX(sJ(),{month:I.value(t+1),year:A.value(t+1)}),1);D(t,u$(e),d$(e))}for(let t=e+1;t<=h.value.count-1;t++){const e=GY(pX(sJ(),{month:I.value(t-1),year:A.value(t-1)}),1);D(t,u$(e),d$(e))}},B=()=>{if(Array.isArray(r.value)&&2===r.value.length){const e=sJ(sJ(r.value[1]?r.value[1]:GY(r.value[0],1))),[t,n]=[u$(r.value[0]),d$(r.value[0])],[i,a]=[u$(r.value[1]),d$(r.value[1])];(t!==i||t===i&&n!==a)&&h.value.solo&&D(1,u$(e),d$(e))}else r.value&&!Array.isArray(r.value)&&(D(0,u$(r.value),d$(r.value)),N(sJ()))},U=()=>{e.startDate&&(D(0,u$(sJ(e.startDate)),d$(sJ(e.startDate))),h.value.count&&F(0))},j=(e,t)=>{q("right"===e?-1:1,t)},H=(t,n,i,a)=>
5211{if(e.sixWeeks&&t.length<6){const o=6-t.length,s=(n.getDay()+7-a)%7,r=6-(i.getDay()+7-a)%7,[l,c]=((t,n)=>{switch(!0===e.sixWeeks?"append":e.sixWeeks){case"prepend":return[!0,!1];case"center":return[0==t,!0];case"fair":return[0==t||n>t,!0];default:return[!1,!1]}})(s,r);for(let e=1;e<=o;e++)if(c?!!(e%2)==l:l){const e=t[0].days[0],i=z(KY(e.value,-7),u$(n));t.unshift({days:i})}else{const e=t[t.length-1],i=e.days[e.days.length-1],a=z(KY(i.value,1),u$(n));t.push({days:a})}}return t},z=(t,n)=>{const i=sJ(t),a=[];for(let o=0;o<7;o++){const t=KY(i,o),s=u$(t)!==n;a.push({text:e.hideOffsetDates&&s?"":t.getDate(),value:t,current:!s,classData:{}})}return a},W=n=>{const a=lJ(sJ(n.value),c.hours,c.minutes,Q());t("date-update",a),v.value.enabled?vZ(a,r,v.value.limit):r.value=a,i(),an().then(()=>{e.autoApply&&O.value&&t("auto-apply",!!e.partialFlow&&e.flowStep!==e.flow.length)})},K=e=>!!f.value.noDisabledRange&&bJ(a.value[0],e).some(e=>b(e)),G=e=>{const t=u$(sJ(e)),n=d$(sJ(e));if(D(0,t,n),h.value.count>0)for(let i=1;i<h.value.count;i++){const t=_J(pX(sJ(e),{year:A.value(i-1),month:I.value(i-1)}));D(i,t.month,t.year)}},Y=(n,i)=>(a.value=r.value?r.value.slice():[],2===a.value.length&&!f.value.fixedStart&&!f.value.fixedEnd&&(a.value=[]),f.value.autoRange?((e,n)=>{const i=[sJ(e.value),KY(sJ(e.value),+f.value.autoRange)];_(i)?(n&&G(e.value),a.value=i):t("invalid-date",e.value)})(n,i):f.value.fixedStart||f.value.fixedEnd?(e=>{if(K(e.value)||!w(e.value,r.value,f.value.fixedStart?0:1))return t("invalid-date",e.value);a.value=wZ(sJ(e.value),r,t,f)})(n):void(a.value[0]?w(sJ(n.value),r.value)&&!K(n.value)?cJ(sJ(n.value),sJ(a.value[0]))?(a.value.unshift(sJ(n.value)),t("range-end",a.value[0])):(a.value[1]=sJ(n.value),t("range-end",a.value[1])):(e.autoApply&&t("auto-apply-invalid",n.value),t("invalid-date",n.value)):(a.value[0]=sJ(n.value),t("range-start",a.value[0])))),Q=(t=!0)=>e.enableSeconds?Array.isArray(c.seconds)?t?c.seconds[0]:c.seconds[1]:c.seconds:0,$=e=>{a.value[e]=lJ(a.value[e],c.hours[e],c.minutes[e],Q(1!==e))},X=()=>{var n,o;a.value.length&&(a.value[0]&&!a.value[1]?$(0):($(0),$(1),i()),a.value[0]&&a.value[1]&&+(null==(n=a.value)?void 0:n[0])>+(null==(o=a.value)?void 0:o[1])&&(a.value.reverse(),t("range-start",a.value[0]),t("range-end",a.value[1])),r.value=a.value.slice(),bZ(a.value,t,e.autoApply,e.modelAuto))},J=()=>{if(Array.isArray(r.value))if(v.value.enabled){const e=Z();r.value[r.value.length-1]=x(e)}else r.value=r.value.map((e,t)=>e&&x(e,t));else r.value=x(r.value);t("time-update")},Z=()=>Array.isArray(r.value)&&r.value.length?r.value[r.value.length-1]:null;return{calendars:l,modelValue:r,month:I,year:A,time:c,disabledTimesConfig:S,today:u,validateTime:E,getCalendarDays:(t,n)=>{const i=[],a=new Date(n,t),o=new Date(n,t+1,0),s=e.weekStart,r=eQ(a,{weekStartsOn:s}),l=e=>{const n=z(e,t);if(i.push({days:n}),!i[i.length-1].days.some(e=>uJ(rJ(e.value),rJ(o)))){const t=KY(e,7);l(t)}};return l(r),H(i,a,o,s)},getMarker:e=>{if(m.value.markers)return nJ(e.value,m.value.markers)},handleScroll:(t,n)=>{if(e.monthChangeOnScroll){const i=(new Date).getTime()-o.value.getTime(),a=Math.abs(t.deltaY);let s=500;a>1&&(s=100),a>100&&(s=0),i>s&&(o.value=new Date,q("inverse"!==e.monthChangeOnScroll?-t.deltaY:t.deltaY,n))}},handleSwipe:j,handleArrow:(t,n,i=!1)=>{e.monthChangeOnArrows&&e.vertical===i&&j(t,n)},selectDate:(n,i=!1)=>b(n.value)||!n.current&&e.hideOffsetDates?t("invalid-date",n.value):(s.value=JSON.parse(JSON.stringify(n)),f.value.enabled?void(t0(c.hours)&&t0(c.minutes)&&!v.value.enabled&&(Y(n,i),X())):W(n)),updateMonthYear:(a,o)=>{var s;D(a,o.month,o.year,!0),h.value.count&&!h.value.solo&&F(a),t("update-month-year",{instance:a,month:o.month,year:o.year}),n(h.value.solo?a:void 0);const r=null!=(s=e.flow)&&s.length?e.flow[e.flowStep]:void 0;!o.fromNav&&(r===NX.month||r===NX.year)&&i()},presetDate:(t,n)=>{_Z({value:t,modelValue:r,range:f.value.enabled,timezone:n?void 0:g.value.timezone}),P(),e.multiCalendars&&an().then(()=>M(!0))},selectCurrentDate:()=>{const e=AX(sJ(),g.value);f.value.enabled?r.value&&Array.isArray(r.value)&&r.value[0]?r.value=cJ(e,r.value[0])?[e,r.value[0]]:[r.value[0],e]:r.value=[e]:r.value=e,P()},updateTime:(e,t=!0,n=!1)=>{k(e,t,n,J)},assignMonthAndYear:N}},i0={key:0},a0=jn({__name:"DatePicker",props:{...iZ},emits:["tooltip-open","tooltip-close","mount","update:internal-model-value","update-flow-step","reset-flow","auto-apply","focus-menu","select-date","range-start","range-end","invali
5211d-fixed-range","time-update","am-pm-change","time-picker-open","time-picker-close","recalculate-position","update-month-year","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(e,{expose:t,emit:n}){const i=n,a=e,{calendars:o,month:s,year:r,modelValue:l,time:c,disabledTimesConfig:u,today:h,validateTime:d,getCalendarDays:f,getMarker:p,handleArrow:g,handleScroll:m,handleSwipe:v,selectDate:y,updateMonthYear:b,presetDate:_,selectCurrentDate:w,updateTime:k,assignMonthAndYear:x}=n0(a,i,function(e){var t;e||0===e?null==(t=D.value[e])||t.triggerTransition(s.value(e),r.value(e)):D.value.forEach((e,t)=>e.triggerTransition(s.value(t),r.value(t)))},function(){i("update-flow-step")}),T=xi(),{setHoverDate:C,getDayClassData:E,clearHoverDate:S}=C0(l,a),{defaultedMultiCalendars:I}=eZ(a),A=It([]),D=It([]),P=It(null),O=k0(T,"calendar"),M=k0(T,"monthYear"),N=k0(T,"timePicker"),R=e=>{a.shadow||i("mount",e)};pa(o,()=>{a.shadow||setTimeout(()=>{i("recalculate-position")},0)},{deep:!0}),pa(I,(e,t)=>{e.count-t.count>0&&x()},{deep:!0});const L=bo(()=>e=>f(s.value(e),r.value(e)).map(e=>({...e,days:e.days.map(e=>(e.marker=p(e),e.classData=E(e),e))})));const V=(e,t)=>{e===NX.time&&i("time-picker-".concat(t?"open":"close")),i("overlay-toggle",{open:t,overlay:e})},q=e=>{i("overlay-toggle",{open:!1,overlay:e}),i("focus-menu")};return t({clearHoverDate:S,presetDate:_,selectCurrentDate:w,toggleMonthPicker:(e,t,n=0)=>{var i;null==(i=A.value[n])||i.toggleMonthPicker(e,t)},toggleYearPicker:(e,t,n=0)=>{var i;null==(i=A.value[n])||i.toggleYearPicker(e,t)},toggleTimePicker:(e,t,n)=>{var i;null==(i=P.value)||i.toggleTimePicker(e,t,n)},handleArrow:g,updateMonthYear:b,getSidebarProps:()=>({modelValue:l,month:s,year:r,time:c,updateTime:k,updateMonthYear:b,selectDate:y,presetDate:_}),changeMonth:e=>{var t;null==(t=A.value[0])||t.handleMonthYearChange(e,!0)},changeYear:e=>{b(0,{month:s.value(0),year:r.value(0)+(e?1:-1),fromNav:!0})},selectWeekDate:(e,t)=>{var n;if(!a.range){const i=l.value?l.value:h,a=t?new Date(t):i,o=e?eQ(a,{weekStartsOn:1}):_Q(a,{weekStartsOn:1});y({value:o,current:u$(a)===s.value(0),text:"",classData:{}}),null==(n=document.getElementById(qJ(o)))||n.focus()}}}),(e,t)=>(Ma(),Va(Sa,null,[za(dZ,{"multi-calendars":Ot(I).count,collapse:e.collapse},{default:pn(({instance:n,index:o})=>[e.disableMonthYearSelect?Qa("",!0):(Ma(),qa(GZ,Za({key:0,ref:e=>{e&&(A.value[o]=e)},months:Ot(UX)(e.formatLocale,e.locale,e.monthNameFormat),years:Ot(BX)(e.yearRange,e.locale,e.reverseYears),month:Ot(s)(n),year:Ot(r)(n),instance:n},e.$props,{onMount:t[0]||(t[0]=e=>R(Ot(MX).header)),onResetFlow:t[1]||(t[1]=t=>e.$emit("reset-flow")),onUpdateMonthYear:e=>Ot(b)(n,e),onOverlayClosed:q,onOverlayOpened:t[2]||(t[2]=t=>e.$emit("overlay-toggle",{open:!0,overlay:t}))}),mi({_:2},[gi(Ot(M),(t,n)=>({name:t,fn:pn(n=>[vi(e.$slots,t,Y(Wa(n)))])}))]),1040,["months","years","month","year","instance","onUpdateMonthYear"])),za(e0,Za({ref:e=>{e&&(D.value[o]=e)},"mapped-dates":L.value(n),month:Ot(s)(n),year:Ot(r)(n),instance:n},e.$props,{onSelectDate:e=>Ot(y)(e,1!==n),onHandleSpace:e=>((e,t=!1)=>{y(e,t),a.spaceConfirm&&i("select-date")})(e,1!==n),onSetHoverDate:t[3]||(t[3]=e=>Ot(C)(e)),onHandleScroll:e=>Ot(m)(e,n),onHandleSwipe:e=>Ot(v)(e,n),onMount:t[4]||(t[4]=e=>R(Ot(MX).calendar)),onResetFlow:t[5]||(t[5]=t=>e.$emit("reset-flow")),onTooltipOpen:t[6]||(t[6]=t=>e.$emit("tooltip-open",t)),onTooltipClose:t[7]||(t[7]=t=>e.$emit("tooltip-close",t))}),mi({_:2},[gi(Ot(O),(t,n)=>({name:t,fn:pn(n=>[vi(e.$slots,t,Y(Wa({...n})))])}))]),1040,["mapped-dates","month","year","instance","onSelectDate","onHandleSpace","onHandleScroll","onHandleSwipe"])]),_:3},8,["multi-calendars","collapse"]),e.enableTimePicker?(Ma(),Va("div",i0,[e.$slots["time-picker"]?vi(e.$slots,"time-picker",Y(Za({key:0},{time:Ot(c),updateTime:Ot(k)}))):(Ma(),qa(qZ,Za({key:1,ref_key:"timePickerRef",ref:P},e.$props,{hours:Ot(c).hours,minutes:Ot(c).minutes,seconds:Ot(c).seconds,"internal-model-value":e.internalModelValue,"disabled-times-config":Ot(u),"validate-time":Ot(d),onMount:t[8]||(t[8]=e=>R(Ot(MX).timePicker)),"onUpdate:hours":t[9]||(t[9]=e=>Ot(k)(e)),"onUpdate:minutes":t[10]||(t[10]=e=>Ot(k)(e,!1)),"onUpdate:seconds":t[11]||(t[11]=e=>Ot(k)(e,!1,!0)),onResetFlow:t[12]||(t[12]=t=>e.$emit("reset-flow")),onOverlayClosed:t[13]||(t[13]=e=>V(e,!1)),onOverlayOpened:t[14]||(t[14]=e=>V(e,!0)),onAmPmChange:t[15]||(t[15]=t=>e.$emit("am-pm-change",t))}),mi({_:2},[gi(Ot(N),(t,n)=>({name:t,fn:pn(n=>[vi(e.$slots,t,Y(Wa(n)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"]))])):Qa("",!0)],64))}}),o0=(e,t)=>
5211{const n=It(),{defaultedMultiCalendars:i,defaultedConfig:a,defaultedHighlight:o,defaultedRange:s,propDates:r,defaultedFilters:l,defaultedMultiDates:c}=eZ(e),{modelValue:u,year:h,month:d,calendars:f}=T0(e,t),{isDisabled:p}=E0(e),{selectYear:g,groupedYears:m,showYearPicker:v,isDisabled:y,toggleYearPicker:b,handleYearSelect:_,handleYear:w}=kZ({modelValue:u,multiCalendars:i,range:s,highlight:o,calendars:f,propDates:r,month:d,year:h,filters:l,props:e,emit:t}),k=(t,n)=>[t,n].map(t=>o$(t,"MMMM",{locale:e.formatLocale})).join("-"),x=bo(()=>e=>!!u.value&&(Array.isArray(u.value)?u.value.some(t=>dX(e,t)):dX(u.value,e))),T=e=>"function"==typeof o.value?o.value({quarter:fQ(e),year:d$(e)}):!!o.value.quarters.find(t=>((e,t)=>e.quarter===fQ(t)&&e.year===d$(t))(t,e)),C=bo(()=>e=>{const t=pX(new Date,{year:h.value(e)});return function(e){const t=zY(e.start),n=zY(e.end);let i=+t>+n;const a=i?+vQ(t):+vQ(n);let o=vQ(i?n:t);const s=[];for(;+o<=a;)s.push(zY(o)),o=rQ(o,1);return i?s.reverse():s}({start:bQ(t),end:yQ(t)}).map(e=>{const t=vQ(e),i=wQ(e),a=p(e),o=(e=>{if(s.value.enabled){if(Array.isArray(u.value)){const t=uJ(e,u.value[0])||uJ(e,u.value[1]);return dJ(u.value,n.value,e)&&!t}return!1}return!1})(t),r=T(t);return{text:k(t,i),value:t,active:x.value(t),highlighted:r,disabled:a,isBetween:o}})});return{defaultedConfig:a,defaultedMultiCalendars:i,groupedYears:m,year:h,isDisabled:y,quarters:C,showYearPicker:v,modelValue:u,setHoverDate:e=>{n.value=e},selectYear:g,selectQuarter:(n,i,a)=>{if(!a)return f.value[i].month=u$(wQ(n)),c.value.enabled?(e=>{vZ(e,u,c.value.limit),t("auto-apply",!0)})(n):s.value.enabled?(n=>{u.value=yZ(u,n,t),bZ(u.value,t,e.autoApply,e.modelAuto)})(n):(e=>{u.value=e,t("auto-apply")})(n)},toggleYearPicker:b,handleYearSelect:_,handleYear:w}},s0={class:"dp--quarter-items"},r0=["data-test","disabled","onClick","onMouseover"],l0=jn({compatConfig:{MODE:3},__name:"QuarterPicker",props:{...iZ},emits:["update:internal-model-value","reset-flow","overlay-closed","auto-apply","range-start","range-end","overlay-toggle","update-month-year"],setup(e,{expose:t,emit:n}
5211){const i=n,a=e,o=xi(),s=k0(o,"yearMode"),{defaultedMultiCalendars:r,defaultedConfig:l,groupedYears:c,year:u,isDisabled:h,quarters:d,modelValue:f,showYearPicker:p,setHoverDate:g,selectQuarter:m,toggleYearPicker:v,handleYearSelect:y,handleYear:b}=o0(a,i);return t({getSidebarProps:()=>({modelValue:f,year:u,selectQuarter:m,handleYearSelect:y,handleYear:b})}),(e,t)=>(Ma(),qa(dZ,{"multi-calendars":Ot(r).count,collapse:e.collapse,stretch:""},{default:pn(({instance:t})=>[Ha("div",{class:"dp-quarter-picker-wrap",style:j({minHeight:"".concat(Ot(l).modeHeight,"px")})},[e.$slots["top-extra"]?vi(e.$slots,"top-extra",{key:0,value:e.internalModelValue}):Qa("",!0),Ha("div",null,[za(mZ,Za(e.$props,{items:Ot(c)(t),instance:t,"show-year-picker":Ot(p)[t],year:Ot(u)(t),"is-disabled":e=>Ot(h)(t,e),onHandleYear:e=>Ot(b)(t,e),onYearSelect:e=>Ot(y)(e,t),onToggleYearPicker:e=>Ot(v)(t,null==e?void 0:e.flow,null==e?void 0:e.show)}),mi({_:2},[gi(Ot(s),(t,n)=>({name:t,fn:pn(n=>[vi(e.$slots,t,Y(Wa(n)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),Ha("div",s0,[(Ma(!0),Va(Sa,null,gi(Ot(d)(t),(n,i)=>(Ma(),Va("div",{key:i},[Ha("button",{type:"button",class:G(["dp--qr-btn",{"dp--qr-btn-active":n.active,"dp--qr-btn-between":n.isBetween,"dp--qr-btn-disabled":n.disabled,"dp--highlighted":n.highlighted}]),"data-test":n.value,disabled:n.disabled,onClick:e=>Ot(m)(n.value,t,n.disabled),onMouseover:e=>Ot(g)(n.value)},[e.$slots.quarter?vi(e.$slots,"quarter",{key:0,value:n.value,text:n.text}):(Ma(),Va(Sa,{key:1},[Ga(ee(n.text),1)],64))],42,r0)]))),128))])],4)]),_:3},8,["multi-calendars","collapse"]))}}),c0=["id","tabindex","role","aria-label"],u0={key:0,class:"dp--menu-load-container"},h0={key:1,class:"dp--menu-header"},d0={key:0,class:"dp__sidebar_left"},f0=["data-test","onClick","onKeydown"],p0={key:2,class:"dp__sidebar_right"},g0={key:3,class:"dp__action_extra"},m0=jn({compatConfig:{MODE:3},__name:"DatepickerMenu",props:{...nZ,shadow:{type:Boolean,default:!1},openOnTop:{type:Boolean,default:!1},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},emits:["close-picker","select-date","auto-apply","time-update","flow-step","update-month-year","invalid-select","update:internal-model-value","recalculate-position","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(e,{expose:t,emit:n}){const i=n,a=e,o=It(null),s=bo(()=>{const{openOnTop:e,...t}=a;return{...t,flowStep:C.value,collapse:a.collapse,noOverlayFocus:a.noOverlayFocus,menuWrapRef:o.value}}),{setMenuFocused:r,setShiftKey:l,control:c}=BJ(),u=xi(),{defaultedTextInput:h,defaultedInline:d,defaultedConfig:f,defaultedUI:p}=eZ(a),g=It(null),m=It(0),v=It(null),y=It(!1),b=It(null);ei(()=>{if(!a.shadow){y.value=!0,_(),window.addEventListener("resize",_);const e=jX(o);if(e&&!h.value.enabled&&!d.value.enabled&&(r(!0),O()),e){const t=e=>{f.value.allowPreventDefault&&e.preventDefault(),XX(e,f.value,!0)};e.addEventListener("pointerdown",t),e.addEventListener("mousedown",t)}}}),ai(()=>{window.removeEventListener("resize",_)});const _=()=>{const e=jX(v);e&&(m.value=e.getBoundingClientRect().width)},{arrowRight:w,arrowLeft:k,arrowDown:x,arrowUp:T}=QJ(),{flowStep:C,updateFlowStep:E,childMount:S,resetFlow:I,handleFlow:A}=I0(a,i,b),D=bo(()=>a.monthPicker?TZ:a.yearPicker?EZ:a.timePicker?UZ:a.quarterPicker?l0:a0),P=bo(()=>{var e,t,n;if(f.value.arrowLeft)return f.value.arrowLeft;const i=null==(n=o.value)?void 0:n.getBoundingClientRect(),s=a.getInputRect();return(null==s?void 0:s.width)<(null==m?void 0:m.value)&&(null==s?void 0:s.left)<=(null!=(e=null==i?void 0:i.left)?e:0)?"".concat((null==s?void 0:s.width)/2,"px"):(null==s?void 0:s.right)>=(null!=(t=null==i?void 0:i.right)?t:0)&&(null==s?void 0:s.width)<(null==m?void 0:m.value)?"".concat((null==m?void 0:m.value)-(null==s?void 0:s.width)/2,"px"):"50%"}),O=()=>{const e=jX(o);e&&e.focus({preventScroll:!0})},M=bo(()=>{var e;return(null==(e=b.value)?void 0:e.getSidebarProps())||{}}),N=()=>{a.openOnTop&&i("recalculate-position")},R=k0(u,"action"),L=bo(()=>a.monthPicker||a.yearPicker?k0(u,"monthYear"):a.timePicker?k0(u,"timePicker"):k0(u,"shared")),V=bo(()=>a.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),q=bo(()=>({dp__menu_disabled:a.disabled,dp__menu_readonly:a.readonly,"dp-menu-loading":a.loading})),F=bo(()=>{var e;return{dp__menu:!0,dp__menu_index:!d.value.enabled,dp__relative:d.value.enabled,...null!=(e=p.value.menu)?e:{}}}),B=e=>{XX(e,f.value,!0)},U=()=>{O(),i("time-picker-close")},H=(e,...t)=>{var n,i;null!=(n=b.value)&&n[e]&&(null==(i=b.value)||i[e](...t))},z=()=>{H("selectCurrentDate")},W=(e,t)=>{H("presetDate",e,t)},K=()=>{H("clearHoverDate")},Q=(e,t)=>{e.preventDefault(),(e=>{if(a.arrowNavigation){if(e===LX.up)return T();if(e===LX.down)return x();if(e===LX.left)return k();if(e===LX.right)w()}else e===LX.left||e===LX.up?H("handleArrow",LX.left,0,e===LX.up):H("handleArrow",LX.right,0,e===LX.down)})(t)},$=e=>{var t,n,s;if((e=>{l(e.shiftKey),!a.disableMonthYearSelect&&e.code===VX.tab&&e.target.classList.contains("dp__menu")&&c.value.shiftKeyInMenu&&(e.preventDefault(),XX(e,f.value,!0),i("close-picker"))})(e),e.key===VX.home||e.key===VX.end)return H("selectWeekDate",e.key===VX.home,e.target.getAttribute("id"));switch((e.key===VX.pageUp||e.key===VX.pageDown)&&(e.shiftKey?(H("changeYear",e.key===VX.pageUp),null==(t=JX(o.value,"overlay-year"))||t.focu
5211s()):(H("changeMonth",e.key===VX.pageUp),null==(n=JX(o.value,e.key===VX.pageUp?"action-prev":"action-next"))||n.focus()),e.target.getAttribute("id")&&(null==(s=o.value)||s.focus({preventScroll:!0}))),e.key){case VX.esc:return void(a.escClose&&i("close-picker"));case VX.arrowLeft:return Q(e,LX.left);case VX.arrowRight:return Q(e,LX.right);case VX.arrowUp:return Q(e,LX.up);case VX.arrowDown:return Q(e,LX.down);default:return}};return t({updateMonthYear:(e,t)=>{H("updateMonthYear",e,t)},switchView:(e,t=0)=>{var n,i,a;return"month"===e?null==(n=b.value)?void 0:n.toggleMonthPicker(!1,!0,t):"year"===e?null==(i=b.value)?void 0:i.toggleYearPicker(!1,!0,t):"time"===e?null==(a=b.value)?void 0:a.toggleTimePicker(!0,!1):(e=>{var t,n,i;null==(t=b.value)||t.toggleTimePicker(!1,!1),null==(n=b.value)||n.toggleMonthPicker(!1,!1,e),null==(i=b.value)||i.toggleYearPicker(!1,!1,e)})(t)},handleFlow:A}),(t,n)=>{var i,a,r;return Ma(),Va("div",{id:t.uid?"dp-menu-".concat(t.uid):void 0,ref_key:"dpMenuRef",ref:o,tabindex:Ot(d).enabled?void 0:"0",role:Ot(d).enabled?void 0:"dialog","aria-label":null==(i=t.ariaLabels)?void 0:i.menu,class:G(F.value),style:j({"--dp-arrow-left":P.value}),onMouseleave:K,onClick:B,onKeydown:$},[(t.disabled||t.readonly)&&Ot(d).enabled||t.loading?(Ma(),Va("div",{key:0,class:G(q.value)},[t.loading?(Ma(),Va("div",u0,n[19]||(n[19]=[Ha("span",{class:"dp--menu-loader"},null,-1)]))):Qa("",!0)],2)):Qa("",!0),t.$slots["menu-header"]?(Ma(),Va("div",h0,[vi(t.$slots,"menu-header")])):Qa("",!0),Ot(d).enabled||t.teleportCenter?Qa("",!0):(Ma(),Va("div",{key:2,class:G(V.value)},null,2)),Ha("div",{ref_key:"innerMenuRef",ref:v,class:G({dp__menu_content_wrapper:(null==(a=t.presetDates)?void 0:a.length)||!!t.$slots["left-sidebar"]||!!t.$slots["right-sidebar"],"dp--menu-content-wrapper-collapsed":e.collapse&&((null==(r=t.presetDates)?void 0:r.length)||!!t.$slots["left-sidebar"]||!!t.$slots["right-sidebar"])}),style:j({"--dp-menu-width":"".concat(m.value,"px")})},[t.$slots["left-sidebar"]?(Ma(),Va("div",d0,[vi(t.$slots,"left-sidebar",Y(Wa(M.value)))])):Qa("",!0),t.presetDates.length?(Ma(),Va("div",{key:1,class:G({"dp--preset-dates-collapsed":e.collapse,"dp--preset-dates":!0})},[(Ma(!0),Va(Sa,null,gi(t.presetDates,(n,i)=>{var a;return Ma(),Va(Sa,{key:i},[n.slot?vi(t.$slots,n.slot,{key:0,presetDate:W,label:n.label,value:n.value}):(Ma(),Va("button",{key:1,type:"button",style:j(n.style||{}),class:G(["dp__btn dp--preset-range",{"dp--preset-range-collapsed":e.collapse}]),"data-test":null!=(a=n.testId)?a:void 0,onClick:Es(e=>W(n.value,n.noTz),["prevent"]),onKeydown:e=>Ot(iJ)(e,()=>W(n.value,n.noTz),!0)},ee(n.label),47,f0))],64)}),128))],2)):Qa("",!0),Ha("div",{ref_key:"calendarWrapperRef",ref:g,class:"dp__instance_calendar",role:"document"},[(Ma(),qa(di(D.value),Za({ref_key:"dynCmpRef",ref:b},s.value,{"flow-step":Ot(C),onMount:Ot(S),onUpdateFlowStep:Ot(E),onResetFlow:Ot(I),onFocusMenu:O,onSelectDate:n[0]||(n[0]=e=>t.$emit("select-date")),onDateUpdate:n[1]||(n[1]=e=>t.$emit("date-update",e)),onTooltipOpen:n[2]||(n[2]=e=>t.$emit("tooltip-open",e)),onTooltipClose:n[3]||(n[3]=e=>t.$emit("tooltip-close",e)),onAutoApply:n[4]||(n[4]=e=>t.$emit("auto-apply",e)),onRangeStart:n[5]||(n[5]=e=>t.$emit("range-start",e)),onRangeEnd:n[6]||(n[6]=e=>t.$emit("range-end",e)),onInvalidFixedRange:n[7]||(n[7]=e=>t.$emit("invalid-fixed-range",e)),onTimeUpdate:n[8]||(n[8]=e=>t.$emit("time-update")),onAmPmChange:n[9]||(n[9]=e=>t.$emit("am-pm-change",e)),onTimePickerOpen:n[10]||(n[10]=e=>t.$emit("time-picker-open",e)),onTimePickerClose:U,onRecalculatePosition:N,onUpdateMonthYear:n[11]||(n[11]=e=>t.$emit("update-month-year",e)),onAutoApplyInvalid:n[12]||(n[12]=e=>t.$emit("auto-apply-invalid",e)),onInvalidDate:n[13]||(n[13]=e=>t.$emit("invalid-date",e)),onOverlayToggle:n[14]||(n[14]=e=>t.$emit("overlay-toggle",e)),"onUpdate:internalModelValue":n[15]||(n[15]=e=>t.$emit("update:internal-model-value",e))}),mi({_:2},[gi(L.value,(e,n)=>({name:e,fn:pn(n=>[vi(t.$slots,e,Y(Wa({...n})))])}))]),1040,["flow-step","onMount","onUpdateFlowStep","onResetFlow"]))],512),t.$slots["right-sidebar"]?(Ma(),Va("div",p0,[vi(t.$slots,"right-sidebar",Y(Wa(M.value)))])):Qa("",!0),t.$slots["action-extra"]?(Ma(),Va("div",g0,[t.$slots["action-extra"]?vi(t.$slots,"action-extra",{key:0,selectCurrentDate:z}):Qa("",!0)])):Qa("",!0)],6),!t.autoApply||Ot(f).keepActionRow?(Ma(),qa(sZ,Za({key:3,"menu-mount":y.value},s.value,{"calendar-width":m.value,onClosePicker:n[16]||(n[16]=e=>t.$emit("close-picker")),onSelectDate:n[17]||(n[17]=e=>t.$emit("select-date")),onInvalidSelect:n[18]||(n[18]=e=>t.$emit("invalid-select")),onSelectNow:z}),mi({_:2},[gi(Ot(R),(e,n)=>({name:e,fn:pn(n=>[vi(t.$slots,e,Y(Wa({...n})))])}))]),1040,["menu-mount","calendar-width"])):Qa("",!0)],46,c0)}}});var v0=(e=>(e.center="center",e.left="left",e.right="right",e))(v0||{});const y0=({menuRef:e,menuRefInner:t,inputRef:n,pickerWrapperRef:i,inl
5211ine:a,emit:o,props:s,slots:r})=>{const{defaultedConfig:l}=eZ(s),c=It({}),u=It(!1),h=It({top:"0",left:"0"}),d=It(!1),f=Ft(s,"teleportCenter");pa(f,()=>{h.value=JSON.parse(JSON.stringify({})),y()});const p=(e,t)=>{h.value.left="".concat(e+t-c.value.width,"px")},g=e=>{h.value.left="".concat(e,"px")},m=(e,t)=>{s.position===v0.left&&g(e),s.position===v0.right&&p(e,t),s.position===v0.center&&(h.value.left="".concat(e+t/2-c.value.width/2,"px"))},v=e=>{const{width:t,height:n}=e.getBoundingClientRect(),{top:i,left:a}=s.altPosition?s.altPosition(e):(e=>{if(s.teleport){const t=e.getBoundingClientRect();return{left:t.left+window.scrollX,top:t.top+window.scrollY}}return{top:0,left:0}})(e);return{top:+i,left:+a,width:t,height:n}},y=(i=!0)=>{var r;if(!a.value.enabled){if(f.value)return h.value.left="50%",h.value.top="50%",h.value.transform="translate(-50%, -50%)",h.value.position="fixed",void delete h.value.opacity;if(null!==s.altPosition)return(()=>{const e=jX(n),{top:t,left:i,transform:a}=s.altPosition(e);h.value={top:"".concat(t,"px"),left:"".concat(i,"px"),transform:null!=a?a:""}})();if(i){const n=s.teleport?null==(r=t.value)?void 0:r.$el:e.value;n&&(c.value=n.getBoundingClientRect()),o("recalculate-position")}return x()}},b=({inputEl:e,left:t,width:n})=>{window.screen.width>768&&!u.value&&m(t,n),w(e)},_=e=>{const{top:t,left:n,height:i,width:a}=v(e);h.value.top="".concat(i+t+ +s.offset,"px"),d.value=!1,u.value||(h.value.left="".concat(n+a/2-c.value.width/2,"px")),b({inputEl:e,left:n,width:a})},w=e=>{if(s.autoPosition){const{left:t,width:n}=v(e),{left:i,right:a}=c.value;if(!u.value){if(Math.abs(i)!==Math.abs(a)){if(i<=0)return u.value=!0,g(t);if(a>=document.documentElement.clientWidth)return u.value=!0,p(t,n)}return m(t,n)}}},k=e=>(()=>{const e=jX(n);if(e){const{height:t}=c.value,{top:n,height:i}=e.getBoundingClientRect(),a=window.innerHeight-n-i,o=n;return t<=a?OX.bottom:t>a&&t<=o?OX.top:a>=o?OX.bottom:OX.top}return OX.bottom})()===OX.bottom?_(e):(e=>{const{top:t,left:n,width:i}=v(e);h.value.top="".concat(t-+s.offset-c.value.height,"px"),d.value=!0,b({inputEl:e,left:n,width:i})})(e),x=()=>{const e=jX(n);if(e)return s.autoPosition?k(e):_(e)},T=function(e){return e&&e!==document.body&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?function(e){if(e){const t=e.scrollHeight>e.clientHeight,n=-1!==window.getComputedStyle(e).overflowY.indexOf("hidden");return t&&!n}return!0}(e)?e:T(e.assignedSlot&&l.value.shadowDom?e.assignedSlot.parentNode:e.parentNode):window};return{openOnTop:d,menuStyle:h,xCorrect:u,setMenuPosition:y,getScrollableParent:T,shadowRender:(e,t)=>{var a,o,u;const h=document.createElement("div"),d=null==(a=jX(n))?void 0:a.getBoundingClientRect();h.setAttribute("id","dp--temp-container");const f=null!=(o=i.value)&&o.clientWidth?i.value:document.body;f.append(h);const p=(e=>{if(e)switch(s.position){case v0.left:return{left:0,transform:"translateX(0)"};case v0.right:return{left:"".concat(e.width,"px"),transform:"translateX(-100%)"};default:return{left:"".concat(e.width/2,"px"),transform:"translateX(-50%)"}}return{}})(d),g=l.value.shadowDom?Object.keys(r).filter(e=>["right-sidebar","left-sidebar","top-extra","action-extra"].includes(e)):Object.keys(r),m=_o(e,{...t,shadow:!0,style:{opacity:0,position:"absolute",...p}},Object.fromEntries(g.map(e=>[e,r[e]])));Os(m,h),c.value=null==(u=m.el)?void 0:u.getBoundingClientRect(),Os(null,h),f.removeChild(h)}}},b0=[{name:"clock-icon",use:["time","calendar","shared"]},{name:"arrow-left",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-right",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-up",use:["time","calendar","month-year","shared"]},{name:"arrow-down",use:["time","calendar","month-year","shared"]},{name:"calendar-icon",use:["month-year","time","calendar","shared","year-mode"]},{name:"day",use:["calendar","shared"]},{name:"month-overlay-value",use:["calendar","month-year","shared"]},{name:"year-overlay-value",use:["calendar","month-year","shared","year-mode"]},{name:"year-overlay",use:["month-year","shared"]},{name:"month-overlay",use:["month-year","shared"]},{name:"month-overlay-header",use:["month-year","shared"]},{name:"year-overlay-header",use:["month-year","shared"]},{name:"hours-overlay-value",use:["calendar","time","shared"]},{name:"hours-overlay-header",use:["calendar","time","shared"]},{name:"minutes-overlay-value",use:["calendar","time","shared"]},{name:"minutes-overlay-header",use:["calendar","time","shared"]},{name:"seconds-overlay-value",use:["calendar","time","shared"]},{name:"seconds-overlay-header",use:["calendar","time","shared"]},{name:"hours",use:["calendar","time","shared"]},{name:"minutes",use:["calendar","time","shared"]},{name:"month",use:["calendar","month-year","shared"]},{name:"year",use:["calendar","month-year","shared","year-mode"]},{name:"action-buttons",use:["action"]},{name:"action-preview",use:["action"]},{name:"calendar-header",use:["calendar","shared"]},{name:"marker-tooltip",use:["calendar","shared"]},{name:"action-extra",use:["menu"]},{name:"time-picker-overlay",use:["calendar","time","shared"]},{name:"am-pm-button",use:["calendar","time","shared"]},{name:"left-sidebar",use:["menu"]},{name:"right-sidebar",use:["menu"]},{name:"month-year",use:["month-year","shared"]},{name:"time-picker",use:["menu","shared"]},{name:"action-row",use:["action"]},{name:"marker",use:["calendar","shared"]},{name:"quarter",use:["shared"]},{name:"top-extra",use:["shared","month-year"]},{name:"tp-inline-arrow-up",use:["shared","time"]},{name:"tp-inline-arrow-down",use:["shared","time"]},{name:"menu-header",use:["menu"]}],_0=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],w0={all:()=>b0,monthYear:()=>b0.filter(e=>e.use.includes("month-year")),input:()=>_0,timePicker:()=>b0.filter(e=>e.use.includes("time")),action:()=>b0.filter(e=>
5211e.use.includes("action")),calendar:()=>b0.filter(e=>e.use.includes("calendar")),menu:()=>b0.filter(e=>e.use.includes("menu")),shared:()=>b0.filter(e=>e.use.includes("shared")),yearMode:()=>b0.filter(e=>e.use.includes("year-mode"))},k0=(e,t,n)=>{const i=[];return w0[t]().forEach(t=>{e[t.name]&&i.push(t.name)}),null!=n&&n.length&&n.forEach(e=>{e.slot&&i.push(e.slot)}),i},x0=e=>{const t=bo(()=>t=>e.value?t?e.value.open:e.value.close:""),n=bo(()=>t=>e.value?t?e.value.menuAppearTop:e.value.menuAppearBottom:"");return{transitionName:t,showTransition:!!e.value,menuTransition:n}},T0=(e,t,n)=>{const{defaultedRange:i,defaultedTz:a}=eZ(e),o=sJ(IX(sJ(),a.value.timezone)),s=It([{month:u$(o),year:d$(o)}]),r=e=>{const t={hours:l$(o),minutes:c$(o),seconds:0};return i.value.enabled?[t[e],t[e]]:t[e]},l=gt({hours:r("hours"),minutes:r("minutes"),seconds:r("seconds")});pa(i,(e,t)=>{e.enabled!==t.enabled&&(l.hours=r("hours"),l.minutes=r("minutes"),l.seconds=r("seconds"))},{deep:!0});const c=bo({get:()=>e.internalModelValue,set:n=>{!e.readonly&&!e.disabled&&t("update:internal-model-value",n)}}),u=bo(()=>e=>s.value[e]?s.value[e].month:0),h=bo(()=>e=>s.value[e]?s.value[e].year:0);return pa(c,(e,t)=>{n&&JSON.stringify(null!=e?e:{})!==JSON.stringify(null!=t?t:{})&&n()},{deep:!0}),{calendars:s,time:l,modelValue:c,month:u,year:h,today:o}},C0=(e,t)=>{const{defaultedMultiCalendars:n,defaultedMultiDates:i,defaultedUI:a,defaultedHighlight:o,defaultedTz:s,propDates:r,defaultedRange:l}=eZ(t),{isDisabled:c}=E0(t),u=It(null),h=It(IX(new Date,s.value.timezone)),d=(n,i=!0)=>(l.value.enabled||t.weekPicker)&&Array.isArray(e.value)&&2===e.value.length?!(t.hideOffsetDates&&!n.current)&&uJ(sJ(n.value),e.value[i?0:1]):!!l.value.enabled&&(((t,n)=>{const i=e.value&&Array.isArray(e.value)&&e.value?n?e.value[0]||null:e.value[1]:null;return uJ(sJ(t.value),i)})(n,i)&&(t=>{var n;const i=Array.isArray(e.value)?e.value[0]:null;return!t||!cJ(null!=(n=u.value)?n:null,i)})(i)||uJ(n.value,Array.isArray(e.value)?e.value[0]:null)&&(t=>!(Array.isArray(e.value)&&l.value.enabled&&e.value[0]&&u.value)||(t?hJ(u.value,e.value[0]):cJ(u.value,e.value[0])))(i)),f=(t,n)=>{if(Array.isArray(e.value)&&e.value[0]&&1===e.value.length){const i=uJ(t.value,u.value);return n?hJ(e.value[0],t.value)&&i:cJ(e.value[0],t.value)&&i}return!1},p=n=>!(!e.value||t.hideOffsetDates&&!n.current)&&(l.value.enabled?!(!t.modelAuto||!Array.isArray(e.value))&&uJ(n.value,e.value[0]?e.value[0]:h.value):i.value.enabled&&Array.isArray(e.value)?e.value.some(e=>uJ(e,n.value)):uJ(n.value,e.value?e.value:h.value)),g=e=>{if(l.value.autoRange||t.weekPicker){if(u.value){if(t.hideOffsetDates&&!e.current)return!1;const n=KY(u.value,+l.value.autoRange),i=wJ(sJ(u.value),t.weekStart);return t.weekPicker?uJ(i[1],sJ(e.value)):uJ(n,sJ(e.value))}return!1}return!1},m=e=>{if(l.value.autoRange||t.weekPicker){if(u.value){const n=KY(u.value,+l.value.autoRange);if(t.hideOffsetDates&&!e.current)return!1;const i=wJ(sJ(u.value),t.weekStart);return t.weekPicker?hJ(e.value,i[0])&&cJ(e.value,i[1]):hJ(e.value,u.value)&&cJ(e.value,n)}return!1}return!1},v=e=>{if(l.value.autoRange||t.weekPicker){if(u.value){if(t.hideOffsetDates&&!e.current)return!1;const n=wJ(sJ(u.value),t.weekStart);return t.weekPicker?uJ(n[0],e.value):uJ(u.value,e.value)}return!1}return!1},y=()=>!t.modelAuto||HX(t.internalModelValue),b=e=>{if(t.weekPicker)return!1;const n=!l.value.enabled||!d(e)&&!d(e,!1);return!c(e.value)&&!p(e)&&!(!e.current&&t.hideOffsetDates)&&n},_=e=>l.value.enabled?!!t.modelAuto&&(!(!t.modelAuto||!Array.isArray(t.internalModelValue)||!t.internalModelValue[0])&&p(e)):p(e),w=e=>!!o.value&&((e,t)=>!e||!!t&&(t instanceof Map?!!nJ(e,t):t(sJ(e))))(e.value,r.value.highlight),k=e=>{const t=c(e.value);return t&&("function"==typeof o.value?!o.value(e.value,t):!o.value.options.highlightDisabled)},x=e=>{var t;return"function"==typeof o.value?o.value(e.value):null==(t=o.value.weekdays)?void 0:t.includes(e.value.getDay())},T=i=>!(!l.value.enabled&&!t.weekPicker||n.value.count>0&&!i.current||!y()||!i.current&&t.hideOffsetDates||p(i))&&(t=>dJ(e.value,u.value,t.value))(i),C=e=>{const{isRangeStart:n,isRangeEnd:i}=S(e),a=!!l.value.enabled&&(n||i);return{dp__cell_offset:!e.current,dp__pointer:!(t.disabled||!e.current&&t.hideOffsetDates||c(e.value)),dp__cell_disabled:c(e.value),dp__cell_highlight:!k(e)&&(w(e)||x(e))&&!_(e)&&!a&&!v(e)&&!(T(e)&&t.weekPicker)&&!i,dp__cell_highlight_active:!k(e)&&(w(e)||x(e))&&_(e),dp__today:!t.noToday&&uJ(e.value,h.value)&&e.current,"dp--past":cJ(e.value,h.value),"dp--future":hJ(e.value,h.value)}},E=e=>({dp__active_date:_(e),dp__date_hover:b(e)}),S=e=>({isRangeStart:n.value.count>0?e.current&&d(e)&&y():d(e)&&y(),isRangeEnd:n.value.count>0?e.current&&d(e,!1)&&y():d(e,!1)&&y()}),I=e=>{const{isRangeStart:n,isRangeEnd:i}=S(e);return{dp__range_start:n,dp__range_end:i,dp__range_between:T(e),dp__date_hover:uJ(e.value,u.value)&&!n&&!i&&!t.weekPicker,dp__date_hover_start:f(e,!0),dp__date_hover_end:f(e,!1)}},A=e=>({...I(e),dp__cell_auto_range:m(e),dp__cell_auto_range_start:v(e),dp__cell_auto_range_end:g(e)}),D=n=>l.value.enabled?l.value.autoRange?A(n):t.modelAuto?{...E(n),...I(n)}:t.weekPicker?(n=>{if(e.value&&Array.isArray(e.value)){const i=wJ(e.value[0],t.weekStart),a=e.value[1]?wJ(e.value[1],t.weekStart):[];return{...A(n),dp__range_start:uJ(i[0],n.value)||uJ(a[0],n.value),dp__range_end:uJ(i[1],n.value)||uJ(a[1],n.value),dp__range_between_week:hJ(n.value,i[0])&&cJ(n.value,i[1])||hJ(n.value,a[0])&&cJ(n.value,a[1]),dp__range_between:hJ(n.value,i[1])&&cJ(n.value,a[0])}}return{...A(n)}})(n):I(n):t.weekPicker?(n=>{if(e.value&&!Array.isArray(e.value)){const i=wJ(e.value,t.weekStart);return{...A(n),dp__range_start:uJ(i[0],n.value),dp__range_end:uJ(i[1],n.value),dp__range_between_week:hJ(n.value,i[0])&&cJ(n.value,i[1])}}return{...A(n)}})(n):E(n);return{setHoverDate:e=>{!e.current&&t.hideOffsetDates||(u.value=e.value)},clearHoverDate:()=>{u.value=null},getDayClassData:e=>{var n;return t.hideOffsetDates&&!e.current?{}:{...C(e),...D(e),[t.dayClass?t.dayClass(e.value,t.internalModelValue):""]:!0,...null!=(n=a.value.calendarCell)?n:{}}}}},E0=e=>{const{defaultedFilters:t,defaultedRange:n,propDates:i,defaultedMultiDates:a}=eZ(e),o=n=>{const a=(t=>!!i.value.maxDate&&(e.yearPicker?d$(t)>d$(i.value.maxDate):hJ(t,i.value.maxDate)))(n),o=(t=>!!i.value.minDate&&(e.yearPicker?d$(t)<d$(i.value.minDate):cJ(t,i.value.minDate)))(n),s=(e=>!!i.value.disabledDates&&("function"==typeof i.value.disabledDates?i.value.disabledDates(sJ(e)):!!nJ(e,i.value.disabledDates)))(n),r=t.value.months.map(e=>+e).includes(u$(n)),c=!!e.disabledWeekDays.length&&e.disabledWeekDays.some(e=>
5211+e===zY(n).getDay()),u=l(n),h=d$(n),d=h<+e.yearRange[0]||h>+e.yearRange[1];return!(a||o||s||r||d||c||u)},s=(e,t)=>cJ(...xJ(i.value.minDate,e,t))||uJ(...xJ(i.value.minDate,e,t)),r=(e,t)=>hJ(...xJ(i.value.maxDate,e,t))||uJ(...xJ(i.value.maxDate,e,t)),l=e=>!(!Array.isArray(i.value.allowedDates)||i.value.allowedDates.length)||!!i.value.allowedDates&&!nJ(e,i.value.allowedDates),c=e=>!o(e),u=t=>{if(t){const n=d$(t);return n>=+e.yearRange[0]&&n<=e.yearRange[1]}return!0},h=(e,t,n)=>e.find(e=>+e.hours===l$(t)&&"*"===e.minutes||+e.minutes===c$(t)&&+e.hours===l$(t))&&n,d=(t,n)=>{const i=Array.isArray(n)?n:[n];return Array.isArray(e.disabledTimes)?Array.isArray(e.disabledTimes[0])?((e,t,n)=>{const[i,a]=e,[o,s]=t;return!h(i,o,n)&&!h(a,s,n)&&n})(e.disabledTimes,i,t):!i.some(n=>h(e.disabledTimes,n,t)):t},f=(t,n)=>e.disabledTimes?Array.isArray(e.disabledTimes)?d(n,t):((t,n)=>{const i=Array.isArray(n)?[gJ(n[0]),n[1]?gJ(n[1]):void 0]:gJ(n),a=!e.disabledTimes(i);return t&&a})(n,t):n,p=t=>{let n=!0;if(!t||!e.enableTimePicker||e.monthPicker||e.yearPicker||e.ignoreTimeValidation)return!0;const a=i.value.minDate||i.value.maxDate?t:(e=>Array.isArray(e)?[e[0]?RJ(e[0]):null,e[1]?RJ(e[1]):null]:RJ(e))(t);return(e.maxTime||i.value.maxDate)&&(n=NJ(e.maxTime,i.value.maxDate,"max",a,n)),(e.minTime||i.value.minDate)&&(n=NJ(e.minTime,i.value.minDate,"min",a,n)),f(t,n)},g=t=>{if(!e.monthPicker)return!0;let n=!0;const a=sJ(fJ(t));if(i.value.minDate&&i.value.maxDate){const e=sJ(fJ(i.value.minDate)),t=sJ(fJ(i.value.maxDate));return hJ(a,e)&&cJ(a,t)||uJ(a,e)||uJ(a,t)}if(i.value.minDate){const e=sJ(fJ(i.value.minDate));n=hJ(a,e)||uJ(a,e)}if(i.value.maxDate){const e=sJ(fJ(i.value.maxDate));n=cJ(a,e)||uJ(a,e)}return n},m=bo(()=>t=>!(e.enableTimePicker&&!e.ignoreTimeValidation)||p(t)),v=bo(()=>t=>!e.monthPicker||(Array.isArray(t)&&(n.value.enabled||a.value.enabled)?!t.filter(e=>!g(e)).length:g(t)));return{isDisabled:c,validateDate:o,validateMonthYearInRange:(e,t,n,a)=>{let o=!1;return a&&(i.value.minDate||i.value.maxDate)?i.value.minDate&&i.value.maxDate?o=((e,t,n)=>{let a=!1;return i.value.maxDate&&n&&r(e,t)&&(a=!0),i.value.minDate&&!n&&s(e,t)&&(a=!0),a})(e,t,n):(i.value.minDate&&s(e,t)||i.value.maxDate&&r(e,t))&&(o=!0):o=!0,o},isDateRangeAllowed:e=>!n.value.noDisabledRange||!mQ({start:e[0],end:e[1]}).some(e=>c(e)),checkMinMaxRange:(e,t,i=0)=>{if(((e,t)=>!!(Array.isArray(e)&&e[t]&&(n.value.maxRange||n.value.minRange)&&u(e[t])))(t,i)&&u(e)){const a=oQ(e,t[i]),o=bJ(t[i],e),s=1===o.length?0:o.filter(e=>c(e)).length,r=Math.abs(a)-(n.value.minMaxRawRange?0:s);if(n.value.minRange&&n.value.maxRange)return r>=+n.value.minRange&&r<=+n.value.maxRange;if(n.value.minRange)return r>=+n.value.minRange;if(n.value.maxRange)return r<=+n.value.maxRange}return!0},isValidTime:p,isTimeValid:m,isMonthValid:v}},S0=()=>({hideNavigationButtons:bo(()=>(e,t)=>null==e?void 0:e.includes(t)),showLeftIcon:bo(()=>(e,t)=>!e.count||(!!e.solo||0===t)),showRightIcon:bo(()=>(e,t)=>!e.count||(!!e.solo||t===e.count-1))}),I0=(e,t,n)=>{const i=It(0),a=gt({[MX.timePicker]:!e.enableTimePicker||e.timePicker||e.monthPicker,[MX.calendar]:!1,[MX.header]:!1}),o=bo(()=>e.monthPicker||e.timePicker),s=()=>{i.value=-1},r=(t,a,...o)=>{var s,r;e.flow[i.value]===t&&n.value&&(null==(r=(s=n.value)[a])||r.call(s,...o))},l=(t=0)=>{t&&(i.value+=t),r(NX.month,"toggleMonthPicker",!0),r(NX.year,"toggleYearPicker",!0),r(NX.calendar,"toggleTimePicker",!1,!0),r(NX.time,"toggleTimePicker",!0,!0);const n=e.flow[i.value];(n===NX.hours||n===NX.minutes||n===NX.seconds)&&r(n,"toggleTimePicker",!0,!0,n)};return{childMount:t=>{var n;if(null!=(n=e.flow)&&n.length){if(!t&&o.value)return l();a[t]=!0,Object.keys(a).filter(e=>!a[e]).length||l()}},updateFlowStep:()=>{var n,a;null!=(n=e.flow)&&n.length&&-1!==i.value&&(i.value+=1,t("flow-step",i.value),l()),(null==(a=e.flow)?void 0:a.length)===i.value&&an().then(()=>s())},resetFlow:s,handleFlow:l,flowStep:i}},A0={key:1,class:"dp__input_wrap"},D0=["id","name","inputmode","placeholder","disabled","readonly","required","value","autocomplete","aria-label","aria-disabled","aria-invalid"],P0={key:2,class:"dp--clear-btn"},O0=["aria-label"],M0=jn({compatConfig:{MODE:3},__name:"DatepickerInput",props:{isMenuOpen:{type:Boolean,default:!1},inputValue:{type:String,default:""},...nZ},emits:["clear","open","update:input-value","set-input-date","close","select-date","set-empty-date","toggle","focus-prev","focus","blur","real-blur","text-input"],setup(e,{expose:t,emit:n}){const i=n,a=e,{defaultedTextInput:o,defaultedAriaLabels:s,defaultedInline:r,defaultedConfig:l,defaultedRange:c,defaultedMultiDates:u,defaultedUI:h,getDefaultPattern:d,getDefaultStartTime:f}
5211=eZ(a),{checkMinMaxRange:p}=E0(a),g=It(),m=It(null),v=It(!1),y=It(!1),b=bo(()=>{var e;return{dp__pointer:!a.disabled&&!a.readonly&&!o.value.enabled,dp__disabled:a.disabled,dp__input_readonly:!o.value.enabled,dp__input:!0,dp__input_icon_pad:!a.hideInputIcon,dp__input_valid:"boolean"==typeof a.state&&a.state,dp__input_invalid:"boolean"==typeof a.state&&!a.state,dp__input_focus:v.value||a.isMenuOpen,dp__input_reg:!o.value.enabled,...null!=(e=h.value.input)?e:{}}}),_=e=>{var t;const n=f();return((e,t,n,i,a,o)=>{const s=Array.isArray(n)?n[0]:n;if("string"==typeof t)return oJ(e,t,s,i,a,o);if(Array.isArray(t)){let n=null;for(const r of t)if(n=oJ(e,r,s,i,a,o),n)break;return n}return"function"==typeof t?t(e):null})(e,null!=(t=o.value.format)?t:d(),null!=n?n:kJ({},a.enableSeconds),a.inputValue,y.value,a.formatLocale)},w=()=>{y.value=!0},k=e=>{if(c.value.enabled)(e=>{const{rangeSeparator:t}=o.value,[n,i]=e.split("".concat(t));if(n){const e=_(n.trim()),t=i?_(i.trim()):null;if(f$(e,t))return;const a=e&&t?[e,t]:[e];p(t,a,0)&&(g.value=e?a:null)}})(e);else if(u.value.enabled){const t=e.split(";");g.value=t.map(e=>_(e.trim())).filter(e=>e)}else g.value=_(e)},x=e=>{var t;const n="string"==typeof e?e:null==(t=e.target)?void 0:t.value;""!==n?(o.value.openMenu&&!a.isMenuOpen&&i("open"),k(n),i("set-input-date",g.value)):(i("set-input-date",null),a.clearable&&a.autoApply&&(i("set-empty-date"),g.value=null)),y.value=!1,i("update:input-value",n),i("text-input",e,g.value)},T=e=>{o.value.enabled?(k(e.target.value),o.value.enterSubmit&&PJ(g.value)&&""!==a.inputValue?(i("set-input-date",g.value,!0),g.value=null):o.value.enterSubmit&&""===a.inputValue&&(g.value=null,i("clear"))):S(e)},C=(e,t)=>{o.value.enabled&&o.value.tabSubmit&&!t&&k(e.target.value),o.value.tabSubmit&&PJ(g.value)&&""!==a.inputValue?(i("set-input-date",g.value,!0,!0),g.value=null):o.value.tabSubmit&&""===a.inputValue&&(g.value=null,i("clear",!0))},E=()=>{v.value=!0,i("focus"),an().then(()=>{var e;o.value.enabled&&o.value.selectOnFocus&&(null==(e=m.value)||e.select())})},S=e=>{if(XX(e,l.value,!0),o.value.enabled&&o.value.openMenu&&!r.value.input){if("open"===o.value.openMenu&&!a.isMenuOpen)return i("open");if("toggle"===o.value.openMenu)return i("toggle")}else o.value.enabled||i("toggle")},I=()=>{i("real-blur"),v.value=!1,(!a.isMenuOpen||r.value.enabled&&r.value.input)&&i("blur"),a.autoApply&&o.value.enabled&&g.value&&!a.isMenuOpen&&(i("set-input-date",g.value),i("select-date"),g.value=null)},A=e=>{XX(e,l.value,!0),i("clear")},D=e=>{if("Tab"===e.key&&C(e),"Enter"===e.key&&T(e),!o.value.enabled){if("Tab"===e.code)return;e.preventDefault()}},P=e=>{e.key===VX.tab&&C(e,!0)};return t({focusInput:()=>{var e;null==(e=m.value)||e.focus({preventScroll:!0})},setParsedDate:e=>{g.value=e}}),(t,n)=>{var a,l,c;return Ma(),Va("div",{onClick:S},[!t.$slots.trigger||t.$slots["dp-input"]||Ot(r).enabled?Qa("",!0):vi(t.$slots,"trigger",{key:0}),t.$slots.trigger||Ot(r).enabled&&!Ot(r).input?Qa("",!0):(Ma(),Va("div",A0,[t.$slots["dp-input"]&&!t.$slots.trigger&&(!Ot(r).enabled||Ot(r).enabled&&Ot(r).input)?vi(t.$slots,"dp-input",{key:0,value:e.inputValue,isMenuOpen:e.isMenuOpen,onInput:x,onEnter:T,onTab:C,onClear:A,onBlur:I,onKeypress:D,onPaste:w,onFocus:E,openMenu:()=>t.$emit("open"),closeMenu:()=>t.$emit("close"),toggleMenu:()=>t.$emit("toggle")}):Qa("",!0),t.$slots["dp-input"]?Qa("",!0):(Ma(),Va("input",{key:1,id:t.uid?"dp-input-".concat(t.uid):void 0,ref_key:"inputRef",ref:m,"data-test":"dp-input",name:t.name,class:G(b.value),inputmode:Ot(o).enabled?"text":"none",placeholder:t.placeholder,disabled:t.disabled,readonly:t.readonly,required:t.required,value:e.inputValue,autocomplete:t.autocomplete,"aria-label":null==(a=Ot(s))?void 0:a.input,"aria-disabled":t.disabled||void 0,"aria-invalid":!1===t.state||void 0,onInput:x,onBlur:I,onFocus:E,onKeypress:D,onKeydown:n[0]||(n[0]=e=>D(e)),onPaste:w},null,42,D0)),Ha("div",{onClick:n[3]||(n[3]=e=>i("toggle"))},[t.$slots["input-icon"]&&!t.hideInputIcon?(Ma(),Va("span",{key:0,class:"dp__input_icon",onClick:n[1]||(n[1]=e=>i("toggle"))},[vi(t.$slots,"input-icon")])):Qa("",!0),t.$slots["input-icon"]||t.hideInputIcon||t.$slots["dp-input"]?Qa("",!0):(Ma(),qa(Ot(wX),{key:1,"aria-label":null==(l=Ot(s))?void 0:l.calendarIcon,class:"dp__input_icon dp__input_icons",onClick:n[2]||(n[2]=e=>i("toggle"))},null,8,["aria-label"]))]),t.$slots["clear-icon"]&&e.inputValue&&t.clearable&&!t.disabled&&!t.readonly?(Ma(),Va("span",P0,[vi(t.$slots,"clear-icon",{clear:A})])):Qa("",!0),!t.clearable||t.$slots["clear-icon"]||!e.inputValue||t.disabled||t.readonly?Qa("",!0):(Ma(),Va("button",{key:3,"aria-label":null==(c=Ot(s))?void 0:c.clearInput,class:"dp--clear-btn",type:"button",onKeydown:n[4]||(n[4]=e=>Ot(iJ)(e,()=>A(e),!0,P)),onClick:n[5]||(n[5]=Es(e=>A(e),["prevent"]))},[za(Ot(kX),{class:"dp__input_icons","data-test":"clear-icon"})],40,O0))]))])}}}),N0=typeof window<"u"?window:void 0,R0=()=>{},L0=(e,t,n,i)=>{if(!e)return R0;let a=R0;const o=pa(()=>Ot(e),e=>{a(),e&&(e.addEventListener(t,n,i),a=()=>{e.removeEventListener(t,n,i),a=R0})},{immediate:!0,flush:"post"}),s=()=>{o(),a()};return(e=>{!!re()&&le(e)}
5211)(s),s},V0=jn({compatConfig:{MODE:3},__name:"VueDatePicker",props:{...nZ},emits:["update:model-value","update:model-timezone-value","text-submit","closed","cleared","open","focus","blur","internal-model-change","recalculate-position","flow-step","update-month-year","invalid-select","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","date-update","invalid-date","overlay-toggle","text-input"],setup(e,{expose:t,emit:n}){const i=n,a=e,o=xi(),s=It(!1),r=Ft(a,"modelValue"),l=Ft(a,"timezone"),c=It(null),u=It(null),h=It(null),d=It(!1),f=It(null),p=It(!1),g=It(!1),m=It(!1),v=It(!1),{setMenuFocused:y,setShiftKey:b}=BJ(),{clearArrowNav:_}=QJ(),{validateDate:w,isValidTime:k}=E0(a),{defaultedTransitions:x,defaultedTextInput:T,defaultedInline:C,defaultedConfig:E,defaultedRange:S,defaultedMultiDates:I}=eZ(a),{menuTransition:A,showTransition:D}=x0(x);ei(()=>{U(a.modelValue),an().then(()=>{if(!C.value.enabled){const e=V(f.value);null==e||e.addEventListener("scroll",Z),null==window||window.addEventListener("resize",ee)}}),C.value.enabled&&(s.value=!0),null==window||window.addEventListener("keyup",te),null==window||window.addEventListener("keydown",ne)}),ai(()=>{if(!C.value.enabled){const e=V(f.value);null==e||e.removeEventListener("scroll",Z),null==window||window.removeEventListener("resize",ee)}null==window||window.removeEventListener("keyup",te),null==window||window.removeEventListener("keydown",ne)});const P=k0(o,"all",a.presetDates),O=k0(o,"input");pa([r,l],()=>{U(r.value)},{deep:!0});const{openOnTop:M,menuStyle:N,xCorrect:R,setMenuPosition:L,getScrollableParent:V,shadowRender:q}=y0({menuRef:c,menuRefInner:u,inputRef:h,pickerWrapperRef:f,inline:C,emit:i,props:a,slots:o}),{inputValue:F,internalModelValue:B,parseExternalModelValue:U,emitModelValue:j,formatInputValue:H,checkBeforeEmit:z}=tZ(i,a,d),W=bo(()=>({dp__main:!0,dp__theme_dark:a.dark,dp__theme_light:!a.dark,dp__flex_display:C.value.enabled,"dp--flex-display-collapsed":m.value,dp__flex_display_with_input:C.value.input})),K=bo(()=>a.dark?"dp__theme_dark":"dp__theme_light"),Q=bo(()=>a.teleport?{to:"boolean"==typeof a.teleport?"body":a.teleport,disabled:!a.teleport||C.value.enabled}:{}),$=bo(()=>({class:"dp__outer_menu_wrap"})),X=bo(()=>C.value.enabled&&(a.timePicker||a.monthPicker||a.yearPicker||a.quarterPicker)),J=()=>{var e,t;return null==(t=null==(e=h.value)?void 0:e.$el)?void 0:t.getBoundingClientRect()},Z=()=>{s.value&&(E.value.closeOnScroll?he():L())},ee=()=>{var e;s.value&&L();const t=null==(e=u.value)?void 0:e.$el.getBoundingClientRect().width;m.value=document.body.offsetWidth<=t},te=e=>{"Tab"===e.key&&!C.value.enabled&&!a.teleport&&E.value.tabOutClosesMenu&&(f.value.contains(document.activeElement)||he()),g.value=e.shiftKey},ne=e=>{g.value=e.shiftKey},ie=()=>{!a.disabled&&!a.readonly&&(q(m0,a),L(!1),s.value=!0,s.value&&i("open"),s.value||ue(),U(a.modelValue))},ae=()=>{var e;F.value="",ue(),null==(e=h.value)||e.setParsedDate(null),i("update:model-value",null),i("update:model-timezone-value",null),i("cleared"),E.value.closeOnClearValue&&he()},oe=()=>{const e=B.value;return!(e&&(Array.isArray(e)||!w(e)))||!!Array.isArray(e)&&(!!(I.value.enabled||2===e.length&&w(e[0])&&w(e[1]))||!(!S.value.partialRange||a.timePicker)&&w(e[0]))},se=()=>{z()&&oe()?(j(),he()):i("invalid-select",B.value)},re=e=>{le(),j(),E.value.closeOnAutoApply&&!e&&he()},le=()=>{h.value&&T.value.enabled&&h.value.setParsedDate(B.value)},ce=(e=!1)=>{a.autoApply&&k(B.value)&&oe()&&(S.value.enabled&&Array.isArray(B.value)?(S.value.partialRange||2===B.value.length)&&re(e):re(e))},ue=()=>{T.value.enabled||(B.value=null)},he=()=>{C.value.enabled||(s.value&&(s.value=!1,R.value=!1,y(!1),b(!1),_(),i("closed"),F.value&&U(r.value)),ue(),i("blur"))},de=(e,t,n=!1)=>
5211{if(!e)return void(B.value=null);const a=Array.isArray(e)?!e.some(e=>!w(e)):w(e),o=k(e);a&&o?(v.value=!0,B.value=e,t&&(p.value=n,se(),i("text-submit")),an().then(()=>{v.value=!1})):i("invalid-date",e)},fe=()=>{a.autoApply&&k(B.value)&&j(),le()},pe=()=>s.value?he():ie(),ge=()=>{T.value.enabled&&(d.value=!0,H()),i("focus")},me=()=>{if(T.value.enabled&&(d.value=!1,U(a.modelValue),p.value)){const e=function(e,t){let n=[...document.querySelectorAll(["a[href]","area[href]","input:not([disabled]):not([type='hidden'])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","[tabindex]:not([tabindex='-1'])","[data-datepicker-instance]"].join(", "))];n=n.filter(t=>!e.contains(t)||t.hasAttribute("data-datepicker-instance"));const i=n.indexOf(e);if(i>=0&&(t?i-1>=0:i+1<=n.length))return n[i+(t?-1:1)]}(f.value,g.value);null==e||e.focus()}i("blur")};return((e,t,n,i={})=>{const{window:a=N0,event:o="pointerdown"}=i;a&&L0(a,o,i=>{const a=jX(e),o=jX(t);!a||!o||a===i.target||i.composedPath().includes(a)||i.composedPath().includes(o)||n(i)},{passive:!0})})(c,h,()=>{return e=oe,E.value.onClickOutside?E.value.onClickOutside(e):he();var e}),t({closeMenu:he,selectDate:se,clearValue:ae,openMenu:ie,onScroll:Z,formatInputValue:H,updateInternalModelValue:e=>{B.value=e},setMonthYear:e=>{u.value&&u.value.updateMonthYear(0,{month:KX(e.month),year:KX(e.year)})},parseModel:e=>{U(null!=e?e:a.modelValue)},switchView:(e,t)=>{var n;null==(n=u.value)||n.switchView(e,t)},toggleMenu:pe,handleFlow:(e=0)=>{var t;null==(t=u.value)||t.handleFlow(e)},dpWrapMenuRef:c}),(e,t)=>(Ma(),Va("div",{ref_key:"pickerWrapperRef",ref:f,class:G(W.value),"data-datepicker-instance":""},[za(M0,Za({ref_key:"inputRef",ref:h,"input-value":Ot(F),"onUpdate:inputValue":t[0]||(t[0]=e=>St(F)?F.value=e:null),"is-menu-open":s.value},e.$props,{onClear:ae,onOpen:ie,onSetInputDate:de,onSetEmptyDate:Ot(j),onSelectDate:se,onToggle:pe,onClose:he,onFocus:ge,onBlur:me,onRealBlur:t[1]||(t[1]=e=>d.value=!1),onTextInput:t[2]||(t[2]=t=>e.$emit("text-input",t))}),mi({_:2},[gi(Ot(O),(t,n)=>({name:t,fn:pn(n=>[vi(e.$slots,t,Y(Wa(n)))])}))]),1040,["input-value","is-menu-open","onSetEmptyDate"]),(Ma(),qa(di(e.teleport?En:"div"),Y(Wa(Q.value)),{default:pn(()=>[za(Mo,{name:Ot(A)(Ot(M)),css:Ot(D)&&!Ot(C).enabled},{default:pn(()=>[s.value?(Ma(),Va("div",Za({key:0,ref_key:"dpWrapMenuRef",ref:c},$.value,{class:{"dp--menu-wrapper":!Ot(C).enabled},style:Ot(C).enabled?void 0:Ot(N)}),[za(m0,Za({ref_key:"dpMenuRef",ref:u},e.$props,{"internal-model-value":Ot(B),"onUpdate:internalModelValue":t[3]||(t[3]=e=>St(B)?B.value=e:null),class:{[K.value]:!0,"dp--menu-wrapper":e.teleport},"open-on-top":Ot(M),"no-overlay-focus":X.value,collapse:m.value,"get-input-rect":J,"is-text-input-date":v.value,onClosePicker:he,onSelectDate:se,onAutoApply:ce,onTimeUpdate:fe,onFlowStep:t[4]||(t[4]=t=>e.$emit("flow-step",t)),onUpdateMonthYear:t[5]||(t[5]=t=>e.$emit("update-month-year",t)),onInvalidSelect:t[6]||(t[6]=t=>e.$emit("invalid-select",Ot(B))),onAutoApplyInvalid:t[7]||(t[7]=t=>e.$emit("invalid-select",t)),onInvalidFixedRange:t[8]||(t[8]=t=>e.$emit("invalid-fixed-range",t)),onRecalculatePosition:Ot(L),onTooltipOpen:t[9]||(t[9]=t=>e.$emit("tooltip-open",t)),onTooltipClose:t[10]||(t[10]=t=>e.$emit("tooltip-close",t)),onTimePickerOpen:t[11]||(t[11]=t=>e.$emit("time-picker-open",t)),onTimePickerClose:t[12]||(t[12]=t=>e.$emit("time-picker-close",t)),onAmPmChange:t[13]||(t[13]=t=>e.$emit("am-pm-change",t)),onRangeStart:t[14]||(t[14]=t=>e.$emit("range-start",t)),onRangeEnd:t[15]||(t[15]=t=>e.$emit("range-end",t)),onDateUpdate:t[16]||(t[16]=t=>e.$emit("date-update",t)),onInvalidDate:t[17]||(t[17]=t=>e.$emit("invalid-date",t)),onOverlayToggle:t[18]||(t[18]=t=>e.$emit("overlay-toggle",t))}),mi({_:2},[gi(Ot(P),(t,n)=>({name:t,fn:pn(n=>[vi(e.$slots,t,Y(Wa({...n})))])}))]),1040,["internal-model-value","class","open-on-top","no-overlay-focus","collapse","is-text-input-date","onRecalculatePosition"])],16)):Qa("",!0)]),_:3},8,["name","css"])]),_:3},16))],2))}}),q0=(()=>{const e=V0;return e.install=t=>{t.component("Vue3DatePicker",e)},e})(),F0=Object.freeze(Object.defineProperty({__proto__:null,default:q0},Symbol.toStringTag,{value:"Module"}));
5211Object.entries(F0).forEach(([e,t])=>{"default"!==e&&(q0[e]=t)});const B0=e=>"".concat(e,"_chat_danang_ai"),U0=e=>"".concat(e,"_chatbot_ai"),j0=e=>uw(sT,"pageViews",e),H0=async e=>{var t;if(!e)return 0;try{const n=await mk(j0(e));return Number(null==(t=n.data())?void 0:t.tong)||0}catch(ZNe){return 0}},z0=async(e,t)=>{if(e)try{await _k(j0(e),{[t]:Ak(1),tong:Ak(1),capNhatLuc:new Date})}catch(ZNe){try{await bk(j0(e),{[t]:1,tong:1,capNhatLuc:new Date},{merge:!0})}catch(n){}}},W0=async(e,t)=>{e&&await bk(j0(e),{tong:Math.max(0,Math.floor(Number(t)||0)),capNhatLuc:new Date},{merge:!0})},K0={class:"modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable"},G0={class:"modal-content nk-modal"},Y0={class:"modal-header nk-header"},Q0={class:"modal-title"},$0={class:"modal-body nk-body"},X0={key:0,class:"nk-trong"},J0={key:1,class:"nk-trong nk-loi"},Z0={key:2,class:"nk-trong"},e1={key:3,class:"nk-ds"},t1={class:"nk-dong-dau"},n1={class:"nk-luc"},i1={class:"nk-thongdiep"},a1={key:0,class:"nk-phu"},o1={key:0},s1={key:1},r1={class:"modal-footer nk-footer"},l1=["disabled"],c1={__name:"ModalNhatKyLoi",setup(e,{expose:t}){const n=It(null);let i=null;const a=It(""),o=It(""),s=It([]),r=It(!1),l=It(""),c=e=>"email"===e.boicanh?"mail":"giaodien",u=e=>"email"!==e.boicanh?"Giao diá»n":"gui-thu"===e.loai?"Gá»i thá»":"Gá»i thư",h=e=>{var t,n;const i=null!=(n=null==(t=null==e?void 0:e.toDate)?void 0:t.call(e))?n:e?new Date(e):null;return!i||Number.isNaN(i.getTime())?"":new Intl.DateTimeFormat("vi-VN",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(i)},d=async()=>{r.value=!0,l.value="";try{s.value=await vT("nhat_ky_loi",[["donvi","==",o.value]],["taoluc","desc"],50)}catch(eRe){l.value=(null==eRe?void 0:eRe.message)||"lá»i không rõ"}finally{r.value=!1}},f=()=>d();return t({moModal:e=>{o.value=(null==e?void 0:e.id)||"",a.value=(null==e?void 0:e.ten)||"",s.value=[],i||(i=new wV(n.value)),i.show(),d()}}),(e,t)=>(Ma(),Va("div",{class:"modal fade",tabindex:"-1",ref_key:"modalRef",ref:n,"aria-hidden":"true"},[Ha("div",K0,[Ha("div",G0,[Ha("div",Y0,[Ha("h5",Q0,"Nháºt ký lá»i â "+ee(a.value||"ÄÆ¡n vá»"),1),t[0]||(t[0]=Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Äóng"},null,-1))]),Ha("div",$0,[Ha("p",{class:"nk-dan"}," Lá»i ghi từ máy chá»§ (gá»i thư, gá»i tin) và từ trình duyá»t cán bá» khi Äang á» mà n cá»§a ÄÆ¡n vá» nà y. Má»i nhất Äứng Äầu, tá»i Äa "+ee(50)+" bản ghi. "),r.value?(Ma(),Va("p",X0,"Äang tảiâ¦")):l.value?(Ma(),Va("p",J0," Không Äá»c ÄÆ°á»£c nháºt ký: "+ee(l.value),1)):s.value.length?(Ma(),Va("ul",e1,[(Ma(!0),Va(Sa,null,gi(s.value,e=>(Ma(),Va("li",{key:e.id,class:"nk-muc"},[Ha("div",t1,[Ha("span",{class:G(["nk-nhan","nk-nhan--".concat(c(e))])},ee(u(e)),3),Ha("span",n1,ee(h(e.taoluc)),1)]),Ha("p",i1,ee(e.thongdiep),1),e.maychu||e.duongdan?(Ma(),Va("p",a1,[e.maychu?(Ma(),Va("span",o1,"Máy chá»§: "+ee(e.maychu),1)):Qa("",!0),e.duongdan?(Ma(),Va("span",s1,"ÄÆ°á»ng dẫn: "+ee(e.duongdan),1)):Qa("",!0)])):Qa("",!0)]))),128))])):(Ma(),Va("p",Z0," Chưa có lá»i nà o ÄÆ°á»£c ghi. Äây là tin tá»t. "))]),Ha("div",r1,[Ha("button",{type:"button",class:"btn btn-secondary",onClick:f,disabled:r.value}," Tải lại ",8,l1),t[1]||(t[1]=Ha("button",{type:"button",class:"btn btn-secondary","data-bs-dismiss":"modal"},"Äóng",-1))])])])],512))}},u1=CC(c1,[["__scopeId","data-v-22d00688"]]),h1=e=>dp().currentUser?e:"".concat(e,"_cong_khai"),d1=gt(new Map),f1=async e=>{var t;if(!e||d1.has(e)||!(null==(t=globalThis.crypto)?void 0:t.subtle))return;const n=await crypto.subtle.digest("SHA-256",(new TextEncoder).encode(String(e))),i=[...new Uint8Array(n)].map(e=>e.toString(16).padStart(2,"0")).join("");d1.set(e,i.slice(0,32))},p1=(e,t)=>!!t&&(e===t||e===d1.get(t)),g1=Hk(aT,"asia-southeast1"),m1=e=>async(t={})=>{var n,i;return(await(n=g1,i=e,Fk(Rc(n),i))(t)).data},v1=m1("laySoThuTu"),y1=Js("khachhangStore",{state:()=>({items:[],item:null,khachDangPhucVu:null,dsKhachDangPhucVuTheoDonVi:[],dsKhachDaPhucVu:[],dsKhachUuTien:[],excelUrl:""}),actions:{fetchItemByKhachMoiNhat:async(e,t)=>(await vT(h1("khach_hang"),[["donvi","==",e],["quay","==",t],["calamviec","==",!0]],["stt","desc"],1))[0],async fetchItemByKhachDaPhucVuByDonVi(e,t,n,i=20,a=null){this.dsKhachDaPhucVu=await CT("khach_hang",[["donvi","==",e],["taoluc",">=",t],["taoluc","<=",n]],["daphucvu","desc"],i,a)},async fetchItemByKhachDaPhucVuByDonViAndQuay(e,t,n,i,a=20,o=null){this.dsKhachDaPhucVu=await CT("khach_hang",[["donvi","==",e],["quay","==",t],["taoluc",">=",n],["taoluc","<=",i]],["daphucvu","desc"],a,o)},async fetchItemByKhachUuTienByDonVi(e,t,n,i=20,a=null){this.dsKhachUuTien=await CT("khach_hang",[["donvi","==",e],["doi_tuong_uu_tien",">",""],["taoluc",">=",t],["taoluc","<=",n]],[["doi_tuong_uu_tien","asc"],["taoluc","desc"]],i,a)},async fetchItemByKhachUuTienByDonViAndQuay(e,t,n,i,a=20,o=null){this.dsKhachUuTien=await CT("khach_hang",[["donvi","==",e],["quay","==",t],["doi_tuong_uu_tien",">",""],["taoluc",">=",n],["taoluc","<=",i]],[["doi_tuong_uu_tien","asc"],["taoluc","desc"]],a,o)},async fetchItemById(e){this.item=await yT("khach_hang",e)}
5211,async realtimeKhachTrongCaLamViecByDonVi(e){FT("khachhang:items",TT(h1("khach_hang"),[["donvi","==",e],["calamviec","==",!0]],["stt","asc"],null,e=>{this.items=e}))},async realtimeKhachTrongCaLamViec(e,t){FT("khachhang:items",TT(h1("khach_hang"),[["donvi","==",e],["quay","==",t],["calamviec","==",!0]],["stt","asc"],null,e=>{this.items=e}))},async realtimeKhachTrongCaLamViecWithCallback(e,t,n){FT("khachhang:cb:".concat(e,":").concat(t),TT(h1("khach_hang"),[["donvi","==",e],["quay","==",t],["calamviec","==",!0]],["stt","asc"],null,e=>{n(e)}))},async realtimeKhachChuaPhucVu(e,t){FT("khachhang:items",TT(h1("khach_hang"),[["donvi","==",e],["quay","==",t],["calamviec","==",!0],["daphucvu","==",null]],["stt","asc"],null,e=>{this.items=e}))},async realtimeKhachDangPhucVu(e,t){FT("khachhang:dangphucvu",TT(h1("khach_hang"),[["donvi","==",e],["quay","==",t],["dangphucvu","==",!0],["calamviec","==",!0]],["stt","desc"],1,e=>{this.khachDangPhucVu=e[0]}))},async realtimeKhachDangPhucVuTheoDonVi(e){FT("khachhang:dangphucvu-donvi",TT(h1("khach_hang"),[["donvi","==",e],["daphucvu","==",null],["calamviec","==",!0]],null,null,e=>{this.dsKhachDangPhucVuTheoDonVi=e}))},laySoThuTu:async e=>await v1({donvi:e.donvi,quay:e.quay,thietBi:e.thiet_bi,hoten:e.hoten,sodienthoai:e.sodienthoai,email:e.email,qrcode:e.qrcode,doi_tuong_uu_tien:e.doi_tuong_uu_tien||""}),async updateItem(e,t){await wT("khach_hang",e,t)},async deleteItem(e){await kT("khach_hang",e)},async exportExcel(e){const t=await _I.post("/exportCustomerStats",e),{downloadUrl:n}=t.data;this.excelUrl=n},async exportExcelTopKhach(e){const t=await _I.post("/exportTopCustomerStats",e),{downloadUrl:n}=t.data;this.excelUrl=n},fetchKhachTrongCaLamViec:async(e,t)=>await vT(h1("khach_hang"),[["donvi","==",e],["quay","==",t],["calamviec","==",!0]])}}),b1={class:"container content-container"},_1={class:"px-3"},w1={class:"table-responsive"},k1={class:"table table-striped custom-table"},x1={class:"manager-list d-flex flex-wrap gap-2"},T1=["title"],C1=["onClick"],E1={class:"d-flex gap-1"},S1=["onClick"],I1=["onClick"],A1=["onClick"],D1=["onClick"],P1={class:"modal-dialog modal-xl modal-dialog-scrollable"},O1={class:"modal-content custom-modal"},M1={class:"modal-header custom-header header-gray"},N1={class:"modal-title",id:"unitModalLabel"},R1={class:"modal-body"},L1={class:"nav nav-tabs nav-justified",role:"tablist"},V1={class:"nav-item"},q1={class:"nav-item"},F1={class:"nav-item"},B1={class:"nav-item"},U1={class:"nav-item"},j1={class:"tab-content pt-4"},H1={class:"form-section"},z1={class:"row"},W1={class:"col-md-6 mb-4"},K1={class:"form-group"},G1={class:"col-md-6 mb-4"},Y1={class:"form-group"},Q1={class:"col-md-6 mb-4"},$1={class:"form-group"},X1={class:"col-md-6 mb-4"},J1={class:"form-group"},Z1={class:"col-md-6 mb-4"},e2={class:"form-group"},t2={class:"col-md-6 mb-4"},n2={class:"form-group"},i2={class:"form-check form-switch"},a2={class:"form-check-label",for:"trangthai"},o2={class:"form-section"},s2={class:"row"},r2={class:"col-md-6 mb-4"},l2={class:"form-group"},c2={class:"col-md-6 mb-4"},u2={class:"form-group"},h2={class:"col-md-6 mb-4"},d2={class:"form-group"},f2={class:"col-md-6 mb-4"},p2={class:"form-group"},g2={class:"d-flex align-items-start gap-4"},m2=["disabled"],v2={key:0,class:"mt-2"},y2={key:0},b2=["src"],_2={class:"col-md-12 mb-4"},w2={class:"form-group"},k2={key:0,class:"mt-3 video-container"},x2=["src"],T2={class:"form-section"},C2={class:"row"},E2={class:"col-md-6 mb-4"},S2={class:"form-group"},I2={class:"col-md-6 mb-4"},A2={class:"form-group"},D2={class:"form-section"},P2={class:"row"},O2={class:"col-md-3 mb-2"},M2={class:"form-group"},N2={class:"form-check form-switch"},R2={class:"form-check-label",for:"quanlyquay"},L2={class:"col-md-3 mb-2"},V2={class:"form-group"},q2={class:"form-check form-switch"},F2={class:"form-check-label",for:"quetqrtinh"},B2={class:"col-md-3 mb-2"},U2={class:"form-group"},j2={class:"form-check form-switch"},H2={class:"form-check-label",for:"quetqrhengio"},z2={class:"col-md-3 mb-2"},W2={class:"form-group"},K2={class:"form-check form-switch"},G2={class:"form-check-label",for:"hienthitranghotro"},Y2={class:"col-md-3 mb-2"},Q2={class:"form-group"},$2={class:"form-check form-switch"},X2={class:"form-check-label",for:"hienthitranginvegiay"},J2={class:"form-section"},Z2={class:"row"},e5={class:"col-md-3 mb-2"},t5={class:"form-group"},n5={class:"form-check form-switch"},i5={class:"form-check-label",for:"laysonhanh"},a5={class:"col-md-3 mb-2"},o5={class:"form-group"},s5={class:"form-check form-switch"},r5={class:"form-check-label",for:"hienthisettingsqr"},l5={class:"col-md-3 mb-2"},c5={class:"form-group"},u5={class:"form-check form-switch"},h5={class:"form-check-label",for:"settinggiongnoi"},d5={class:"col-md-3 mb-2"},f5={class:"form-group"},p5={class:"form-check form-switch"},g5={class:"form-check-label",for:"smsNotification"},m5={class:"col-md-3 mb-2"},v5={class:"form-group"},y5={class:"form-check form-switch"},b5={class:"form-check-label",for:"zaloNotification"},_5={class:"col-md-3 mb-2"},w5={class:"form-group"},k5={class:"form-check form-switch"},x5={class:"form-check-label",for:"emailNotification"},T5={class:"col-md-3 mb-2"},C5={class:"form-group"},E5={class:"form-check form-switch"},S5={class:"form-check-label",for:"tiviNotification"},I5={class:"form-section"},A5={class:"row align-items-center g-3"},D5={class:"col-md-4"},P5={class:"form-group"},O5={class:"form-check form-switch"},M5={class:"form-check-label",for:"chat-danang-ai-toggle"},N5={class:"col-md-4"},R5={class:"form-group"},L5=["disabled"],V5={class:"form-section"},q5={class:"row align-items-center g-3"},F5={class:"col-md-4"},B5={class:"form-group"},U5={class:"form-check form-switch"},j5={class:"form-check-label",for:"chatbot-ai-toggle"},H5={class:"col-md-4"},z5={class:"form-group"},W5=["disabled"],K5={class:"col-md-4"},G5={class:"form-group"},Y5=["disabled"],Q5={class:"col-md-4"},$5={class:"form-group"},X5=["disabled"],J5={class:"col-md-6"},Z5={class:"form-group"},e3=["disabled"],t3={class:"form-section"},n3={class:"row"},i3={class:"col-md-3 mb-2"},a3={class:"form-group"},o3={class:"form-check form-switch"},s3={class:"form-check-label",for:"hienthithongke"},r3={class:"form-section"},l3={class:"row"},c3={class:"col-md-4 mb-2"},u3={class:"form-group"},h3={class:"col-md-4 mb-2"},d3={class:"form-group"},f3={class:"col-md-4 mb-2"},p3={class:"form-group"},g3={key:0,class:"col-md-4 mb-2"},m3={class:"qr-preview text-center"},v3=["src"],y3={key:1,class:"col-md-4 mb-2"},b3={class:"qr-preview text-center"},_3=["src"],w3={key:2,class:"col-md-4 mb-2"},k3={class:"qr-preview text-center"},x3=["src"],T3={class:"form-section"},C3={class:"row"},E3={class:"col-md-8 mb-4"},S3={class:"form-group"},I3={class:"input-group"},A3=["value"],D3=["disabled"],P3={key:0,class:"col-md-4 mb-2"},O3={class:"qr-preview text-center p-0"},M3=["src"],N3={class:"form-section"},R3={class:"row"},L3={class:"col-md-4 mb-2"},V3={class:"form-group"},q3={class:"form-check form-switch"},F3={class:"form-check-label",for:"invegiay"},B3={class:"col-md-4 mb-2"},U3={class:"form-group"},j3={class:"col-md-4 mb-2"},H3={class:"form-group"},z3={class:"form-section"},W3={class:"row"},K3={class:"col-md-4 mb-2"},G3={class:"form-group"},Y3={class:"col-md-4 mb-2"},Q3={class:"form-group"},$3={class:"col-md-4 mb-2"},X3={class:"form-group"},J3=["placeholder"],Z3={class:"form-section"},e4={class:"row"},t4={class:"col-md-4 mb-2"},n4={class:"form-group"},i4={class:"col-md-4 mb-2"},a4={class:"form-group"},o4={class:"col-md-4 mb-2"},s4={class:"form-group"},r4={class:"col-md-4 mb-2"},l4={class:"form-group"},c4=["placeholder"],u4={class:"col-md-4 mb-2"},h4={class:"form-group"},d4={class:"row align-items-end g-2 mt-1"},f4={class:"col-md-5"},p4={class:"form-group"},g4=["disabled"],m4={class:"col-md-4"},v4=["disabled"],y4={class:"form-section"},b4={class:"row"},_4={class:"col-md-4 mb-2"},w4={class:"form-group"},k4={class:"col-md-4 mb-2"},x4={class:"form-group"},T4={class:"col-md-4 mb-2"},C4={class:"form-group"},E4=["placeholder"],S4={class:"col-md-4 mb-2"},I4={class:"form-group"},A4={class:"col-md-4 mb-2"},D4={class:"form-group"},P4={class:"col-md-4 mb-2"},O4={class:"form-group"},M4={class:"form-section"},N4={class:"row"},R4={class:"col-md-4 mb-2"},L4={class:"form-group"},V4={class:"form-check form-switch"},q4={class:"form-check-label",for:"thongbaolettane"},F4={key:0,class:"col-md-8 mb-4"},B4={class:"form-group"},U4={class:"holiday-list"},j4={class:"form-check"},H4=["id","onUpdate:modelValue"],z4=["for"],W4={class:"mt-2 d-flex gap-2"},K4=["disabled"],G4={class:"form-section"},Y4={class:"row"},Q4={class:"col-md-4 mb-2"},$4={class:"form-group"},X4={class:"form-check form-switch"},J4={class:"form-check-label",for:"thongbaodinhky"},Z4={key:0,class:"col-md-4 mb-2"},e6={class:"form-group"},t6={key:1,class:"col-md-8 mb-2"},n6={class:"form-group"},i6={class:"form-section"},a6={class:"row"},o6={class:"col-md-4 mb-2"},s6={class:"form-group"},r6={class:"col-md-4 mb-2"},l6={class:"form-group"},c6={class:"col-md-4 mb-2"},u6={class:"form-group"},h6={class:"col-md-4 mb-2"},d6={class:"form-group"},f6={class:"col-md-4 mb-2"},p6={class:"form-group"},g6={key:0,class:"col-md-4 mb-2"},m6={class:"form-group"},v6=["placeholder"],y6={class:"col-md-4 mb-2"},b6={class:"form-group"},_6={class:"form-check form-switch"},w6={class:"form-check-label",for:"doctendonvi"},k6={class:"col-md-4 mb-2"},x6={class:"form-group"},T6={class:"form-check form-switch"},C6={class:"form-check-label",for:"docsotungchuso"},E6={class:"form-section"},S6={class:"row"},I6={class:"col-md-12 mb-4"},A6={class:"form-group"},D6={class:"weekday-selector"},P6={class:"weekday-content"},O6=["onClick"],M6={class:"weekday-name"},N6={class:"weekday-options"},R6=["onClick"],L6={key:0,class:"fas fa-check"},V6=["onClick"],q6={key:0,class:"fas fa-check"},F6=["onClick"],B6={key:0,class:"fas fa-check"},U6={class:"col-md-12 mb-4"},j6={class:"form-group"},H6={class:"holiday-list"},z6={class:"form-check"},W6=["id","onUpdate:modelValue"],K6=["for"],G6=["onClick"],Y6={class:"form-section"},Q6={class:"row"},$6={class:"col-md-4 mb-2"},X6={class:"form-group"},J6={class:"col-md-4 mb-2"},Z6={class:"form-group"},e9={class:"col-md-8 mb-2"},t9={class:"form-group"},n9={class:"form-section"},i9={class:"row"},a9={class:"col-md-4 mb-2"},o9={class:"form-group"},s9={class:"form-section"},r9={class:"row"},l9={class:"col-md-4 mb-2"},c9={class:"form-group"},u9={class:"form-check form-switch"},h9={class:"form-check-label",for:"doituonguutien_enabled"},d9={class:"col-md-8 mb-2"},f9={class:"form-group"},p9={class:"form-check form-switch"},g9={class:"form-check-label",for:"uutien_vuot_hengio"},m9={key:0,class:"col-md-8 mb-4"},v9={class:"form-group"},y9={class:"holiday-list"},b9={class:"form-check"},_9=["id","onUpdate:modelValue"],w9=["for"],k9={class:"mt-2 d-flex gap-2"},x9=["disabled"],T9={class:"modal-footer"},C9={class:"d-flex justify-content-between mt-4"},E9={class:"d-flex gap-2"},S9=["disabled"],I9={key:0,class:"spinner-border spinner-border-sm",role:"status","aria-hidden":"true"},A9={key:1},D9=["disabled"],P9={class:"modal-dialog modal-dialog-centered"},O9={class:"modal-content custom-modal"},M9={class:"modal-body"}
5211,N9={class:"form-group mb-3"},R9={class:"form-group"},L9={class:"modal-footer custom-footer"},V9={class:"modal-dialog modal-dialog-centered"},q9={class:"modal-content custom-modal"},F9={class:"modal-body"},B9={class:"form-group mb-3"},U9={class:"modal-footer custom-footer"},j9={class:"modal-dialog modal-dialog-centered"},H9={class:"modal-content custom-modal"},z9={class:"modal-body"},W9={class:"form-group mb-3"},K9={class:"modal-footer custom-footer"},G9={class:"modal-dialog modal-dialog-centered"},Y9={class:"modal-content custom-modal"},Q9={class:"modal-body"},$9={class:"mb-2"},X9={class:"form-group p-0"},J9={class:"modal-footer d-flex justify-content-end gap-2"},Z9=["disabled"],e8={key:0,class:"spinner-border spinner-border-sm",role:"status","aria-hidden":"true"},t8={key:1},n8=CC({__name:"QuanLyDonVi",setup(e){Ll();const t=JT(),{items:n}=Zs(t),i=ET(),{userRole:a}=Zs(i),o=xI(),{users:s}=Zs(o),r=HY(),{items:l}=Zs(r),c=y1(),u=wI(),h=oG(),{files:d,open:f}=IB(),p=It([]),g=It("basic"),m=It(null);let v=null;const y=It(!1),b=It(null);let _=null;const w=It(""),k=It(""),x=gt({ten:"",diachi:"",trangthai:"",sodienthoai:"",logo:"",thutu:"",quanly:[],videolink:"",smsserver:"",smsuser:"",smspassword:"",emailserver:"",emailport:465,emailuser:"",emailpassword:"",emailname:"",zaloserver:"",zalouser:"",zalopassword:"",zalofrom:"",zalotemplate:"",zalo_app_id:"",qrcodedong:"",qrcodecodinh:"",qrcodehengio:"",laysonhanh:"",hotline:"",email:"",website:"",danhgia:"",thutuc:"",invegiay:!1,ip_printer:"",ip_network:"",quetqrtinh:"",quetqrhengio:"",hienthithongke:!1,quanlyquay:!0,hienthitranginvegiay:!1,hienthitranghotro:!1,hienthisettingsqr:!1,settinggiongnoi:!1,hienthichatdanangai:!1,hienthiaichatbot:!1,aichatbot_layout:"floating",aichatbot_endpoint:"",aichatbot_greeting:"",thongbao_lettane_enabled:!1,thongbao_lettane_texts:[],thongbao_dinhky_enabled:!1,thongbao_dinhky_phut:15,thongbao_dinhky_noidung:QT,tocdoamthanh:"",pitchamthanh:"",volumeamthanh:"",vitriamthanh:"qrcode",sound_provider:"default",sound_provider_auth_key:"",doctendonvi:!1,docsotungchuso:!1,notifications:{sms:!1,zalo:!1,email:!1,tivi:!1},ngaynghi:[],ngayle:[],doi_tuong_uu_tien_enabled:!1,doi_tuong_uu_tien_texts:[],uutien_vuot_hengio:!1,hengio_datlich_truoc_phut:50,hengio_xacnhan_truoc_phut:20,hengio_toida_moi_nguoi:2,laso_toida_moi_nguoi:2}),T=It(!1),C=It(null),E="https://xephangqrcode.web.app",S=It(null),I=It(null),A=It(null),D=bo(()=>{var e,t;if(!x.videolink)return"";if(x.videolink.includes("youtube.com")||x.videolink.includes("youtu.be")){const n=x.videolink.includes("youtube.com")?null==(e=x.videolink.split("v=")[1])?void 0:e.split("&")[0]:null==(t=x.videolink.split("youtu.be/")[1])?void 0:t.split("?")[0];if(n)return"https://www.youtube.com/embed/".concat(n)}return x.videolink}),P=[{name:"Tết Dương lá»ch",date:"01/01"},{name:"Giá» Tá» Hùng Vương",date:"10/03"},{name:"Ngà y Giải phóng miá»n Nam",date:"30/04"},{name:"Ngà y Quá»c tế Lao Äá»ng",date:"01/05"},{name:"Ngà y Quá»c khánh",date:"02/09"}],O=It([]),M=()=>{te(),T.value=!1,g.value="basic",v||(v=new wV(m.value)),v.show()},N=It({}),R=It(null),L=e=>{const t={...e};for(const n of WT)delete t[n];return t},V=()=>{for(const e of WT)x[e]=""},q=async(e,t=null)=>{var n;const i={};for(const a of WT)x[a]&&(i[a]=x[a]);try{await _I.post("/luuBiMatDonVi",{donvi:e,biMat:i,saoChepTu:t})}catch(eRe){const t=new Error("Äã lưu thông tin ÄÆ¡n vá», nhưng lưu máºt khẩu thất bại: ".concat((null==(n=null==eRe?void 0:eRe.response)?void 0:n.data)||(null==eRe?void 0:eRe.message)||""));throw t.laLoiBiMat=!0,t}},F=async e=>{var t,n,i,a,o;await te();const{id:s,...r}=e;if((null==(t=r.quanly)?void 0:t.length)&&(p.value=r.quanly.map(e=>({email:e}))),O.value=P.map(e=>({...e,selected:!1})),null==(n=r.ngayle)?void 0:n.length){O.value=O.value.map(e=>({...e,selected:r.ngayle.some(t=>t.date===e.date)}));const e=r.ngayle.filter(e=>!P.some(t=>t.date===e.date));e.length&&(O.value=[...O.value,...e.map(e=>({...e,selected:!0}))])}Object.assign(x,{...r,ngaynghi:r.ngaynghi||[],ngayle:r.ngayle||[],thongbao_lettane_texts:(r.thongbao_lettane_texts||[]).map(e=>({text:e,selected:!1})),doi_tuong_uu_tien_enabled:e.doi_tuong_uu_tien_enabled||!1,doi_tuong_uu_tien_texts:(e.doi_tuong_uu_tien_texts||[]).map(e=>({text:e,selected:!1}))}),x.quanlyquay=null==(i=r.quanlyquay)||i,x.hienthichatdanangai=null!=(a=r.hienthichatdanangai)&&a,x.hienthiaichatbot=null!=(o=r.hienthiaichatbot)&&o,$(e.id),x.aichatbot_layout=r.aichatbot_layout||"floating",x.aichatbot_endpoint=r.aichatbot_endpoint||"",x.aichatbot_greeting=r.aichatbot_greeting||"",V(),(async e=>{N.value={};try{const{data:t}=await _I.get("/trangThaiBiMatDonVi",{params:{donvi:e}});N.value=t||{}}catch(eRe){}})(e.id),T.value=!0,C.value=e.id,x.id=e.id,S.value="".concat(E,"/").concat(e.id,"/nhap-thong-tin/").concat(x.qrcodecodinh),I.value="".concat(E,"/").concat(e.id,"/nhap-thong-tin/").concat(x.qrcodecodinh),A.value="".concat(E,"/").concat(e.id,"/hen-gio-giao-dich/").concat(x.qrcodehengio),v||(v=new wV(m.value)),v.show()},B=async()=>
5211{if(k.value){x.ten=k.value,T.value=!0;try{const{id:e,...n}=x;n.ten=k.value;const i=await t.addItem(L(n));if(!(null==i?void 0:i.id))throw new Error("Không tạo ÄÆ°á»£c ÄÆ¡n vá»");await q(i.id,R.value),te(),_.hide(),LT("Nhân bản ÄÆ¡n vá» thà nh công!")}catch(eRe){VT((null==eRe?void 0:eRe.laLoiBiMat)?eRe.message:"Nhân bản ÄÆ¡n vá» thất bại!")}finally{T.value=!1}}else VT("Vui lòng nháºp tên ÄÆ¡n vá» má»i.")},U=It(null),j=It(""),H=It(!1),z=async()=>{var e;if(C.value)if(j.value.trim()){H.value=!0;try{const{data:e}=await _I.post("/guiThuEmail",{donvi:C.value,to:j.value.trim()});LT(e||"Äã gá»i thư thá»!")}catch(eRe){VT((null==(e=null==eRe?void 0:eRe.response)?void 0:e.data)||"Gá»i thư thá» thất bại!")}finally{H.value=!1}}else VT("Nháºp email nháºn thư thá»!")},W=It(0),K=It(0),Y=It(0),Q=It(0),$=async e=>{if(W.value=0,K.value=0,Y.value=0,Q.value=0,!e)return;const[t,n]=await Promise.all([H0(B0(e)),H0(U0(e))]);W.value=t,K.value=t,Y.value=n,Q.value=n},X=async()=>{var e;const t=(null==(e=null==d?void 0:d.value)?void 0:e.length)?d.value[0]:null;if(!t||KT.includes(t.type)){y.value=!0;try{T.value?await Z():await J(),v.hide()}finally{y.value=!1}}else VT(GT)},J=async()=>{var e;try{if(a.value.role!=BT)return void VT("Bạn không có quyá»n thêm má»i!");const n=(null==(e=null==d?void 0:d.value)?void 0:e.length)?d.value[0]:null;if(n){const e=tC(10),t="logo/".concat(e),i=oj(h,t),{url:a,upload:o}=lG(i);let s;await o(n);let r=!1;await new Promise(e=>{s=fa(()=>{a.value&&(x.logo=a.value,!r&&s&&(s(),r=!0),e())})})}const i=O.value.filter(e=>e.selected),o={...x,quanly:p.value.length?eC(p.value,"email"):[],thongbao_lettane_texts:x.thongbao_lettane_texts.map(e=>e.text),doi_tuong_uu_tien_enabled:x.doi_tuong_uu_tien_enabled,doi_tuong_uu_tien_texts:x.doi_tuong_uu_tien_texts.map(e=>e.text),ngaynghi:x.ngaynghi.map(e=>({week_day:e.week_day,type:e.type})),ngayle:i.map(e=>({name:e.name,date:e.date}))},s=await t.addItem(L(o));if(!(null==s?void 0:s.id))throw new Error("Không tạo ÄÆ°á»£c ÄÆ¡n vá»");await q(s.id),LT("Thêm má»i ÄÆ¡n vá» thà nh công!")}catch(eRe){VT((null==eRe?void 0:eRe.laLoiBiMat)?eRe.message:"Thêm má»i ÄÆ¡n vá» thất bại!")}},Z=async()=>{var e;try{const n=(null==(e=null==d?void 0:d.value)?void 0:e.length)?d.value[0]:null;if(n){const e=tC(10),t="logo/".concat(e),i=oj(h,t),{url:a,upload:o}=lG(i);let s;await o(n);let r=!1;await new Promise(e=>{s=fa(()=>{a.value&&(x.logo=a.value,!r&&s&&(s(),r=!0),e())})})}const i=O.value.filter(e=>e.selected);await t.updateItem(C.value,L({...x,quanly:p.value.length?eC(p.value,"email"):[],ngaynghi:x.ngaynghi.map(e=>({week_day:e.week_day,type:e.type})),ngayle:i.map(e=>({name:e.name,date:e.date})),thongbao_lettane_texts:x.thongbao_lettane_texts.map(e=>e.text),doi_tuong_uu_tien_enabled:x.doi_tuong_uu_tien_enabled,doi_tuong_uu_tien_texts:x.doi_tuong_uu_tien_texts.map(e=>e.text)})),await q(C.value),await(async e=>{if(!e)return;const t=[],n=Math.max(0,Math.floor(Number(W.value)||0)),i=Math.max(0,Math.floor(Number(Y.value)||0));if(n!==K.value&&t.push(W0(B0(e),n)),i!==Q.value&&t.push(W0(U0(e),i)),t.length)try{await Promise.all(t),K.value=n,Q.value=i}catch(eRe){VT("Cáºp nháºt sá» lượt hiá»n thá» thất bại!")}})(C.value),T.value=!1,C.value=null,LT("Cáºp nháºp ÄÆ¡n vá» thà nh công!")}catch(eRe){VT((null==eRe?void 0:eRe.laLoiBiMat)?eRe.message:"Cáºp nháºp ÄÆ¡n vá» thất bại!")}},te=()=>{N.value={},R.value=null,x.ten="",x.diachi="",x.trangthai=!0,x.sodienthoai="",x.logo="",x.thutu="",x.quanly=[],x.videolink="",x.smsserver="",x.smsuser="",x.smspassword="",x.emailserver="",x.emailport=465,x.emailuser="",x.emailpassword="",x.emailname="",x.zalofrom="",x.zalouser="",x.zalopassword="",x.zalotemplate="",x.zaloserver="",x.hotline="",x.email="",x.website="",x.danhgia="",x.thutuc="",x.invegiay=!1,x.ip_printer="",x.ip_network="",x.quetqrtinh=!1,x.quetqrhengio=!1,x.hienthithongke=!1,x.quanlyquay=!0,x.hienthitranginvegiay=!1,x.hienthitranghotro=!1,x.hienthisettingsqr=!1,x.settinggiongnoi=!1,x.hienthichatdanangai=!1,x.hienthiaichatbot=!1,Y.value=0,Q.value=0,W.value=0,K.value=0,x.aichatbot_layout="floating",x.aichatbot_endpoint="",x.aichatbot_greeting="",x.thongbao_lettane_enabled=!1,x.thongbao_dinhky_enabled=!1,x.thongbao_dinhky_phut=15,x.thongbao_dinhky_noidung=QT,x.doi_tuong_uu_tien_enabled=!1,x.doi_tuong_uu_tien_texts=[],x.uutien_vuot_hengio=!1,x.hengio_datlich_truoc_phut=50,x.hengio_xacnhan_truoc_phut=2
52110,x.hengio_toida_moi_nguoi=2,x.laso_toida_moi_nguoi=2,x.thongbao_lettane_texts=[],x.tocdoamthanh=1,x.pitchamthanh=1,x.volumeamthanh=1,x.vitriamthanh="qrcode",x.sound_provider="default",x.sound_provider_auth_key="",x.doctendonvi=!1,x.docsotungchuso=!1,T.value=!1,C.value=null,x.laysonhanh=!1,x.id=null,d.value=[],p.value=[],x.notifications={sms:!1,zalo:!1,email:!1,tivi:!1},x.ngaynghi=[],x.ngayle=[],O.value=P.map(e=>({...e,selected:!1})),k.value=""},ne=()=>{if(!x.id)return;const e="".concat(E,"/").concat(x.id,"/bang-dien-tu");navigator.clipboard.writeText(e),LT("Äã sao chép liên kết bảng Äiá»n tá»!")},ie=(e,t)=>{const n=x.ngaynghi.find(t=>t.week_day===e.toString());return(null==n?void 0:n.type)===t},ae=(e,t)=>{const n=e.toString(),i=x.ngaynghi.find(e=>e.week_day===n);i?i.type===t?x.ngaynghi=x.ngaynghi.filter(e=>e.week_day!==n):x.ngaynghi=x.ngaynghi.map(e=>e.week_day===n?{...e,type:t}:e):x.ngaynghi=[...x.ngaynghi,{week_day:n,type:t}]},oe=It(null);let se=null;const re=gt({name:"",date:null}),le=It(null);let ce=null;const ue=It(""),he=It(""),de=It(null);let fe=null;const pe=()=>{re.name="",re.date=null,se.show()},ge=()=>{x.ngayle=O.value.filter(e=>e.selected).map(e=>({name:e.name,date:e.date}))},me=async()=>{if(!re.name||!re.date)return void VT("Vui lòng nháºp Äầy Äá»§ thông tin");const e=o$(re.date,"dd/MM");if(O.value.some(t=>t.date===e))VT("Ngà y lá»
nà y Äã tá»n tại!");else try{await r.addItem({name:re.name,date:e});const t={name:re.name,date:e,selected:!0};O.value=[...O.value,t],ge(),re.name="",re.date=null,se.hide()}catch(eRe){VT("Thêm ngà y lá»
thất bại!")}},ve=bo(()=>{var e;return null==(e=x.thongbao_lettane_texts)?void 0:e.some(e=>e.selected)}),ye=()=>{ue.value="",ce.show()},be=()=>{ue.value?(x.thongbao_lettane_texts||(x.thongbao_lettane_texts=[]),x.thongbao_lettane_texts.push({text:ue.value,selected:!1}),ue.value="",ce.hide()):VT("Vui lòng nháºp ná»i dung thông báo")},_e=()=>{x.thongbao_lettane_texts=x.thongbao_lettane_texts.filter(e=>!e.selected)},we=bo(()=>{var e;return null==(e=x.doi_tuong_uu_tien_texts)?void 0:e.some(e=>e.selected)}),ke=()=>{he.value="",fe.show()},xe=()=>{he.value?(x.doi_tuong_uu_tien_texts||(x.doi_tuong_uu_tien_texts=[]),x.doi_tuong_uu_tien_texts.push({text:he.value,selected:!1}),he.value="",fe.hide()):VT("Vui lòng nháºp tên Äá»i tượng ưu tiên")},Te=()=>{x.doi_tuong_uu_tien_texts=x.doi_tuong_uu_tien_texts.filter(e=>!e.selected)},Ce=async()=>{try{if((await wO("Reset sá» thứ tá»±",'Bạn có muá»n reset sá» thứ tá»± cá»§a tất cả quầy thuá»c ÄÆ¡n vá» "'.concat(x.ten,'" không?'))).isConfirmed){await u.fetchItemsByDonVi(x.id);const e=u.items,t=Ek();for(const n of e){const e=await c.fetchKhachTrongCaLamViec(x.id,n.id);for(const n of e){const e={calamviec:!1,dangphucvu:!1};n.daphucvu||(e.daphucvu=t),await c.updateItem(n.id,e)}}LT("Reset STT thà nh công!")}}catch(eRe){VT("Reset STT thất bại!")}};return ei(async()=>{await Promise.all([t.fetchItems(),i.getUserAuthRole(),o.fetchUsers(),r.fetchItems()]),v=new wV(m.value),O.value=[...P,...l.value.map(e=>({...e,selected:!1}))],se=new wV(oe.value),ce=new wV(le.value),fe=new wV(de.value),_=new wV(b.value)}),(e,i)=>{var o,r;return Ma(),Va(Sa,null,[Ha("div",b1,[Ha("div",{class:"header-and-actions d-flex align-items-center mb-3 px-3 py-2"},[i[83]||(i[83]=Ha("div",{class:"header-title-wrapper flex-grow-1 text-center"},[Ha("h3",null,"QUẢN LÃ ÄÆ N Vá»")],-1)),Ha("div",{class:"actions-bar"},[Ha("button",{onClick:M,class:"btn btn-custom btn-gradient-orange"},i[82]||(i[82]=[Ha("i",{class:"fas fa-plus me-2"},null,-1),Ga(" Thêm má»i ")]))])]),Ha("div",_1,[Ha("div",w1,[Ha("table",k1,[i[89]||(i[89]=Ha("thead",null,[Ha("tr",null,[Ha("th",null,"#"),Ha("th",null,"Tên ÄÆ¡n vá»"),Ha("th",null,"Trạng thái"),Ha("th",null,"Sá» Äiá»n thoại"),Ha("th",null,"Sắp xếp"),Ha("th",null,"Ngưá»i quản lý"),Ha("th",null,"Hà nh Äá»ng")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(Ot(n),(e,n)=>(Ma(),Va("tr",{key:e.id},[Ha("td",null,ee(n+1),1),Ha("td",null,ee(e.ten),1),Ha("td",null,ee(e.trangthai?"Hoạt Äá»ng":"Không hoạt Äá»ng"),1),Ha("td",null,ee(e.sodienthoai),1),Ha("td",null,ee(e.thutu),1),Ha("td",null,[Ha("div",x1,[(Ma(!0),Va(Sa,null,gi(e.quanly,(n,a)=>(Ma(),Va("span",{key:a,class:"chip",title:n},[Ga(ee(n)+" ",1),Ha("button",{class:"btn btn-icon btn-danger ms-1",onClick:i=>(async(e,n)=>{if((await kO()).isConfirmed)try{const i=n.quanly.filter(t=>t!==e);await t.updateItem(n.id,{quanly:i}),LT("Xoá quản lý thà nh công!")}catch(eRe){VT("Xoá quản lý thất bại!")}})(n,e)},i[84]||(i[84]=[Ha("i",{class:"fas fa-times"},null,-1)]),8,C1)],8,T1))),128))])]),Ha("td",null,[Ha("div",E1,[Ha("button",{class:"btn btn-icon btn-secondary",onClick:t=>(e=>{var t,n,i;k.value="",w.value=e.ten;const{id:a,...o}=e;Object.assign(x,o),V(),R.value=a,x.quanlyquay=null==(t=o.quanlyquay)||t,x.hienthiaichatbot=null!=(n=o.hienthiaichatbot)&&n,x.aichatbot_layout=o.aichatbot_layout||"floating",x.aichatbot_endpoint=o.aichatbot_endpoint||"",x.thongbao_lettane_texts=(o.thongbao_lettane_texts||[]).map(e=>({text:e,selected:!1})),x.doi_tuong_uu_tien_texts=(o.doi_tuong_uu_tien_texts||[]).map(e=>({text:e,selected:!1})),p.value=(null==(i=o.quanly)?void 0:i.map(e=>({email:e})))||[],_||(_=new wV(b.value)),_.show()})(e)},i[85]||(i[85]=[Ha("i",{class:"fas fa-copy"},null,-1)]),8,S1),Ha("button",{class:"btn btn-icon btn-primary",onClick:t=>F(e)},i[86]||(i[86]=[Ha("i",{class:"fas fa-pencil"},null,-1)]),8,I1),Ha("button",{class:"btn btn-icon btn-warning",title:"Nháºt ký lá»i",onClick:t=>(e=>{var t;return null==(t=U.value)?void 0:t.moModal(e)})(e)},i[87]||(i[87]=[Ha("i",{class:"fas fa-triangle-exclamation"},null,-1)]),8,A1),Ot(a).role==Ot(BT)?(Ma(),Va("button",{key:0,class:"btn btn-icon btn-danger",onClick:n=>(async e=>{if(a.value.role==UT)return void VT("Bạn không có quyá»n xoá!");if((await kO()).isConfirmed)try{await t.deleteItem(e),LT("Xoá ÄÆ¡n vá» thà nh công!")}catch(eRe){VT("Xoá ÄÆ¡n vá» thất bại!")}})(e.id)}
5211,i[88]||(i[88]=[Ha("i",{class:"fas fa-trash-alt"},null,-1)]),8,D1)):Qa("",!0)])])]))),128))])])])]),Ha("div",{class:"modal fade",id:"unitModal",tabindex:"-1","aria-labelledby":"unitModalLabel",ref_key:"unitModalRef",ref:m},[Ha("div",P1,[Ha("div",O1,[Ha("div",M1,[Ha("h5",N1,ee(T.value?"Cáºp nháºt ÄÆ¡n vá»":"Thêm má»i ÄÆ¡n vá»"),1),i[90]||(i[90]=Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),Ha("div",R1,[Ha("ul",L1,[Ha("li",V1,[Ha("a",{class:G(["nav-link",{active:"basic"===g.value}]),onClick:i[0]||(i[0]=e=>g.value="basic")},"Thông tin chung",2)]),Ha("li",q1,[Ha("a",{class:G(["nav-link",{active:"features"===g.value}]),onClick:i[1]||(i[1]=e=>g.value="features")},"Cấu hình chức nÄng",2)]),Ha("li",F1,[Ha("a",{class:G(["nav-link",{active:"integrations"===g.value}]),onClick:i[2]||(i[2]=e=>g.value="integrations")},"Cấu hình tÃch hợp",2)]),Ha("li",B1,[Ha("a",{class:G(["nav-link",{active:"notifications"===g.value}]),onClick:i[3]||(i[3]=e=>g.value="notifications")},"Thông báo & Ãm thanh",2)]),Ha("li",U1,[Ha("a",{class:G(["nav-link",{active:"advanced"===g.value}]),onClick:i[4]||(i[4]=e=>g.value="advanced")},"Cấu hình nâng cao",2)])]),Ha("div",j1,[Ha("div",{class:G(["tab-pane fade",{"show active":"basic"===g.value}]),role:"tabpanel"},[Ha("div",H1,[i[97]||(i[97]=Ha("h5",{class:"section-title"},"Thông tin ÄÆ¡n vá»",-1)),Ha("div",z1,[Ha("div",W1,[Ha("div",K1,[i[91]||(i[91]=Ha("label",{for:"unit-name",class:"form-label"},"Tên ÄÆ¡n vá»",-1)),gn(Ha("input",{type:"text",class:"form-control",placeholder:"Nháºp tên ÄÆ¡n vá»","onUpdate:modelValue":i[5]||(i[5]=e=>x.ten=e),required:""},null,512),[[ms,x.ten]])])]),Ha("div",G1,[Ha("div",Y1,[i[92]||(i[92]=Ha("label",{for:"address",class:"form-label"},"Äá»a chá»",-1)),gn(Ha("input",{type:"text",class:"form-control",placeholder:"Nháºp Äá»a chá»","onUpdate:modelValue":i[6]||(i[6]=e=>x.diachi=e),required:""},null,512),[[ms,x.diachi]])])]),Ha("div",Q1,[Ha("div",$1,[i[93]||(i[93]=Ha("label",{for:"phone-number",class:"form-label"},"Sá» Äiá»n thoại",-1)),gn(Ha("input",{type:"text",id:"phone-number",class:"form-control",placeholder:"Nháºp sá» Äiá»n thoại","onUpdate:modelValue":i[7]||(i[7]=e=>x.sodienthoai=e),required:""},null,512),[[ms,x.sodienthoai]])])]),Ha("div",X1,[Ha("div",J1,[i[94]||(i[94]=Ha("label",{for:"thutu",class:"form-label"},"Sắp xếp",-1)),gn(Ha("input",{type:"text",class:"form-control",placeholder:"Nháºp thứ tá»± sắp xếp","onUpdate:modelValue":i[8]||(i[8]=e=>x.thutu=e),required:""},null,512),[[ms,x.thutu]])])]),Ha("div",Z1,[Ha("div",e2,[i[95]||(i[95]=Ha("label",{for:"manager",class:"form-label"},"Ngưá»i quản lý",-1)),za(Ot(IO),{id:"manager",modelValue:p.value,"onUpdate:modelValue":i[9]||(i[9]=e=>p.value=e),options:Ot(s),multiple:!0,taggable:!1,"close-on-select":!1,"clear-on-select":!0,showNoResults:!1,showNoOptions:!1,selectLabel:"Chá»n ngưá»i quản lý",selectedLabel:"Äã chá»n",placeholder:"Vui lòng chá»n ngưá»i quản lý",deselectLabel:"Nhấn Äá» xoá ngưá»i quản lý Äã chá»n",label:"email","track-by":"email"},null,8,["modelValue","options"])])]),Ha("div",t2,[Ha("div",n2,[i[96]||(i[96]=Ha("label",{class:"form-label"},"Trạng thái",-1)),Ha("div",i2,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"trangthai","onUpdate:modelValue":i[10]||(i[10]=e=>x.trangthai=e)},null,512),[[vs,x.trangthai]]),Ha("label",a2,ee(x.trangthai?"Hoạt Äá»ng":"Không hoạt Äá»ng"),1)])])])])]),Ha("div",o2,[i[104]||(i[104]=Ha("h5",{class:"section-title"},"Thông tin liên há»",-1)),Ha("div",s2,[Ha("div",r2,[Ha("div",l2,[i[98]||(i[98]=Ha("label",{for:"hotline",class:"form-label"},"Hotline",-1)),gn(Ha("input",{id:"hotline",type:"text",class:"form-control",placeholder:"Nháºp sá» hotline","onUpdate:modelValue":i[11]||(i[11]=e=>x.hotline=e)},null,512),[[ms,x.hotline]])])]),Ha("div",c2,[Ha("div",u2,[i[99]||(i[99]=Ha("label",{for:"email-org",class:"form-label"},"Äá»a chá» Email",-1)),gn(Ha("input",{id:"email-org",type:"text",class:"form-control",placeholder:"Nháºp Äá»a chá» email ÄÆ¡n vá»","onUpdate:modelValue":i[12]||(i[12]=e=>x.email=e)},null,512),[[ms,x.email]])])]),Ha("div",h2,[Ha("div",d2,[i[100]||(i[100]=Ha("label",{for:"website",class:"form-label"},"Website",-1)),gn(Ha("input",{id:"website",type:"text",class:"form-control",placeholder:"Nháºp Äá»a chá» website","onUpdate:modelValue":i[13]||(i[13]=e=>x.website=e)},null,512),[[ms,x.website]])])]),Ha("div",f2,[Ha("div",p2,[i[102]||(i[102]=Ha("label",{for:"logo",class:"form-label"},"Logo",-1)),Ha("div",g2,[Ha("fieldset",{disabled:!!e.uploadTask},[Ha("button",{type:"button",class:"btn btn-custom btn-gradient-blue",onClick:i[14]||(i[14]=e=>Ot(f)({accept:Ot(KT).join(","),multiple:!1}))},i[101]||(i[101]=[Ha("i",{class:"fa fa-upload me-2"},null,-1),Ga(" Chá»n ảnh ")])),1===(null==(o=Ot(d))?void 0:o.length)?(Ma(),Va("div",v2," File Äã chá»n: "+ee(null==(r=Ot(d)[0])?void 0:r.name),1)):Qa("",!0)],8,m2),x.logo?(Ma(),Va("div",y2,[Ha("img",{src:x.logo,alt:"Logo Preview",class:"img-thumbnail",width:"120",height:"120"},null,8,b2)])):Qa("",!0)])])]),Ha("div",_2,[Ha("div",w2,[i[103]||(i[103]=Ha("label",{for:"video",class:"form-label"},"Video tuyên truyá»n",-1)),gn(Ha("input",{id:"video",type:"text",class:"form-control",placeholder:"Nháºp liên kết video","onUpdate:modelValue":i[15]||(i[15]=e=>x.videolink=e)},null,512),[[ms,x.videolink]]),x.videolink?(Ma(),Va("div",k2,[Ha("iframe",{src:D.value,frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:"",class:"video-iframe"},null,8,x2)])):Qa("",!0)])])])])],2),Ha("div",{class:G(["tab-pane fade",{"show active":"features"===g.value}]),role:"tabpanel"},[Ha("div",T2,[i[107]||(i[107]=Ha("h5",{class:"section-title"},"Thông tin Vé",-1)),Ha("div",C2,[Ha("div",E2,[Ha("div",S2,[i[105]||(i[105]=Ha("label",{for:"danhgia",class:"form-label"},"Link Äánh giá",-1)),gn(Ha("input",{id:"danhgia",type:"text",class:"form-control",placeholder:"Nháºp link Äánh giá","onUpdate:modelValue":i[16]||(i[16]=e=>x.danhgia=e)},null,512),[[ms,x.danhgia]])])]),Ha("div",I2,[Ha("div",A2,[i[106]||(i[106]=Ha("label",{for:"thutuc",class:"form-label"},"Link tra cứu thá»§ tục",-1)),gn(Ha("input",{id:"thutuc",type:"text",class:"form-control",placeholder:"Nháºp link tra cứu thá»§ tục","onUpdate:modelValue":i[17]||(i[17]=e=>x.thutuc=e)},null,512),[[ms,x.thutuc]])])])])]),Ha("div",D2,[i[113]||(i[113]=Ha("h5",{class:"section-title"},"Hiá»n thá» chức nÄng trang quản lý",-1)),Ha("div",P2,[Ha("div",O2,[Ha("div",M2,[i[108]||(i[108]=Ha("label",{class:"form-label"},"Quản lý quầy",-1)),Ha("div",N2,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"quanlyquay","onUpdate:modelValue":i[18]||(i[18]=e=>x.quanlyquay=e)},null,512),[[vs,x.quanlyquay]]),Ha("label",R2,ee(x.quanlyquay?"Có":"Không"),1)])])]),Ha("div",L2,[Ha("div",V2,[i[109]||(i[109]=Ha("label",{class:"form-label"},"Quét QR tÄ©nh",-1)),Ha("div",q2,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"quetqrtinh","onUpdate:modelValue":i[19]||(i[19]=e=>x.quetqrtinh=e)},null,512),[[vs,x.quetqrtinh]]),Ha("label",F2,ee(x.quetqrtinh?"Có":"Không"),1)])])]),Ha("div",B2,[Ha("div",U2,[i[110]||(i[110]=Ha("label",{class:"form-label"},"Quét QR hẹn giá»",-1)),Ha("div",j2,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"quetqrhengio","onUpdate:modelValue":i[20]||(i[20]=e=>x.quetqrhengio=e)},null,512),[[vs,x.quetqrhengio]]),Ha("label",H2,ee(x.quetqrhengio?"Có":"Không"),1)])])]),Ha("div",z2,[Ha("div",W2,[i[111]||(i[111]=Ha("label",{class:"form-label"},"Hiá»n thá» trang há» trợ lấy sá»",-1)),Ha("div",K2,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"hienthitranghotro","onUpdate:modelValue":i[21]||(i[21]=e=>x.hienthitranghotro=e)},null,512),[[vs,x.hienthitranghotro]]),Ha("label",G2,ee(x.hienthitranghotro?"Có":"Không"),1)])])]),Ha("div",Y2,[Ha("div",Q2,[i[112]||(i[112]=Ha("label",{class:"form-label"},"Hiá»n thá» trang in vé giấy",-1)),Ha("div",$2,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"hienthitranginvegiay","onUpdate:modelValue":i[22]||(i[22]=e=>x.hienthitranginvegiay=e)},null,512),[[vs,x.hienthitranginvegiay]]),Ha("label",X2,ee(x.hienthitranginvegiay?"Có":"Không"),1)])])])])]),Ha("div",J2,[i[121]||(i[121]=Ha("h5",{class:"section-title"},"Hiá»n thá» chức nÄng trang QR Code",-1)),Ha("div",Z2,[Ha("div",e5,[Ha("div",t5,[i[114]||(i[114]=Ha("label",{class:"form-label"},"Lấy sá» nhanh",-1)),Ha("div",n5,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"laysonhanh","onUpdate:modelValue":i[23]||(i[23]=e=>x.laysonhanh=e)},null,512),[[vs,x.laysonhanh]]),Ha("label",i5,ee(x.laysonhanh?"Có":"Không"),1)])])]),Ha("div",a5,[Ha("div",o5,[i[115]||(i[115]=Ha("label",{class:"form-label"},"Cấu hình",-1)),Ha("div",s5,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"hienthisettingsqr","onUpdate:modelValue":i[24]||(i[24]=e=>x.hienthisettingsqr=e)},null,512),[[vs,x.hienthisettingsqr]]),Ha("label",r5,ee(x.hienthisettingsqr?"Có":"Không"),1)])])]),Ha("div",l5,[Ha("div",c5,[i[116]||(i[116]=Ha("label",{class:"form-label"},"Trợ lý giá»ng nói",-1)),Ha("div",u5,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"settinggiongnoi","onUpdate:modelValue":i[25]||(i[25]=e=>x.settinggiongnoi=e)},null,512),[[vs,x.settinggiongnoi]]),Ha("label",h5,ee(x.settinggiongnoi?"Có":"Không"),1)])])]),Ha("div",d5,[Ha("div",f5,[i[117]||(i[117]=Ha("label",{class:"form-label"},"SMS",-1)),Ha("div",p5,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"smsNotification","onUpdate:modelValue":i[26]||(i[26]=e=>x.notifications.sms=e)},null,512),[[vs,x.notifications.sms]]),Ha("label",g5,ee(x.notifications.sms?"Có":"Không"),1)])])]),Ha("div",m5,[Ha("div",v5,[i[118]||(i[118]=Ha("label",{class:"form-label"},"Zalo",-1)),Ha("div",y5,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"zaloNotification","onUpdate:modelValue":i[27]||(i[27]=e=>x.notifications.zalo=e)},null,512),[[vs,x.notifications.zalo]]),Ha("label",b5,ee(x.notifications.zalo?"Có":"Không"),1)])])]),Ha("div",_5,[Ha("div",w5,[i[119]||(i[119]=Ha("label",{class:"form-label"},"Email",-1)),Ha("div",k5,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"emailN
5211otification","onUpdate:modelValue":i[28]||(i[28]=e=>x.notifications.email=e)},null,512),[[vs,x.notifications.email]]),Ha("label",x5,ee(x.notifications.email?"Có":"Không"),1)])])]),Ha("div",T5,[Ha("div",C5,[i[120]||(i[120]=Ha("label",{class:"form-label"},"Tivi",-1)),Ha("div",E5,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"tiviNotification","onUpdate:modelValue":i[29]||(i[29]=e=>x.notifications.tivi=e)},null,512),[[vs,x.notifications.tivi]]),Ha("label",S5,ee(x.notifications.tivi?"Có":"Không"),1)])])])])]),Ha("div",I5,[i[126]||(i[126]=Ha("h5",{class:"section-title"},"Há»p chat Äà Nẵng AI",-1)),Ha("div",A5,[Ha("div",D5,[Ha("div",P5,[i[122]||(i[122]=Ha("label",{class:"form-label"},"Hiá»n nút Äà Nẵng AI",-1)),Ha("div",O5,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"chat-danang-ai-toggle","onUpdate:modelValue":i[30]||(i[30]=e=>x.hienthichatdanangai=e)},null,512),[[vs,x.hienthichatdanangai]]),Ha("label",M5,ee(x.hienthichatdanangai?"Có":"Không"),1)]),i[123]||(i[123]=Ha("small",{class:"text-muted"}," Hiá»n trên vé Äiá»n tá», vé hẹn giá», bảng Äiá»n tá» và mà n gá»i sá» cá»§a cán bá». Chá» báºt khi Äã có ngưá»i trá»±c há»p chat - dân nhắn và o mà không ai trả lá»i thì tá» hÆ¡n là không có nút. ",-1))])]),Ha("div",N5,[Ha("div",R5,[i[124]||(i[124]=Ha("label",{for:"so-luot-chat",class:"form-label"},"Sá» lượt há» trợ hiá»n thá»",-1)),gn(Ha("input",{id:"so-luot-chat",type:"number",min:"0",class:"form-control",placeholder:"0","onUpdate:modelValue":i[31]||(i[31]=e=>W.value=e),disabled:!T.value},null,8,L5),[[ms,W.value]]),i[125]||(i[125]=Ha("small",{class:"text-muted"}," Con sá» hiá»n dưá»i nút Äà Nẵng AI. Há» thá»ng tá»± cá»ng khi có ngưá»i dùng; sá»a á» Äây Äá» Äặt lại hoặc Äặt sá» khá»i Äiá»m. Chá» sá»a ÄÆ°á»£c khi Äang cáºp nháºt ÄÆ¡n vá» Äã có. ",-1))])])])]),Ha("div",V5,[i[134]||(i[134]=Ha("h5",{class:"section-title"},"Cấu hình Chatbot AI",-1)),Ha("div",q5,[Ha("div",F5,[Ha("div",B5,[i[127]||(i[127]=Ha("label",{class:"form-label"},"KÃch hoạt Chatbot AI",-1)),Ha("div",U5,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"chatbot-ai-toggle","onUpdate:modelValue":i[32]||(i[32]=e=>x.hienthiaichatbot=e)},null,512),[[vs,x.hienthiaichatbot]]),Ha("label",j5,ee(x.hienthiaichatbot?"Có":"Không"),1)])])]),Ha("div",H5,[Ha("div",z5,[i[128]||(i[128]=Ha("label",{for:"so-luot-hoi-ai",class:"form-label"},"Sá» lượt há»i hiá»n thá»",-1)),gn(Ha("input",{id:"so-luot-hoi-ai",type:"number",min:"0",class:"form-control",placeholder:"0","onUpdate:modelValue":i[33]||(i[33]=e=>Y.value=e),disabled:!T.value},null,8,W5),[[ms,Y.value]]),i[129]||(i[129]=Ha("small",{class:"text-muted"}," Con sá» hiá»n trên Äầu khung trợ lý. Há» thá»ng tá»± cá»ng má»i lượt há»i; sá»a á» Äây Äá» Äặt lại hoặc Äặt sá» khá»i Äiá»m. Chá» sá»a ÄÆ°á»£c khi Äang cáºp nháºt ÄÆ¡n vá» Äã có. ",-1))])]),Ha("div",K5,[Ha("div",G5,[i[131]||(i[131]=Ha("label",{class:"form-label"},"Kiá»u hiá»n thá»",-1)),gn(Ha("select",{class:"form-select","onUpdate:modelValue":i[34]||(i[34]=e=>
5211x.aichatbot_layout=e),disabled:!x.hienthiaichatbot},i[130]||(i[130]=[Ha("option",{value:"floating"},"Nút góc mà n hình",-1),Ha("option",{value:"dock"},"Khung cá» Äá»nh bên phải",-1)]),8,Y5),[[_s,x.aichatbot_layout]])])]),Ha("div",Q5,[Ha("div",$5,[i[132]||(i[132]=Ha("label",{class:"form-label"},"Endpoint API",-1)),gn(Ha("input",{type:"text",class:"form-control",placeholder:"https://...","onUpdate:modelValue":i[35]||(i[35]=e=>x.aichatbot_endpoint=e),disabled:!x.hienthiaichatbot},null,8,X5),[[ms,x.aichatbot_endpoint]])])]),Ha("div",J5,[Ha("div",Z5,[i[133]||(i[133]=Ha("label",{class:"form-label"},"Câu chà o",-1)),gn(Ha("input",{type:"text",class:"form-control",placeholder:"Và dụ: Chà o bạn! Mình có thá» giúp gì?","onUpdate:modelValue":i[36]||(i[36]=e=>x.aichatbot_greeting=e),disabled:!x.hienthiaichatbot},null,8,e3),[[ms,x.aichatbot_greeting]])])])])]),Ha("div",t3,[i[136]||(i[136]=Ha("h5",{class:"section-title"},"Hiá»n thá» chức nÄng bá» sung",-1)),Ha("div",n3,[Ha("div",i3,[Ha("div",a3,[i[135]||(i[135]=Ha("label",{class:"form-label"},"Thá»ng kê (Mà n hình gá»i sá»)",-1)),Ha("div",o3,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"hienthithongke","onUpdate:modelValue":i[37]||(i[37]=e=>x.hienthithongke=e)},null,512),[[vs,x.hienthithongke]]),Ha("label",s3,ee(x.hienthithongke?"Có":"Không"),1)])])])])]),Ha("div",r3,[i[140]||(i[140]=Ha("h5",{class:"section-title"},"Cấu hình QR Code",-1)),Ha("div",l3,[Ha("div",c3,[Ha("div",u3,[i[137]||(i[137]=Ha("label",{for:"time-qr",class:"form-label"},"Thá»i gian QR Code Äá»ng",-1)),gn(Ha("input",{id:"time-qr",type:"text",class:"form-control",placeholder:"Nháºp thá»i gian QR Code Äá»ng","onUpdate:modelValue":i[38]||(i[38]=e=>x.qrcodedong=e),required:""},null,512),[[ms,x.qrcodedong]])])]),Ha("div",h3,[Ha("div",d3,[i[138]||(i[138]=Ha("label",{for:"qr-default",class:"form-label"},"Mã QR Code cá» Äá»nh",-1)),gn(Ha("input",{id:"qr-default",type:"text",class:"form-control",placeholder:"Nháºp mã QR Code cá» Äá»nh","onUpdate:modelValue":i[39]||(i[39]=e=>x.qrcodecodinh=e),required:""},null,512),[[ms,x.qrcodecodinh]])])]),Ha("div",f3,[Ha("div",p3,[i[139]||(i[139]=Ha("label",{for:"qr-timing",class:"form-label"},"Mã QR Code hẹn giá»",-1)),gn(Ha("input",{id:"qr-timing",type:"text",class:"form-control",placeholder:"Nháºp mã QR Code hẹn giá»","onUpdate:modelValue":i[40]||(i[40]=e=>x.qrcodehengio=e),required:""},null,512),[[ms,x.qrcodehengio]])])]),S.value?(Ma(),Va("div",g3,[Ha("div",m3,[S.value?(Ma(),qa(Ot(jY),{key:0,value:S.value,options:{errorCorrectionLevel:"Q",width:320},tag:"svg",class:"qr-code-img"},null,8,["value"])):Qa("",!0),x.logo?(Ma(),Va("img",{key:1,class:"qrcode-image",src:x.logo},null,8,v3)):Qa("",!0)])])):Qa("",!0),I.value?(Ma(),Va("div",y3,[Ha("div",b3,[I.value?(Ma(),qa(Ot(jY),{key:0,value:I.value,options:{errorCorrectionLevel:"Q",width:320},tag:"svg",class:"qr-code-img"},null,8,["value"])):Qa("",!0),x.logo?(Ma(),Va("img",{key:1,class:"qrcode-image",src:x.logo},null,8,_3)):Qa("",!0)])])):Qa("",!0),A.value?(Ma(),Va("div",w3,[Ha("div",k3,[A.value?(Ma(),qa(Ot(jY),{key:0,value:A.value,options:{errorCorrectionLevel:"Q",width:320},tag:"svg",class:"qr-code-img"},null,8,["value"])):Qa("",!0),x.logo?(Ma(),Va("img",{key:1,class:"qrcode-image",src:x.logo},null,8,x3)):Qa("",!0)])])):Qa("",!0)])]),Ha("div",T3,[i[143]||(i[143]=Ha("h5",{class:"section-title"},"Mà n hình Bảng Äiá»n tá»",-1)),Ha("div",C3,[Ha("div",E3,[Ha("div",S3,[i[142]||(i[142]=Ha("label",{class:"form-label"},"Link truy cáºp",-1)),Ha("div",I3,[Ha("input",{type:"text",class:"form-control bg-light",readonly:"",value:x.id?"".concat(Ot(E),"/").concat(x.id,"/bang-dien-tu"):""},null,8,A3),Ha("button",{class:"btn btn-custom btn-gradient-blue",type:"button",onClick:ne,disabled:!x.id},i[141]||(i[141]=[Ha("i",{class:"fas fa-copy"},null,-1)]),8,D3)])])]),x.id?(Ma(),Va("div",P3,[Ha("div",O3,[za(Ot(jY),{value:"".concat(Ot(E),"/").concat(x.id,"/bang-dien-tu"),options:{width:320,errorCorrectionLevel:"Q"},class:"qr-code-img"},null,8,["value"]),x.logo?(Ma(),Va("img",{key:0,class:"qrcode-image",src:x.logo},null,8,M3)):Qa("",!0)])])):Qa("",!0)])])],2),Ha("div",{class:G(["tab-pane fade",{"show active":"integrations"===g.value}]),role:"tabpanel"},[Ha("div",N3,[i[147]||(i[147]=Ha("h5",{class:"section-title"},"Cấu hình in vé giấy",-1)),Ha("div",R3,[Ha("div",L3,[Ha("div",V3,[i[144]||(i[144]=Ha("label",{class:"form-label"},"Hiá»n thá» in vé giấy",-1)),Ha("div",q3,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"invegiay","onUpdate:modelValue":i[41]||(i[41]=e=>x.invegiay=e)},null,512),[[vs,x.invegiay]]),Ha("label",F3,ee(x.invegiay?"Có":"Không"),1)])])]),Ha("div",B3,[Ha("div",U3,[i[145]||(i[145]=Ha("label",{for:"ip-print",class:"form-label"},"Äá»a chá» IP máy in",-1)),gn(Ha("input",{id:"ip-print",type:"text",class:"form-control",placeholder:"Nháºp Äá»a chá» IP máy in","onUpdate:modelValue":i[42]||(i[42]=e=>x.ip_printer=e)},null,512),[[ms,x.ip_printer]])])]),Ha("div",j3,[Ha("div",H3,[i[146]||(i[146]=Ha("label",{for:"ip-network",class:"form-label"},"Äá»a chá» IP mạng ná»i bá»",-1)),gn(Ha("input",{id:"ip-network",type:"text",class:"form-control",placeholder:"Nháºp Äá»a chá» IP mạng ná»i bá»","onUpdate:modelValue":i[43]||(i[43]=e=>x.ip_network=e)},null,512),[[ms,x.ip_network]])])])])]),Ha("div",z3,[i[151]||(i[151]=Ha("h5",{class:"section-title"},"Cấu hình SMS",-1)),Ha("div",W3,[Ha("div",K3,[Ha("div",G3,[i[148]||(i[148]=Ha("label",{for:"sms-server",class:"form-label"},"SMS Server",-1)),gn(Ha("input",{id:"sms-server",type:"text",class:"form-control",placeholder:"Nháºp SMS server","onUpdate:modelValue":i[44]||(i[44]=e=>x.smsserver=e)},null,512),[[ms,x.smsserver]])])]),Ha("div",Y3,[Ha("div",Q3,[i[149]||(i[149]=Ha("label",{for:"sms-acc",class:"form-label"},"Tà i khoản SMS",-1)),gn(Ha("input",{id:"sms-acc",class:"form-control",placeholder:"Nháºp tà i khoản","onUpdate:modelValue":i[45]||(i[45]=e=>x.smsuser=e)},null,512),[[ms,x.smsuser]])])]),Ha("div",$3,[Ha("div",X3,[i[150]||(i[150]=Ha("label",{for:"sms-pwd",class:"form-label"},"Máºt khẩu SMS",-1)),gn(Ha("input",{id:"sms-pwd",type:"password",class:"form-control",placeholder:N.value.smspassword?"Äã lưu - Äá» trá»ng nếu giữ nguyên":"Nháºp máºt khẩu",autocomplete:"new-password","onUpdate:modelValue":i[46]||(i[46]=e=>x.smspassword=e)},null,8,J3),[[ms,x.smspassword]])])])])]),Ha("div",Z3,[i[159]||(i[159]=Ha("h5",{class:"section-title"},"Cấu hình Email",-1)),Ha("div",e4,[Ha("div",t4,[Ha("div",n4,[i[152]||(i[152]=Ha("label",{for:"email-server",class:"form-label"},"Email Server",-1)),gn(Ha("input",{id:"email-server",type:"text",class:"form-control",placeholder:"Nháºp email server","onUpdate:modelValue":i[47]||(i[47]=e=>x.emailserver=e)},null,512),[[ms,x.emailserver]])])]),Ha("div",i4,[Ha("div",a4,[i[153]||(i[153]=Ha("label",{for:"email-port",class:"form-label"},"Cá»ng Email",-1)),gn(Ha("input",{id:"email-port",type:"number",min:"1",class:"form-control",placeholder:"Nháºp cá»ng email server","onUpdate:modelValue":i[48]||(i[48]=e=>x.emailport=e)},null,512),[[ms,x.emailport]])])]),Ha("div",o4,[Ha("div",s4,[i[154]||(i[154]=Ha("label",{for:"email-acc",class:"form-label"},"Tà i khoản Email",-1)),gn(Ha("input",{id:"email-acc",type:"text",class:"form-control",placeholder:"Nháºp tà i khoản","onUpdate:modelValue":i[49]||(i[49]=e
5211=>x.emailuser=e)},null,512),[[ms,x.emailuser]])])]),Ha("div",r4,[Ha("div",l4,[i[155]||(i[155]=Ha("label",{for:"email-pwd",class:"form-label"},"Máºt khẩu Email",-1)),gn(Ha("input",{id:"email-pwd",type:"password",class:"form-control",placeholder:N.value.emailpassword?"Äã lưu - Äá» trá»ng nếu giữ nguyên":"Nháºp máºt khẩu",autocomplete:"new-password","onUpdate:modelValue":i[50]||(i[50]=e=>x.emailpassword=e)},null,8,c4),[[ms,x.emailpassword]])])]),Ha("div",u4,[Ha("div",h4,[i[156]||(i[156]=Ha("label",{for:"email-name",class:"form-label"},"Tên ngưá»i gá»i",-1)),gn(Ha("input",{id:"email-name",type:"text",class:"form-control",placeholder:"Nháºp tên ngưá»i gá»i","onUpdate:modelValue":i[51]||(i[51]=e=>x.emailname=e)},null,512),[[ms,x.emailname]])])])]),Ha("div",d4,[Ha("div",f4,[Ha("div",p4,[i[157]||(i[157]=Ha("label",{for:"email-thu",class:"form-label"},"Gá»i thư thá» tá»i",-1)),gn(Ha("input",{id:"email-thu",type:"email",class:"form-control",placeholder:"Nháºp email nháºn thư thá»","onUpdate:modelValue":i[52]||(i[52]=e=>j.value=e),disabled:!T.value},null,8,g4),[[ms,j.value]])])]),Ha("div",m4,[Ha("button",{type:"button",class:"btn btn-secondary w-100",disabled:!T.value||H.value,onClick:z},ee(H.value?"Äang gá»i...":"Gá»i thá»"),9,v4)]),i[158]||(i[158]=Ha("div",{class:"col-12"},[Ha("small",{class:"text-muted"},[Ga(" Dùng Äúng cấu hình Äang lưu cá»§a ÄÆ¡n vá», gá»i bằng chÃnh mẫu thư ngưá»i dân nháºn. "),Ha("strong",null,"Lưu cấu hình trưá»c rá»i má»i gá»i thá»"),Ga(" â nút nà y Äá»c cấu hình Äã lưu chứ không Äá»c những gì Äang gõ dá». ")])],-1))])]),Ha("div",y4,[i[166]||(i[166]=Ha("h5",{class:"section-title"},"Cấu hình Zalo",-1)),Ha("div",b4,[Ha("div",_4,[Ha("div",w4,[i[160]||(i[160]=Ha("label",{for:"zalo-server",class:"form-label"},"Zalo Server",-1)),gn(Ha("input",{id:"zalo-server",type:"text",class:"form-control",placeholder:"Nháºp Zalo server","onUpdate:modelValue":i[53]||(i[53]=e=>x.zaloserver=e)},null,512),[[ms,x.zaloserver]])])]),Ha("div",k4,[Ha("div",x4,[i[161]||(i[161]=Ha("label",{for:"zalo-acc",class:"form-label"},"Tà i khoản Zalo",-1)),gn(Ha("input",{id:"zalo-acc",type:"text",class:"form-control",placeholder:"Nháºp tà i khoản","onUpdate:modelValue":i[54]||(i[54]=e=>x.zalouser=e)},null,512),[[ms,x.zalouser]])])]),Ha("div",T4,[Ha("div",C4,[i[162]||(i[162]=Ha("label",{for:"zalo-pwd",class:"form-label"},"Máºt khẩu Zalo",-1)),gn(Ha("input",{id:"zalo-pwd",type:"password",class:"form-control",placeholder:N.value.zalopassword?"Äã lưu - Äá» trá»ng nếu giữ nguyên":"Nháºp máºt khẩu",autocomplete:"new-password","onUpdate:modelValue":i[55]||(i[55]=e=>x.zalopassword=e)},null,8,E4),[[ms,x.zalopassword]])])]),Ha("div",S4,[Ha("div",I4,[i[163]||(i[163]=Ha("label",{for:"zalo-template",class:"form-label"},"Zalo Template ID",-1)),gn(Ha("input",{id:"zalo-template",type:"text",class:"form-control",placeholder:"Nháºp Zalo template ID","onUpdate:modelValue":i[56]||(i[56]=e=>x.zalotemplate=e)},null,512),[[ms,x.zalotemplate]])])]),Ha("div",A4,[Ha("div",D4,[i[164]||(i[164]=Ha("label",{for:"zalo-from",class:"form-label"},"Äá»nh danh tà i khoản Zalo",-1)),gn(Ha("input",{id:"zalo-from",type:"text",class:"form-control",placeholder:"Nháºp Äá»nh danh tà i khoản Zalo","onUpdate:modelValue":i[57]||(i[57]=e=>x.zalofrom=e)},null,512),[[ms,x.zalofrom]])])]),Ha("div",P4,[Ha("div",O4,[i[165]||(i[165]=Ha("label",{for:"zalo-app-id",class:"form-label"},"Zalo App ID",-1)),gn(Ha("input",{id:"zalo-app-id",type:"text",class:"form-control",placeholder:"Nháºp Zalo App ID","onUpdate:modelValue":i[58]||(i[58]=e=>x.zalo_app_id=e)},null,512),[[ms,x.zalo_app_id]])])])])])],2),Ha("div",{class:G(["tab-pane fade",{"show active":"notifications"===g.value}]),role:"tabpanel"},[Ha("div",M4,[i[171]||(i[171]=Ha("h5",{class:"section-title"},"Cấu hình thông báo tùy chá»nh",-1)),Ha("div",N4,[Ha("div",R4,[Ha("div",L4,[i[167]||(i[167]=Ha("label",{class:"form-label"},"Thông báo ngoà i quầy lá»
tân",-1)),Ha("div",V4,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"thongbaolettane","onUpdate:modelValue":i[59]||(i[59]=e=>x.thongbao_lettane_enabled=e)},null,512),[[vs,x.thongbao_lettane_enabled]]),Ha("label",q4,ee(x.thongbao_lettane_enabled?"Báºt":"Tắt"),1)])])]),x.thongbao_lettane_enabled?(Ma(),Va("div",F4,[Ha("div",B4,[i[170]||(i[170]=Ha("label",{class:"form-label"},"Ná»i dung thông báo",-1)),Ha("div",U4,[(Ma(!0),Va(Sa,null,gi(x.thongbao_lettane_texts,(e,t)=>(Ma(),Va("div",{key:t,class:"holiday-item"},[Ha("div",j4,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"thongbao-"+t,"onUpdate:modelValue":t=>e.selected=t},null,8,H4),[[vs,e.selected]]),Ha("label",{class:"form-check-label",for:"thongbao-"+t},ee(e.text),9,z4)])]))),128)),Ha("div",W4,[Ha("button",{type:"button",class:"btn btn-sm btn-custom btn-gradient-blue",onClick:ye},i[168]||(i[168]=[Ha("i",{class:"fas fa-plus"},null,-1),Ga(" Thêm thông báo ")])),Ha("button",{type:"button",class:"btn btn-sm btn-custom btn-gradient-danger",onClick:_e,disabled:!ve.value}
5211,i[169]||(i[169]=[Ha("i",{class:"fas fa-trash-alt"},null,-1),Ga(" Xoá mục Äã chá»n ")]),8,K4)])])])])):Qa("",!0)])]),Ha("div",G4,[i[178]||(i[178]=Ha("h5",{class:"section-title"},"Thông báo quy Äá»nh phát Äá»nh kỳ",-1)),Ha("div",Y4,[Ha("div",Q4,[Ha("div",$4,[i[172]||(i[172]=Ha("label",{class:"form-label"},"Tá»± Äá»ng phát thông báo quy Äá»nh",-1)),Ha("div",X4,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"thongbaodinhky","onUpdate:modelValue":i[60]||(i[60]=e=>x.thongbao_dinhky_enabled=e)},null,512),[[vs,x.thongbao_dinhky_enabled]]),Ha("label",J4,ee(x.thongbao_dinhky_enabled?"Báºt":"Tắt"),1)]),i[173]||(i[173]=Ha("small",{class:"text-muted"},"Mặc Äá»nh tắt. Báºt thì loa á» sảnh sẽ nhắc quy Äá»nh ưu tiên và hẹn giá».",-1))])]),x.thongbao_dinhky_enabled?(Ma(),Va("div",Z4,[Ha("div",e6,[i[174]||(i[174]=Ha("label",{for:"thongbaodinhkyphut",class:"form-label"},"Khoảng cách giữa hai lần phát (phút)",-1)),gn(Ha("input",{id:"thongbaodinhkyphut",type:"number",min:"5",max:"120",class:"form-control",placeholder:"Nháºp sá» phút","onUpdate:modelValue":i[61]||(i[61]=e=>x.thongbao_dinhky_phut=e)},null,512),[[ms,x.thongbao_dinhky_phut]]),i[175]||(i[175]=Ha("small",{class:"text-muted"},"Dưá»i 10 phút là bắt Äầu gây khó chá»u á» sảnh Äông.",-1))])])):Qa("",!0),x.thongbao_dinhky_enabled?(Ma(),Va("div",t6,[Ha("div",n6,[i[176]||(i[176]=Ha("label",{for:"thongbaodinhkynoidung",class:"form-label"},"Ná»i dung thông báo",-1)),gn(Ha("textarea",{id:"thongbaodinhkynoidung",rows:"3",class:"form-control",placeholder:"Nháºp ná»i dung thông báo","onUpdate:modelValue":i[62]||(i[62]=e=>x.thongbao_dinhky_noidung=e)},null,512),[[ms,x.thongbao_dinhky_noidung]]),i[177]||(i[177]=Ha("small",{class:"text-muted"}," Chá» phát khi sảnh Äang hoạt Äá»ng (có lượt gá»i sá» gần Äây) và không rÆ¡i và o ngà y nghá», ngà y lá»
. Thông báo xếp sau lá»i gá»i sá» nên không nói Äè lượt khách Äang ÄÆ°á»£c gá»i. ",-1))])])):Qa("",!0)])]),Ha("div",i6,[i[196]||(i[196]=Ha("h5",{class:"section-title"},"Cấu hình Ãm thanh",-1)),Ha("div",a6,[Ha("div",o6,[Ha("div",s6,[i[179]||(i[179]=Ha("label",{for:"tocdoamthanh",class:"form-label"},"Tá»c ÄỠâm thanh (tá»· lá»)",-1)),gn(Ha("input",{id:"tocdoamthanh",type:"number",min:"0.1",max:"10",step:"0.1",class:"form-control",placeholder:"Nháºp tá»· lá» tá»c Äá» Äá»c","onUpdate:modelValue":i[63]||(i[63]=e=>x.tocdoamthanh=e)},null,512),[[ms,x.tocdoamthanh]]),i[180]||(i[180]=Ha("small",{class:"text-muted"},"Giá trá» 1: bình thưá»ng, nhá» hÆ¡n 1: cháºm, lá»n hÆ¡n 1: nhanh.",-1))])]),Ha("div",r6,[Ha("div",l6,[i[181]||(i[181]=Ha("label",{for:"pitchamthanh",class:"form-label"},"Äá» cao thấp giá»ng nói (pitch)",-1)),gn(Ha("input",{id:"pitchamthanh",type:"number",min:"0.1",max:"2",step:"0.1",class:"form-control",placeholder:"Nháºp Äá» cao thấp (1: bình thưá»ng)","onUpdate:modelValue":i[64]||(i[64]=e=>x.pitchamthanh=e)},null,512),[[ms,x.pitchamthanh]]),i[182]||(i[182]=Ha("small",{class:"text-muted"},"Giá trá» 1: bình thưá»ng, nhá» hÆ¡n 1: trầm, lá»n hÆ¡n 1: cao.",-1))])]),Ha("div",c6,[Ha("div",u6,[i[183]||(i[183]=Ha("label",{for:"volumeamthanh",class:"form-label"},"Ãm lượng (volume)",-1)),gn(Ha("input",{id:"volumeamthanh",type:"number",min:"0",max:"1",step:"0.1",class:"form-control",placeholder:"Nháºp âm lượng (0-1)","onUpdate:modelValue":i[65]||(i[65]=e=>x.volumeamthanh=e)},null,512),[[ms,x.volumeamthanh]]),i[184]||(i[184]=Ha("small",{class:"text-muted"},"Giá trá» từ 0 (im lặng) Äến 1 (âm lượng tá»i Äa).",-1))])]),Ha("div",h6,[Ha("div",d6,[i[186]||(i[186]=Ha("label",{for:"vitriamthanh",class:"form-label"},"Vá» trà hiá»n thỠâm thanh",-1)),gn(Ha("select",{id:"vitriamthanh",class:"form-select","onUpdate:modelValue":i[66]||(i[66]=e=>x.vitriamthanh=e)},i[185]||(i[185]=[Ha("option",{value:"qrcode"},"Vá» trà mã QRCode",-1),Ha("option",{value:"tv"},"Vá» trà mà n hình TV",-1),Ha("option",{value:"letan"},"Quầy lá»
tân",-1)]),512),[[_s,x.vitriamthanh]]),i[187]||(i[187]=Ha("small",{class:"text-muted"},"Chá»n vá» trà phát âm thanh khi có khách hà ng má»i",-1))])]),Ha("div",f6,[Ha("div",p6,[i[189]||(i[189]=Ha("label",{for:"sound_provider",class:"form-label"},"Nhà cung cấp âm thanh",-1)),gn(Ha("select",{id:"sound_provider",class:"form-select","onUpdate:modelValue":i[67]||(i[67]=e=>x.sound_provider=e)},i[188]||(i[188]=[Ha("option",{value:"default"},"Mặc Äá»nh (trình duyá»t)",-1),Ha("option",{value:"google"},"Google Text-to-Speech",-1)]),512),[[_s,x.sound_provider]]),i[190]||(i[190]=Ha("small",{class:"text-muted"},"Chá»n nhà cung cấp dá»ch vụ âm thanh",-1))])]),"google"===x.sound_provider?(Ma(),Va("div",g6,[Ha("div",m6,[i[191]||(i[191]=Ha("label",{for:"sound_provider_auth_key",class:"form-label"},"Google API Key",-1)),gn(Ha("input",{id:"sound_provider_auth_key",type:"password",class:"form-control",placeholder:N.value.sound_provider_auth_key?"Äã lưu - Äá» trá»ng nếu giữ nguyên":"Nháºp Google API Key",autocomplete:"new-password","onUpdate:modelValue":i[68]||(i[68]=e=>x.sound_provider_auth_key=e)},null,8,v6),[[ms,x.sound_provider_auth_key]])])])):Qa("",!0),Ha("div",y6,[Ha("div",b6,[i[192]||(i[192]=Ha("label",{class:"form-label"},"Äá»c tên ÄÆ¡n vá»",-1)),Ha("div",_6,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"doctendonvi","onUpdate:modelValue":i[69]||(i[69]=e=>x.doctendonvi=e)},null,512),[[vs,x.doctendonvi]]),Ha("label",w6,ee(x.doctendonvi?"Có":"Không"),1)]),i[193]||(i[193]=Ha("small",{class:"text-muted"},"Cho phép Äá»c tên ÄÆ¡n vá»",-1))])]),Ha("div",k6,[Ha("div",x6,[i[194]||(i[194]=Ha("label",{class:"form-label"},"Äá»c sá» theo từng chữ sá»",-1)),Ha("div",T6,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"docsotungchuso","onUpdate:modelValue":i[70]||(i[70]=e=>x.docsotungchuso=e)},null,512),[[vs,x.docsotungchuso]]),Ha("label",C6,ee(x.docsotungchuso?"Có":"Không"),1)]),i[195]||(i[195]=Ha("small",{class:"text-muted"},'Báºt: Äá»c "má»t không không má»t". Tắt: Äá»c "má»t nghìn không trÄm linh má»t"',-1))])])])])],2),Ha("div",{class:G(["tab-pane fade",{"show active":"advanced"===g.value}]),role:"tabpanel"},[Ha("div",E6,[i[204]||(i[204]=Ha("h5",{class:"section-title"},"Cấu hình ngà y nghá»",-1)),Ha("div",S6,[Ha("div",I6,[Ha("div",A6,[i[200]||(i[200]=Ha("label",{class:"form-label"},"Ngà y nghá» trong tuần",-1)),Ha("div",D6,[(Ma(),Va(Sa,null,gi(["Thứ 2","Thứ 3","Thứ 4","Thứ 5","Thứ 6","Thứ 7","Chá»§ nháºt"],(e,t)=>Ha("div",{key:t,class:G(["weekday-item",{"selected-full":ie(t,"full"),"selected-morning":ie(t,"morning"),"selected-afternoon":ie(t,"afternoon")}])},[Ha("div",P6,[Ha("div",{class:"weekday-header",onClick:e=>(e=>{const t=e.toString(),n=x.ngaynghi.find(e=>e.week_day===t);x.ngaynghi=n?x.ngaynghi.filter(e=>e.week_day!==t):[...x.ngaynghi,{week_day:t,type:"full"}]})(t)},[Ha("span",M6,ee(e),1)],8,O6),Ha("div",N6,[Ha("button",{type:"button",class:G(["btn-option",{active:ie(t,"full")}]),onClick:e=>ae(t,"full")},[ie(t,"full")?(Ma(),Va("i",L6)):Qa("",!0),i[197]||(i[197]=Ga(" Cả ngà y "))],10,R6),Ha("button",{type:"button",class:G(["btn-option",{active:ie(t,"morning")}]),onClick:e=>ae(t,"morning")},[ie(t,"morning")?(Ma(),Va("i",q6)):Qa("",!0),i[198]||(i[198]=Ga(" Sáng "))],10,V6),Ha("button",{type:"button",class:G(["btn-option",{active:ie(t,"afternoon")}]),onClick:e=>ae(t,"afternoon")},[ie(t,"afternoon")?(Ma(),Va("i",B6)):Qa("",!0),i[199]||(i[199]=Ga(" Chiá»u "))],10,F6)])])],2)),64))])])]),Ha("div",U6,[Ha("div",j6,[i[203]||(i[203]=Ha("label",{class:"form-label"},"Ngà y lá»
",-1)),Ha("div",H6,[(Ma(!0),Va(Sa,null,gi(O.value,(e,t)=>(Ma(),Va("div",{key:t,class:"holiday-item"},[Ha("div",z6,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"holiday-"+t,"onUpdate:modelValue":t=>e.selected=t,onChange:ge},null,40,W6),[[vs,e.selected]]),Ha("label",{class:"form-check-label",for:"holiday-"+t},[Ga(ee(e.name)+" ("+ee(e.date)+") ",1),P.some(t=>t.date===e.date)?Qa("",!0):(Ma(),Va("button",{key:0,class:"btn-icon-only text-danger",onClick:Es(e=>(e=>
5211{O.value=O.value.filter((t,n)=>n!==e),ge()})(t),["prevent"])},i[201]||(i[201]=[Ha("i",{class:"fas fa-trash-alt"},null,-1)]),8,G6))],8,K6)])]))),128)),Ha("div",{class:"mt-2"},[Ha("button",{type:"button",class:"btn btn-sm btn-custom btn-gradient-blue",onClick:pe},i[202]||(i[202]=[Ha("i",{class:"fas fa-plus"},null,-1),Ga(" Thêm ngà y lá»
khác ")]))])])])])])]),Ha("div",Y6,[i[211]||(i[211]=Ha("h5",{class:"section-title"},"Cấu hình hẹn giá» giao dá»ch",-1)),Ha("div",Q6,[Ha("div",$6,[Ha("div",X6,[i[205]||(i[205]=Ha("label",{for:"hengio_dattruoc",class:"form-label"},"Äặt lá»ch trưá»c Ãt nhất (phút)",-1)),gn(Ha("input",{id:"hengio_dattruoc",type:"number",min:"0",max:"1440",class:"form-control",placeholder:"Nháºp sá» phút","onUpdate:modelValue":i[71]||(i[71]=e=>x.hengio_datlich_truoc_phut=e)},null,512),[[ms,x.hengio_datlich_truoc_phut]]),i[206]||(i[206]=Ha("small",{class:"text-muted"},"Công dân không chá»n ÄÆ°á»£c khung giá» gần hÆ¡n khoảng nà y.",-1))])]),Ha("div",J6,[Ha("div",Z6,[i[207]||(i[207]=Ha("label",{for:"hengio_toida",class:"form-label"},"Sá» lá»ch hẹn tá»i Äa má»i ngưá»i (Äang giữ)",-1)),gn(Ha("input",{id:"hengio_toida",type:"number",min:"1",max:"10",class:"form-control",placeholder:"Nháºp sá» lá»ch","onUpdate:modelValue":i[72]||(i[72]=e
5211=>x.hengio_toida_moi_nguoi=e)},null,512),[[ms,x.hengio_toida_moi_nguoi]]),i[208]||(i[208]=Ha("small",{class:"text-muted"},[Ga(" Má»t ngưá»i Äặt ÄÆ°á»£c nhiá»u lá»ch hẹn, "),Ha("strong",null,"má»i quầy má»t lá»ch"),Ga(", tá»ng không quá con sá» nà y. Äếm sá» lá»ch "),Ha("strong",null,"Äang giữ"),Ga(" chứ không phải cả ngà y: ÄÆ°á»£c phục vụ xong, hoặc quá giá» hẹn mà chưa xác nháºn, là nhả chá» ngay. ")],-1))])]),Ha("div",e9,[Ha("div",t9,[i[209]||(i[209]=Ha("label",{for:"hengio_xacnhantruoc",class:"form-label"},"Má» nút xác nháºn trưá»c giá» hẹn (phút)",-1)),gn(Ha("input",{id:"hengio_xacnhantruoc",type:"number",min:"1",max:"240",class:"form-control",placeholder:"Nháºp sá» phút","onUpdate:modelValue":i[73]||(i[73]=e=>x.hengio_xacnhan_truoc_phut=e)},null,512),[[ms,x.hengio_xacnhan_truoc_phut]]),i[210]||(i[210]=Ha("small",{class:"text-muted"},[Ga(' Nút "Xác nháºn có mặt" trên vé má» trưá»c giá» hẹn Äúng khoảng nà y và '),Ha("strong",null,"Äóng Äúng giá» hẹn"),Ga(". Quá giá» hẹn mà chưa xác nháºn là mất lượt - má»c Äóng là quy Äá»nh, không cấu hình ÄÆ°á»£c. Con sá» á» Äây cÅ©ng là con sá» hiá»n trong lá»i nhắc trên vé. ")],-1))])])])]),Ha("div",n9,[i[214]||(i[214]=Ha("h5",{class:"section-title"},"Cấu hình lấy sá» thứ tá»±",-1)),Ha("div",i9,[Ha("div",a9,[Ha("div",o9,[i[212]||(i[212]=Ha("label",{for:"laso_toida",class:"form-label"},"Sá» lượt tá»i Äa má»i ngưá»i (Äang chá»)",-1)),gn(Ha("input",{id:"laso_toida",type:"number",min:"1",max:"10",class:"form-control",placeholder:"Nháºp sá» lượt","onUpdate:modelValue":i[74]||(i[74]=e=>x.laso_toida_moi_nguoi=e)},null,512),[[ms,x.laso_toida_moi_nguoi]]),i[213]||(i[213]=Ha("small",{class:"text-muted"},[Ga(" Má»t ngưá»i lấy sá» ÄÆ°á»£c á» nhiá»u quầy, tá»ng không quá con sá» nà y. Äếm sá» lượt "),Ha("strong",null,"Äang chá»"),Ga(": ÄÆ°á»£c phục vụ xong, hoặc qua lượt vì hết ca, là nhả chá» ngay. Riêng viá»c lấy lại sá» á» "),Ha("strong",null,"cùng má»t quầy"),Ga(' do cấu hình "Giá»i hạn thá»i gian lấy sá»" cá»§a từng quầy quyết Äá»nh. ')],-1))])])])]),Ha("div",s9,[i[221]||(i[221]=Ha("h5",{class:"section-title"},"Cấu hình Äá»i tượng ưu tiên",-1)),Ha("div",r9,[Ha("div",l9,[Ha("div",c9,[i[215]||(i[215]=Ha("label",{class:"form-label"},"Hiá»n thá» Äá»i tượng ưu tiên",-1)),Ha("div",u9,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"doituonguutien_enabled","onUpdate:modelValue":i[75]||(i[75]=e=>x.doi_tuong_uu_tien_enabled=e)},null,512),[[vs,x.doi_tuong_uu_tien_enabled]]),Ha("label",h9,ee(x.doi_tuong_uu_tien_enabled?"Báºt":"Tắt"),1)])])]),Ha("div",d9,[Ha("div",f9,[i[216]||(i[216]=Ha("label",{class:"form-label"},"Ưu tiên ÄÆ°á»£c gá»i trưá»c khách hẹn giá»",-1)),Ha("div",p9,[g
5211n(Ha("input",{class:"form-check-input",type:"checkbox",id:"uutien_vuot_hengio","onUpdate:modelValue":i[76]||(i[76]=e=>x.uutien_vuot_hengio=e)},null,512),[[vs,x.uutien_vuot_hengio]]),Ha("label",g9,ee(x.uutien_vuot_hengio?"Báºt":"Tắt"),1)]),i[217]||(i[217]=Ha("small",{class:"text-muted"},' Báºt: thứ tá»± gá»i là khách ưu tiên, rá»i khách hẹn giá», sau cùng là khách xếp hà ng thưá»ng. Tắt (mặc Äá»nh): khách hẹn giá» Äã xác nháºn và Äã tá»i giá» ÄÆ°á»£c gá»i trưá»c, khách ưu tiên chá» hết khách hẹn giá» má»i tá»i lượt. Dù báºt hay tắt, cán bá» vẫn gá»i vượt má»t khách ưu tiên cụ thá» ÄÆ°á»£c bằng nút "Gá»i sá» ngay". ',-1))])]),x.doi_tuong_uu_tien_enabled?(Ma(),Va("div",m9,[Ha("div",v9,[i[220]||(i[220]=Ha("label",{class:"form-label"},"Danh sách trưá»ng hợp ưu tiên",-1)),Ha("div",y9,[(Ma(!0),Va(Sa,null,gi(x.doi_tuong_uu_tien_texts,(e,t)=>(Ma(),Va("div",{key:t,class:"holiday-item"},[Ha("div",b9,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"doituong-"+t,"onUpdate:modelValue":t=>e.selected=t},null,8,_9),[[vs,e.selected]]),Ha("label",{class:"form-check-label",for:"doituong-"+t},ee(e.text),9,w9)])]))),128)),Ha("div",k9,[Ha("button",{type:"button",class:"btn btn-sm btn-custom btn-gradient-blue",onClick:ke},i[218]||(i[218]=[Ha("i",{class:"fas fa-plus"},null,-1),Ga(" Thêm Äá»i tượng ")])),Ha("button",{type:"button",class:"btn btn-sm btn-custom btn-gradient-danger",onClick:Te,disabled:!we.value},i[219]||(i[219]=[Ha("i",{class:"fas fa-trash-alt"},null,-1),Ga(" Xoá mục Äã chá»n ")]),8,x9)])])])])):Qa("",!0)])])],2)])]),Ha("div",T9,[Ha("div",C9,[Ha("div",E9,[Ha("button",{type:"button",class:"btn btn-custom btn-gradient-orange",onClick:X,disabled:y.value||!T.value&&Ot(a).role==Ot(UT)},[y.value?(Ma(),Va("span",I9)):(Ma(),Va("span",A9,ee(T.value?"Cáºp nháºt":"Thêm má»i"),1))],8,S9),T.value&&x.id?(Ma(),Va("button",{key:0,disabled:y.value,type:"button",class:"btn btn-custom btn-gradient-info",onClick:Ce},i[222]||(i[222]=[Ha("i",{class:"fas fa-sync-alt me-2"},null,-1),Ga("Reset STT ")]),8,D9)):Qa("",!0)])])])])])],512),Ha("div",{class:"modal fade",id:"holidayModal",tabindex:"-1","aria-labelledby":"holidayModalLabel",ref_key:"holidayModalRef",ref:oe},[Ha("div",P9,[Ha("div",O9,[i[226]||(i[226]=Ha("div",{class:"modal-header custom-header"},[Ha("h5",{class:"modal-title",id:"holidayModalLabel"},"Thêm ngà y lá»
"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("div",M9,[Ha("div",N9,[i[223]||(i[223]=Ha("label",{for:"holidayName",class:"form-label"},"Tên ngà y lá»
",-1)),gn(Ha("input",{type:"text",id:"holidayName",class:"form-control","onUpdate:modelValue":i[77]||(i[77]=e=>re.name=e),placeholder:"Nháºp tên ngà y lá»
",required:""},null,512),[[ms,re.name]])]),Ha("div",R9,[i[224]||(i[224]=Ha("label",{for:"holidayDate",class:"form-label"},"Chá»n ngà y",-1)),za(Ot(q0),{modelValue:re.date,"onUpdate:modelValue":i[78]||(i[78]=e=>re.date=e),format:"dd/MM/yyyy","enable-time-picker":!1,locale:"vi","day-names":["T2","T3","T4","T5","T6","T7","CN"],"auto-apply":"",placeholder:"Chá»n ngà y",required:""},null,8,["modelValue"])])]),Ha("div",L9,[i[225]||(i[225]=Ha("button",{type:"button",class:"btn btn-custom btn-gradient-blue","data-bs-dismiss":"modal"},"Äóng",-1)),Ha("button",{type:"button",class:"btn btn-custom btn-gradient-orange",onClick:Es(me,["prevent"])},"Thêm")])])])],512),Ha("div",{class:"modal fade",id:"thongBaoModal",tabindex:"-1","aria-labelledby":"thongBaoModalLabel",ref_key:"thongBaoModalRef",ref:le},[Ha("div",V9,[Ha("div",q9,[i[229]||(i[229]=Ha("div",{class:"modal-header custom-header"},[Ha("h5",{class:"modal-title",id:"thongBaoModalLabel"},"Thêm thông báo"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("div",F9,[Ha("div",B9,[i[227]||(i[227]=Ha("label",{for:"thongBaoText",class:"form-label"},"Ná»i dung thông báo",-1)),gn(Ha("textarea",{rows:"3",id:"thongBaoText",class:"form-control","onUpdate:modelValue":i[79]||(i[79]=e=>ue.value=e),placeholder:"Nháºp ná»i dung",required:""},null,512),[[ms,ue.value]])])]),Ha("div",U9,[i[228]||(i[228]=Ha("button",{type:"button",class:"btn btn-custom btn-gradient-blue","data-bs-dismiss":"modal"},"Äóng",-1)),Ha("button",{type:"button",class:"btn btn-custom btn-gradient-orange",onClick:Es(be,["prevent"])},"Thêm")])])])],512),Ha("div",{class:"modal fade",id:"doiTuongUuTienModal",tabindex:"-1","aria-labelledby":"doiTuongUuTienModalLabel",ref_key:"doiTuongUuTienModalRef",ref:de},[Ha("div",j9,[Ha("div",H9,[i[232]||(i[232]=Ha("div",{class:"modal-header custom-header"},[Ha("h5",{class:"modal-title",id:"doiTuongUuTienModalLabel"},"Thêm Äá»i tượng ưu tiên"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("div",z9,[Ha("div",W9,[i[230]||(i[230]=Ha("label",{for:"doiTuongUuTienText",class:"form-label"},"Tên Äá»i tượng ưu tiên",-1)),gn(Ha("input",{type:"text",id:"doiTuongUuTienText",class:"form-control","onUpdate:modelValue":i[80]||(i[80]=e=>he.value=e),placeholder:"Nháºp tên Äá»i tượng ưu tiên",required:""},null,512),[[ms,he.value]])])]),Ha("div",K9,[i[231]||(i[231]=Ha("button",{type:"button",class:"btn btn-custom btn-gradient-blue","data-bs-dismiss":"modal"},"Äóng",-1)),Ha("button",{type:"button",class:"btn btn-custom btn-gradient-orange",onClick:Es(xe,["prevent"])},"Thêm")])])])],512),Ha("div",{class:"modal fade",id:"cloneUnitModal",tabindex:"-1","aria-labelledby":"
5211cloneUnitModalLabel",ref_key:"cloneUnitModalRef",ref:b},[Ha("div",G9,[Ha("div",Y9,[i[236]||(i[236]=Ha("div",{class:"modal-header custom-header"},[Ha("h5",{class:"modal-title",id:"cloneUnitModalLabel"},"Nhân bản ÄÆ¡n vá»"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("form",{onSubmit:Es(B,["prevent"])},[Ha("div",Q9,[Ha("p",$9,[i[233]||(i[233]=Ga("Bạn Äang nhân bản ÄÆ¡n vá»: ")),Ha("strong",null,ee(w.value),1)]),Ha("div",X9,[i[234]||(i[234]=Ha("label",{for:"new-unit-name",class:"form-label"},"Tên ÄÆ¡n vá» má»i",-1)),gn(Ha("input",{type:"text",id:"new-unit-name",class:"form-control","onUpdate:modelValue":i[81]||(i[81]=e=>k.value=e),placeholder:"Nháºp tên ÄÆ¡n vá» má»i",required:""},null,512),[[ms,k.value]])])]),Ha("div",J9,[i[235]||(i[235]=Ha("button",{type:"button",class:"btn btn-custom btn-gradient-blue","data-bs-dismiss":"modal"},"Äóng",-1)),Ha("button",{type:"submit",class:"btn btn-custom btn-gradient-orange",disabled:T.value},[T.value?(Ma(),Va("span",e8)):(Ma(),Va("span",t8,"Nhân bản"))],8,Z9)])],32)])])],512)]),za(u1,{ref_key:"nhatKyLoiRef",ref:U},null,512)],64)}}},[["__scopeId","data-v-8fd20514"]]),i8=Js("cauHinhStore",{state:()=>({item:null}),actions:{async saveCauHinh(e){try{await bk(uw(sT,"cau_hinh_he_thong","cau_hinh"),e),fT({hanhDong:hT,doiTuong:"cau_hinh_he_thong",doiTuongId:"cau_hinh",tenDoiTuong:"Cấu hình chung toà n há» thá»ng",chiTiet:"Trưá»ng Äã Äá»i: ".concat(Object.keys(e||{}).join(", "))})}catch(eRe){}},async fetchData(){this.item=await yT("cau_hinh_he_thong","cau_hinh")}}}),a8={class:"container content-container"},o8={class:"form-section"},s8={class:"row"},r8={class:"col-md-12 mb-4"},l8={class:"form-group shadow-sm"},c8={class:"d-flex align-items-start gap-4"},u8=["disabled"],h8={key:0,class:"mt-2"},d8={key:0},f8=["src"],p8={class:"col-md-12 mb-4"},g8={class:"form-group shadow-sm"},m8={class:"col-md-12 mb-4"},v8={class:"form-group shadow-sm"},y8={class:"col-md-12 mb-4"},b8={class:"form-group shadow-sm"},_8={class:"d-flex justify-content-end"},w8=["disabled"],k8=CC({__name:"CauHinhHeThong",setup(e){const t=oG(),{files:n,open:i,reset:a}=IB(),o=It(!1),s=i8(),{item:r}=Zs(s),l=gt({logo:"",banquyen:"",tenhethong:"",thietke:""});ei(async()=>{await Promise.all([s.fetchData()]),await an(()=>{(null==r?void 0:r.value)&&Object.assign(l,r.value)})});const c=async()=>{var e;try{o.value=!0;const i=(null==(e=null==n?void 0:n.value)?void 0:e.length)?n.value[0]:null;if(i){const e=tC(10),n="logo/".concat(e),a=oj(t,n),{url:o,uploadProgress:s,uploadError:r,uploadTask:c,upload:u}=lG(a);let h;await u(i);let d=!1;await new Promise(e=>{h=fa(()=>{o.value&&(l.logo=o.value,!d&&h&&(h(),d=!0),e())})})}await s.saveCauHinh({...l}),LT("Cấu hình há» thá»ng thà nh công!"),setTimeout(()=>{window.location.reload()},1e3)}catch(eRe){VT("Cấu hình há» thá»ng thất bại!")}finally{o.value=!1}};return(e,t)=>{var a,s;return Ma(),Va("div",a8,[t[9]||(t[9]=Ha("div",{class:"header"},[Ha("h3",{class:"text-center"},"CẤU HÃNH Há» THá»NG")],-1)),Ha("form",{onSubmit:Es(c,["prevent"]),class:"form-container"},[Ha("div",o8,[Ha("div",s8,[Ha("div",r8,[Ha("div",l8,[t[5]||(t[5]=Ha("label",{for:"logo",class:"form-label"},"Logo há» thá»ng",-1)),Ha("div",c8,[Ha("fieldset",{disabled:!!e.uploadTask},[Ha("button",{type:"button",class:"btn btn-custom btn-gradient-blue",onClick:t[0]||(t[0]=e=>Ot(i)({accept:"image/*",multiple:!1}))},t[4]||(t[4]=[Ha("i",{class:"fa fa-upload me-2"},null,-1),Ga(" Chá»n ảnh ")])),1===(null==(a=Ot(n))?void 0:a.length)?(Ma(),Va("div",h8," File Äã chá»n: "+ee(null==(s=Ot(n)[0])?void 0:s.name),1)):Qa("",!0)],8,u8),l.logo?(Ma(),Va("div",d8,[Ha("img",{src:l.logo,alt:"Logo Preview",class:"img-thumbnail",width:"120",height:"120"},null,8,f8)])):Qa("",!0)])])]),Ha("div",p8,[Ha("div",g8,[t[6]||(t[6]=Ha("label",{for:"banquyen",class:"form-label"},"Thông tin bản quyá»n",-1)),gn(Ha("input",{type:"text",id:"banquyen",class:"form-control",placeholder:"Nháºp thông tin bản quyá»n",required:"","onUpdate:modelValue":t[1]||(t[1]=e=>l.banquyen=e)},null,512),[[ms,l.banquyen]])])]),Ha("div",m8,[Ha("div",v8,[t[7]||(t[7]=Ha("label",{for:"tenhethong",class:"form-label"},"Tên há» thá»ng",-1)),gn(Ha("input",{type:"text",id:"tenhethong",class:"form-control",placeholder:"Há» thá»ng xếp hà ng tá»± Äá»ng QR CODE",required:"","onUpdate:modelValue":t[2]||(t[2]=e=>l.tenhethong=e)},null,512),[[ms,l.tenhethong]])])]),Ha("div",y8,[Ha("div",b8,[t[8]||(t[8]=Ha("label",{for:"thietke",class:"form-label"},"Thông tin ÄÆ¡n vá» thiết kế",-1)),gn(Ha("input",{type:"text",id:"thietke",class:"form-control",placeholder:"Nháºp thông tin ÄÆ¡n vá» thiết kế",required:"","onUpdate:modelValue":t[3]||(t[3]=e=>l.thietke=e)},null,512),[[ms,l.thietke]])])])])]),Ha("div",_8,[Ha("button",{type:"submit",class:"btn btn-custom btn-gradient-orange",disabled:o.value}," Cáºp nháºt ",8,w8)])],32)])}}},[["__scopeId","data-v-e7879357"]]),x8={class:"container content-container"},T8={class:"header"},C8={class:"text-center"},E8={key:0,class:"button-section"},S8={key:1,class:"button-section"},I8=CC({__name:"TheIndex",setup(e){const t=Vl().params.don_vi,n=JT(),{item:i}=Zs(n),a=wI(),{items:o}=Zs(a),s=ET(),{userAuth:r}=Zs(s),{userRole:l}=Zs(s),c=localStorage.getItem("screen_id")||"",u=bo(()=>{var e;const t=null==(e=i.value)?void 0:e.quanlyquay;return void 0===t||!!t});return Zn(async()=>{try{await Promise.all([s.getAuthUser(),s.getUserAuthRole(),n.realtimeItemById(t)]),l.value.role==zT?await Promise.all([a.fetchItemsByDonViAndManger(t,r.value.email,!0)]):await Promise.all([a.fetchEnableItemsByDonVi(t)])}catch(eRe){}}),(e,t)=>{var n,a,s,r,h,d,f,p,g,m,v;const y=ui("router-link");return Ma(),Va("div",x8,[Ha("div",T8,[Ha("h3",C8,ee(null==(n=Ot(i))?void 0:n.ten),1)]),Ot(l).role?(Ma(),Va("div",E8,[[Ot(BT),Ot(UT),Ot(jT)].includes(Ot(l).role)&&Ot(i).quetqrtinh?(Ma(),qa(y,{key:0,class:"btn btn-custom btn-gradient-blue",to:"/".concat(null==(a=Ot(i))?void 0:a.id,"/hien-thi-qrcode?state=default")},{default:pn(()=>t[0]||(t[0]=[Ga("Hiá»n thá» QRCODE TĨNH")])),_:1},8,["to"])):Qa("",!0),[Ot(BT),Ot(UT)].includes(Ot(l).role)?(Ma(),qa(y,{key:1,class:"btn btn-custom btn-gradient-blue",to:"/".concat(null==(s=Ot(i))?void 0:s.id,"/cap-nhat-thong-tin")},{default:pn(()=>t[1]||(t[1]=[Ga("Cáºp nháºt thông tin")])),_:1},8,["to"])):Qa("",!0),[Ot(BT),Ot(UT),Ot(jT)].includes(Ot(l).role)?(Ma(),qa(y,{key:2,class:"btn btn-custom btn-gradient-blue",to:"/".concat(null==(r=Ot(i))?void 0:r.id,"/hien-thi-qrcode?state=dynamic")},{default:pn(()=>t[2]||(t[2]=[Ga("Hiá»n thá» QRCODE Äá»NG")])),_:1},8,["to"])):Qa("",!0),(null==(h=Ot(i))?void 0:h.hienthitranghotro)&&[Ot(BT),Ot(UT),Ot(jT),Ot(HT)
5211].includes(Ot(l).role)?(Ma(),qa(y,{key:3,class:"btn btn-custom btn-gradient-blue",to:"/".concat(null==(d=Ot(i))?void 0:d.id,"/ho-tro-lay-so")},{default:pn(()=>t[3]||(t[3]=[Ga("Há» trợ lấy sá» nhanh")])),_:1},8,["to"])):Qa("",!0),[Ot(BT),Ot(UT),Ot(jT)].includes(Ot(l).role)&&(null==(f=Ot(i))?void 0:f.hienthitranginvegiay)?(Ma(),qa(y,{key:4,class:"btn btn-custom btn-gradient-blue",to:"/".concat(null==(p=Ot(i))?void 0:p.id,"/in-ve-giay")},{default:pn(()=>t[4]||(t[4]=[Ga("In vé giấy")])),_:1},8,["to"])):Qa("",!0),[Ot(BT),Ot(UT)].includes(Ot(l).role)?(Ma(),qa(y,{key:5,class:"btn btn-custom btn-gradient-blue",to:"/".concat(null==(g=Ot(i))?void 0:g.id,"/bao-cao-thong-ke")},{default:pn(()=>t[5]||(t[5]=[Ga("Báo cáo - Tá»ng hợp")])),_:1},8,["to"])):Qa("",!0),[Ot(BT),Ot(UT)].includes(Ot(l).role)&&u.value?(Ma(),qa(y,{key:6,class:"btn btn-custom btn-gradient-blue",to:"/".concat(null==(m=Ot(i))?void 0:m.id,"/quan-ly-quay")},{default:pn(()=>t[6]||(t[6]=[Ga("Quản lý quầy")])),_:1},8,["to"])):Qa("",!0),[Ot(BT),Ot(UT),Ot(jT)].includes(Ot(l).role)?(Ma(),qa(y,{key:7,class:"btn btn-custom btn-gradient-blue",to:"/".concat(null==(v=Ot(i))?void 0:v.id,"/man-hinh?sc=").concat(Ot(c))},{default:pn(()=>t[7]||(t[7]=[Ga("Mà n hình trung tâm")])),_:1},8,["to"])):Qa("",!0)])):Qa("",!0),[Ot(BT),Ot(UT),Ot(zT)].includes(Ot(l).role)?(Ma(),Va("div",S8,[(Ma(!0),Va(Sa,null,gi(Ot(o),e=>(Ma(),Va("div",{key:e.id},[za(y,{class:"btn btn-custom btn-gradient-light-blue",to:"/".concat(null==e?void 0:e.donvi,"/goi-so/").concat(null==e?void 0:e.id)},{default:pn(()=>[Ga(" Gá»i sá» - Quầy "+ee(null==e?void 0:e.ten),1)]),_:2},1032,["to"])]))),128))])):Qa("",!0)])}}},[["__scopeId","data-v-460561e6"]]),A8={class:"container content-container"},D8={class:"px-3"},P8={class:"tab-content",id:"quayTabContent"},O8={class:"tab-pane fade show active",id:"active-quays",role:"tabpanel","aria-labelledby":"active-tab"},M8={class:"table-responsive mt-3"},N8={class:"table table-striped custom-table"},R8={class:"manager-list d-flex flex-wrap gap-2"},L8=["title"],V8=["onClick"],q8={class:"d-flex gap-2"},F8=["onClick"],B8=["onClick"],U8=["onClick"],j8=["onClick"],H8=["onClick"],z8={key:0},W8={class:"tab-pane fade",id:"inactive-quays",role:"tabpanel","aria-labelledby":"inactive-tab"},K8={class:"table-responsive mt-3"},G8={class:"table table-striped custom-table"},Y8={class:"manager-list d-flex flex-wrap gap-2"},Q8=["title"],$8=["onClick"],X8={class:"d-flex gap-2"},J8=["onClick"],Z8=["onClick"],e7=["onClick"],t7=["onClick"],n7={key:0},i7={class:"modal-dialog modal-xl modal-dialog-scrollable"},a7={class:"modal-content custom-modal"},o7={class:"modal-header custom-header header-gray"},s7={class:"modal-title",id:"quayModalLabel"},r7={class:"modal-body pb-5"},l7={class:"row mb-3"},c7={class:"col-md-6 mb-4"},u7={class:"form-group"},h7={class:"col-md-6 mb-4"},d7={class:"form-group"},f7={class:"col-md-12 mb-4"},p7={class:"form-group"},g7={class:"col-md-3 mb-4"},m7={class:"form-group"},v7={class:"col-md-3 mb-4"},y7={class:"form-group"},b7={class:"col-md-3 mb-4"},_7={class:"form-group"},w7={class:"col-md-3 mb-4"},k7={class:"form-group"},x7={class:"form-check form-switch"},T7={class:"form-check-label",for:"inlineCheckboxStatus"},C7={class:"col-md-3 mb-4"},E7={class:"form-group"},S7={class:"col-md-3 mb-4"},I7={class:"form-group"},A7={class:"col-md-3 mb-4"},D7={class:"form-group"},P7={class:"col-md-3 mb-4"},O7={class:"form-group"},M7={class:"col-md-3 mb-4"},N7={class:"form-group"},R7={class:"form-check form-switch"},L7={class:"form-check-label",for:"inlineCheckboxAutoPause"},V7={class:"col-md-3 mb-4"},q7={class:"form-group"},F7={class:"form-check form-switch"},B7={class:"form-check-label",for:"inlineCheckboxDungTheoSokhach"},U7={key:0,class:"col-md-3 mb-4"},j7={class:"form-group"},H7={class:"col-md-3 mb-4"},z7={class:"form-group"},W7={class:"form-check form-switch"},K7={class:"form-check-label",for:"gioihanquetma"},G7={key:1,class:"col-md-3 mb-4"},Y7={class:"form-group"},Q7={class:"col-md-3 mb-4"},$7={class:"form-group"},X7={class:"form-check form-switch"},J7={class:"form-check-label",for:"xacnhanhengiotaiquay"},Z7={class:"col-md-3 mb-4"},eee={class:"form-group"},tee={class:"col-md-3 mb-4"},nee={class:"form-group"},iee={class:"col-md-3 mb-4"},aee={class:"form-group"},oee={class:"col-md-3 mb-4"},see={class:"form-group"},ree={class:"col-md-3 mb-4"},lee={class:"form-group"},cee={class:"col-md-6 mb-4"},uee={class:"form-group"},hee={class:"form-text m-0"},dee={key:0},fee={key:0},pee={key:1,class:"text-danger"},gee={class:"col-md-4 mb-4"},mee={class:"form-group"},vee={class:"form-check form-switch"},yee={class:"form-check-label",for:"inlineCheckboxMessage"},bee={class:"col-md-4 mb-4"},_ee={class:"form-group"},wee={class:"form-check form-switch"},kee={class:"form-check-label",for:"inlineCheckboxZalo"},xee={class:"col-md-4 mb-4"},Tee={class:"form-group"},Cee={class:"form-check form-switch"},Eee={class:"form-check-label",for:"inlineCheckboxMail"},See={class:"modal-footer sticky-footer"},Iee={class:"d-flex justify-content-end w-100"},Aee={class:"d-flex gap-2"},Dee=["disabled"],Pee={key:0,class:"spinner-border spinner-border-sm",role:"status","aria-hidden":"true"},Oee={key:1},Mee={class:"modal-dialog modal-dialog-centered"},Nee={class:"modal-content custom-modal"},Ree={class:"modal-body"},Lee={class:"mb-2"},Vee={class:"form-group p-0"},qee={class:"modal-footer d-flex justify-content-end gap-2"},Fee=["disabled"],Bee=["disabled"],Uee={key:0,class:"spinner-border spinner-border-sm",role:"status","aria-hidden":"true"},jee={key:1},Hee=CC({__name:"QuanLyQuay",setup(e){Ll();const t=Vl().params.don_vi,n=ET(),{userAuth:i}=Zs(n),{userRole:a}=Zs(n),o=xI(),{users:s}
5211=Zs(o),r=wI(),l=y1(),c=It([]),u=gt({ten:"",mota:"",trangthai:"",hoatdong:"",thutu:"",quanly:[],nhantin:"",zalo:"",mail:"",sobatdau:"",thoigianphucvu:"",donvi:t,thoigianbatdau_sang:"",thoigianketthuc_sang:"",thoigianbatdau_chieu:"",thoigianketthuc_chieu:"",autodungkhach:!1,gioihanquetma:!1,thoigiangioihan:1,dungtheosokhach:!1,sokhachtoida:0,xacnhanhengiotaiquay:!1,hengio_batdau_sang:"",hengio_ketthuc_sang:"",hengio_batdau_chieu:"",hengio_ketthuc_chieu:"",hengio_khoangcach:_C}),h=bo(()=>xC(u)),d=It(!1),f=It(null),p=It(null),g=It(!1),m=It(null);let v=null;const y=It(""),b=It(""),_=It(!1),w=It(null);let k=null;ei(async()=>{try{await Promise.all([n.getAuthUser(),n.getUserAuthRole(),o.fetchUsersByDonVi(t)]),m.value&&(v=new wV(m.value)),w.value&&(k=new wV(w.value)),await x()}catch(eRe){}});const x=async()=>{a.value.role==zT?await r.realtimeItemsForDonViAndManager(t,i.value.email):await r.realtimeItemsForDonVi(t)},T=bo(()=>r.items.filter(e=>e.hoatdong)),C=bo(()=>r.items.filter(e=>!e.hoatdong)),E=async()=>{const e=u.thoigianketthuc_sang,t=u.thoigianketthuc_chieu,n=parseInt(e.split(":")[0]),i=parseInt(e.split(":")[1]),a=parseInt(t.split(":")[0]),o=parseInt(t.split(":")[1]);if(12===n&&i>30||n>12)return void VT("Thá»i gian kết thúc buá»i sáng phải từ 00:00 Äến 12:30!");if(a<12||12===a&&o<30)return void VT("Thá»i gian kết thúc buá»i chiá»u phải từ 12:30");const s=(()=>{const e=Number(u.hengio_khoangcach);if(!Number.isFinite(e)||e<1)return"Khoảng cách giá» hẹn phải là sá» phút lá»n hÆ¡n 0!";const t=[["buá»i sáng",u.hengio_batdau_sang,u.hengio_ketthuc_sang],["buá»i chiá»u",u.hengio_batdau_chieu,u.hengio_ketthuc_chieu]];for(const[n,i,a]of t)if(i||a){if(!i||!a)return"Vui lòng nháºp Äá»§ giá» bắt Äầu và kết thúc nháºn hẹn ".concat(n,"!");if(a<=i)return"Giá» kết thúc nháºn hẹn ".concat(n," phải sau giá» bắt Äầu!")}return xC(u).length?null:"Cấu hình hẹn giá» không sinh ÄÆ°á»£c khung giá» nà o, vui lòng kiá»m tra lại!"})();if(s)VT(s);else{g.value=!0;try{d.value?await P():await D()}finally{g.value=!1}}},S=()=>{q(),d.value=!1,k||(k=new wV(w.value)),k.show()},I=e=>{b.value="",y.value=e.ten;const{id:t,...n}=e;Object.assign(u,n),v||(v=new wV(m.value)),v.show()},A=async()=>{if(b.value){_.value=!0;try{const e={...u};e.ten=b.value,delete e.id,await r.addItem(e),LT("Nhân bản quầy thà nh công!"),v.hide(),q(),await x()}catch(eRe){VT("Nhân bản quầy thất bại!")}finally{_.value=!1}}else VT("Vui lòng nháºp tên quầy má»i.")},D=async()=>{try{if(a.value.role==zT)return void VT("Bạn không có quyá»n thêm má»i!");if(u.gioihanquetma&&!u.thoigiangioihan)return void VT("Vui lòng nháºp thá»i gian giá»i hạn quét mã!");const e={...u,hoatdong:!0,hengio_khoangcach:Number(u.hengio_khoangcach),quanly:c.value.length?eC(c.value,"email"):[]};await r.addItem(e),LT("Thêm má»i quầy thà nh công!"),q(),k.hide()}catch(eRe){VT("Thêm má»i quầy thất bại!")}},P=async()=>{try{if(u.gioihanquetma&&!u.thoigiangioihan)return void VT("Vui lòng nháºp thá»i gian giá»i hạn quét mã!");const e={...u,hengio_khoangcach:Number(u.hengio_khoangcach),quanly:c.value.length?eC(c.value,"email"):[],hoatdong:!0};await r.updateItem(f.value,e),d.value=!1,f.value=null,LT("Cáºp nháºp quầy thà nh công!"),q(),k.hide()}catch(eRe){VT("Cáºp nháºp quầy thất bại!")}},O=e=>{var t;q();const{id:n,...i}=e;(null==(t=i.quanly)?void 0:t.length)&&(c.value=i.quanly.map(e=>({email:e}))),Object.assign(u,i),d.value=!0,f.value=e.id,p.value=e,k.show()},M=async(e,t)=>{if((await kO()).isConfirmed)try{const{id:n,...i}=t,a=t.quanly.filter(t=>t!==e);await r.updateItem(t.id,{...i,quanly:a}),LT("Xoá quản lý thà nh công!")}catch(eRe){VT("Xoá quản lý thất bại!")}},N=async e=>{if(a.value.role==zT)return void VT("Bạn không có quyá»n xoá!");if((await kO()).isConfirmed)try{await r.deleteItem(e.id,e),LT("Xoá quầy thà nh công!"),await x()}catch(eRe){VT("Xoá quầy thất bại!")}},R=async e=>{if(a.value.role==zT)return void VT("Bạn không có quyá»n!");if((await bO({title:"Bạn muá»n ngưng hoạt Äá»ng quầy?",text:"Quầy sẽ không hoạt Äá»ng cho tá»i khi bạn má» lại.",confirmButtonText:"Ngưng hoạt Äá»ng",nguyHiem:!0})).isConfirmed)try{const t={hoatdong:!1};await r.updateItem(e.id,t),LT("Quầy ngưng hoạt Äá»ng thà nh công!"),await x(),await q()}catch(eRe){VT("Quầy ngưng hoạt Äá»ng thất bại!")}},L=async e=>{if(a.value.role==zT)return void VT("Bạn không có quyá»n!");if((await bO({title:"Bạn muá»n khôi phục hoạt Äá»ng quầy?",text:"Quầy sẽ hoạt Äá»ng trá» lại.",confirmButtonText:"Khôi phục"})).isConfirmed)try{const t={hoatdong:!0};await r.updateItem(e.id,t),LT("Quầy khôi phục hoạt Äá»ng thà nh công!"),await x(),await q()}catch(eRe){VT("Quầy khôi phục hoạt Äá»ng thất bại!")}},V=async e=>{try{if((await wO("Reset sá» thứ tá»±",'Bạn có muá»n reset sá» thứ tá»± cá»§a quầy "'.concat(e.ten,'" không?'))).isConfirmed){const n=Ek(),i=await l.fetchKhachTrongCaLamViec(t,e.i
5211d);for(const e of i){const t={calamviec:!1,dangphucvu:!1};e.daphucvu||(t.daphucvu=n),await l.updateItem(e.id,t)}LT("Reset STT thà nh công!")}}catch(eRe){VT("Reset STT thất bại!")}},q=()=>{u.ten="",u.mota="",u.trangthai="",u.thutu="",u.quanly=[],u.nhantin="",u.zalo="",u.mail="",u.sobatdau="",u.thoigianphucvu="",u.thoigianbatdau_sang="",u.thoigianketthuc_sang="",u.thoigianbatdau_chieu="",u.thoigianketthuc_chieu="",u.autodungkhach=!1,u.gioihanquetma=!1,u.thoigiangioihan=1,u.dungtheosokhach=!1,u.sokhachtoida=0,u.xacnhanhengiotaiquay=!1,u.hengio_batdau_sang="",u.hengio_ketthuc_sang="",u.hengio_batdau_chieu="",u.hengio_ketthuc_chieu="",u.hengio_khoangcach=_C,d.value=!1,f.value=null,p.value=null,c.value=[]};return(e,t)=>(Ma(),Va("div",A8,[Ha("div",{class:"header-and-actions d-flex align-items-center mb-3 px-3 py-2"},[t[28]||(t[28]=Ha("div",{class:"header-title-wrapper flex-grow-1 text-center"},[Ha("h3",null,"QUẢN Là QUẦY")],-1)),Ha("div",{class:"actions-bar"},[Ha("button",{onClick:S,class:"btn btn-custom btn-gradient-orange"},t[27]||(t[27]=[Ha("i",{class:"fas fa-plus me-2"},null,-1),Ga(" Thêm má»i ")]))])]),Ha("div",D8,[t[44]||(t[44]=Ha("ul",{class:"nav nav-tabs",id:"quayTabs",role:"tablist"},[Ha("li",{class:"nav-item",role:"presentation"},[Ha("button",{class:"nav-link active",id:"active-tab","data-bs-toggle":"tab","data-bs-target":"#active-quays",type:"button",role:"tab","aria-controls":"active-quays","aria-selected":"true"}," Quầy Äang hoạt Äá»ng ")]),Ha("li",{class:"nav-item",role:"presentation"},[Ha("button",{class:"nav-link",id:"inactive-tab","data-bs-toggle":"tab","data-bs-target":"#inactive-quays",type:"button",role:"tab","aria-controls":"inactive-quays","aria-selected":"false"}," Quầy ngừng hoạt Äá»ng ")])],-1)),Ha("div",P8,[Ha("div",O8,[Ha("div",M8,[Ha("table",N8,[t[36]||(t[36]=Ha("thead",null,[Ha("tr",null,[Ha("th",null,"#"),Ha("th",null,"Tên quầy"),Ha("th",null,"Mô tả"),Ha("th",null,"Ngưá»i quản lý"),Ha("th",null,"Trạng thái nháºn khách"),Ha("th",null,"SMS"),Ha("th",null,"Zalo"),Ha("th",null,"Email"),Ha("th",null,"Sắp xếp"),Ha("th",null,"Hà nh Äá»ng")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(T.value,(e,n)=>(Ma(),Va("tr",{key:e.id},[Ha("td",null,ee(n+1),1),Ha("td",null,ee(e.ten),1),Ha("td",null,ee(e.mota),1),Ha("td",null,[Ha("div",R8,[(Ma(!0),Va(Sa,null,gi(e.quanly,(n,i)=>(Ma(),Va("span",{key:i,class:"chip",title:n},[Ga(ee(n)+" ",1),Ha("button",{class:"btn btn-icon btn-danger ms-1",onClick:t=>M(n,e)},t[29]||(t[29]=[Ha("i",{class:"fas fa-times"},null,-1)]),8,V8)],8,L8))),128))])]),Ha("td",null,ee(e.trangthai?"Có":"Không"),1),Ha("td",null,ee(e.nhantin?"Có":"Không"),1),Ha("td",null,ee(e.zalo?"Có":"Không"),1),Ha("td",null,ee(e.mail?"Có":"Không"),1),Ha("td",null,ee(e.thutu),1),Ha("td",null,[Ha("div",q8,[Ha("button",{class:"btn btn-icon btn-secondary",onClick:t=>I(e)},t[30]||(t[30]=[Ha("i",{class:"fas fa-copy"},null,-1)]),8,F8),Ha("button",{class:"btn btn-icon btn-primary",onClick:t=>O(e)},t[31]||(t[31]=[Ha("i",{class:"fas fa-pencil"},null,-1)]),8,B8),Ha("button",{class:"btn btn-icon btn-warning",onClick:t=>R(e)},t[32]||(t[32]=[Ha("i",{class:"fas fa-pause"},null,-1)]),8,U8),Ha("button",{class:"btn btn-icon btn-danger",onClick:t=>N(e)},t[33]||(t[33]=[Ha("i",{class:"fas fa-trash-alt"},null,-1)]),8,j8),Ha("button",{class:"btn btn-icon btn-info",onClick:t=>V(e)},t[34]||(t[34]=[Ha("i",{class:"fas fa-sync-alt"},null,-1)]),8,H8)])])]))),128)),T.value.length?Qa("",!0):(Ma(),Va("tr",z8,t[35]||(t[35]=[Ha("td",{colspan:"10",class:"text-center"},"Không có quầy Äang hoạt Äá»ng",-1)])))])])])]),Ha("div",W8,[Ha("div",K8,[Ha("table",G8,[t[43]||(t[43]=Ha("thead",null,[Ha("tr",null,[Ha("th",null,"#"),Ha("th",null,"Tên quầy"),Ha("th",null,"Mô tả"),Ha("th",null,"Ngưá»i quản lý"),Ha("th",null,"Trạng thái nháºn khách"),Ha("th",null,"SMS"),Ha("th",null,"Zalo"),Ha("th",null,"Email"),Ha("th",null,"Sắp xếp"),Ha("th",null,"Hà nh Äá»ng")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(C.value,(e,n)=>(Ma(),Va("tr",{key:e.id},[Ha("td",null,ee(n+1),1),Ha("td",null,ee(e.ten),1),Ha("td",null,ee(e.mota),1),Ha("td",null,[Ha("div",Y8,[(Ma(!0),Va(Sa,null,gi(e.quanly,(n,i)=>(Ma(),Va("span",{key:i,class:"chip",title:n},[Ga(ee(n)+" ",1),Ha("button",{class:"btn btn-icon btn-danger ms-1",onClick:t=>M(n,e)},t[37]||(t[37]=[Ha("i",{class:"fas fa-times"},null,-1)]),8,$8)],8,Q8))),128))])]),Ha("td",null,ee(e.trangthai?"Có":"Không"),1),Ha("td",null,ee(e.nhantin?"Có":"Không"),1),Ha("td",null,ee(e.zalo?"Có":"Không"),1),Ha("td",null,ee(e.mail?"Có":"Không"),1),Ha("td",null,ee(e.thutu),1),Ha("td",null,[Ha("div",X8,[Ha("button",{class:"btn btn-icon btn-secondary",onClick:t=>I(e)},t[38]||(t[38]=[Ha("i",{class:"fas fa-copy"},null,-1)]),8,J8),Ha("button",{class:"btn btn-icon btn-primary",onClick:t=>O(e)},t[39]||(t[39]=[Ha("i",{class:"fas fa-pencil"},null,-1)]),8,Z8),Ha("button",{class:"btn btn-icon btn-warning",onClick:t=>L(e)},t[40]||(t[40]=[Ha("i",{class:"fas fas fa-play"},null,-1)]),8,e7),Ha("button",{class:"btn btn-icon btn-danger",onClick:t=>N(e)}
5211,t[41]||(t[41]=[Ha("i",{class:"fas fa-trash-alt"},null,-1)]),8,t7)])])]))),128)),C.value.length?Qa("",!0):(Ma(),Va("tr",n7,t[42]||(t[42]=[Ha("td",{colspan:"10",class:"text-center"},"Không có quầy ngừng hoạt Äá»ng",-1)])))])])])])])]),Ha("div",{class:"modal fade",id:"quayModal",tabindex:"-1","aria-labelledby":"quayModalLabel",ref_key:"quayModalRef",ref:w},[Ha("div",i7,[Ha("div",a7,[Ha("div",o7,[Ha("h5",s7,ee(d.value?"Cáºp nháºt quầy":"Thêm má»i quầy"),1),t[45]||(t[45]=Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),Ha("div",r7,[d.value?(Ma(),Va("div",{key:0,class:G(["status-badge mb-3",u.hoatdong?"badge-active":"badge-inactive"])},[t[46]||(t[46]=Ha("span",{class:"status-dot"},null,-1)),Ga(" "+ee(u.hoatdong?"Äang hoạt Äá»ng":"Ngưng hoạt Äá»ng"),1)],2)):Qa("",!0),Ha("div",l7,[Ha("div",c7,[Ha("div",u7,[t[47]||(t[47]=Ha("label",{for:"unit-name",class:"form-label"},"Tên quầy",-1)),gn(Ha("input",{type:"text",class:"form-control",placeholder:"Nháºp tên quầy","onUpdate:modelValue":t[0]||(t[0]=e=>u.ten=e),required:""},null,512),[[ms,u.ten]])])]),Ha("div",h7,[Ha("div",d7,[t[48]||(t[48]=Ha("label",{for:"address",class:"form-label"},"Mô tả",-1)),gn(Ha("input",{type:"text",class:"form-control",placeholder:"Nháºp mô tả","onUpdate:modelValue":t[1]||(t[1]=e=>u.mota=e),required:""},null,512),[[ms,u.mota]])])]),Ha("div",f7,[Ha("div",p7,[t[49]||(t[49]=Ha("label",{for:"manager",class:"form-label"},"Ngưá»i quản lý",-1)),za(Ot(IO),{id:"manager",modelValue:c.value,"onUpdate:modelValue":t[2]||(t[2]=e=>c.value=e),options:Ot(s),multiple:!0,taggable:!1,"close-on-select":!1,"clear-on-select":!0,showNoResults:!1,showNoOptions:!1,selectLabel:"Chá»n ngưá»i quản lý",selectedLabel:"Äã chá»n",placeholder:"Vui lòng chá»n ngưá»i quản lý",deselectLabel:"Nhấn Äá» xoá ngưá»i quản lý Äã chá»n",label:"email","track-by":"email"},null,8,["modelValue","options"])])]),Ha("div",g7,[Ha("div",m7,[t[50]||(t[50]=Ha("label",{for:"sobatdau",class:"form-label"},"Sá» bắt Äầu",-1)),gn(Ha("input",{type:"number",min:"1",id:"sobatdau",class:"form-control",placeholder:"Nháºp sá»","onUpdate:modelValue":t[3]||(t[3]=e=>u.sobatdau=e),required:""},null,512),[[ms,u.sobatdau]])])]),Ha("div",v7,[Ha("div",y7,[t[51]||(t[51]=Ha("label",{for:"thoigianphucvu",class:"form-label"},"Thá»i gian phục vụ",-1)),gn(Ha("input",{type:"number",min:"1",id:"thoigianphucvu",class:"form-control",placeholder:"Nháºp phút","onUpdate:modelValue":t[4]||(t[4]=e=>u.thoigianphucvu=e),required:""},null,512),[[ms,u.thoigianphucvu]])])]),Ha("div",b7,[Ha("div",_7,[t[52]||(t[52]=Ha("label",{for:"thutu",class:"form-label"},"Sắp xếp",-1)),gn(Ha("input",{type:"number",min:"1",id:"thutu",class:"form-control",placeholder:"Nháºp thứ tá»±","onUpdate:modelValue":t[5]||(t[5]=e=>u.thutu=e),required:""},null,512),[[ms,u.thutu]])])]),Ha("div",w7,[Ha("div",k7,[t[53]||(t[53]=Ha("label",{class:"form-label"},"Trạng thái nháºn khách",-1)),Ha("div",x7,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"inlineCheckboxStatus","onUpdate:modelValue":t[6]||(t[6]=e=>u.trangthai=e)},null,512),[[vs,u.trangthai]]),Ha("label",T7,ee(u.trangthai?"Có":"Không"),1)])])]),Ha("div",C7,[Ha("div",E7,[t[54]||(t[54]=Ha("label",{for:"thoigianbatdau_sang",class:"form-label"},"Thá»i gian bắt Äầu buá»i sáng",-1)),gn(Ha("input",{type:"time",min:"00:00",max:"12:30",id:"thoigianbatdau_sang",class:"form-control","onUpdate:modelValue":t[7]||(t[7]=e=>u.thoigianbatdau_sang=e),required:""},null,512),[[ms,u.thoigianbatdau_sang]])])]),Ha("div",S7,[Ha("div",I7,[t[55]||(t[55]=Ha("label",{for:"thoigianketthuc_sang",class:"form-label"},"Thá»i gian kết thúc buá»i sáng",-1)),gn(Ha("input",{type:"time",min:"00:00",max:"12:30",id:"thoigianketthuc_sang",class:"form-control","onUpdate:modelValue":t[8]||(t[8]=e=>u.thoigianketthuc_sang=e),required:""},null,512),[[ms,u.thoigianketthuc_sang]])])]),Ha("div",A7,[Ha("div",D7,[t[56]||(t[56]=Ha("label",{for:"thoigianbatdau_chieu",class:"form-label"},"Thá»i gian bắt Äầu buá»i chiá»u",-1)),gn(Ha("input",{type:"time",min:"12:30",id:"thoigianbatdau_
5211chieu",class:"form-control","onUpdate:modelValue":t[9]||(t[9]=e=>u.thoigianbatdau_chieu=e),required:""},null,512),[[ms,u.thoigianbatdau_chieu]])])]),Ha("div",P7,[Ha("div",O7,[t[57]||(t[57]=Ha("label",{for:"thoigianketthuc_chieu",class:"form-label"},"Thá»i gian kết thúc buá»i chiá»u",-1)),gn(Ha("input",{type:"time",min:"12:30",id:"thoigianketthuc_chieu",class:"form-control","onUpdate:modelValue":t[10]||(t[10]=e=>u.thoigianketthuc_chieu=e),required:""},null,512),[[ms,u.thoigianketthuc_chieu]])])]),t[74]||(t[74]=Ha("div",{class:"col-12 mb-2"},[Ha("p",{class:"m-0"},[Ha("strong",{class:"text-secondary mt-1 ms-1 d-block"},"Dừng nháºn khách")])],-1)),Ha("div",M7,[Ha("div",N7,[t[58]||(t[58]=Ha("label",{class:"form-label"},"Tá»± Äá»ng dừng nháºn khách",-1)),Ha("div",R7,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"inlineCheckboxAutoPause","onUpdate:modelValue":t[11]||(t[11]=e=>u.autodungkhach=e)},null,512),[[vs,u.autodungkhach]]),Ha("label",L7,ee(u.autodungkhach?"Có":"Không"),1)])])]),Ha("div",V7,[Ha("div",q7,[t[59]||(t[59]=Ha("label",{class:"form-label"},"Dừng theo sá» khách",-1)),Ha("div",F7,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"inlineCheckboxDungTheoSokhach","onUpdate:modelValue":t[12]||(t[12]=e=>u.dungtheosokhach=e)},null,512),[[vs,u.dungtheosokhach]]),Ha("label",B7,ee(u.dungtheosokhach?"Có":"Không"),1)])])]),u.dungtheosokhach?(Ma(),Va("div",U7,[Ha("div",j7,[t[60]||(t[60]=Ha("label",{for:"sokhachtoida",class:"form-label"},"Sá» khách tá»i Äa",-1)),gn(Ha("input",{id:"sokhachtoida",type:"number",class:"form-control",placeholder:"Nháºp sá» khách tá»i Äa","onUpdate:modelValue":t[13]||(t[13]=e=>u.sokhachtoida=e),min:"1"},null,512),[[ms,u.sokhachtoida]])])])):Qa("",!0),t[75]||(t[75]=Ha("div",{class:"col-12 mb-2"},[Ha("p",{class:"m-0"},[Ha("strong",{class:"text-secondary mt-1 ms-1 d-block"},"Kiá»m tra lấy sá» lần 2")])],-1)),Ha("div",H7,[Ha("div",z7,[t[61]||(t[61]=Ha("label",{class:"form-label"},"Giá»i hạn thá»i gian lấy sá»",-1)),Ha("div",W7,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"gioihanquetma","onUpdate:modelValue":t[14]||(t[14]=e=>u.gioihanquetma=e)},null,512),[[vs,u.gioihanquetma]]),Ha("label",K7,ee(u.gioihanquetma?"Có":"Không"),1)])])]),u.gioihanquetma?(Ma(),Va("div",G7,[Ha("div",Y7,[t[62]||(t[62]=Ha("label",{for:"thoigiangioihan",class:"form-label"},"Thá»i gian giá»i hạn (phút)",-1)),gn(Ha("input",{id:"thoigiangioihan",type:"number",class:"form-control",placeholder:"Nháºp thá»i gian giá»i hạn","onUpdate:modelValue":t[15]||(t[15]=e=>u.thoigiangioihan=e),min:"1"},null,512),[[ms,u.thoigiangioihan]])])])):Qa("",!0),t[76]||(t[76]=Ha("div",{class:"col-12 mb-2"},[Ha("p",{class:"m-0"},[Ha("strong",{class:"text-secondary mt-1 ms-1 d-block"},"Hẹn giá» giao dá»ch")])],-1)),Ha("div",Q7,[Ha("div",$7,[t[63]||(t[63]=Ha("label",{class:"form-label"},"Quầy tá»± xác nháºn hẹn giá»",-1)),Ha("div",X7,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"xacnhanhengiotaiquay","onUpdate:modelValue":t[16]||(t[16]=e=>u.xacnhanhengiotaiquay=e)},null,512),[[vs,u.xacnhanhengiotaiquay]]),Ha("label",J7,ee(u.xacnhanhengiotaiquay?"Có":"Không"),1)])])]),Ha("div",Z7,[Ha("div",eee,[t[64]||(t[64]=Ha("label",{for:"hengio_khoangcach",class:"form-label"},"Khoảng cách giá» hẹn (phút)",-1)),gn(Ha("input",{id:"hengio_khoangcach",type:"number",min:"1",max:"240",class:"form-control",placeholder:"Nháºp sá» phút","onUpdate:modelValue":t[17]||(t[17]=e=>u.hengio_khoangcach=e)},null,512),[[ms,u.hengio_khoangcach]])])]),Ha("div",tee,[Ha("div",nee,[t[65]||(t[65]=Ha("label",{for:"hengio_batdau_sang",class:"form-label"},"Nháºn hẹn từ (sáng)",-1)),gn(Ha("input",{type:"time",id:"hengio_batdau_sang",class:"form-control","onUpdate:modelValue":t[18]||(t[18]=e=>u.hengio_batdau_sang=e)},null,512),[[ms,u.hengio_batdau_sang]])])]),Ha("div",iee,[Ha("div",aee,[t[66]||(t[66]=Ha("label",{for:"hengio_ketthuc_sang",class:"form-label"},"Nháºn hẹn Äến (sáng)",-1)),gn(Ha("input",{type:"time",id:"hengio_ketthuc_sang",class:"form-control","onUpdate:modelValue":t[19]||(t[19]=e=>u.hengio_ketthuc_sang=e)},null,512),[[ms,u.hengio_ketthuc_sang]])])]),Ha("div",oee,[Ha("div",see,[t[67]||(t[67]=Ha("label",{for:"hengio_batdau_chieu",class:"form-label"},"Nháºn hẹn từ (chiá»u)",-1)),gn(Ha("input",{type:"time",id:"hengio_batdau_chieu",class:"form-control","onUpdate:modelValue":t[20]||(t[20]=e=>u.hengio_batdau_chieu=e)},null,512),[[ms,u.hengio_batdau_chieu]])])]),Ha("div",ree,[Ha("div",lee,[t[68]||(t[68]=Ha("label",{for:"hengio_ketthuc_chieu",class:"form-label"},"Nháºn hẹn Äến (chiá»u)",-1)),gn(Ha("input",{type:"time",id:"hengio_ketthuc_chieu",class:"form-control","onUpdate:modelValue":t[21]||(t[21]=e=>u.hengio_ketthuc_chieu=e)},null,512),[[ms,u.hengio_ketthuc_chieu]])])]),Ha("div",cee,[Ha("div",uee,[t[69]||(t[69]=Ha("label",{class:"form-label"},"Khung giá» công dân sẽ thấy",-1)),Ha("p",hee,[h.value.length?(Ma(),Va("span",dee,[Ga(ee(h.value.length)+" khung giá»: "+ee(h.value.slice(0,6).join(", ")),1),h.value.length>6?(Ma(),Va("span",fee,", ...")):Qa("",!0)])):(Ma(),Va("span",pee,"Không sinh ÄÆ°á»£c khung giá» nà o, kiá»m tra lại giá» bắt Äầu/kết thúc."))]),t[70]||(t[70]=Ha("p",{class:"form-text m-0 text-muted"},"Äá» trá»ng các ô giá» sẽ lấy theo giá» là m viá»c cá»§a quầy.",-1))])]),t[77]||(t[77]=Ha("div",{class:"col-12 mb-2"},[Ha("p",{class:"m-0"},[Ha("strong",{class:"text-secondary mt-1 ms-1 d-block"},"Chá»n phương tiá»n gá»i vé Äiá»n tá»")])],-1)),Ha("div",gee,[Ha("div",mee,[t[71]||(t[71]=Ha("label",{class:"form-label"},"SMS",-1)),Ha("div",vee,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"inlineCheckboxMessage","onUpdate:modelValue":t[22]||(t[22]=e=>u.nhantin=e)},null,512),[[vs,u.nhantin]]),Ha("label",yee,ee(u.nhantin?"Có":"Không"),1)])])]),Ha("div",bee,[Ha("div",_ee,[t[72]||(t[72]=Ha("label",{class:"form-label"},"Zalo",-1)),Ha("div",wee,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"inlineCheckboxZalo","onUpdate:modelValue":t[23]||(t[23]=e=>u.zalo=e)},null,512),[[vs,u.zalo]]),Ha("label",kee,ee(u.zalo?"Có":"Không"),1)])])]),Ha("div",xee,[Ha("div",Tee,[t[73]||(t[73]=Ha("label",{class:"form-label"},"Email",-1)),Ha("div",Cee,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"inlineCheckboxMail","onUpdate:modelValue":t[24]||(t[24]=e=>u.mail=e)},null,512),[[vs,u.mail]]),Ha("label",Eee,ee(u.mail?"Có":"Không"),1)])])])])]),Ha("div",See,[Ha("div",Iee,[Ha("div",Aee,[Ha("button",{type:"type",onClick:E,class:"btn btn-custom btn-gradient-orange",disabled:g.value||!d.value&&Ot(a).role==Ot(zT)},[g.value?(Ma(),Va("span",Pee)):(Ma(),Va("span",Oee,ee(d.value?"Cáºp nháºt":"Thêm má»i"),1))],8,Dee),d.value?(Ma(),Va("button",{key:0,t
5211ype:"button",class:"btn btn-custom btn-gradient-info",onClick:t[25]||(t[25]=e=>V(p.value))},t[78]||(t[78]=[Ha("i",{class:"fas fa-sync-alt me-2"},null,-1),Ga("Reset STT ")]))):Qa("",!0)])])])])])],512),Ha("div",{class:"modal fade",id:"cloneQuayModal",tabindex:"-1","aria-labelledby":"cloneQuayModalLabel",ref_key:"cloneQuayModalRef",ref:m},[Ha("div",Mee,[Ha("div",Nee,[t[81]||(t[81]=Ha("div",{class:"modal-header custom-header header-gray"},[Ha("h5",{class:"modal-title",id:"cloneQuayModalLabel"},"Nhân bản Quầy"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("form",{onSubmit:Es(A,["prevent"])},[Ha("div",Ree,[Ha("p",Lee,[t[79]||(t[79]=Ga("Bạn Äang nhân bản quầy: ")),Ha("strong",null,ee(y.value),1)]),Ha("div",Vee,[t[80]||(t[80]=Ha("label",{for:"new-quay-name",class:"form-label"},"Tên quầy má»i",-1)),gn(Ha("input",{type:"text",id:"new-quay-name",class:"form-control","onUpdate:modelValue":t[26]||(t[26]=e=>b.value=e),placeholder:"Nháºp tên quầy má»i",required:""},null,512),[[ms,b.value]])])]),Ha("div",qee,[Ha("button",{type:"button",class:"btn btn-custom btn-gradient-blue","data-bs-dismiss":"modal",disabled:_.value},"Äóng",8,Fee),Ha("button",{type:"submit",class:"btn btn-custom btn-gradient-orange",disabled:_.value},[_.value?(Ma(),Va("span",Uee)):(Ma(),Va("span",jee,"Nhân bản"))],8,Bee)])],32)])])],512)]))}},[["__scopeId","data-v-c2af9197"]]),zee=m1("capSoThuTu"),Wee=async(e,t)=>{const{stt:n}=await zee({donvi:e,quay:t});return n},Kee=Js("qrcodeStore",{state:()=>({items:[],item:null}),actions:{fetchItemById:async e=>await yT("qrcode",e),async realtimeCheckQrcodeForQrcode(e){await TT("qrcode",[["donvi","==",e],["daquet","==",!1]],["taoluc","desc"],1,e=>{this.item=e[0]})},async addItem(e){await _T("qrcode",e)},async updateItem(e,t){await wT("qrcode",e,t)}}}),Gee=Js("thongkeStore",{state:()=>({items:[],item:null}),actions:{async fetchItems(){this.items=await vT("thong_ke")},async fetchItemsByDonVi(e){this.items=await vT("thong_ke",[["donvi","==",e]])},async fetchItemsByDonViAnQuay(e,t){this.items=await vT("thong_ke",[["donvi","==",e],["quay","==",t]])}}}),Yee=Js("goisoStore",{state:()=>({items:[],item:null}),actions:{async fetchItems(){this.items=await vT("goi_so")},async fetchItemsByDonVi(e){this.items=await vT("goi_so",[["donvi","==",e]],["taoluc","desc"])},fetchItemById:async e=>await yT("goi_so",e),async addItem(e){await _T("goi_so",e)},async deleteItem(e){await kT("goi_so",e)},async deleteAllItems(e){await this.fetchItemsByDonVi(e),await Promise.all(this.items.map(e=>kT("goi_so",e.id))),this.items=[]},async synthesizeSpeech({donvi:e,content:t,voiceName:n,rate:i,pitch:a,volume:o}){var s;try{const s=await _I.post("/tongHopGiongNoi",{donvi:e,content:t,voiceName:n,rate:i,pitch:a,volume:o});if(s.data&&s.data.audioContent)return s.data.audioContent;throw new Error("Invalid response from Google API")}catch(eRe){if("string"==typeof(null==(s=eRe.response)?void 0:s.data))throw new Error(eRe.response.data);throw eRe}}}}),Qee={key:0,class:"content-phatamthanh"},$ee={key:0,class:"form-card"},Xee={class:"form-content"},Jee={key:0,class:"form-group"},Zee=["value"],ete={key:1,class:"form-group"},tte=["value"],nte={class:"form-group"},ite=CC({__name:"PhatAmThanh",emits:["sound-started"],setup(e,{emit:t}){const n=Vl().params.don_vi,i=Yee(),a=JT(),{item:o}=Zs(a),s=wI(),{items:r}=Zs(s),l=It([]),c=It(!1),u=It(!1),h=It([]),d=It(null),f=window.speechSynthesis,p=It([{name:"vi-VN-Neural2-D",gender:"Nam",type:"Neural2"},{name:"vi-VN-Neural2-A",gender:"Nữ",type:"Neural2"},{name:"vi-VN-Wavenet-D",gender:"Nam",type:"WaveNet"},{name:"vi-VN-Wavenet-C",gender:"Nữ",type:"WaveNet"},{name:"vi-VN-Wavenet-B",gender:"Nam",type:"WaveNet"},{name:"vi-VN-Wavenet-A",gender:"Nữ",type:"WaveNet"},{name:"vi-VN-Standard-D",gender:"Nam",type:"Chuẩn"},{name:"vi-VN-Standard-C",gender:"Nữ",type:"Chuẩn"},{name:"vi-VN-Standard-B",gender:"Nam",type:"Chuẩn"},{name:"vi-VN-Standard-A",gender:"Nữ",type:"Chuẩn"}]),g=It("vi-VN-Neural2-D"),m=It([]),v=It(!0);let y=null,b=0;const _=t;let w=null,k=!1;const x=["click","touchend","keydown"],T=()=>(w||(w=new Audio),w),C=()=>{const e=T();e.src="data:audio/wav;base64,UklGRnQAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YVAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgA==";try{const t=e.play();t&&t.catch&&t.catch(()=>{})}catch(t){}},E=()=>
5211{k&&(k=!1,x.forEach(e=>document.removeEventListener(e,E,!0)),C())},S=e=>new Promise((t,n)=>{const i=T();let a=!1;const o=e=>{a||(a=!0,clearTimeout(s),i.onended=null,i.onerror=null,e?n(e):t())},s=setTimeout(()=>{i.pause(),o(new Error("Quá thá»i gian phát âm thanh"))},45e3);i.onended=()=>o(),i.onerror=()=>o(new Error("Lá»i khi phát file âm thanh")),i.src=e;try{const e=i.play();e&&e.catch&&e.catch(e=>{e&&"NotAllowedError"===e.name&&(k||(k=!0,VT("Trình duyá»t Äang chặn âm thanh. Chạm và o mà n hình Äá» báºt lại."),x.forEach(e=>document.addEventListener(e,E,!0)))),o(e)})}catch(r){o(r)}});let I=[];const A=()=>{I.forEach(e=>e&&e()),I=[]},D=()=>{v.value=!1,_("sound-started")};Zn(()=>{P()}),ei(async()=>{f.onvoiceschanged=P,await Promise.all([a.fetchItemById(n),s.fetchItemsByDonVi(n)]),N(),g.value=localStorage.getItem("google_voice")||"vi-VN-Neural2-D"}),ai(()=>{A(),V(),f.cancel(),x.forEach(e=>document.removeEventListener(e,E,!0)),w&&w.pause()});const P=()=>{h.value=f.getVoices(),an(()=>{O.value.length>0&&(d.value=O.value.find(e=>e.voiceURI==localStorage.getItem("voice"))||O.value[1]||O.value[0])})},O=bo(()=>h.value.filter(e=>"vi-VN"===e.lang)),M=bo(()=>r.value.filter(e=>e.hoatdong).map(e=>({id:e.id,name:"Quầy ".concat(e.ten)}))),N=()=>{const e=localStorage.getItem("selected_quay_".concat(n));if(e)try{const t=JSON.parse(e);m.value=M.value.filter(e=>t.includes(e.id))}catch(eRe){m.value=[]}else m.value=[]};pa(r,()=>{r.value.length>0&&N()},{immediate:!0}),pa(m,e=>{const t=e.map(e=>e.id);localStorage.setItem("selected_quay_".concat(n),JSON.stringify(t))},{deep:!0});const R=async e=>{for(const t of e.docChanges())"added"===t.type&&(b=Date.now(),l.value.push(t.doc.get("noidung")),await wk(t.doc.ref),u.value||B())},L=bo(()=>{var e,t;const n=((null==(e=o.value)?void 0:e.thongbao_dinhky_noidung)||"").trim();if(!(null==(t=o.value)?void 0:t.thongbao_dinhky_enabled)||!n)return null;const i=Number(o.value.thongbao_dinhky_phut);return{noiDung:n,phut:Number.isFinite(i)&&i>0?Math.floor(i):15}}),V=()=>{y&&(clearInterval(y),y=null)},q=()=>{V();const e=L.value;e&&(y=setInterval(()=>{!L.value||Date.now()-b>9e5||pC(null,o.value,new Date,!0)||(l.value.push(e.noiDung),u.value||B())},6e4*e.phut))};pa(L,()=>{c.value&&q()});const F=async()=>{C(),await i.deleteAllItems(n),c.value=!0,l.value.unshift("Há» thá»ng phát âm thanh Äã hoạt Äá»ng"),B(),"google"===o.value.sound_provider?localStorage.setItem("google_voice",g.value):localStorage.setItem("voice",d.value.voiceURI),_("sound-started");const e=localStorage.getItem("selected_quay_".concat(n));let t=[];if(e)try{t=JSON.parse(e)||[]}catch(eRe){t=[]}const a=t.length?(s=t,r=10,Array.from({length:Math.ceil(s.length/r)},(e,t)=>s.slice(t*r,t*r+r))):[null];var s,r;A(),I=a.map(e=>{const t=[Jw("donvi","==",n)];return e&&t.push(Jw("quay","in",e)),t.push(tk("taoluc")),xk($w(cw(sT,"goi_so"),...t),R)}),q()},B=()=>{l.value.length>0&&c.value&&!u.value&&(u.value=!0,U(l.value[0]).catch(e=>{}).finally(()=>{l.value.shift(),u.value=!1,B()}))},U=e=>"google"===o.value.sound_provider?j(e):H(e),j=async e=>{var t,n,a;let s;try{s=await i.synthesizeSpeech({donvi:o.value.id,content:e,voiceName:g.value,rate:null==(t=o.value)?void 0:t.tocdoamthanh,pitch:null==(n=o.value)?void 0:n.pitchamthanh,volume:null==(a=o.value)?void 0:a.volumeamthanh})}catch(r){throw VT("Lá»i Google API: ".concat(r.message)),r}try{await S("data:audio/mp3;base64,".concat(s))}catch(r){throw"NotAllowedError"!==(null==r?void 0:r.name)&&VT("Lá»i khi phát file âm thanh từ Google."),r}},H=e=>new Promise((t,n)=>{var i,a,s;let r;if(!d.value)return r=new Error("Không tìm thấy giá»ng Äá»c phù hợp"),VT(r.message),void n(r);const l=function(e,t={}){const{pitch:n=1,rate:i=1,volume:a=1,window:o=TB}=t,s=o&&o.speechSynthesis,r=EB(()=>s),l=It(!1),c=It("init"),u=xB(e||""),h=xB(t.lang||"en-US"),d=At(void 0),f=e=>{e.lang=Mt(h),e.voice=Mt(t.voice)||null,e.pitch=Mt(n),e.rate=Mt(i),e.volume=a,e.onstart=()=>{l.value=!0,c.value="play"},e.onpause=()=>{l.value=!1,c.value="pause"},e.onresume=()=>{l.value=!0,c.value="play"},e.onend=()=>{l.value=!1,c.value="end"},e.onerror=e=>{d.value=e}},p=bo(()=>{l.value=!1,c.value="init";const e=new SpeechSynthesisUtterance(u.value);return f(e),e});return r.value&&(f(p.value),pa(h,e=>{p.value&&!l.value&&(p.value.lang=e)}),t.voice&&pa(t.voice,()=>{s.cancel()}),pa(l,()=>{l.value?s.resume():s.pause()})),bB(()=>{l.value=!1}),{isSupported:r,isPlaying:l,status:c,utterance:p,error:d,stop:()=>{s.cancel(),l.value=!1},toggle:(e=!l.value)=>{l.value=e},speak:()=>{s.cancel(),p&&s.speak(p.value)}}}(e,{voice:d.value,pitch:(null==(i=null==o?void 0:o.value)?void 0:i.pitchamthanh)||1,rate:(null==(a=null==o?void 0:o.value)?void 0:a.tocdoamthanh)||1,volume:(null==(s=null==o?void 0:o.value)?void 0:s.volumeamthanh)||1});let c=!1;const u=e=>{c||(c=!0,clearTimeout(g),h(),p(),e?n(e):t())},h=pa(l.status,e=>
5211{"error"===e&&(r=new Error("Lá»i há» thá»ng phát âm thanh trình duyá»t"),VT(r.message),u(r))}),p=pa(()=>l.isPlaying.value,e=>{e||u()}),g=setTimeout(()=>{f.cancel(),u()},Math.min(45e3,Math.max(15e3,250*e.length)));l.speak()});return(e,t)=>v.value?(Ma(),Va("div",Qee,[c.value?Qa("",!0):(Ma(),Va("div",$ee,[Ha("div",Xee,[Ot(o).sound_provider&&"default"!==Ot(o).sound_provider?Qa("",!0):(Ma(),Va("div",Jee,[t[3]||(t[3]=Ha("label",{for:"voices",class:"form-label"},"Chá»n giá»ng nói (trình duyá»t)",-1)),gn(Ha("select",{id:"voices","onUpdate:modelValue":t[0]||(t[0]=e=>d.value=e),class:"form-input"},[(Ma(!0),Va(Sa,null,gi(O.value,e=>(Ma(),Va("option",{key:e.voiceURI,value:e},ee(e.name)+" ("+ee(e.lang)+") ",9,Zee))),128))],512),[[_s,d.value]])])),"google"===Ot(o).sound_provider?(Ma(),Va("div",ete,[t[4]||(t[4]=Ha("label",{for:"google-voices",class:"form-label"},"Chá»n giá»ng nói (Google)",-1)),gn(Ha("select",{id:"google-voices","onUpdate:modelValue":t[1]||(t[1]=e=>g.value=e),class:"form-input"},[(Ma(!0),Va(Sa,null,gi(p.value,e=>(Ma(),Va("option",{key:e.name,value:e.name},ee(e.gender)+" - "+ee(e.type)+" ("+ee(e.name)+") ",9,tte))),128))],512),[[_s,g.value]])])):Qa("",!0),Ha("div",nte,[t[5]||(t[5]=Ha("label",{class:"form-label"},"Chá»n danh sách các quầy Äá» phát âm thanh",-1)),za(Ot(IO),{modelValue:m.value,"onUpdate:modelValue":t[2]||(t[2]=e=>m.value=e),options:M.value,multiple:!0,taggable:!1,"close-on-select":!1,"clear-on-select":!0,showNoResults:!1,showNoOptions:!1,selectLabel:"Chá»n quầy",selectedLabel:"Äã chá»n",placeholder:"Tất cả quầy (mặc Äá»nh)",deselectLabel:"Nhấn Äá» xoá quầy Äã chá»n",label:"name","track-by":"id",class:"multiselect-custom"},null,8,["modelValue","options"]),t[6]||(t[6]=Ha("small",{class:"form-text text-muted"},"Äá» trá»ng Äá» phát âm thanh cho tất cả quầy",-1))]),Ha("div",{class:"button-group"},[Ha("button",{onClick:F,class:"form-button btn-sound"}," Báºt âm thanh "),Ha("button",{onClick:D,class:"form-button btn-mute"}," Không báºt âm thanh ")])])]))])):Qa("",!0)}},[["__scopeId","data-v-50623f06"]]),ate={class:"modal-dialog"},ote={class:"modal-content custom-modal"},ste={class:"modal-body"},rte=CC({__name:"SoundModal",props:{showButton:{type:Boolean,default:!0}},emits:["sound-started"],setup(e,{expose:t,emit:n}){const i=n,a=It(null);let o=null;const s=()=>{o=new wV(a.value),o.show()};t({openSoundModal:s});const r=()=>{i("sound-started"),o&&o.hide()};return(t,n)=>(Ma(),Va(Sa,null,[e.showButton?(Ma(),Va("button",{key:0,class:"sound-btn",onClick:s},n[0]||(n[0]=[Ha("i",{class:"fas fa-volume-up text-light"},null,-1)]))):Qa("",!0),Ha("div",{class:"modal fade",id:"soundModal",tabindex:"-1","aria-labelledby":"soundModalLabel",ref_key:"soundModalRef",ref:a},[Ha("div",ate,[Ha("div",ote,[n[1]||(n[1]=Ha("div",{class:"modal-header custom-header"},[Ha("h5",{class:"modal-title",id:"soundModalLabel"},"Cà i Äặt âm thanh"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("div",ste,[za(ite,{onSoundStarted:r})])])])],512)],64))}},[["__scopeId","data-v-6f686647"]]),lte={key:0,class:"voice-assistant-modal"},cte={class:"voice-assistant-container"},ute={key:0,class:"fas fa-microphone"},hte={key:1,class:"fas fa-times"},dte={key:0,class:"voice-content"},fte={class:"voice-controls"},pte=["disabled"],gte={key:0,class:"fas fa-microphone"},mte={key:1,class:"fas fa-stop"},vte={key:2,class:"fas fa-spinner fa-spin"},yte={class:"voice-status"},bte={key:0,class:"status-text"},_te={key:1,class:"status-text recording"},wte={key:2,class:"status-text processing"},kte={key:0,class:"conversation-area"},xte={key:0,class:"voice-transcript"},Tte={class:"message-text"},Cte={key:1,class:"voice-response"},Ete={class:"message-text"},Ste={class:"quick-actions-section"},Ite={class:"quick-actions"},Ate=["onClick"],Dte=CC({__name:"VoiceAssistantModal",props:{activeCounters:{type:Number,default:0},waitingCustomers:{type:Number,default:0}},setup(e){const t=It(!0),n=It(!1),i=It(!1),a=It(!1),o=It(""),s=It("");let r=null;const l=It([{id:"how-to-get-search-kqhs",icon:"fas fa-clipboard-check",text:"Tra cứu kết quả há» sÆ¡",question:"Là m thế nà o Äá» tra cứu kết quả há» sÆ¡?"},{id:"how-to-get-search-thutuc",icon:"fas fa-search",text:"Tra cứu thá»§ tục hà nh chÃnh",question:"Là m thế nà o Äá» tra cứu thá»§ tục hà nh chÃnh?"},{id:"how-to-get-danhgia",icon:"fas fa-star",text:"Äánh giá cán bá» công chức",question:"Là m thế nà o Äá» Äánh giá cán bá» công chức?"},{id:"how-to-get-comment",icon:"fas fa-comment-dots",text:"Phản ánh, kiến nghá»",question:"Là m thế nà o Äá» phản ánh, kiến nghá»?"},{id:"how-to-get-download",icon:"fas fa-download",text:"Tải và in biá»u mẫu",question:"Là m thế nà o Äá» tải và in biá»u mẫu?"},{id:"how-to-get-payment",icon:"fas fa-credit-card",text:"Thanh toán trá»±c tuyến",question:"Là m thế nà o Äá» thanh toán trá»±c tuyến?"},{id:"queue-status",icon:"fas fa-clock",text:"Tình trạng xếp hà ng",question:"Còn bao nhiêu ngưá»i Äang chá»?"},{id:"counter-info",icon:"fas fa-desktop",text:"Quầy hoạt Äá»ng",question:"Quầy nà o Äang hoạt Äá»ng?"},{id:"how-to-get-number",icon:"fas fa-qrcode",text:"Cách lấy sá»",question:"Là m thế nà o Äá» lấy sá» thứ tá»±?"},{id:"how-to-get-calendar",icon:"fas fa-calendar-check",text:"Äặt lá»ch hẹn",question:"Là m thế nà o Äá» Äặt lá»ch hẹn?"}]),c=()=>
5211{n.value=!n.value,n.value||(d(),o.value="",s.value="")},u=async()=>{i.value?d():await h()},h=async()=>{try{if(!("webkitSpeechRecognition"in window)&&!("SpeechRecognition"in window))return void VT("Trình duyá»t không há» trợ nháºn dạng giá»ng nói.");const e=window.SpeechRecognition||window.webkitSpeechRecognition;r=new e,r.lang="vi-VN",r.continuous=!1,r.interimResults=!1,r.onstart=()=>{i.value=!0,o.value="",s.value=""},r.onresult=e=>{const t=e.results[0][0].transcript;o.value=t,i.value=!1,a.value=!0,f().finally(()=>{a.value=!1})},r.onerror=e=>{i.value=!1,a.value=!1,VT("Lá»i nháºn dạng giá»ng nói: "+e.error)},r.onend=()=>{i.value=!1},r.start()}catch(eRe){VT("Không thá» khá»i tạo nháºn dạng giá»ng nói.")}},d=()=>{if(r)try{r.stop()}catch(eRe){i.value=!1,a.value=!1}},f=async()=>{await new Promise(e=>setTimeout(e,500)),o.value?(o.value.toLowerCase(),s.value="Chức nÄng Äang cáºp nháºp theo mô hình chÃnh quyá»n 2 cấp"):s.value="Không nháºn ÄÆ°á»£c ná»i dung câu há»i. Vui lòng thá» lại."};return ii(()=>{if(r)try{r.stop()}catch(eRe){}}),(e,r)=>t.value?(Ma(),Va("div",lte,[Ha("div",cte,[Ha("button",{class:G(["voice-toggle-btn",{expanded:n.value}]),onClick:c},[n.value?Qa("",!0):(Ma(),Va("i",ute)),n.value?(Ma(),Va("i",hte)):Qa("",!0)],2),n.value?(Ma(),Va("div",dte,[r[3]||(r[3]=Ha("div",{class:"voice-header"},[Ha("h4",null,[Ha("i",{class:"fas fa-robot"}),Ga(" Trợ lý giá»ng nói ")])],-1)),Ha("div",fte,[Ha("button",{class:G(["voice-button",{recording:i.value,processing:a.value}]),onClick:u,disabled:a.value},[i.value||a.value?Qa("",!0):(Ma(),Va("i",gte)),i.value?(Ma(),Va("i",mte)):Qa("",!0),a.value?(Ma(),Va("i",vte)):Qa("",!0)],10,pte),Ha("div",yte,[i.value||a.value?Qa("",!0):(Ma(),Va("p",bte," Nhấn Äá» há»i Äáp ")),i.value?(Ma(),Va("p",_te," Äang ghi âm... ")):Qa("",!0),a.value?(Ma(),Va("p",wte," Äang xá» lý... ")):Qa("",!0)])]),o.value||s.value?(Ma(),Va("div",kte,[o.value?(Ma(),Va("div",xte,[r[0]||(r[0]=H
5211a("div",{class:"message-header"},[Ha("i",{class:"fas fa-user"}),Ha("span",null,"Bạn:")],-1)),Ha("p",Tte,ee(o.value),1)])):Qa("",!0),s.value?(Ma(),Va("div",Cte,[r[1]||(r[1]=Ha("div",{class:"message-header"},[Ha("i",{class:"fas fa-robot"}),Ha("span",null,"Trợ lý:")],-1)),Ha("p",Ete,ee(s.value),1)])):Qa("",!0)])):Qa("",!0),Ha("div",Ste,[r[2]||(r[2]=Ha("div",{class:"quick-actions-header"},[Ha("span",{class:"quick-actions-title"},[Ha("i",{class:"fas fa-question-circle"}),Ga(" Câu há»i nhanh ")])],-1)),Ha("div",Ite,[(Ma(!0),Va(Sa,null,gi(l.value,e=>(Ma(),Va("button",{key:e.id,onClick:t=>(e=>{o.value=e.question,f()})(e),class:"quick-action-btn"},[Ha("i",{class:G(e.icon)},null,2),Ha("span",null,ee(e.text),1)],8,Ate))),128))])])])):Qa("",!0)])])):Qa("",!0)}},[["__scopeId","data-v-e16aa37f"]]); 5212/*! 5213 * @kurkle/color v0.3.4 5214 * https://github.com/kurkle/color#readme 5215 * (c) 2024 Jukka Kurkela 5216 * Released under the MIT License 5217 */ 5218function Pte(e){return e+.5|0}const Ote=(e,t,n)=>Math.max(Math.min(e,n),t);function Mte(e){return Ote(Pte(2.55*e),0,255)}function Nte(e){return Ote(Pte(255*e),0,255)}function Rte(e){return Ote(Pte(e/2.55)/100,0,1)}function Lte(e){return Ote(Pte(100*e),0,100)}const Vte={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},qte=[..."0123456789ABCDEF"],Fte=e=>qte[15&e],Bte=e=>qte[(240&e)>>4]+qte[15&e],Ute=e=>(240&e)>>4==(15&e);function jte(e){var t=(e=>Ute(e.r)&&Ute(e.g)&&Ute(e.b)&&Ute(e.a))(e)?Fte:Bte;return e?"#"+t(e.r)+t(e.g)+t(e.b)+((e,t)=>e<255?t(e):"")(e.a,t):void 0}const Hte=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function zte(e,t,n){const i=t*Math.min(n,1-n),a=(t,a=(t+e/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return[a(0),a(8),a(4)]}function Wte(e,t,n){const i=(i,a=(i+e/60)%6)=>n-n*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}function Kte(e,t,n){const i=zte(e,1,.5);let a;for(t+n>1&&(a=1/(t+n),t*=a,n*=a),a=0;a<3;a++)i[a]*=1-t-n,i[a]+=t;return i}function Gte(e){const t=e.r/255,n=e.g/255,i=e.b/255,a=Math.max(t,n,i),o=Math.min(t,n,i),s=(a+o)/2;let r,l,c;return a!==o&&(c=a-o,l=s>.5?c/(2-a-o):c/(a+o),r=function(e,t,n,i,a){return e===a?(t-n)/i+(t<n?6:0):t===a?(n-e)/i+2:(e-t)/i+4}(t,n,i,c,a),r=60*r+.5),[0|r,l||0,s]}function Yte(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Nte)}function Qte(e,t,n){return Yte(zte,e,t,n)}function $te(e){return(e%360+360)%360}function Xte(e){const t=Hte.exec(e);let n,i=255;if(!t)return;t[5]!==n&&(i=t[6]?Mte(+t[5]):Nte(+t[5]));const a=$te(+t[2]),o=+t[3]/100,s=+t[4]/100;return n="hwb"===t[1]?function(e,t,n){return Yte(Kte,e,t,n)}(a,o,s):"hsv"===t[1]?function(e,t,n){return Yte(Wte,e,t,n)}(a,o,s):Qte(a,o,s),{r:n[0],g:n[1],b:n[2],a:i}}const Jte={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Zte={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let ene;function tne(e){ene||(ene=function(){const e={},t=Object.keys(Zte),n=Object.keys(Jte);let i,a,o,s,r;for(i=0;i<t.length;i++){for(s=r=t[i],a=0;a<n.length;a++)o=n[a],r=r.replace(o,Jte[o]);o=parseInt(Zte[s],16),e[r]=[o>>16&255,o>>8&255,255&o]}return e}(),ene.transparent=[0,0,0,0]);const t=ene[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}const nne=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const ine=e=>
vendor: 7,460 bytes, lines 5218-5224
5218e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,ane=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function one(e,t,n){if(e){let i=Gte(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,0===t?360:1)),i=Qte(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function sne(e,t){return e?Object.assign(t||{},e):e}function rne(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Nte(e[3]))):(t=sne(e,{r:0,g:0,b:0,a:1})).a=Nte(t.a),t}function lne(e){return"r"===e.charAt(0)?function(e){const t=nne.exec(e);let n,i,a,o=255;if(t){if(t[7]!==n){const e=+t[7];o=t[8]?Mte(e):Ote(255*e,0,255)}return n=+t[1],i=+t[3],a=+t[5],n=255&(t[2]?Mte(n):Ote(n,0,255)),i=255&(t[4]?Mte(i):Ote(i,0,255)),a=255&(t[6]?Mte(a):Ote(a,0,255)),{r:n,g:i,b:a,a:o}}}(e):Xte(e)}class cne{constructor(e){if(e instanceof cne)return e;const t=typeof e;let n;var i,a,o;"object"===t?n=rne(e):"string"===t&&(o=(i=e).length,"#"===i[0]&&(4===o||5===o?a={r:255&17*Vte[i[1]],g:255&17*Vte[i[2]],b:255&17*Vte[i[3]],a:5===o?17*Vte[i[4]]:255}:7!==o&&9!==o||(a={r:Vte[i[1]]<<4|Vte[i[2]],g:Vte[i[3]]<<4|Vte[i[4]],b:Vte[i[5]]<<4|Vte[i[6]],a:9===o?Vte[i[7]]<<4|Vte[i[8]]:255})),n=a||tne(e)||lne(e)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var e=sne(this._rgb);return e&&(e.a=Rte(e.a)),e}set rgb(e){this._rgb=rne(e)}rgbString(){return this._valid?(e=this._rgb)&&(e.a<255?"rgba(".concat(e.r,", ").concat(e.g,", ").concat(e.b,", ").concat(Rte(e.a),")"):"rgb(".concat(e.r,", ").concat(e.g,", ").concat(e.b,")")):void 0;var e}hexString(){return this._valid?jte(this._rgb):void 0}hslString(){return this._valid?function(e){if(!e)return;const t=Gte(e),n=t[0],i=Lte(t[1]),a=Lte(t[2]);return e.a<255?"hsla(".concat(n,", ").concat(i,"%, ").concat(a,"%, ").concat(Rte(e.a),")"):"hsl(".concat(n,", ").concat(i,"%, ").concat(a,"%)")}(this._rgb):void 0}mix(e,t){if(e){const n=this.rgb,i=e.rgb;let a;const o=t===a?.5:t,s=2*o-1,r=n.a-i.a,l=((s*r===-1?s:(s+r)/(1+s*r))+1)/2;a=1-l,n.r=255&l*n.r+a*i.r+.5,n.g=255&l*n.g+a*i.g+.5,n.b=255&l*n.b+a*i.b+.5,n.a=o*n.a+(1-o)*i.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=function(e,t,n){const i=ane(Rte(e.r)),a=ane(Rte(e.g)),o=ane(Rte(e.b));return{r:Nte(ine(i+n*(ane(Rte(t.r))-i))),g:Nte(ine(a+n*(ane(Rte(t.g))-a))),b:Nte(ine(o+n*(ane(Rte(t.b))-o))),a:e.a+n*(t.a-e.a)}}(this._rgb,e._rgb,t)),this}clone(){return new cne(this.rgb)}alpha(e){return this._rgb.a=Nte(e),this}clearer(e){return this._rgb.a*=1-e,this}greyscale(){const e=this._rgb,t=Pte(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}opaquer(e){return this._rgb.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return one(this._rgb,2,e),this}darken(e){return one(this._rgb,2,-e),this}saturate(e){return one(this._rgb,1,e),this}desaturate(e){return one(this._rgb,1,-e),this}rotate(e){return function(e,t){var n=Gte(e);n[0]=$te(n[0]+t),n=Qte(n),e.r=n[0],e.g=n[1],e.b=n[2]}(this._rgb,e),this}} 5219/*! 5220 * Chart.js v4.4.8 5221 * https://www.chartjs.org 5222 * (c) 2025 Chart.js Contributors 5223 * Released under the MIT License 5224 */function une(){}const hne=(()=>{let e=0;return()=>e++})();function dne(e){return null==e}function fne(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return"[object"===t.slice(0,7)&&"Array]"===t.slice(-6)}function pne(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function gne(e){return("number"==typeof e||e instanceof Number)&&isFinite(+e)}function mne(e,t){return gne(e)?e:t}function vne(e,t){return void 0===e?t:e}const yne=(e,t)=>"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100*t:+e;function bne(e,t,n){if(e&&"function"==typeof e.call)return e.apply(n,t)}function _ne(e,t,n,i){let a,o,s;if(fne(e))for(o=e.length,a=0;a<o;a++)t.call(n,e[a],a);else if(pne(e))for(s=Object.keys(e),o=s.length,a=0;a<o;a++)t.call(n,e[s[a]],s[a])}function wne(e,t){let n,i,a,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(a=e[n],o=t[n],a.datasetIndex!==o.datasetIndex||a.index!==o.index)return!1;return!0}function kne(e){if(fne(e))return e.map(kne);if(pne(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let a=0;for(;a<i;++a)t[n[a]]=kne(e[n[a]]);return t}return e}function xne(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function Tne(e,t,n,i){if(!xne(e))return;const a=t[e],o=n[e];pne(a)&&pne(o)?Cne(a,o,i):t[e]=kne(o)}function Cne(e,t,n){const i=fne(t)?t:[t],a=i.length;if(!pne(e))return e;const o=(n=n||{}).merger||Tne;let s;for(let r=0;r<a;++r){if(s=i[r],!pne(s))continue;const t=Object.keys(s);for(let i=0,a=t.length;i<a;++i)o(t[i],e,s,n)}return e}function Ene(e,t){return Cne(e,t,{merger:Sne})}function Sne(e,t,n){if(!xne(e))return;const i=t[e],a=n[e];pne(i)&&pne(a)?Ene(i,a):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=kne(a))}const Ine={"":e=>e,x:e=>e.x,y:e=>e.y};function Ane(e,t){const n=Ine[t]||(Ine[t]=function(e){const t=function(e){const t=e.split("."),n=[];let i="";for(const a of t)i+=a,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}(e);return e=>{for(const n of t){if(""===n)break;e=e&&e[n]}return e}}(t));return n(e)}function Dne(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Pne=e=>void 0!==e,One=e=>"function"==typeof e,Mne=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};const Nne=Math.PI,Rne=2*Nne,Lne=Rne+Nne,Vne=Number.POSITIVE_INFINITY,qne=Nne/180,Fne=Nne/2,Bne=Nne/4,Une=2*Nne/3,jne=Math.log10,Hne=Math.sign;function zne(e,t,n){return Math.abs(e-t)<n}function Wne(e){const t=Math.round(e);e=zne(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(jne(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function Kne(e){return!function(e){return"symbol"==typeof e||"object"==typeof e&&null!==e&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Gne(e,t,n){let i,a,o;for(i=0,a=e.length;i<a;i++)o=e[i][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Yne(e){return e*(Nne/180)}function Qne(e){return e*(180/Nne)}function $ne(e){if(!gne(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Xne(e,t){const n=t.x-e.x,i=t.y-e.y,a=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*Nne&&(o+=Rne),{angle:o,distance:a}}function Jne(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Zne(e,t){return(e-t+Lne)%Rne-Nne}function eie(e){return(e%Rne+Rne)%Rne}function tie(e,t,n,i){const a=eie(e),o=eie(t),s=eie(n),r=eie(o-a),l=eie(s-a),c=eie(a-o),u=eie(a-s);return a===o||a===s||i&&o===s||r>l&&c<u}function nie(e,t,n){return Math.max(t,Math.min(n,e))}function iie(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function aie(e,t,n){n=n||(n=>e[n]<t);let i,a=e.length-1,o=0;for(;a-o>1;)i=o+a>>1,n(i)?o=i:a=i;return{lo:o,hi:a}}const oie=(e,t,n,i)=>aie(e,n,i?i=>{const a=e[i][t];return a<n||a===n&&e[i+1][t]===n}:i=>e[i][t]<n),sie=(e,t,n)=>aie(e,n,i=>e[i][t]>=n);const rie=["push","pop","shift","splice","unshift"];function lie(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,a=i.indexOf(t);-1!==a&&i.splice(a,1),i.length>0||(rie.forEach(t=>{delete e[t]}),delete e._chartjs)}function cie(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const uie="undefined"==typeof window?function(e){return e()}:window.requestAnimationFrame;function hie(e,t){let n=[],i=!1;return function(...a){n=a,i||(i=!0,uie.call(window,()=>{i=!1,e.apply(t,n)}))}}const die=e=>
vendor: 4,698 bytes, line 5224
5224"start"===e?"left":"end"===e?"right":"center",fie=(e,t,n)=>"start"===e?t:"end"===e?n:(t+n)/2;function pie(e,t,n){const i=t.length;let a=0,o=i;if(e._sorted){const{iScale:s,vScale:r,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=s.axis,{min:h,max:d,minDefined:f,maxDefined:p}=s.getUserBounds();if(f){if(a=Math.min(oie(l,u,h).lo,n?i:oie(t,u,s.getPixelForValue(h)).lo),c){const e=l.slice(0,a+1).reverse().findIndex(e=>!dne(e[r.axis]));a-=Math.max(0,e)}a=nie(a,0,i-1)}if(p){let e=Math.max(oie(l,s.axis,d,!0).hi+1,n?0:oie(t,u,s.getPixelForValue(d),!0).hi+1);if(c){const t=l.slice(e-1).findIndex(e=>!dne(e[r.axis]));e+=Math.max(0,t)}o=nie(e,a,i)-a}else o=i-a}return{start:a,count:o}}function gie(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,a={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=a,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,a),o}const mie=e=>0===e||1===e,vie=(e,t,n)=>-Math.pow(2,10*(e-=1))*Math.sin((e-t)*Rne/n),yie=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Rne/n)+1,bie={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>1-Math.cos(e*Fne),easeOutSine:e=>Math.sin(e*Fne),easeInOutSine:e=>-.5*(Math.cos(Nne*e)-1),easeInExpo:e=>0===e?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>mie(e)?e:e<.5?.5*Math.pow(2,10*(2*e-1)):.5*(2-Math.pow(2,-10*(2*e-1))),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>mie(e)?e:vie(e,.075,.3),easeOutElastic:e=>mie(e)?e:yie(e,.075,.3),easeInOutElastic(e){const t=.1125;return mie(e)?e:e<.5?.5*vie(2*e,t,.45):.5+.5*yie(2*e-1,t,.45)},easeInBack(e){const t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){const t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:e=>1-bie.easeOutBounce(1-e),easeOutBounce(e){const t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?.5*bie.easeInBounce(2*e):.5*bie.easeOutBounce(2*e-1)+.5};function _ie(e){if(e&&"object"==typeof e){const t=e.toString();return"[object CanvasPattern]"===t||"[object CanvasGradient]"===t}return!1}function wie(e){return _ie(e)?e:new cne(e)}function kie(e){return _ie(e)?e:new cne(e).saturate(.5).darken(.1).hexString()}const xie=["x","y","borderWidth","radius","tension"],Tie=["color","borderColor","backgroundColor"];const Cie=new Map;function Eie(e,t,n){return function(e,t){t=t||{};const n=e+JSON.stringify(t);let i=Cie.get(n);return i||(i=new Intl.NumberFormat(e,t),Cie.set(n,i)),i}(t,n).format(e)}const Sie={values:e=>fne(e)?e:""+e,numeric(e,t,n){if(0===e)return"0";const i=this.chart.options.locale;let a,o=e;if(n.length>1){const t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>1e15)&&(a="scientific"),o=function(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e));return n}(e,n)}const s=jne(Math.abs(o)),r=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:a,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Eie(e,i,l)},logarithmic(e,t,n){if(0===e)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(jne(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?Sie.numeric.call(this,e,t,n):""}};var Iie={formatters:Sie};const Aie=Object.create(null),Die=Object.create(null);function Pie(e,t){if(!t)return e;const n=t.split(".");for(let i=0,a=n.length;i<a;++i){const t=n[i];e=e[t]||(e[t]=Object.create(null))}return e}function Oie(e,t,n){return"string"==typeof t?Cne(Pie(e,t),n):Cne(Pie(e,""),t)}class Mie{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={}
vendor: 4,103 bytes, line 5224
5224,this.hoverBackgroundColor=(e,t)=>kie(t.backgroundColor),this.hoverBorderColor=(e,t)=>kie(t.borderColor),this.hoverColor=(e,t)=>kie(t.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return Oie(this,e,t)}get(e){return Pie(this,e)}describe(e,t){return Oie(Die,e,t)}override(e,t){return Oie(Aie,e,t)}route(e,t,n,i){const a=Pie(this,e),o=Pie(this,n),s="_"+t;Object.defineProperties(a,{[s]:{value:a[t],writable:!0},[t]:{enumerable:!0,get(){const e=this[s],t=o[i];return pne(e)?Object.assign({},t,e):vne(e,t)},set(e){this[s]=e}}})}apply(e){e.forEach(e=>e(this))}}var Nie=new Mie({_scriptable:e=>!e.startsWith("on"),_indexable:e=>"events"!==e,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>"onProgress"!==e&&"onComplete"!==e&&"fn"!==e}),e.set("animations",{colors:{type:"color",properties:Tie},numbers:{type:"number",properties:xie}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>0|e}}}})},function(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Iie.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&"callback"!==e&&"parser"!==e,_indexable:e=>"borderDash"!==e&&"tickBorderDash"!==e&&"dash"!==e}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:e=>"backdropPadding"!==e&&"callback"!==e,_indexable:e=>"backdropPadding"!==e})}]);function Rie(e,t,n,i,a){let o=t[a];return o||(o=t[a]=e.measureText(a).width,n.push(a)),o>i&&(i=o),i}function Lie(e,t,n,i){let a=(i=i||{}).data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(a=i.data={},o=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let s=0;const r=n.length;let l,c,u,h,d;for(l=0;l<r;l++)if(h=n[l],null==h||fne(h)){if(fne(h))for(c=0,u=h.length;c<u;c++)d=h[c],null==d||fne(d)||(s=Rie(e,a,o,s,d))}else s=Rie(e,a,o,s,h);e.restore();const f=o.length/2;if(f>n.length){for(l=0;l<f;l++)delete a[o[l]];o.splice(0,f)}return s}function Vie(e,t,n){const i=e.currentDevicePixelRatio,a=0!==n?Math.max(n/2,.5):0;return Math.round((t-a)*i)/i+a}function qie(e,t){(t||e)&&((t=t||e.getContext("2d")).save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Fie(e,t,n,i){Bie(e,t,n,i,null)}function Bie(e,t,n,i,a){let o,s,r,l,c,u,h,d;const f=t.pointStyle,p=t.rotation,g=t.radius;let m=(p||0)*qne;if(f&&"object"==typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return e.save(),e.translate(n,i),e.rotate(m),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void e.restore(
vendor: 19,844 bytes, lines 5224-5230
5224);if(!(isNaN(g)||g<=0)){switch(e.beginPath(),f){default:a?e.ellipse(n,i,a/2,g,0,0,Rne):e.arc(n,i,g,0,Rne),e.closePath();break;case"triangle":u=a?a/2:g,e.moveTo(n+Math.sin(m)*u,i-Math.cos(m)*g),m+=Une,e.lineTo(n+Math.sin(m)*u,i-Math.cos(m)*g),m+=Une,e.lineTo(n+Math.sin(m)*u,i-Math.cos(m)*g),e.closePath();break;case"rectRounded":c=.516*g,l=g-c,s=Math.cos(m+Bne)*l,h=Math.cos(m+Bne)*(a?a/2-c:l),r=Math.sin(m+Bne)*l,d=Math.sin(m+Bne)*(a?a/2-c:l),e.arc(n-h,i-r,c,m-Nne,m-Fne),e.arc(n+d,i-s,c,m-Fne,m),e.arc(n+h,i+r,c,m,m+Fne),e.arc(n-d,i+s,c,m+Fne,m+Nne),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,u=a?a/2:l,e.rect(n-u,i-l,2*u,2*l);break}m+=Bne;case"rectRot":h=Math.cos(m)*(a?a/2:g),s=Math.cos(m)*g,r=Math.sin(m)*g,d=Math.sin(m)*(a?a/2:g),e.moveTo(n-h,i-r),e.lineTo(n+d,i-s),e.lineTo(n+h,i+r),e.lineTo(n-d,i+s),e.closePath();break;case"crossRot":m+=Bne;case"cross":h=Math.cos(m)*(a?a/2:g),s=Math.cos(m)*g,r=Math.sin(m)*g,d=Math.sin(m)*(a?a/2:g),e.moveTo(n-h,i-r),e.lineTo(n+h,i+r),e.moveTo(n+d,i-s),e.lineTo(n-d,i+s);break;case"star":h=Math.cos(m)*(a?a/2:g),s=Math.cos(m)*g,r=Math.sin(m)*g,d=Math.sin(m)*(a?a/2:g),e.moveTo(n-h,i-r),e.lineTo(n+h,i+r),e.moveTo(n+d,i-s),e.lineTo(n-d,i+s),m+=Bne,h=Math.cos(m)*(a?a/2:g),s=Math.cos(m)*g,r=Math.sin(m)*g,d=Math.sin(m)*(a?a/2:g),e.moveTo(n-h,i-r),e.lineTo(n+h,i+r),e.moveTo(n+d,i-s),e.lineTo(n-d,i+s);break;case"line":s=a?a/2:Math.cos(m)*g,r=Math.sin(m)*g,e.moveTo(n-s,i-r),e.lineTo(n+s,i+r);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(m)*(a?a/2:g),i+Math.sin(m)*g);break;case!1:e.closePath()}e.fill(),t.borderWidth>0&&e.stroke()}}function Uie(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function jie(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Hie(e){e.restore()}function zie(e,t,n,i,a){if(!t)return e.lineTo(n.x,n.y);if("middle"===a){const i=(t.x+n.x)/2;e.lineTo(i,t.y),e.lineTo(i,n.y)}else"after"===a!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function Wie(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Kie(e,t,n,i,a){if(a.strikethrough||a.underline){const o=e.measureText(i),s=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=a.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=a.decorationWidth||2,e.moveTo(s,u),e.lineTo(r,u),e.stroke()}}function Gie(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Yie(e,t,n,i,a,o={}){const s=fne(t)?t:[t],r=o.strokeWidth>0&&""!==o.strokeColor;let l,c;for(e.save(),e.font=a.string,function(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),dne(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}(e,o),l=0;l<s.length;++l)c=s[l],o.backdrop&&Gie(e,o.backdrop),r&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),dne(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),Kie(e,n,i,c,o),i+=Number(a.lineHeight);e.restore()}function Qie(e,t){const{x:n,y:i,w:a,h:o,radius:s}=t;e.arc(n+s.topLeft,i+s.topLeft,s.topLeft,1.5*Nne,Nne,!0),e.lineTo(n,i+o-s.bottomLeft),e.arc(n+s.bottomLeft,i+o-s.bottomLeft,s.bottomLeft,Nne,Fne,!0),e.lineTo(n+a-s.bottomRight,i+o),e.arc(n+a-s.bottomRight,i+o-s.bottomRight,s.bottomRight,Fne,0,!0),e.lineTo(n+a,i+s.topRight),e.arc(n+a-s.topRight,i+s.topRight,s.topRight,0,-Fne,!0),e.lineTo(n+s.topLeft,i)}const $ie=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Xie=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Jie(e,t){const n=(""+e).match($ie);if(!n||"normal"===n[1])return 1.2*t;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100}return t*e}const Zie=e=>+e||0;function eae(e,t){const n={},i=pne(t),a=i?Object.keys(t):t,o=pne(e)?i?n=>vne(e[n],e[t[n]]):t=>e[t]:()=>e;for(const s of a)n[s]=Zie(o(s));return n}function tae(e){return eae(e,{top:"y",right:"x",bottom:"y",left:"x"})}function nae(e){return eae(e,["topLeft","topRight","bottomLeft","bottomRight"])}function iae(e){const t=tae(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function aae(e,t){e=e||{},t=t||Nie.font;let n=vne(e.size,t.size);"string"==typeof n&&(n=parseInt(n,10));let i=vne(e.style,t.style);i&&!(""+i).match(Xie)&&(i=void 0);const a={family:vne(e.family,t.family),lineHeight:Jie(vne(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:vne(e.weight,t.weight),string:""};return a.string=function(e){return!e||dne(e.size)||dne(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}(a),a}function oae(e,t,n,i){let a,o,s;for(a=0,o=e.length;a<o;++a)if(s=e[a],void 0!==s&&(void 0!==t&&"function"==typeof s&&(s=s(t)),void 0!==n&&fne(s)&&(s=s[n%s.length]),void 0!==s))return s}function sae(e,t){return Object.assign(Object.create(e),t)}function rae(e,t=[""],n,i,a=()=>e[0]){const o=n||e;void 0===i&&(i=yae("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:a,override:n=>rae([n,...e],t,o,i)};return new Proxy(s,{deleteProperty:(t,n)=>(delete t[n],delete t._keys,delete e[0][n],!0),get:(n,i)=>dae(n,i,()=>function(e,t,n,i){let a;for(const o of t)if(a=yae(uae(o,e),n),void 0!==a)return hae(e,a)?mae(n,i,e,a):a}(i,t,e,n)),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e._scopes[0],t),getPrototypeOf:()=>Reflect.getPrototypeOf(e[0]),has:(e,t)=>bae(e).includes(t),ownKeys:e=>bae(e),set(e,t,n){const i=e._storage||(e._storage=a());return e[t]=i[t]=n,delete e._keys,!0}})}function lae(e,t,n,i){const a={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:cae(e,i),setContext:t=>lae(e,t,n,i),override:a=>lae(e.override(a),t,n,i)};return new Proxy(a,{deleteProperty:(t,n)=>(delete t[n],delete e[n],!0),get:(e,t,n)=>dae(e,t,()=>function(e,t,n){const{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=e;let r=i[t];One(r)&&s.isScriptable(t)&&(r=function(e,t,n,i){const{_proxy:a,_context:o,_subProxy:s,_stack:r}=n;if(r.has(e))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+e);r.add(e);let l=t(o,s||i);r.delete(e),hae(e,l)&&(l=mae(a._scopes,a,e,l));return l}(t,r,e,n));fne(r)&&r.length&&(r=function(e,t,n,i){const{_proxy:a,_context:o,_subProxy:s,_descriptors:r}=n;if(void 0!==o.index&&i(e))return t[o.index%t.length];if(pne(t[0])){const n=t,i=a._scopes.filter(e=>e!==n);t=[];for(const l of n){const n=mae(i,a,e,l);t.push(lae(n,o,s&&s[e],r))}}return t}(t,r,e,s.isIndexable));hae(t,r)&&(r=lae(r,a,o&&o[t],s));return r}(e,t,n)),getOwnPropertyDescriptor:(t,n)=>t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n),getPrototypeOf:()=>Reflect.getPrototypeOf(e),has:(t,n)=>Reflect.has(e,n),ownKeys:()=>Reflect.ownKeys(e),set:(t,n,i)=>(e[n]=i,delete t[n],!0)})}function cae(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:a=t.allKeys}=e;return{allKeys:a,scriptable:n,indexable:i,isScriptable:One(n)?n:()=>n,isIndexable:One(i)?i:()=>i}}const uae=(e,t)=>e?e+Dne(t):t,hae=(e,t)=>pne(t)&&"adapters"!==e&&(null===Object.getPrototypeOf(t)||t.constructor===Object);function dae(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||"constructor"===t)return e[t];const i=n();return e[t]=i,i}function fae(e,t,n){return One(e)?e(t,n):e}const pae=(e,t)=>!0===e?t:"string"==typeof e?Ane(t,e):void 0;function gae(e,t,n,i,a){for(const o of t){const t=pae(n,o);if(t){e.add(t);const o=fae(t._fallback,n,a);if(void 0!==o&&o!==n&&o!==i)return o}else if(!1===t&&void 0!==i&&n!==i)return null}return!1}function mae(e,t,n,i){const a=t._rootScopes,o=fae(t._fallback,n,i),s=[...e,...a],r=new Set;r.add(i);let l=vae(r,s,n,o||n,i);return null!==l&&((void 0===o||o===n||(l=vae(r,s,o,l,i),null!==l))&&rae(Array.from(r),[""],a,o,()=>function(e,t,n){const i=e._getTarget();t in i||(i[t]={});const a=i[t];if(fne(a)&&pne(n))return n;return a||{}}(t,n,i)))}function vae(e,t,n,i,a){for(;n;)n=gae(e,t,n,i,a);return n}function yae(e,t){for(const n of t){if(!n)continue;const t=n[e];if(void 0!==t)return t}}function bae(e){let t=e._keys;return t||(t=e._keys=function(e){const t=new Set;for(const n of e)for(const e of Object.keys(n).filter(e=>!e.startsWith("_")))t.add(e);return Array.from(t)}(e._scopes)),t}function _ae(e,t,n,i){const{iScale:a}=e,{key:o="r"}=this._parsing,s=new Array(i);let r,l,c,u;for(r=0,l=i;r<l;++r)c=r+n,u=t[c],s[r]={r:a.parse(Ane(u,o),c)};return s}const wae=Number.EPSILON||1e-14,kae=(e,t)=>t<e.length&&!e[t].skip&&e[t],xae=e=>"x"===e?"y":"x";function Tae(e,t,n,i){const a=e.skip?t:e,o=t,s=n.skip?t:n,r=Jne(o,a),l=Jne(s,o);let c=r/(r+l),u=l/(r+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const h=i*c,d=i*u;return{previous:{x:o.x-h*(s.x-a.x),y:o.y-h*(s.y-a.y)},next:{x:o.x+d*(s.x-a.x),y:o.y+d*(s.y-a.y)}}}function Cae(e,t="x"){const n=xae(t),i=e.length,a=Array(i).fill(0),o=Array(i);let s,r,l,c=kae(e,0);for(s=0;s<i;++s)if(r=l,l=c,c=kae(e,s+1),l){if(c){const e=c[t]-l[t];a[s]=0!==e?(c[n]-l[n])/e:0}o[s]=r?c?Hne(a[s-1])!==Hne(a[s])?0:(a[s-1]+a[s])/2:a[s-1]:a[s]}!function(e,t,n){const i=e.length;let a,o,s,r,l,c=kae(e,0);for(let u=0;u<i-1;++u)l=c,c=kae(e,u+1),l&&c&&(zne(t[u],0,wae)?n[u]=n[u+1]=0:(a=n[u]/t[u],o=n[u+1]/t[u],r=Math.pow(a,2)+Math.pow(o,2),r<=9||(s=3/Math.sqrt(r),n[u]=a*s*t[u],n[u+1]=o*s*t[u])))}(e,a,o),function(e,t,n="x"){const i=xae(n),a=e.length;let o,s,r,l=kae(e,0);for(let c=0;c<a;++c){if(s=r,r=l,l=kae(e,c+1),!r)continue;const a=r[n],u=r[i];s&&(o=(a-s[n])/3,r["cp1".concat(n)]=a-o,r["cp1".concat(i)]=u-o*t[c]),l&&(o=(l[n]-a)/3,r["cp2".concat(n)]=a+o,r["cp2".concat(i)]=u+o*t[c])}}(e,o,t)}function Eae(e,t,n){return Math.max(Math.min(e,n),t)}function Sae(e,t,n,i,a){let o,s,r,l;if(t.spanGaps&&(e=e.filter(e=>!e.skip)),"monotone"===t.cubicInterpolationMode)Cae(e,a);else{let n=i?e[e.length-1]:e[0];for(o=0,s=e.length;o<s;++o)r=e[o],l=Tae(n,r,e[Math.min(o+1,s-(i?0:1))%s],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,n=r}t.capBezierPoints&&function(e,t){let n,i,a,o,s,r=Uie(e[0],t);for(n=0,i=e.length;n<i;++n)s=o,o=r,r=n<i-1&&Uie(e[n+1],t),o&&(a=e[n],s&&(a.cp1x=Eae(a.cp1x,t.left,t.right),a.cp1y=Eae(a.cp1y,t.top,t.bottom)),r&&(a.cp2x=Eae(a.cp2x,t.left,t.right),a.cp2y=Eae(a.cp2y,t.top,t.bottom)))}(e,n)}function Iae(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Aae(e){let t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t}function Dae(e,t,n){let i;return"string"==typeof e?(i=parseInt(e,10),-1!==e.indexOf("%")&&(i=i/100*t.parentNode[n])):i=e,i}const Pae=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);const Oae=["top","right","bottom","left"];function Mae(e,t,n){const i={};n=n?"-"+n:"";for(let a=0;a<4;a++){const o=Oae[a];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function Nae(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,a=Pae(n),o="border-box"===a.boxSizing,s=Mae(a,"padding"),r=Mae(a,"border","width"),{x:l,y:c,box:u}=function(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:a,offsetY:o}=i;let s,r,l=!1;if(((e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot))(a,o,e.target))s=a,r=o;else{const e=t.getBoundingClientRect();s=i.clientX-e.left,r=i.clientY-e.top,l=!0}return{x:s,y:r,box:l}}(e,n),h=s.left+(u&&r.left),d=s.top+(u&&r.top);let{width:f,height:p}=t;return o&&(f-=s.width+r.width,p-=s.height+r.height),{x:Math.round((l-h)/f*n.width/i),y:Math.round((c-d)/p*n.height/i)}}const Rae=e=>Math.round(10*e)/10;function Lae(e,t,n,i){const a=Pae(e),o=Mae(a,"margin"),s=Dae(a.maxWidth,e,"clientWidth")||Vne,r=Dae(a.maxHeight,e,"clientHeight")||Vne,l=function(e,t,n){let i,a;if(void 0===t||void 0===n){const o=e&&Aae(e);if(o){const e=o.getBoundingClientRect(),s=Pae(o),r=Mae(s,"border","width"),l=Mae(s,"padding");t=e.width-l.width-r.width,n=e.height-l.height-r.height,i=Dae(s.maxWidth,o,"clientWidth"),a=Dae(s.maxHeight,o,"clientHeight")}else t=e.clientWidth,n=e.clientHeight}return{width:t,height:n,maxWidth:i||Vne,maxHeight:a||Vne}}(e,t,n);let{width:c,height:u}=l;if("content-box"===a.boxSizing){const e=Mae(a,"border","width"),t=Mae(a,"padding");c-=t.width+e.width,u-=t.height+e.height}c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=Rae(Math.min(c,s,l.maxWidth)),u=Rae(Math.min(u,r,l.maxHeight)),c&&!u&&(u=Rae(c/2));return(void 0!==t||void 0!==n)&&i&&l.height&&u>l.height&&(u=l.height,c=Rae(Math.floor(u*i))),{width:c,height:u}}function Vae(e,t,n){const i=t||1,a=Math.floor(e.height*i),o=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height="".concat(e.height,"px"),s.style.width="".concat(e.width,"px")),(e.currentDevicePixelRatio!==i||s.height!==a||s.width!==o)&&(e.currentDevicePixelRatio=i,s.height=a,s.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0)}const qae=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Iae()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch(ZNe){}return e}();function Fae(e,t){const n=function(e,t){return Pae(e).getPropertyValue(t)}(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Bae(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Uae(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:"middle"===i?n<.5?e.y:t.y:"after"===i?n<1?e.y:t.y:n>0?t.y:e.y}}function jae(e,t,n,i){const a={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=Bae(e,a,n),r=Bae(a,o,n),l=Bae(o,t,n),c=Bae(s,r,n),u=Bae(r,l,n);return Bae(c,u,n)}function Hae(e,t,n){return e?function(e,t){return{x:n=>e+e+t-n,setWidth(e){t=e},textAlign:e=>"center"===e?e:"right"===e?"left":"right",xPlus:(e,t)=>e-t,leftForLtr:(e,t)=>e-t}}(t,n):{x:e=>e,setWidth(e){},textAlign:e=>e,xPlus:(e,t)=>e+t,leftForLtr:(e,t)=>e}}function zae(e,t){let n,i;"ltr"!==t&&"rtl"!==t||(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function Wae(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Kae(e){return"angle"===e?{between:tie,compare:Zne,normalize:eie}:{between:iie,compare:(e,t)=>e-t,normalize:e=>e}}function Gae({start:e,end:t,count:n,loop:i,style:a}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n==0,style:a}}function Yae(e,t,n){if(!n)return[e];const{property:i,start:a,end:o}=n,s=t.length,{compare:r,between:l,normalize:c}=Kae(i),{start:u,end:h,loop:d,style:f}=function(e,t,n){const{property:i,start:a,end:o}=n,{between:s,normalize:r}=Kae(i),l=t.length;let c,u,{start:h,end:d,loop:f}=e;if(f){for(h+=l,d+=l,c=0,u=l;c<u&&s(r(t[h%l][i]),a,o);++c)h--,d--;h%=l,d%=l}return d<h&&(d+=l),{start:h,end:d,loop:f,style:e.style}}(e,t,n),p=[];let g,m,v,y=!1,b=null;const _=()=>y||l(a,v,g)&&0!==r(a,v),w=()=>!y||0===r(o,g)||l(o,v,g);for(let k=u,x=u;k<=h;++k)m=t[k%s],m.skip||(g=c(m[i]),g!==v&&(y=l(g,a,o),null===b&&_()&&(b=0===r(g,a)?k:x),null!==b&&w()&&(p.push(Gae({start:b,end:k,loop:d,count:s,style:f})),b=null),x=k,v=g));return null!==b&&p.push(Gae({start:b,end:h,loop:d,count:s,style:f})),p}function Qae(e,t){const n=[],i=e.segments;for(let a=0;a<i.length;a++){const o=Yae(i[a],e.points,t);o.length&&n.push(...o)}return n}function $ae(e,t,n,i){return i&&i.setContext&&n?function(e,t,n,i){const a=e._chart.getContext(),o=Xae(e.options),{_datasetIndex:s,options:{spanGaps:r}}=e,l=n.length,c=[];let u=o,h=t[0].start,d=h;function f(e,t,i,a){const o=r?-1:1;if(e!==t){for(e+=l;n[e%l].skip;)e-=o;for(;n[t%l].skip;)t+=o;e%l!==t%l&&(c.push({start:e%l,end:t%l,loop:i,style:a}),u=a,h=t%l)}}for(const p of t){h=r?h:p.start;let e,t=n[h%l];for(d=h+1;d<=p.end;d++){const o=n[d%l];e=Xae(i.setContext(sae(a,{type:"segment",p0:t,p1:o,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:s}))),Jae(e,u)&&f(h,d-1,p.loop,u),t=o,u=e}h<d-1&&f(h,d-1,p.loop,u)}return c}(e,t,n,i):t}function Xae(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Jae(e,t){if(!t)return!1;const n=[],i=function(e,t){return _ie(t)?(n.includes(t)||n.push(t),n.indexOf(t)):t};return JSON.stringify(e,i)!==JSON.stringify(t,i)} 5225/*! 5226 * Chart.js v4.4.8 5227 * https://www.chartjs.org 5228 * (c) 2025 Chart.js Contributors 5229 * Released under the MIT License 5230 */class Zae{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,i){const a=t.listeners[i],o=t.duration;a.forEach(i=>i({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(n-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=uie.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,i)=>{if(!n.running||!n.items.length)return;const a=n.items;let o,s=a.length-1,r=!1;for(;s>=0;--s)o=a[s],o._active?(o._total>n.duration&&(n.duration=o._total),o.tick(e),r=!0):(a[s]=a[a.length-1],a.pop());r&&(i.draw(),this._notify(i,n,e,"progress")),a.length||(n.running=!1,this._notify(i,n,e,"complete"),n.initial=!1),t+=a.length}),this._lastDate=e,0===t&&(this._running=!1)}_getAnims(e){const t=this._charts;let n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const n=t.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var eoe=new Zae;const toe="transparent",noe={boolean:(e,t,n)=>n>.5?t:e,color(e,t,n){const i=wie(e||toe),a=i.valid&&wie(t||toe);return a&&a.valid?a.mix(i,n).hexString():t},number:(e,t,n)=>e+(t-e)*n};class ioe{constructor(e,t,n,i){const a=t[n];i=oae([e.to,i,a,e.from]);const o=oae([e.from,a,i]);this._active=!0,this._fn=e.fn||noe[e.type||typeof o],this._easing=bie[e.easing]||bie.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);const i=this._target[this._prop],a=n-this._start,o=this._duration-a;this._start=n,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=a,this._loop=!!e.loop,this._to=oae([e.to,t,i,e.from]),this._from=oae([e.from,i,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,n=this._duration,i=this._prop,a=this._from,o=this._loop,s=this._to;let r;if(this._active=a!==s&&(o||t<n),!this._active)return this._target[i]=s,void this._notify(!0);t<0?this._target[i]=a:(r=t/n%2,r=o&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[i]=this._fn(a,s,r))}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){const t=e?"res":"rej",n=this._promises||[];for(let i=0;i<n.length;i++)n[i][t]()}}class aoe{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!pne(e))return;const t=Object.keys(Nie.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(i=>
vendor: 5,017 bytes, line 5230
5230{const a=e[i];if(!pne(a))return;const o={};for(const e of t)o[e]=a[e];(fne(a.properties)&&a.properties||[i]).forEach(e=>{e!==i&&n.has(e)||n.set(e,o)})})}_animateOptions(e,t){const n=t.options,i=function(e,t){if(!t)return;let n=e.options;if(!n)return void(e.options=t);n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(e,n);if(!i)return[];const a=this._createAnimations(i,n);return n.$shared&&function(e,t){const n=[],i=Object.keys(t);for(let a=0;a<i.length;a++){const t=e[i[a]];t&&t.active()&&n.push(t.wait())}return Promise.all(n)}(e.options.$animations,n).then(()=>{e.options=n},()=>{}),a}_createAnimations(e,t){const n=this._properties,i=[],a=e.$animations||(e.$animations={}),o=Object.keys(t),s=Date.now();let r;for(r=o.length-1;r>=0;--r){const l=o[r];if("$"===l.charAt(0))continue;if("options"===l){i.push(...this._animateOptions(e,t));continue}const c=t[l];let u=a[l];const h=n.get(l);if(u){if(h&&u.active()){u.update(h,c,s);continue}u.cancel()}h&&h.duration?(a[l]=u=new ioe(h,e,l,c),i.push(u)):e[l]=c}return i}update(e,t){if(0===this._properties.size)return void Object.assign(e,t);const n=this._createAnimations(e,t);return n.length?(eoe.add(this._chart,n),!0):void 0}}function ooe(e,t){const n=e&&e.options||{},i=n.reverse,a=void 0===n.min?t:0,o=void 0===n.max?t:0;return{start:i?o:a,end:i?a:o}}function soe(e,t){const n=[],i=e._getSortedDatasetMetas(t);let a,o;for(a=0,o=i.length;a<o;++a)n.push(i[a].index);return n}function roe(e,t,n,i={}){const a=e.keys,o="single"===i.mode;let s,r,l,c;if(null===t)return;let u=!1;for(s=0,r=a.length;s<r;++s){if(l=+a[s],l===n){if(u=!0,i.all)continue;break}c=e.values[l],gne(c)&&(o||0===t||Hne(t)===Hne(c))&&(t+=c)}return u||i.all?t:0}function loe(e,t){const n=e&&e.options.stacked;return n||void 0===n&&void 0!==t.stack}function coe(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function uoe(e,t,n,i){for(const a of t.getMatchingVisibleMetas(i).reverse()){const t=e[a.index];if(n&&t>0||!n&&t<0)return a.index}return null}function hoe(e,t){const{chart:n,_cachedMeta:i}=e,a=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:r}=i,l=o.axis,c=s.axis,u=function(e,t,n){return"".concat(e.id,".").concat(t.id,".").concat(n.stack||n.type)}(o,s,i),h=t.length;let d;for(let f=0;f<h;++f){const e=t[f],{[l]:n,[c]:o}=e;d=(e._stacks||(e._stacks={}))[c]=coe(a,u,n),d[r]=o,d._top=uoe(d,s,!0,i.type),d._bottom=uoe(d,s,!1,i.type);(d._visualValues||(d._visualValues={}))[r]=o}}function doe(e,t){const n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function foe(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const e of t){const t=e._stacks;if(!t||void 0===t[i]||void 0===t[i][n])return;delete t[i][n],void 0!==t[i]._visualValues&&void 0!==t[i]._visualValues[n]&&delete t[i]._visualValues[n]}}}const poe=e=>"reset"===e||"none"===e,goe=(e,t)=>t?e:Object.assign({},e);class moe{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=loe(e.vScale,e),this.addElements(),this.options.fill&&this.chart.isPluginEnabled("filler")}updateIndex(e){this.index!==e&&foe(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,n=this.getDataset(),i=(e,t,n,i)=>"x"===e?t:"r"===e?i:n,a=t.xAxisID=vne(n.xAxisID,doe(e,"x")),o=t.yAxisID=vne(n.yAxisID,doe(e,"y")),s=t.rAxisID=vne(n.rAxisID,doe(e,"r")),r=t.indexAxis,l=t.iAxisID=i(r,a,o,s),c=t.vAxisID=i(r,o,a,s);t.xScale=this.getScaleForId(a),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(s),t.iScale=this.getScaleForId(l),t.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&lie(this._data,this),e._stacked&&foe(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),n=this._data;if(pne(t)){const e=this._cachedMeta;this._data=function(e,t){const{iScale:n,vScale:i}=t,a="x"===n.axis?"x":"y",o="x"===i.axis?"x":"y",s=Object.keys(e),r=new Array(s.length);let l,c,u;for(l=0,c=s.length;l<c;++l)u=s[l],r[l]={[a]:u,[o]:e[u]};return r}(t,e)}else if(n!==t){if(n){lie(n,this);const e=this._cachedMeta;foe(e),e._parsed=[]}t&&Object.isExtensible(t)&&(a=this,(i=t)._chartjs?i._chartjs.listeners.push(a):(Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[a]}}
vendor: 12,108 bytes, line 5230
5230),rie.forEach(e=>{const t="_onData"+Dne(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...e){const a=n.apply(this,e);return i._chartjs.listeners.forEach(n=>{"function"==typeof n[t]&&n[t](...e)}),a}})}))),this._syncList=[],this._data=t}var i,a}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const a=t._stacked;t._stacked=loe(t.vScale,t),t.stack!==n.stack&&(i=!0,foe(t),t.stack=n.stack),this._resyncElements(e),(i||a!==t._stacked)&&(hoe(this,t._parsed),t._stacked=loe(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:n,_data:i}=this,{iScale:a,_stacked:o}=n,s=a.axis;let r,l,c,u=0===e&&t===i.length||n._sorted,h=e>0&&n._parsed[e-1];if(!1===this._parsing)n._parsed=i,n._sorted=!0,c=i;else{c=fne(i[e])?this.parseArrayData(n,i,e,t):pne(i[e])?this.parseObjectData(n,i,e,t):this.parsePrimitiveData(n,i,e,t);const a=()=>null===l[s]||h&&l[s]<h[s];for(r=0;r<t;++r)n._parsed[r+e]=l=c[r],u&&(a()&&(u=!1),h=l);n._sorted=u}o&&hoe(this,c)}parsePrimitiveData(e,t,n,i){const{iScale:a,vScale:o}=e,s=a.axis,r=o.axis,l=a.getLabels(),c=a===o,u=new Array(i);let h,d,f;for(h=0,d=i;h<d;++h)f=h+n,u[h]={[s]:c||a.parse(l[f],f),[r]:o.parse(t[f],f)};return u}parseArrayData(e,t,n,i){const{xScale:a,yScale:o}=e,s=new Array(i);let r,l,c,u;for(r=0,l=i;r<l;++r)c=r+n,u=t[c],s[r]={x:a.parse(u[0],c),y:o.parse(u[1],c)};return s}parseObjectData(e,t,n,i){const{xScale:a,yScale:o}=e,{xAxisKey:s="x",yAxisKey:r="y"}=this._parsing,l=new Array(i);let c,u,h,d;for(c=0,u=i;c<u;++c)h=c+n,d=t[h],l[c]={x:a.parse(Ane(d,s),h),y:o.parse(Ane(d,r),h)};return l}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){const i=this.chart,a=this._cachedMeta,o=t[e.axis];return roe({keys:soe(i,!0),values:t._stacks[e.axis]._visualValues},o,a.index,{mode:n})}updateRangeFromParsed(e,t,n,i){const a=n[t.axis];let o=null===a?NaN:a;const s=i&&n._stacks[t.axis];i&&s&&(i.values=s,o=roe(i,a,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,t){const n=this._cachedMeta,i=n._parsed,a=n._sorted&&e===n.iScale,o=i.length,s=this._getOtherScale(e),r=((e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:soe(n,!0),values:null})(t,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(e){const{min:t,max:n,minDefined:i,maxDefined:a}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:a?n:Number.POSITIVE_INFINITY}}(s);let h,d;function f(){d=i[h];const t=d[s.axis];return!gne(d[e.axis])||c>t||u<t}for(h=0;h<o&&(f()||(this.updateRangeFromParsed(l,e,d,r),!a));++h);if(a)for(h=o-1;h>=0;--h)if(!f()){this.updateRangeFromParsed(l,e,d,r);break}return l}getAllParsedValues(e){const t=this._cachedMeta._parsed,n=[];let i,a,o;for(i=0,a=t.length;i<a;++i)o=t[i][e.axis],gne(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,n=t.iScale,i=t.vScale,a=this.getParsed(e);return{label:n?""+n.getLabelForValue(a[n.axis]):"",value:i?""+i.getLabelForValue(a[i.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=function(e){let t,n,i,a;return pne(e)?(t=e.top,n=e.right,i=e.bottom,a=e.left):t=n=i=a=e,{top:t,right:n,bottom:i,left:a,disabled:!1===e}}(vne(this.options.clip,function(e,t,n){if(!1===n)return!1;const i=ooe(e,n),a=ooe(t,n);return{top:a.end,right:i.end,bottom:a.start,left:i.start}}(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,n=this._cachedMeta,i=n.data||[],a=t.chartArea,o=[],s=this._drawStart||0,r=this._drawCount||i.length-s,l=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(e,a,s,r),c=s;c<s+r;++c){const t=i[c];t.hidden||(t.active&&l?o.push(t):t.draw(e,a))}for(c=0;c<o.length;++c)o[c].draw(e,a)}getStyle(e,t){const n=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){const i=this.getDataset();let a;if(e>=0&&e<this._cachedMeta.data.length){const t=this._cachedMeta.data[e];a=t.$context||(t.$context=function(e,t,n){return sae(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}(this.getContext(),e,t)),a.parsed=this.getParsed(e),a.raw=i.data[e],a.index=a.dataIndex=e}else a=this.$context||(this.$context=function(e,t){return sae(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),a.dataset=i,a.index=a.datasetIndex=this.index;return a.active=!!t,a.mode=n,a}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",n){const i="active"===t,a=this._cachedDataOpts,o=e+"-"+t,s=a[o],r=this.enableOptionSharing&&Pne(n);if(s)return goe(s,r);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,e),u=i?["".concat(e,"Hover"),"hover",e,""]:[e,""],h=l.getOptionScopes(this.getDataset(),c),d=Object.keys(Nie.elements[e]),f=l.resolveNamedOptions(h,d,()=>this.getContext(n,i,t),u);return f.$shared&&(f.$shared=r,a[o]=Object.freeze(goe(f,r))),f}_resolveAnimations(e,t,n){const i=this.chart,a=this._cachedDataOpts,o="animation-".concat(t),s=a[o];if(s)return s;let r;if(!1!==i.options.animation){const i=this.chart.config,a=i.datasetAnimationScopeKeys(this._type,t),o=i.getOptionScopes(this.getDataset(),a);r=i.createResolver(o,this.getContext(e,n,t))}const l=new aoe(i,r&&r.animations);return r&&r._cacheable&&(a[o]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||poe(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const n=this.resolveDataElementOptions(e,t),i=this._sharedOptions,a=this.getSharedOptions(n),o=this.includeOptions(t,a)||a!==i;return this.updateSharedOptions(a,t,n),{sharedOptions:a,includeOptions:o}}updateElement(e,t,n,i){poe(i)?Object.assign(e,n):this._resolveAnimations(t,i).update(e,n)}updateSharedOptions(e,t,n){e&&!poe(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,i){e.active=i;const a=this.getStyle(t,i);this._resolveAnimations(t,n,i).update(e,{options:!i&&this.getSharedOptions(a)||a})}removeHoverStyle(e,t,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,t,n){this._setStyle(e,n,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,n=this._cachedMeta.data;for(const[s,r,l]of this._syncList)this[s](r,l);this._syncList=[];const i=n.length,a=t.length,o=Math.min(a,i);o&&this.parse(0,o),a>i?this._insertElements(i,a-i,e):a<i&&this._removeElements(a,i-a)}_insertElements(e,t,n=!0){const i=this._cachedMeta,a=i.data,o=e+t;let s;const r=e=>{for(e.length+=t,s=e.length-1;s>=o;s--)e[s]=e[s-t]};for(r(a),s=e;s<o;++s)a[s]=new this.dataElementType;this._parsing&&r(i._parsed),this.parse(e,t),n&&this.updateElements(a,e,t,"reset")}updateElements(e,t,n,i){}_removeElements(e,t){const n=this._cachedMeta;if(this._parsing){const i=n._parsed.splice(e,t);n._stacked&&foe(n,i)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,n,i]=e;this[t](n,i)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function voe(e){const t=e.iScale,n=function(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let t=0,a=n.length;t<a;t++)i=i.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=cie(i.sort((e,t)=>e-t))}return e._cache.$bar}(t,e.type);let i,a,o,s,r=t._length;const l=()=>{32767!==o&&-32768!==o&&(Pne(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i<a;++i)o=t.getPixelForValue(n[i]),l();for(s=void 0,i=0,a=t.ticks.length;i<a;++i)o=t.getPixelForTick(i),l();return r}function yoe(e,t,n,i){return fne(e)?function(e,t,n,i){const a=n.parse(e[0],i),o=n.parse(e[1],i),s=Math.min(a,o),r=Math.max(a,o);let l=s,c=r;Math.abs(s)>Math.abs(r)&&(l=r,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:a,end:o,min:s,max:r}}(e,t,n,i):t[n.axis]=n.parse(e,i),t}function boe(e,t,n,i){const a=e.iScale,o=e.vScale,s=a.getLabels(),r=a===o,l=[];let c,u,h,d;for(c=n,u=n+i;c<u;++c)d=t[c],h={},h[a.axis]=r||a.parse(s[c],c),l.push(yoe(d,h,o,c));return l}function _oe(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function woe(e,t,n,i){let a=t.borderSkipped;const o={};if(!a)return void(e.borderSkipped=o);if(!0===a)return void(e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:s,end:r,reverse:l,top:c,bottom:u}=function(e){let t,n,i,a,o;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(a="end",o="start"):(a="start",o="end"),{start:n,end:i,reverse:t,top:a,bottom:o}}(e);"middle"===a&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?a=c:(n._bottom||0)===i?a=u:(o[koe(u,s,r,l)]=!0,a=c)),o[koe(a,s,r,l)]=!0,e.borderSkipped=o}function koe(e,t,n,i){var a,o,s;return i?(s=n,e=xoe(e=(a=e)===(o=t)?s:a===s?o:a,n,t)):e=xoe(e,t,n),e}function xoe(e,t,n){return"start"===e?t:"end"===e?n:e}function Toe(e,{inflateAmount:t},n){e.inflateAmount="auto"===t?1===n?.33:0:t}n(moe,"defaults",{}),n(moe,"datasetElementType",null),n(moe,"dataElementType",null);class Coe extends moe{parsePrimitiveData(e,t,n,i){return boe(e,t,n,i)}parseArrayData(e,t,n,i){return boe(e,t,n,i)}parseObjectData(e,t,n,i){const{iScale:a,vScale:o}=e,{xAxisKey:s="x",yAxisKey:r="y"}=this._parsing,l="x"===a.axis?s:r,c="x"===o.axis?s:r,u=[];let h,d,f,p;for(h=n,d=n+i;h<d;++h)p=t[h],f={},f[a.axis]=a.parse(Ane(p,l),h),u.push(yoe(Ane(p,c),f,o,h));return u}updateRangeFromParsed(e,t,n,i){super.updateRangeFromParsed(e,t,n,i);const a=n._custom;a&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,a.min),e.max=Math.max(e.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:n,vScale:i}=t,a=this.getParsed(e),o=a._custom,s=_oe(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(a[i.axis]);return{label:""+n.getLabelForValue(a[n.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,i){const a="reset"===i,{index:o,_cachedMeta:{vScale:s}}=this,r=s.getBasePixel(),l=s.isHorizontal(),c=this._getRuler(),{sharedOptions:u,includeOptions:h}=this._getSharedOptions(t,i);for(let d=t;d<t+n;d++){const t=this.getParsed(d),n=a||dne(t[s.axis])?{base:r,head:r}:this._calculateBarValuePixels(d),f=this._calculateBarIndexPixels(d,c),p=(t._stacks||{})[s.axis],g={horizontal:l,base:n.base,enableBorderRadius:!p||_oe(t._custom)||o===p._top||o===p._bottom,x:l?n.head:f.center,y:l?f.center:n.head,height:l?f.size:Math.abs(n.size),width:l?Math.abs(n.size):f.size};h&&(g.options=u||this.resolveDataElementOptions(d,e[d].active?"active":i));const m=g.options||e[d].options;woe(g,m,p,o),Toe(g,m,c.ratio),this.updateElement(e[d],d,g,i)}}_getStacks(e,t){const{iScale:n}=this._cachedMeta,i=n.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),a=n.options.stacked,o=[],s=this._cachedMeta.controller.getParsed(t),r=s&&s[n.axis],l=e=>{const t=e._parsed.find(e=>
vendor: 6,082 bytes, line 5230
5230e[n.axis]===r),i=t&&t[e.vScale.axis];if(dne(i)||isNaN(i))return!0};for(const c of i)if((void 0===t||!l(c))&&((!1===a||-1===o.indexOf(c.stack)||void 0===a&&void 0===c.stack)&&o.push(c.stack),c.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,n){const i=this._getStacks(e,n),a=void 0!==t?i.indexOf(t):-1;return-1===a?i.length-1:a}_getRuler(){const e=this.options,t=this._cachedMeta,n=t.iScale,i=[];let a,o;for(a=0,o=t.data.length;a<o;++a)i.push(n.getPixelForValue(this.getParsed(a)[n.axis],a));const s=e.barThickness;return{min:s||voe(t),pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:s?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:n,index:i},options:{base:a,minBarLength:o}}=this,s=a||0,r=this.getParsed(e),l=r._custom,c=_oe(l);let u,h,d=r[t.axis],f=0,p=n?this.applyStack(t,r,n):d;p!==d&&(f=p-d,p=d),c&&(d=l.barStart,p=l.barEnd-l.barStart,0!==d&&Hne(d)!==Hne(l.barEnd)&&(f=0),f+=d);const g=dne(a)||c?f:a;let m=t.getPixelForValue(g);if(u=this.chart.getDataVisibility(e)?t.getPixelForValue(f+p):m,h=u-m,Math.abs(h)<o){h=function(e,t,n){return 0!==e?Hne(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}(h,t,s)*o,d===s&&(m-=h/2);const e=t.getPixelForDecimal(0),a=t.getPixelForDecimal(1),l=Math.min(e,a),f=Math.max(e,a);m=Math.max(Math.min(m,f),l),u=m+h,n&&!c&&(r._stacks[t.axis]._visualValues[i]=t.getValueForPixel(u)-t.getValueForPixel(m))}if(m===t.getPixelForValue(s)){const e=Hne(h)*t.getLineWidthForValue(s)/2;m+=e,h-=e}return{size:h,base:m,head:u,center:u+h/2}}_calculateBarIndexPixels(e,t){const n=t.scale,i=this.options,a=i.skipNull,o=vne(i.maxBarThickness,1/0);let s,r;if(t.grouped){const n=a?this._getStackCount(e):t.stackCount,l="flex"===i.barThickness?function(e,t,n,i){const a=t.pixels,o=a[e];let s=e>0?a[e-1]:null,r=e<a.length-1?a[e+1]:null;const l=n.categoryPercentage;null===s&&(s=o-(null===r?t.end-t.start:r-o)),null===r&&(r=o+o-s);const c=o-(o-Math.min(s,r))/2*l;return{chunk:Math.abs(r-s)/2*l/i,ratio:n.barPercentage,start:c}}(e,t,i,n):function(e,t,n,i){const a=n.barThickness;let o,s;return dne(a)?(o=t.min*n.categoryPercentage,s=n.barPercentage):(o=a*i,s=1),{chunk:o/i,ratio:s,start:t.pixels[e]-o/2}}(e,t,i,n),c=this._getStackIndex(this.index,this._cachedMeta.stack,a?e:void 0);s=l.start+l.chunk*c+l.chunk/2,r=Math.min(o,l.chunk*l.ratio)}else s=n.getPixelForValue(this.getParsed(e)[n.axis],e),r=Math.min(o,t.min*t.ratio);return{base:s-r/2,head:s+r/2,center:s,size:r}}draw(){const e=this._cachedMeta,t=e.vScale,n=e.data,i=n.length;let a=0;for(;a<i;++a)null===this.getParsed(a)[t.axis]||n[a].hidden||n[a].draw(this._ctx)}}n(Coe,"id","bar"),n(Coe,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),n(Coe,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Eoe extends moe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,n,i){const a=super.parsePrimitiveData(e,t,n,i);for(let o=0;o<a.length;o++)a[o]._custom=this.resolveDataElementOptions(o+n).radius;return a}parseArrayData(e,t,n,i){const a=super.parseArrayData(e,t,n,i);for(let o=0;o<a.length;o++){const e=t[n+o];a[o]._custom=vne(e[2],this.resolveDataElementOptions(o+n).radius)}return a}parseObjectData(e,t,n,i){const a=super.parseObjectData(e,t,n,i);for(let o=0;o<a.length;o++){const e=t[n+o];a[o]._custom=vne(e&&e.r&&+e.r,this.resolveDataElementOptions(o+n).radius)}return a}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:i,yScale:a}=t,o=this.getParsed(e),s=i.getLabelForValue(o.x),r=a.getLabelForValue(o.y),l=o._custom;return{label:n[e]||"",value:"("+s+", "+r+(l?", "+l:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,n,i){const a="reset"===i,{iScale:o,vScale:s}=this._cachedMeta,{sharedOptions:r,includeOptions:l}=this._getSharedOptions(t,i),c=o.axis,u=s.axis;for(let h=t;h<t+n;h++){const t=e[h],n=!a&&this.getParsed(h),d={},f=d[c]=a?o.getPixelForDecimal(.5):o.getPixelForValue(n[c]),p=d[u]=a?s.getBasePixel():s.getPixelForValue(n[u]);d.skip=isNaN(f)||isNaN(p),l&&(d.options=r||this.resolveDataElementOptions(h,t.active?"active":i),a&&(d.options.radius=0)),this.updateElement(t,h,d,i)}}resolveDataElementOptions(e,t){const n=this.getParsed(e);let i=super.resolveDataElementOptions(e,t);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const a=i.radius;return"active"!==t&&(i.radius=0),i.radius+=vne(n&&n._custom,a),i}}n(Eoe,"id","bubble"),n(Eoe,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),n(Eoe,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});class Soe extends moe{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const n=this.getDataset().data,i=this._cachedMeta;if(!1===this._parsing)i._parsed=n;else{let a,o,s=e=>+n[e];if(pne(n[e])){const{key:e="value"}=this._parsing;s=t=>+Ane(n[t],e)}for(a=e,o=e+t;a<o;++a)i._parsed[a]=s(a)}}_getRotation(){return Yne(this.options.rotation-90)}_getCircumference(){return Yne(this.options.circumference)}_getRotationExtents(){let e=Rne,t=-Rne;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const i=this.chart.getDatasetMeta(n).controller,a=i._getRotation(),o=i._getCircumference();e=Math.min(e,a),t=Math.max(t,a+o)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:n}=t,i=this._cachedMeta,a=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(a
vendor: 2,197 bytes, line 5230
5230)+this.options.spacing,s=Math.max((Math.min(n.width,n.height)-o)/2,0),r=Math.min((l=this.options.cutout,c=s,"string"==typeof l&&l.endsWith("%")?parseFloat(l)/100:+l/c),1);var l,c;const u=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=function(e,t,n){let i=1,a=1,o=0,s=0;if(t<Rne){const r=e,l=r+t,c=Math.cos(r),u=Math.sin(r),h=Math.cos(l),d=Math.sin(l),f=(e,t,i)=>tie(e,r,l,!0)?1:Math.max(t,t*n,i,i*n),p=(e,t,i)=>tie(e,r,l,!0)?-1:Math.min(t,t*n,i,i*n),g=f(0,c,h),m=f(Fne,u,d),v=p(Nne,c,h),y=p(Nne+Fne,u,d);i=(g-v)/2,a=(m-y)/2,o=-(g+v)/2,s=-(m+y)/2}return{ratioX:i,ratioY:a,offsetX:o,offsetY:s}}(d,h,r),v=(n.width-o)/f,y=(n.height-o)/p,b=Math.max(Math.min(v,y)/2,0),_=yne(this.options.radius,b),w=(_-Math.max(_*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*_,this.offsetY=m*_,i.total=this.calculateTotal(),this.outerRadius=_-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*u,0),this.updateElements(a,0,a.length,e)}_circumference(e,t){const n=this.options,i=this._cachedMeta,a=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||null===i._parsed[e]||i.data[e].hidden?0:this.calculateCircumference(i._parsed[e]*a/Rne)}updateElements(e,t,n,i){const a="reset"===i,o=this.chart,s=o.chartArea,r=o.options.animation,l=(s.left+s.right)/2,c=(s.top+s.bottom)/2,u=a&&r.animateScale,h=u?0:this.innerRadius,d=u?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(t,i);let g,m=this._getRotation();for(g=0;g<t;++g)m+=this._circumference(g,a);for(g=t;g<t+n;++g){const t=this._circumference(g,a),n=e[g],o={x:l+this.offsetX,y:c+this.offsetY,startAngle:m,endAngle:m+t,circumference:t,outerRadius:d,innerRadius:h};p&&(o.options=f||this.resolveDataElementOptions(g,n.active?"active":i)),m+=t,this.updateElement(n,g,o,i)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let n,i=0;for(n=0;n<t.length;n++){const a=e._parsed[n];null===a||isNaN(a)||!this.chart.getDataVisibility(n)||t[n].hidden||(i+=Math.abs(a))}return i}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?Rne*(Math.abs(e)/t):0}
vendor: 5,304 bytes, line 5230
5230getLabelAndValue(e){const t=this._cachedMeta,n=this.chart,i=n.data.labels||[],a=Eie(t._parsed[e],n.options.locale);return{label:i[e]||"",value:a}}getMaxBorderWidth(e){let t=0;const n=this.chart;let i,a,o,s,r;if(!e)for(i=0,a=n.data.datasets.length;i<a;++i)if(n.isDatasetVisible(i)){o=n.getDatasetMeta(i),e=o.data,s=o.controller;break}if(!e)return 0;for(i=0,a=e.length;i<a;++i)r=s.resolveDataElementOptions(i),"inner"!==r.borderAlign&&(t=Math.max(t,r.borderWidth||0,r.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let n=0,i=e.length;n<i;++n){const e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(vne(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}n(Soe,"id","doughnut"),n(Soe,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),n(Soe,"descriptors",{_scriptable:e=>"spacing"!==e,_indexable:e=>"spacing"!==e&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),n(Soe,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n,color:i}}=e.legend.options;return t.labels.map((t,a)=>{const o=e.getDatasetMeta(0).controller.getStyle(a);return{text:t,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:i,lineWidth:o.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(a),index:a}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}});class Ioe extends moe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:n,data:i=[],_dataset:a}=t,o=this.chart._animationsDisabled;let{start:s,count:r}=pie(t,i,o);this._drawStart=s,this._drawCount=r,gie(t)&&(s=0,r=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!a._decimated,n.points=i;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:l},e),this.updateElements(i,s,r,e)}updateElements(e,t,n,i){const a="reset"===i,{iScale:o,vScale:s,_stacked:r,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(t,i),h=o.axis,d=s.axis,{spanGaps:f,segment:p}=this.options,g=Kne(f)?f:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||a||"none"===i,v=t+n,y=e.length;let b=t>0&&this.getParsed(t-1);for(let _=0;_<y;++_){const n=e[_],f=m?n:{};if(_<t||_>=v){f.skip=!0;continue}const y=this.getParsed(_),w=dne(y[d]),k=f[h]=o.getPixelForValue(y[h],_),x=f[d]=a||w?s.getBasePixel():s.getPixelForValue(r?this.applyStack(s,y,r):y[d],_);f.skip=isNaN(k)||isNaN(x)||w,f.stop=_>0&&Math.abs(y[h]-b[h])>g,p&&(f.parsed=y,f.raw=l.data[_]),u&&(f.options=c||this.resolveDataElementOptions(_,n.active?"active":i)),m||this.updateElement(n,_,f,i),b=y}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,i=e.data||[];if(!i.length)return n;const a=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,a,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}n(Ioe,"id","line"),n(Ioe,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),n(Ioe,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Aoe extends moe{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart,i=n.data.labels||[],a=Eie(t._parsed[e].r,n.options.locale);return{label:i[e]||"",value:a}}parseObjectData(e,t,n,i){return _ae.bind(this)(e,t,n,i)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((e,n)=>{const i=this.getParsed(n).r;!isNaN(i)&&this.chart.getDataVisibility(n)&&(i<t.min&&(t.min=i),i>t.max&&(t.max=i))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,n=e.options,i=Math.min(t.right-t.left,t.bottom-t.top),a=Math.max(i/2,0),o=(a-Math.max(n.cutoutPercentage?a/100*n.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=a-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(e,t,n,i){const a="reset"===i,o=this.chart,s=o.options.animation,r=this._cachedMeta.rScale,l=r.xCenter,c=r.yCenter,u=r.getIndexAngle(0)-.5*Nne;let h,d=u;const f=360/this.countVisibleElements();for(h=0;h<t;++h)d+=this._computeAngle(h,i,f);for(h=t;h<t+n;h++){const t=e[h];let n=d,p=d+this._computeAngle(h,i,f),g=o.getDataVisibility(h)?r.getDistanceFromCenterForValue(this.getParsed(h).r):0;d=p,a&&(s.animateScale&&(g=0),s.animateRotate&&(n=p=u));
5230const m={x:l,y:c,innerRadius:0,outerRadius:g,startAngle:n,endAngle:p,options:this.resolveDataElementOptions(h,t.active?"active":i)};this.updateElement(t,h,m,i)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((e,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&t++}),t}_computeAngle(e,t,n){return this.chart.getDataVisibility(e)?Yne(this.resolveDataElementOptions(e,t).angle||n):0}}n(Aoe,"id","polarArea"),n(Aoe,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),n(Aoe,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n,color:i}}=e.legend.options;return t.labels.map((t,a)=>{const o=e.getDatasetMeta(0).controller.getStyle(a);return{text:t,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:i,lineWidth:o.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(a),index:a}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Doe extends Soe{}n(Doe,"id","pie"),n(Doe,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Poe extends moe{getLabelAndValue(e){const t=this._cachedMeta.vScale,n=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(n[t.axis])}}parseObjectData(e,t,n,i){return _ae.bind(this)(e,t,n,i)}update(e){const t=this._cachedMeta,n=t.dataset,i=t.data||[],a=t.iScale.getLabels();if(n.points=i,"resize"!==e){const t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);const o={_loop:!0,_fullLoop:a.length===i.length,options:t};this.updateElement(n,void 0,o,e)}this.updateElements(i,0,i.length,e)}updateElements(e,t,n,i){const a=this._cachedMeta.rScale,o="reset"===i;for(let s=t;s<t+n;s++){const t=e[s],n=this.resolveDataElementOptions(s,t.active?"active":i),r=a.getPointPositionForValue(s,this.getParsed(s).r),l=o?a.xCenter:r.x,c=o?a.yCenter:r.y,u={x:l,y:c,angle:r.angle,skip:isNaN(l)||isNaN(c),options:n};this.updateElement(t,s,u,i)}}}n(Poe,"id","radar"),n(Poe,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),n(Poe,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Ooe extends moe{getLabelAndValue(e){const t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:i,yScale:a}=t,o=this.getParsed(e),s=i.getLabelForValue(o.x),r=a.getLabelForValue(o.y);return{label:n[e]||"",value:"("+s+", "+r+")"}}update(e){const t=this._cachedMeta,{data:n=[]}=t,i=this.chart._animationsDisabled;let{start:a,count:o}=pie(t,n,i);if(this._drawStart=a,this._drawCount=o,gie(t)&&(a=0,o=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:o}=t;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!o._decimated,a.points=n;const s=this.resolveDatasetElementOptions(e);s.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:s},e)}else this.datasetElementType&&(delete t.dataset,this.datasetElementType=!1);this.updateElements(n,a,o,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,t,n,i){const a="reset"===i,{iScale:o,vScale:s,_stacked:r,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(t,i),u=this.getSharedOptions(c),h=this.includeOptions(i,u),d=o.axis,f=s.axis,{spanGaps:p,segment:g}=this.options,m=Kne(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||a||"none"===i;let y=t>0&&this.getParsed(t-1);for(let b=t;b<t+n;++b){const t=e[b],n=this.getParsed(b),c=v?t:{},p=dne(n[f]),_=c[d]=o.getPixelForValue(n[d],b),w=c[f]=a||p?s.getBasePixel():s.getPixelForValue(r?this.applyStack(s,n,r):n[f],b);c.skip=isNaN(_)||isNaN(w)||p,c.stop=b>0&&Math.abs(n[d]-y[d])>m,g&&(c.parsed=n,c.raw=l.data[b]),h&&(c.options=u||this.resolveDataElementOptions(b,t.active?"active":i)),v||this.updateElement(t,b,c,i),y=n}this.updateSharedOptions(u,i,c)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}const n=e.dataset,i=n.options&&n.options.borderWidth||0;if(!t.length)return i;const a=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(i,a,o)/2}}n(Ooe,"id","scatter"),n(Ooe,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),n(Ooe,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Moe=Object.freeze({__proto__:null,BarController:Coe,BubbleController:Eoe,DoughnutController:Soe,LineController:Ioe,PieController:Doe,PolarAreaController:Aoe,RadarController:Poe,ScatterController:Ooe});function Noe(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Roe{constructor(e){n(this,"options"),this.options=e||{}}static override(e){Object.assign(Roe.prototype,e)}init(){}formats(){return Noe()}parse(){return Noe()}format(){return Noe()}add(){return Noe()}diff(){return Noe()}startOf(){return Noe()}endOf(){return Noe()}}var Loe=Roe;function Voe(e,t,n,i){const{controller:a,data:o,_sorted:s}=e,r=a._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(r&&t===r.axis&&"r"!==t&&s&&o.length){const s=r._reversePixels?sie:oie;if(!i){const i=s(o,t,n);if(l){const{vScale:t}=a._cachedMeta,{_parsed:n}=e,o=n.slice(0,i.lo+1).reverse().findIndex(e=>!dne(e[t.axis]));i.lo-=Math.max(0,o);const s=n.slice(i.hi).findIndex(e=>!dne(e[t.axis]));i.hi+=Math.max(0,s)}return i}if(a._sharedOptions){const e=o[0],i="function"==typeof e.getRange&&e.getRange(t);if(i){const e=s(o,t,n-i),a=s(o,t,n+i);return{lo:e.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function qoe(e,t,n,i,a){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let r=0,l=o.length;r<l;++r){const{index:e,data:n}=o[r],{lo:l,hi:c}=Voe(o[r],t,s,a);for(let t=l;t<=c;++t){const a=n[t];a.skip||i(a,e,t)}}}function Foe(e,t,n,i,a){const o=[];if(!a&&!e.isPointInArea(t))return o;return qoe(e,n,t,function(n,s,r){(a||Uie(n,e.chartArea,0))&&n.inRange(t.x,t.y,i)&&o.push({element:n,datasetIndex:s,index:r})},!0),o}function Boe(e,t,n,i,a,o){let s=[];const r=function(e){const t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,i){const a=t?Math.abs(e.x-i.x):0,o=n?Math.abs(e.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(o,2))}}(n);let l=Number.POSITIVE_INFINITY;return qoe(e,n,t,function(n,c,u){const h=n.inRange(t.x,t.y,a);if(i&&!h)return;const d=n.getCenterPoint(a);if(!(!!o||e.isPointInArea(d))&&!h)return;const f=r(t,d);f<l?(s=[{element:n,datasetIndex:c,index:u}],l=f):f===l&&s.push({element:n,datasetIndex:c,index:u})}),s}function Uoe(e,t,n,i,a,o){return o||e.isPointInArea(t)?"r"!==n||i?Boe(e,t,n,i,a,o):function(e,t,n,i){let a=[];return qoe(e,n,t,function(e,n,o){const{startAngle:s,endAngle:r}=e.getProps(["startAngle","endAngle"],i),{angle:l}=Xne(e,{x:t.x,y:t.y});tie(l,s,r)&&a.push({element:e,datasetIndex:n,index:o})}),a}(e,t,n,a):[]}function joe(e,t,n,i,a){const o=[],s="x"===n?"inXRange":"inYRange";let r=!1;return qoe(e,n,t,(e,i,l)=>{e[s]&&e[s](t[n],a)&&(o.push({element:e,datasetIndex:i,index:l}),r=r||e.inRange(t.x,t.y,a))}),i&&!r?[]:o}var Hoe={evaluateInteractionItems:qoe,modes:{index(e,t,n,i){const a=Nae(t,e),o=n.axis||"x",s=n.includeInvisible||!1,r=n.intersect?Foe(e,a,o,i,s):Uoe(e,a,o,!1,i,s),l=[];
vendor: 7,624 bytes, line 5230
5230return r.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{const t=r[0].index,n=e.data[t];n&&!n.skip&&l.push({element:n,datasetIndex:e.index,index:t})}),l):[]},dataset(e,t,n,i){const a=Nae(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let r=n.intersect?Foe(e,a,o,i,s):Uoe(e,a,o,!1,i,s);if(r.length>0){const t=r[0].datasetIndex,n=e.getDatasetMeta(t).data;r=[];for(let e=0;e<n.length;++e)r.push({element:n[e],datasetIndex:t,index:e})}return r},point:(e,t,n,i)=>Foe(e,Nae(t,e),n.axis||"xy",i,n.includeInvisible||!1),nearest(e,t,n,i){const a=Nae(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return Uoe(e,a,o,n.intersect,i,s)},x:(e,t,n,i)=>joe(e,Nae(t,e),"x",n.intersect,i),y:(e,t,n,i)=>joe(e,Nae(t,e),"y",n.intersect,i)}};const zoe=["left","top","right","bottom"];function Woe(e,t){return e.filter(e=>e.pos===t)}function Koe(e,t){return e.filter(e=>-1===zoe.indexOf(e.pos)&&e.box.axis===t)}function Goe(e,t){return e.sort((e,n)=>{const i=t?n:e,a=t?e:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight})}function Yoe(e,t){const n=function(e){const t={};for(const n of e){const{stack:e,pos:i,stackWeight:a}=n;if(!e||!zoe.includes(i))continue;const o=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=a}return t}(e),{vBoxMaxWidth:i,hBoxMaxHeight:a}=t;let o,s,r;for(o=0,s=e.length;o<s;++o){r=e[o];const{fullSize:s}=r.box,l=n[r.stack],c=l&&r.stackWeight/l.weight;r.horizontal?(r.width=c?c*i:s&&t.availableWidth,r.height=a):(r.width=i,r.height=c?c*a:s&&t.availableHeight)}return n}function Qoe(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function $oe(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Xoe(e,t,n,i){const{pos:a,box:o}=n,s=e.maxPadding;if(!pne(a)){n.size&&(e[a]-=n.size);const t=i[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?o.height:o.width),n.size=t.size/t.count,e[a]+=n.size}o.getPadding&&$oe(s,o.getPadding());const r=Math.max(0,t.outerWidth-Qoe(s,e,"left","right")),l=Math.max(0,t.outerHeight-Qoe(s,e,"top","bottom")),c=r!==e.w,u=l!==e.h;return e.w=r,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Joe(e,t){const n=t.maxPadding;function i(e){const i={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{i[e]=Math.max(t[e],n[e])}),i}return i(e?["left","right"]:["top","bottom"])}function Zoe(e,t,n,i){const a=[];let o,s,r,l,c,u;for(o=0,s=e.length,c=0;o<s;++o){r=e[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Joe(r.horizontal,t));const{same:s,other:h}=Xoe(t,n,r,i);c|=s&&a.length,u=u||h,l.fullSize||a.push(r)}return c&&Zoe(a,t,n,i)||u}function ese(e,t,n,i,a){e.top=n,e.left=t,e.right=t+i,e.bottom=n+a,e.width=i,e.height=a}function tse(e,t,n,i){const a=n.padding;let{x:o,y:s}=t;for(const r of e){const e=r.box,l=i[r.stack]||{count:1,placed:0,weight:1},c=r.stackWeight/l.weight||1;if(r.horizontal){const i=t.w*c,o=l.size||e.height;Pne(l.start)&&(s=l.start),e.fullSize?ese(e,a.left,s,n.outerWidth-a.right-a.left,o):ese(e,t.left+l.placed,s,i,o),l.start=s,l.placed+=i,s=e.bottom}else{const i=t.h*c,s=l.size||e.width;Pne(l.start)&&(o=l.start),e.fullSize?ese(e,o,a.top,s,n.outerHeight-a.bottom-a.top):ese(e,o,t.top+l.placed,s,i),l.start=o,l.placed+=i,o=e.right}}t.x=o,t.y=s}var nse={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;const a=iae(e.options.layout.padding),o=Math.max(t-a.width,0),s=Math.max(n-a.height,0),r=function(e){const t=function(e){const t=[];let n,i,a,o,s,r;for(n=0,i=(e||[]).length;n<i;++n)a=e[n],({position:o,options:{stack:s,stackWeight:r=1}}=a),t.push({index:n,box:a,pos:o,horizontal:a.isHorizontal(),weight:a.weight,stack:s&&o+s,stackWeight:r});return t}(e),n=Goe(t.filter(e=>e.box.fullSize),!0),i=Goe(Woe(t,"left"),!0),a=Goe(Woe(t,"right")),o=Goe(Woe(t,"top"),!0),s=Goe(Woe(t,"bottom")),r=Koe(t,"x"),l=Koe(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:a.concat(l).concat(s).concat(r),chartArea:Woe(t,"chartArea"),vertical:i.concat(a).concat(l),horizontal:o.concat(s).concat(r)}}(e.boxes),l=r.vertical,c=r.horizontal;_ne(e.boxes,e=>{"function"==typeof e.beforeLayout&&e.beforeLayout()});const u=l.reduce((e,t)=>t.box.options&&!1===t.box.options.display?e:e+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:n,padding:a,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/u,hBoxMaxHeight:s/2}),d=Object.assign({},a);$oe(d,iae(i));const f=Object.assign({maxPadding:d,w:o,h:s,x:a.left,y:a.top},a),p=Yoe(l.concat(c),h);Zoe(r.fullSize,f,h,p),Zoe(l,f,h,p),Zoe(c,f,h,p)&&Zoe(l,f,h,p),function(e){const t=e.maxPadding;function n(n){const i=Math.max(t[n]-e[n],0);return e[n]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}(f),tse(r.leftAndTop,f,h,p),f.x+=f.w,f.y+=f.h,tse(r.rightAndBottom,f,h,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},_ne(r.chartArea,t=>{const n=t.box;Object.assign(n,e.chartArea),n.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class ise{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,i){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,i?Math.floor(t/i):n)}}isAttached(e){return!0}updateConfig(e){}}class ase extends ise{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ose="$chartjs",sse={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},rse=e=>null===e||""===e;const lse=!!qae&&{passive:!0};function cse(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,lse)}function use(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function hse(e,t,n){const i=e.canvas,a=new MutationObserver(e=>{let t=!1;for(const n of e)t=t||use(n.addedNodes,i),t=t&&!use(n.removedNodes,i);t&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}function dse(e,t,n){const i=e.canvas,a=new MutationObserver(e=>{let t=!1;for(const n of e)t=t||use(n.removedNodes,i),t=t&&!use(n.addedNodes,i);t&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}const fse=new Map;let pse=0;function gse(){const e=window.devicePixelRatio;e!==pse&&(pse=e,fse.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function mse(e,t,n){const i=e.canvas,a=i&&Aae(i);if(!a)return;const o=hie((e,t)=>{const i=a.clientWidth;n(e,t),i<a.clientWidth&&n()},window),s=new ResizeObserver(e=>{const t=e[0],n=t.contentRect.width,i=t.contentRect.height;0===n&&0===i||o(n,i)});return s.observe(a),function(e,t){fse.size||window.addEventListener("resize",gse),fse.set(e,t)}(e,o),s}function vse(e,t,n){n&&n.disconnect(),"resize"===t&&function(e){fse.delete(e),fse.size||window.removeEventListener("resize",gse)}(e)}function yse(e,t,n){const i=e.canvas,a=hie(t=>{null!==e.ctx&&n(function(e,t){const n=sse[e.type]||e.type,{x:i,y:a}=Nae(e,t);return{type:n,chart:t,native:e,x:void 0!==i?i:null,y:void 0!==a?a:null}}(t,e))},e);return function(e,t,n){e&&e.addEventListener(t,n,lse)}(i,t,a),a}class bse extends ise{acquireContext(e,t){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(function(e,t){const n=e.style,i=e.getAttribute("height"),a=e.getAttribute("width");
5230if(e[ose]={initial:{height:i,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",rse(a)){const t=Fae(e,"width");void 0!==t&&(e.width=t)}if(rse(i))if(""===e.style.height)e.height=e.width/(t||2);else{const t=Fae(e,"height");void 0!==t&&(e.height=t)}}(e,t),n):null}releaseContext(e){const t=e.canvas;if(!t[ose])return!1;const n=t[ose].initial;["height","width"].forEach(e=>{const i=n[e];dne(i)?t.removeAttribute(e):t.setAttribute(e,i)});const i=n.style||{};return Object.keys(i).forEach(e=>{t.style[e]=i[e]}),t.width=t.width,delete t[ose],!0}addEventListener(e,t,n){this.removeEventListener(e,t);const i=e.$proxies||(e.$proxies={}),a={attach:hse,detach:dse,resize:mse}[t]||yse;i[t]=a(e,t,n)}removeEventListener(e,t){const n=e.$proxies||(e.$proxies={}),i=n[t];if(!i)return;({attach:vse,detach:vse,resize:vse}[t]||cse)(e,t,i),n[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,i){return Lae(e,t,n,i)}isAttached(e){const t=e&&Aae(e);return!(!t||!t.isConnected)}}let _se=(e=class{constructor(){n(this,"x"),n(this,"y"),n(this,"active",!1),n(this,"options"),n(this,"$animations")}tooltipPosition(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}hasValue(){return Kne(this.x)&&Kne(this.y)}getProps(e,t){const n=this.$animations;if(!t||!n)return this;const i={};return e.forEach(e=>{i[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),i}},n(e,"defaults",{}),n(e,"defaultRoutes"),e);function wse(e,t){const n=e.options.ticks,i=function(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),a=e._maxLength/n;return Math.floor(Math.min(i,a))}(e),a=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?function(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}(t):[],s=o.length,r=o[0],l=o[s-1],c=[];if(s>a)return function(e,t,n,i){let a,o=0,s=n[0];for(i=Math.ceil(i),a=0;a<e.length;a++)a===s&&(t.push(e[a]),o++,s=n[o*i])}(t,c,o,s/a),c;const u=function(e,t,n){const i=function(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}(e),a=t.length/n;if(!i)return Math.max(a,1);const o=function(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));
vendor: 5,114 bytes, line 5230
5230return n===(0|n)&&t.push(n),t.sort((e,t)=>e-t).pop(),t}(i);for(let s=0,r=o.length-1;s<r;s++){const e=o[s];if(e>a)return e}return Math.max(a,1)}(o,t,a);if(s>0){let e,n;const i=s>1?Math.round((l-r)/(s-1)):null;for(kse(t,c,u,dne(i)?0:r-i,r),e=0,n=s-1;e<n;e++)kse(t,c,u,o[e],o[e+1]);return kse(t,c,u,l,dne(i)?t.length:l+i),c}return kse(t,c,u),c}function kse(e,t,n,i,a){const o=vne(i,0),s=Math.min(vne(a,e.length),e.length);let r,l,c,u=0;for(n=Math.ceil(n),a&&(r=a-i,n=r/Math.floor(r/n)),c=o;c<0;)u++,c=Math.round(o+u*n);for(l=Math.max(o,0);l<s;l++)l===c&&(t.push(e[l]),u++,c=Math.round(o+u*n))}const xse=(e,t,n)=>"top"===t||"left"===t?e[t]+n:e[t]-n,Tse=(e,t)=>Math.min(t||e,e);function Cse(e,t){const n=[],i=e.length/t,a=e.length;let o=0;for(;o<a;o+=i)n.push(e[Math.floor(o)]);return n}function Ese(e,t,n){const i=e.ticks.length,a=Math.min(t,i-1),o=e._startPixel,s=e._endPixel,r=1e-6;let l,c=e.getPixelForTick(a);if(!(n&&(l=1===i?Math.max(c-o,s-c):0===t?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(a-1))/2,c+=a<t?l:-l,c<o-r||c>s+r)))return c}function Sse(e){return e.drawTicks?e.tickLength:0}function Ise(e,t){if(!e.display)return 0;const n=aae(e.font,t),i=iae(e.padding);return(fne(e.text)?e.text.length:1)*n.lineHeight+i.height}function Ase(e,t,n){let i=die(e);return(n&&"right"!==t||!n&&"right"===t)&&(i=(e=>"left"===e?"right":"right"===e?"left":e)(i)),i}class Dse extends _se{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:i}=this;return e=mne(e,Number.POSITIVE_INFINITY),t=mne(t,Number.NEGATIVE_INFINITY),n=mne(n,Number.POSITIVE_INFINITY),i=mne(i,Number.NEGATIVE_INFINITY),{min:mne(e,n),max:mne(t,i),minDefined:gne(e),maxDefined:gne(t)}}getMinMax(e){let t,{min:n,max:i,minDefined:a,maxDefined:o}=this.getUserBounds();if(a&&o)return{min:n,max:i};const s=this.getMatchingVisibleMetas();for(let r=0,l=s.length;r<l;++r)t=s[r].controller.getMinMax(this,e),a||(n=Math.min(n,t.min)),o||(i=Math.max(i,t.max));return n=o&&n>i?i:n,i=a&&n>i?n:i,{min:mne(n,mne(i,n)),max:mne(i,mne(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){bne(this.options.beforeUpdate,[this])}update(e,t,n){const{beginAtZero:i,grace:a,ticks:o}=this.options,s=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(e,t,n){const{min:i,max:a}=e,o=yne(t,(a-i)/2),s=(e,t)=>n&&0===e?0:e+t;return{min:s(i,-Math.abs(o)),max:s(a,o)}}(this,a,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=s<this.ticks.length;this._convertTicksToLabels(r?Cse(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=wse(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),r&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e,t,n=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,n=!n),this._startPixel=e,this._endPixel=t,this._reversePixels=n,this._length=t-e,this._alignToPixels=this.options.alignToPixels}
vendor: 4,400 bytes, line 5230
5230afterUpdate(){bne(this.options.afterUpdate,[this])}beforeSetDimensions(){bne(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){bne(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),bne(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){bne(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let n,i,a;for(n=0,i=e.length;n<i;n++)a=e[n],a.label=bne(t.callback,[a.value,n,e],this)}afterTickToLabelConversion(){bne(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){bne(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,n=Tse(this.ticks.length,e.ticks.maxTicksLimit),i=t.minRotation||0,a=t.maxRotation;let o,s,r,l=i;if(!this._isVisible()||!t.display||i>=a||n<=1||!this.isHorizontal())return void(this.labelRotation=i);const c=this._getLabelSizes(),u=c.widest.width,h=c.highest.height,d=nie(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:d/(n-1),u+6>o&&(o=d/(n-(e.offset?.5:1)),s=this.maxHeight-Sse(e.grid)-t.padding-Ise(e.title,this.chart.options.font),r=Math.sqrt(u*u+h*h),l=Qne(Math.min(Math.asin(nie((c.highest.height+6)/o,-1,1)),Math.asin(nie(s/r,-1,1))-Math.asin(nie(h/r,-1,1)))),l=Math.max(i,Math.min(a,l))),this.labelRotation=l}afterCalculateLabelRotation(){bne(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){bne(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:n,title:i,grid:a}}=this,o=this._isVisible(),s=this.isHorizontal();if(o){const o=Ise(i,t.options.font);if(s?(e.width=this.maxWidth,e.height=Sse(a)+o):(e.height=this.maxHeight,e.width=Sse(a)+o),n.display&&this.ticks.length){const{first:t,last:i,widest:a,highest:o}=this._getLabelSizes(),r=2*n.padding,l=Yne(this.labelRotation),c=Math.cos(l),u=Math.sin(l);if(s){const t=n.mirror?0:u*a.width+c*o.height;e.height=Math.min(this.maxHeight,e.height+t+r)}else{const t=n.mirror?0:c*a.width+u*o.height;e.width=Math.min(this.maxWidth,e.width+t+r)}this._calculatePadding(t,i,u,c)}}this._handleMargins(),s?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,i){const{ticks:{align:a,padding:o},position:s}=this.options,r=0!==this.labelRotation,l="top"!==s&&"x"===this.axis;if(this.isHorizontal()){const s=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,h=0;r?l?(u=i*e.width,h=n*t.height):(u=n*e.height,h=i*t.width):"start"===a?h=t.width:"end"===a?u=e.width:"inner"!==a&&(u=e.width/2,h=t.width/2),this.paddingLeft=Math.max((u-s+o)*this.width/(this.width-s),0),this.paddingRight=Math.max((h-c+o)*this.width/(this.width-c),0)}else{let n=t.height/2,i=e.height/2;"start"===a?(n=0,i=e.height):"end"===a&&(n=t.height,i=0),this.paddingTop=n+o,this.paddingBottom=i+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){bne(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return"top"===t||"bottom"===t||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let t,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,n=e.length;t<n;t++)dne(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let n=this.ticks;t<n.length&&(n=Cse(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}
vendor: 4,771 bytes, line 5230
5230_computeLabelSizes(e,t,n){const{ctx:i,_longestTextCache:a}=this,o=[],s=[],r=Math.floor(t/Tse(t,n));let l,c,u,h,d,f,p,g,m,v,y,b=0,_=0;for(l=0;l<t;l+=r){if(h=e[l].label,d=this._resolveTickFontOptions(l),i.font=f=d.string,p=a[f]=a[f]||{data:{},gc:[]},g=d.lineHeight,m=v=0,dne(h)||fne(h)){if(fne(h))for(c=0,u=h.length;c<u;++c)y=h[c],dne(y)||fne(y)||(m=Rie(i,p.data,p.gc,m,y),v+=g)}else m=Rie(i,p.data,p.gc,m,h),v=g;o.push(m),s.push(v),b=Math.max(m,b),_=Math.max(v,_)}!function(e,t){_ne(e,e=>{const n=e.gc,i=n.length/2;let a;if(i>t){for(a=0;a<i;++a)delete e.data[n[a]];n.splice(0,i)}})}(a,t);const w=o.indexOf(b),k=s.indexOf(_),x=e=>({width:o[e]||0,height:s[e]||0});return{first:x(0),last:x(t-1),widest:x(w),highest:x(k),widths:o,heights:s}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return nie(this._alignToPixels?Vie(this.chart,t,0):t,-32768,32767)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const n=t[e];return n.$context||(n.$context=function(e,t,n){return sae(e,{tick:n,index:t,type:"tick"})}(this.getContext(),e,n))}return this.$context||(this.$context=sae(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const e=this.options.ticks,t=Yne(this.labelRotation),n=Math.abs(Math.cos(t)),i=Math.abs(Math.sin(t)),a=this._getLabelSizes(),o=e.autoSkipPadding||0,s=a?a.widest.width+o:0,r=a?a.highest.height+o:0;return this.isHorizontal()?r*n>s*i?s/n:r/i:r*i<s*n?r/n:s/i}_isVisible(){const e=this.options.display;return"auto"!==e?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,n=this.chart,i=this.options,{grid:a,position:o,border:s}=i,r=a.offset,l=this.isHorizontal(),c=this.ticks.length+(r?1:0),u=Sse(a),h=[],d=s.setContext(this.getContext()),f=d.display?d.width:0,p=f/2,g=function(e){return Vie(n,e,f)};let m,v,y,b,_,w,k,x,T,C,E,S;if("top"===o)m=g(this.bottom),w=this.bottom-u,x=m-p,C=g(e.top)+p,S=e.bottom;else if("bottom"===o)m=g(this.top),C=e.top,S=g(e.bottom)-p,w=m+p,x=this.top+u;else if("left"===o)m=g(this.right),_=this.right-u,k=m-p,T=g(e.left)+p,E=e.right;else if("right"===o)m=g(this.left),T=e.left,E=g(e.right)-p,_=m+p,k=this.left+u;else if("x"===t){if("center"===o)m=g((e.top+e.bottom)/2+.5);else if(pne(o)){const e=Object.keys(o)[0],t=o[e];m=g(this.chart.scales[e].getPixelForValue(t))}C=e.top,S=e.bottom,w=m+p,x=w+u}else if("y"===t){if("center"===o)m=g((e.left+e.right)/2);else if(pne(o)){const e=Object.keys(o)[0],t=o[e];m=g(this.chart.scales[e].getPixelForValue(t))}_=m-p,k=_-u,T=e.left,E=e.right}const I=vne(i.ticks.maxTicksLimit,c),A=Math.max(1,Math.ceil(c/I));for(v=0;v<c;v+=A){const e=this.getContext(v),t=a.setContext(e),i=s.setContext(e),o=t.lineWidth,c=t.color,u=i.dash||[],d=i.dashOffset,f=t.tickWidth,p=t.tickColor,g=t.tickBorderDash||[],m=t.tickBorderDashOffset;y=Ese(this,v,r),void 0!==y&&(b=Vie(n,y,o),l?_=k=T=E=b:w=x=C=S=b,h.push({tx1:_,ty1:w,tx2:k,ty2:x,x1:T,y1:C,x2:E,y2:S,width:o,color:c,borderDash:u,borderDashOffset:d,tickWidth:f,tickColor:p,tickBorderDash:g,tickBorderDashOffset:m}))}return this._ticksLength=c,this._borderValue=m,h}_computeLabelItems(e){const t=this.axis,n=this.options,{position:i,ticks:a}=n,o=this.isHorizontal(),s=this.ticks,{align:r,crossAlign:l,padding:c,mirror:u}=a,h=Sse(n.grid),d=h+c,f=u?-c:d,p=-Yne(this.labelRotation),g=[];let m,v,y,b,_,w,k,x,T,C,E,S,I="middle";if("top"===i)w=this.bottom-f,k=this._getXAxisLabelAlignment();else if("bottom"===i)w=this.top+f,k=this._getXAxisLabelAlignment();else if("left"===i){const e=this._getYAxisLabelAlignment(h);k=e.textAlign,_=e.x}else if("right"===i){const e=this._getYAxisLabelAlignment(h);k=e.textAlign,_=e.x}else if("x"===t){if("center"===i)w=(e.top+e.bottom)/2+d;else if(pne(i)){const e=Object.keys(i)[0],t=i[e];w=this.chart.scales[e].getPixelForValue(t)+d}k=this._getXAxisLabelAlignment()}else if("y"===t){if("center"===i)_=(e.left+e.right)/2-d;else if(pne(i)){const e=Object.keys(i)[0],t=i[e];_=this.chart.scales[e].getPixelForValue(t)}k=this._getYAxisLabelAlignment(h).textAlign}"y"===t&&("start"===r?I="top":"end"===r&&(I="bottom"));const A=this._getLabelSizes();for(m=0,v=s.length;m<v;++m){y=s[m],b=y.label;const e=a.setContext(this.getContext(m));x=this.getPixelForTick(m)+a.labelOffset,T=this._resolveTickFontOptions(m),C=T.lineHeight,E=fne(b)?b.length:1;const t=E/2,n=e.color,r=e.textStrokeColor,c=e.textStrokeWidth;let h,d=k;
vendor: 1,857 bytes, line 5230
5230if(o?(_=x,"inner"===k&&(d=m===v-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),S="top"===i?"near"===l||0!==p?-E*C+C/2:"center"===l?-A.highest.height/2-t*C+C:-A.highest.height+C/2:"near"===l||0!==p?C/2:"center"===l?A.highest.height/2-t*C:A.highest.height-E*C,u&&(S*=-1),0===p||e.showLabelBackdrop||(_+=C/2*Math.sin(p))):(w=x,S=(1-E)*C/2),e.showLabelBackdrop){const t=iae(e.backdropPadding),n=A.heights[m],i=A.widths[m];let a=S-t.top,o=0-t.left;switch(I){case"middle":a-=n/2;break;case"bottom":a-=n}switch(k){case"center":o-=i/2;break;case"right":o-=i;break;case"inner":m===v-1?o-=i:m>0&&(o-=i/2)}h={left:o,top:a,width:i+t.width,height:n+t.height,color:e.backdropColor}}g.push({label:b,font:T,textOffset:S,options:{rotation:p,color:n,strokeColor:r,strokeWidth:c,textAlign:d,textBaseline:I,translation:[_,w],backdrop:h}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Yne(this.labelRotation))return"top"===e?"left":"right";let n="center";return"start"===t.align?n="left":"end"===t.align?n="right":"inner"===t.align&&(n="inner"),n}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:n,mirror:i,padding:a}}=this.options,o=e+a,s=this._getLabelSizes().widest.width;let r,l;return"left"===t?i?(l=this.right+a,"near"===n?r="left":"center"===n?(r="center",l+=s/2):(r="right",l+=s)):(l=this.right-o,"near"===n?r="right":"center"===n?(r="center",l-=s/2):(r="left",l=this.left)):"right"===t?i?(l=this.left+a,"near"===n?r="right":"center"===n?(r="center",l-=s/2):(r="left",l-=s)):(l=this.left+o,"near"===n?r="left":"center"===n?(r="center",l+=s/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;return"left"===t||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}
vendor: 99,019 bytes, line 5230
5230:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:n,top:i,width:a,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,i,a,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const n=this.ticks.findIndex(t=>t.value===e);if(n>=0){return t.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(e){const t=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let a,o;const s=(e,t,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(a=0,o=i.length;a<o;++a){const e=i[a];t.drawOnChartArea&&s({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&s({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:n,grid:i}}=this,a=n.setContext(this.getContext()),o=n.display?a.width:0;if(!o)return;const s=i.setContext(this.getContext(0)).lineWidth,r=this._borderValue;let l,c,u,h;this.isHorizontal()?(l=Vie(e,this.left,o)-o/2,c=Vie(e,this.right,s)+s/2,u=h=r):(u=Vie(e,this.top,o)-o/2,h=Vie(e,this.bottom,s)+s/2,l=c=r),t.save(),t.lineWidth=a.width,t.strokeStyle=a.color,t.beginPath(),t.moveTo(l,u),t.lineTo(c,h),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const t=this.ctx,n=this._computeLabelArea();n&&jie(t,n);const i=this.getLabelItems(e);for(const a of i){const e=a.options,n=a.font;Yie(t,a.label,0,a.textOffset,n,e)}n&&Hie(t)}drawTitle(){const{ctx:e,options:{position:t,title:n,reverse:i}}=this;if(!n.display)return;const a=aae(n.font),o=iae(n.padding),s=n.align;let r=a.lineHeight/2;"bottom"===t||"center"===t||pne(t)?(r+=o.bottom,fne(n.text)&&(r+=a.lineHeight*(n.text.length-1))):r+=o.top;const{titleX:l,titleY:c,maxWidth:u,rotation:h}=function(e,t,n,i){const{top:a,left:o,bottom:s,right:r,chart:l}=e,{chartArea:c,scales:u}=l;let h,d,f,p=0;const g=s-a,m=r-o;if(e.isHorizontal()){if(d=fie(i,o,r),pne(n)){const e=Object.keys(n)[0],i=n[e];f=u[e].getPixelForValue(i)+g-t}else f="center"===n?(c.bottom+c.top)/2+g-t:xse(e,n,t);h=r-o}else{if(pne(n)){const e=Object.keys(n)[0],i=n[e];d=u[e].getPixelForValue(i)-m+t}else d="center"===n?(c.left+c.right)/2-m+t:xse(e,n,t);f=fie(i,s,a),p="left"===n?-Fne:Fne}return{titleX:d,titleY:f,maxWidth:h,rotation:p}}(this,r,t,s);Yie(e,n.text,0,0,a,{color:n.color,maxWidth:u,rotation:h,textAlign:Ase(s,t,i),textBaseline:"middle",translation:[l,c]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,n=vne(e.grid&&e.grid.z,-1),i=vne(e.border&&e.border.z,0);return this._isVisible()&&this.draw===Dse.prototype.draw?[{z:n,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:t,draw:e=>{this.drawLabels(e)}}]:[{z:t,draw:e=>{this.draw(e)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let a,o;for(a=0,o=t.length;a<o;++a){const o=t[a];o[n]!==this.id||e&&o.type!==e||i.push(o)}return i}_resolveTickFontOptions(e){return aae(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Pse{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let n;(function(e){return"id"in e&&"defaults"in e})(t)&&(n=this.register(t));const i=this.items,a=e.id,o=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+e);return a in i||(i[a]=e,function(e,t,n){const i=Cne(Object.create(null),[n?Nie.get(n):{},Nie.get(t),e.defaults]);Nie.set(t,i),e.defaultRoutes&&function(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),a=i.pop(),o=[e].concat(i).join("."),s=t[n].split("."),r=s.pop(),l=s.join(".");Nie.route(o,a,l,r)})}(t,e.defaultRoutes);e.descriptors&&Nie.describe(t,e.descriptors)}(e,o,n),this.override&&Nie.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const t=this.items,n=e.id,i=this.scope;n in t&&delete t[n],i&&n in Nie[i]&&(delete Nie[i][n],this.override&&delete Aie[n])}}class Ose{constructor(){this.controllers=new Pse(moe,"datasets",!0),this.elements=new Pse(_se,"elements"),this.plugins=new Pse(Object,"plugins"),this.scales=new Pse(Dse,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,n){[...t].forEach(t=>{const i=n||this._getRegistryForType(t);n||i.isForType(t)||i===this.plugins&&t.id?this._exec(e,i,t):_ne(t,t=>{const i=n||this._getRegistryForType(t);this._exec(e,i,t)})})}_exec(e,t,n){const i=Dne(e);bne(n["before"+i],[],n),t[e](n),bne(n["after"+i],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){const i=t.get(e);if(void 0===i)throw new Error('"'+e+'" is not a registered '+n+".");return i}}var Mse=new Ose;class Nse{constructor(){this._init=[]}notify(e,t,n,i){"beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const a=i?this._descriptors(e).filter(i):this._descriptors(e),o=this._notify(a,e,t,n);return"afterDestroy"===t&&(this._notify(a,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,n,i){i=i||{};for(const a of e){const e=a.plugin;if(!1===bne(e[n],[t,i,a.options],e)&&i.cancelable)return!1}return!0}invalidate(){dne(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const n=e&&e.config,i=vne(n.options&&n.options.plugins,{}),a=function(e){const t={},n=[],i=Object.keys(Mse.plugins.items);for(let o=0;o<i.length;o++)n.push(Mse.getPlugin(i[o]));const a=e.plugins||[];for(let o=0;o<a.length;o++){const e=a[o];-1===n.indexOf(e)&&(n.push(e),t[e.id]=!0)}return{plugins:n,localIds:t}}(n);return!1!==i||t?function(e,{plugins:t,localIds:n},i,a){const o=[],s=e.getContext();for(const r of t){const t=r.id,l=Rse(i[t],a);null!==l&&o.push({plugin:r,options:Lse(e.config,{plugin:r,local:n[t]},l,s)})}return o}(e,a,i,t):[]}_notifyStateChanges(e){const t=this._oldCache||[],n=this._cache,i=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(i(t,n),e,"stop"),this._notify(i(n,t),e,"start")}}function Rse(e,t){return t||!1!==e?!0===e?{}:e:null}function Lse(e,{plugin:t,local:n},i,a){const o=e.pluginScopeKeys(t),s=e.getOptionScopes(i,o);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Vse(e,t){const n=Nie.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function qse(e){if("x"===e||"y"===e||"r"===e)return e}function Fse(e){return"top"===e||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0}function Bse(e,...t){if(qse(e))return e;for(const n of t){const t=n.axis||Fse(n.position)||e.length>1&&qse(e[0].toLowerCase());if(t)return t}throw new Error("Cannot determine type of '".concat(e,"' axis. Please provide 'axis' or 'position' option."))}function Use(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function jse(e,t){const n=Aie[e.type]||{scales:{}},i=t.scales||{},a=Vse(e.type,t),o=Object.create(null);return Object.keys(i).forEach(t=>{const s=i[t];if(!pne(s))return;if(s._proxy)return;const r=Bse(t,s,function(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return Use(e,"x",n[0])||Use(e,"y",n[0])}return{}}(t,e),Nie.scales[s.type]),l=function(e,t){return e===t?"_index_":"_value_"}(r,a),c=n.scales||{};o[t]=Ene(Object.create(null),[{axis:r},s,c[r],c[l]])}),e.data.datasets.forEach(n=>{const a=n.type||e.type,s=n.indexAxis||Vse(a,t),r=(Aie[a]||{}).scales||{};Object.keys(r).forEach(e=>{const t=function(e,t){let n=e;return"_index_"===e?n=t:"_value_"===e&&(n="x"===t?"y":"x"),n}(e,s),a=n[t+"AxisID"]||t;o[a]=o[a]||Object.create(null),Ene(o[a],[{axis:t},i[a],r[e]])})}),Object.keys(o).forEach(e=>{const t=o[e];Ene(t,[Nie.scales[t.type],Nie.scale])}),o}function Hse(e){const t=e.options||(e.options={});t.plugins=vne(t.plugins,{}),t.scales=jse(e,t)}function zse(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}const Wse=new Map,Kse=new Set;function Gse(e,t){let n=Wse.get(e);return n||(n=t(),Wse.set(e,n),Kse.add(n)),n}const Yse=(e,t,n)=>{const i=Ane(t,n);void 0!==i&&e.add(i)};class Qse{constructor(e){this._config=function(e){return(e=e||{}).data=zse(e.data),Hse(e),e}(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=zse(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Hse(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Gse(e,()=>[["datasets.".concat(e),""]])}datasetAnimationScopeKeys(e,t){return Gse("".concat(e,".transition.").concat(t),()=>[["datasets.".concat(e,".transitions.").concat(t),"transitions.".concat(t)],["datasets.".concat(e),""]])}datasetElementScopeKeys(e,t){return Gse("".concat(e,"-").concat(t),()=>[["datasets.".concat(e,".elements.").concat(t),"datasets.".concat(e),"elements.".concat(t),""]])}pluginScopeKeys(e){const t=e.id,n=this.type;return Gse("".concat(n,"-plugin-").concat(t),()=>[["plugins.".concat(t),...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const n=this._scopeCache;let i=n.get(e);return i&&!t||(i=new Map,n.set(e,i)),i}getOptionScopes(e,t,n){const{options:i,type:a}=this,o=this._cachedScopes(e,n),s=o.get(t);if(s)return s;const r=new Set;t.forEach(t=>{e&&(r.add(e),t.forEach(t=>Yse(r,e,t))),t.forEach(e=>Yse(r,i,e)),t.forEach(e=>Yse(r,Aie[a]||{},e)),t.forEach(e=>Yse(r,Nie,e)),t.forEach(e=>Yse(r,Die,e))});const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),Kse.has(t)&&o.set(t,l),l}chartOptionScopes(){const{options:e,type:t}=this;return[e,Aie[t]||{},Nie.datasets[t]||{},{type:t},Nie,Die]}resolveNamedOptions(e,t,n,i=[""]){const a={$shared:!0},{resolver:o,subPrefixes:s}=$se(this._resolverCache,e,i);let r=o;if(function(e,t){const{isScriptable:n,isIndexable:i}=cae(e);for(const a of t){const t=n(a),o=i(a),s=(o||t)&&e[a];if(t&&(One(s)||Xse(s))||o&&fne(s))return!0}return!1}(o,t)){a.$shared=!1;r=lae(o,n=One(n)?n():n,this.createResolver(e,n,s))}for(const l of t)a[l]=r[l];return a}createResolver(e,t,n=[""],i){const{resolver:a}=$se(this._resolverCache,e,n);return pne(t)?lae(a,t,void 0,i):a}}function $se(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const a=n.join();let o=i.get(a);if(!o){o={resolver:rae(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes("hover"))},i.set(a,o)}return o}const Xse=e=>pne(e)&&Object.getOwnPropertyNames(e).some(t=>One(e[t]));const Jse=["top","bottom","left","right","chartArea"];function Zse(e,t){return"top"===e||"bottom"===e||-1===Jse.indexOf(e)&&"x"===t}function ere(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function tre(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),bne(n&&n.onComplete,[e],t)}function nre(e){const t=e.chart,n=t.options.animation;bne(n&&n.onProgress,[e],t)}function ire(e){return Iae()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const are={},ore=e=>{const t=ire(e);return Object.values(are).filter(e=>e.canvas===t).pop()};function sre(e,t,n){const i=Object.keys(e);for(const a of i){const i=+a;if(i>=t){const o=e[a];delete e[a],(n>0||i>t)&&(e[i+n]=o)}}}function rre(e,t,n){return e.options.clip?e[n]:t[n]}class lre{static register(...e){Mse.add(...e),cre()}static unregister(...e){Mse.remove(...e),cre()}constructor(e,t){const n=this.config=new Qse(t),i=ire(e),a=ore(i);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function(e){return!Iae()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?ase:bse}(i)),this.platform.updateConfig(n);const s=this.platform.acquireContext(i,o.aspectRatio),r=s&&s.canvas,l=r&&r.height,c=r&&r.width;this.id=hne(),this.ctx=s,this.canvas=r,this.width=c,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Nse,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}(e=>this.update(e),o.resizeDelay||0),this._dataChanges=[],are[this.id]=this,s&&r&&(eoe.listen(this,"complete",tre),eoe.listen(this,"progress",nre),this._initialize(),this.attached&&this.update())}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:i,_aspectRatio:a}=this;return dne(e)?t&&a?a:i?n/i:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Mse}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Vae(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return qie(this.canvas,this.ctx),this}stop(){return eoe.stop(this),this}resize(e,t){eoe.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const n=this.options,i=this.canvas,a=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,e,t,a),s=n.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Vae(this,s,!0)&&(this.notifyPlugins("resize",{size:o}),bne(n.onResize,[this,o],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){_ne(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){const e=this.options,t=e.scales,n=this.scales,i=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{});let a=[];t&&(a=a.concat(Object.keys(t).map(e=>{const n=t[e],i=Bse(e,n),a="r"===i,o="x"===i;return{options:n,dposition:a?"chartArea":o?"bottom":"left",dtype:a?"radialLinear":o?"category":"linear"}}))),_ne(a,t=>{const a=t.options,o=a.id,s=Bse(o,a),r=vne(a.type,t.dtype);void 0!==a.position&&Zse(a.position,s)===Zse(t.dposition)||(a.position=t.dposition),i[o]=!0;let l=null;if(o in n&&n[o].type===r)l=n[o];else{l=new(Mse.getScale(r))({id:o,type:r,ctx:this.ctx,chart:this}),n[l.id]=l}l.init(a,e)}),_ne(i,(e,t)=>{e||delete n[t]}),_ne(n,e=>{nse.configure(this,e,e.options),nse.addBox(this,e)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(ere("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{0===t.filter(t=>t===e._dataset).length&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=t.length;n<i;n++){const i=t[n];let a=this.getDatasetMeta(n);const o=i.type||this.config.type;if(a.type&&a.type!==o&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=o,a.indexAxis=i.indexAxis||Vse(o,this.options),a.order=i.order||0,a.index=n,a.label=""+i.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{const t=Mse.getController(o),{datasetElementType:i,dataElementType:s}=Nie.datasets[o];Object.assign(t,{dataElementType:Mse.getElement(s),datasetElementType:i&&Mse.getElement(i)}),a.controller=new t(this,n),e.push(a.controller)}}return this._updateMetasets(),e}_resetElements(){_ne(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let l=0,c=this.data.datasets.length;l<c;l++){const{controller:e}=this.getDatasetMeta(l),t=!i&&-1===a.indexOf(e);e.buildOrUpdateElements(t),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=n.layout.autoPadding?o:0,this._updateLayout(o),i||_ne(a,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(ere("z","_idx"));const{_active:s,_lastEvent:r}=this;r?this._eventHandler(r,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){_ne(this.scales,e=>{nse.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),n=new Set(e.events);Mne(t,n)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:a}of t){sre(e,i,"_removeElements"===n?-a:a)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+","+e.splice(1).join(","))),i=n(0);for(let a=1;a<t;a++)if(!Mne(i,n(a)))return;return Array.from(i).map(e=>e.split(",")).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;nse.update(this,this.width,this.height,e);const t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],_ne(this.boxes,e=>{n&&"chartArea"===e.position||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,One(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const n=this.getDatasetMeta(e),i={meta:n,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",i)&&(n.controller._update(t),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(eoe.has(this)?this.attached&&!eoe.running(this)&&eoe.start(this):(this.draw(),tre({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,n=[];let i,a;for(i=0,a=t.length;i<a;++i){const a=t[i];e&&!a.visible||n.push(a)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,n=e._clip,i=!n.disabled,a=function(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:rre(n,t,"left"),right:rre(n,t,"right"),top:rre(i,t,"top"),bottom:rre(i,t,"bottom")}:t}(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(i&&jie(t,{left:!1===n.left?0:a.left-n.left,right:!1===n.right?this.width:a.right+n.right,top:!1===n.top?0:a.top-n.top,bottom:!1===n.bottom?this.height:a.bottom+n.bottom}),e.controller.draw(),i&&Hie(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return Uie(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,i){const a=Hoe.modes[t];return"function"==typeof a?a(this,e,n,i):[]}getDatasetMeta(e){const t=this.data.datasets[e],n=this._metasets;let i=n.filter(e=>e&&e._dataset===t).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context=sae(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const n=this.getDatasetMeta(e);return"boolean"==typeof n.hidden?!n.hidden:!t.hidden}setDatasetVisibility(e,t){this.getDatasetMeta(e).hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){const i=n?"show":"hide",a=this.getDatasetMeta(e),o=a.controller._resolveAnimations(void 0,i);Pne(t)?(a.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),o.update(a,{visible:n}),this.update(t=>t.datasetIndex===e?i:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),eoe.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),qie(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete are[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,n=(n,i)=>{t.addEventListener(this,n,i),e[n]=i},i=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};_ne(this.options.events,e=>n(e,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,n=(n,i)=>{t.addEventListener(this,n,i),e[n]=i},i=(n,i)=>{e[n]&&(t.removeEventListener(this,n,i),delete e[n])},a=(e,t)=>{this.canvas&&this.resize(e,t)};let o;const s=()=>{i("attach",s),this.attached=!0,this.resize(),n("resize",a),n("detach",o)};o=()=>{this.attached=!1,i("resize",a),this._stop(),this._resize(0,0),n("attach",s)},t.isAttached(this.canvas)?s():o()}unbindEvents(){_ne(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},_ne(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){const i=n?"set":"remove";let a,o,s,r;for("dataset"===t&&(a=this.getDatasetMeta(e[0].datasetIndex),a.controller["_"+i+"DatasetHoverStyle"]()),s=0,r=e.length;s<r;++s){o=e[s];const t=o&&this.getDatasetMeta(o.datasetIndex).controller;t&&t[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{const n=this.getDatasetMeta(e);if(!n)throw new Error("No dataset found at index "+e);return{datasetIndex:e,element:n.data[t],index:t}});!wne(n,t)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return 1===this._plugins._cache.filter(t=>t.plugin.id===e).length}_updateHoverStyles(e,t,n){const i=this.options.hover,a=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),o=a(t,e),s=n?e:a(e,t);o.length&&this.updateHoverStyle(o,i.mode,!1),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,!0)}_eventHandler(e,t){const n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},i=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",n,i))return;const a=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(a||n.changed)&&this.render(),this}_handleEvent(e,t,n){const{_active:i=[],options:a}=this,o=t,s=this._getActiveElements(e,i,n,o),r=function(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}(e),l=function(e,t,n,i){return n&&"mouseout"!==e.type?i?t:e:null}(e,this._lastEvent,n,r);n&&(this._lastEvent=null,bne(a.onHover,[e,s,this],this),r&&bne(a.onClick,[e,s,this],this));const c=!wne(s,i);return(c||t)&&(this._active=s,this._updateHoverStyles(s,i,t)),this._lastEvent=l,c}_getActiveElements(e,t,n,i){if("mouseout"===e.type)return[];if(!n)return t;const a=this.options.hover;return this.getElementsAtEventForMode(e,a.mode,a,i)}}function cre(){return _ne(lre.instances,e=>e._plugins.invalidate())}function ure(e,t,n,i){const a=eae(e.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(n-t)/2,s=Math.min(o,i*t/2),r=e=>{const t=(n-Math.min(o,e))*i/2;return nie(e,0,Math.min(o,t))};return{outerStart:r(a.outerStart),outerEnd:r(a.outerEnd),innerStart:nie(a.innerStart,0,s),innerEnd:nie(a.innerEnd,0,s)}}function hre(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function dre(e,t,n,i,a,o){const{x:s,y:r,startAngle:l,pixelMargin:c,innerRadius:u}=t,h=Math.max(t.outerRadius+i+n-c,0),d=u>0?u+i+n+c:0;let f=0;const p=a-l;if(i){const e=((u>0?u-i:0)+(h>0?h-i:0))/2;f=(p-(0!==e?p*e/(e+i):p))/2}const g=(p-Math.max(.001,p*h-n/Nne)/h)/2,m=l+g+f,v=a-g-f,{outerStart:y,outerEnd:b,innerStart:_,innerEnd:w}=ure(t,d,h,v-m),k=h-y,x=h-b,T=m+y/k,C=v-b/x,E=d+_,S=d+w,I=m+_/E,A=v-w/S;if(e.beginPath(),o){const t=(T+C)/2;if(e.arc(s,r,h,T,t),e.arc(s,r,h,t,C),b>0){const t=hre(x,C,s,r);e.arc(t.x,t.y,b,C,v+Fne)}const n=hre(S,v,s,r);if(e.lineTo(n.x,n.y),w>0){const t=hre(S,A,s,r);e.arc(t.x,t.y,w,v+Fne,A+Math.PI)}const i=(v-w/d+(m+_/d))/2;if(e.arc(s,r,d,v-w/d,i,!0),e.arc(s,r,d,i,m+_/d,!0),_>0){const t=hre(E,I,s,r);e.arc(t.x,t.y,_,I+Math.PI,m-Fne)}const a=hre(k,m,s,r);if(e.lineTo(a.x,a.y),y>0){const t=hre(k,T,s,r);e.arc(t.x,t.y,y,m-Fne,T)}}else{e.moveTo(s,r);const t=Math.cos(T)*h+s,n=Math.sin(T)*h+r;e.lineTo(t,n);const i=Math.cos(C)*h+s,a=Math.sin(C)*h+r;e.lineTo(i,a)}e.closePath()}function fre(e,t,n,i,a){const{fullCircles:o,startAngle:s,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:d}=l,f="inner"===l.borderAlign;if(!c)return;e.setLineDash(h||[]),e.lineDashOffset=d,f?(e.lineWidth=2*c,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let p=t.endAngle;if(o){dre(e,t,n,i,p,a);for(let t=0;t<o;++t)e.stroke();isNaN(r)||(p=s+(r%Rne||Rne))}f&&function(e,t,n){const{startAngle:i,pixelMargin:a,x:o,y:s,outerRadius:r,innerRadius:l}=t;let c=a/r;e.beginPath(),e.arc(o,s,r,i-c,n+c),l>a?(c=a/l,e.arc(o,s,l,n+c,i-c,!0)):e.arc(o,s,a,n+Fne,i-Fne),e.closePath(),e.clip()}(e,t,p),o||(dre(e,t,n,i,p,a),e.stroke())}n(lre,"defaults",Nie),n(lre,"instances",are),n(lre,"overrides",Aie),n(lre,"registry",Mse),n(lre,"version","4.4.8"),n(lre,"getChart",ore);class pre extends _se{constructor(e){super(),n(this,"circumference"),n(this,"endAngle"),n(this,"fullCircles"),n(this,"innerRadius"),n(this,"outerRadius"),n(this,"pixelMargin"),n(this,"startAngle"),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){const i=this.getProps(["x","y"],n),{angle:a,distance:o}=Xne(i,{x:e,y:t}),{startAngle:s,endAngle:r,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),h=(this.options.spacing+this.options.borderWidth)/2,d=vne(u,r-s),f=tie(a,s,r)&&s!==r,p=d>=Rne||f,g=iie(o,l+h,c+h);return p&&g}getCenterPoint(e){const{x:t,y:n,startAngle:i,endAngle:a,innerRadius:o,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:r,spacing:l}=this.options,c=(i+a)/2,u=(o+s+l+r)/2;return{x:t+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:n}=this,i=(t.offset||0)/4,a=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin="inner"===t.borderAlign?.33:0,this.fullCircles=n>Rne?Math.floor(n/Rne):0,0===n||this.innerRadius<0||this.outerRadius<0)return;e.save();const s=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(s)*i,Math.sin(s)*i);const r=i*(1-Math.sin(Math.min(Nne,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,function(e,t,n,i,a){const{fullCircles:o,startAngle:s,circumference:r}=t;let l=t.endAngle;if(o){dre(e,t,n,i,l,a);for(let t=0;t<o;++t)e.fill();isNaN(r)||(l=s+(r%Rne||Rne))}dre(e,t,n,i,l,a),e.fill()}(e,this,r,a,o),fre(e,this,r,a,o),e.restore()}}function gre(e,t,n=t){e.lineCap=vne(n.borderCapStyle,t.borderCapStyle),e.setLineDash(vne(n.borderDash,t.borderDash)),e.lineDashOffset=vne(n.borderDashOffset,t.borderDashOffset),e.lineJoin=vne(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=vne(n.borderWidth,t.borderWidth),e.strokeStyle=vne(n.borderColor,t.borderColor)}function mre(e,t,n){e.lineTo(n.x,n.y)}function vre(e,t,n={}){const i=e.length,{start:a=0,end:o=i-1}=n,{start:s,end:r}=t,l=Math.max(a,s),c=Math.min(o,r),u=a<s&&o<s||a>r&&o>r;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function yre(e,t,n,i){const{points:a,options:o}=t,{count:s,start:r,loop:l,ilen:c}=vre(a,n,i),u=function(e){return e.stepped?zie:e.tension||"monotone"===e.cubicInterpolationMode?Wie:mre}(o);let h,d,f,{move:p=!0,reverse:g}=i||{};for(h=0;h<=c;++h)d=a[(r+(g?c-h:h))%s],d.skip||(p?(e.moveTo(d.x,d.y),p=!1):u(e,f,d,g,o.stepped),f=d);return l&&(d=a[(r+(g?c:0))%s],u(e,f,d,g,o.stepped)),!!l}function bre(e,t,n,i){const a=t.points,{count:o,start:s,ilen:r}=vre(a,n,i),{move:l=!0,reverse:c}=i||{};let u,h,d,f,p,g,m=0,v=0;const y=e=>(s+(c?r-e:e))%o,b=()=>{f!==p&&(e.lineTo(m,p),e.lineTo(m,f),e.lineTo(m,g))};for(l&&(h=a[y(0)],e.moveTo(h.x,h.y)),u=0;u<=r;++u){if(h=a[y(u)],h.skip)continue;const t=h.x,n=h.y,i=0|t;i===d?(n<f?f=n:n>p&&(p=n),m=(v*m+t)/++v):(b(),e.lineTo(t,n),d=i,v=0,f=p=n),g=n}b()}function _re(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!(e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||n)?bre:yre}n(pre,"id","arc"),n(pre,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),n(pre,"defaultRoutes",{backgroundColor:"backgroundColor"}),n(pre,"descriptors",{_scriptable:!0,_indexable:e=>"borderDash"!==e});const wre="function"==typeof Path2D;function kre(e,t,n,i){wre&&!t.options.segment?function(e,t,n,i){let a=t._path;a||(a=t._path=new Path2D,t.path(a,n,i)&&a.closePath()),gre(e,t.options),e.stroke(a)}(e,t,n,i):function(e,t,n,i){const{segments:a,options:o}=t,s=_re(t);for(const r of a)gre(e,o,r.style),e.beginPath(),s(e,t,r,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}(e,t,n,i)}class xre extends _se{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;Sae(this._points,n,e,i,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(e,t){const n=e.points,i=e.options.spanGaps,a=n.length;if(!a)return[];const o=!!e._loop,{start:s,end:r}=function(e,t,n,i){let a=0,o=t-1;if(n&&!i)for(;a<t&&!e[a].skip;)a++;for(;a<t&&e[a].skip;)a++;for(a%=t,n&&(o+=a);o>a&&e[o%t].skip;)o--;return o%=t,{start:a,end:o}}(n,a,o,i);return $ae(e,!0===i?[{start:s,end:r,loop:o}]:function(e,t,n,i){const a=e.length,o=[];let s,r=t,l=e[t];for(s=t+1;s<=n;++s){const n=e[s%a];n.skip||n.stop?l.skip||(i=!1,o.push({start:t%a,end:(s-1)%a,loop:i}),t=r=n.stop?s:null):(r=s,l.skip&&(t=s)),l=n}return null!==r&&o.push({start:t%a,end:r%a,loop:i}),o}(n,s,r<s?r+a:r,!!e._fullLoop&&0===s&&r===a-1),n,t)}(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){const n=this.options,i=e[t],a=this.points,o=Qae(this,{property:t,start:i,end:i});if(!o.length)return;const s=[],r=function(e){return e.stepped?Uae:e.tension||"monotone"===e.cubicInterpolationMode?jae:Bae}(n);let l,c;for(l=0,c=o.length;l<c;++l){const{start:c,end:u}=o[l],h=a[c],d=a[u];if(h===d){s.push(h);continue}const f=r(h,d,Math.abs((i-h[t])/(d[t]-h[t])),n.stepped);f[t]=e[t],s.push(f)}return 1===s.length?s[0]:s}pathSegment(e,t,n){return _re(this)(e,this,t,n)}path(e,t,n){const i=this.segments,a=_re(this);let o=this._loop;t=t||0,n=n||this.points.length-t;for(const s of i)o&=a(e,this,s,{start:t,end:t+n-1});return!!o}draw(e,t,n,i){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(e.save(),kre(e,this,n,i),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Tre(e,t,n,i){const a=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<a.radius+a.hitRadius}n(xre,"id","line"),n(xre,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),n(xre,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),n(xre,"descriptors",{_scriptable:!0,_indexable:e=>"borderDash"!==e&&"fill"!==e});class Cre extends _se{constructor(e){super(),n(this,"parsed"),n(this,"skip"),n(this,"stop"),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){const i=this.options,{x:a,y:o}=this.getProps(["x","y"],n);return Math.pow(e-a,2)+Math.pow(t-o,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(e,t){return Tre(this,e,"x",t)}inYRange(e,t){return Tre(this,e,"y",t)}getCenterPoint(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}size(e){let t=(e=e||this.options||{}).radius||0;t=Math.max(t,t&&e.hoverRadius||0);return 2*(t+(t&&e.borderWidth||0))}draw(e,t){const n=this.options;this.skip||n.radius<.1||!Uie(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Fie(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}function Ere(e,t){const{x:n,y:i,base:a,width:o,height:s}=e.getProps(["x","y","base","width","height"],t);let r,l,c,u,h;return e.horizontal?(h=s/2,r=Math.min(n,a),l=Math.max(n,a),c=i-h,u=i+h):(h=o/2,r=n-h,l=n+h,c=Math.min(i,a),u=Math.max(i,a)),{left:r,top:c,right:l,bottom:u}}function Sre(e,t,n,i){return e?0:nie(t,n,i)}function Ire(e){const t=Ere(e),n=t.right-t.left,i=t.bottom-t.top,a=function(e,t,n){const i=e.options.borderWidth,a=e.borderSkipped,o=tae(i);return{t:Sre(a.top,o.top,0,n),r:Sre(a.right,o.right,0,t),b:Sre(a.bottom,o.bottom,0,n),l:Sre(a.left,o.left,0,t)}}(e,n/2,i/2),o=function(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),a=e.options.borderRadius,o=nae(a),s=Math.min(t,n),r=e.borderSkipped,l=i||pne(a);return{topLeft:Sre(!l||r.top||r.left,o.topLeft,0,s),topRight:Sre(!l||r.top||r.right,o.topRight,0,s),bottomLeft:Sre(!l||r.bottom||r.left,o.bottomLeft,0,s),bottomRight:Sre(!l||r.bottom||r.right,o.bottomRight,0,s)}}(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:o},inner:{x:t.left+a.l,y:t.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,o.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(a.b,a.r))}}}}function Are(e,t,n,i){const a=null===t,o=null===n,s=e&&!(a&&o)&&Ere(e,i);return s&&(a||iie(t,s.left,s.right))&&(o||iie(n,s.top,s.bottom))}function Dre(e,t){e.rect(t.x,t.y,t.w,t.h)}function Pre(e,t,n={}){const i=e.x!==n.x?-t:0,a=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-i,s=(e.y+e.h!==n.y+n.h?t:0)-a;return{x:e.x+i,y:e.y+a,w:e.w+o,h:e.h+s,radius:e.radius}}n(Cre,"id","point"),n(Cre,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),n(Cre,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});class Ore extends _se{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:n,backgroundColor:i}}=this,{inner:a,outer:o}=Ire(this),s=(r=o.radius).topLeft||r.topRight||r.bottomLeft||r.bottomRight?Qie:Dre;var r;e.save(),o.w===a.w&&o.h===a.h||(e.beginPath(),s(e,Pre(o,t,a)),e.clip(),s(e,Pre(a,-t,o)),e.fillStyle=n,e.fill("evenodd")),e.beginPath(),s(e,Pre(a,t)),e.fillStyle=i,e.fill(),e.restore()}inRange(e,t,n){return Are(this,e,t,n)}inXRange(e,t){return Are(this,e,null,t)}inYRange(e,t){return Are(this,null,e,t)}getCenterPoint(e){const{x:t,y:n,base:i,horizontal:a}=this.getProps(["x","y","base","horizontal"],e);return{x:a?(t+i)/2:t,y:a?n:(n+i)/2}}getRange(e){return"x"===e?this.width/2:this.height/2}}n(Ore,"id","bar"),n(Ore,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),n(Ore,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Mre=Object.freeze({__proto__:null,ArcElement:pre,BarElement:Ore,LineElement:xre,PointElement:Cre});const Nre=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Rre=Nre.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Lre(e){return Nre[e%Nre.length]}function Vre(e){return Rre[e%Rre.length]}function qre(e){let t=0;return(n,i)=>{const a=e.getDatasetMeta(i).controller;a instanceof Soe?t=function(e,t){return e.backgroundColor=e.data.map(()=>Lre(t++)),t}(n,t):a instanceof Aoe?t=function(e,t){return e.backgroundColor=e.data.map(()=>Vre(t++)),t}(n,t):a&&(t=function(e,t){return e.borderColor=Lre(t),e.backgroundColor=Vre(t),++t}(n,t))}}function Fre(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}var Bre={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:a}=e.config,{elements:o}=a,s=Fre(i)||(r=a)&&(r.borderColor||r.backgroundColor)||o&&Fre(o)||"rgba(0,0,0,0.1)"!==Nie.borderColor||"rgba(0,0,0,0.1)"!==Nie.backgroundColor;var r;if(!n.forceOverride&&s)return;const l=qre(e);i.forEach(l)}};function Ure(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function jre(e){e.data.datasets.forEach(e=>{Ure(e)})}var Hre={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled)return void jre(e);const i=e.width;e.data.datasets.forEach((t,a)=>{const{_data:o,indexAxis:s}=t,r=e.getDatasetMeta(a),l=o||t.data;if("y"===oae([s,e.options.indexAxis]))return;if(!r.controller.supportsDecimation)return;const c=e.scales[r.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(e.options.parsing)return;let{start:u,count:h}=function(e,t){const n=t.length;let i,a=0;const{iScale:o}=e,{min:s,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(a=nie(oie(t,o.axis,s).lo,0,n-1)),i=c?nie(oie(t,o.axis,r).hi+1,a,n)-a:n-a,{start:a,count:i}}(r,l);if(h<=(n.threshold||4*i))return void Ure(t);let d;switch(dne(o)&&(t._data=l,delete t.data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(e){this._data=e}})),n.algorithm){case"lttb":d=function(e,t,n,i,a){const o=a.samples||i;if(o>=n)return e.slice(t,t+n);const s=[],r=(n-2)/(o-2);let l=0;const c=t+n-1;let u,h,d,f,p,g=t;for(s[l++]=e[g],u=0;u<o-2;u++){let i,a=0,o=0;const c=Math.floor((u+1)*r)+1+t,m=Math.min(Math.floor((u+2)*r)+1,n)+t,v=m-c;for(i=c;i<m;i++)a+=e[i].x,o+=e[i].y;a/=v,o/=v;const y=Math.floor(u*r)+1+t,b=Math.min(Math.floor((u+1)*r)+1,n)+t,{x:_,y:w}=e[g];for(d=f=-1,i=y;i<b;i++)f=.5*Math.abs((_-a)*(e[i].y-w)-(_-e[i].x)*(o-w)),f>d&&(d=f,h=e[i],p=i);s[l++]=h,g=p}return s[l++]=e[c],s}(l,u,h,i,n);break;case"min-max":d=function(e,t,n,i){let a,o,s,r,l,c,u,h,d,f,p=0,g=0;const m=[],v=t+n-1,y=e[t].x,b=e[v].x-y;for(a=t;a<t+n;++a){o=e[a],s=(o.x-y)/b*i,r=o.y;const t=0|s;if(t===l)r<d?(d=r,c=a):r>f&&(f=r,u=a),p=(g*p+o.x)/++g;else{const n=a-1;if(!dne(c)&&!dne(u)){const t=Math.min(c,u),i=Math.max(c,u);t!==h&&t!==n&&m.push({...e[t],x:p}),i!==h&&i!==n&&m.push({...e[i],x:p})}a>0&&n!==h&&m.push(e[n]),m.push(o),l=t,g=0,d=f=r,c=u=h=a}}return m}(l,u,h,i);break;default:throw new Error("Unsupported decimation algorithm '".concat(n.algorithm,"'"))}t._decimated=d})},destroy(e){jre(e)}};function zre(e,t,n,i){if(i)return;let a=t[e],o=n[e];return"angle"===e&&(a=eie(a),o=eie(o)),{property:e,start:a,end:o}}function Wre(e,t,n){for(;t>e;t--){const e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function Kre(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Gre(e,t){let n=[],i=!1;return fne(e)?(i=!0,n=e):n=function(e,t){const{x:n=null,y:i=null}=e||{},a=t.points,o=[];return t.segments.forEach(({start:e,end:t})=>{t=Wre(e,t,a);const s=a[e],r=a[t];null!==i?(o.push({x:s.x,y:i}),o.push({x:r.x,y:i})):null!==n&&(o.push({x:n,y:s.y}),o.push({x:n,y:r.y}))}),o}(e,t),n.length?new xre({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Yre(e){return e&&!1!==e.fill}function Qre(e,t,n){let i=e[t].fill;const a=[t];let o;if(!n)return i;for(;!1!==i&&-1===a.indexOf(i);){if(!gne(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;a.push(i),i=o.fill}return!1}function $re(e,t,n){const i=function(e){const t=e.options,n=t.fill;let i=vne(n&&n.target,n);void 0===i&&(i=!!t.backgroundColor);if(!1===i||null===i)return!1;if(!0===i)return"origin";return i}(e);if(pne(i))return!isNaN(i.value)&&i;let a=parseFloat(i);return gne(a)&&Math.floor(a)===a?function(e,t,n,i){"-"!==e&&"+"!==e||(n=t+n);if(n===t||n<0||n>=i)return!1;return n}(i[0],t,a,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Xre(e,t,n){const i=[];for(let a=0;a<n.length;a++){const o=n[a],{first:s,last:r,point:l}=Jre(o,t,"x");if(!(!l||s&&r))if(s)i.unshift(l);else if(e.push(l),!r)break}e.push(...i)}function Jre(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const a=i[n],o=e.segments,s=e.points;let r=!1,l=!1;for(let c=0;c<o.length;c++){const e=o[c],t=s[e.start][n],i=s[e.end][n];if(iie(a,t,i)){r=a===t,l=a===i;break}}return{first:r,last:l,point:i}}class Zre{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){const{x:i,y:a,radius:o}=this;return t=t||{start:0,end:Rne},e.arc(i,a,o,t.end,t.start,!0),!n.bounds}interpolate(e){const{x:t,y:n,radius:i}=this,a=e.angle;return{x:t+Math.cos(a)*i,y:n+Math.sin(a)*i,angle:a}}}function ele(e){const{chart:t,fill:n,line:i}=e;if(gne(n))return function(e,t){const n=e.getDatasetMeta(t),i=n&&e.isDatasetVisible(t);return i?n.dataset:null}(t,n);if("stack"===n)return function(e){const{scale:t,index:n,line:i}=e,a=[],o=i.segments,s=i.points,r=function(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let a=0;a<i.length;a++){const e=i[a];if(e.index===t)break;e.hidden||n.unshift(e.dataset)}return n}(t,n);r.push(Gre({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const e=o[l];for(let t=e.start;t<=e.end;t++)Xre(a,s[t],r)}return new xre({points:a,options:{}})}(e);if("shape"===n)return!0;const a=function(e){const t=e.scale||{};if(t.getPointPositionForValue)return function(e){const{scale:t,fill:n}=e,i=t.options,a=t.getLabels().length,o=i.reverse?t.max:t.min,s=function(e,t,n){let i;return i="start"===e?n:"end"===e?t.options.reverse?t.min:t.max:pne(e)?e.value:t.getBaseValue(),i}(n,t,o),r=[];if(i.grid.circular){const e=t.getPointPositionForValue(0,o);return new Zre({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<a;++l)r.push(t.getPointPositionForValue(l,s));return r}(e);return function(e){const{scale:t={},fill:n}=e,i=function(e,t){let n=null;return"start"===e?n=t.bottom:"end"===e?n=t.top:pne(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}(n,t);if(gne(i)){const e=t.isHorizontal();return{x:e?i:null,y:e?null:i}}return null}(e)}(e);return a instanceof Zre?a:Gre(a,i)}function tle(e,t,n){const i=ele(t),{line:a,scale:o,axis:s}=t,r=a.options,l=r.fill,c=r.backgroundColor,{above:u=c,below:h=c}=l||{};i&&a.points.length&&(jie(e,n),function(e,t){const{line:n,target:i,above:a,below:o,area:s,scale:r}=t,l=n._loop?"angle":t.axis;e.save(),"x"===l&&o!==a&&(nle(e,i,s.top),ile(e,{line:n,target:i,color:a,scale:r,property:l}),e.restore(),e.save(),nle(e,i,s.bottom));ile(e,{line:n,target:i,color:o,scale:r,property:l}),e.restore()}(e,{line:a,target:i,above:u,below:h,area:n,scale:o,axis:s}),Hie(e))}function nle(e,t,n){const{segments:i,points:a}=t;let o=!0,s=!1;e.beginPath();for(const r of i){const{start:i,end:l}=r,c=a[i],u=a[Wre(i,l,a)];o?(e.moveTo(c.x,c.y),o=!1):(e.lineTo(c.x,n),e.lineTo(c.x,c.y)),s=!!t.pathSegment(e,r,{move:s}),s?e.closePath():e.lineTo(u.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function ile(e,t){const{line:n,target:i,property:a,color:o,scale:s}=t,r=function(e,t,n){const i=e.segments,a=e.points,o=t.points,s=[];for(const r of i){let{start:e,end:i}=r;i=Wre(e,i,a);const l=zre(n,a[e],a[i],r.loop);if(!t.segments){s.push({source:r,target:l,start:a[e],end:a[i]});continue}const c=Qae(t,l);for(const t of c){const e=zre(n,o[t.start],o[t.end],t.loop),i=Yae(r,a,e);for(const a of i)s.push({source:a,target:t,start:{[n]:Kre(l,e,"start",Math.max)},end:{[n]:Kre(l,e,"end",Math.min)}})}}return s}(n,i,a);for(const{source:l,target:c,start:u,end:h}of r){const{style:{backgroundColor:t=o}={}}=l,r=!0!==i;e.save(),e.fillStyle=t,ale(e,s,r&&zre(a,u,h)),e.beginPath();const d=!!n.pathSegment(e,l);let f;if(r){d?e.closePath():ole(e,i,h,a);const t=!!i.pathSegment(e,c,{move:d,reverse:!0});f=d&&t,f||ole(e,i,u,a)}e.closePath(),e.fill(f?"evenodd":"nonzero"),e.restore()}}function ale(e,t,n){const{top:i,bottom:a}=t.chart.chartArea,{property:o,start:s,end:r}=n||{};"x"===o&&(e.beginPath(),e.rect(s,i,r-s,a-i),e.clip())}function ole(e,t,n,i){const a=t.interpolate(n,i);a&&e.lineTo(a.x,a.y)}var sle={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,a=[];let o,s,r,l;for(s=0;s<i;++s)o=e.getDatasetMeta(s),r=o.dataset,l=null,r&&r.options&&r instanceof xre&&(l={visible:e.isDatasetVisible(s),index:s,fill:$re(r,s,i),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,a.push(l);for(s=0;s<i;++s)l=a[s],l&&!1!==l.fill&&(l.fill=Qre(a,s,n.propagate))},beforeDraw(e,t,n){const i="beforeDraw"===n.drawTime,a=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let s=a.length-1;s>=0;--s){const t=a[s].$filler;t&&(t.line.updateControlPoints(o,t.axis),i&&t.fill&&tle(e.ctx,t,o))}},beforeDatasetsDraw(e,t,n){if("beforeDatasetsDraw"!==n.drawTime)return;const i=e.getSortedVisibleDatasetMetas();for(let a=i.length-1;a>=0;--a){const t=i[a].$filler;Yre(t)&&tle(e.ctx,t,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;Yre(i)&&"beforeDatasetDraw"===n.drawTime&&tle(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const rle=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}};class lle extends _se{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=bne(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display)return void(this.width=this.height=0);const n=e.labels,i=aae(n.font),a=i.size,o=this._computeTitleHeight(),{boxWidth:s,itemHeight:r}=rle(n,a);let l,c;t.font=i.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(o,a,s,r)+10):(c=this.maxHeight,l=this._fitCols(o,i,s,r)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,i){const{ctx:a,maxWidth:o,options:{labels:{padding:s}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],c=i+s;let u=e;a.textAlign="left",a.textBaseline="middle";let h=-1,d=-c;return this.legendItems.forEach((e,f)=>{const p=n+t/2+a.measureText(e.text).width;(0===f||l[l.length-1]+p+2*s>o)&&(u+=c,l[l.length-(f>0?0:1)]=0,d+=c,h++),r[f]={left:0,top:d,row:h,width:p,height:i},l[l.length-1]+=p+s}),u}_fitCols(e,t,n,i){const{ctx:a,maxHeight:o,options:{labels:{padding:s}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-e;let u=s,h=0,d=0,f=0,p=0;return this.legendItems.forEach((e,o)=>{const{itemWidth:g,itemHeight:m}=function(e,t,n,i,a){const o=function(e,t,n,i){let a=e.text;a&&"string"!=typeof a&&(a=a.reduce((e,t)=>e.length>t.length?e:t));return t+n.size/2+i.measureText(a).width}(i,e,t,n),s=function(e,t,n){let i=e;"string"!=typeof t.text&&(i=cle(t,n));return i}(a,i,t.lineHeight);return{itemWidth:o,itemHeight:s}}(n,t,a,e,i);o>0&&d+m+2*s>c&&(u+=h+s,l.push({width:h,height:d}),f+=h+s,p++,h=d=0),r[o]={left:f,top:d,col:p,width:g,height:m},h=Math.max(h,g),d+=m+s}),u+=h,l.push({width:h,height:d}),u}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:i},rtl:a}}=this,o=Hae(a,this.left,this.width);if(this.isHorizontal()){let a=0,s=fie(n,this.left+i,this.right-this.lineWidths[a]);for(const r of t)a!==r.row&&(a=r.row,s=fie(n,this.left+i,this.right-this.lineWidths[a])),r.top+=this.top+e+i,r.left=o.leftForLtr(o.x(s),r.width),s+=r.width+i}else{let a=0,s=fie(n,this.top+e+i,this.bottom-this.columnSizes[a].height);for(const r of t)r.col!==a&&(a=r.col,s=fie(n,this.top+e+i,this.bottom-this.columnSizes[a].height)),r.top=s,r.left+=this.left+i,r.left=o.leftForLtr(o.x(r.left),r.width),s+=r.height+i}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const e=this.ctx;jie(e,this),this._draw(),Hie(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:n,ctx:i}=this,{align:a,labels:o}=e,s=Nie.color,r=Hae(e.rtl,this.left,this.width),l=aae(o.font),{padding:c}=o,u=l.size,h=u/2;let d;this.drawTitle(),i.textAlign=r.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=l.string;const{boxWidth:f,boxHeight:p,itemHeight:g}=rle(o,u),m=this.isHorizontal(),v=this._computeTitleHeight();d=m?{x:fie(a,this.left+c,this.right-n[0]),y:this.top+c+v,line:0}:{x:this.left+c,y:fie(a,this.top+v+c,this.bottom-t[0].height),line:0},zae(this.ctx,e.textDirection);const y=g+c;this.legendItems.forEach((b,_)=>{i.strokeStyle=b.fontColor,i.fillStyle=b.fontColor;const w=i.measureText(b.text).width,k=r.textAlign(b.textAlign||(b.textAlign=o.textAlign)),x=f+h+w;let T=d.x,C=d.y;r.setWidth(this.width),m?_>0&&T+x+c>this.right&&(C=d.y+=y,d.line++,T=d.x=fie(a,this.left+c,this.right-n[d.line])):_>0&&C+y>this.bottom&&(T=d.x=T+t[d.line].width+c,d.line++,C=d.y=fie(a,this.top+v+c,this.bottom-t[d.line].height));if(function(e,t,n){if(isNaN(f)||f<=0||isNaN(p)||p<0)return;i.save();const a=vne(n.lineWidth,1);if(i.fillStyle=vne(n.fillStyle,s),i.lineCap=vne(n.lineCap,"butt"),i.lineDashOffset=vne(n.lineDashOffset,0),i.lineJoin=vne(n.lineJoin,"miter"),i.lineWidth=a,i.strokeStyle=vne(n.strokeStyle,s),i.setLineDash(vne(n.lineDash,[])),o.usePointStyle){const s={radius:p*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:a},l=r.xPlus(e,f/2);Bie(i,s,l,t+h,o.pointStyleWidth&&f)}else{const o=t+Math.max((u-p)/2,0),s=r.leftForLtr(e,f),l=nae(n.borderRadius);i.beginPath(),Object.values(l).some(e=>0!==e)?Qie(i,{x:s,y:o,w:f,h:p,radius:l}):i.rect(s,o,f,p),i.fill(),0!==a&&i.stroke()}i.restore()}(r.x(T),C,b),T=((e,t,n,i)=>e===(i?"left":"right")?n:"center"===e?(t+n)/2:t)(k,T+f+h,m?T+x:this.right,e.rtl),function(e,t,n){Yie(i,n.text,e,t+g/2,l,{strikethrough:n.hidden,textAlign:r.textAlign(n.textAlign)})}(r.x(T),C,b),m)d.x+=x+c;else if("string"!=typeof b.text){const e=l.lineHeight;d.y+=cle(b,e)+c}else d.y+=y}),Wae(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,n=aae(t.font),i=iae(t.padding);if(!t.display)return;const a=Hae(e.rtl,this.left,this.width),o=this.ctx,s=t.position,r=n.size/2,l=i.top+r;let c,u=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+l,u=fie(e.align,u,this.right-h);else{const t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);c=l+fie(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}const d=fie(s,u,u+h);o.textAlign=a.textAlign(die(s)),o.textBaseline="middle",o.strokeStyle=t.color,o.fillStyle=t.color,o.font=n.string,Yie(o,t.text,d,c,n)}_computeTitleHeight(){const e=this.options.title,t=aae(e.font),n=iae(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,i,a;if(iie(e,this.left,this.right)&&iie(t,this.top,this.bottom))for(a=this.legendHitBoxes,n=0;n<a.length;++n)if(i=a[n],iie(e,i.left,i.left+i.width)&&iie(t,i.top,i.top+i.height))return this.legendItems[n];return null}handleEvent(e){const t=this.options;if(!function(e,t){if(("mousemove"===e||"mouseout"===e)&&(t.onHover||t.onLeave))return!0;if(t.onClick&&("click"===e||"mouseup"===e))return!0;return!1}(e.type,t))return;const n=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){const o=this._hoveredItem,s=(a=n,null!==(i=o)&&null!==a&&i.datasetIndex===a.datasetIndex&&i.index===a.index);o&&!s&&bne(t.onLeave,[e,o,this],this),this._hoveredItem=n,n&&!s&&bne(t.onHover,[e,n,this],this)}else n&&bne(t.onClick,[e,n,this],this);var i,a}}function cle(e,t){return t*(e.text?e.text.length:0)}var ule={id:"legend",_element:lle,start(e,t,n){const i=e.legend=new lle({ctx:e.ctx,options:n,chart:e});nse.configure(e,i,n),nse.addBox(e,i)},stop(e){nse.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;nse.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,a=n.chart;a.isDatasetVisible(i)?(a.hide(i),t.hidden=!0):(a.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:a,color:o,useBorderRadius:s,borderRadius:r}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{const l=e.controller.getStyle(n?0:void 0),c=iae(l.borderWidth);return{text:t[e.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!e.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:i||l.pointStyle,rotation:l.rotation,textAlign:a||l.textAlign,borderRadius:s&&(r||l.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class hle extends _se{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){const n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=e,this.height=this.bottom=t;const i=fne(n.text)?n.text.length:1;this._padding=iae(n.padding);const a=i*aae(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const e=this.options.position;return"top"===e||"bottom"===e}_drawArgs(e){const{top:t,left:n,bottom:i,right:a,options:o}=this,s=o.align;let r,l,c,u=0;return this.isHorizontal()?(l=fie(s,n,a),c=t+e,r=a-n):("left"===o.position?(l=n+e,c=fie(s,i,t),u=-.5*Nne):(l=a-e,c=fie(s,t,i),u=.5*Nne),r=i-t),{titleX:l,titleY:c,maxWidth:r,rotation:u}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const n=aae(t.font),i=n.lineHeight/2+this._padding.top,{titleX:a,titleY:o,maxWidth:s,rotation:r}=this._drawArgs(i);Yie(e,t.text,0,0,n,{color:t.color,maxWidth:s,rotation:r,textAlign:die(t.align),textBaseline:"middle",translation:[a,o]})}}var dle={id:"title",_element:hle,start(e,t,n){!function(e,t){const n=new hle({ctx:e.ctx,options:t,chart:e});nse.configure(e,n,t),nse.addBox(e,n),e.titleBlock=n}(e,n)},stop(e){const t=e.titleBlock;nse.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;nse.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const fle=new WeakMap;var ple={id:"subtitle",start(e,t,n){const i=new hle({ctx:e.ctx,options:n,chart:e});nse.configure(e,i,n),nse.addBox(e,i),fle.set(e,i)},stop(e){nse.removeBox(e,fle.get(e)),fle.delete(e)},beforeUpdate(e,t,n){const i=fle.get(e);nse.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const gle={average(e){if(!e.length)return!1;let t,n,i=new Set,a=0,o=0;for(t=0,n=e.length;t<n;++t){const n=e[t].element;if(n&&n.hasValue()){const e=n.tooltipPosition();i.add(e.x),a+=e.y,++o}}if(0===o||0===i.size)return!1;return{x:[...i].reduce((e,t)=>e+t)/i.size,y:a/o}},nearest(e,t){if(!e.length)return!1;let n,i,a,o=t.x,s=t.y,r=Number.POSITIVE_INFINITY;for(n=0,i=e.length;n<i;++n){const i=e[n].element;if(i&&i.hasValue()){const e=Jne(t,i.getCenterPoint());e<r&&(r=e,a=i)}}if(a){const e=a.tooltipPosition();o=e.x,s=e.y}return{x:o,y:s}}};function mle(e,t){return t&&(fne(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function vle(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function yle(e,t){const{element:n,datasetIndex:i,index:a}=t,o=e.getDatasetMeta(i).controller,{label:s,value:r}=o.getLabelAndValue(a);return{chart:e,label:s,parsed:o.getParsed(a),raw:e.data.datasets[i].data[a],formattedValue:r,dataset:o.getDataset(),dataIndex:a,datasetIndex:i,element:n}}function ble(e,t){const n=e.chart.ctx,{body:i,footer:a,title:o}=e,{boxWidth:s,boxHeight:r}=t,l=aae(t.bodyFont),c=aae(t.titleFont),u=aae(t.footerFont),h=o.length,d=a.length,f=i.length,p=iae(t.padding);let g=p.height,m=0,v=i.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,h&&(g+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),v){g+=f*(t.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(v-f)*l.lineHeight+(v-1)*t.bodySpacing}d&&(g+=t.footerMarginTop+d*u.lineHeight+(d-1)*t.footerSpacing);let y=0;const b=function(e){m=Math.max(m,n.measureText(e).width+y)};return n.save(),n.font=c.string,_ne(e.title,b),n.font=l.string,_ne(e.beforeBody.concat(e.afterBody),b),y=t.displayColors?s+2+t.boxPadding:0,_ne(i,e=>{_ne(e.before,b),_ne(e.lines,b),_ne(e.after,b)}),y=0,n.font=u.string,_ne(e.footer,b),n.restore(),m+=p.width,{width:m,height:g}}function _le(e,t,n,i){const{x:a,width:o}=n,{width:s,chartArea:{left:r,right:l}}=e;let c="center";return"center"===i?c=a<=(r+l)/2?"left":"right":a<=o/2?c="left":a>=s-o/2&&(c="right"),function(e,t,n,i){const{x:a,width:o}=i,s=n.caretSize+n.caretPadding;return"left"===e&&a+o+s>t.width||"right"===e&&a-o-s<0||void 0}(c,e,t,n)&&(c="center"),c}function wle(e,t,n){const i=n.yAlign||t.yAlign||function(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}(e,n);return{xAlign:n.xAlign||t.xAlign||_le(e,t,n,i),yAlign:i}}function kle(e,t,n,i){const{caretSize:a,caretPadding:o,cornerRadius:s}=e,{xAlign:r,yAlign:l}=n,c=a+o,{topLeft:u,topRight:h,bottomLeft:d,bottomRight:f}=nae(s);let p=function(e,t){let{x:n,width:i}=e;return"right"===t?n-=i:"center"===t&&(n-=i/2),n}(t,r);const g=function(e,t,n){let{y:i,height:a}=e;return"top"===t?i+=n:i-="bottom"===t?a+n:a/2,i}(t,l,c);return"center"===l?"left"===r?p+=c:"right"===r&&(p-=c):"left"===r?p-=Math.max(u,d)+a:"right"===r&&(p+=Math.max(h,f)+a),{x:nie(p,0,i.width-t.width),y:nie(g,0,i.height-t.height)}}function xle(e,t,n){const i=iae(n.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-i.right:e.x+i.left}function Tle(e){return mle([],vle(e))}function Cle(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Ele={beforeTitle:une,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return n[t.dataIndex]}return""},afterTitle:une,beforeBody:une,beforeLabel:une,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return dne(n)||(t+=n),t},labelColor(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:une,afterBody:une,beforeFooter:une,footer:une,afterFooter:une};function Sle(e,t,n,i){const a=e[t].call(n,i);return void 0===a?Ele[t].call(n,i):a}class Ile extends _se{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&t.options.animation&&n.animations,a=new aoe(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=(e=this.chart.getContext(),t=this,n=this._tooltipItems,sae(e,{tooltip:t,tooltipItems:n,type:"tooltip"})));var e,t,n}getTitle(e,t){const{callbacks:n}=t,i=Sle(n,"beforeTitle",this,e),a=Sle(n,"title",this,e),o=Sle(n,"afterTitle",this,e);let s=[];return s=mle(s,vle(i)),s=mle(s,vle(a)),s=mle(s,vle(o)),s}getBeforeBody(e,t){return Tle(Sle(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:n}=t,i=[];return _ne(e,e=>{const t={before:[],lines:[],after:[]},a=Cle(n,e);mle(t.before,vle(Sle(a,"beforeLabel",this,e))),mle(t.lines,Sle(a,"label",this,e)),mle(t.after,vle(Sle(a,"afterLabel",this,e))),i.push(t)}),i}getAfterBody(e,t){return Tle(Sle(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:n}=t,i=Sle(n,"beforeFooter",this,e),a=Sle(n,"footer",this,e),o=Sle(n,"afterFooter",this,e);let s=[];return s=mle(s,vle(i)),s=mle(s,vle(a)),s=mle(s,vle(o)),s}_createItems(e){const t=this._active,n=this.chart.data,i=[],a=[],o=[];let s,r,l=[];for(s=0,r=t.length;s<r;++s)l.push(yle(this.chart,t[s]));return e.filter&&(l=l.filter((t,i,a)=>e.filter(t,i,a,n))),e.itemSort&&(l=l.sort((t,i)=>e.itemSort(t,i,n))),_ne(l,t=>{const n=Cle(e.callbacks,t);i.push(Sle(n,"labelColor",this,t)),a.push(Sle(n,"labelPointStyle",this,t)),o.push(Sle(n,"labelTextColor",this,t))}),this.labelColors=i,this.labelPointStyles=a,this.labelTextColors=o,this.dataPoints=l,l}update(e,t){const n=this.options.setContext(this.getContext()),i=this._active;let a,o=[];if(i.length){const e=gle[n.position].call(this,i,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const t=this._size=ble(this,n),s=Object.assign({},e,t),r=wle(this.chart,n,s),l=kle(n,s,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,a={opacity:1,x:l.x,y:l.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}else 0!==this.opacity&&(a={opacity:0});this._tooltipItems=o,this.$context=void 0,a&&this._resolveAnimations().update(this,a),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,i){const a=this.getCaretPosition(e,n,i);t.lineTo(a.x1,a.y1),t.lineTo(a.x2,a.y2),t.lineTo(a.x3,a.y3)}getCaretPosition(e,t,n){const{xAlign:i,yAlign:a}=this,{caretSize:o,cornerRadius:s}=n,{topLeft:r,topRight:l,bottomLeft:c,bottomRight:u}=nae(s),{x:h,y:d}=e,{width:f,height:p}=t;let g,m,v,y,b,_;return"center"===a?(b=d+p/2,"left"===i?(g=h,m=g-o,y=b+o,_=b-o):(g=h+f,m=g+o,y=b-o,_=b+o),v=g):(m="left"===i?h+Math.max(r,c)+o:"right"===i?h+f-Math.max(l,u)-o:this.caretX,"top"===a?(y=d,b=y-o,g=m-o,v=m+o):(y=d+p,b=y+o,g=m+o,v=m-o),_=y),{x1:g,x2:m,x3:v,y1:y,y2:b,y3:_}}drawTitle(e,t,n){const i=this.title,a=i.length;let o,s,r;if(a){const l=Hae(n.rtl,this.x,this.width);for(e.x=xle(this,n.titleAlign,n),t.textAlign=l.textAlign(n.titleAlign),t.textBaseline="middle",o=aae(n.titleFont),s=n.titleSpacing,t.fillStyle=n.titleColor,t.font=o.string,r=0;r<a;++r)t.fillText(i[r],l.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+s,r+1===a&&(e.y+=n.titleMarginBottom-s)}}_drawColorBox(e,t,n,i,a){const o=this.labelColors[n],s=this.labelPointStyles[n],{boxHeight:r,boxWidth:l}=a,c=aae(a.bodyFont),u=xle(this,"left",a),h=i.x(u),d=r<c.lineHeight?(c.lineHeight-r)/2:0,f=t.y+d;if(a.usePointStyle){const t={radius:Math.min(l,r)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},n=i.leftForLtr(h,l)+l/2,c=f+r/2;e.strokeStyle=a.multiKeyBackground,e.fillStyle=a.multiKeyBackground,Fie(e,t,n,c),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Fie(e,t,n,c)}else{e.lineWidth=pne(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const t=i.leftForLtr(h,l),n=i.leftForLtr(i.xPlus(h,1),l-2),s=nae(o.borderRadius);Object.values(s).some(e=>0!==e)?(e.beginPath(),e.fillStyle=a.multiKeyBackground,Qie(e,{x:t,y:f,w:l,h:r,radius:s}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Qie(e,{x:n,y:f+1,w:l-2,h:r-2,radius:s}),e.fill()):(e.fillStyle=a.multiKeyBackground,e.fillRect(t,f,l,r),e.strokeRect(t,f,l,r),e.fillStyle=o.backgroundColor,e.fillRect(n,f+1,l-2,r-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){const{body:i}=this,{bodySpacing:a,bodyAlign:o,displayColors:s,boxHeight:r,boxWidth:l,boxPadding:c}=n,u=aae(n.bodyFont);let h=u.lineHeight,d=0;const f=Hae(n.rtl,this.x,this.width),p=function(n){t.fillText(n,f.x(e.x+d),e.y+h/2),e.y+=h+a},g=f.textAlign(o);let m,v,y,b,_,w,k;for(t.textAlign=o,t.textBaseline="middle",t.font=u.string,e.x=xle(this,g,n),t.fillStyle=n.bodyColor,_ne(this.beforeBody,p),d=s&&"right"!==g?"center"===o?l/2+c:l+2+c:0,b=0,w=i.length;b<w;++b){for(m=i[b],v=this.labelTextColors[b],t.fillStyle=v,_ne(m.before,p),y=m.lines,s&&y.length&&(this._drawColorBox(t,e,b,f,n),h=Math.max(u.lineHeight,r)),_=0,k=y.length;_<k;++_)p(y[_]),h=u.lineHeight;_ne(m.after,p)}d=0,h=u.lineHeight,_ne(this.afterBody,p),e.y-=a}drawFooter(e,t,n){const i=this.footer,a=i.length;let o,s;if(a){const r=Hae(n.rtl,this.x,this.width);for(e.x=xle(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=r.textAlign(n.footerAlign),t.textBaseline="middle",o=aae(n.footerFont),t.fillStyle=n.footerColor,t.font=o.string,s=0;s<a;++s)t.fillText(i[s],r.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+n.footerSpacing}}drawBackground(e,t,n,i){const{xAlign:a,yAlign:o}=this,{x:s,y:r}=e,{width:l,height:c}=n,{topLeft:u,topRight:h,bottomLeft:d,bottomRight:f}=nae(i.cornerRadius);t.fillStyle=i.backgroundColor,t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.beginPath(),t.moveTo(s+u,r),"top"===o&&this.drawCaret(e,t,n,i),t.lineTo(s+l-h,r),t.quadraticCurveTo(s+l,r,s+l,r+h),"center"===o&&"right"===a&&this.drawCaret(e,t,n,i),t.lineTo(s+l,r+c-f),t.quadraticCurveTo(s+l,r+c,s+l-f,r+c),"bottom"===o&&this.drawCaret(e,t,n,i),t.lineTo(s+d,r+c),t.quadraticCurveTo(s,r+c,s,r+c-d),"center"===o&&"left"===a&&this.drawCaret(e,t,n,i),t.lineTo(s,r+u),t.quadraticCurveTo(s,r,s+u,r),t.closePath(),t.fill(),i.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,n=this.$animations,i=n&&n.x,a=n&&n.y;if(i||a){const n=gle[e.position].call(this,this._active,this._eventPosition);if(!n)return;const o=this._size=ble(this,e),s=Object.assign({},n,this._size),r=wle(t,e,s),l=kle(e,s,r,t);i._to===l.x&&a._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(t);const i={width:this.width,height:this.height},a={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=iae(t.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&s&&(e.save(),e.globalAlpha=n,this.drawBackground(a,e,i,t),zae(e,t.textDirection),a.y+=o.top,this.drawTitle(a,e,t),this.drawBody(a,e,t),this.drawFooter(a,e,t),Wae(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const n=this._active,i=e.map(({datasetIndex:e,index:t})=>{const n=this.chart.getDatasetMeta(e);if(!n)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:n.data[t],index:t}}),a=!wne(n,i),o=this._positionChanged(i,t);(a||o)&&(this._active=i,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,a=this._active||[],o=this._getActiveElements(e,a,t,n),s=this._positionChanged(o,e),r=t||!wne(o,a)||s;return r&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),r}_getActiveElements(e,t,n,i){const a=this.options;if("mouseout"===e.type)return[];if(!i)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&void 0!==this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index));const o=this.chart.getElementsAtEventForMode(e,a.mode,a,n);return a.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:n,caretY:i,options:a}=this,o=gle[a.position].call(this,e,t);return!1!==o&&(n!==o.x||i!==o.y)}}n(Ile,"positioners",gle);var Ale={id:"tooltip",_element:Ile,positioners:gle,afterInit(e,t,n){n&&(e.tooltip=new Ile({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(!1===e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0}))return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ele},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>"filter"!==e&&"itemSort"!==e&&"external"!==e,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Dle=Object.freeze({__proto__:null,Colors:Bre,Decimation:Hre,Filler:sle,Legend:ule,SubTitle:ple,Title:dle,Tooltip:Ale});function Ple(e,t,n,i){const a=e.indexOf(t);if(-1===a)return((e,t,n,i)=>("string"==typeof t?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n))(e,t,n,i);return a!==e.lastIndexOf(t)?n:a}function Ole(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Mle extends Dse{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const e=this.getLabels();for(const{index:n,label:i}of t)e[n]===i&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(dne(e))return null;const n=this.getLabels();return((e,t)=>null===e?null:nie(Math.round(e),0,t))(t=isFinite(t)&&n[t]===e?t:Ple(n,e,vne(t,e),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:n,max:i}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(n=0),t||(i=this.getLabels().length-1)),this.min=n,this.max=i}buildTicks(){const e=this.min,t=this.max,n=this.options.offset,i=[];let a=this.getLabels();a=0===e&&t===a.length-1?a:a.slice(e,t+1),this._valueRange=Math.max(a.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let o=e;o<=t;o++)i.push({value:o});return i}getLabelForValue(e){return Ole.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return"number"!=typeof e&&(e=this.parse(e)),null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function Nle(e,t){const n=[],{bounds:i,step:a,min:o,max:s,precision:r,count:l,maxTicks:c,maxDigits:u,includeBounds:h}=e,d=a||1,f=c-1,{min:p,max:g}=t,m=!dne(o),v=!dne(s),y=!dne(l),b=(g-p)/(u+1);let _,w,k,x,T=Wne((g-p)/f/d)*d;if(T<1e-14&&!m&&!v)return[{value:p},{value:g}];x=Math.ceil(g/T)-Math.floor(p/T),x>f&&(T=Wne(x*T/f/d)*d),dne(r)||(_=Math.pow(10,r),T=Math.ceil(T*_)/_),"ticks"===i?(w=Math.floor(p/T)*T,k=Math.ceil(g/T)*T):(w=p,k=g),m&&v&&a&&function(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}((s-o)/a,T/1e3)?(x=Math.round(Math.min((s-o)/T,c)),T=(s-o)/x,w=o,k=s):y?(w=m?o:w,k=v?s:k,x=l-1,T=(k-w)/x):(x=(k-w)/T,x=zne(x,Math.round(x),T/1e3)?Math.round(x):Math.ceil(x));const C=Math.max($ne(T),$ne(w));_=Math.pow(10,dne(r)?C:r),w=Math.round(w*_)/_,k=Math.round(k*_)/_;let E=0;for(m&&(h&&w!==o?(n.push({value:o}),w<o&&E++,zne(Math.round((w+E*T)*_)/_,o,Rle(o,b,e))&&E++):w<o&&E++);E<x;++E){const e=Math.round((w+E*T)*_)/_;if(v&&e>s)break;n.push({value:e})}return v&&h&&k!==s?n.length&&zne(n[n.length-1].value,s,Rle(s,b,e))?n[n.length-1].value=s:n.push({value:s}):v&&k!==s||n.push({value:k}),n}function Rle(e,t,{horizontal:n,minRotation:i}){const a=Yne(i),o=(n?Math.sin(a):Math.cos(a))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}n(Mle,"id","category"),n(Mle,"defaults",{ticks:{callback:Ole}});class Lle extends Dse{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return dne(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:a}=this;const o=e=>i=t?i:e,s=e=>a=n?a:e;if(e){const e=Hne(i),t=Hne(a);e<0&&t<0?s(0):e>0&&t>0&&o(0)}if(i===a){let t=0===a?1:Math.abs(.05*a);s(a+t),e||o(i-t)}this.min=i,this.max=a}getTickLimit(){const e=this.options.ticks;let t,{maxTicksLimit:n,stepSize:i}=e;return i?(t=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,t>1e3&&(t=1e3)):(t=this.computeTickLimit(),n=n||11),n&&(t=Math.min(n,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i=Nle({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&Gne(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const e=this.ticks;let t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){const i=(n-t)/Math.max(e.length-1,1)/2;t-=i,n+=i}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return Eie(e,this.chart.options.locale,this.options.ticks.format)}}class Vle extends Lle{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=gne(e)?e:0,this.max=gne(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,n=Yne(this.options.ticks.minRotation),i=(e?Math.sin(n):Math.cos(n))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,a.lineHeight/i))}getPixelForValue(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}n(Vle,"id","linear"),n(Vle,"defaults",{ticks:{callback:Iie.formatters.numeric}});const qle=e=>Math.floor(jne(e)),Fle=(e,t)=>Math.pow(10,qle(e)+t);function Ble(e){return 1===e/Math.pow(10,qle(e))}function Ule(e,t,n){const i=Math.pow(10,n),a=Math.floor(e/i);return Math.ceil(t/i)-a}function jle(e,{min:t,max:n}){t=mne(e.min,t);const i=[],a=qle(t);let o=function(e,t){let n=qle(t-e);for(;Ule(e,t,n)>10;)n++;for(;Ule(e,t,n)<10;)n--;return Math.min(n,qle(e))}(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),l=a>o?Math.pow(10,a):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/r/10)*r*10;let h=Math.floor((c-u)/Math.pow(10,o)),d=mne(e.min,Math.round((l+u+h*Math.pow(10,o))*s)/s);for(;d<n;)i.push({value:d,major:Ble(d),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,s=o>=0?1:s),d=Math.round((l+u+h*Math.pow(10,o))*s)/s;const f=mne(e.max,d);return i.push({value:f,major:Ble(f),significand:h}),i}class Hle extends Dse{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const n=Lle.prototype.parse.apply(this,[e,t]);if(0!==n)return gne(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=gne(e)?Math.max(0,e):null,this.max=gne(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!gne(this._userMin)&&(this.min=e===Fle(this.min,0)?Fle(this.min,-1):Fle(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let n=this.min,i=this.max;const a=t=>n=e?n:t,o=e=>i=t?i:e;n===i&&(n<=0?(a(1),o(10)):(a(Fle(n,-1)),o(Fle(i,1)))),n<=0&&a(Fle(i,-1)),i<=0&&o(Fle(n,1)),this.min=n,this.max=i}buildTicks(){const e=this.options,t=jle({min:this._userMin,max:this._userMax},this);return"ticks"===e.bounds&&Gne(t,this,"value"),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return void 0===e?"0":Eie(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=jne(e),this._valueRange=jne(this.max)-jne(e)}getPixelForValue(e){return void 0!==e&&0!==e||(e=this.min),null===e||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(jne(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}function zle(e){const t=e.ticks;if(t.display&&e.display){const e=iae(t.backdropPadding);return vne(t.font&&t.font.size,Nie.font.size)+e.height}return 0}function Wle(e,t,n){return n=fne(n)?n:[n],{w:Lie(e,t.string,n),h:n.length*t.lineHeight}}function Kle(e,t,n,i,a){return e===i||e===a?{start:t-n/2,end:t+n/2}:e<i||e>a?{start:t-n,end:t}:{start:t,end:t+n}}function Gle(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],a=[],o=e._pointLabels.length,s=e.options.pointLabels,r=s.centerPointLabels?Nne/o:0;for(let l=0;l<o;l++){const o=s.setContext(e.getPointLabelContext(l));a[l]=o.padding;const c=e.getPointPosition(l,e.drawingArea+a[l],r),u=aae(o.font),h=Wle(e.ctx,u,e._pointLabels[l]);i[l]=h;const d=eie(e.getIndexAngle(l)+r),f=Math.round(Qne(d));Yle(n,t,d,Kle(f,c.x,h.w,0,180),Kle(f,c.y,h.h,90,270))}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=function(e,t,n){const i=[],a=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:r}=o.pointLabels,l={extra:zle(o)/2,additionalAngle:s?Nne/a:0};let c;for(let u=0;u<a;u++){l.padding=n[u],l.size=t[u];const a=Qle(e,u,l);i.push(a),"auto"===r&&(a.visible=$le(a,c),a.visible&&(c=a))}return i}(e,i,a)}function Yle(e,t,n,i,a){const o=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let r=0,l=0;i.start<t.l?(r=(t.l-i.start)/o,e.l=Math.min(e.l,t.l-r)):i.end>t.r&&(r=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+r)),a.start<t.t?(l=(t.t-a.start)/s,e.t=Math.min(e.t,t.t-l)):a.end>t.b&&(l=(a.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function Qle(e,t,n){const i=e.drawingArea,{extra:a,additionalAngle:o,padding:s,size:r}=n,l=e.getPointPosition(t,i+a+s,o),c=Math.round(Qne(eie(l.angle+Fne))),u=function(e,t,n){90===n||270===n?e-=t/2:(n>270||n<90)&&(e-=t);return e}(l.y,r.h,c),h=function(e){if(0===e||180===e)return"center";if(e<180)return"left";return"right"}(c),d=function(e,t,n){"right"===n?e-=t:"center"===n&&(e-=t/2);return e}(l.x,r.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:d,top:u,right:d+r.w,bottom:u+r.h}}function $le(e,t){if(!t)return!0;const{left:n,top:i,right:a,bottom:o}=e;return!(Uie({x:n,y:i},t)||Uie({x:n,y:o},t)||Uie({x:a,y:i},t)||Uie({x:a,y:o},t))}function Xle(e,t,n){const{left:i,top:a,right:o,bottom:s}=n,{backdropColor:r}=t;if(!dne(r)){const n=nae(t.borderRadius),l=iae(t.backdropPadding);e.fillStyle=r;const c=i-l.left,u=a-l.top,h=o-i+l.width,d=s-a+l.height;Object.values(n).some(e=>0!==e)?(e.beginPath(),Qie(e,{x:c,y:u,w:h,h:d,radius:n}),e.fill()):e.fillRect(c,u,h,d)}}function Jle(e,t,n,i){const{ctx:a}=e;if(n)a.arc(e.xCenter,e.yCenter,t,0,Rne);else{let n=e.getPointPosition(0,t);a.moveTo(n.x,n.y);for(let o=1;o<i;o++)n=e.getPointPosition(o,t),a.lineTo(n.x,n.y)}}n(Hle,"id","logarithmic"),n(Hle,"defaults",{ticks:{callback:Iie.formatters.logarithmic,major:{enabled:!0}}});class Zle extends Lle{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=iae(zle(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=gne(e)&&!isNaN(e)?e:0,this.max=gne(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/zle(this.options))}generateTickLabels(e){Lle.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((e,t)=>{const n=bne(this.options.pointLabels.callback,[e,t],this);return n||0===n?n:""}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){const e=this.options;e.display&&e.pointLabels.display?Gle(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,i){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,i))}getIndexAngle(e){return eie(e*(Rne/(this._pointLabels.length||1))+Yne(this.options.startAngle||0))}getDistanceFromCenterForValue(e){if(dne(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(dne(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const n=t[e];return function(e,t,n){return sae(e,{label:n,index:t,type:"pointLabel"})}(this.getContext(),e,n)}}getPointPosition(e,t,n=0){const i=this.getIndexAngle(e)-Fne+n;return{x:Math.cos(i)*t+this.xCenter,y:Math.sin(i)*t+this.yCenter,angle:i}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:n,right:i,bottom:a}=this._pointLabelItems[e];return{left:t,top:n,right:i,bottom:a}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const n=this.ctx;n.save(),n.beginPath(),Jle(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:n,grid:i,border:a}=t,o=this._pointLabels.length;let s,r,l;if(t.pointLabels.display&&function(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let a=t-1;a>=0;a--){const t=e._pointLabelItems[a];if(!t.visible)continue;const o=i.setContext(e.getPointLabelContext(a));Xle(n,o,t);const s=aae(o.font),{x:r,y:l,textAlign:c}=t;Yie(n,e._pointLabels[a],r,l+s.lineHeight/2,s,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,o),i.display&&this.ticks.forEach((e,t)=>{if(0!==t||0===t&&this.min<0){r=this.getDistanceFromCenterForValue(e.value);const n=this.getContext(t),s=i.setContext(n),l=a.setContext(n);!function(e,t,n,i,a){const o=e.ctx,s=t.circular,{color:r,lineWidth:l}=t;!s&&!i||!r||!l||n<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(a.dash||[]),o.lineDashOffset=a.dashOffset,o.beginPath(),Jle(e,n,s,i),o.closePath(),o.stroke(),o.restore())}(this,s,r,o,l)}}),n.display){for(e.save(),s=o-1;s>=0;s--){const i=n.setContext(this.getPointLabelContext(s)),{color:a,lineWidth:o}=i;o&&a&&(e.lineWidth=o,e.strokeStyle=a,e.setLineDash(i.borderDash),e.lineDashOffset=i.borderDashOffset,r=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),l=this.getPointPosition(s,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;const i=this.getIndexAngle(0);let a,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(i),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((i,s)=>{if(0===s&&this.min>=0&&!t.reverse)return;const r=n.setContext(this.getContext(s)),l=aae(r.font);if(a=this.getDistanceFromCenterForValue(this.ticks[s].value),r.showLabelBackdrop){e.font=l.string,o=e.measureText(i.label).width,e.fillStyle=r.backdropColor;const t=iae(r.backdropPadding);e.fillRect(-o/2-t.left,-a-l.size/2-t.top,o+t.width,l.size+t.height)}Yie(e,i.label,0,-a,l,{color:r.color,strokeColor:r.textStrokeColor,strokeWidth:r.textStrokeWidth})}),e.restore()}drawTitle(){}}n(Zle,"id","radialLinear"),n(Zle,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Iie.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:e=>e,padding:5,centerPointLabels:!1}}),n(Zle,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),n(Zle,"descriptors",{angleLines:{_fallback:"grid"}});const ece={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},tce=Object.keys(ece);function nce(e,t){return e-t}function ice(e,t){if(dne(t))return null;const n=e._adapter,{parser:i,round:a,isoWeekday:o}=e._parseOpts;let s=t;return"function"==typeof i&&(s=i(s)),gne(s)||(s="string"==typeof i?n.parse(s,i):n.parse(s)),null===s?null:(a&&(s="week"!==a||!Kne(o)&&!0!==o?n.startOf(s,a):n.startOf(s,"isoWeek",o)),+s)}function ace(e,t,n,i){const a=tce.length;for(let o=tce.indexOf(e);o<a-1;++o){const e=ece[tce[o]],a=e.steps?e.steps:Number.MAX_SAFE_INTEGER;if(e.common&&Math.ceil((n-t)/(a*e.size))<=i)return tce[o]}return tce[a-1]}function oce(e,t,n){if(n){if(n.length){const{lo:i,hi:a}=aie(n,t);e[n[i]>=t?n[i]:n[a]]=!0}}else e[t]=!0}function sce(e,t,n){const i=[],a={},o=t.length;let s,r;for(s=0;s<o;++s)r=t[s],a[r]=s,i.push({value:r,major:!1});return 0!==o&&n?function(e,t,n,i){const a=e._adapter,o=+a.startOf(t[0].value,i),s=t[t.length-1].value;let r,l;for(r=o;r<=s;r=+a.add(r,1,i))l=n[r],l>=0&&(t[l].major=!0);return t}(e,i,a,n):i}class rce extends Dse{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){const n=e.time||(e.time={}),i=this._adapter=new Loe(e.adapters.date);i.init(t),Ene(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return void 0===e?null:ice(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,n=e.time.unit||"day";let{min:i,max:a,minDefined:o,maxDefined:s}=this.getUserBounds();function r(e){o||isNaN(e.min)||(i=Math.min(i,e.min)),s||isNaN(e.max)||(a=Math.max(a,e.max))}o&&s||(r(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||r(this.getMinMax(!1))),i=gne(i)&&!isNaN(i)?i:+t.startOf(Date.now(),n),a=gne(a)&&!isNaN(a)?a:+t.endOf(Date.now(),n)+1,this.min=Math.min(i,a-1),this.max=Math.max(i+1,a)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){const e=this.options,t=e.time,n=e.ticks,i="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const a=this.min,o=function(e,t,n){let i=0,a=e.length;for(;i<a&&e[i]<t;)i++;for(;a>i&&e[a-1]>n;)a--;return i>0||a<e.length?e.slice(i,a):e}(i,a,this.max);return this._unit=t.unit||(n.autoSkip?ace(t.minUnit,this.min,this.max,this._getLabelCapacity(a)):function(e,t,n,i,a){for(let o=tce.length-1;o>=tce.indexOf(n);o--){const n=tce[o];if(ece[n].common&&e._adapter.diff(a,i,n)>=t-1)return n}return tce[n?tce.indexOf(n):0]}(this,o.length,t.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(e){for(let t=tce.indexOf(e)+1,n=tce.length;t<n;++t)if(ece[tce[t]].common)return tce[t]}(this._unit):void 0,this.initOffsets(i),e.reverse&&o.reverse(),sce(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t,n,i=0,a=0;this.options.offset&&e.length&&(t=this.getDecimalForValue(e[0]),i=1===e.length?1-t:(this.getDecimalForValue(e[1])-t)/2,n=this.getDecimalForValue(e[e.length-1]),a=1===e.length?n:(n-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;i=nie(i,0,o),a=nie(a,0,o),this._offsets={start:i,end:a,factor:1/(i+1+a)}}_generate(){const e=this._adapter,t=this.min,n=this.max,i=this.options,a=i.time,o=a.unit||ace(a.minUnit,t,n,this._getLabelCapacity(t)),s=vne(i.ticks.stepSize,1),r="week"===o&&a.isoWeekday,l=Kne(r)||!0===r,c={};let u,h,d=t;if(l&&(d=+e.startOf(d,"isoWeek",r)),d=+e.startOf(d,l?"day":o),e.diff(n,t,o)>1e5*s)throw new Error(t+" and "+n+" are too far apart with stepSize of "+s+" "+o);const f="data"===i.ticks.source&&this.getDataTimestamps();for(u=d,h=0;u<n;u=+e.add(u,s,o),h++)oce(c,u,f);return u!==n&&"ticks"!==i.bounds&&1!==h||oce(c,u,f),Object.keys(c).sort(nce).map(e=>+e)}getLabelForValue(e){const t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){const n=this.options.time.displayFormats,i=this._unit,a=t||n[i];return this._adapter.format(e,a)}_tickFormatFunction(e,t,n,i){const a=this.options,o=a.ticks.callback;if(o)return bne(o,[e,t,n],this);const s=a.time.displayFormats,r=this._unit,l=this._majorUnit,c=r&&s[r],u=l&&s[l],h=n[t],d=l&&u&&h&&h.major;return this._adapter.format(e,i||(d?u:c))}generateTickLabels(e){let t,n,i;for(t=0,n=e.length;t<n;++t)i=e[t],i.label=this._tickFormatFunction(i.value,t,e)}getDecimalForValue(e){return null===e?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,n=this.ctx.measureText(e).width,i=Yne(this.isHorizontal()?t.maxRotation:t.minRotation),a=Math.cos(i),o=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:n*a+s*o,h:n*o+s*a}}_getLabelCapacity(e){const t=this.options.time,n=t.displayFormats,i=n[t.unit]||n.millisecond,a=this._tickFormatFunction(e,0,sce(this,[e],this._majorUnit),i),o=this._getLabelSize(a),s=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return s>0?s:1}getDataTimestamps(){let e,t,n=this._cache.data||[];if(n.length)return n;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(e=0,t=i.length;e<t;++e)n=n.concat(i[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const e=this._cache.labels||[];let t,n;if(e.length)return e;const i=this.getLabels();for(t=0,n=i.length;t<n;++t)e.push(ice(this,i[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return cie(e.sort(nce))}}function lce(e,t,n){let i,a,o,s,r=0,l=e.length-1;n?(t>=e[r].pos&&t<=e[l].pos&&({lo:r,hi:l}=oie(e,"pos",t)),({pos:i,time:o}=e[r]),({pos:a,time:s}=e[l])):(t>=e[r].time&&t<=e[l].time&&({lo:r,hi:l}=oie(e,"time",t)),({time:i,pos:o}=e[r]),({time:a,pos:s}=e[l]));const c=a-i;return c?o+(s-o)*(t-i)/c:o}n(rce,"id","time"),n(rce,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});class cce extends rce{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=lce(t,this.min),this._tableRange=lce(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:n}=this,i=[],a=[];let o,s,r,l,c;for(o=0,s=e.length;o<s;++o)l=e[o],l>=t&&l<=n&&i.push(l);if(i.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(o=0,s=i.length;o<s;
5230++o)c=i[o+1],r=i[o-1],l=i[o],Math.round((c+r)/2)!==l&&a.push({time:l,pos:o/(s-1)});return a}_generate(){const e=this.min,t=this.max;let n=super.getDataTimestamps();return n.includes(e)&&n.length||n.splice(0,0,e),n.includes(t)&&1!==n.length||n.push(t),n.sort((e,t)=>e-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(lce(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return lce(this._table,n*this._tableRange+this._minPos,!0)}}n(cce,"id","timeseries"),n(cce,"defaults",rce.defaults);const uce=[Moe,Mre,Dle,Object.freeze({__proto__:null,CategoryScale:Mle,LinearScale:Vle,LogarithmicScale:Hle,RadialLinearScale:Zle,TimeScale:rce,TimeSeriesScale:cce})];lre.register(...uce);const hce={class:"mini-stats-chart"},dce={class:"chart-header"},fce={class:"chart-title"},pce={class:"total-count"},gce={class:"chart-container"},mce=CC({__name:"MiniStatsChart",props:{thongKeData:{type:Array,default:()=>[]},donViId:{type:String,required:!0}},setup(e){const t=e,n=It(null);let i=null;const a=It(0),o=It((new Date).getMonth()+1),s=It((new Date).getFullYear()),r=()=>{i&&i.destroy();const e=n.value;if(!e)return;const o=(()=>{const e=(new Date).getFullYear(),n=(new Date).getMonth()+1,i=new Date(e,n,0).getDate(),a=t.thongKeData.filter(t=>{const i=new Date(t.ngaythongke);return"xephang"===t.phanloai&&i.getMonth()+1===n&&i.getFullYear()===e}),o=Array(i).fill(0);return a.forEach(e=>{const t=new Date(e.ngaythongke).getDate();t>=1&&t<=i&&(o[t-1]+=e.soluongkhach||0)}),{labels:Array.from({length:i},(e,t)=>"".concat(t+1)),data:o,total:o.reduce((e,t)=>e+t,0)}})();a.value=o.total,i=new lre(e,{type:"bar",data:{labels:o.labels,datasets:[{label:"Sá» lượng khách",data:o.data,backgroundColor:Array.from({length:o.data.length},(e,t)=>"hsla(".concat(12*t%360,", 70%, 60%, 0.8)")),borderColor:Array.from({length:o.data.length},(e,t)=>"hsla(".concat(12*t%360,", 70%, 50%, 1)")),borderWidth:1}]},options:{maintainAspectRatio:!1,responsive:!0,aspectRatio:3,animation:{duration:800,easing:"easeOutQuart"},plugins:{legend:{display:!1},title:{display:!1},tooltip:{callbacks:{title:function(e){const t=e[0].label,n=(new Date).getMonth()+1,i=(new Date).getFullYear();return"Ngà y ".concat(t,"/").concat(n,"/").concat(i)},label:function(e){return"Sá» khách: ".concat(e.raw)}}}},scales:{y:{beginAtZero:!0,display:!0,title:{display:!0,text:"Sá» khách",font:{size:10,weight:"bold"}},ticks:{precision:0,font:{size:9}},grid:{display:!0,color:"rgba(0, 0, 0, 0.1)"}},x:{display:!0,title:{display:!0,text:"Ngà y trong tháng",font:{size:10,weight:"bold"}},ticks:{font:{size:8},maxRotation:0,minRotation:0},grid:{display:!1}}},elements:{bar:{borderRadius:2}},interaction:{intersect:!1,mode:"index"}}})};return pa(()=>t.thongKeData,()=>{t.thongKeData.length>0&&an(()=>{r()})},{deep:!0}),ei(()=>{t.thongKeData.length>0&&an(()=>{r()})}),ii(()=>{i&&i.destroy()}),(e,t)=>(Ma(),Va("div",hce,[Ha("div",dce,[Ha("h6",fce,[t[0]||(t[0]=Ha("i",{class:"fas fa-chart-line"},null,-1)),Ga(" Thá»ng kê tháng "+ee(o.value)+"/"+ee(s.value),1)]),Ha("div",pce,ee(a.value)+" khách",1)]),Ha("div",gce,[Ha("canvas",{ref_key:"chartCanvas",ref:n,class:"mini-chart"},null,512)])]))}},[["__scopeId","data-v-e6d29290"]]),vce={class:"modal-dialog modal-lg"},yce={class:"modal-content settings-modal"},bce={class:"modal-body settings-body"},_ce={class:"settings-section"},wce={class:"settings-grid"},kce={class:"setting-control"},xce={class:"setting-label"},Tce=["onUpdate:modelValue"],Cce={class:"setting-info"},Ece={class:"setting-name"},Sce={class:"setting-desc"},Ice={class:"setting-icon"},Ace={class:"setting-sap-xep"},Dce=["disabled","onClick"],Pce=["disabled","onClick"],Oce=CC({__name:"QrcodeSettingsModal",props:{choPhepHenGio:{type:Boolean,default:!1}},emits:["settingsChanged"],setup(e,{expose:t,emit:n}){const i=It(null);let a=null;const o=e,s=It({showQuickStats:!0,showChart:!0,showQrBangDienTu:!0,showQrHenGio:!0,thuTu:[...XT]}),r=bo(()=>{const e=(Array.isArray(s.value.thuTu)?s.value.thuTu:[]).filter(e=>XT.includes(e)),t=XT.filter(t=>!e.includes(t));return[...e,...t]}),l=bo(()=>r.value.map(e=>$T.find(t=>t.ma===e)).filter(e=>e&&(!e.henGio||o.choPhepHenGio))),c=(e,t)=>{const n=l.value.map(e=>e.ma),i=n[n.indexOf(e)+t];if(!i)return;const a=[...r.value],o=a.indexOf(e),c=a.indexOf(i);[a[o],a[c]]=[a[c],a[o]],s.value={...s.value,thuTu:a}},u=n;ei(()=>{a=new wV(document.getElementById("qrcodeSettingsModal")),h()});const h=()=>{const e=localStorage.getItem("qrcode_display_settings");if(e)try{const t=JSON.parse(e);s.value={...s.value,...t}}catch(eRe){}},d=()=>{try{localStorage.setItem("qrcode_display_settings",JSON.stringify(s.value)),u("settingsChanged",s.value),LT("Cà i Äặt Äã ÄÆ°á»£c lưu thà nh công!"),a.hide()}catch(eRe){VT("Lá»i khi lưu cà i Äặt!")}};return t({showModal:()=>{a&&a.show()}}),(e,t)=>(Ma(),Va("div",{class:"modal fade",id:"qrcodeSettingsModal",tabindex:"-1",ref_key:"modalRef",ref:i},[Ha("div",vce,[Ha("div",yce,[t[5]||(t[5]=Ha("div",{class:"modal-header settings-header"},[Ha("h5",{class:"modal-title"}," Cà i Äặt hiá»n thá» mà n hình QR Code "),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("div",bce,[Ha("div",_ce,[Ha("div",wce,[(Ma(!0),Va(Sa,null,gi(l.value,(e,n)=>(Ma(),Va("div",{class:"setting-item",key:e.ma},[Ha("div",kce,[Ha("label",xce,[gn(Ha("input",{type:"checkbox","onUpdate:modelValue":t=>s.value[e.co]=t,class:"setting-checkbox"},null,8,Tce),[[vs,s.value[e.co]]]),t[0]||(t[0]=Ha("span",{class:"checkmark"},null,-1)),Ha("div",Cce,[Ha("span",Ece,ee(e.ten),1),Ha("span",Sce,ee(e.mota),1)])])]),Ha("div",Ice,[Ha("i",{class:G(e.icon)},null,2)]),Ha("div",Ace,[Ha("button",{type:"button",class:"nut-xep",disabled:0===n,"aria-label":"ÄÆ°a lên trên",onClick:t=>c(e.ma,-1)},t[1]||(t[1]=[Ha("i",{class:"fas fa-chevron-up"},null,-1)]),8,Dce),Ha("button",{type:"button",class:"nut-xep",disabled:n===l.value.length-1,"aria-label":"ÄÆ°a xuá»ng dưá»i",onClick:t=>c(e.ma,1)},t[2]||(t[2]=[Ha("i",{class:"fas fa-chevron-down"},null,-1)]),8,Pce)])]))),128))]),t[3]||(t[3]=Ha("p",{class:"settings-ghi-chu"},[Ha("i",{class:"fas fa-circle-info"}),Ga(" Cà i Äặt lưu trên "),Ha("strong",null,"chÃnh thiết bá» nà y"),Ga(". Má»i kiosk, má»i mà n hình báºt tắt riêng, không ảnh hưá»ng máy khác. ")],-1))])]),Ha("div",{class:"modal-footer settings-footer"},[Ha("button",{type:"button",class:"btn btn-primary",onClick:d}," Lưu cà i Äặt "),t[4]||(t[4]=Ha("button",{type:"button",class:"btn btn-secondary","data-bs-dismiss":"modal"}," Huá»· ",-1))])])])],512))}},[["__scopeId","data-v-90698dfe"]]),Mce={class:"modal-dialog modal-xl"},Nce={class:"modal-content modern-modal"},Rce={class:"modal-body"},Lce={class:"counter-grid"},Vce=["onClick"],qce={class:"quay-status"},Fce={key:0,class:"fas fa-play icon-active"},Bce={key:1,class:"fas fa-pause icon-pause blink"},Uce={class:"counter-content"},jce={class:"waiting-badge-new"},Hce={class:"waiting-number"},zce=CC({__name:"QuaySelectionModal",props:{dsQuay:{type:Array,required:!0},selectedQuayId:{type:String,default:""}},emits:["quaySelected"],setup(e,{expose:t,emit:n}){const i=n;let a="";const o=It(null);let s=null;const r=It({}),l=Vl().params.don_vi;ei(()=>{s=new wV(o.value);const e=y1(),t=wI(),{items:n}=Zs(t);pa(n,t=>{t.forEach(t=>{e.realtimeKhachTrongCaLamViecWithCallback(l,t.id,e=>{const n=e.filter(e=>!e.daphucvu&&!e.dangphucvu).length;r.value[t.id]=n})})},{immediate:!0})});return t({showModal:e=>{a=e,s.show()}}),(t,n)=>(Ma(),Va("div",{class:"modal fade",id:"quayModal",tabindex:"-1",ref_key:"quayModalRef",ref:o},[Ha("div",Mce,[Ha("div",Nce,[n[1]||(n[1]=Ha("div",{class:"modal-header modern-header"},[Ha("h5",{class:"modal-title"},[Ha("i",{class:"fas fa-list"}),Ga(" Chá»n quầy giao dá»ch ")]),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal"})],-1)),Ha("div",Rce,[Ha("div",Lce,[(Ma(!0),Va(Sa,null,gi(e.dsQuay,t=>(Ma(),Va("div",{key:t.id,class:G(["counter-card",{disabled:!t.trangthai,selected:e.selectedQuayId===t.id}]),onClick:e=>{var n;(n=t).trangthai?(i("quaySelected",{type:a,quay:n}),s.hide()):VT("Quầy ".concat(n.ten," hiá»n Äang dừng nháºn khách!"))}},[Ha("span",qce,[t.trangthai?(Ma(),Va("i",Fce)):(Ma(),Va("i",Bce))]),Ha("div",Uce,[Ha("h4",null,"Quầy "+ee(t.ten),1),Ha("p",null,ee(t.mota),1)]),Ha("div",jce,[Ha("span",Hce,ee(r.value[t.id]||0),1),n[0]||(n[0]=Ha("i",{class:"fas fa-users waiting-icon"},null,-1))])],10,Vce))),128))])]),n[2]||(n[2]=Ha("div",{class:"modal-footer modern-footer"},[Ha("button",{type:"button",class:"btn-modern btn-secondary","data-bs-dismiss":"modal"}," Äóng ")],-1))])])],512))}},[["__scopeId","data-v-66dcf772"]]),Wce={class:"khung-chinh"},Kce={class:"portal-header"},Gce={class:"header-content"}
5230,Yce={class:"gov-branding"},Qce=["src"],$ce={class:"gov-info"},Xce={class:"gov-title"},Jce={class:"khung-chinh-than"},Zce={class:"qr-card"},eue={class:"qr-container"},tue=["src"],nue={key:0,class:"tracking-section"},iue={class:"notification-badges"},aue={key:0,class:"notification-item sms"},oue={key:1,class:"notification-item zalo"},sue={key:2,class:"notification-item email"},rue={key:3,class:"notification-item display"},lue={key:0,class:"quick-form-inline"},cue={class:"form-row-flex"},uue={class:"form-group flex-item phone-item"},hue={class:"form-group flex-item depart-item"},due={key:0,class:"selected-quay-text"},fue={key:1,class:"text-muted"},pue=["disabled"],gue={key:1,class:"quick-form-inline"},mue={class:"form-row-flex"},vue={class:"form-group flex-item depart-item"},yue={key:0,class:"selected-quay-text"},bue={key:1,class:"text-muted"},_ue=["disabled"],wue={class:"portal-footer"},kue={class:"footer-content"},xue={key:0},Tue={key:0,class:"khung-phu"},Cue={key:0,class:"the-phu"},Eue={class:"stats-grid"},Sue={class:"stat-item"},Iue={class:"stat-number"},Aue={class:"stat-item"},Due={class:"stat-number"},Pue={class:"stat-item"},Oue={class:"stat-number"},Mue={class:"stat-item"},Nue={class:"stat-number"},Rue={class:"stat-item"},Lue={class:"stat-number"},Vue={class:"stat-item"},que={class:"stat-number"},Fue={key:1,class:"the-phu the-phu--bieu-do"},Bue={key:2,class:"the-phu"},Uue={class:"qr-display-section"},jue={class:"qr-display-container"},Hue=["src"],zue={key:3,class:"the-phu"},Wue={class:"qr-display-section"},Kue={class:"qr-display-container"},Gue=["src"],Yue={class:"thanh-van-hanh"},Que=["title","aria-label"],$ue=CC({__name:"HienThiQrcode",setup(e){const t=Ll(),n=Vl(),i=n.params.don_vi,a=JT(),{item:o}=Zs(a),s=wI(),{items:r}=Zs(s),l=Kee(),{item:c}=Zs(l),u=y1(),{items:h}=Zs(u),d=Gee(),{items:f}=Zs(d),p=i8(),{item:g}=Zs(p),m=It(!1),v=It(null),y=bo(()=>{var e,t;return!(null==(e=o.value)?void 0:e.vitriamthanh)||"qrcode"===(null==(t=o.value)?void 0:t.vitriamthanh)}),b=bo(()=>y.value&&!m.value),_=It(null),w=It(!1),k=It(null),x=It(n.query.state||null),T="https://xephangqrcode.web.app",C=It(null),E=It(null),S=It
5230({showQuickStats:!0,showChart:!0,showQrBangDienTu:!0,showQrHenGio:!0,thuTu:[...XT]}),I=bo(()=>{const e=(Array.isArray(S.value.thuTu)?S.value.thuTu:[]).filter(e=>XT.includes(e)),t=XT.filter(t=>!e.includes(t));return[...e,...t]}),A="".concat(T,"/").concat(i,"/bang-dien-tu"),D=bo(()=>{var e,t;return Boolean((null==(e=o.value)?void 0:e.quetqrhengio)&&(null==(t=o.value)?void 0:t.qrcodehengio))}),P=bo(()=>{var e;return"".concat(T,"/").concat(i,"/hen-gio-giao-dich/").concat(null==(e=o.value)?void 0:e.qrcodehengio)}),O=bo(()=>D.value&&S.value.showQrHenGio),M=gt({hoten:"ÄÄng ký nhanh",sodienthoai:"",quay:"",donvi:i,taoluc:Ek(),dangphucvu:!1,daphucvu:null,calamviec:!0,stt:null,dangkinhanh:!0}),N=gt({hoten:"ÄÄng ký vé giấy",sodienthoai:"",quay_in_ve:"",donvi:i,taoluc:Zp.now(),dangphucvu:!1,daphucvu:null,calamviec:!0,stt:null,dangkinhanh:!0}),R=bo(()=>!0),L=bo(()=>r.value.filter(e=>e.hoatdong).length),V=bo(()=>h.value.filter(e=>e.daphucvu||e.dangphucvu).length),q=bo(()=>h.value.filter(e=>!e.daphucvu&&!e.dangphucvu).length),F=bo(()=>{const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1,0,0,0,0),n=new Date(e.getFullYear(),e.getMonth()+1,0,23,59,59,999);return f.value.filter(e=>{const i=new Date(e.ngaythongke);return"xephang"===e.phanloai&&i>=t&&i<=n}).reduce((e,t)=>e+(t.soluongkhach||0),0)}),B=bo(()=>{const e=(new Date).getFullYear();return f.value.filter(t=>"xephang"===t.phanloai&&new Date(t.ngaythongke).getFullYear()===e).reduce((e,t)=>e+(t.soluongkhach||0),0)}),U=bo(()=>S.value.showQuickStats||S.value.showQrBangDienTu||S.value.showChart||O.value);Zn(async()=>{try{if(await Promise.all([a.realtimeItemById(i)]),"dynamic"!=x.value&&!o.value.quetqrtinh)return void t.push("/forbidden")}catch(eRe){}}),ei(async()=>{try{ae(),await Promise.all([s.realtimeItemsByDonViAndStatus(i,!0),l.realtimeCheckQrcodeForQrcode(i),p.fetchData(),u.realtimeKhachTrongCaLamViecByDonVi(i),d.fetchItemsByDonVi(i)])}catch(eRe){}});const j=It(!1),H=Boolean(document.fullscreenEnabled||document.webkitFullscreenEnabled),z=async()=>{var e,t,n,i,a,o;const s=document.documentElement;try{document.fullscreenElement||document.webkitFullscreenElement?await(null!=(n=null==(e=document.exitFullscreen)?void 0:e.call(document))?n:null==(t=document.webkitExitFullscreen)?void 0:t.call(document)):await(null!=(o=null==(i=s.requestFullscreen)?void 0:i.call(s))?o:null==(a=s.webkitRequestFullscreen)?void 0:a.call(s))}catch(eRe){VT("Trình duyá»t không cho chuyá»n sang toà n mà n hình")}},W=()=>{j.value=Boolean(document.fullscreenElement||document.webkitFullscreenElement)};ei(()=>{document.addEventListener("fullscreenchange",W),document.addEventListener("webkitfullscreenchange",W)}),ii(()=>{document.removeEventListener("fullscreenchange",W),document.removeEventListener("webkitfullscreenchange",W)});const K=async()=>{if(!M.sodienthoai||!M.quay)return VT("Vui lòng Äiá»n Äầy Äá»§ thông tin!"),void(w.value=!1);const e=r.value.find(e=>e.id===M.quay);if(e.trangthai){w.value=!0;try{_.value=await Y(),M.stt=await Wee(i,M.quay),await Q()}finally{w.value=!1,X()}}else await wO("Quầy ".concat(e.ten,": Lượt khách chá» tại quầy Äã quá thá»i gian là m viá»c dá»± kiến. Vui lòng quay lại sau. Trân trá»ng!"),"Vui lòng chá»n quầy khác hoặc quay lại sau.")},Y=async()=>{try{return await u.fetchItemByKhachMoiNhat(i,M.quay)}catch(eRe){}},Q=async()=>{try{const e=await u.addItem({...M});LT("ÄÄng ký thà nh công, sá» thứ tá»±: "+e.stt)}catch(eRe){VT("Thêm má»i khách hà ng thất bại!")}},$=async()=>{var e,t,n;if(!(null==(e=o.value)?void 0:e.ip_printer))return void VT("Máy in chưa ÄÆ°á»£c cấu hình!");if(!N.quay_in_ve)return VT("Vui lòng chá»n quầy!"),void(w.value=!1);const a=r.value.find(e=>e.id===N.quay_in_ve);if(a.trangthai){_.value=await Y(a.id),N.quay=a.id,N.stt=await Wee(i,a.id);try{await u.addItem({...N}),await(async e=>{var t;try{const n=(null==(t=o.value)?void 0:t.ip_network)||"127.0.0.1";await bI.post("http://".concat(n,":3000/print"),e,{headers:{"Content-Type":"application/json"},timeout:7e4}),_O("In vé thà nh công!")}catch(eRe){VT("In vé thất bại!")}})({queueNumber:N.stt,timestamp:aC(N.taoluc),quay:a.ten,donVi:(null==(t=o.value)?void 0:t.ten)||"ÄÆ¡n vá»",ipPrinter:null==(n=o.value)?void 0:n.ip_printer})}catch(eRe){VT("In vé thất bại!")}finally{J()}}else await wO("Quầy ".concat(a.ten,": Lượt khách chá» tại quầy Äã quá thá»i gian là m viá»c dá»± kiến. Vui lòng quay lại sau. Trân trá»ng!"),"Vui lòng chá»n quầy khác hoặc quay lại sau.")},X=()=>{J()},J=()=>{M.sodienthoai="",M.quay="",M.stt=null},Z=e=>{E.value&&E.value.showModal(e)},te=bo(()=>
5230{if(!M.quay_lay_so)return"";const e=r.value.find(e=>e.id===M.quay_lay_so);return e?"".concat(e.ten,": ").concat(e.mota):""}),ne=bo(()=>{if(!N.quay_in_ve)return"";const e=r.value.find(e=>e.id===N.quay_in_ve);return e?"".concat(e.ten,": ").concat(e.mota):""}),ie=({type:e,quay:t})=>{"lay_so"===e?(M.quay_lay_so=t.id,M.quay=t.id):"in_ve"===e&&(N.quay_in_ve=t.id)},ae=()=>{const e=localStorage.getItem("qrcode_display_settings");if(e)try{const t=JSON.parse(e);S.value={...S.value,...t}}catch(eRe){}},oe=()=>{C.value&&C.value.showModal()},se=e=>{S.value={...e}},re=()=>{m.value=!0};return pa(()=>c.value,e=>{if("dynamic"===x.value)null==e||null==e?(async()=>{try{await l.addItem({daquet:!1,donvi:i,taoluc:Ek()}),LT("Thêm má»i QRCode thà nh công!")}catch(eRe){VT("Thêm má»i QRCode thất bại!")}})():(async e=>{try{return k.value="".concat(T,"/").concat(i,"/nhap-thong-tin/").concat(e.id),k.value}catch(eRe){}})(e);else(async e=>{try{return k.value="".concat(T,"/").concat(i,"/nhap-thong-tin/").concat(e),k.value}catch(eRe){}})(o.value.qrcodecodinh)},{deep:!0}),(e,t)=>{var n,a,s,l,c,u,d,p,m,_,x,T,N,W,Y,Q,X,J;return Ma(),Va(Sa,null,[Ha("div",{class:G(["kiosk",{"kiosk--mot-cot":!U.value}])},[Ha("section",Wce,[Ha("div",Kce,[Ha("div",Gce,[Ha("div",Yce,[Ha("img",{src:(null==(n=Ot(o))?void 0:n.logo)||"/images/logodanang.png",alt:"Logo",class:"gov-logo"},null,8,Qce),Ha("div",$ce,[Ha("h3",Xce,ee(null==(a=Ot(o))?void 0:a.ten),1),t[4]||(t[4]=Ha("p",{class:"gov-subtitle"},"Há» thá»ng xếp hà ng tá»± Äá»ng QRCode",-1))])])])]),Ha("div",Jce,[Ha("div",Zce,[t[11]||(t[11]=Ha("div",{class:"qr-header"},[Ha("div",{class:"scan-instruction"},[Ha("i",{class:"fas fa-qrcode"}),Ha("p",null,"Quét mã QR Äá» lấy sá» thứ tá»±")])],-1)),Ha("div",eue,[k.value?(Ma(),qa(Ot(jY),{key:0,value:k.value,options:{errorCorrectionLevel:"Q"},tag:"svg",class:"qr-code"},null,8,["value"])):Qa("",!0),Ha("img",{class:"qr-logo",src:(null==(s=Ot(o))?void 0:s.logo)||"/images/logodanang.png"},null,8,tue)]),R.value?(Ma(),Va("div",nue,[t[10]||(t[10]=Ha("div",{class:"tracking-header"},[Ha("i",{class:"fas fa-bell"}),Ha("span",null,"Theo dõi từ xa qua")],-1)),Ha("div",iue,[(null==(c=null==(l=Ot(o))?void 0:l.notifications)?void 0:c.sms)?(Ma(),Va("div",aue,t[5]||(t[5]=[Ha("i",{class:"fas fa-sms"},null,-1),Ha("span",null,"SMS",-1)]))):Qa("",!0),(null==(d=null==(u=Ot(o))?void 0:u.notifications)?void 0:d.zalo)?(Ma(),Va("div",oue,t[6]||(t[6]=[Ha("i",{class:"fab fa-telegram"},null,-1),Ha("span",null,"Zalo",-1)]))):Qa("",!0),(null==(m=null==(p=Ot(o))?void 0:p.notifications)?void 0:m.email)?(Ma(),Va("div",sue,t[7]||(t[7]=[Ha("i",{class:"fas fa-envelope"},null,-1),Ha("span",null,"Email",-1)]))):Qa("",!0),(null==(x=null==(_=Ot(o))?void 0:_.notifications)?void 0:x.tivi)?(Ma(),Va("div",rue,t[8]||(t[8]=[Ha("i",{class:"fas fa-tv"},null,-1),Ha("span",null,"Mà n hình",-1)]))):Qa("",!0),t[9]||(t[9]=Ha("div",{class:"notification-item board"},[Ha("i",{class:"fas fa-table-list"}),Ha("span",null,"Bảng Äiá»n tá»")],-1))])])):Qa("",!0)]),(null==(T=Ot(o))?void 0:T.laysonhanh)?(Ma(),Va("div",lue,[Ha("div",cue,[Ha("div",uue,[gn(Ha("input",{type:"tel",class:"form-input",name:"phone","onUpdate:modelValue":t[0]||(t[0]=e=>M.sodienthoai=e),placeholder:"Sá» Äiá»n thoại"},null,512),[[ms,M.sodienthoai]])]),Ha("div",hue,[Ha("div",{class:"form-input form-select-custom",onClick:t[1]||(t[1]=e=>Z("lay_so"))},[te.value?(Ma(),Va("span",due,ee(te.value),1)):(Ma(),Va("span",fue,"Chá»n quầy")),t[12]||(t[12]=Ha("i",{class:"fas fa-chevron-down"},null,-1))])]),Ha("button",{class:"form-button button-item",onClick:K,disabled:w.value},ee(w.value?"Äang xá» lý...":"Lấy sá» nhanh"),9,pue)])])):Qa("",!0),(null==(N=Ot(o))?void 0:N.invegiay)?(Ma(),Va("div",gue,[t[14]||(t[14]=Ha("h5",{class:"quick-title text-uppercase"},"Chá»n quầy in vé giấy",-1)),Ha("div",mue,[Ha("div",vue,[Ha("div",{class:"form-input form-select-custom",onClick:t[2]||(t[2]=e=>Z("in_ve"))},[ne.value?(Ma(),Va("span",yue,ee(ne.value),1)):(Ma(),Va("span",bue,"Chá»n quầy")),t[13]||(t[13]=Ha("i",{class:"fas fa-chevron-down"},null,-1))])]),Ha("button",{class:"form-button-info button-item",onClick:$,disabled:w.value},ee(w.value?"Äang xá» lý...":"In vé giấy"),9,_ue)])])):Qa("",!0)]),Ha("div",wue,[Ha("div",kue,[Ha("span",null,ee((null==(W=Ot(g))?void 0:W.banquyen)||"Há» thá»ng xếp hà ng tá»± Äá»ng QRCode"),1),(null==(Y=Ot(g))?void 0:Y.thietke)?(Ma(),Va("span",xue,ee(Ot(g).thietke),1)):Qa("",!0)])])]),U.value?(Ma(),Va("aside",Tue,[(Ma(!0),Va(Sa,null,gi(I.value,e=>{var n,a;return Ma(),Va(Sa,{key:e},["thongKe"===e&&S.value.showQuickStats?(Ma(),Va("div",Cue,[t[21]||(t[21]=Ha("div",{class:"card-header"},[Ha("h4",{class:"card-title"},[Ha("i",{class:"fas fa-chart-bar"}),Ga(" Sá» liá»u phục vụ ")])],-1)),Ha("div",Eue,[Ha("div",Sue,[Ha("span",Iue,ee(L.value),1),t[15]||(t[15]=H
5230a("div",{class:"stat-info"},[Ha("span",{class:"stat-label"},"Quầy"),Ha("span",{class:"stat-label"},"hoạt Äá»ng")],-1))]),Ha("div",Aue,[Ha("span",Due,ee(V.value),1),t[16]||(t[16]=Ha("div",{class:"stat-info"},[Ha("span",{class:"stat-label"},"Khách Äã"),Ha("span",{class:"stat-label"},"phục vụ")],-1))]),Ha("div",Pue,[Ha("span",Oue,ee(q.value),1),t[17]||(t[17]=Ha("div",{class:"stat-info"},[Ha("span",{class:"stat-label"},"Khách"),Ha("span",{class:"stat-label"},"Äang chá»")],-1))]),Ha("div",Mue,[Ha("span",Nue,ee(Ot(h).length),1),t[18]||(t[18]=Ha("div",{class:"stat-info"},[Ha("span",{class:"stat-label"},"Khách"),Ha("span",{class:"stat-label"},"hôm nay")],-1))]),Ha("div",Rue,[Ha("span",Lue,ee(F.value),1),t[19]||(t[19]=Ha("div",{class:"stat-info"},[Ha("span",{class:"stat-label"},"Khách"),Ha("span",{class:"stat-label"},"trong tháng")],-1))]),Ha("div",Vue,[Ha("span",que,ee(B.value),1),t[20]||(t[20]=Ha("div",{class:"stat-info"},[Ha("span",{class:"stat-label"},"Khách"),Ha("span",{class:"stat-label"},"trong nÄm")],-1))])])])):"bieuDo"===e&&S.value.showChart?(Ma(),Va("div",Fue,[za(mce,{thongKeData:Ot(f),donViId:Ot(i)},null,8,["thongKeData","donViId"])])):"qrBangDienTu"===e&&S.value.showQrBangDienTu?(Ma(),Va("div",Bue,[t[23]||(t[23]=Ha("div",{class:"card-header"},[Ha("h4",{class:"card-title"},[Ha("i",{class:"fas fa-tv"}),Ga(" Bảng Äiá»n tá» theo dõi xếp hà ng từ xa ")])],-1)),Ha("div",Uue,[Ha("div",jue,[za(Ot(jY),{value:A,options:{errorCorrectionLevel:"Q"},tag:"svg",class:"qr-display-code"}),Ha("img",{class:"qr-display-logo",src:(null==(n=Ot(o))?void 0:n.logo)||"/images/logodanang.png"},null,8,Hue)]),t[22]||(t[22]=Ya('<div class="qr-display-info" data-v-5c873c17><ol class="qr-info-list" data-v-5c873c17><li data-v-5c873c17>Quét mã bằng Zalo hoặc Camera</li><li data-v-5c873c17>Xem lượt chá» từng quầy, theo dõi từ xa</li><li data-v-5c873c17>Gần tá»i lượt má»i có mặt</li><li data-v-5c873c17>Tra cứu há» sÆ¡, thá»§ tục qua Äà Nẵng AI</li></ol><p class="qr-info-luu-y" data-v-5c873c17><i class="fas fa-camera" data-v-5c873c17></i> Chụp ảnh mã QR Äá» dùng lại </p><hr class="qr-info-vach" data-v-5c873c17><p class="qr-info-nhan-manh" data-v-5c873c17> Tiết kiá»m thá»i gian, chi phà Äi lại. </p></div>',1))])])):"qrHenGio"===e&&O.value?(Ma(),Va("div",zue,[t[25]||(t[25]=Ha("div",{class:"card-header"},[Ha("h4",{class:"card-title"},[Ha("i",{class:"fas fa-calendar-check"}),Ga(" Äặt lá»ch hẹn giá» giao dá»ch ")])],-1)),Ha("div",Wue,[Ha("div",Kue,[za(Ot(jY),{value:P.value,options:{errorCorrectionLevel:"Q"},tag:"svg",class:"qr-display-code"},null,8,["value"]),Ha("img",{class:"qr-display-logo",src:(null==(a=Ot(o))?void 0:a.logo)||"/images/logodanang.png"},null,8,Gue)]),t[24]||(t[24]=Ya('<div class="qr-display-info" data-v-5c873c17><ol class="qr-info-list" data-v-5c873c17><li data-v-5c873c17>Quét mã bằng Zalo hoặc Camera</li><li data-v-5c873c17>Chá»n quầy giao dá»ch, ngà y hẹn và giá» hẹn</li><li data-v-5c873c17>Nháºn vé hẹn giá», Äến Äúng giá» xác nháºn có mặt</li><li data-v-5c873c17>Tra cứu há» sÆ¡, thá»§ tục qua Äà Nẵng AI</li></ol><p class="qr-info-luu-y" data-v-5c873c17><i class="fas fa-camera" data-v-5c873c17></i> Chụp ảnh mã QR Äá» hẹn giá» tại nhà </p><hr class="qr-info-vach" data-v-5c873c17><p class="qr-info-nhan-manh" data-v-5c873c17> Tiết kiá»m thá»i gian, chi phà Äi lại. </p></div>',1))])])):Qa("",!0)],64)}),128))])):Qa("",!0)],2),Ha("div",Yue,[(null==(Q=Ot(o))?void 0:Q.hienthisettingsqr)?(Ma(),Va("button",{key:0,class:"nut-van-hanh",type:"button",title:"Cà i Äặt hiá»n thá»","aria-label":"Cà i Äặt hiá»n thá»",onClick:oe},t[26]||(t[26]=[Ha("i",{class:"fas fa-cog"},null,-1)]))):Qa("",!0),Ot(H)?(Ma(),Va("button",{key:1,class:"nut-van-hanh",type:"button",title:j.value?"Thoát toà n mà n hình":"Toà n mà n hình","aria-label":j.value?"Thoát toà n mà n hình":"Toà n mà n hình",onClick:z},[Ha("i",{class:G(j.value?"fas fa-compress":"fas fa-expand")},null,2)],8,Que)):Qa("",!0),b.value?(Ma(),Va("button",{key:2,class:"nut-van-hanh",type:"button",title:"Cà i Äặt âm thanh","aria-label":"Cà i Äặt âm thanh",onClick:t[3]||(t[3]=e=>{var t;return null==(t=v.value)?void 0:t.openSoundModal()})},t[27]||(t[27]=[Ha("i",{class:"fas fa-volume-up"},null,-1)]))):Qa("",!0)]),y.value?(Ma(),qa(rte,{key:0,ref_key:"soundModalRef",ref:v,showButton:!1,onSoundStarted:re},null,512)):Qa("",!0),(null==(X=Ot(o))?void 0:X.settinggiongnoi)?(Ma(),qa(Dte,{key:1,activeCounters:L.value,waitingCustomers:q.value}
5230,null,8,["activeCounters","waitingCustomers"])):Qa("",!0),(null==(J=Ot(o))?void 0:J.hienthisettingsqr)?(Ma(),qa(Oce,{key:2,ref_key:"settingsModalRef",ref:C,choPhepHenGio:D.value,onSettingsChanged:se},null,8,["choPhepHenGio"])):Qa("",!0),za(zce,{ref_key:"quaySelectionModalRef",ref:E,dsQuay:Ot(r),selectedQuayId:M.quay_lay_so,onQuaySelected:ie},null,8,["dsQuay","selectedQuayId"])],64)}}},[["__scopeId","data-v-5c873c17"]]),Xue=[];for(let tRe=0;tRe<256;++tRe)Xue.push((tRe+256).toString(16).slice(1));let Jue;const Zue=new Uint8Array(16);const ehe={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function the(e,t,n){var i,a,o;if(ehe.randomUUID&&!t&&!e)return ehe.randomUUID();const s=null!=(o=null!=(a=(e=e||{}).random)?a:null==(i=e.rng)?void 0:i.call(e))?o:function(){if(!Jue){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Jue=crypto.getRandomValues.bind(crypto)}return Jue(Zue)}();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=15&s[6]|64,s[8]=63&s[8]|128,function(e,t=0){return(Xue[e[t+0]]+Xue[e[t+1]]+Xue[e[t+2]]+Xue[e[t+3]]+"-"+Xue[e[t+4]]+Xue[e[t+5]]+"-"+Xue[e[t+6]]+Xue[e[t+7]]+"-"+Xue[e[t+8]]+Xue[e[t+9]]+"-"+Xue[e[t+10]]+Xue[e[t+11]]+Xue[e[t+12]]+Xue[e[t+13]]+Xue[e[t+14]]+Xue[e[t+15]]).toLowerCase()}(s)}const nhe={},ihe=e=>{if(nhe[e])return nhe[e];const t=(e=>{try{return localStorage.getItem(e)}catch(t){return null}})(e);if(t)return nhe[e]=t,t;const n=the();return nhe[e]=n,((e,t)=>{try{localStorage.setItem(e,t)}catch(n){}})(e,n),n},ahe=()=>ihe("device_id"),ohe=e=>"ve_cua_toi_".concat(e),she=e=>"ticket_url_".concat(e),rhe=e=>{try{return localStorage.getItem(e)}catch(ZNe){return null}},lhe=(e,t)=>{try{localStorage.setItem(e,t)}catch(ZNe){}},che=e=>{const t=rhe(ohe(e));if(t)try{const e=JSON.parse(t);if(Array.isArray(e))return e.filter(e=>e&&"string"==typeof e.url)}catch(ZNe){}const n=rhe(she(e));return n?[{url:n,luc:null}]:[]},uhe=e=>che(e).map(e=>e.url.split("/").filter(Boolean).pop()||"").filter(Boolean),hhe=(e,t)=>{if(!t)return;const n=che(e).filter(e=>e.url!==t),i=[{url:t,luc:(new Date).toISOString()},...n].slice(0,10);lhe(ohe(e),JSON.stringify(i)),lhe(she(e),t)},dhe="thuong",fhe="uutien",phe="hengio",ghe={[dhe]:"",[fhe]:"Ưu tiên",[phe]:"Hẹn giá»"},mhe={[dhe]:"",[fhe]:"fas fa-star",[phe]:"fas fa-clock"},vhe=e=>{if(!e)return null;if("function"==typeof e.toDate)return e.toDate();const t=new Date(e);return Number.isNaN(t.getTime())?null:t},yhe=e=>{const t=hC(e);return t?t.split(" ").slice(-4).join(" "):""},bhe=(e,t)=>{var n,i,a,o;return(null!=(i=null==(n=e.thoiDiem)?void 0:n.getTime())?i:0)-(null!=(o=null==(a=t.thoiDiem)?void 0:a.getTime())?o:0)},_he=e=>!e.daphucvu&&!e.dangphucvu,whe=e=>{var t,n;return{id:e.id,loai:e.doi_tuong_uu_tien?fhe:dhe,ma:String(null!=(t=e.stt)?t:""),hoten:e.hoten,sodienthoai:e.sodienthoai,quay:e.quay,dangphucvu:!!e.dangphucvu,daphucvu:null!=(n=e.daphucvu)?n:null,thoiDiem:vhe(e.taoluc),dienUuTien:e.doi_tuong_uu_tien||"",daxacnhan:!0,goc:e}},khe=e=>{var t,n;return{id:e.id,loai:phe,ma:"".concat(null!=(t=e.thoigianhengio)?t:"").trim(),hoten:e.hoten,sodienthoai:e.sodienthoai,quay:e.quay,dangphucvu:!!e.dangphucvu,daphucvu:null!=(n=e.daphucvu)?n:null,thoiDiem:vhe(e.ngayhengio),dienUuTien:"",daxacnhan:!!e.daxacnhan,goc:e}},xhe=(e,t)=>e.daxacnhan&&!!e.thoiDiem&&t>=e.thoiDiem,The=({dsKhachHang:e=[],dsHenGio:t=[],uuTienVuotHenGio:n=!1,bayGio:i=new Date}={})=>{const a=e.filter(_he).map(whe),o=t.filter(_he).map(khe),s=a.filter(e=>e.loai===fhe).sort(bhe),r=a.filter(e=>e.loai===dhe).sort(bhe),l=o.filter(e=>xhe(e,i)).sort(bhe),c=o.filter(e=>!xhe(e,i)).filter(e=>!!e.thoiDiem&&(e.daxacnhan||i<=e.thoiDiem)).sort(bhe);return{hangDoi:n?[...s,...l,...r]:[...l,...s,...r],henGioSapToi:c,dangPhucVu:t.filter(e=>e.dangphucvu).map(khe)[0]||e.filter(e=>e.dangphucvu).map(whe)[0]||null,soUuTien:s.length,soHenGio:l.length,soThuong:r.length}},Che=(e,t,n)=>{const i=Number(t);if(!Number.isFinite(i)||i<=0)return null;if(!Number.isFinite(e)||e<0)return null;const a=n instanceof Date?n:new Date;return new Date(a.getTime()+e*i*6e4)},Ehe={key:0,class:"chatbot-dock"},She={class:"chatbot-card dock-mode"},Ihe={class:"chat-2"}
5230,Ahe={class:"header"},Dhe=["src","alt"],Phe={key:1,class:"avatar"},Ohe={class:"question-badge"},Mhe=["innerHTML"],Nhe={key:1,class:"bubble typing"},Rhe={class:"input-area"},Lhe=["onKeyup"],Vhe={key:1,class:"chatbot-launcher"},qhe={key:0,class:"chatbot-floating-panel"},Fhe={class:"chatbot-card"},Bhe={class:"chat-2"},Uhe={class:"header"},jhe=["src","alt"],Hhe={key:1,class:"avatar"},zhe={key:2,class:"question-badge"},Whe=["innerHTML"],Khe={key:1,class:"bubble typing"},Ghe={class:"input-area"},Yhe=["onKeyup"],Qhe="glass-chatbot-scroll-lock",$he=CC({__name:"GlassChatbot",props:{layout:{type:String,default:"floating"},orgName:{type:String,default:"Há» thá»ng xếp hà ng QRCode"},orgLogo:{type:String,default:""},orgGreeting:{type:String,default:""},endpoint:{type:String,default:""},orgId:{type:String,default:""}},setup(e){const t=e,n=It(!1),i=()=>{n.value=window.innerWidth<992};ei(()=>{i(),window.addEventListener("resize",i)}),ii(()=>{window.removeEventListener("resize",i),o()});let a="";const o=()=>{if("undefined"==typeof document)return;const{body:e}=document;e.classList.contains(Qhe)&&(e.style.overflow=a,e.classList.remove(Qhe))},s=()=>{v.value&&!r.value&&n.value?(()=>{if("undefined"==typeof document)return;const{body:e}=document;e.classList.contains(Qhe)||(a=e.style.overflow||"",e.style.overflow="hidden",e.classList.add(Qhe))})():o()},r=bo(()=>"dock"===t.layout&&!n.value),l=(e="")=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),c=(e="")=>e.replace(/(https?:\/\/[^\s]+)/g,e=>'<a href="'.concat(e,'" target="_blank" rel="noopener">Tại Äây</a>')),u=(e="")=>e.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>"),h=(e="",t="bot")=>"bot"===t?((e="")=>{const t=l(e).split(/\r?\n/),n=[],i=[],a=(e=0)=>{for(;i.length&&e<i[i.length-1];)n.push("</ul>"),i.pop()};return t.forEach(e=>{const t=e.match(/^\s*/)[0].length,o=e.trim();if(o){if("---"===o)return a(0),void n.push("<hr />");if(/^[-*]\s+/.test(o)){!i.length||t>i[i.length-1]?(n.push("<ul>"),i.push(t)):t<i[i.length-1]&&(a(t),(!i.length||t>i[i.length-1])&&(n.push("<ul>"),i.push(t)));const e=o.replace(/^[-*]\s+/,"");return void n.push("<li>".concat(c(u(e)),"</li>"))}a(0),n.push('<p class="m-0">'.concat(c(u(o)),"</p>"))}else a(0)}),a(0),n.join("")})(e):((e="")=>c(l(e)).replace(/\n/g,"<br />"))(e),d=(e,t)=>({id:"".concat(e,"-").concat(Date.now(),"-").concat(Math.random().toString(16).slice(2)),role:e,text:t,html:h(t,e)}),f=It([d("bot",t.orgGreeting||"Chà o bạn! Tôi là trợ lý ảo.")]),p=It(""),g=It(null);let m=null;const v=It(r.value),y=It(0),b=bo(()=>y.value),_=()=>{an(()=>{g.value&&(g.value.scrollTop=g.value.scrollHeight)})};pa(f,()=>{_()}),pa(r,e=>{v.value=!!e}),pa([v,n,r],()=>{s()},{immediate:!0});const w=(e,t)=>{f.value.push(d(e,t)),_()},k=()=>{r.value||(v.value=!v.value,v.value?_():C())};H0(U0(t.orgId)).then(e=>{const t=Number(e);y.value=Number.isNaN(t)?0:t});const x=async()=>{const e=t.endpoint||"";if(!e)return n="Chưa cấu hình thông tin API URL",void yO.fire({icon:"info",title:"Thông báo",text:n,timer:4e3,showConfirmButton:!1});var n;const i=p.value.trim();if(i){w("user",i),p.value="",E(),T();try{const t=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:i})});if(!t.ok)throw new Error("Request failed with status ".concat(t.status));const n=await t.text();let a=null;try{a=JSON.parse(n)}catch(eRe){a=null}const o="string"==typeof a&&a||(null==a?void 0:a.answer)||(null==a?void 0:a.response)||(null==a?void 0:a.message)||(null==a?void 0:a.result)||n||"Mình Äang chá» thêm dữ liá»u Äá» phản há»i chÃnh xác.";C(),w("bot",o)}catch(eRe){C(),w("bot","Xin lá»i, há» thá»ng Äang báºn. Bạn vui lòng thá» lại sau nhé.")}}},T=()=>{C(),m="typing-".concat(Date.now(),"-").concat(Math.random().toString(16).slice(2)),f.value.push({id:m,role:"bot",text:"",typing:!0}),_()},C=()=>{if(!m)return;const e=f.value.findIndex(e=>e.id===m);
5230-1!==e&&f.value.splice(e,1),m=null,_()},E=()=>{y.value+=1,t.orgId&&z0(U0(t.orgId),"soLuotHoi")};return(t,n)=>r.value?(Ma(),Va("div",Ehe,[Ha("section",She,[Ha("div",Ihe,[Ha("div",Ahe,[e.orgLogo?(Ma(),Va("img",{key:0,src:e.orgLogo,width:"55",height:"55",alt:e.orgName,class:"rounded-circle shadow-sm"},null,8,Dhe)):(Ma(),Va("div",Phe,n[2]||(n[2]=[Ha("span",null,"ð¬",-1)]))),n[4]||(n[4]=Ha("div",{class:"bot-info"},[Ha("h3",null,"Trợ lý ảo AI")],-1)),Ha("div",Ohe,[n[3]||(n[3]=Ha("i",{class:"fas fa-comments"},null,-1)),Ha("span",null,ee(b.value),1)])]),Ha("div",{class:"messages",ref_key:"messageListRef",ref:g},[(Ma(!0),Va(Sa,null,gi(f.value,e=>(Ma(),Va("div",{key:e.id,class:G(["message",e.role])},[e.typing?(Ma(),Va("div",Nhe,n[5]||(n[5]=[Ha("span",null,null,-1),Ha("span",null,null,-1),Ha("span",null,null,-1)]))):(Ma(),Va("div",{key:0,class:"bubble",innerHTML:e.html},null,8,Mhe))],2))),128))],512),Ha("div",Rhe,[gn(Ha("input",{type:"text",placeholder:"Gá»i tin nhắn...","onUpdate:modelValue":n[0]||(n[0]=e=>p.value=e),onKeyup:Is(Es(x,["prevent"]),["enter"])},null,40,Lhe),[[ms,p.value]]),Ha("button",{type:"button",onClick:x},"â¤")])])])])):(Ma(),Va("div",Vhe,[Ha("button",{type:"button",class:G(["chatbot-toggle-btn",{hidden:v.value||r.value}]),onClick:k,"aria-label":"Trợ lý AI"},n[6]||(n[6]=[Ha("i",{class:"fas fa-comments"},null,-1)]),2),za(Mo,{name:"chatbot-fade"},{default:pn(()=>[v.value?(Ma(),Va("div",qhe,[Ha("section",Fhe,[Ha("div",Bhe,[Ha("div",Uhe,[e.orgLogo?(Ma(),Va("img",{key:0,src:e.orgLogo,width:"55",height:"55",alt:e.orgName,class:"rounded-circle shadow-sm"},null,8,jhe)):(Ma(),Va("div",Hhe,n[7]||(n[7]=[Ha("span",null,"ð¬",-1)]))),n[10]||(n[10]=Ha("div",{class:"bot-info"},[Ha("h3",null,"Trợ lý ảo AI")],-1)),b.value>0?(Ma(),Va("div",zhe,[n[8]||(n[8]=Ha("i",{class:"fas fa-comments"},null,-1)),Ha("span",null,ee(b.value),1)])):Qa("",!0),Ha("button",{class:"close-btn",type:"button",onClick:k,"aria-label":"Äóng chatbot"},n[9]||(n[9]=[Ha("i",{class:"fas fa-times"},null,-1)]))]),Ha("div",{class:"messages",ref_key:"messageListRef",ref:g},[(Ma(!0),Va(Sa,null,gi(f.value,e=>(Ma(),Va("div",{key:e.id,class:G(["message",e.role])},[e.typing?(Ma(),Va("div",Khe,n[11]||(n[11]=[Ha("span",null,null,-1),Ha("span",null,null,-1),Ha("span",null,null,-1)]))):(Ma(),Va("div",{key:0,class:"bubble",innerHTML:e.html},null,8,Whe))],2))),128))],512),Ha("div",Ghe,[gn(Ha("input",{type:"text",placeholder:"Gá»i tin nhắn...","onUpdate:modelValue":n[1]||(n[1]=e=>p.value=e),onKeyup:Is(Es(x,["prevent"]),["enter"])},null,40,Yhe),[[ms,p.value]]),Ha("button",{type:"button",onClick:x},"â¤")])])])])):Qa("",!0)]),_:1})]))}},[["__scopeId","data-v-b6c73774"]]),Xhe={class:"ls-wrap"},Jhe={class:"ls-the"},Zhe={class:"ls-header"},ede=["src","alt"],tde={class:"ls-header-chu"},nde={key:0,class:"ls-don-vi"},ide={class:"ls-than"},ade={class:"section-head"},ode={class:"section-note"},sde={key:0,class:"ls-trong"},rde={key:1,class:"ls-danh-sach"},lde=["disabled","onClick"],cde={class:"ls-noi-dung"},ude={key:0,class:"ls-meta"},hde={key:0},dde={key:1,class:"ls-ly-do"},fde={class:"ls-linh-vuc"},pde={class:"ls-footer"},gde={key:0,class:"ls-footer-phu"},mde={class:"modal-dialog modal-dialog-centered modal-dialog-scrollable"},vde={class:"modal-content tt-modal"},yde={class:"modal-header tt-header"},bde={class:"modal-title"},_de={class:"modal-body"},wde={key:0,class:"tt-quay"},kde={class:"tt-quay-chu"},xde={class:"tt-quay-dau"},Tde={class:"tt-quay-ten"},Cde={class:"tt-quay-meta"},Ede={class:"tt-quay-mota"},Sde={class:"tt-o"},Ide={class:"tt-o"},Ade={class:"tt-o"},Dde={class:"uu-tien-bat"},Pde={key:0,class:"uu-tien-than"},Ode=["value"],Mde=["disabled"],Nde=CC({__name:"NhapThongTin",setup(e){const t=Vl(),n=Ll(),i=m1("nhanMaQr");let a=Promise.resolve();const o=t.params.don_vi,s=t.params.token,r=JT(),{item:l}=Zs(r),c=wI(),{items:u}=Zs(c),h=y1();Zs(h);const d=i8(),{item:f}=Zs(d);It(null);const p=It(!1),g=localStorage.getItem("user_info")||null,m=It(null);let v=null;const y=gt({hoten:"",sodienthoai:"",email:"",quay:"",donvi:o,qrcode:s,taoluc:Ek(),dangphucvu:!1,daphucvu:null,calamviec:!0,stt:null,doi_tuong_uu_tien:null}),b=It({}),_=It(!1);pa(_,e=>{y.doi_tuong_uu_tien=e?"":null}),ei(async()=>{var e,t;try{g&&Object.assign(y,{...y,...JSON.parse(g)}),await Promise.all([r.realtimeItemById(o),c.realtimeItemsByDonViAndStatus(o,!0),d.fetchData()]),s!==(null==(e=l.value)?void 0:e.qrcodecodinh)&&(a=i({donvi:o,qrcodeId:s,thietBi:ahe()}).catch(e=>{"functions/failed-precondition"===(null==e?void 0:e.code)&&n.replace("/".concat(o,"/ma-het-han"))}
5230)),u.value.forEach(e=>{h.realtimeKhachTrongCaLamViecWithCallback(o,e.id,t=>{const n=t.filter(e=>!e.daphucvu&&!e.dangphucvu).length;b.value[e.id]=n})}),(null==(t=l.value)?void 0:t.logo)||(l.value.logo="/images/logodanang.png"),v=new wV(m.value)}catch(eRe){}});const w=It(new Date),k=setInterval(()=>{w.value=new Date},3e4),x=bo(()=>{const e=w.value;return u.value.map(t=>{const n=b.value[t.id]||0,i=pC(t,l.value,e),a=!!t.trangthai&&!i,o=t.trangthai?i:"Quầy Äang dừng nháºn khách",s=Che(n,t.thoigianphucvu,e);return{...t,soKhachCho:n,tieuDe:t.mota||"Quầy ".concat(t.ten),choPhep:a,lyDo:o,gioDuKien:s?new Intl.DateTimeFormat("vi-VN",{hour:"2-digit",minute:"2-digit",hour12:!1}).format(s):""}})}),T=bo(()=>x.value.filter(e=>e.choPhep).length),C=bo(()=>x.value.find(e=>e.id===y.quay)||null),E=bo(()=>g?"Kiá»m tra thông tin":"Thông tin lấy sá»");ii(()=>{clearInterval(k),null==v||v.hide()});const S=async e=>{const t=String(e||"").split("/").filter(Boolean).pop();if(!t)return!1;const n=await yT("khach_hang",t);return!(!n||n.daphucvu||!1===n.calamviec)||(localStorage.removeItem("last_scan_info_".concat(y.quay)),!1)},I=async()=>{try{await a;const e=await h.laySoThuTu({...y,doi_tuong_uu_tien:_.value?y.doi_tuong_uu_tien:null,thiet_bi:ahe()});if(!(null==e?void 0:e.id))throw new Error("Không tạo ÄÆ°á»£c sá» thứ tá»±");y.stt=e.stt;const t="/".concat(o,"/ve-dien-tu/").concat(e.id);localStorage.setItem("last_scan_info_".concat(y.quay),JSON.stringify({timestamp:(new Date).getTime(),ticketUrl:t})),hhe(o,t),null==v||v.hide(),n.push(t)}catch(eRe){VT((null==eRe?void 0:eRe.message)||"Lấy sá» thất bại. Vui lòng thá» lại hoặc liên há» cán bá» há» trợ.")}};return(e,t)=>{var i,a,r,c,h,d,g,b,w,k,A,D;return Ma(),Va(Sa,null,[Ha("div",Xhe,[Ha("div",Jhe,[Ha("header",Zhe,[Ha("img",{class:"ls-logo",src:(null==(i=Ot(l))?void 0:i.logo)||"/images/logodanang.png",alt:(null==(a=Ot(l))?void 0:a.ten)||"Logo ÄÆ¡n vá»"},null,8,ede),Ha("div",tde,[(null==(r=Ot(l))?void 0:r.ten)?(Ma(),Va("p",nde,ee(Ot(l).ten),1)):Qa("",!0),t[6]||(t[6]=Ha("h1",{class:"ls-tieu-de"},"Lấy sá» thứ tá»±",-1))])]),Ha("main",ide,[Ha("div",ade,[t[7]||(t[7]=Ha("h2",{class:"section-heading"},"Chá»n quầy",-1)),Ha("span",ode,ee(T.value)+"/"+ee(x.value.length)+" quầy nháºn khách",1)]),x.value.length?(Ma(),Va("div",rde,[(Ma(!0),Va(Sa,null,gi(x.value,e=>(Ma(),Va("button",{key:e.id,type:"button",class:G(["ls-hang",{"ls-hang--dong":!e.choPhep}]),disabled:!e.choPhep,onClick:t=>(e=>{e.choPhep&&(y.quay=e.id,v.show())})(e)},[Ha("span",cde,[e.choPhep?(Ma(),Va("span",ude,[Ha("span",null,[t[9]||(t[9]=Ga("Quầy: ")),Ha("strong",null,ee(e.ten),1)]),Ha("span",null,[t[10]||(t[10]=Ga("Hà ng Äợi: ")),Ha("strong",null,ee(e.soKhachCho),1)]),e.gioDuKien?(Ma(),Va("span",hde,[t[11]||(t[11]=Ga("Dá»± kiến: ")),Ha("strong",null,ee(e.gioDuKien),1)])):Qa("",!0)])):(Ma(),Va("span",dde,[t[12]||(t[12]=Ha("i",{class:"fas fa-circle-info"},null,-1)),Ga(" "+ee(e.lyDo),1)])),Ha("span",fde,ee(e.tieuDe),1)])],10,lde))),128))])):(Ma(),Va("div",sde,t[8]||(t[8]=[Ha("i",{class:"far fa-folder-open"},null,-1),Ha("p",null,"ÄÆ¡n vá» chưa tạo quầy giao dá»ch nà o",-1)])))]),Ha("footer",pde,[t[13]||(t[13]=Ha("p",{class:"ls-footer-chinh"},"Há» thá»ng xếp hà ng tá»± Äá»ng QRCode",-1)),(null==(c=Ot(f))?void 0:c.thietke)?(Ma(),Va("p",gde,ee(Ot(f).thietke),1)):Qa("",!0)])]),Ha("div",{class:"modal fade",tabindex:"-1","aria-hidden":"true",ref_key:"modalThongTinRef",ref:m},[Ha("div",mde,[Ha("div",vde,[Ha("div",yde,[Ha("h5",bde,ee(E.value),1),t[14]||(t[14]=Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Äóng"},null,-1))]),Ha("div",_de,[C.value?(Ma(),Va("div",wde,[Ha("span",kde,[Ha("span",xde,[Ha("span",Tde,"Quầy "+ee(C.value.ten),1),Ha("span",Cde,[t[16]||(t[16]=Ga(" Hà ng Äợi: ")),Ha("strong",null,ee(C.value.soKhachCho),1),C.value.gioDuKien?(Ma(),Va(Sa,{key:0},[t[15]||(t[15]=Ga(" · dá»± kiến ")),Ha("strong",null,ee(C.value.gioDuKien),1)],64)):Qa("",!0)])]),Ha("span",Ede,ee(C.value.tieuDe),1)])])):Qa("",!0),Ha("form",{class:"tt-form",onSubmit:t[5]||
5230(t[5]=Es(e=>(async()=>{if(s==l.value.qrcodecodinh&&!l.value.quetqrtinh)return void VT("Quét mã QR tÄ©nh Äang tạm dừng!");if(!y.quay)return void VT("Vui lòng chá»n quầy");if(!uC(y.sodienthoai))return void VT("Sá» Äiá»n thoại không hợp lá». Vui lòng nháºp 10 sá», bắt Äầu bằng 03, 05, 07, 08 hoặc 09.");const e=u.value.find(e=>e.id===y.quay);if(!e.trangthai)return void(await wO("Quầy ".concat(e.ten,": Lượt khách chá» tại quầy Äã quá thá»i gian là m viá»c dá»± kiến. Vui lòng quay lại sau. Trân trá»ng!"),"Vui lòng chá»n quầy khác hoặc quay lại sau."));const t=pC(e,l.value);if(t)return void VT("Quầy ".concat(e.ten,": ").concat(t,"!"));const i=JSON.parse(localStorage.getItem("last_scan_info_".concat(y.quay))||"{}"),a=(new Date).getTime(),o=e.gioihanquetma&&e.thoigiangioihan?60*e.thoigiangioihan*1e3:0;if(e.gioihanquetma&&i.timestamp&&i.ticketUrl&&a-i.timestamp<o&&await S(i.ticketUrl))return VT("Bạn Äã lấy sá» tại quầy nà y. Äang má» lại vé cá»§a bạn."),void n.push(i.ticketUrl);p.value=!0;try{const e=dC(y);Object.assign(y,e);const t={hoten:y.hoten,sodienthoai:y.sodienthoai,email:y.email};localStorage.setItem("user_info",JSON.stringify(t)),await I()}catch(eRe){VT("Lấy sá» thất bại. Vui lòng thá» lại hoặc liên há» cán bá» há» trợ.")}finally{p.value=!1}})(),["prevent"]))},[Ha("div",Sde,[t[17]||(t[17]=Ha("label",{for:"hoten"},[Ga("Há» và tên "),Ha("span",{class:"tt-bat-buoc"},"*")],-1)),gn(Ha("input",{id:"hoten",type:"text",required:"",maxlength:"100","onUpdate:modelValue":t[0]||(t[0]=e=>y.hoten=e),placeholder:"Nháºp há» và tên"},null,512),[[ms,y.hoten]])]),Ha("div",Ide,[t[18]||(t[18]=Ha("label",{for:"sodienthoai"},[Ga("Sá» Äiá»n thoại "),Ha("span",{class:"tt-bat-buoc"},"*")],-1)),gn(Ha("input",{id:"sodienthoai",type:"tel",required:"","onUpdate:modelValue":t[1]||(t[1]=e=>y.sodienthoai=e),placeholder:"Nháºp sá» Äiá»n thoại Äá» nháºn vé"},null,512),[[ms,y.sodienthoai]])]),Ha("div",Ade,[t[19]||(t[19]=Ha("label",{for:"email"},"Äá»a chá» email",-1)),gn(Ha("input",{id:"email",type:"email",maxlength:"100","onUpdate:modelValue":t[2]||(t[2]=e=>y.email=e),placeholder:"Nháºp email Äá» nháºn vé"},null,512),[[ms,y.email]])]),(null==(h=Ot(l))?void 0:h.doi_tuong_uu_tien_enabled)&&(null==(d=Ot(l).doi_tuong_uu_tien_texts)?void 0:d.length)?(Ma(),Va("div",{key:0,class:G(["uu-tien",{"uu-tien--bat":_.value}])},[Ha("label",Dde,[gn(Ha("input",{type:"checkbox","onUpdate:modelValue":t[3]||(t[3]=e=>_.value=e)},null,512),[[vs,_.value]]),t[20]||(t[20]=Ha("span",{class:"uu-tien-chu"},[Ha("span",{class:"uu-tien-ten"},"Là Äá»i tượng ưu tiên"),Ha("span",{class:"uu-tien-phu"},"ÄÆ°á»£c phục vụ trưá»c theo quy Äá»nh")],-1))]),_.value?(Ma(),Va("div",Pde,[t[21]||(t[21]=Ha("p",{class:"uu-tien-nhan"},"Chá»n trưá»ng hợp cá»§a bạn",-1)),(Ma(!0),Va(Sa,null,gi(Ot(l).doi_tuong_uu_tien_texts,e=>(Ma(),Va("label",{key:e,class:G(["uu-tien-muc",{"uu-tien-muc--chon":y.doi_tuong_uu_tien===e}])},[gn(Ha("input",{type:"radio",value:e,"onUpdate:modelValue":t[4]||(t[4]=e=>y.doi_tuong_uu_tien=e)},null,8,Ode),[[bs,y.doi_tuong_uu_tien]]),Ha("span",null,ee(e),1)],2))),128)),t[22]||(t[22]=Ha("p",{class:"uu-tien-luu-y"},[Ha("i",{class:"fas fa-triangle-exclamation"}),Ha("span",null,[Ga(" Phải là ngưá»i Äứng tên trá»±c tiếp tại há» sÆ¡ hoặc ÄÆ°á»£c uá»· quyá»n, có giấy tá» pháp lý theo quy Äá»nh. "),Ha("strong",null,"Sá» thứ tá»± bá» huá»· khi không Äúng Äá»i tượng phục vụ.")])],-1))])):Qa("",!0)],2)):Qa("",!0),Ha("button",{type:"submit",class:"nut nut-xanh nut-rong",disabled:p.value},ee(p.value?"Äang xá» lý...":"Lấy sá»"),9,Mde)],32)])])])],512)]),(null==(g=Ot(l))?void 0:g.hienthiaichatbot)?(Ma(),qa($he,{key:0,"org-id":(null==(b=Ot(l))?void 0:b.id)||Ot(o),"org-logo":(null==(w=Ot(l))?void 0:w.logo)||"","org-name":(null==(k=Ot(l))?void 0:k.ten)||"Há» thá»ng xếp hà ng QRCode",endpoint:(null==(A=Ot(l))?void 0:A.aichatbot_endpoint)||"","org-greeting":(null==(D=Ot(l))?void 0:D.aichatbot_greeting)||""},null,8,["org-id","org-logo","org-name","endpoint","org-greeting"])):Qa("",!0)],64)}}},[["__scopeId","data-v-6f02cc19"]]),Rde=m1("nhaGiuChoTam"),Lde=m1("datLichHen"),Vde=m1("huyHenGio"),qde=m1("doiGioHenGio"),Fde=Js("hengioStore",{state:()=>({items:[],item:null,dsHenGioDaPhucVu:[]}),actions:{async fetchItemById(e){this.item=await yT("hen_gio",e)},async realtimeItemById(e){FT("hengio:item",xT("hen_gio",e,e=>{this.item=e}))},fetchItemsByDonViQuayNgay:async(e,t,n,i)=>await vT(h1("hen_gio"),[["donvi","==",e],["quay","==",t],["ngayhengio",">=",n],["ngayhengio","<=",i]]),async fetchItemsByThietBi(e,t){if(!t)return[];return(await m1("henCuaThietBi")({donvi:e,thietBi:t})||[]).map(e=>({...e,ngayhengio:null==e.ngayhengio?null:Zp.fromMillis(e.ngayhengio)}))},async realtimeKhachHenGioChuaPhucVu(e,t,n,i){FT("hengio:items",TT(h1("hen_gio"),[["donvi","==",e],["quay","==",t],["ngayhengio",">=",n],["ngayhengio","<=",i]],null,null,e=>{this.items=e}))},async realtimeKhachHenGioChuaPhucVuTheoDonVi(e,t,n){FT("hengio:items",TT(h1("hen_gio"),[["donvi","==",e],["ngayhengio",">=",t],["ngayhengio","<=",n]],null,null,e=>{this.items=e}))},datLichHen:async e=>await Lde({donvi:e.donvi,quay:e.quay,thietBi:e.thiet_bi,hoten:e.hoten,sodienthoai:e.sodienthoai,email:e.email,thoigianhengio:e.thoigianhengio,ngayhengio:e.ngayhengio instanceof Date?e.ngayhengio.toISOString():e.ngayhengio}),async updateItem(e,t){await wT("hen_gio",e,t)},huyLichHen:async(e,t)=>await Vde({henGioId:e,thietBi:t}),doiGioLichHen:async(e,t,n,i,a="")=>await qde({henGioId:e,thietBi:t,quay:a,ngayhengio:n instanceof Date?n.toISOString():n,thoigianhengio:i}),async createTemporarySlot(e){try{return await _T("slot_temporary_reservations",e)}catch(eRe){throw eRe}},async nhaGiuCho(e,t,n,i=""){try{const{daNha:a}=await Rde({donvi:e,quay:t,reserverId:n,thoigianhengio:i});return a}catch(eRe){return 0}},async removeTemporarySlot(e,t,n,i){return await this.nhaGiuCho(e,t,i,n)},async removeAllTemporarySlotsByReserver(e,t,n){return await this.nhaGiuCho(e,t,n)},async realtimeTemporarySlots(e,t,n,i){try{const a=new Date;return await TT("slot_temporary_reservations",[["donvi","==",e],["quay","==",t],["ngay","==",n],["hetHan",">
5230",a]],["taoLuc","desc"],null,i)}catch(eRe){return()=>{}}},async fetchItemByHenGioDaPhucVuByDonVi(e,t,n,i=20,a=null){this.dsHenGioDaPhucVu=await CT("hen_gio",[["donvi","==",e],["taoluc",">=",t],["taoluc","<=",n]],["daphucvu","desc"],i,a)},async fetchItemByHenGioDaPhucVuByDonViAndQuay(e,t,n,i,a=20,o=null){this.dsHenGioDaPhucVu=await CT("hen_gio",[["donvi","==",e],["quay","==",t],["taoluc",">=",n],["taoluc","<=",i]],["daphucvu","desc"],a,o)},async realtimeItemsByDonViQuayNgay(e,t,n,i,a){FT("hengio:theongay",TT(h1("hen_gio"),[["donvi","==",e],["quay","==",t],["ngayhengio",">=",n],["ngayhengio","<=",i]],null,null,e=>{a(e)}))}}}),Bde={class:"hg-wrap"},Ude={class:"hg-the"},jde={class:"hg-header"},Hde=["src","alt"],zde={class:"hg-header-chu"},Wde={key:0,class:"hg-don-vi"},Kde={class:"hg-tieu-de"},Gde={class:"hg-than"},Yde={key:0,class:"hg-dang-doi"},Qde={class:"hg-buoc"},$de={class:"section-head"},Xde={key:0,class:"section-note"},Jde={key:0,class:"hg-da-chon"},Zde={class:"hg-da-chon-ten"},efe={class:"hg-da-chon-mota"},tfe={key:0,class:"hg-da-chon-hangdoi"},nfe={key:1,class:"hg-danh-sach"},ife=["disabled","onClick"],afe={key:0,class:"hg-meta"},ofe={key:0},sfe={key:1},rfe={key:2,class:"hg-dung-hom-nay"},lfe={class:"hg-linh-vuc"},cfe={key:1,class:"hg-buoc"},ufe={class:"hg-ngay"},hfe={key:2,class:"hg-buoc"},dfe={class:"section-head"},ffe={class:"section-note"},pfe={key:0,class:"hg-khung"},gfe=["disabled","onClick"],mfe={key:1,class:"hg-khung-trong"},vfe={key:3,class:"hg-quay-lai"},yfe={class:"hg-footer"},bfe={key:0,class:"hg-footer-phu"},_fe={class:"modal-dialog modal-dialog-centered modal-dialog-scrollable"},wfe={class:"modal-content tt-modal"},kfe={class:"modal-header tt-header"},xfe={class:"modal-title"},Tfe={class:"modal-body"},Cfe={key:0,class:"tt-lich"},Efe={class:"tt-lich-dau"},Sfe={class:"tt-lich-ten"},Ife={key:0,class:"tt-lich-gio"},Afe={class:"tt-lich-mota"},Dfe={class:"tt-o"},Pfe={class:"tt-o"},Ofe={class:"tt-o"},Mfe={class:"tt-nhac"},Nfe=["disabled"],Rfe={__name:"HenGioGiaoDich",setup(e){const t=Vl(),n=Ll(),i=t.params.don_vi,a=t.params.khach_hang||"",o=!!a,s=It(""),r=It(""),l=JT(),{item:c}=Zs(l),u=wI(),{items:h}=Zs(u),d=Fde(),f=y1(),p=i8(),{item:g}=Zs(p),m=It(!1),v=It(!1),y=It(null);let b=null;const _=new Date,w=bo(()=>{var e;const t=Number(null==(e=c.value)?void 0:e.hengio_datlich_truoc_phut);return Number.isFinite(t)&&t>=0?t:50}),k=bo(()=>{var e;const t=Number(null==(e=c.value)?void 0:e.hengio_xacnhan_truoc_phut);return Number.isFinite(t)&&t>0?Math.floor(t):20}),x=bo(()=>sQ(_,w.value)),T=bo(()=>KY(new Date,14)),C=It([]),E=It([]),S=It([]),I=localStorage.getItem("user_info")||null,A=It(null),D=It({}),P=It(new Date);let O=null;const M=It([]),N=It((()=>{let e=localStorage.getItem("slot_reserver_id");return e||(e=the(),localStorage.setItem("slot_reserver_id",e)),e})()),R=It(null),L=gt({hoten:"",sodienthoai:"",email:"",donvi:i,quay:"",ngayhengio:new Date,thoigianhengio:"",dangphucvu:!1,daphucvu:null,daxacnhan:!1,taoluc:Ek(),stt:"0000"}),V=e=>new Intl.DateTimeFormat("vi-VN",{day:"2-digit",month:"2-digit",year:"numeric"}).format(new Date(e)),q=bo(()=>!L.ngayhengio||uQ(L.ngayhengio,new Date)),F=bo(()=>{if(!L.quay||!q.value)return!1;const e=h.value.find(e=>e.id===L.quay);return!!e&&!e.trangthai}),B=bo(()=>{const e=q.value;return h.value.map(t=>{const n=!t.trangthai,i=L.ngayhengio?pC(t,c.value,L.ngayhengio,!0):"",a=e&&!n?D.value[t.id]||0:null,s=null===a?null:Che(a,t.thoigianphucvu,P.value),r=z.value[t.id]||null,l=!o&&!r&&Q.value;return{...t,tieuDe:t.mota||"Quầy ".concat(t.ten),henDaCo:r,dungHomNay:n,choPhep:!r&&!l&&!i,lyDo:r?"Bạn Äã có lá»ch ".concat(r.thoigianhengio," · ").concat(V(r.ngayhengio.toDate())," - chạm Äá» má» vé"):l?"Äã Äạt tá»i Äa ".concat(Y.value," lá»ch hẹn. Huá»· bá»t má»t lá»ch Äá» Äặt thêm."):i||"",soKhachCho:a,gioDuKien:s?new Intl.DateTimeFormat("vi-VN",{hour:"2-digit",minute:"2-digit",hour12:!1}).format(s):""}})}),U=bo(()=>B.value.find(e=>e.id===L.quay)||null),j=bo(()=>U.value?xC(U.value):[]);pa(()=>j.value.join("|"),()=>ae()),pa(F,()=>ae()),Zn(async()=>{try{if(await Promise.all([l.realtimeItemById(i)]),c.value&&!c.value.quetqrhengio)return void n.push("/forbidden");c.value&&!c.value.logo&&(c.value.logo="/images/logodanang.png"),await W(),o&&await X()}catch(eRe){}}),ei(async()=>{try{I&&Object.assign(L,{...L,...JSON.parse(I)}),await Promise.all([u.realtimeItemsByDonViAndStatus(i,!0),p.fetchData()]),h.value.forEach(e
5230=>{f.realtimeKhachTrongCaLamViecWithCallback(i,e.id,t=>{D.value[e.id]=t.filter(e=>!e.daphucvu&&!e.dangphucvu).length})}),O=setInterval(()=>{P.value=new Date,re()},3e4),Z(),window.addEventListener("beforeunload",H),b=new wV(y.value)}catch(eRe){}}),ii(()=>{O&&clearInterval(O),A.value&&A.value(),R.value&&R.value(),window.removeEventListener("beforeunload",H),L.quay&&L.ngayhengio&&d.removeAllTemporarySlotsByReserver(i,L.quay,N.value)});const H=e=>{L.quay&&L.ngayhengio&&L.thoigianhengio&&d.removeTemporarySlot(i,L.quay,L.thoigianhengio,N.value)},z=It({}),W=async()=>{const e=await(async()=>{const e=await d.fetchItemsByThietBi(i,ahe()),t=new Date;return e.filter(e=>{var n,i,a;if(e.daphucvu)return!1;const o=null!=(a=null==(i=null==(n=e.ngayhengio)?void 0:n.toDate)?void 0:i.call(n))?a:null;return!!o&&(!!e.daxacnhan||t<=o)})})();z.value=Object.fromEntries(e.filter(e=>e.id!==a).map(e=>[e.quay,e]))},K=bo(()=>Object.keys(z.value).length),Y=bo(()=>{var e;const t=Number(null==(e=c.value)?void 0:e.hengio_toida_moi_nguoi);return Number.isFinite(t)&&t>=1?Math.floor(t):2}),Q=bo(()=>K.value>=Y.value),$=e=>{null==b||b.hide(),n.push("/".concat(i,"/ve-hen-gio/").concat(e.id))},X=async()=>{var e,t,o;await d.fetchItemById(a);const l=d.item;if(!l||l.donvi!==i)return VT("Không tìm thấy lá»ch hẹn cần Äá»i."),void n.replace("/khong-tim-thay");const c=e=>{VT(e),n.replace("/".concat(i,"/ve-hen-gio/").concat(a))};if(l.thiet_bi!==ahe())return c("Lá»ch hẹn nà y không thuá»c vá» thiết bá» Äang dùng.");if(l.daphucvu)return c("Lá»ch hẹn Äã ÄÆ°á»£c phục vụ, không Äá»i giá» ÄÆ°á»£c nữa.");if(l.dangphucvu)return c("Bạn Äang ÄÆ°á»£c phục vụ tại quầy, vui lòng báo cán bá».");if(l.daxacnhan)return c("Bạn Äã xác nháºn có mặt nên không Äá»i giá» ÄÆ°á»£c nữa. Có thá» huá»· lá»ch hẹn.");const u=null!=(o=null==(t=null==(e=l.ngayhengio)?void 0:e.toDate)?void 0:t.call(e))?o:null;if(!u||new Date>u)return c("Lá»ch hẹn Äã quá giá», không Äá»i ÄÆ°á»£c nữa.");s.value="".concat(l.thoigianhengio," · ").concat(V(u)),r.value=l.quay,L.quay=l.quay,L.ngayhengio=u},J=async()=>{try{const e={hoten:L.hoten,sodienthoai:L.sodienthoai,email:L.email},t=await d.datLichHen({...L,thiet_bi:ahe()});if(!(null==t?void 0:t.id))throw new Error("Không tạo ÄÆ°á»£c lá»ch hẹn");const a="/".concat(i,"/ve-hen-gio/").concat(t.id);localStorage.setItem("user_info",JSON.stringify(e)),hhe(i,a),null==b||b.hide(),n.push(a)}catch(eRe){v.value=!1,VT((null==eRe?void 0:eRe.message)||"Äặt lá»ch thất bại. Vui lòng thá» lại."),await W(),await Z()}},Z=async()=>{let e=F.value?[]:j.value;if(L.thoigianhengio="",q.value){const t=new Date,n=sQ(t,w.value);e=e.filter(e=>f$(uX(e,"HH:mm",t),n))}S.value=e,L.quay&&L.ngayhengio&&(A.value&&A.value(),R.value&&R.value(),A.value=await d.realtimeItemsByDonViQuayNgay(i,L.quay,iQ(L.ngayhengio),pQ(L.ngayhengio),ne),R.value=await d.realtimeTemporarySlots(i,L.quay,iQ(L.ngayhengio),te))},te=e=>{if(!m.value&&!v.value)try{const t=new Date;if(M.value=e.filter(e=>{const n=e.reserverId===N.value,i=new Date(e.hetHan)<t;return!n&&!i}).map(e=>e.thoigianhengio),L.thoigianhengio){const n=e.find(e=>e.reserverId===N.value&&e.thoigianhengio===L.thoigianhengio);(!n||new Date(n.hetHan)<t)&&(L.thoigianhengio="",M.value=M.value.filter(e=>e!==L.thoigianhengio),n&&new Date(n.hetHan)<t&&VT("Khung giá» Äã quá thá»i gian chá» (1 phút). Vui lòng chá»n lại khung giá»!"))}ae(),L.thoigianhengio&&M.value.includes(L.thoigianhengio)&&!E.value.includes(L.thoigianhengio)&&(L.thoigianhengio="",VT("Khung giá» nà y vừa ÄÆ°á»£c ngưá»i khác chá»n. Vui lòng chá»n khung giá» khác!"))}catch(eRe){}},ne=e=>{if(!m.value&&!v.value)try{const t=ie(Zp.fromDate(new Date(L.ngayhengio)));E.value=e.filter(e=>e.quay===L.quay&&ie(e.ngayhengio)===t).map(e=>e.thoigianhengio),ae(),L.thoigianhengio&&E.value.includes(L.thoigianhengio)&&(L.thoigianhengio="",VT("Khung giá» nà y vừa ÄÆ°á»£c Äặt lá»ch. Vui lòng chá»n khung giá» khác!"))}catch(eRe){}},ie=e=>e?e.toDate().toLocaleString("vi-VN",{day:"2-digit",month:"2-digit",year:"numeric"}):"",ae=()=>{let e=F.value?[]:j.value;if(q.value){const t=new Date,n=sQ(t,w.value);e=e.filter(e=>f$(uX(e,"HH:mm",t),n))}if(L.quay&&L.ngayhengio){const e=h.value.find(e=>e.id===L.quay);if(e){if(pC(e,c.value,L.ngayhengio,!0))return S.value=[],void(C.value=[])}}S.value=e;const t=[...E.value,...M.value];C.value=e.filter(e=>!t.includes(e))},oe=e=>!e||!q.value||f$(uX(e,"HH:mm",new Date),sQ(new Date,w.value)),se=async e=>{L.thoigianhengio="",null==b||b.hide(),await d.removeTemporarySlot(i,L.quay,e,N.value),ae(),VT("Khung ".concat(e," không còn Äá»§ ").concat(w.value," phút chuẩn bá». Vui lòng chá»n khung giá» khác!"))},re=async()=>
5230{if(m.value||v.value)return;if(!L.quay||!L.ngayhengio||!q.value)return;const e=L.thoigianhengio;!e||oe(e)?ae():await se(e)},le=bo(()=>{if(!L.quay||!L.ngayhengio)return"";const e=U.value;if(!e)return"";const t=pC(e,c.value,L.ngayhengio,!0);return t?"Quầy ".concat(e.ten,": ").concat(t.toLowerCase(),". Vui lòng chá»n ngà y khác hoặc Äá»i quầy."):F.value?"Quầy ".concat(e.ten," hôm nay Äã dừng nháºn khách. Vui lòng chá»n ngà y khác."):j.value.length?S.value.length?C.value.length?"":"Má»i khung giá» ngà y nà y Äã có ngưá»i Äặt. Vui lòng chá»n ngà y khác hoặc Äá»i quầy.":q.value?"Hôm nay không còn khung giá» nà o Äá»§ sá»m - lá»ch phải Äặt trưá»c Ãt nhất ".concat(w.value," phút. Vui lòng chá»n ngà y khác."):"Ngà y nà y không còn khung giá» nà o. Vui lòng chá»n ngà y khác.":"Quầy nà y chưa má» khung giá» nháºn hẹn. Vui lòng Äá»i quầy."}),ce=bo(()=>I?"Kiá»m tra thông tin":"Thông tin Äặt lá»ch"),ue=bo(()=>L.ngayhengio?V(L.ngayhengio):""),he=()=>{L.quay="",L.thoigianhengio=""},de=()=>n.replace("/".concat(i,"/ve-hen-gio/").concat(a)),fe=async e=>{await(async e=>{L.thoigianhengio&&L.thoigianhengio!==e&&await d.removeTemporarySlot(i,L.quay,L.thoigianhengio,N.value),L.thoigianhengio=e;const t=new Date;t.setMinutes(t.getMinutes()+2);const n={donvi:i,quay:L.quay,ngay:iQ(L.ngayhengio),thoigianhengio:e,reserverId:N.value,hetHan:t,taoLuc:new Date};try{await d.createTemporarySlot(n)}catch(eRe){}})(e),o?await ge(e):null==b||b.show()},pe=async e=>{L.thoigianhengio="",await d.removeTemporarySlot(i,L.quay,e,N.value)},ge=async e=>{const t=U.value&&U.value.id!==r.value?"Lá»ch hẹn chuyá»n sang quầy ".concat(U.value.ten," - ").concat(U.value.tieuDe,". ")+"Khung giá» cÅ© ".concat(s.value," sẽ ÄÆ°á»£c trả lại cho ngưá»i khác."):"Khung giá» cÅ© ".concat(s.value," sẽ ÄÆ°á»£c trả lại cho ngưá»i khác.");if((await wO("Äá»i sang ".concat(e," ngà y ").concat(ue.value,"?"),t)).isConfirmed){m.value=!0;try{const t=new Date(L.ngayhengio),[o,s]=e.split(":");t.setHours(Number(o),Number(s),0,0),await d.doiGioLichHen(a,ahe(),t,e,L.quay),v.value=!0,await d.removeTemporarySlot(i,L.quay,e,N.value),n.replace("/".concat(i,"/ve-hen-gio/").concat(a))}catch(eRe){VT((null==eRe?void 0:eRe.message)||"Không Äá»i ÄÆ°á»£c giá» hẹn. Vui lòng thá» lại."),await pe(e),ae()}finally{m.value=!1}}else await pe(e)},me=e=>{if(L.ngayhengio){const t=pC(e,c.value,L.ngayhengio,!0);if(t)return void VT("Quầy ".concat(e.ten,": ").concat(t,"!"))}L.quay=e.id,Z()};return(e,t)=>{var n,i,a,r;return Ma(),Va("div",Bde,[Ha("div",Ude,[Ha("header",jde,[Ha("img",{class:"hg-logo",src:(null==(n=Ot(c))?void 0:n.logo)||"/images/logodanang.png",alt:(null==(i=Ot(c))?void 0:i.ten)||"Logo ÄÆ¡n vá»"},null,8,Hde),Ha("div",zde,[(null==(a=Ot(c))?void 0:a.ten)?(Ma(),Va("p",Wde,ee(Ot(c).ten),1)):Qa("",!0),Ha("h1",Kde,ee(o?"Äá»i giá» hẹn":"Äặt lá»ch hẹn giá»"),1)])]),Ha("main",Gde,[o&&s.value?(Ma(),Va("p",Yde,[t[5]||(t[5]=Ha("i",{class:"fas fa-arrow-right-arrow-left"},null,-1)),t[6]||(t[6]=Ga(" Äang Äá»i lá»ch hẹn ")),Ha("strong",null,ee(s.value),1),t[7]||(t[7]=Ga(". Chạm và o khung giá» má»i bên dưá»i. "))])):Qa("",!0),Ha("section",Qde,[Ha("div",$de,[t[8]||(t[8]=Ha("h2",{class:"section-heading"},[Ha("span",{class:"hg-so"},"1"),Ga(" Chá»n quầy")],-1)),L.quay?(Ma(),Va("button",{key:1,type:"button",class:"hg-doi",onClick:he},"Äá»i")):(Ma(),Va("span",Xde,ee(B.value.length)+" quầy ",1))]),L.quay&&U.value?(Ma(),Va("div",Jde,[Ha("span",Zde,"Quầy "+ee(U.value.ten),1),Ha("span",efe,ee(U.value.tieuDe),1),null!==U.value.soKhachCho?(Ma(),Va("span",tfe,[t[10]||(t[10]=Ga(" Hà ng Äợi hôm nay: ")),Ha("strong",null,ee(U.value.soKhachCho),1),U.value.gioDuKien?(Ma(),Va(Sa,{key:0},[t[9]||(t[9]=Ga(" · dá»± kiến ")),Ha("strong",null,ee(U.value.gioDuKien),1)],64)):Qa("",!0)])):Qa("",!0)])):(Ma(),Va("div",nfe,[(Ma(!0),Va(Sa,null,gi(B.value,e=>(Ma(),Va("button",{key:e.id,type:"button",class:G(["hg-hang",{"hg-hang--dong":!e.choPhep&&!e.henDaCo,"hg-hang--da-co":!!e.henDaCo}]),disabled:!e.choPhep&&!e.henDaCo,onClick:t=>(e=>{e.henDaCo?$(e.henDaCo):e.choPhep&&me(e)})(e)},[e.choPhep?(Ma(),Va("span",afe,[Ha("span",null,[t[11]||(t[11]=Ga("Quầy: ")),Ha("strong",null,ee(e.ten),1)]),null!==e.soKhachCho?(Ma(),Va("span",ofe,[t[12]||(t[12]=Ga("Hà ng Äợi: ")),Ha("strong",null,ee(e.soKhachCho),1)])):Qa("",!0),e.gioDuKien?(Ma(),Va("span",sfe,[t[13]||(t[13]=Ga("Dá»± kiến: ")),Ha("strong",null,ee(e.gioDuKien),1)])):Qa("",!0),e.dungHomNay?(Ma(),Va("span",rfe,"Hôm nay dừng nháºn khách · Äặt ÄÆ°á»£c cho ngà y khác")):Qa("",!0)])):(Ma(),Va("span",{key:1,class:G(["hg-ly-do",{"hg-ly-do--da-co":!!e.henDaCo}])},[Ha("i",{class:G(["fas",e.henDaCo?"fa-clock":"fa-circle-info"])},null,2),Ga(" "+ee(e.lyDo),1)],2)),Ha("span",lfe,ee(e.tieuDe),1)],10,ife))),128))]))]),L.quay?(Ma(),Va("section",cfe,[t[14]||(t[14]=Ha("div",{class:"section-head"},[Ha("h2",{class:"section-heading"},[Ha("span",{class:"hg-so"},"2"),Ga(" Chá»n ngà y")]),Ha("span",{class:"section-note"},"Trong vòng 14 ngà y tá»i")],-1)),Ha("div",ufe,[za(Ot(q0),{"auto-apply":"",modelValue:L.ngayhengio,"onUpdate:modelValue":[t[0]||(t[0]=e=>L.ngayhengio=e),Z],format:"dd/MM/yyyy","enable-time-picker":!1,"min-date":x.value,"max-date":T.value,locale:"vi","day-names":["T2","T3","T4","T5","T6","T7","CN"],"cancel-text":"Äóng","select-text":"Chá»n ngà y",placeholder:"Chá»n ngà y",required:""},null,8,["modelValue","min-date","max-date"])])])):Qa("",!0),L.quay&&L.ngayhengio?(Ma(),Va("section",hfe,[Ha("div",dfe,[t[15]||(t[15]=H
5230a("h2",{class:"section-heading"},[Ha("span",{class:"hg-so"},"3"),Ga(" Chá»n khung giá»")],-1)),Ha("span",ffe,ee(C.value.length)+" khung còn trá»ng",1)]),S.value.length?(Ma(),Va("div",pfe,[(Ma(!0),Va(Sa,null,gi(S.value,e=>(Ma(),Va("button",{key:e,type:"button",class:G(["hg-o-gio",{"hg-o-gio--trong":C.value.includes(e),"hg-o-gio--chon":L.thoigianhengio===e,"hg-o-gio--giu":M.value.includes(e)&&!E.value.includes(e),"hg-o-gio--het":E.value.includes(e)}]),disabled:!C.value.includes(e),onClick:t=>fe(e)},ee(e),11,gfe))),128))])):Qa("",!0),le.value?(Ma(),Va("p",mfe,ee(le.value),1)):Qa("",!0),t[16]||(t[16]=Ha("div",{class:"hg-chu-thich"},[Ha("span",null,[Ha("i",{class:"hg-cham hg-cham--trong"}),Ga(" Còn trá»ng")]),Ha("span",null,[Ha("i",{class:"hg-cham hg-cham--giu"}),Ga(" Ngưá»i khác Äang giữ")]),Ha("span",null,[Ha("i",{class:"hg-cham hg-cham--het"}),Ga(" Äã có ngưá»i Äặt")])],-1))])):Qa("",!0),o?(Ma(),Va("p",vfe,[Ha("button",{type:"button",onClick:de},t[17]||(t[17]=[Ha("i",{class:"fas fa-chevron-left"},null,-1),Ga(" Giữ nguyên giá» cÅ©, quay lại vé ")]))])):Qa("",!0)]),Ha("footer",yfe,[t[18]||(t[18]=Ha("p",{class:"hg-footer-chinh"},"Há» thá»ng xếp hà ng tá»± Äá»ng QRCode",-1)),(null==(r=Ot(g))?void 0:r.thietke)?(Ma(),Va("p",bfe,ee(Ot(g).thietke),1)):Qa("",!0)])]),Ha("div",{class:"modal fade",tabindex:"-1","aria-hidden":"true",ref_key:"modalThongTinRef",ref:y},[Ha("div",_fe,[Ha("div",wfe,[Ha("div",kfe,[Ha("h5",xfe,ee(ce.value),1),t[19]||(t[19]=Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Äóng"},null,-1))]),Ha("div",Tfe,[U.value?(Ma(),Va("div",Cfe,[Ha("div",Efe,[Ha("span",Sfe,"Quầy "+ee(U.value.ten),1),L.thoigianhengio?(Ma(),Va("span",Ife,ee(L.thoigianhengio)+" · "+ee(ue.value),1)):Qa("",!0)]),Ha("span",Afe,ee(U.value.tieuDe),1)])):Qa("",!0),Ha("form",{class:"tt-form",onSubmit:t[4]||(t[4]=Es(e=>(async()=>{if(!c.value.quetqrhengio)return void VT("Hẹn giá» giao dá»ch Äang tạm dừng!");if(!L.thoigianhengio)return void VT("Vui lòng chá»n thá»i gian giao dá»ch");if(!L.quay)return void VT("Vui lòng chá»n quầy");if(!oe(L.thoigianhengio))return void(await se(L.thoigianhengio));if(!uC(L.sodienthoai))return void VT("Sá» Äiá»n thoại không hợp lá». Vui lòng nháºp 10 sá», bắt Äầu bằng 03, 05, 07, 08 hoặc 09.");const e=h.value.find(e=>e.id===L.quay);if(!e.trangthai&&q.value)return void(await wO("Quầy ".concat(e.ten,": Lượt khách chá» tại quầy Äã quá thá»i gian là m viá»c dá»± kiến. Vui lòng quay lại sau. Trân trá»ng!"),"Vui lòng chá»n quầy khác hoặc quay lại sau."));const t=pC(e,c.value,L.ngayhengio,!0);if(t)VT("Quầy ".concat(e.ten,": ").concat(t,"!"));else{m.value=!0,v.value=!1,A.value&&(A.value(),A.value=null);try{const e=dC(L);Object.assign(L,e);const[t,n]=L.thoigianhengio.split(":");L.ngayhengio.setHours(t,n),await W();const i=z.value[L.quay];if(i)return VT("Bạn Äã có lá»ch hẹn tại quầy nà y. Hãy Äá»i giá» lá»ch hẹn Äó thay vì Äặt thêm."),void $(i);if(Q.value)return void VT("Bạn Äang giữ ".concat(K.value," lá»ch hẹn, mức tá»i Äa cá»§a ÄÆ¡n vá». Huá»· bá»t má»t lá»ch Äá» Äặt thêm."));v.value=!0,await J()}catch(eRe){VT("Không Äặt ÄÆ°á»£c lá»ch hẹn. Vui lòng thá» lại."),v.value=!1,await Z()}finally{m.value=!1}}})(),["prevent"]))},[Ha("div",Dfe,[t[20]||(t[20]=Ha("label",{for:"hoten"},[Ga("Há» và tên "),Ha("span",{class:"tt-bat-buoc"},"*")],-1)),gn(Ha("input",{id:"hoten",type:"text",required:"",maxlength:"100","onUpdate:modelValue":t[1]||(t[1]=e=>L.hoten=e),placeholder:"Nháºp há» và tên"},null,512),[[ms,L.hoten]])]),Ha("div",Pfe,[t[21]||(t[21]=Ha("label",{for:"sodienthoai"},[Ga("Sá» Äiá»n thoại "),Ha("span",{class:"tt-bat-buoc"},"*")],-1)),gn(Ha("input",{id:"sodienthoai",type:"tel",required:"","onUpdate:modelValue":t[2]||(t[2]=e=>L.sodienthoai=e),placeholder:"Nháºp sá» Äiá»n thoại Äá» nháºn vé"},null,512),[[ms,L.sodienthoai]])]),Ha("div",Ofe,[t[22]||(t[22]=Ha("label",{for:"email"},"Äá»a chá» email",-1)),gn(Ha("input",{id:"email",type:"email",maxlength:"100","onUpdate:modelValue":t[3]||(t[3]=e=>L.email=e),placeholder:"Nháºp email Äá» nháºn vé"},null,512),[[ms,L.email]])]),Ha("p",Mfe,[t[26]||(t[26]=Ha("i",{class:"fas fa-triangle-exclamation"},null,-1)),Ha("span",null,[t[23]||(t[23]=Ga(" Bạn có ")),Ha("strong",null,ee(k.value)+" phút cuá»i",1),t[24]||(t[24]=Ga(" trưá»c giá» hẹn Äá» có mặt tại quầy và má» vé bấm xác nháºn. ")),t[25]||(t[25]=Ha("strong",null,"Quá giá» hẹn mà chưa xác nháºn là mất lượt.",-1))])]),Ha("button",{type:"submit",class:"nut nut-xanh nut-rong",disabled:m.value},ee(m.value?"Äang xá» lý...":"Äặt lá»ch"),9,Nfe)],32)])])])],512)])}}},Lfe=CC(Rfe,[["__scopeId","data-v-57b1ad87"]]),Vfe={class:"d-flex justify-content-center align-items-center my-2 my-md-3"},qfe={class:"table-container"},Ffe={class:"header"},Bfe={class:"logo-section"},Ufe=["src"],jfe={class:"footer"},Hfe={key:0},zfe=CC({__name:"MaHetHan",setup(e){const t=Vl(),n=JT(),{item:i}=Zs(n),a=i8(),{item:o}=Zs(a),s=t.params.don_vi;return Zn(async()=>{try{await Promise.all([n.fetchItemById(s),a.fetchData()])}catch(eRe){}}),(e,t)=>{var n,a,s,r;return Ma(),Va("div",Vfe,[Ha("div",qfe,[Ha("div",Ffe,[Ha("div",Bfe,[Ha("img",{src:(null==(n=Ot(i))?void 0:n.logo)||"/images/logodanang.png",width:"55",height:"55",alt:"Logo",class:"rounded-circle shadow-sm"},null,8,Ufe),Ha("div",null,[Ha("h3",null,ee(null==(a=Ot(i))?void 0:a.ten),1),t[0]||(t[0]=Ha("p",{class:"heading-2"},"Há» thá»ng xếp hà ng tá»± Äá»ng QRCode",-1))])])]),t[1]||(t[1]=Ha("div",{class:"queue-card text-center"},[Ha("div",{class:"alert alert-custom alert-danger shadow-sm",role:"alert"},[Ha("i",{class:"fas fa-exclamation-triangle me-2"}),Ha("span",{class:"alert-text text-uppercase"},"Mà HẾT HẠN!")]),Ha("p",{class:"my-2 text-muted"},"Vui lòng thá»±c hiá»n quét lại mã Äá» lấy vé Äiá»n tá».")],-1)),Ha("p",jfe,[Ha("span",null,ee((null==(s=Ot(o))?void 0:s.banquyen)||"Há» thá»ng xếp hà ng tá»± Äá»ng QRCode"),1),(null==(r=Ot(o))?void 0:r.thietke)?(Ma(),Va("span",Hfe,ee(Ot(o).thietke),1)):Qa("",!0)])])])}}},[["__scopeId","data-v-46764b77"]]),Wfe={class:"modal-dialog modal-dialog-scrollable modal-fullscreen-sm-down"},Kfe={class:"modal-content hd-modal"},Gfe={class:"modal-header hd-header"},Yfe={class:"modal-title"},Qfe={key:0,class:"hd-mo-ta"},$fe={class:"modal-body"},Xfe={class:"hd-bang"},Jfe={key:0,class:"hd-dang-phuc-vu"},Zfe={class:"cot-stt"},epe=["title","aria-label"],tpe={class:"cot-stt"},npe=["title","aria-label"],ipe={key:1,class:"hd-ban"},ape={key:1},ope={class:"hd-bang"},spe={class:"cot-stt"},rpe=["title","aria-label"],lpe={key:0,class:"hd-ban"},cpe={class:"cot-tt"},upe={key:1,class:"hd-chu-thich"},hpe={key:0},dpe={key:1},fpe=CC({__name:"ModalHangDoi",props:{hangDoi:{type:Array,default:()=>[]},henGioSapToi:{type:Array,default:()=>[]},dangPhucVu:{type:Object,default:null},idCuaToi:{type:[String,Array],default:""},tenQuay:{type:String,default:""},moTa:{type:String,default:""},choPhepUuTien:{type:Boolean,default:!1},choPhepHenGio:{type:Boolean,default:!1}},setup(e,{expose:t}){const n=e,i=bo(()=>new Set((Array.isArray(n.idCuaToi)?n.idCuaToi:[n.idCuaToi]).filter(
5230Boolean)));pa(i,e=>e.forEach(f1),{immediate:!0});const a=e=>[...i.value].some(t=>p1(e,t)),o=It(null);let s=null;return ii(()=>{null==s||s.hide()}),t({moModal:()=>{s||(s=new wV(o.value)),s.show()}}),(t,n)=>(Ma(),Va("div",{class:"modal fade",tabindex:"-1","aria-hidden":"true",ref_key:"modalRef",ref:o},[Ha("div",Wfe,[Ha("div",Kfe,[Ha("div",Gfe,[Ha("h5",Yfe,"Quầy "+ee(e.tenQuay),1),n[0]||(n[0]=Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Äóng"},null,-1))]),e.moTa?(Ma(),Va("p",Qfe,ee(e.moTa),1)):Qa("",!0),Ha("div",$fe,[Ha("table",Xfe,[n[4]||(n[4]=Ha("thead",null,[Ha("tr",null,[Ha("th",{scope:"col",class:"cot-stt"},"Stt"),Ha("th",{scope:"col"},"Há» tên"),Ha("th",{scope:"col",class:"cot-tt"},"Trạng thái")])],-1)),Ha("tbody",null,[e.dangPhucVu?(Ma(),Va("tr",Jfe,[Ha("td",Zfe,ee(e.dangPhucVu.ma),1),Ha("td",null,[Ga(ee(Ot(yhe)(e.dangPhucVu.hoten))+" ",1),e.dangPhucVu.loai!==Ot(dhe)?(Ma(),Va("i",{key:0,class:G([Ot(mhe)[e.dangPhucVu.loai],"hd-icon hd-icon--".concat(e.dangPhucVu.loai)]),title:Ot(ghe)[e.dangPhucVu.loai],"aria-label":Ot(ghe)[e.dangPhucVu.loai]},null,10,epe)):Qa("",!0)]),n[1]||(n[1]=Ha("td",{class:"cot-tt"},[Ha("span",{class:"hd-tt hd-tt--phucvu"},"Äang phục vụ")],-1))])):Qa("",!0),(Ma(!0),Va(Sa,null,gi(e.hangDoi,e=>(Ma(),Va("tr",{key:e.id,class:G({"hd-cua-toi":a(e.id)})},[Ha("td",tpe,ee(e.ma),1),Ha("td",null,[Ga(ee(Ot(yhe)(e.hoten))+" ",1),e.loai!==Ot(dhe)?(Ma(),Va("i",{key:0,class:G([Ot(mhe)[e.loai],"hd-icon hd-icon--".concat(e.loai)]),title:Ot(ghe)[e.loai],"aria-label":Ot(ghe)[e.loai]},null,10,npe)):Qa("",!0),a(e.id)?(Ma(),Va("span",ipe,"(bạn)")):Qa("",!0)]),n[2]||(n[2]=Ha("td",{class:"cot-tt"},[Ha("span",{class:"hd-tt hd-tt--cho"},"Äang chá»")],-1))],2))),128)),e.hangDoi.length||e.dangPhucVu?Qa("",!0):(Ma(),Va("tr",ape,n[3]||(n[3]=[Ha("td",{colspan:"3",class:"hd-trong"},"Chưa có ai trong hà ng Äợi",-1)])))])]),e.henGioSapToi.length?(Ma(),Va(Sa,{key:0},[n[5]||(n[5]=Ha("div",{class:"hd-tieu-de-phu"},[Ha("h6",null,"Lá»ch hẹn sắp tá»i")],-1)),Ha("table",ope,[Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(e.henGioSapToi,e=>(Ma(),Va("tr",{key:e.id,class:G({"hd-cua-toi":a(e.id)})},[Ha("td",spe,ee(e.ma),1),Ha("td",null,[Ga(ee(Ot(yhe)(e.hoten))+" ",1),Ha("i",{class:G([Ot(mhe)[e.loai],"hd-icon hd-icon--hengio"]),title:Ot(ghe)[e.loai],"aria-label":Ot(ghe)[e.loai]},null,10,rpe),a(e.id)?(Ma(),Va("span",lpe,"(bạn)")):Qa("",!0)]),Ha("td",cpe,[Ha("span",{class:G(["hd-tt",e.daxacnhan?"hd-tt--xacnhan":"hd-tt--chua"])},ee(e.daxacnhan?"Äã xác nháºn":"Chưa xác nháºn"),3)])],2))),128))])])],64)):Qa("",!0),e.choPhepHenGio||e.choPhepUuTien?(Ma(),Va("div",upe,[e.choPhepHenGio?(Ma(),Va("span",hpe,[Ha("i",{class:G([Ot(mhe)[Ot(phe)],"hd-icon hd-icon--hengio"]),"aria-hidden":"true"},null,2),n[6]||(n[6]=Ga(" Khách Äặt lá»ch hẹn "))])):Qa("",!0),e.choPhepUuTien?(Ma(),Va("span",dpe,[Ha("i",{class:G([Ot(mhe)[Ot(fhe)],"hd-icon hd-icon--uutien"]),"aria-hidden":"true"},null,2),n[7]||(n[7]=Ga(" Khách diá»n ưu tiên "))])):Qa("",!0)])):Qa("",!0)])])])],512))}},[["__scopeId","data-v-da50a75e"]]),ppe={class:"hd-luoi"},gpe={key:0,class:"hd-o"},mpe={key:1,class:"hd-o"},vpe={class:"hd-o"},ype={class:"hd-o"},bpe={key:0,class:"hd-thanh-phan"},_pe=CC({__name:"HangDoiQuay",props:{hangDoi:{type:Array,default:()=>[]},henGioSapToi:{type:Array,default:()=>[]},dangPhucVu:{type:Object,default:null},idCuaToi:{type:String,default:""},thoiGianPhucVu:{type:[Number,String],default:0},tenQuay:{type:String,default:""},moTa:{type:String,default:""},soUuTien:{type:Number,default:0},soHenGio:{type:Number,default:0},choPhepUuTien:{type:Boolean,default:!1},choPhepHenGio:{type:Boolean,default:!1}},setup(e){const t=e;pa(()=>t.idCuaToi,f1,{immediate:!0});const n=It(null),i=()=>{var e;return null==(e=n.value)?void 0:e.moModal()},a=bo(()=>{const e=(n=t.hangDoi,i=t.idCuaToi,n.findIndex(e=>p1(e.id,i)));var n,i;return e<0?null:e}),o=It(new Date);pa(a,()=>{o.value=new Date});const s=bo(()=>{if(null===a.value)return"";const e=Che(a.value,t.thoiGianPhucVu,o.value);return e?new Intl.DateTimeFormat("vi-VN",{hour:"2-digit",minute:"2-digit",hour12:!1}).format(e):""}),r=bo(()=>{const e=[];return t.soUuTien>0&&e.push("".concat(t.soUuTien," khách diá»n ưu tiên")),t.soHenGio>0&&e.push("".concat(t.soHenGio," khách Äặt lá»ch hẹn")),e.join(" và ")});return(t,o)=>{var l;return Ma(),Va("div",null,[Ha("dl",ppe,[null!==a.value?(Ma(),Va("div",gpe,[o[1]||(o[1]=Ha("dt",null,"Trưá»c bạn còn",-1)),Ha("dd",null,[Ga(ee(a.value)+" ",1),o[0]||(o[0]=Ha("span",{class:"hd-don-vi"},"ngưá»i",-1))])])):Qa("",!0),s.value?(Ma(),Va("div",mpe,[o[2]||(o[2]=Ha("dt",null,"Dá»± kiến tá»i lượt",-1)),Ha("dd",null,ee(s.value),1)])):Qa("",!0),Ha("div",vpe,[o[3]||(o[3]=Ha("dt",null,"Äang phục vụ",-1)),Ha("dd",null,ee((null==(l=e.dangPhucVu)?void 0:l.ma)||"..."),1)]),Ha("div",ype,[o[4]||(o[4]=Ha("dt",null,"Tá»ng lượt chá»",-1)),Ha("dd",null,ee(e.hangDoi.length),1)])]),r.value?(Ma(),Va("p",bpe," Trong Äó có "+ee(r.value)+". ",1)):Qa("",!0),vi(t.$slots,"thao-tac",{},void 0,!0),Ha("button",{type:"button",class:"hd-nut",onClick:i},o[5]||(o[5]=[Ha("i",{class:"fas fa-list-ul"},null,-1),Ga(" Xem lượt chá» tại quầy ")])),za(fpe,{ref_key:"modalRef",ref:n,hangDoi:e.hangDoi,henGioSapToi:e.henGioSapToi,dangPhucVu:e.dangPhucVu,idCuaToi:e.idCuaToi,tenQuay:e.tenQuay,moTa:e.moTa,choPhepUuTien:e.choPhepUuTien,choPhepHenGio:e.choPhepHenGio},null,8,["hangDoi","henGioSapToi","dangPhucVu","idCuaToi","tenQuay","moTa","choPhepUuTien","choPhepHenGio"])])}}},[["__scopeId","data-v-707d14c7"]]),wpe={class:"modal-dialog modal-dialog-centered"},kpe={class:"modal-content tt-modal"},xpe={class:"modal-body"},Tpe={class:"tt-danh-sach"},Cpe={class:"tt-dong"},Epe={class:"tt-dong"},Spe={class:"tt-dong"},Ipe={class:"tt-email"}
5230,Ape={key:0,class:"tt-dong"},Dpe={key:1,class:"tt-dong"},Ppe=CC({__name:"ModalThongTinVe",props:{hoTen:{type:String,default:""},soDienThoai:{type:String,default:""},email:{type:String,default:""},tenQuay:{type:String,default:""},nhanThoiGian:{type:String,default:""},giaTriThoiGian:{type:String,default:""}},setup(e,{expose:t}){const n=It(null);let i=null;return ii(()=>{null==i||i.hide()}),t({moModal:()=>{i||(i=new wV(n.value)),i.show()}}),(t,i)=>(Ma(),Va("div",{class:"modal fade",tabindex:"-1","aria-hidden":"true",ref_key:"modalRef",ref:n},[Ha("div",wpe,[Ha("div",kpe,[i[5]||(i[5]=Ha("div",{class:"modal-header tt-header"},[Ha("h5",{class:"modal-title"},"Thông tin cá»§a bạn"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Äóng"})],-1)),Ha("div",xpe,[Ha("dl",Tpe,[Ha("div",Cpe,[i[0]||(i[0]=Ha("dt",null,"Há» và tên",-1)),Ha("dd",null,ee(e.hoTen||"â"),1)]),Ha("div",Epe,[i[1]||(i[1]=Ha("dt",null,"Sá» Äiá»n thoại",-1)),Ha("dd",null,ee(e.soDienThoai||"â"),1)]),Ha("div",Spe,[i[2]||(i[2]=Ha("dt",null,"Email",-1)),Ha("dd",Ipe,ee(e.email||"â"),1)]),e.tenQuay?(Ma(),Va("div",Ape,[i[3]||(i[3]=Ha("dt",null,"Quầy",-1)),Ha("dd",null,ee(e.tenQuay),1)])):Qa("",!0),e.nhanThoiGian?(Ma(),Va("div",Dpe,[Ha("dt",null,ee(e.nhanThoiGian),1),Ha("dd",null,ee(e.giaTriThoiGian||"â"),1)])):Qa("",!0)]),i[4]||(i[4]=Ha("p",{class:"tt-ghi-chu"}," Thông tin nà y chá» hiá»n trên máy cá»§a bạn khi bạn chạm và o sá». Mà n hình công cá»ng ngoà i sảnh không hiá»n thá» sá» Äiá»n thoại và email. ",-1))])])])],512))}},[["__scopeId","data-v-73481a5d"]]),Ope={class:"lv-khoi"},Mpe={class:"lv-nhac"},Npe={class:"lv-hang"},Rpe={class:"modal-dialog modal-dialog-centered modal-dialog-scrollable"},Lpe={class:"modal-content lv-modal"},Vpe={class:"modal-header lv-header"},qpe={class:"modal-title"},Fpe={class:"modal-body lv-than"},Bpe={class:"lv-cach"},Upe={class:"lv-ten"},jpe=["src","alt"],Hpe=CC({__name:"LuuVe",props:{tenVe:{type:String,default:"vé"}},setup(e){const t=e,n=It(null);let i=null;const a=It(!1),o=It(!1),s=It("khac"),r=It(!1),l=bo(()=>"ios"===s.value?"/images/luuve_iphone.jpg":"android"===s.value?"/images/luuve_android.png":""),c=bo(()=>r.value?o.value?["zalo","chiaSe","chep"]:["zalo","chep"]:o.value?["chiaSe","zalo","chep"]:["zalo","chep"]);ei(()=>{i=new wV(n.value),o.value="undefined"!=typeof navigator&&"function"==typeof navigator.share,s.value=(()=>{if("undefined"==typeof navigator)return"khac";const e=navigator.userAgent||"";return/Android/i.test(e)?"android":/iPad|iPhone|iPod/i.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1?"ios":"khac"})(),r.value="undefined"!=typeof navigator&&/Zalo/i.test(navigator.userAgent||"")}),ii(()=>{null==i||i.dispose()});const u=()=>null==i?void 0:i.show(),h=async()=>{try{await navigator.share({title:t.tenVe,url:window.location.href})}catch(e){"AbortError"!==(null==e?void 0:e.name)&&VT("Không má» ÄÆ°á»£c bảng chia sẻ. Vui lòng thá» cách sao chép ÄÆ°á»ng dẫn.")}},d=async()=>{var e;const t=window.location.href;try{(null==(e=navigator.clipboard)?void 0:e.writeText)?await navigator.clipboard.writeText(t):(e=>{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();try{if(!document.execCommand("copy"))throw new Error("execCommand trả vá» false")}finally{document.body.removeChild(t)}})(t),a.value=!0,LT("Äã sao chép ÄÆ°á»ng dẫn vé.")}catch(n){VT("Không sao chép ÄÆ°á»£c. Vui lòng chụp mà n hình hoặc lưu vé và o Zalo.")}};return(t,i)=>(Ma(),Va(Sa,null,[Ha("div",Ope,[Ha("p",Mpe,[i[0]||(i[0]=Ha("i",{class:"fas fa-circle-info"},null,-1)),Ha("span",null,ee(e.tenVe[0].toUpperCase()+e.tenVe.slice(1))+" chá» nằm trong trình duyá»t nà y. Lưu lại Äá» má» ÄÆ°á»£c sau khi Äóng trình duyá»t hoặc khi Äá»i máy. ",1)]),Ha("div",Npe,[Ha("button",{type:"button",class:"lv-nut lv-nut-chinh",onClick:u},i[1]||(i[1]=[Ha("i",{class:"fas fa-bookmark"},null,-1),Ga(" Lưu vé ")])),Ha("button",{type:"button",class:G(["lv-nut",{"lv-nut-xong":a.value}]),onClick:d},[i[2]||(i[2]=Ha("i",{class:"fas fa-link"},null,-1)),Ga(" "+ee(a.value?"Äã sao chép":"Sao chép link"),1)],2)])]),(Ma(),qa(En,{to:"body"},[Ha("div",{class:"modal fade",tabindex:"-1","aria-hidden":"true",ref_key:"modalRef",ref:n},[Ha("div",Rpe,[Ha("div",Lpe,[Ha("div",Vpe,[Ha("h5",qpe,"Lưu "+ee(e.tenVe),1),i[3]||(i[3]=Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Äóng"},null,-1))]),Ha("div",Fpe,[i[11]||(i[11]=Ha("p",{class:"lv-vi-sao"}," Chá»n má»t trong các cách dưá»i Äây. Cách nà o cÅ©ng ÄÆ°á»£c, miá»
n là má» lại ÄÆ°á»£c ÄÆ°á»ng dẫn vé khi cần. ",-1)),Ha("ol",Bpe,[(Ma(!0),Va(Sa,null,gi(c.value,e=>(Ma(),Va("li",{key:e},["chiaSe"===e?(Ma(),Va(Sa,{key:0},[i[5]||(i[5]=Ha("p",{class:"lv-ten"},"Gá»i vé và o Zalo",-1)),i[6]||(i[6]=Ha("p",{class:"lv-mo-ta"},[Ga(" Bấm nút dưá»i Äây, chá»n "),Ha("strong",null,"Zalo"),Ga(", rá»i chá»n chÃnh mình hoặc "),Ha("strong",null,"Cloud cá»§a tôi"),Ga(" Äá» tá»± gá»i cho mình. ")],-1)),Ha("button",{type:"button",class:"lv-nut lv-nut-chinh lv-nut-rong",onClick:h},i[4]||(i[4]=[Ha("i",{class:"fas fa-share-nodes"},null,-1),Ga(" Chá»n ứng dụng Äá» gá»i ")]))],64)):"zalo"===e?(Ma(),Va(Sa,{key:1},[Ha("p",Upe,ee(r.value?"Lưu và o Cloud cá»§a tôi":"Nếu bạn Äang má» vé trong Zalo"),1),i[7]||(i[7]=Ha("p",{class:"lv-mo-ta"},[Ga(" Bấm dấu "),Ha("strong",null,"â®"),Ga(" á» góc trên bên phải mà n hình, rá»i chá»n "),Ha("strong",null,"Lưu và o Cloud cá»§a tôi"),Ga(". ")],-1)),l.value?(Ma(),Va("img",{key:0,class:"lv-anh",src:l.value,alt:"Minh hoạ trên ".concat("ios"===s.value?"iPhone":"Android",": má» menu ba chấm trong Zalo rá»i chá»n Lưu và o Cloud cá»§a tôi")},null,8,jpe)):Qa("",!0)],64)):(Ma(),Va(Sa,{key:2},[i[9]||(i[9]=Ha("p",{class:"lv-ten"},"Sao chép ÄÆ°á»ng dẫn",-1)),i[10]||(i[10]=Ha("p",{class:"lv-mo-ta"}
5230," Dán và o tin nhắn hoặc ghi chú cá»§a bạn. Má» lại ÄÆ°á»ng dẫn Äó là thấy vé. ",-1)),Ha("button",{type:"button",class:G(["lv-nut lv-nut-rong",{"lv-nut-xong":a.value}]),onClick:d},[i[8]||(i[8]=Ha("i",{class:"fas fa-link"},null,-1)),Ga(" "+ee(a.value?"Äã sao chép":"Sao chép ÄÆ°á»ng dẫn"),1)],2)],64))]))),128))])])])])],512)]))],64))}},[["__scopeId","data-v-7d701f47"]]),zpe="https://messenger.svc.chative.io/static/v1.0/channels/".concat("sb847a38b-e9b0-429b-bb06-ffd8d0f83f8f","/messenger.js?mode=livechat"),Wpe="chative-messenger",Kpe="chative-che-giao-dien",Gpe="chat-truc-tuyen-mo",Ype="iframe[data-cti-id]",Qpe="chat-truc-tuyen-khoi-boc",$pe=["Chative","ChativeApi","ChativeEvents","ctiApiKeys","cti"];let Xpe=0,Jpe=null,Zpe=null,ege=null;const tge=It(!1),nge=It(0);let ige="",age=!1;const oge=e=>{let t=e;for(;t.parentElement&&t.parentElement!==document.body;)t=t.parentElement;const n=document.getElementById("app");return n&&t.contains(n)?e:t};let sge=null;const rge=()=>{sge&&(clearTimeout(sge),sge=null)},lge=()=>{document.documentElement.classList.add(Gpe),tge.value=!0,uge()},cge=()=>{rge(),document.documentElement.classList.remove(Gpe),tge.value=!1},uge=()=>{if(Zpe||ege)return;let e=60;const t=e=>{oge(e).classList.add(Qpe),Zpe=new ResizeObserver(()=>{tge.value&&e.getBoundingClientRect().height<300&&cge()}),Zpe.observe(e)},n=document.querySelector(Ype);if(n)return t(n);ege=setInterval(()=>{const n=document.querySelector(Ype);e-=1,(n||e<=0)&&(clearInterval(ege),ege=null,n&&t(n))},500)},hge=async e=>{nge.value+=1,ige&&await z0(B0(ige),e)},dge=(e,t)=>{var n;try{window.ChativeEvents=window.ChativeEvents||[],window.ChativeEvents.push([e,t]),null==(n=window.ChativeApi)||n.call(window,e,t)}catch(ZNe){}},fge=()=>{if((()=>{if(document.getElementById(Kpe))return;const e=document.createElement("style");e.id=Kpe,e.textContent="\nbody > *:has(".concat(Ype,") { opacity: 0 !important; }\nhtml.").concat(Gpe," body > *:has(").concat(Ype,") { opacity: 1 !important; }\nhtml:not(.").concat(Gpe,") body > *:has(").concat(Ype,"),\nhtml:not(.").concat(Gpe,") body > *:has(").concat(Ype,") * { pointer-events: none !important; }\n\n.").concat(Qpe," { opacity: 0 !important; }\nhtml.").concat(Gpe," .").concat(Qpe," { opacity: 1 !important; }\nhtml:not(.").concat(Gpe,") .").concat(Qpe,",\nhtml:not(.").concat(Gpe,") .").concat(Qpe," * { pointer-events: none !important; }\n\n").concat(Ype," { opacity: 0 !important; }\nhtml.").concat(Gpe," ").concat(Ype," { opacity: 1 !important; }\nhtml:not(.").concat(Gpe,") ").concat(Ype," { pointer-events: none !important; }\n"),document.head.appendChild(e)})(),uge(),(()=>{if(age)return;age=!0;const e=(e,t)=>dge("addEventListener",{event:e,callback:t});e("opened",()=>{rge(),lge(),hge("soLuotMo")}),e("closed",()=>{cge(),hge("soLuotDong")}),e("message-sent",()=>hge("soTinNguoiDanGui")),e("new-agent-message",()=>hge("soLuotCanBoTraLoi"))})(),document.getElementById(Wpe))return;const e=document.createElement("script");e.id=Wpe,e.src=zpe,e.async=!0,document.body.appendChild(e)},pge=()=>{dge("openChatWindow"),hge("soLuotBam"),rge(),sge=setTimeout(()=>{sge=null,lge()},2500)},gge=({maDonVi:e=""}={})=>(ei(()=>{Xpe+=1,Jpe&&(clearTimeout(Jpe),Jpe=null),ige=e||ige,(async()=>{ige&&(nge.value=await H0(B0(ige)))})(),fge()}),ii(()=>{Xpe-=1,Xpe>0||(Jpe=setTimeout(()=>{Jpe=null,0===Xpe&&(()=>{var e;cge();try{"function"==typeof window.ChativeApi&&window.ChativeApi("destroy")}catch(ZNe){}Zpe&&(Zpe.disconnect(),Zpe=null),ege&&(clearInterval(ege),ege=null),null==(e=document.getElementById(Kpe))||e.remove(),document.querySelectorAll("#".concat(Wpe,', script[src*="messenger.svc.chative.io"]')).forEach(e=>e.remove()),document.querySelectorAll(Ype).forEach(e=>{oge(e).remove()}),$pe.forEach(e=>{delete window[e]}),age=!1})()},0))}),{dangMo:tge,soLuot:nge,moChat:pge}),mge=["title","aria-label"],vge={class:"chu"},yge={class:"ten"},bge={key:0,class:"dem"},_ge={__name:"ChatTrucTuyen",props:{nhan:{type:String,default:"Äà Nẵng AI"},hienSoLuot:{type:Boolean,default:!0},lechDuoi:{type:Number,default:24},lechPhai:{type:Number,default:24}},setup(e){const t=Vl(),{dangMo:n,soLuot:i,moChat:a}=gge({maDonVi:t.params.don_vi}),o=bo(()=>new Intl.NumberFormat("vi-VN").format(i.value));return(t,s)=>(Ma(),Va("button",{type:"button",class:G(["nut-chat-truc-tuyen",{an:Ot(n)}]),style:j({bottom:"".concat(e.lechDuoi,"px"),right:"".concat(e.lechPhai,"px")}),title:e.nhan,"aria-label":e.nhan,onClick:s[0]||(s[0]=(...e)=>Ot(a)&&Ot(a)(...e))},[s[1]||(s[1]=Ha("i",{class:"fas fa-headset"},null,-1)),Ha("span",vge,[Ha("span",yge,ee(e.nhan),1),e.hienSoLuot&&Ot(i)?(Ma(),Va("span",bge,ee(o.value)+" lượt há» trợ",1)):Qa("",!0)])],14,mge))}},wge=CC(_ge,[["__scopeId","data-v-5403d51b"]]),kge={class:"ve-wrap"},xge={class:"ve-the"},Tge={class:"ve-header"},Cge=["src","alt"],Ege={class:"ve-header-chu"},Sge={key:0,class:"ve-don-vi"},Ige={class:"ve-body"},Age={class:"ve-khoi-chinh"},Dge={class:"so-gia-tri"},Pge={class:"so-phu"}
5230,Oge={class:"so-phu-o"},Mge={class:"so-phu-o"},Nge={class:"ve-than"},Rge={class:"tt-mo-ta"},Lge={key:0,class:"tt-mo-ta"},Vge={class:"ve-khoi-cuoi"},qge={class:"ve-lien-ket"},Fge=["href"],Bge=["href"],Uge=["href"],jge={class:"ve-footer"},Hge={key:0,class:"ve-footer-phu"},zge=CC({__name:"VeDienTu",setup(e){const t=Vl(),n=t.params.don_vi,i=t.params.khach_hang,a=i8(),{item:o}=Zs(a),s=JT(),{item:r}=Zs(s),l=y1(),{item:c,items:u,khachDangPhucVu:h}=Zs(l),d=wI(),{item:f}=Zs(d),p=Fde();Zs(p);const g=It([]),m=It(null),v=()=>{var e;return null==(e=m.value)?void 0:e.moModal()},y=It(!1);pa(()=>S.value,()=>{y.value=!1});const b=It(new Date);let _=null;ei(async()=>{try{_=setInterval(()=>{b.value=new Date},1e3),await Promise.all([s.realtimeItemById(n),l.fetchItemById(i),a.fetchData()]),r.value.logo||(r.value.logo="/images/logodanang.png"),await Promise.all([d.fetchItemById(c.value.quay),l.realtimeKhachDangPhucVu(n,c.value.quay),l.realtimeKhachChuaPhucVu(n,c.value.quay),p.realtimeItemsByDonViQuayNgay(n,c.value.quay,iQ(new Date),pQ(new Date),e=>{g.value=e})])}catch(eRe){}});const w=bo(()=>{var e;return!!(null==(e=c.value)?void 0:e.doi_tuong_uu_tien)}),k=bo(()=>{var e;return The({dsKhachHang:u.value||[],dsHenGio:g.value||[],uuTienVuotHenGio:!!(null==(e=r.value)?void 0:e.uutien_vuot_hengio),bayGio:b.value})}),x=bo(()=>{var e;return!!(null==(e=c.value)?void 0:e.daphucvu)}),T=bo(()=>{var e,t;return!1===(null==(e=c.value)?void 0:e.calamviec)&&!(null==(t=c.value)?void 0:t.daphucvu)}),C=bo(()=>{var e,t;return!!(null==(e=c.value)?void 0:e.dangphucvu)&&!(null==(t=c.value)?void 0:t.daphucvu)}),E=bo(()=>{var e,t,n;return!0===(null==(e=c.value)?void 0:e.calamviec)&&!(null==(t=c.value)?void 0:t.daphucvu)&&!(null==(n=c.value)?void 0:n.dangphucvu)}),S=bo(()=>C.value?"tt-den-luot":x.value?"tt-xong":T.value?"tt-bo-qua":E.value?"tt-cho":"tt-nghi"),I=bo(()=>"/".concat(n,"/bang-dien-tu")),A=e=>e?e.toDate().toLocaleString("vi-VN",{hour:"2-digit",minute:"2-digit",day:"2-digit",month:"2-digit",year:"numeric"}):"";return ai(()=>{_&&clearInterval(_)}),(e,t)=>{var a,s,l,u,h,d,p,g,b,_,D,P,O,M,N,R,L,V,q,F,B,U,j,H,z,W,K,Y,Q;return Ma(),Va(Sa,null,[Ha("div",kge,[Ha("div",xge,[Ha("header",Tge,[Ha("img",{class:"ve-logo",src:(null==(a=Ot(r))?void 0:a.logo)||"/images/logodanang.png",alt:(null==(s=Ot(r))?void 0:s.ten)||"Logo ÄÆ¡n vá»"},null,8,Cge),Ha("div",Ege,[(null==(l=Ot(r))?void 0:l.ten)?(Ma(),Va("p",Sge,ee(Ot(r).ten),1)):Qa("",!0),t[1]||(t[1]=Ha("h1",{class:"ve-loai"},"Vé Äiá»n tá»",-1))])]),Ha("div",Ige,[Ha("section",Age,[Ha("button",{type:"button",class:"so-nut",onClick:v},[t[2]||(t[2]=Ha("span",{class:"so-nhan"},"Sá» thứ tá»± cá»§a bạn",-1)),Ha("span",Dge,ee((null==(u=Ot(c))?void 0:u.stt)||"â"),1),t[3]||(t[3]=Ha("span",{class:"so-goi-y"},[Ha("i",{class:"fas fa-circle-info"}),Ga(" Chạm Äá» xem thông tin cá»§a bạn")],-1))]),Ha("dl",Pge,[Ha("div",Oge,[t[4]||(t[4]=Ha("dt",null,"Quầy",-1)),Ha("dd",null,ee((null==(h=Ot(f))?void 0:h.ten)||"â"),1)]),Ha("div",Mge,[t[5]||(t[5]=Ha("dt",null,"Lấy sá» lúc",-1)),Ha("dd",null,ee(A(null==(d=Ot(c))?void 0:d.taoluc)||"â"),1)])]),E.value?(Ma(),qa(_pe,{key:0,hangDoi:k.value.hangDoi,henGioSapToi:k.value.henGioSapToi,dangPhucVu:k.value.dangPhucVu,idCuaToi:Ot(i),thoiGianPhucVu:null==(p=Ot(f))?void 0:p.thoigianphucvu,tenQuay:null==(g=Ot(f))?void 0:g.ten,moTa:null==(b=Ot(f))?void 0:b.mota,soUuTien:k.value.soUuTien,soHenGio:k.value.soHenGio,choPhepUuTien:!!(null==(_=Ot(r))?void 0:_.doi_tuong_uu_tien_enabled),choPhepHenGio:!!(null==(D=Ot(r))?void 0:D.quetqrhengio)},null,8,["hangDoi","henGioSapToi","dangPhucVu","idCuaToi","thoiGianPhucVu","tenQuay","moTa","soUuTien","soHenGio","choPhepUuTien","choPhepHenGio"])):Qa("",!0)]),Ha("section",Nge,[y.value?Qa("",!0):(Ma(),Va("div",{key:0,class:G(["tt-khoi",S.value]),role:"status"},[Ha("button",{type:"button",class:"tt-tat",onClick:t[0]||(t[0]=e=>y.value=!0),"aria-label":"Tắt thông báo"},t[6]||(t[6]=[Ha("i",{class:"fas fa-xmark"},null,-1)])),C.value?(Ma(),Va(Sa,{key:0},[t[7]||(t[7]=Ha("p",{class:"tt-tieu-de"},"Äã Äến lượt bạn",-1)),Ha("p",Rge,"Vui lòng Äến quầy "+ee(null==(P=Ot(f))?void 0:P.ten)+" Äá» là m thá»§ tục.",1)],64)):x.value?(Ma(),Va(Sa,{key:1},[t[8]||(t[8]=Ha("p",{class:"tt-tieu-de"},"Cảm Æ¡n bạn Äã sá» dụng dá»ch vụ",-1)),t[9]||(t[9]=Ha("p",{class:"tt-mo-ta"},"Rất mong nháºn ÄÆ°á»£c góp ý cá»§a bạn á» liên kết bên dưá»i.",-1))],64)):T.value?(Ma(),Va(Sa,{key:2},[t[10]||(t[10]=Ha("p",{class:"tt-tieu-de"},"Äã qua lượt cá»§a bạn",-1)),t[11]||(t[11]=Ha("p",{class:"tt-mo-ta"}," Vui lòng quét mã QR tại ÄÆ¡n vá» Äá» lấy sá» má»i vÃ ÄÆ°á»£c phục vụ trong hôm nay. ",-1))],64)):E.value?(Ma(),Va(Sa,{key:3},[t[12]||(t[12]=Ha("p",{class:"tt-tieu-de"},"Vui lòng chá» Äến lượt",-1)),w.value?(Ma(),Va("p",Lge," Bạn thuá»c diá»n ưu tiên nên ÄÆ°á»£c phục vụ trưá»c theo quy Äá»nh. ")):Qa("",!0)],64)):(Ma(),Va(Sa,{key:4},[t[13]||(t[13]=Ha("p",{class:"tt-tieu-de"},"Ngoà i giá» là m viá»c",-1)),t[14]||(t[14]=Ha("p",{class:"tt-mo-ta"},"Mong bạn thông cảm và vui lòng chá» Äến giá» là m viá»c.",-1))],64))],2)),Ha("div",Vge,[Ha("div",qge,[Ha("a",{href:I.value},t[15]||(t[15]=[Ha("i",{class:"fas fa-tv"},null,-1),Ha("span",null,"Bảng Äiá»n tá» theo dõi lượt chá»",-1),Ha("i",{class:"fas fa-chevron-right ve-mui-ten"},null,-1)]),8,Fge),Ha("a",{href:(null==(O=Ot(r))?void 0:O.thutuc)||"#"},t[16]||(t[16]=[Ha("i",{class:"fas fa-file-lines"},null,-1),Ha("span",null,"Tra cứu thá»§ tục hà nh chÃnh",-1),Ha("i",{class:"fas fa-chevron-right ve-mui-ten"},null,-1)]),8,Bge),Ha("a",{href:(null==(M=Ot(r))?void 0:M.danhgia)||"#"},t[17]||(t[17]=[Ha("i",{class:"fas fa-star"},null,-1),Ha("span",null,"Äánh giá / góp ý",-1),Ha("i",{class:"fas fa-chevron-right ve-mui-ten"},null,-1)]),8,Uge)]),za(Hpe,{tenVe:"vé Äiá»n tá»"})])])]),Ha("footer",jge,[t[18]||(t[18]=Ha("p",{class:"ve-footer-don-vi"},"Há» thá»ng xếp hà ng tá»± Äá»ng QRCode",-1)),(null==(N=Ot(o))?void 0:N.thietke)?(Ma(),Va("p",Hge,ee(Ot(o).thietke),1)):Qa("",!0)])]),za(Ppe,{ref_key:"modalThongTinRef",ref:m,hoTen:(Q=null==(R=Ot(c))?void 0:R.hoten,hC(Q)),soDienThoai:(null==(L=Ot(c))?void 0:L.sodienthoai)||"",email:(null==(V=Ot(c))?void 0:V.email)||"",tenQuay:(null==(q=Ot(f))?void 0:q.ten)||"",nhanThoiGian:"Lấy sá» lúc",giaTriThoiGian:A(null==(F=Ot(c))?void 0:F.taoluc)},null,8,["hoTen","soDienThoai","email","tenQuay","giaTriThoiGian"])]),(null==(B=Ot(r))?void 0:B.hie
5230nthiaichatbot)?(Ma(),qa($he,{key:0,"org-id":(null==(U=Ot(r))?void 0:U.id)||Ot(n),"org-logo":(null==(j=Ot(r))?void 0:j.logo)||"","org-name":(null==(H=Ot(r))?void 0:H.ten)||"Há» thá»ng xếp hà ng QRCode",endpoint:(null==(z=Ot(r))?void 0:z.aichatbot_endpoint)||"","org-greeting":(null==(W=Ot(r))?void 0:W.aichatbot_greeting)||""},null,8,["org-id","org-logo","org-name","endpoint","org-greeting"])):Qa("",!0),(null==(K=Ot(r))?void 0:K.hienthichatdanangai)?(Ma(),qa(wge,{key:1,"lech-duoi":(null==(Y=Ot(r))?void 0:Y.hienthiaichatbot)?96:24},null,8,["lech-duoi"])):Qa("",!0)],64)}}},[["__scopeId","data-v-543da421"]]),Wge={class:"ve-wrap"},Kge={class:"ve-the"},Gge={class:"ve-header"},Yge=["src","alt"],Qge={class:"ve-header-chu"},$ge={key:0,class:"ve-don-vi"},Xge={key:0,class:"ve-body"},Jge={key:1,class:"ve-body"},Zge={class:"ve-khoi-chinh"},eme={class:"so-gia-tri"},tme={class:"so-phu"},nme={class:"so-phu-o"},ime={class:"so-phu-o"},ame=["disabled"],ome={class:"ve-than"},sme={class:"tt-dem-nguoc"},rme={class:"tt-mo-ta"},lme=["disabled"],cme={class:"tt-mo-ta tt-gap"},ume={class:"tt-mo-ta"},hme={key:1,class:"ve-luu-y"},dme={class:"ve-khoi-cuoi"},fme={class:"ve-lien-ket"},pme=["href"],gme=["href"],mme=["href"],vme={class:"ve-footer"},yme={key:0,class:"ve-footer-phu"},bme={__name:"VeHenGio",setup(e){const t=Vl(),n=Ll(),i=t.params.don_vi,a=t.params.khach_hang,o=m1("xacNhanHenGio"),s=i8(),{item:r}=Zs(s),l=JT(),{item:c}=Zs(l),u=y1(),{item:h,items:d}=Zs(u),f=wI(),{item:p}=Zs(f),g=Fde(),{item:m}=Zs(g),v=It([]),y=It(new Date),b=setInterval(()=>{y.value=new Date},1e3),_=bo(()=>{var e;const t=Number(null==(e=c.value)?void 0:e.hengio_xacnhan_truoc_phut);return Number.isFinite(t)&&t>0?Math.floor(t):20}),w=bo(()=>{var e,t,n,i;return null!=(i=null==(n=null==(t=null==(e=m.value)?void 0:e.ngayhengio)?void 0:t.toDate)?void 0:n.call(t))?i:null}),k=bo(()=>w.value?(w.value-y.value)/6e4:null),x=bo(()=>{var e,t;return"".concat(null!=(t=null==(e=m.value)?void 0:e.thoigianhengio)?t:"").trim()}),T=e=>{const t=Math.max(0,Math.round(60*e)),n=Math.floor(t/3600),i=Math.floor(t%3600/60),a=t%60;return n>0?"".concat(n," giá» ").concat(String(i).padStart(2,"0")," phút"):i>0?"".concat(i," phút ").concat(String(a).padStart(2,"0")," giây"):"".concat(a," giây")},C=bo(()=>null===k.value?"":T(k.value-_.value)),E=bo(()=>null===k.value?"":T(k.value)),S=bo(()=>{var e;return!!(null==(e=m.value)?void 0:e.daxacnhan)}),I=bo(()=>null!==k.value&&k.value>_.value&&!S.value),A=bo(()=>null!==k.value&&k.value<=_.value&&k.value>0&&!S.value),D=bo(()=>{var e;return S.value&&!(null==(e=m.value)?void 0:e.daphucvu)}),P=bo(()=>{var e;return S.value&&!!(null==(e=m.value)?void 0:e.daphucvu)}),O=bo(()=>null!==k.value&&k.value<=0&&!S.value),M=bo(()=>{var e;return The({dsKhachHang:d.value||[],dsHenGio:v.value||[],uuTienVuotHenGio:!!(null==(e=c.value)?void 0:e.uutien_vuot_hengio),bayGio:y.value})}),N=bo(()=>"/".concat(i,"/bang-dien-tu")),R=bo(()=>A.value?"tt-den-luot":D.value?"tt-cho":P.value?"tt-xong":O.value?"tt-bo-qua":"tt-nghi"),L=It(!1),V=It(!1),q=bo(()=>!!m.value&&!V.value&&!m.value.daphucvu&&!m.value.dangphucvu&&null!==k.value&&k.value>0),F=bo(()=>q.value),B=bo(()=>q.value&&!S.value),U=()=>n.push("/".concat(i,"/doi-gio-hen/").concat(a)),j=async()=>{if(L.value)return;if((await wO("Huá»· lá»ch hẹn nà y?","Khung giá» sẽ ÄÆ°á»£c trả lại cho ngưá»i khác. Muá»n giao dá»ch lại thì phải Äặt lá»ch má»i.")).isConfirmed){L.value=!0;try{await g.huyLichHen(a,ahe()),V.value=!0,((e,t)=>{var n;const i=che(e).filter(e=>e.url!==t);lhe(ohe(e),JSON.stringify(i)),rhe(she(e))===t&&lhe(she(e),(null==(n=i[0])?void 0:n.url)||"")})(i,"/".concat(i,"/ve-hen-gio/").concat(a))}catch(eRe){VT((null==eRe?void 0:eRe.message)||"Không huá»· ÄÆ°á»£c lá»ch hẹn. Vui lòng thá» lại.")}finally{L.value=!1}}},H=It(!1),z=async()=>{if(!H.value){H.value=!0;try{await o({henGioId:a})}catch(eRe){VT("Xác nháºn không thà nh công. Vui lòng thá» lại hoặc báo cán bá» tại quầy.")}finally{H.value=!1}}},W=It(null),K=()=>{var e;return null==(e=W.value)?void 0:e.moModal()},Y=It(!1);pa(()=>R.value,()=>{Y.value=!1});const Q=bo(()=>!A.value),$=It(!1);ei(async()=>{var e,t;try{await Promise.all([l.realtimeItemById(i),g.fetchItemById(a),g.realtimeItemById(a),s.fetchData()]),c.value.logo||(c.value.logo="/images/logodanang.png");const n=m.value.ngayhengio.toDate();await Promise.all([f.fetchItemById(null==(e=m.value)?void 0:e.quay),g.realtimeItemsByDonViQuayNgay(i,m.value.quay,iQ(n),pQ(n),e=>{v.value=e}),u.realtimeKhachChuaPhucVu(i,null==(t=m.value)?void 0:t.quay)])}catch(eRe){}}),ai(()=>{clearInterval(b)}
5230);const X=e=>e?e.toDate().toLocaleString("vi-VN",{day:"2-digit",month:"2-digit",year:"numeric"}):"";return(e,t)=>{var n,i,o,s,l,u,h,d,f,g,v,y,b,w,k,T,S,q,J,Z;return Ma(),Va(Sa,null,[Ha("div",Wge,[Ha("div",Kge,[Ha("header",Gge,[Ha("img",{class:"ve-logo",src:(null==(n=Ot(c))?void 0:n.logo)||"/images/logodanang.png",alt:(null==(i=Ot(c))?void 0:i.ten)||"Logo ÄÆ¡n vá»"},null,8,Yge),Ha("div",Qge,[(null==(o=Ot(c))?void 0:o.ten)?(Ma(),Va("p",$ge,ee(Ot(c).ten),1)):Qa("",!0),t[2]||(t[2]=Ha("h1",{class:"ve-loai"},"Vé hẹn giá»",-1))])]),V.value?(Ma(),Va("div",Xge,t[3]||(t[3]=[Ha("section",{class:"ve-khoi-chinh"},[Ha("div",{class:"tt-khoi tt-bo-qua"},[Ha("p",{class:"tt-tieu-de"},"Äã huá»· lá»ch hẹn"),Ha("p",{class:"tt-mo-ta"}," Khung giá» Äã ÄÆ°á»£c trả lại cho ngưá»i khác. Muá»n giao dá»ch thì Äặt lá»ch hẹn má»i, hoặc Äến ÄÆ¡n vá» quét mã QR lấy sá» thứ tá»±. ")])],-1)]))):(Ma(),Va("div",Jge,[Ha("section",Zge,[Ha("button",{type:"button",class:"so-nut",onClick:K},[t[4]||(t[4]=Ha("span",{class:"so-nhan"},"Giá» hẹn cá»§a bạn",-1)),Ha("span",eme,ee(x.value||"â"),1),t[5]||(t[5]=Ha("span",{class:"so-goi-y"},[Ha("i",{class:"fas fa-circle-info"}),Ga(" Chạm Äá» xem thông tin cá»§a bạn")],-1))]),Ha("dl",tme,[Ha("div",nme,[t[6]||(t[6]=Ha("dt",null,"Quầy",-1)),Ha("dd",null,ee((null==(s=Ot(p))?void 0:s.ten)||"â"),1)]),Ha("div",ime,[t[7]||(t[7]=Ha("dt",null,"Ngà y hẹn",-1)),Ha("dd",null,ee(X(null==(l=Ot(m))?void 0:l.ngayhengio)||"â"),1)])]),za(_pe,{hangDoi:M.value.hangDoi,henGioSapToi:M.value.henGioSapToi,dangPhucVu:M.value.dangPhucVu,idCuaToi:Ot(a),thoiGianPhucVu:null==(u=Ot(p))?void 0:u.thoigianphucvu,tenQuay:null==(h=Ot(p))?void 0:h.ten,moTa:null==(d=Ot(p))?void 0:d.mota,soUuTien:M.value.soUuTien,soHenGio:M.value.soHenGio,choPhepUuTien:!!(null==(f=Ot(c))?void 0:f.doi_tuong_uu_tien_enabled),choPhepHenGio:!!(null==(g=Ot(c))?void 0:g.quetqrhengio)},{"thao-tac":pn(()=>[F.value?(Ma(),Va("div",{key:0,class:G(["ve-thao-tac",{"ve-thao-tac--mot":!B.value}])},[B.value?(Ma(),Va("button",{key:0,type:"button",onClick:U},t[8]||(t[8]=[Ha("i",{class:"fas fa-arrow-right-arrow-left"},null,-1),Ga(" Äá»i giá» ")]))):Qa("",!0),Ha("button",{type:"button",class:"ve-thao-tac-huy",disabled:L.value,onClick:j},[t[9]||(t[9]=Ha("i",{class:"fas fa-xmark"},null,-1)),Ga(" "+ee(L.value?"Äang huá»·...":"Huá»· lá»ch hẹn"),1)],8,ame)],2)):Qa("",!0)]),_:1},8,["hangDoi","henGioSapToi","dangPhucVu","idCuaToi","thoiGianPhucVu","tenQuay","moTa","soUuTien","soHenGio","choPhepUuTien","choPhepHenGio"])]),Ha("section",ome,[Y.value&&Q.value?Qa("",!0):(Ma(),Va("div",{key:0,class:G(["tt-khoi",R.value]),role:"status"},[Q.value?(Ma(),Va("button",{key:0,type:"button",class:"tt-tat",onClick:t[0]||(t[0]=e=>Y.value=!0),"aria-label":"Tắt thông báo"},t[10]||(t[10]=[Ha("i",{class:"fas fa-xmark"},null,-1)]))):Qa("",!0),I.value?(Ma(),Va(Sa,{key:1},[t[11]||(t[11]=Ha("p",{class:"tt-nhan-phu"},"Nút xác nháºn má» sau",-1)),Ha("p",sme,ee(C.value),1),Ha("p",rme," Bạn có "+ee(_.value)+" phút cuá»i trưá»c giá» hẹn Äá» có mặt tại quầy và bấm xác nháºn. ",1)],64)):A.value?(Ma(),Va(Sa,{key:2},[t[13]||(t[13]=Ha("p",{class:"tt-tieu-de"},"Äã Äến lúc xác nháºn",-1)),Ha("button",{onClick:z,class:"nut nut-xanh nut-rong",disabled:H.value},[t[12]||(t[12]=Ha("i",{class:"fas fa-circle-check"},null,-1)),Ga(" "+ee(H.value?"Äang xác nháºn...":"Xác nháºn có mặt"),1)],8,lme),Ha("p",cme,"Còn "+ee(E.value)+" Äá» xác nháºn",1)],64)):D.value?(Ma(),Va(Sa,{key:3},[t[14]||(t[14]=Ha("p",{class:"tt-tieu-de"},"Äã xác nháºn có mặt",-1)),Ha("p",ume,"Vui lòng chá» gá»i tên tại quầy "+ee(null==(v=Ot(p))?void 0:v.ten)+".",1)],64)):P.value?(Ma(),Va(Sa,{key:4},[t[15]||(t[15]=Ha("p",{class:"tt-tieu-de"},"Cảm Æ¡n và hẹn gặp lại",-1)),t[16]||(t[16]=Ha("p",{class:"tt-mo-ta"},"Rất mong nháºn ÄÆ°á»£c góp ý cá»§a bạn á» liên kết bên dưá»i.",-1))],64)):O.value?(Ma(),Va(Sa,{key:5},[t[17]||(t[17]=Ha("p",{class:"tt-tieu-de"},"Lá»ch hẹn không còn hiá»u lá»±c",-1)),t[18]||(t[18]=Ha("p",{class:"tt-mo-ta"}," Äã quá giá» hẹn mà bạn chưa xác nháºn có mặt. Vui lòng Äến ÄÆ¡n vá» và quét mã QR lấy sá» Äá» ÄÆ°á»£c phục vụ trong hôm nay. ",-1))],64)):Qa("",!0)],2)),$.value||P.value||O.value?Qa("",!0):(Ma(),Va("div",hme,[Ha("button",{type:"button",class:"tt-tat",onClick:t[1]||(t[1]=e=>$.value=!0),"aria-label":"Tắt lưu ý"},t[19]||(t[19]=[Ha("i",{class:"fas fa-xmark"},null,-1)])),t[23]||(t[23]=Ha("p",{class:"ve-luu-y-tieu-de"}
5230,"Lưu ý quan trá»ng",-1)),Ha("ul",null,[Ha("li",null,[t[20]||(t[20]=Ga("Nút xác nháºn má» trưá»c giá» hẹn ")),Ha("strong",null,ee(_.value)+" phút",1)]),t[21]||(t[21]=Ha("li",null,[Ga("Có mặt tại quầy, má» vé nà y và bấm "),Ha("strong",null,"Xác nháºn có mặt")],-1)),t[22]||(t[22]=Ha("li",null,[Ha("strong",null,"Quá giá» hẹn mà chưa xác nháºn là mất lượt"),Ga(", không xác nháºn bù ÄÆ°á»£c")],-1))])])),Ha("div",dme,[Ha("div",fme,[Ha("a",{href:N.value},t[24]||(t[24]=[Ha("i",{class:"fas fa-tv"},null,-1),Ha("span",null,"Bảng Äiá»n tá» theo dõi lượt chá»",-1),Ha("i",{class:"fas fa-chevron-right ve-mui-ten"},null,-1)]),8,pme),Ha("a",{href:(null==(y=Ot(c))?void 0:y.thutuc)||"#"},t[25]||(t[25]=[Ha("i",{class:"fas fa-file-lines"},null,-1),Ha("span",null,"Tra cứu thá»§ tục hà nh chÃnh",-1),Ha("i",{class:"fas fa-chevron-right ve-mui-ten"},null,-1)]),8,gme),Ha("a",{href:(null==(b=Ot(c))?void 0:b.danhgia)||"#"},t[26]||(t[26]=[Ha("i",{class:"fas fa-star"},null,-1),Ha("span",null,"Äánh giá / góp ý",-1),Ha("i",{class:"fas fa-chevron-right ve-mui-ten"},null,-1)]),8,mme)]),za(Hpe,{tenVe:"vé hẹn giá»"})])])])),Ha("footer",vme,[t[27]||(t[27]=Ha("p",{class:"ve-footer-don-vi"},"Há» thá»ng xếp hà ng tá»± Äá»ng QRCode",-1)),(null==(w=Ot(r))?void 0:w.thietke)?(Ma(),Va("p",yme,ee(Ot(r).thietke),1)):Qa("",!0)])]),za(Ppe,{ref_key:"modalThongTinRef",ref:W,hoTen:(null==(k=Ot(m))?void 0:k.hoten)||"",soDienThoai:(null==(T=Ot(m))?void 0:T.sodienthoai)||"",email:(null==(S=Ot(m))?void 0:S.email)||"",tenQuay:(null==(q=Ot(p))?void 0:q.ten)||"",nhanThoiGian:"Ngà y hẹn",giaTriThoiGian:X(null==(J=Ot(m))?void 0:J.ngayhengio)},null,8,["hoTen","soDienThoai","email","tenQuay","giaTriThoiGian"])]),(null==(Z=Ot(c))?void 0:Z.hienthichatdanangai)?(Ma(),qa(wge,{key:0})):Qa("",!0)],64)}}},_me=CC(bme,[["__scopeId","data-v-319cad76"]]),wme="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",kme="google.c.a.c_id";var xme,Tme,Cme; 5231/** 5232 * @license 5233 * Copyright 2017 Google LLC 5234 * 5235 * Licensed under the Apache License, Version 2.0 (the "License"); 5236 * you may not use this file except in compliance with the License. 5237 * You may obtain a copy of the License at 5238 * 5239 * http://www.apache.org/licenses/LICENSE-2.0 5240 * 5241 * Unless required by applicable law or agreed to in writing, software 5242 * distributed under the License is distributed on an "AS IS" BASIS, 5243 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5244 * See the License for the specific language governing permissions and 5245 * limitations under the License. 5246 */ 5247function Eme(e){const t=new Uint8Array(e);return btoa(String.fromCharCode(...t)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Sme(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=atob(t),i=new Uint8Array(n.length);for(let a=0;a<n.length;++a)i[a]=n.charCodeAt(a);return i} 5248/** 5249 * @license 5250 * Copyright 2019 Google LLC 5251 * 5252 * Licensed under the Apache License, Version 2.0 (the "License"); 5253 * you may not use this file except in compliance with the License. 5254 * You may obtain a copy of the License at 5255 * 5256 * http://www.apache.org/licenses/LICENSE-2.0 5257 * 5258 * Unless required by applicable law or agreed to in writing, software 5259 * distributed under the License is distributed on an "AS IS" BASIS, 5260 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5261 * See the License for the specific language governing permissions and 5262 * limitations under the License. 5263 */(Tme=xme||(xme={}))[Tme.DATA_MESSAGE=1]="DATA_MESSAGE",Tme[Tme.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION",function(e){e.PUSH_RECEIVED="push-received",e.NOTIFICATION_CLICKED="notification-clicked"}(Cme||(Cme={}));const Ime="fcm_token_details_db",Ame="fcm_token_object_Store"; 5264/** 5265 * @license 5266 * Copyright 2019 Google LLC 5267 * 5268 * Licensed under the Apache License, Version 2.0 (the "License"); 5269 * you may not use this file except in compliance with the License. 5270 * You may obtain a copy of the License at 5271 * 5272 * http://www.apache.org/licenses/LICENSE-2.0 5273 * 5274 * Unless required by applicable law or agreed to in writing, softw
5274are 5275 * distributed under the License is distributed on an "AS IS" BASIS, 5276 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5277 * See the License for the specific language governing permissions and 5278 * limitations under the License. 5279 */ 5280const Dme="firebase-messaging-store";let Pme=null;function Ome(){return Pme||(Pme=ou("firebase-messaging-database",1,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(Dme)}})),Pme}async function Mme(e){const t=Rme(e),n=await Ome(),i=await n.transaction(Dme).objectStore(Dme).get(t);if(i)return i;{const t=await async function(e){if("databases"in indexedDB&&!(await indexedDB.databases()).map(e=>e.name).includes(Ime))return null;let t=null;return(await ou(Ime,5,{upgrade:async(n,i,a,o)=>{var s;if(i<2)return;if(!n.objectStoreNames.contains(Ame))return;const r=o.objectStore(Ame),l=await r.index("fcmSenderId").get(e);if(await r.clear(),l)if(2===i){const e=l;if(!e.auth||!e.p256dh||!e.endpoint)return;t={token:e.fcmToken,createTime:null!==(s=e.createTime)&&void 0!==s?s:Date.now(),subscriptionOptions:{auth:e.auth,p256dh:e.p256dh,endpoint:e.endpoint,swScope:e.swScope,vapidKey:"string"==typeof e.vapidKey?e.vapidKey:Eme(e.vapidKey)}}}else if(3===i){const e=l;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:Eme(e.auth),p256dh:Eme(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:Eme(e.vapidKey)}}}else if(4===i){const e=l;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:Eme(e.auth),p256dh:Eme(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:Eme(e.vapidKey)}}}}})).close(),await su(Ime),await su("fcm_vapid_details_db"),await su("undefined"),function(e){if(!e||!e.subscriptionOptions)return!1;const{subscriptionOptions:t}=e;return"number"==typeof e.createTime&&e.createTime>0&&"string"==typeof e.token&&e.token.length>0&&"string"==typeof t.auth&&t.auth.length>0&&"string"==typeof t.p256dh&&t.p256dh.length>0&&"string"==typeof t.endpoint&&t.endpoint.length>0&&"string"==typeof t.swScope&&t.swScope.length>0&&"string"==typeof t.vapidKey&&t.vapidKey.length>0}(t)?t:null}(e.appConfig.senderId);if(t)return await Nme(e,t),t}}async function Nme(e,t){const n=Rme(e),i=(await Ome()).transaction(Dme,"readwrite");return await i.objectStore(Dme).put(t,n),await i.done,t}function Rme({appConfig:e}){return e.appId} 5281/** 5282 * @license 5283 * Copyright 2017 Google LLC 5284 * 5285 * Licensed under the Apache License, Version 2.0 (the "License"); 5286 * you may not use this file except in compliance with the License. 5287 * You may obtain a copy of the License at 5288 * 5289 * http://www.apache.org/licenses/LICENSE-2.0 5290 * 5291 * Unless required by applicable law or agreed to in writing, software 5292 * distributed under the License is distributed on an "AS IS" BASIS, 5293 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5294 * See the License for the specific language governing permissions and 5295 * limitations under the License. 5296 */const Lme=new mc("messaging","Messaging",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. {$browserErrorMessage}","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: {$errorInfo}","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: {$errorInfo}","token-update-failed":"A problem occurred while updating the user from FCM: {$errorInfo}","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invali
5296d-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."});function Vme({projectId:e}){return"".concat("https://fcmregistrations.googleapis.com/v1","/projects/").concat(e,"/registrations")}async function qme({appConfig:e,installations:t}){const n=await t.getToken();return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":"FIS ".concat(n)})}function Fme({p256dh:e,auth:t,endpoint:n,vapidKey:i}){const a={web:{endpoint:n,auth:t,p256dh:e}};return i!==wme&&(a.web.applicationPubKey=i),a} 5297/** 5298 * @license 5299 * Copyright 2019 Google LLC 5300 * 5301 * Licensed under the Apache License, Version 2.0 (the "License"); 5302 * you may not use this file except in compliance with the License. 5303 * You may obtain a copy of the License at 5304 * 5305 * http://www.apache.org/licenses/LICENSE-2.0 5306 * 5307 * Unless required by applicable law or agreed to in writing, software 5308 * distributed under the License is distributed on an "AS IS" BASIS, 5309 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5310 * See the License for the specific language governing permissions and 5311 * limitations under the License. 5312 */async function Bme(e){const t=await async function(e,t){const n=await e.pushManager.getSubscription();if(n)return n;return e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Sme(t)})}(e.swRegistration,e.vapidKey),n={vapidKey:e.vapidKey,swScope:e.swRegistration.scope,endpoint:t.endpoint,auth:Eme(t.getKey("auth")),p256dh:Eme(t.getKey("p256dh"))},i=await Mme(e.firebaseDependencies);if(i){if(function(e,t){const n=t.vapidKey===e.vapidKey,i=t.endpoint===e.endpoint,a=t.auth===e.auth,o=t.p256dh===e.p256dh;return n&&i&&a&&o} 5313/** 5314 * @license 5315 * Copyright 2020 Google LLC 5316 * 5317 * Licensed under the Apache License, Version 2.0 (the "License"); 5318 * you may not use this file except in compliance with the License. 5319 * You may obtain a copy of the License at 5320 * 5321 * http://www.apache.org/licenses/LICENSE-2.0 5322 * 5323 * Unless required by applicable law or agreed to in writing, software 5324 * distributed under the License is distributed on an "AS IS" BASIS, 5325 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5326 * See the License for the specific language governing permissions and 5327 * limitations under the License. 5328 */(i.subscriptionOptions,n))return Date.now()>=i.createTime+6048e5?async function(e,t){try{const n=await async function(e,t){const n=await qme(e),i=Fme(t.subscriptionOptions),a={method:"PATCH",headers:n,body:JSON.stringify(i)};let o;try{const n=await fetch("".concat(Vme(e.appConfig),"/").concat(t.token),a);o=await n.json()}catch(s){throw Lme.create("token-update-failed",{errorInfo:null==s?void 0:s.toString()})}if(o.error){const e=o.error.message;throw Lme.create("token-update-failed",{errorInfo:e})}if(!o.token)throw Lme.create("token-update-no-token");return o.token}(e.firebaseDependencies,t),i=Object.assign(Object.assign({},t),{token:n,createTime:Date.now()});return await Nme(e.firebaseDependencies,i),n}catch(ZNe){throw ZNe}}(e,{token:i.token,createTime:Date.now(),subscriptionOptions:n}):i.token;try{await async function(e,t){const n={method:"DELETE",headers:await qme(e)};try{const i=await fetch("".concat(Vme(e.appConfig),"/").concat(t),n),a=await i.json();if(a.error){const e=a.error.message;throw Lme.create("token-unsubscribe-failed",{errorInfo:e})}}catch(i){throw Lme.create("token-unsubscribe-failed",{errorInfo:null==i?void 0:i.toString()})}}(e.firebaseDependencies,i.token)}catch(ZNe){}return Ume(e.firebaseDependencies,n)}return Ume(e.firebaseDependencies,n)}async function Ume(e,t){const n= 5329/** 5330 * @license 5331 * Copyright 2019 Google LLC 5332 * 5333 * Licensed under the Apache License, Version 2.0 (the "License");
5334 * you may not use this file except in compliance with the License. 5335 * You may obtain a copy of the License at 5336 * 5337 * http://www.apache.org/licenses/LICENSE-2.0 5338 * 5339 * Unless required by applicable law or agreed to in writing, software 5340 * distributed under the License is distributed on an "AS IS" BASIS, 5341 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5342 * See the License for the specific language governing permissions and 5343 * limitations under the License. 5344 */await async function(e,t){const n=await qme(e),i=Fme(t),a={method:"POST",headers:n,body:JSON.stringify(i)};let o;try{const t=await fetch(Vme(e.appConfig),a);o=await t.json()}catch(s){throw Lme.create("token-subscribe-failed",{errorInfo:null==s?void 0:s.toString()})}if(o.error){const e=o.error.message;throw Lme.create("token-subscribe-failed",{errorInfo:e})}if(!o.token)throw Lme.create("token-subscribe-no-token");return o.token}(e,t),i={token:n,createTime:Date.now(),subscriptionOptions:t};return await Nme(e,i),i.token}function jme(e){const t={from:e.from,collapseKey:e.collapse_key,messageId:e.fcmMessageId};return function(e,t){if(!t.notification)return;e.notification={};const n=t.notification.title;n&&(e.notification.title=n);const i=t.notification.body;i&&(e.notification.body=i);const a=t.notification.image;a&&(e.notification.image=a);const o=t.notification.icon;o&&(e.notification.icon=o)}(t,e),function(e,t){if(!t.data)return;e.data=t.data}(t,e),function(e,t){var n,i,a,o,s;if(!t.fcmOptions&&!(null===(n=t.notification)||void 0===n?void 0:n.click_action))return;e.fcmOptions={};const r=null!==(a=null===(i=t.fcmOptions)||void 0===i?void 0:i.link)&&void 0!==a?a:null===(o=t.notification)||void 0===o?void 0:o.click_action;r&&(e.fcmOptions.link=r);const l=null===(s=t.fcmOptions)||void 0===s?void 0:s.analytics_label;l&&(e.fcmOptions.analyticsLabel=l)} 5345/** 5346 * @license 5347 * Copyright 2019 Google LLC 5348 * 5349 * Licensed under the Apache License, Version 2.0 (the "License"); 5350 * you may not use this file except in compliance with the License. 5351 * You may obtain a copy of the License at 5352 * 5353 * http://www.apache.org/licenses/LICENSE-2.0 5354 * 5355 * Unless required by applicable law or agreed to in writing, software 5356 * distributed under the License is distributed on an "AS IS" BASIS, 5357 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5358 * See the License for the specific language governing permissions and 5359 * limitations under the License. 5360 */(t,e),t}function Hme(e){return Lme.create("missing-app-config-values",{valueName:e})} 5361/** 5362 * @license 5363 * Copyright 2020 Google LLC 5364 * 5365 * Licensed under the Apache License, Version 2.0 (the "License"); 5366 * you may not use this file except in compliance with the License. 5367 * You may obtain a copy of the License at 5368 * 5369 * http://www.apache.org/licenses/LICENSE-2.0 5370 * 5371 * Unless required by applicable law or agreed to in writing, software 5372 * distributed under the License is distributed on an "AS IS" BASIS, 5373 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5374 * See the License for the specific language governing permissions and 5375 * limitations under the License. 5376 */class zme{constructor(e,t,n){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1;const i= 5377/** 5378 * @license 5379 * Copyright 2019 Google LLC 5380 * 5381 * Licensed under the Apache License, Version 2.0 (the "License"); 5382 * you may not use this file except in compliance with the License. 5383 * You may obtain a copy of the License at 5384 * 5385 * http://www.apache.org/licenses/LICENSE-2.0 5386 * 5387 * Unless required by applicable law or agreed to in writing, software 5388 * distributed under the License is distributed on an "AS IS" BASIS, 5389 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5390 * See the License for the specific language governing permissions and 5391 * limitations under the License. 5392 */ 5393function(e){if(!e||!e.options)throw Hme("App Configuration Object");if(!e.name)throw Hme("App Name");const t=["projectId","apiKey","appId","messagingSenderId"],{options:n}=e;for(const i of t)if(!n[i])throw Hme(i);
5393return{appName:e.name,projectId:n.projectId,apiKey:n.apiKey,appId:n.appId,senderId:n.messagingSenderId}}(e);this.firebaseDependencies={app:e,appConfig:i,installations:t,analyticsProvider:n}}_delete(){return Promise.resolve()}} 5394/** 5395 * @license 5396 * Copyright 2020 Google LLC 5397 * 5398 * Licensed under the Apache License, Version 2.0 (the "License"); 5399 * you may not use this file except in compliance with the License. 5400 * You may obtain a copy of the License at 5401 * 5402 * http://www.apache.org/licenses/LICENSE-2.0 5403 * 5404 * Unless required by applicable law or agreed to in writing, software 5405 * distributed under the License is distributed on an "AS IS" BASIS, 5406 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5407 * See the License for the specific language governing permissions and 5408 * limitations under the License. 5409 */ 5410/** 5411 * @license 5412 * Copyright 2020 Google LLC 5413 * 5414 * Licensed under the Apache License, Version 2.0 (the "License"); 5415 * you may not use this file except in compliance with the License. 5416 * You may obtain a copy of the License at 5417 * 5418 * http://www.apache.org/licenses/LICENSE-2.0 5419 * 5420 * Unless required by applicable law or agreed to in writing, software 5421 * distributed under the License is distributed on an "AS IS" BASIS, 5422 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5423 * See the License for the specific language governing permissions and 5424 * limitations under the License. 5425 */ 5426async function Wme(e,t){if(t||e.swRegistration||await async function(e){try{e.swRegistration=await navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:"/firebase-cloud-messaging-push-scope"}),e.swRegistration.update().catch(()=>{})}catch(ZNe){throw Lme.create("failed-service-worker-registration",{browserErrorMessage:null==ZNe?void 0:ZNe.message})}}(e),t||!e.swRegistration){if(!(t instanceof ServiceWorkerRegistration))throw Lme.create("invalid-sw-registration");e.swRegistration=t}} 5427/** 5428 * @license 5429 * Copyright 2020 Google LLC 5430 * 5431 * Licensed under the Apache License, Version 2.0 (the "License"); 5432 * you may not use this file except in compliance with the License. 5433 * You may obtain a copy of the License at 5434 * 5435 * http://www.apache.org/licenses/LICENSE-2.0 5436 * 5437 * Unless required by applicable law or agreed to in writing, software 5438 * distributed under the License is distributed on an "AS IS" BASIS, 5439 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5440 * See the License for the specific language governing permissions and 5441 * limitations under the License. 5442 */ 5443/** 5444 * @license 5445 * Copyright 2020 Google LLC 5446 * 5447 * Licensed under the Apache License, Version 2.0 (the "License"); 5448 * you may not use this file except in compliance with the License. 5449 * You may obtain a copy of the License at 5450 * 5451 * http://www.apache.org/licenses/LICENSE-2.0 5452 * 5453 * Unless required by applicable law or agreed to in writing, software 5454 * distributed under the License is distributed on an "AS IS" BASIS, 5455 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5456 * See the License for the specific language governing permissions and 5457 * limitations under the License. 5458 */ 5459async function Kme(e,t){if(!navigator)throw Lme.create("only-available-in-window");if("default"===Notification.permission&&await Notification.requestPermission(),"granted"!==Notification.permission)throw Lme.create("permission-blocked");return await async function(e,t){t?e.vapidKey=t:e.vapidKey||(e.vapidKey=wme)}(e,null==t?void 0:t.vapidKey),await Wme(e,null==t?void 0:t.serviceWorkerRegistration),Bme(e)} 5460/** 5461 * @license 5462 * Copyright 2019 Google LLC 5463 * 5464 * Licensed under the Apache License, Version 2.0 (the "License"); 5465 * you may not use this file except in compliance with the License. 5466 * You may obtain a copy of the License at 5467 * 5468 * http://www.apache.org/licenses/LICENSE-2.0 5469 * 5470 * Unless required by applicable law or agreed to in writing, software 5471 * distributed under the License is distributed on an "AS IS" BASIS, 5472 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5473 * See the License for the specific language governing permissions and 5474 * limitations under the License. 5475 */async function Gme(e,t,n){const i=function(e){switch(e){case Cme.NOTIFICATION_CLICKED:return"notification_open";case Cme.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}} 5476/** 5477 * @license 5478 * Copyright 2017 Google LLC 5479 * 5480 * Licensed under the Apache License, Version 2.0 (the "License");
5481 * you may not use this file except in compliance with the License. 5482 * You may obtain a copy of the License at 5483 * 5484 * http://www.apache.org/licenses/LICENSE-2.0 5485 * 5486 * Unless required by applicable law or agreed to in writing, software 5487 * distributed under the License is distributed on an "AS IS" BASIS, 5488 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5489 * See the License for the specific language governing permissions and 5490 * limitations under the License. 5491 */(t);(await e.firebaseDependencies.analyticsProvider.get()).logEvent(i,{message_id:n[kme],message_name:n["google.c.a.c_l"],message_time:n["google.c.a.ts"],message_device_time:Math.floor(Date.now()/1e3)})}async function Yme(e,t){const n=t.data;if(!n.isFirebaseMessaging)return;e.onMessageHandler&&n.messageType===Cme.PUSH_RECEIVED&&("function"==typeof e.onMessageHandler?e.onMessageHandler(jme(n)):e.onMessageHandler.next(jme(n)));const i=n.data;var a;"object"==typeof(a=i)&&a&&kme in a&&"1"===i["google.c.a.e"]&&await Gme(e,n.messageType,i)}const Qme="@firebase/messaging",$me="0.12.12",Xme=e=>{const t=e.getProvider("messaging").getImmediate();return{getToken:e=>Kme(t,e)}}; 5492/** 5493 * @license 5494 * Copyright 2017 Google LLC 5495 * 5496 * Licensed under the Apache License, Version 2.0 (the "License"); 5497 * you may not use this file except in compliance with the License. 5498 * You may obtain a copy of the License at 5499 * 5500 * http://www.apache.org/licenses/LICENSE-2.0 5501 * 5502 * Unless required by applicable law or agreed to in writing, software 5503 * distributed under the License is distributed on an "AS IS" BASIS, 5504 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5505 * See the License for the specific language governing permissions and 5506 * limitations under the License. 5507 */ 5508function Jme(e=eh()){ 5509/** 5510 * @license 5511 * Copyright 2020 Google LLC 5512 * 5513 * Licensed under the Apache License, Version 2.0 (the "License"); 5514 * you may not use this file except in compliance with the License. 5515 * You may obtain a copy of the License at 5516 * 5517 * http://www.apache.org/licenses/LICENSE-2.0 5518 * 5519 * Unless required by applicable law or agreed to in writing, software 5520 * distributed under the License is distributed on an "AS IS" BASIS, 5521 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5522 * See the License for the specific language governing permissions and 5523 * limitations under the License. 5524 */ 5525return async function(){try{await fc()}catch(ZNe){return!1}return"undefined"!=typeof window&&dc()&&pc()&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")} 5526/** 5527 * @license 5528 * Copyright 2020 Google LLC 5529 * 5530 * Licensed under the Apache License, Version 2.0 (the "License"); 5531 * you may not use this file except in compliance with the License. 5532 * You may obtain a copy of the License at 5533 * 5534 * http://www.apache.org/licenses/LICENSE-2.0 5535 * 5536 * Unless required by applicable law or agreed to in writing, software 5537 * distributed under the License is distributed on an "AS IS" BASIS, 5538 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 5539 * See the License for the specific language governing permissions and 5540 * limitations under the License. 5541 */().then(e=>{if(!e)throw Lme.create("unsupported-browser")},e=>{throw Lme.create("indexed-db-unsupported")}),Yu(Rc(e),"messaging").getImmediate()}function Zme(e,t){return function(e,t){if(!navigator)throw Lme.create("only-available-in-window");return e.onMessageHandler=t,()=>{e.onMessageHandler=null}}(e=Rc(e),t)}Gu(new Lc("messaging",e=>{const t=new zme(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),e.getProvider("analytics-internal"));return navigator.serviceWorker.addEventListener("message",e=>Yme(t,e)),t},"PUBLIC")),Gu(new Lc("messaging-internal",Xme,"PRIVATE")),th(Qme,$me),th(Qme,$me,"esm2017");const eve=Js("thongbaoStore",{state:()=>({items:[],item:null,unsubscribe:null}),actions:{fetchItemById:async e=>await yT("thong_bao",e),async fetchItemByNhanThongBao(e,t,n){const i=await vT("thong_bao",[["token","==",e],["donvi","==",t],["quay","==",n]],null,1);this.item=i[0]},async realtimeItemById(e){await xT("thong_bao",e,e=>{this.item=e})},async addItem(e){await _T("thong_bao",e)},async deleteItem(e){await kT("thong_bao",e)},async deleteAllByToken(e,t,n){const i=await vT("thong_bao",[["token","==",e],["donvi","==",t],["quay","==",n]]);return await Promise.all(i.map(e=>kT("thong_bao",e.id))),this.item=null,i.length},startRealtimeListeningForToken(e,t,n){this.unsubscribe&&this.unsubscribe();const i=[["token","==",e],["donvi","==",t],["quay","==",n]];this.unsubscribe=TT("thong_bao",i,null,null,e=>{this.item=e.length>0?e[0]:null})},stopRealtimeListening(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)}}}); 5542/*! 5543 * chartjs-plugin-datalabels v2.2.0 5544 * https://chartjs-plugin-datalabels.netlify.app 5545 * (c) 2017-2022 chartjs-plugin-datalabels contributors 5546 * Released under the MIT license 5547 */var tve=function(){if("undefined"!=typeof window){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),nve=function(e){var t,n=[];for(e=[].concat(e);e.length;)"string"==typeof(t=e.pop())?n.unshift.apply(n,t.split("\n")):Array.isArray(t)?e.push.apply(e,t):dne(e)||n.unshift(""+t);return n},ive=function(e,t,n){var i,a=[].concat(t),o=a.length,s=e.font,r=0;for(e.font=n.string,i=0;i<o;++i)r=Math.max(e.measureText(a[i]).width,r);return e.font=s,{height:o*n.lineHeight,width:r}},ave=function(e,t,n){return Math.max(e,Math.min(t,n))},ove=function(e,t){var n,i,a,o,s=e.slice(),r=[];for(n=0,a=t.length;n<a;++n)o=t[n],-1===(i=s.indexOf(o))?r.push([o,1]):s.splice(i,1);for(n=0,a=s.length;n<a;++n)r.push([s[n],-1]);return r};function sve(e,t){var n=t.x,i=t.y;if(null===n)return{x:0,y:-1};if(null===i)return{x:1,y:0};var a=e.x-n,o=e.y-i,s=Math.sqrt(a*a+o*o);return{x:s?a/s:0,y:s?o/s:-1}}function rve(e,t,n){var i=0;return e<n.left?i|=1:e>n.right&&(i|=2),t<n.top?i|=8:t>n.bottom&&(i|=4),i}function lve(e,t){var n,i,a=t.anchor,o=e;return t.clamp&&(o=function(e,t){for(var n,i,a,o=e.x0,s=e.y0,r=e.x1,l=e.y1,c=rve(o,s,t),u=rve(r,l,t);c|u&&!(c&u);
5547)8&(n=c||u)?(i=o+(r-o)*(t.top-s)/(l-s),a=t.top):4&n?(i=o+(r-o)*(t.bottom-s)/(l-s),a=t.bottom):2&n?(a=s+(l-s)*(t.right-o)/(r-o),i=t.right):1&n&&(a=s+(l-s)*(t.left-o)/(r-o),i=t.left),n===c?c=rve(o=i,s=a,t):u=rve(r=i,l=a,t);return{x0:o,x1:r,y0:s,y1:l}}(o,t.area)),"start"===a?(n=o.x0,i=o.y0):"end"===a?(n=o.x1,i=o.y1):(n=(o.x0+o.x1)/2,i=(o.y0+o.y1)/2),function(e,t,n,i,a){switch(a){case"center":n=i=0;break;case"bottom":n=0,i=1;break;case"right":n=1,i=0;break;case"left":n=-1,i=0;break;case"top":n=0,i=-1;break;case"start":n=-n,i=-i;break;case"end":break;default:a*=Math.PI/180,n=Math.cos(a),i=Math.sin(a)}return{x:e,y:t,vx:n,vy:i}}(n,i,e.vx,e.vy,t.align)}var cve=function(e,t){var n=(e.startAngle+e.endAngle)/2,i=Math.cos(n),a=Math.sin(n),o=e.innerRadius,s=e.outerRadius;return lve({x0:e.x+i*o,y0:e.y+a*o,x1:e.x+i*s,y1:e.y+a*s,vx:i,vy:a},t)},uve=function(e,t){var n=sve(e,t.origin),i=n.x*e.options.radius,a=n.y*e.options.radius;return lve({x0:e.x-i,y0:e.y-a,x1:e.x+i,y1:e.y+a,vx:n.x,vy:n.y},t)},hve=function(e,t){var n=sve(e,t.origin),i=e.x,a=e.y,o=0,s=0;return e.horizontal?(i=Math.min(e.x,e.base),o=Math.abs(e.base-e.x)):(a=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),lve({x0:i,y0:a+s,x1:i+o,y1:a,vx:n.x,vy:n.y},t)},dve=function(e,t){var n=sve(e,t.origin);return lve({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)},fve=function(e){return Math.round(e*tve)/tve};function pve(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(void 0!==n.xCenter&&void 0!==n.yCenter)return{x:n.xCenter,y:n.yCenter};var i=n.getBasePixel();return e.horizontal?{x:i,y:null}:{x:null,y:i}}function gve(e,t,n){var i=n.backgroundColor,a=n.borderColor,o=n.borderWidth;(i||a&&o)&&(e.beginPath(),function(e,t,n,i,a,o){var s=Math.PI/2;if(o){var r=Math.min(o,a/2,i/2),l=t+r,c=n+r,u=t+i-r,h=n+a-r;e.moveTo(t,c),l<u&&c<h?(e.arc(l,c,r,-Math.PI,-s),e.arc(u,c,r,-s,0),e.arc(u,h,r,0,s),e.arc(l,h,r,s,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,r,-s,s),e.arc(l,c,r,s,Math.PI+s)):c<h?(e.arc(l,c,r,-Math.PI,0),e.arc(l,h,r,0,Math.PI)):e.arc(l,c,r,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,i,a)}(e,fve(t.x)+o/2,fve(t.y)+o/2,fve(t.w)-o,fve(t.h)-o,n.borderRadius),e.closePath(),i&&(e.fillStyle=i,e.fill()),a&&o&&(e.strokeStyle=a,e.lineWidth=o,e.lineJoin="miter",e.stroke()))}function mve(e,t,n){var i=e.shadowBlur,a=n.stroked,o=fve(n.x),s=fve(n.y),r=fve(n.w);a&&e.strokeText(t,o,s,r),n.filled&&(i&&a&&(e.shadowBlur=0),e.fillText(t,o,s,r),i&&a&&(e.shadowBlur=i))}var vve=function(e,t,n,i){var a=this;a._config=e,a._index=i,a._model=null,a._rects=null,a._ctx=t,a._el=n};Cne(vve.prototype,{_modelize:function(e,t,n,i){var a,o=this,s=o._index,r=aae(oae([n.font,{}],i,s)),l=oae([n.color,Nie.color],i,s);return{align:oae([n.align,"center"],i,s),anchor:oae([n.anchor,"center"],i,s),area:i.chart.chartArea,backgroundColor:oae([n.backgroundColor,null],i,s),borderColor:oae([n.borderColor,null],i,s),borderRadius:oae([n.borderRadius,0],i,s),borderWidth:oae([n.borderWidth,0],i,s),clamp:oae([n.clamp,!1],i,s),clip:oae([n.clip,!1],i,s),color:l,display:e,font:r,lines:t,offset:oae([n.offset,4],i,s),opacity:oae([n.opacity,1],i,s),origin:pve(o._el,i),padding:iae(oae([n.padding,4],i,s)),positioner:(a=o._el,a instanceof pre?cve:a instanceof Cre?uve:a instanceof Ore?hve:dve),rotation:oae([n.rotation,0],i,s)*(Math.PI/180),size:ive(o._ctx,t,r),textAlign:oae([n.textAlign,"start"],i,s),textShadowBlur:oae([n.textShadowBlur,0],i,s),textShadowColor:oae([n.textShadowColor,l],i,s),textStrokeColor:oae([n.textStrokeColor,l],i,s),textStrokeWidth:oae([n.textStrokeWidth,0],i,s)}},update:function(e){var t,n,i,a=this,o=null,s=null,r=a._index,l=a._config,c=oae([l.display,!0],e,r);c&&(t=e.dataset.data[r],(i=dne(n=vne(bne(l.formatter,[t,e]),t))?[]:nve(n)).length&&(s=function(e){var t=e.borderWidth||0,n=e.padding,i=e.size.height,a=e.size.width,o=-a/2,s=-i/2;return{frame:{x:o-n.left-t,y:s-n.top-t,w:a+n.width+2*t,h:i+n.height+2*t},text:{x:o,y:s,w:a,h:i}}}(o=a._modelize(c,i,l,e)))),a._model=o,a._rects=s},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n,i=e.ctx,a=this._model,o=this._rects;this.visible()&&(i.save(),a.clip&&(n=a.area,i.beginPath(),i.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),i.clip()),i.globalAlpha=ave(0,a.opacity,1),i.translate(fve(t.x),fve(t.y)),i.rotate(a.rotation),gve(i,o.frame,a),function(e,t,n,i){var a,o=i.textAlign,s=i.color,r=!!s,l=i.font,c=t.length,u=i.textStrokeColor,h=i.textStrokeWidth,d=u&&h;if(c&&(r||d))for(n=function(e,t,n){var i=n.lineHeight,a=e.w,o=e.x;return"center"===t?o+=a/2:"end"!==t&&"right"!==t||(o+=a),{h:i,w:a,x:o,y:e.y+i/2}}(n,o,l),e.font=l.string,e.textAlign=o,e.textBaseline="middle",e.shadowBlur=i.textShadowBlur,e.shadowColor=i.textShadowColor,r&&(e.fillStyle=s),d&&(e.lineJoin="round",e.lineWidth=h,e.strokeStyle=u),a=0,c=t.length;a<c;++a)mve(e,t[a],{stroked:d,filled:r,w:n.w,x:n.x,y:n.y+n.h*a})}
vendor: 1,948 bytes, line 5547
5547(i,a.lines,o.text,a),i.restore())}});var yve=Number.MIN_SAFE_INTEGER||-9007199254740991,bve=Number.MAX_SAFE_INTEGER||9007199254740991;function _ve(e,t,n){var i=Math.cos(n),a=Math.sin(n),o=t.x,s=t.y;return{x:o+i*(e.x-o)-a*(e.y-s),y:s+a*(e.x-o)+i*(e.y-s)}}function wve(e,t){var n,i,a,o,s,r=bve,l=yve,c=t.origin;for(n=0;n<e.length;++n)a=(i=e[n]).x-c.x,o=i.y-c.y,s=t.vx*a+t.vy*o,r=Math.min(r,s),l=Math.max(l,s);return{min:r,max:l}}function kve(e,t){var n=t.x-e.x,i=t.y-e.y,a=Math.sqrt(n*n+i*i);return{vx:(t.x-e.x)/a,vy:(t.y-e.y)/a,origin:e,ln:a}}var xve=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};function Tve(e,t,n){var i=t.positioner(e,t),a=i.vx,o=i.vy;if(!a&&!o)return{x:i.x,y:i.y};var s=n.w,r=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(r/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(r/2*Math.cos(l)),h=1/Math.max(Math.abs(a),Math.abs(o));return c*=a*h,u*=o*h,c+=t.offset*a,u+=t.offset*o,{x:i.x+c,y:i.y+u}}Cne(xve.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=t._rect;return!((e=_ve(e,t.center(),-t._rotation)).x<n.x-1||e.y<n.y-1||e.x>n.x+n.w+2||e.y>n.y+n.h+2)},intersects:function(e){var t,n,i,a=this._points(),o=e._points(),s=[kve(a[0],a[1]),kve(a[0],a[3])];for(this._rotation!==e._rotation&&s.push(kve(o[0],o[1]),kve(o[0],o[3])),t=0;t<s.length;++t)if(n=wve(a,s[t]),i=wve(o,s[t]),n.max<i.min||i.max<n.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,i=e.center();return[_ve({x:t.x,y:t.y},i,n),_ve({x:t.x+t.w,y:t.y},i,n),_ve({x:t.x+t.w,y:t.y+t.h},i,n),_ve({x:t.x,y:t.y+t.h},i,n)]}});var Cve={prepare:function(e){var t,n,i,a,o,s=[];for(t=0,i=e.length;t<i;++t)for(n=0,a=e[t].length;n<a;++n)o=e[t][n],s.push(o),o.$layout={_box:new xve,_hidable:!1,_visible:!0,_set:t,_idx:o._index};return s.sort(function(e,t){var n=e.$layout,i=t.$layout;
5547return n._idx===i._idx?i._set-n._set:i._idx-n._idx}),this.update(s),s},update:function(e){var t,n,i,a,o,s=!1;for(t=0,n=e.length;t<n;++t)a=(i=e[t]).model(),(o=i.$layout)._hidable=a&&"auto"===a.display,o._visible=i.visible(),s|=o._hidable;s&&function(e){var t,n,i,a,o,s,r;for(t=0,n=e.length;t<n;++t)(a=(i=e[t]).$layout)._visible&&(r=new Proxy(i._el,{get:(e,t)=>e.getProps([t],!0)[t]}),o=i.geometry(),s=Tve(r,i.model(),o),a._box.update(s,o,i.rotation()));(function(e,t){var n,i,a,o;for(n=e.length-1;n>=0;--n)for(a=e[n].$layout,i=n-1;i>=0&&a._visible;--i)(o=e[i].$layout)._visible&&a._box.intersects(o._box)&&t(a,o)})(e,function(e,t){var n=e._hidable,i=t._hidable;n&&i||i?t._visible=!1:n&&(e._visible=!1)})}(e)},lookup:function(e,t){var n,i;for(n=e.length-1;n>=0;--n)if((i=e[n].$layout)&&i._visible&&i._box.contains(t))return e[n];return null},draw:function(e,t){var n,i,a,o,s,r;for(n=0,i=t.length;n<i;++n)(o=(a=t[n]).$layout)._visible&&(s=a.geometry(),r=Tve(a._el,a.model(),s),o._box.update(r,s,a.rotation()),a.draw(e,r))}},Eve="$datalabels",Sve="$default";function Ive(e,t,n,i){if(t){var a,o=n.$context,s=n.$groups;t[s._set]&&(a=t[s._set][s._key])&&!0===bne(a,[o,i])&&(e[Eve]._dirty=!0,n.update(o))}}function Ave(e,t){var n,i,a=e[Eve],o=a._listeners;if(o.enter||o.leave){if("mousemove"===t.type)i=Cve.lookup(a._labels,t);else if("mouseout"!==t.type)return;n=a._hovered,a._hovered=i,function(e,t,n,i,a){var o,s;(n||i)&&(n?i?n!==i&&(s=o=!0):s=!0:o=!0,s&&Ive(e,t.leave,n,a),o&&Ive(e,t.enter,i,a))}(e,o,n,i,t)}}var Dve={id:"datalabels",defaults:{align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:function(e){if(dne(e))return null;var t,n,i,a=e;if(pne(e))if(dne(e.label))if(dne(e.r))for(a="",i=0,n=(t=Object.keys(e)).length;i<n;++i)a+=(0!==i?", ":"")+t[i]+": "+e[t[i]];else a=e.r;else a=e.label;return""+a},labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},beforeInit:function(e){e[Eve]={_actives:[]}},beforeUpdate:function(e){var t=e[Eve];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var i,a,o,s,r,l,c,u,h=t.index,d=e[Eve],f=d._datasets[h]=[],p=e.isDatasetVisible(h),g=e.data.datasets[h],m=function(e,t){var n,i,a,o=e.datalabels,s=[];return!1===o?null:(!0===o&&(o={}),t=Cne({},[t,o]),i=t.labels||{},a=Object.keys(i),delete t.labels,a.length?a.forEach(function(e){i[e]&&s.push(Cne({},[t,i[e],{_key:e}]))}):s.push(t),n=s.reduce(function(e,t){return _ne(t.listeners||{},function(n,i){e[i]=e[i]||{},e[i][t._key||Sve]=n}),delete t.listeners,e},{}),{labels:s,listeners:n})}(g,n),v=t.meta.data||[],y=e.ctx;for(y.save(),i=0,o=v.length;i<o;++i)if((c=v[i])[Eve]=[],p&&c&&e.getDataVisibility(i)&&!c.skip)for(a=0,s=m.labels.length;a<s;++a)l=(r=m.labels[a])._key,(u=new vve(r,y,c,i)).$groups={_set:h,_key:l||Sve},u.$context={active:!1,chart:e,dataIndex:i,dataset:g,datasetIndex:h},u.update(u.$context),c[Eve].push(u),f.push(u);y.restore(),Cne(d._listeners,m.listeners,{merger:function(e,n,i){n[e]=n[e]||{},n[e][t.index]=i[e],d._listened=!0}})},afterUpdate:function(e){e[Eve]._labels=Cve.prepare(e[Eve]._datasets)},afterDatasetsDraw:function(e){Cve.draw(e,e[Eve]._labels)},beforeEvent:function(e,t){if(e[Eve]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":Ave(e,n);break;case"click":!function(e,t){var n=e[Eve],i=n._listeners.click,a=i&&Cve.lookup(n._labels,t);a&&Ive(e,i,a,t)}(e,n)}}},afterEvent:function(e){var t,n,i,a,o,s,r,l=e[Eve],c=l._actives,u=l._actives=e.getActiveElements(),h=ove(c,u);for(t=0,n=h.length;t<n;++t)if((o=h[t])[1])for(i=0,a=(r=o[0].element[Eve]||[]).length;i<a;++i)(s=r[i]).$context.active=1===o[1],s.update(s.$context);(l._dirty||h.length)&&(Cve.update(l._labels),e.render()),delete l._dirty}};const Pve={class:"modal-dialog modal-md"},Ove={class:"modal-content custom-modal"},Mve={class:"modal-body text-center"},Nve={class:"text-muted"},Rve=CC({__name:"PriorityViewModal",props:{khachHang:{type:Object,default:null},donViId:String,quayId:String,audioConfig:Object},emits:["callPriorityCustomer"],setup(e,{expose:t,emit:n}){const i=e,a=n,o=It(null);let s=null;ei(()=>{s=new wV(o.value)});const r=()=>{i.khachHang?(a("callPriorityCustomer",i.khachHang),s.hide()):VT("Không có thông tin khách hà ng Äá» gá»i!")};return t({showModal:()=>{i.khachHang?s.show():VT("Không có thông tin khách hà ng Äá» hiá»n thá».")}}),(t,n)=>{var i,a,s;return Ma(),Va("div",{class:"modal fade",id:"priorityViewModal",tabindex:"-1","aria-labelledby":"priorityViewModalLabel","aria-hidden":"true",ref_key:"priorityViewModalRef",ref:o},[Ha("div",Pve,[Ha("div",Ove,[n[1]||(n[1]=Ha("div",{class:"modal-header custom-header"},[Ha("h5",{class:"modal-title",id:"priorityViewModalLabel"},"Äá»i tượng ưu tiên"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("div",Mve,[Ha("h4",null,ee(null==(i=e.khachHang)?void 0:i.doi_tuong_uu_tien),1),Ha("p",Nve,ee(null==(a=e.khachHang)?void 0:a.hoten)+" - STT: "+ee(null==(s=e.khachHang)?void 0:s.stt),1)]),Ha("div",{class:"modal-footer custom-footer"},[Ha("button",{type:"button",class:"btn btn-custom btn-gradient-orange",onClick:r}," Gá»i sá» ngay "),n[0]||(n[0]=Ha("button",{type:"button",class:"btn btn-secondary","data-bs-dismiss":"modal"},"Äóng",-1))])])])],512)}}},[["__scopeId","data-v-7bdc768b"]]),Lve={class:"queue-container mx-auto"},Vve={class:"queue-section row"},qve={class:"col-lg-4"},Fve={class:"queue-status text-center shadow-sm"},Bve={class:"quay-dau"},Uve={class:"quay-ten"},jve=["title","aria-label"],Hve={class:"queue-number shadow-sm"},zve={class:"badge"},Wve={class:"badge"},Kve={key:2,class:"mt-2"},Gve={class:"table custom-table"},Yve={class:"text-start"},Qve={class:"text-start"},$ve={class:"text-start"},Xve={class:"text-start"},Jve={key:3,class:"py-4"},Zve={class:"btn-container btn-container-progress mt-4"},eye=["disabled"],tye={class:"row g-2"},nye={class:"col-6"},iye=["disabled"],aye={class:"col-6"},oye=["disabled"],sye={class:"col-lg-8 queue-list"},rye={class:"d-flex justify-content-between mb-1"},lye={class:"section-title"},cye={class:"section-title"},uye={class:"table-container"},hye={class:"table custom-table"},dye={class:"text-center"},fye={key:0,class:"d-flex justify-content-center"},pye=["onClick"],gye={key:1},mye={key:1},vye={class:"btn-container mt-4"},yye={key:0,class:"queue-status shadow-sm mt-2"},bye={class:"d-flex justify-content-between mb-1"},_ye={class:"section-title"},wye={class:"section-title"},kye={class:"table-container"},xye={class:"table custom-table"},Tye={key:0,class:"text-center"},Cye={key:0,class:"text-center"},Eye=["disabled","onClick"],Sye={key:1},Iye=["colspan"],Aye={class:"alert custom-links-alert mt-3 mb-0"},Dye={class:"m-0"},Pye={key:2},Oye={key:0,class:"chart-container-wrapper"}
5547,Mye={class:"stats-section mt-3"},Nye={class:"card chart-card shadow-sm"},Rye={class:"card-body"},Lye={class:"text-center section-title"},Vye={class:"text-center text-muted total-customers"},qye={class:"modal-dialog"},Fye={class:"modal-content custom-modal"},Bye={class:"modal-body"},Uye={class:"counter-list"},jye=["onClick"],Hye={class:"counter-info"},zye={class:"counter-header"},Wye={class:"counter-sub-header"},Kye={class:"counter-name"},Gye={class:"counter-waiting"},Yye={class:"counter-desc"},Qye={class:"counter-radio"},$ye={class:"modal-footer custom-footer"},Xye=["disabled"],Jye={class:"modal-dialog"},Zye={class:"modal-content custom-modal"},ebe={class:"modal-body"},tbe={key:0},nbe={class:"counter-list"},ibe=["onClick"],abe={class:"counter-info"},obe={class:"counter-header"},sbe={class:"counter-sub-header"},rbe={class:"counter-name"},lbe={class:"counter-radio"},cbe={key:1,class:"text-center text-muted"},ube={class:"modal-footer custom-footer"},hbe=["disabled"],dbe="goi-so-toan-man-hinh",fbe=CC({__name:"GoiSo",setup(e){lre.register(Dve);const t=Ll(),n=Vl(),i=n.params.don_vi,a=n.params.quay,o=JT(),{item:s}=Zs(o),r=wI(),{item:l}=Zs(r),{items:c}=Zs(r),u=y1(),{items:h}=Zs(u),d=Yee(),f=eve(),{item:p}=Zs(f),g=Fde(),{items:m}=Zs(g),v=Gee(),{items:y}=Zs(v),b=ET(),{userAuth:_}=Zs(b),{userRole:w}
5547=Zs(b),k=It(!1),x=It(!1),T=It(!1),C=It(!1),E=It(null),S=It(!1),I=It(null),A=It(null),D=It(null),P=It(new Date),O=setInterval(()=>{P.value=new Date},1e3),M=bo(()=>iQ(P.value)),N=bo(()=>pQ(P.value)),R=It(null);let L=null;const V=gt({quay:""}),q=gt({noidung:""}),F=It(null);let B=null;const U=It({});let j=!1;pa(()=>M.value.getTime(),()=>{j||g.realtimeKhachHenGioChuaPhucVu(i,a,M.value,N.value)});let H=null;const z=bo(()=>(new Date).getMonth()+1),W=bo(()=>{var e,t,n;return{doctendonvi:null==(e=s.value)?void 0:e.doctendonvi,tendonvi:null==(t=s.value)?void 0:t.ten,docsotungchuso:null==(n=s.value)?void 0:n.docsotungchuso}});Zn(async()=>{var e,n;try{if(await Promise.all([b.getAuthUser(),b.getUserAuthRole(),o.realtimeItemById(i),r.realtimeItemById(a),g.realtimeKhachHenGioChuaPhucVu(i,a,M.value,N.value),u.realtimeKhachTrongCaLamViec(i,a),we(),v.fetchItemsByDonViAnQuay(i,a)]),w.value.role==zT?await Promise.all([r.fetchItemsByDonViAndManger(i,_.value.email,!0)]):await Promise.all([r.fetchEnableItemsByDonVi(i)]),(null==(e=l.value)?void 0:e.hoatdong)||t.replace("/not-work"),j)return;c.value.forEach(e=>{u.realtimeKhachTrongCaLamViecWithCallback(i,e.id,t=>{U.value[e.id]=t.filter(e=>!e.daphucvu&&!e.dangphucvu).length})}),await me(),E.value&&f.startRealtimeListeningForToken(E.value,i,a);Zme(Jme(),async e=>{const t=(null==e?void 0:e.data)||{};if(t.quay&&t.quay!==a)return;if(t.donvi&&t.donvi!==i)return;const n=t.title||"Có khách má»i",o=t.body||"Công dân vừa lấy sá» thứ tá»±";try{const e=await navigator.serviceWorker.getRegistration();if(e&&"granted"===Notification.permission)return void(await e.showNotification(n,{body:o,icon:t.icon||"/images/logodanang.png",data:{url:t.link},tag:"khach-moi-".concat(a),renotify:!0}))}catch(eRe){}LT("".concat(n,": ").concat(o))}),(null==(n=s.value)?void 0:n.hienthithongke)&&await Re()}catch(eRe){}}),ai(()=>{j=!0,clearInterval(O),H&&H.destroy(),f.stopRealtimeListening()});const K=bo(()=>{if(l.value)return c.value.map(e=>({...e,soKhachCho:U.value[e.id]||0}))}),Y=e=>{var t,n,i;return null!=(i=null==(n=null==(t=null==e?void 0:e.ngayhengio)?void 0:t.toDate)?void 0:n.call(t))?i:null},Q=e=>{const t=Y(e);return!!t&&uQ(t,P.value)},$=bo(()=>m.value.filter(Q)),X=bo(()=>h.value.filter(e=>e.daphucvu).length),J=bo(()=>$.value.filter(e=>e.daphucvu).length),Z=bo(()=>h.value.filter(e=>!e.daphucvu&&!e.dangphucvu).length),te=bo(()=>$.value.filter(e=>!e.daphucvu&&!e.dangphucvu).length),ne=bo(()=>h.value.filter(e=>!e.daphucvu&&!e.dangphucvu).sort((e,t)=>{const n=!!e.doi_tuong_uu_tien;return n!==!!t.doi_tuong_uu_tien?n?-1:1:e.taoluc.toDate()-t.taoluc.toDate()})),ie=bo(()=>m.value.filter(e=>!e.daphucvu&&!e.dangphucvu&&Y(e)&&(e.daxacnhan||P.value<=Y(e))).sort((e,t)=>{const n=iQ(Y(e)),i=iQ(Y(t));return n.getTime()!==i.getTime()?n-i:e.daxacnhan!==t.daxacnhan?e.daxacnhan?-1:1:Y(e)-Y(t)})),ae=bo(()=>$.value.filter(e=>!e.daphucvu&&!e.dangphucvu&&e.daxacnhan&&Y(e)&&P.value>=Y(e)).sort((e,t)=>Y(e)-Y(t))),oe=bo(()=>{const e=m.value.find(e=>e.dangphucvu);if(e)return S.value=!0,e;const t=h.value.find(e=>e.dangphucvu);return t?(S.value=!1,t):null}),se=async()=>{const e={dangphucvu:!1,daphucvu:Zp.now()};await Promise.all([...m.value.filter(e=>e.dangphucvu).map(t=>g.updateItem(t.id,e)),...h.value.filter(e=>e.dangphucvu).map(t=>u.updateItem(t.id,e))])},re=(e,t=!1)=>{const n=W.value.doctendonvi?" ".concat(W.value.tendonvi):"";if(t)return"Xin má»i quý khách ".concat(e.hoten," Äã Äặt lá»ch hẹn lúc ").concat(e.thoigianhengio," Äến quầy ").concat(l.value.ten).concat(n," Äá» giao dá»ch");const i=e.doi_tuong_uu_tien?" thuá»c diá»n ưu tiên theo quy Äá»nh":"",a=W.value.docsotungchuso?(o=e.stt,String(null!=o?o:"").split("").map(e=>/\d/.test(e)?TC[Number(e)]:e).join(" ").replace(/\s+/g," ").trim()):e.stt;var o;return"Xin má»i quý khách ".concat(e.hoten," sá» ").concat(a).concat(i," Äến quầy ").concat(l.value.ten).concat(n," Äá» giao dá»ch")},le=e=>d.addItem({noidung:e,donvi:i,quay:a,taoluc:Zp.now()}),ce=bo(()=>{var e;return!!(null==(e=s.value)?void 0:e.uutien_vuot_hengio)}),ue=async()=>{C.value=!0;try{await se();const e=(()=>{const e=ne.value[0],t=ae.value[0];return ce.value&&(null==e?void 0:e.doi_tuong_uu_tien)?{khach:e,laHenGio:!1}
5547:t?{khach:t,laHenGio:!0}:e?{khach:e,laHenGio:!1}:null})();if(!e)return;const{khach:t,laHenGio:n}=e,i=n?g:u;await Promise.all([le(re(t,n)),i.updateItem(t.id,{dangphucvu:!0})])}catch(eRe){VT("Gá»i sá» tiếp theo thất bại!")}finally{C.value=!1}},he=async e=>{try{await se(),await Promise.all([le(re(e)),u.updateItem(e.id,{dangphucvu:!0})]),LT("Äã gá»i khách hà ng ưu tiên ".concat(e.stt,"!"))}catch(eRe){VT("Lá»i khi xá» lý gá»i khách ưu tiên!")}},de=async()=>{if(oe.value){x.value=!0;try{await le(re(oe.value,S.value))}catch(eRe){VT("Gá»i lại thất bại!")}finally{x.value=!1}}},fe=()=>{q.noidung="",B=new wV(F.value),B.show()},pe=async()=>{if(q.noidung)try{await d.addItem({noidung:q.noidung,donvi:i,quay:a,taoluc:Zp.now()}),LT("Äã gá»i yêu cầu phát thông báo!")}catch(eRe){VT("Phát thông báo thất bại!")}finally{B.hide()}else VT("Vui lòng chá»n má»t thông báo Äá» phát!")},ge=()=>{L=new wV(R.value),L.show()},me=async()=>{try{E.value=await ke(),await f.fetchItemByNhanThongBao(E.value,i,a)}catch(eRe){}},ve=async()=>{if((await wO("Bạn muá»n dừng nháºn khách?","Khách hà ng sẽ không thá» ÄÄng ký xếp hà ng")).isConfirmed)try{await r.updateItem(a,{trangthai:!1}),LT("Äã dừng nháºn khách!")}catch(eRe){VT("Lá»i khi dừng nháºn khách!")}},ye=async()=>{if((await wO("Bạn muá»n nháºn khách?","Khách hà ng có thá» tiếp ÄÄng ký xếp hà ng")).isConfirmed)try{await r.updateItem(a,{trangthai:!0}),LT("Äã tiếp tục nháºn khách!")}catch(eRe){VT("Lá»i khi nháºn lại khách!")}},be=async()=>{if((await wO("Bạn muá»n nháºn thông báo khi có khách?","Thông báo sẽ hiá»n thá» trên máy tÃnh khi có khách ÄÄng ký")).isConfirmed)try{if(!("Notification"in window))return void VT("Trình duyá»t nà y không há» trợ thông báo!");if("denied"===Notification.permission)return void VT("Bạn Äã chặn quyá»n thông báo cho trang nà y. Má» cà i Äặt trình duyá»t Äá» báºt lại.");if("granted"!==Notification.permission){if(!(await we()))return void VT("Cần cấp quyá»n thông báo thì má»i ÄÄng ký ÄÆ°á»£c.")}if(E.value||(E.value=await ke()),!E.value)return void VT("Chưa lấy ÄÆ°á»£c mã thiết bá». Kiá»m tra quyá»n thông báo và cấu hình FIREBASE_FCM_KEY.");if(await f.fetchItemByNhanThongBao(E.value,i,a),p.value)return void LT("Máy nà y Äã ÄÄng ký nháºn thông báo rá»i.");await f.addItem({token:E.value,donvi:i,quay:a}),LT("ÄÄng ký nháºn thông báo thà nh công!")}catch(eRe){VT("ÄÄng ký nháºn thông báo thất bại!")}},_e=async()=>{if((await wO("Bạn muá»n dừng nháºn thông báo khi có khách?","Thông báo sẽ dừng hiá»n thá» trên máy tÃnh khi có khách ÄÄng ký")).isConfirmed)try{if(E.value||(E.value=await ke()),!E.value)return void VT("Chưa lấy ÄÆ°á»£c mã thiết bá» nên không xác Äá»nh ÄÆ°á»£c ÄÄng ký cần huá»·.");const e=await f.deleteAllByToken(E.value,i,a);LT(e>1?"Dừng nháºn thông báo thà nh công (Äã xoá ".concat(e," ÄÄng ký trùng)."):"Dừng nháºn thông báo thà nh công!")}catch(eRe){VT("Dừng nháºn thông báo thất bại!")}},we=async()=>{try{return"granted"===await Notification.requestPermission()}catch(eRe){return!1}},ke=async()=>{try{return await async function(e,t){return Kme(e=Rc(e),t)}(Jme(),{vapidKey:"BOQ-a7dzSM7xGkL34fJrIBTb6Edg8QVtC3rFLrX_3Mw_PCUs-u1iWXytvzyMUoYdURFlQtqGQkIJrvvGcasX-LU"})}catch(eRe){}},xe=bo(()=>e=>hC(e)),Te=It(!1),Ce=It(!1),Ee=bo(()=>{var e;return(null==(e=l.value)?void 0:e.thoigianphucvu)||10}),Se=e=>{if("string"!=typeof e)return null;const[t,n]=e.split(":").map(Number);return Number.isFinite(t)&&Number.isFinite(n)?60*t+n:null},Ie=bo(()=>{var e;return Se(null==(e=l.value)?void 0:e.thoigianketthuc_sang)}),Ae=bo(()=>{var e;return Se(null==(e=l.value)?void 0:e.thoigianketthuc_chieu)}),De=bo(()=>{var e;return(null==(e=l.value)?void 0:e.autodungkhach)||!1}),Pe=bo(()=>{var e,t;return(null==(e=l.value)?void 0:e.dungtheosokhach)&&Z.value+te.value>=(null==(t=l.value)?void 0:t.sokhachtoida)}),Oe=bo(()=>{const e=Z.value+te.value;if(0===e)return"....";const t=e*Ee.value,n=new Date(P.value);return o$(new Date(n.getTime()+6e4*t),"HH:mm")}
5547),Me=bo(()=>{const e=Z.value+te.value;if(0===e)return!1;const t=Ie.value,n=Ae.value;if(null===t&&null===n)return!1;const i=new Date(P.value),a=60*i.getHours()+i.getMinutes(),o=a+e*Ee.value;return null!==t&&a<=t?o>t:null===n||(a>n||o>n)});pa([Z,te,P],()=>{(async()=>{if(l.value.trangthai&&(Pe.value||Me.value)){const e=new Date(P.value),t=60*e.getHours()+e.getMinutes(),n=null===Ie.value||t>Ie.value;let i="";i=Pe.value?"Sá» khách Äã Äạt giá»i hạn tá»i Äa cá»§a quầy (".concat(l.value.sokhachtoida,")."):n?"Äã quá thá»i gian là m viá»c buá»i chiá»u.":"Äã quá thá»i gian là m viá»c buá»i sáng.",De.value?(await r.updateItem(a,{trangthai:!1}),LT("Äã tá»± Äá»ng dừng nháºn khách!")):Te.value||Ce.value||(Te.value=!0,(await wO("Dừng nháºn khách?","".concat(i," Dừng lại thì công dân không ÄÄng ký xếp hà ng á» quầy nà y ÄÆ°á»£c nữa."))).isConfirmed?(await r.updateItem(a,{trangthai:!1}),LT("Äã dừng nháºn khách!")):(Ce.value=!0,Te.value=!1))}else Me.value||(Te.value=!1,Ce.value=!1)})()});const Ne=It(0),Re=async()=>{var e;const t=(new Date).getFullYear(),n=z.value;await v.fetchItemsByDonViAnQuay(i,a);const o=r$(new Date(t,n-1)),s=Array.from({length:o},(e,t)=>t+1),r=Array(o).fill(0);y.value.filter(e=>{const i=new Date(e.ngaythongke);return e.quay===a&&"xephang"===e.phanloai&&i.getMonth()+1===n&&i.getFullYear()===t}).forEach(e=>{const t=new Date(e.ngaythongke).getDate();t>=1&&t<=o&&(r[t-1]=e.soluongkhach||0)});const c=document.getElementById("dailyStatsChart");H&&H.destroy();let u=(null==(e=l.value)?void 0:e.ten)||"Quầy ".concat(a);const h=window.innerWidth<768,d=h?"line":"bar";Ne.value=r.reduce((e,t)=>e+t,0);const f=[{label:"Quầy ".concat(u),data:r,backgroundColor:Array.from({length:o},(e,t)=>"rgba(".concat(50*t%255,", ").concat(100*t%255,", ").concat(150*t%255,", 0.5)")),borderColor:h?"rgba(104, 132, 245, 1)":Array.from({length:o},(e,t)=>"rgba(".concat(50*t%255,", ").concat(100*t%255,", ").concat(150*t%255,", 1)")),borderWidth:h?2:1,barThickness:20,tension:.3,fill:!h&&void 0,pointBackgroun
5547dColor:h?"rgba(104, 132, 245, 1)":void 0,pointRadius:h?3:void 0,pointHoverRadius:h?5:void 0}];H=new lre(c,{type:d,data:{labels:s.map(e=>"".concat(e)),datasets:f},options:{maintainAspectRatio:!1,responsive:!0,animation:{duration:1e3,easing:"easeOutQuart"},plugins:{legend:{display:!0,position:"top",labels:{font:{size:12}}},title:{display:!1,font:{size:14}},datalabels:{display:!1},tooltip:{callbacks:{title:function(e){const i=e[0].label;return"Ngà y ".concat(i,"/").concat(n,"/").concat(t)},label:function(e){return"Sá» khách: ".concat(e.raw)}}}},scales:{y:{beginAtZero:!0,title:{display:!0,text:"Sá» lượng khách",font:{weight:"bold"}},ticks:{font:{weight:"bold"},precision:0}},x:{title:{display:!0,text:"Ngà y trong tháng",font:{weight:"bold"}},ticks:{autoSkip:!0,maxRotation:0,font:{weight:"bold"}}}}}}),window.addEventListener("resize",function(){window.innerWidth<768!==h&&Re()})};pa(()=>{var e;return null==(e=s.value)?void 0:e.hienthithongke},async(e,t)=>{!0===e&&!1===t?await Re():!1===e&&H&&(H.destroy(),H=null)});const Le=()=>{k.value=!0},Ve=It(!1),qe=Boolean(document.fullscreenEnabled||document.webkitFullscreenEnabled),Fe=async()=>{var e,t,n,i,a,o;const s=document.documentElement;try{document.fullscreenElement||document.webkitFullscreenElement?await(null!=(n=null==(e=document.exitFullscreen)?void 0:e.call(document))?n:null==(t=document.webkitExitFullscreen)?void 0:t.call(document)):await(null!=(o=null==(i=s.requestFullscreen)?void 0:i.call(s))?o:null==(a=s.webkitRequestFullscreen)?void 0:a.call(s))}catch(eRe){VT("Trình duyá»t không cho chuyá»n sang toà n mà n hình")}},Be=()=>{Ve.value=Boolean(document.fullscreenElement||document.webkitFullscreenElement),document.documentElement.classList.toggle(dbe,Ve.value)};return ei(()=>{document.addEventListener("fullscreenchange",Be),document.addEventListener("webkitfullscreenchange",Be)}),ai(()=>{document.documentElement.classList.remove(dbe),document.removeEventListener("fullscreenchange",Be),document.removeEventListener("webkitfullscreenchange",Be)}),(e,t)=>{var n,o,r,c,h,d,f,m,v,y,b,_;return Ma(),Va(Sa,null,[Ha("div",Lve,[Ha("div",Vve,[Ha("div",qve,[Ha("div",Fve,[Ha("div",Bve,[Ha("span",Uve,"Quầy "+ee(null==(n=Ot(l))?void 0:n.ten),1),Ot(qe)?(Ma(),Va("button",{key:0,type:"button",class:"nut-toan-man-hinh",title:Ve.value?"Thoát toà n mà n hình":"Toà n mà n hình","aria-label":Ve.value?"Thoát toà n mà n hình":"Toà n mà n hình",onClick:Fe},[Ha("i",{class:G(Ve.value?"fas fa-compress":"fas fa-expand")},null,2)],8,jve)):Qa("",!0)]),t[8]||(t[8]=Ha("h5",{class:"section-title"},"KHÃCH ÄANG PHỤC VỤ",-1)),Ha("div",Hve,[S.value?(Ma(),Va(Sa,{key:0},[t[1]||(t[1]=Ha("p",{class:"fw-bold text-muted m-0"},"Giá» hẹn giao dá»ch:",-1)),Ha("span",zve,ee(oe.value?oe.value.thoigianhengio:"..."),1)],64)):(Ma(),Va(Sa,{key:1},[t[2]||(t[2]=Ha("p",{class:"fw-bold text-muted m-0"},"Sá» thứ tá»±:",-1)),Ha("span",Wve,ee(oe.value?oe.value.stt:"..."),1)],64)),oe.value?(Ma(),Va("div",Kve,[Ha("table",Gve,[Ha("tbody",null,[Ha("tr",null,[t[3]||(t[3]=Ha("th",{class:"text-start"},"Há» tên:",-1)),Ha("td",Yve,[Ha("strong",null,ee(xe.value(oe.value.hoten)),1)])]),Ha("tr",null,[t[4]||(t[4]=Ha("th",{class:"text-start"},"Sá» Äiá»n thoại:",-1)),Ha("td",Qve,[Ha("strong",null,ee(oe.value.sodienthoai),1)])]),Ha("tr",null,[t[5]||(t[5]=Ha("th",{class:"text-start"},"Email:",-1)),Ha("td",$ve,[Ha("strong",null,ee(oe.value.email),1)])]),Ha("tr",null,[t[6]||(t[6]=Ha("th",{class:"text-start"},"Lấy sá» lúc:",-1)),Ha("td",Xve,[Ha("strong",null,ee(Ot(aC)(oe.value.taoluc)),1)])])])])])):(Ma(),Va("div",Jve,t[7]||(t[7]=[Ha("h5",{class:"text-muted"},[Ha("i",null,"Không có khách Äang phục vụ")],-1)])))]),Ha("div",Zve,[Ha("button",{class:"btn btn-custom btn-gradient-orange w-100",disabled:ae.value.length<=0&&ne.value.length<=0||C.value,onClick:ue},ee(C.value?"Äang gá»i sá»...":"Tiếp theo"),9,eye),Ha("div",tye,[Ha("div",nye,[Ha("button",{class:"btn btn-custom btn-gradient-orange w-100",disabled:!oe.value||x.value||T.value,onClick:de},ee(x.value?"Äang gá»i lại...":"Gá»i lại"),9,iye)]),Ha("div",aye,[Ha("button",{class:"btn btn-custom btn-gradient-blue w-100",disabled:!oe.value||x.value||T.value,onClick:ge}," Chuyá»n quầy ",8,oye)]),(null==(o=Ot(s))?void 0:o.thongbao_lettane_enabled)?(Ma(),Va("button",{key:0,class:"btn btn-custom btn-gradient-blue w-100 mt-2",onClick:fe}," Phát thông báo ")):Qa("",!0)])])])]),Ha("div",sye,[Ha("div",{class:G(["queue-status mb-2 shadow-sm",{"h-100":!Ot(s).quetqrhengio}])},[Ha("div",rye,[Ha("h5",lye,"ÄANG CHá»: "+ee(Z.value),1),Ha("h5",{class:G(["section-title serving-time",{over:Me.value}])},[t[9]||(t[9]=Ga("Dá»° KIẾN ÄẾN: ")),Ha("strong",null,ee(Oe.value),1)],2),Ha("h5",cye,"Äà PHỤC VỤ: "+ee(X.value),1)]),Ha("div",uye,[Ha("table",hye,[t[11]||(t[11]=Ha("thead",null,[Ha("tr",null,[Ha("th",{style:{width:"15%"}},"STT"),Ha("th",null,"Tên khách hà ng"),Ha("th",null,"Sá» Äiá»n thoại"),Ha("th",null,"Lấy sá» lúc"),Ha("th",{class:"text-center"},"Ưu tiên")])],-1)),Ha("tbody",null,[ne.value.length>0?(Ma(!0),Va(Sa,{key:0},gi(ne.value,e=>(Ma(),Va("tr",{key:e.id},[Ha("td",null,ee(e.stt),1),Ha("td",null,ee(xe.value(e.hoten)),1),Ha("td",null,ee(e.sodienthoai),1),Ha("td",null,ee(Ot(oC)(e.taoluc)),1),Ha("td",dye,[e.doi_tuong_uu_tien?(Ma(),Va("div",fye,[Ha("button",{class:"btn btn-sm btn-custom btn-gradient-blue w-auto",onClick:t=>{return n=e,I.value=n,void an(()=>{A.value&&A.value.showModal()});var n}},"Xem ",8,pye)])):(Ma(),Va("span",gye,"Không"))])]))),128)):(Ma(),Va("tr",mye,t[10]||(t[10]=[Ha("td",{colspan:"5",class:"text-center"},"Không có khách hà ng nà o",-1)])))])])]),Ha("div",vye,[(null==(r=Ot(l))?void 0:r.trangthai)?(Ma(),Va("button",{key:0,class:"btn btn-custom btn-gradient-blue",onClick:ve}," Dừng nháºn khách ")):(Ma(),Va("button",{key:1,class:"btn btn-custom btn-gradient-orange",onClick:ye}," Nháºn khách ")),(null==(c=Ot(p))?void 0:c.id)?(Ma(),Va("button",{key:2,class:"btn btn-custom btn-gradient-orange",onClick:_e}," Dừng thông báo ")):(Ma(),Va("button",{key:3,class:"btn btn-custom btn-gradient-blue",onClick:be}," Nháºn thông báo "))])],2),Ot(s).quetqrhengio?(Ma(),Va("div",yye,[Ha("div",bye,[Ha("h5",_ye,"HẸN GIá» HÃM NAY: "+ee(te.value),1),Ha("h5",wye,"Äà PHỤC VỤ: "+ee(J.value),1)]),Ha("div",kye,[Ha("table",xye,[Ha("thead",null,[Ha("tr",null,[t[12]||(t[12]=Ha("th",null,"Ngà y hẹn",-1)),t[13]||(t[13]=Ha("th",null,"Giá» hẹn",-1)),t[14]||(t[14]=Ha("th",null,"Tên khách hà ng",-1)),t[15]||(t[15]=H
5547a("th",null,"Sá» Äiá»n thoại",-1)),t[16]||(t[16]=Ha("th",null,"Trạng thái",-1)),(null==(h=Ot(l))?void 0:h.xacnhanhengiotaiquay)?(Ma(),Va("th",Tye,"Hà nh Äá»ng")):Qa("",!0)])]),Ha("tbody",null,[ie.value.length>0?(Ma(!0),Va(Sa,{key:0},gi(ie.value,e=>{var t,n;return Ma(),Va("tr",{key:e.id,class:G({"hen-gio-hom-nay":Q(e)})},[Ha("td",null,ee((n=e,iC(null==n?void 0:n.ngayhengio))),1),Ha("td",null,ee(e.thoigianhengio),1),Ha("td",null,ee(xe.value(e.hoten)),1),Ha("td",null,ee(e.sodienthoai),1),Ha("td",null,[Ha("span",{class:G(e.daxacnhan?"text-success":"text-danger")},ee(e.daxacnhan?"Äã xác nháºn":"Chưa xác nháºn"),3)]),(null==(t=Ot(l))?void 0:t.xacnhanhengiotaiquay)?(Ma(),Va("td",Cye,[Ha("button",{class:G(["btn btn-sm btn-custom w-auto",e.daxacnhan?"btn-gradient-blue":"btn-gradient-orange"]),disabled:D.value===e.id,onClick:t=>(async e=>{var t;if(!(null==(t=l.value)?void 0:t.xacnhanhengiotaiquay)||D.value)return;const n=!!e.daxacnhan;if(n&&!(await wO("Huá»· xác nháºn lá»ch hẹn","Bạn có muá»n huá»· xác nháºn lá»ch hẹn ".concat(e.thoigianhengio," cá»§a khách ").concat(hC(e.hoten)," không?"))).isConfirmed)return;D.value=e.id;try{await g.updateItem(e.id,{daxacnhan:!n}),LT(n?"Äã huá»· xác nháºn lá»ch hẹn!":"Äã xác nháºn lá»ch hẹn!")}catch(eRe){VT("Cáºp nháºt xác nháºn lá»ch hẹn thất bại!")}finally{D.value=null}})(e)},ee(e.daxacnhan?"Huá»· xác nháºn":"Xác nháºn"),11,Eye)])):Qa("",!0)],2)}),128)):(Ma(),Va("tr",Sye,[Ha("td",{colspan:(null==(d=Ot(l))?void 0:d.xacnhanhengiotaiquay)?6:5,class:"text-center"},"Không có khách hà ng nà o",8,Iye)]))])])]),Ha("div",Aye,[Ha("p",Dye,[t[18]||(t[18]=Ha("strong",null,"Lưu ý:",-1)),t[19]||(t[19]=Ha("br",null,null,-1)),t[20]||(t[20]=Ga(" - Bảng liá»t kê lá»ch hẹn cá»§a cả tuần hiá»n tại; chá» khách hẹn trong ngà y hôm nay má»i ÄÆ°á»£c gá»i sá».")),t[21]||(t[21]=Ha("br",null,null,-1)),t[22]||(t[22]=Ga(" - Thứ tá»± gá»i: ")),ce.value?(Ma(),Va(Sa,{key:0},[Ga("khách thuá»c diá»n ưu tiên trưá»c, rá»i Äến khách hẹn giá», sau cùng là khách xếp hà ng thưá»ng.")],64)):(Ma(),Va(Sa,{key:1},[Ga("khách hẹn giá» trưá»c, rá»i Äến khách thuá»c diá»n ưu tiên, sau cùng là khách xếp hà ng thưá»ng.")],64)),t[23]||(t[23]=Ha("br",null,null,-1)),t[24]||(t[24]=Ga(" - Khách hẹn giá» khi Äến thá»i gian hẹn, nếu xác nháºn có mặt sẽ ÄÆ°á»£c phục vụ trưá»c khách xếp hà ng thưá»ng; quá giá» hẹn mà Äã xác nháºn thì vẫn giữ lượt.")),t[25]||(t[25]=Ha("br",null,null,-1)),t[26]||(t[26]=Ga(" - Nếu không xác nháºn, há» thá»ng sẽ bá» qua và không phục vụ. ")),(null==(f=Ot(l))?void 0:f.xacnhanhengiotaiquay)?(Ma(),Va("span",Pye,t[17]||(t[17]=[Ha("br",null,null,-1),Ga("- Quầy ÄÆ°á»£c phép xác nháºn hoặc huá»· xác nháºn thay cho công dân bất cứ lúc nà o, không cần chá» tá»i giá» hẹn.")]))):Qa("",!0)])])])):Qa("",!0)])]),(null==(m=Ot(s))?void 0:m.hienthithongke)?(Ma(),Va("div",Oye,[Ha("div",Mye,[Ha("div",Nye,[Ha("div",Rye,[Ha("h5",Lye,"THEO DÃI TÃNH HÃNH XẾP HÃNG THÃNG "+ee(z.value),1),Ha("p",Vye,[t[27]||(t[27]=Ga("Tá»ng khách: ")),Ha("strong",null,ee(Ne.value),1)]),t[28]||(t[28]=Ha("div",{class:"fullwidth-chart-container"},[Ha("canvas",{id:"dailyStatsChart",class:"full-width-chart"})],-1))])])])])):Qa("",!0),"letan"===(null==(v=Ot(s))?void 0:v.vitriamthanh)?(Ma(),qa(rte,{key:1,showButton:!k.value,onSoundStarted:Le},null,8,["showButton"])):Qa("",!0),I.value?(Ma(),qa(Rve,{key:2,ref_key:"priorityViewModalRef",ref:A,khachHang:I.value,donViId:Ot(i),quayId:Ot(a),audioConfig:W.value,onCallPriorityCustomer:he},null,8,["khachHang","donViId","quayId","audioConfig"])):Qa("",!0),Ha("div",{class:"modal fade",id:"chuyenQuayModal",tabindex:"-1","aria-labelledby":"chuyenQuayModalLabel","aria-hidden":"true",ref_key:"modalChuyenQuayRef",ref:R},[Ha("div",qye,[Ha("div",Fye,[t[29]||(t[29]=Ha("div",{class:"modal-header custom-header"},[Ha("h5",{class:"modal-title",id:"quayModalLabel"},"Chuyá»n quầy"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("form",{onSubmit:t[0]||(t[0]=Es(e=>(async()=>
5547{if(!oe.value)return void VT("Không có khách Äang phục vụ Äá» chuyá»n!");if(!V.quay)return void VT("Vui lòng chá»n quầy cần chuyá»n!");if(V.quay===a)return void VT("Khách Äang á» quầy nà y rá»i!");T.value=!0;const{id:e,quay:t}=oe.value,n=S.value;try{if(n)await g.updateItem(e,{quay:V.quay,quay_goc:t,dangphucvu:!1});else{const n=await Wee(i,V.quay);await u.updateItem(e,{quay:V.quay,quay_goc:t,stt:n,dangphucvu:!1,taoluc_goc:oe.value.taoluc,taoluc:Zp.now()})}LT("Chuyá»n quầy thà nh công")}catch(eRe){VT("Chuyá»n quầy thất bại")}finally{T.value=!1,L.hide()}})(),["prevent"]))},[Ha("div",Bye,[Ha("div",Uye,[(Ma(!0),Va(Sa,null,gi(K.value,e=>{return Ma(),Va("div",{key:e.id,class:G(["counter-item",{disabled:!e.trangthai,selected:V.quay===e.id}]),onClick:t=>(e=>{if(!e.trangthai)return void VT("Quầy ".concat(e.ten," hiá»n Äang dừng nháºn khách!"));const t=pC(e,s.value);t?VT("Quầy ".concat(e.ten,": ").concat(t,"!")):V.quay=e.id})(e)},[Ha("div",Hye,[Ha("div",zye,[Ha("div",Wye,[Ha("div",Kye,"Quầy "+ee(e.ten),1),Ha("div",Gye,ee((t=e,gC(t,s.value,new Date,t.soKhachCho))),1)]),Ha("div",Yye,ee(e.mota),1)])]),Ha("div",Qye,[Ha("span",{class:G(["radio-checkmark",{checked:V.quay===e.id}])},null,2)])],10,jye);var t}),128))])]),Ha("div",$ye,[Ha("button",{type:"submit",class:"btn btn-custom btn-gradient-blue",disabled:T.value||!oe.value||!V.quay},ee(T.value?"Äang xá» lý...":"Chuyá»n quầy"),9,Xye)])],32)])])],512),Ha("div",{class:"modal fade",id:"thongBaoLeTanModal",tabindex:"-1","aria-labelledby":"thongBaoLeTanModalLabel","aria-hidden":"true",ref_key:"modalThongBaoLeTanRef",ref:F},[Ha("div",Jye,[Ha("div",Zye,[t[31]||(t[31]=Ha("div",{class:"modal-header custom-header"},[Ha("h5",{class:"modal-title",id:"thongBaoLeTanModalLabel"},"Chá»n thông báo"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("form",{onSubmit:Es(pe,["prevent"])},[Ha("div",ebe,[(null==(b=null==(y=Ot(s))?void 0:y.thongbao_lettane_texts)?void 0:b.length)>0?(Ma(),Va("div",tbe,[Ha("div",nbe,[(Ma(!0),Va(Sa,null,gi(Ot(s).thongbao_lettane_texts,(e,t)=>(Ma(),Va("div",{key:t,class:G(["counter-item",{selected:q.noidung===e}]),onClick:t=>(e=>{q.noidung=e})(e)},[Ha("div",abe,[Ha("div",obe,[Ha("div",sbe,[Ha("div",rbe,ee(e),1)])])]),Ha("div",lbe,[Ha("span",{class:G(["radio-checkmark",{checked:q.noidung===e}])},null,2)])],10,ibe))),128))])])):(Ma(),Va("div",cbe,t[30]||(t[30]=[Ha("p",null,"Không có thông báo tùy chá»nh nà o ÄÆ°á»£c cấu hình.",-1)])))]),Ha("div",ube,[Ha("button",{type:"submit",class:"btn btn-custom btn-gradient-blue",disabled:!q.noidung}," Phát thông báo ",8,hbe)])],32)])])],512)]),(null==(_=Ot(s))?void 0:_.hienthichatdanangai)?(Ma(),qa(wge,{key:0,"hien-so-luot":!1})):Qa("",!0)],64)}}},[["__scopeId","data-v-94fb319b"]]);var pbe={exports:{}}; 5548/** 5549 * @license 5550 * Lodash <https://lodash.com/> 5551 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> 5552 * Released under MIT license <https://lodash.com/license> 5553 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 5554 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 5555 */!function(e,t){(function(){var n,i="Expected a function",a="__lodash_hash_undefined__",o="__lodash_placeholder__",s=16,r=32,l=64,c=128,u=256,h=1/0,d=9007199254740991,f=NaN,p=4294967295,g=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",r],["partialRight",l],["rearg",u]],m="[object Arguments]",v="[object Array]",y="[object Boolean]",b="[object Date]",_="[object Error]",w="[object Function]",k="[object GeneratorFunction]",x="[object Map]",T="[object Number]",C="[object Object]",E="[object Promise]",S="[object RegExp]",I="[object Set]",A="[object String]",D="[object Symbol]",P="[object WeakMap]",O="[object ArrayBuffer]",M="[object DataView]",N="[object Float32Array]",R="[object Float64Array]",L="[object Int8Array]",V="[object Int16Array]",q="[object Int32Array]",F="[object Uint8Array]",B="[object Uint8ClampedArray]",U="[object Uint16Array]",j="[object Uint32Array]",H=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,K=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,Y=RegExp(K.source),Q=RegExp(G.source),$=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ee=/^\w*$/,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(ne.source),ae=/^\s+/,oe=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,re=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,pe=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 17,892 bytes, line 5555
55557f]/g,_e=/($^)/,we=/['\n\r\u2028\u2029\\]/g,ke="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Te="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",Ee="A-Z\\xc0-\\xd6\\xd8-\\xde",Se="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ae="['â]",De="["+ke+"]",Pe="["+Ie+"]",Oe="["+xe+"]",Me="\\d+",Ne="["+Te+"]",Re="["+Ce+"]",Le="[^"+ke+Ie+Me+Te+Ce+Ee+"]",Ve="\\ud83c[\\udffb-\\udfff]",qe="[^"+ke+"]",Fe="(?:\\ud83c[\\udde6-\\uddff]){2}",Be="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Ee+"]",je="\\u200d",He="(?:"+Re+"|"+Le+")",ze="(?:"+Ue+"|"+Le+")",We="(?:['â](?:d|ll|m|re|s|t|ve))?",Ke="(?:['â](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Oe+"|"+Ve+")"+"?",Ye="["+Se+"]?",Qe=Ye+Ge+("(?:"+je+"(?:"+[qe,Fe,Be].join("|")+")"+Ye+Ge+")*"),$e="(?:"+[Ne,Fe,Be].join("|")+")"+Qe,Xe="(?:"+[qe+Oe+"?",Oe,Fe,Be,De].join("|")+")",Je=RegExp(Ae,"g"),Ze=RegExp(Oe,"g"),et=RegExp(Ve+"(?="+Ve+")|"+Xe+Qe,"g"),tt=RegExp([Ue+"?"+Re+"+"+We+"(?="+[Pe,Ue,"$"].join("|")+")",ze+"+"+Ke+"(?="+[Pe,Ue+He,"$"].join("|")+")",Ue+"?"+He+"+"+We,Ue+"+"+Ke,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Me,$e].join("|"),"g"),nt=RegExp("["+je+ke+xe+Se+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,at=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ot=-1,st={};st[N]=st[R]=st[L]=st[V]=st[q]=st[F]=st[B]=st[U]=st[j]=!0,st[m]=st[v]=st[O]=st[y]=st[M]=st[b]=st[_]=st[w]=st[x]=st[T]=st[C]=st[S]=st[I]=st[A]=st[P]=!1;var rt={};rt[m]=rt[v]=rt[O]=rt[M]=rt[y]=rt[b]=rt[N]=rt[R]=rt[L]=rt[V]=rt[q]=rt[x]=rt[T]=rt[C]=rt[S]=rt[I]=rt[A]=rt[D]=rt[F]=rt[B]=rt[U]=rt[j]=!0,rt[_]=rt[w]=rt[P]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,ut=parseInt,ht="object"==typeof ST&&ST&&ST.Object===Object&&ST,dt="object"==typeof self&&self&&self.Object===Object&&self,ft=ht||dt||Function("return this")(),pt=t&&!t.nodeType&&t,gt=pt&&e&&!e.nodeType&&e,mt=gt&>.exports===pt,vt=mt&&ht.process,yt=function(){try{var e=gt&>.require&>.require("util").types;return e||vt&&vt.binding&&vt.binding("util")}catch(ZNe){}}(),bt=yt&&yt.isArrayBuffer,_t=yt&&yt.isDate,wt=yt&&yt.isMap,kt=yt&&yt.isRegExp,xt=yt&&yt.isSet,Tt=yt&&yt.isTypedArray;function Ct(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Et(e,t,n,i){for(var a=-1,o=null==e?0:e.length;++a<o;){var s=e[a];t(i,s,n(s),e)}return i}function St(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e}function It(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function At(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(!t(e[n],n,e))return!1;return!0}function Dt(e,t){for(var n=-1,i=null==e?0:e.length,a=0,o=[];++n<i;){var s=e[n];t(s,n,e)&&(o[a++]=s)}return o}function Pt(e,t){return!!(null==e?0:e.length)&&Ut(e,t,0)>-1}function Ot(e,t,n){for(var i=-1,a=null==e?0:e.length;++i<a;)if(n(t,e[i]))return!0;return!1}function Mt(e,t){for(var n=-1,i=null==e?0:e.length,a=Array(i);++n<i;)a[n]=t(e[n],n,e);return a}function Nt(e,t){for(var n=-1,i=t.length,a=e.length;++n<i;)e[a+n]=t[n];return e}function Rt(e,t,n,i){var a=-1,o=null==e?0:e.length;for(i&&o&&(n=e[++a]);++a<o;)n=t(n,e[a],a,e);return n}function Lt(e,t,n,i){var a=null==e?0:e.length;for(i&&a&&(n=e[--a]);a--;)n=t(n,e[a],a,e);return n}function Vt(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}var qt=Wt("length");function Ft(e,t,n){var i;return n(e,function(e,n,a){if(t(e,n,a))return i=n,!1}),i}function Bt(e,t,n,i){for(var a=e.length,o=n+(i?1:-1);i?o--:++o<a;)if(t(e[o],o,e))return o;return-1}function Ut(e,t,n){return t==t?function(e,t,n){var i=n-1,a=e.length;for(;++i<a;)if(e[i]===t)return i;return-1}(e,t,n):Bt(e,Ht,n)}function jt(e,t,n,i){for(var a=n-1,o=e.length;++a<o;)if(i(e[a],t))return a;return-1}function Ht(e){return e!=e}function zt(e,t){var n=null==e?0:e.length;return n?Yt(e,t)/n:f}function Wt(e){return function(t){return null==t?n:t[e]}}function Kt(e){return function(t){return null==e?n:e[t]}}function Gt(e,t,n,i,a){return a(e,function(e,a,o){n=i?(i=!1,e):t(n,e,a,o)}),n}function Yt(e,t){for(var i,a=-1,o=e.length;++a<o;){var s=t(e[a]);s!==n&&(i=i===n?s:i+s)}return i}function Qt(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function $t(e){return e?e.slice(0,fn(e)+1).replace(ae,""):e}function Xt(e){return function(t){return e(t)}}function Jt(e,t){return Mt(t,function(t){return e[t]})}function Zt(e,t){return e.has(t)}function en(e,t){for(var n=-1,i=e.length;++n<i&&Ut(t,e[n],0)>-1;);return n}function tn(e,t){for(var n=e.length;n--&&Ut(t,e[n],0)>-1;);return n}var nn=Kt({"Ã":"A","Ã":"A","Ã":"A","Ã":"A","Ã":"A","Ã
":"A","à ":"a","á":"a","â":"a","ã":"a","ä":"a","Ã¥":"a","Ã":"C","ç":"c","Ã":"D","ð":"d","Ã":"E","Ã":"E","Ã":"E","Ã":"E","è":"e","é":"e","ê":"e","ë":"e","Ã":"I","Ã":"I","Ã":"I","Ã":"I","ì":"i","Ã":"i","î":"i","ï":"i","Ã":"N","ñ":"n","Ã":"O","Ã":"O","Ã":"O","Ã":"O","Ã":"O","Ã":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ã":"U","Ã":"U","Ã":"U","Ã":"U","ù":"u","ú":"u","û":"u","ü":"u","Ã":"Y","ý":"y","ÿ":"y","Ã":"Ae","æ":"ae","Ã":"Th","þ":"th","Ã":"ss","Ä":"A","Ä":"A","Ä":"A","Ä":"a","Ä":"a","Ä
":"a","Ä":"C","Ä":"C","Ä":"C","Ä":"C","Ä":"c","Ä":"c","Ä":"c","Ä":"c","Ä":"D","Ä":"D","Ä":"d","Ä":"d","Ä":"E","Ä":"E","Ä":"E","Ä":"E","Ä":"E","Ä":"e","Ä":"e","Ä":"e","Ä":"e","Ä":"e","Ä":"G","Ä":"G","Ä ":"G","Ä¢":"G","Ä":"g","Ä":"g","Ä¡":"g","Ä£":"g","Ĥ":"H","Ħ":"H","Ä¥":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Ä®":"I","İ":"I","Ä©":"i","Ä«":"i","Ä":"i","į":"i","ı":"i","Ä´":"J","ĵ":"j","Ķ":"K","Ä·":"k","ĸ":"k","Ĺ":"L","Ä»":"L","Ľ":"L","Ä¿":"L","Å":"L","ĺ":"l","ļ":"l","ľ":"l","Å":"l","Å":"l","Å":"N","Å
":"N","Å":"N","Å":"N","Å":"n","Å":"n","Å":"n","Å":"n","Å":"O","Å":"O","Å":"O","Å":"o","Å":"o","Å":"o","Å":"R","Å":"R","Å":"R","Å":"r","Å":"r","Å":"r","Å":"S","Å":"S","Å":"S","Å ":"S","Å":"s","Å":"s","Å":"s","Å¡":"s","Å¢":"T","Ť":"T","Ŧ":"T","Å£":"t","Å¥":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Å®":"U","Ű":"U","Ų":"U","Å©":"u","Å«":"u","Å":"u","ů":"u","ű":"u","ų":"u","Å´":"W","ŵ":"w","Ŷ":"Y","Å·":"y","Ÿ":"Y","Ź":"Z","Å»":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Å":"Oe","Å":"oe","Å":"'n","Å¿":"s"}),an=Kt({"&":"&","<":"<",">":">",'"':""","'":"'"});function on(e){return"\\"+lt[e]}function sn(e){return nt.test(e)}function rn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function ln(e,t){return function(n){return e(t(n))}}function cn(e,t){for(var n=-1,i=e.length,a=0,s=[];++n<i;){var r=e[n];r!==t&&r!==o||(e[n]=o,s[a++]=n)}return s}function un(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function hn(e){return sn(e)?function(e){var t=et.lastIndex=0;for(;et.test(e);)++t;return t}(e):qt(e)}function dn(e){return sn(e)?function(e){return e.match(et)||[]}(e):function(e){return e.split("")}(e)}function fn(e){for(var t=e.length;t--&&oe.test(e.charAt(t)););return t}var pn=Kt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var gn=function e(t){var oe,ke=(t=null==t?ft:gn.defaults(ft.Object(),t,gn.pick(ft,at))).Array,xe=t.Date,Te=t.Error,Ce=t.Function,Ee=t.Math,Se=t.Object,Ie=t.RegExp,Ae=t.String,De=t.TypeError,Pe=ke.prototype,Oe=Ce.prototype,Me=Se.prototype,Ne=t["__core-js_shared__"],Re=Oe.toString,Le=Me.hasOwnProperty,Ve=0,qe=(oe=/[^.]+$/.exec(Ne&&Ne.keys&&Ne.keys.IE_PROTO||""))?"Symbol(src)_1."+oe:"",Fe=Me.toString,Be=Re.call(Se),Ue=ft._,je=Ie("^"+Re.call(Le).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=mt?t.Buffer:n,ze=t.Symbol,We=t.Uint8Array,Ke=He?He.allocUnsafe:n,Ge=ln(Se.getPrototypeOf,Se),Ye=Se.create,Qe=Me.propertyIsEnumerable,$e=Pe.splice,Xe=ze?ze.isConcatSpreadable:n,et=ze?ze.iterator:n,nt=ze?ze.toStringTag:n,lt=function(){try{var e=ho(Se,"defineProperty");return e({},"",{}),e}catch(ZNe){}}(),ht=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,dt=xe&&xe.now!==ft.Date.now&&xe.now,pt=t.setTimeout!==ft.setTimeout&&t.setTimeout,gt=Ee.ceil,vt=Ee.floor,yt=Se.getOwnPropertySymbols,qt=He?He.isBuffer:n,Kt=t.isFinite,mn=Pe.join,vn=ln(Se.keys,Se),yn=Ee.max,bn=Ee.min,_n=xe.now,wn=t.parseInt,kn=Ee.random,xn=Pe.reverse,Tn=ho(t,"DataView"),Cn=ho(t,"Map"),En=ho(t,"Promise"),Sn=ho(t,"Set"),In=ho(t,"WeakMap"),An=ho(Se,"create"),Dn=In&&new In,Pn={},On=Uo(Tn),Mn=Uo(Cn),Nn=Uo(En),Rn=Uo(Sn),Ln=Uo(In),Vn=ze?ze.prototype:n,qn=Vn?Vn.valueOf:n,Fn=Vn?Vn.toString:n;function Bn(e){if(ar(e)&&!Gs(e)&&!(e instanceof zn)){if(e instanceof Hn)return e;if(Le.call(e,"__wrapped__"))return jo(e)}return new Hn(e)}var Un=function(){function e(){}return function(t){if(!ir(t))return{};if(Ye)return Ye(t);e.prototype=t;var i=new e;return e.prototype=n,i}}();function jn(){}function Hn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function zn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Kn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Gn;++t<n;)this.add(e[t])}function Qn(e){var t=this.__data__=new Kn(e);this.size=t.size}function $n(e,t){var n=Gs(e),i=!n&&Ks(e),a=!n&&!i&&Xs(e),o=!n&&!i&&!a&&dr(e),s=n||i||a||o,r=s?Qt(e.length,Ae):[],l=r.length;for(var c in e)!t&&!Le.call(e,c)||s&&("length"==c||a&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||bo(c,l))||r.push(c);return r}function Xn(e){var t=e.length;return t?e[Yi(0,t-1)]:n}function Jn(e,t){return Ro(Aa(e),ri(t,0,e.length))}function Zn(e){return Ro(Aa(e))}function ei(e,t,i){(i!==n&&!Hs(e[t],i)||i===n&&!(t in e))&&oi(e,t,i)}function ti(e,t,i){var a=e[t];Le.call(e,t)&&Hs(a,i)&&(i!==n||t in e)||oi(e,t,i)}function ni(e,t){for(var n=e.length;n--;)if(Hs(e[n][0],t))return n;return-1}function ii(e,t,n,i){return di(e,function(e,a,o){t(i,e,n(e),o)}),i}function ai(e,t){return e&&Da(t,Nr(t),e)}function oi(e,t,n){"__proto__"==t&<?lt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function si(e,t){for(var i=-1,a=t.length,o=ke(a),s=null==e;++i<a;)o[i]=s?n:Ar(e,t[i]);return o}function ri(e,t,i){return e==e&&(i!==n&&(e=e<=i?e:i),t!==n&&(e=e>=t?e:t)),e}function li(e,t,i,a,o,s){var r,l=1&t,c=2&t,u=4&t;if(i&&(r=o?i(e,a,o,s):i(e)),r!==n)return r;if(!ir(e))return e;var h=Gs(e);if(h){if(r=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Le.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Aa(e,r)}else{var d=go(e),f=d==w||d==k;if(Xs(e))return xa(e,l);if(d==C||d==m||f&&!o){if(r=c||f?{}:vo(e),!l)return c?function(e,t){return Da(e,po(e),t)}(e,function(e,t){return e&&Da(t,Rr(t),e)}(r,e)):function(e,t){return Da(e,fo(e),t)}(e,ai(r,e))}else{if(!rt[d])return o?e:{};r=function(e,t,n){var i=e.constructor;switch(t){case O:return Ta(e);case y:case b:return new i(+e);case M:return function(e,t){var n=t?Ta(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case R:case L:case V:case q:case F:case B:case U:case j:return Ca(e,n);case x:return new i;case T:case A:return new i(e);case S:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case I:return new i;case D:return a=e,qn?Se(qn.call(a)):{}}var a}(e,d,l)}}s||(s=new Qn);var p=s.get(e);if(p)return p;s.set(e,r),cr(e)?e.forEach(function(n){r.add(li(n,t,i,n,e,s))}):or(e)&&e.forEach(function(n,a){r.set(a,li(n,t,i,a,e,s))});var g=h?n:(u?c?ao:io:c?Rr:Nr)(e);return St(g||e,function(n,a){g&&(n=e[a=n]),ti(r,a,li(n,t,i,a,e,s))}),r}function ci(e,t,i){var a=i.length;if(null==e)return!a;for(e=Se(e);a--;){var o=i[a],s=t[o],r=e[o];if(r===n&&!(o in e)||!s(r))return!1}return!0}function ui(e,t,a){if("function"!=typeof e)throw new De(i);return Po(function(){e.apply(n,a)},t)}function hi(e,t,n,i){var a=-1,o=Pt,s=!0,r=e.length,l=[],c=t.length;if(!r)return l;n&&(t=Mt(t,Xt(n))),i?(o=Ot,s=!1):t.length>=200&&(o=Zt,s=!1,t=new Yn(t));e:for(;++a<r;){var u=e[a],h=null==n?u:n(u);if(u=i||0!==u?u:0,s&&h==h){for(var d=c;d--;)if(t[d]===h)continue e;l.push(u)}else o(t,h,i)||l.push(u)}return l}Bn.templateSettings={escape:$,evaluate:X,interpolate:J,variable:"",imports:{_:Bn}},Bn.prototype=jn.prototype,Bn.prototype.constructor=Bn,Hn.prototype=Un(jn.prototype),Hn.prototype.constructor=Hn,zn.prototype=Un(jn.prototype),zn.prototype.constructor=zn,Wn.prototype.clear=function(){this.__data__=An?An(null):{},this.size=0},Wn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Wn.prototype.get=function(e){var t=this.__data__;if(An){var i=t[e];return i===a?n:i}return Le.call(t,e)?t[e]:n},Wn.prototype.has=function(e){var t=this.__data__;return An?t[e]!==n:Le.call(t,e)},Wn.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=An&&t===n?a:t,this},Kn.prototype.clear=function(){this.__data__=[],this.size=0},Kn.prototype.delete=function(e){var t=this.__data__,n=ni(t,e);return!(n<0)&&(n==t.length-1?t.pop():$e.call(t,n,1),--this.size,!0)},Kn.prototype.get=function(e){var t=this.__data__,i=ni(t,e);return i<0?n:t[i][1]},Kn.prototype.has=function(e){return ni(this.__data__,e)>-1},Kn.prototype.set=function(e,t){var n=this.__data__,i=ni(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(Cn||Kn),string:new Wn}},Gn.prototype.delete=function(e){var t=co(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return co(this,e).get(e)},Gn.prototype.has=function(e){return co(this,e).has(e)},Gn.prototype.set=function(e,t){var n=co(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this},Yn.prototype.add=Yn.prototype.push=function(e){return this.__data__.set(e,a),this},Yn.prototype.has=function(e){return this.__data__.has(e)},Qn.prototype.clear=function(){this.__data__=new Kn,this.size=0},Qn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Qn.prototype.get=function(e){return this.__data__.get(e)},Qn.prototype.has=function(e){return this.__data__.has(e)},Qn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Kn){var i=n.__data__;if(!Cn||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(i)}return n.set(e,t),this.size=n.size,this};var di=Ma(_i),fi=Ma(wi,!0);function pi(e,t){var n=!0;return di(e,function(e,i,a){return n=!!t(e,i,a)}),n}function gi(e,t,i){for(var a=-1,o=e.length;++a<o;){var s=e[a],r=t(s);if(null!=r&&(l===n?r==r&&!hr(r):i(r,l)))var l=r,c=s}return c}function mi(e,t){var n=[];return di(e,function(e,i,a){t(e,i,a)&&n.push(e)}),n}function vi(e,t,n,i,a){var o=-1,s=e.length;for(n||(n=yo),a||(a=[]);++o<s;){var r=e[o];t>0&&n(r)?t>1?vi(r,t-1,n,i,a):Nt(a,r):i||(a[a.length]=r)}return a}var yi=Na(),bi=Na(!0);function _i(e,t){return e&&yi(e,t,Nr)}function wi(e,t){return e&&bi(e,t,Nr)}function ki(e,t){return Dt(t,function(t){return er(e[t])})}function xi(e,t){for(var i=0,a=(t=ba(t,e)).length;null!=e&&i<a;)e=e[Bo(t[i++])];return i&&i==a?e:n}function Ti(e,t,n){var i=t(e);return Gs(e)?i:Nt(i,n(e))}function Ci(e){return null==e?e===n?"[object Undefined]":"[object Null]":nt&&nt in Se(e)?function(e){var t=Le.call(e,nt),i=e[nt];try{e[nt]=n;var a=!0}catch(ZNe){}var o=Fe.call(e);a&&(t?e[nt]=i:delete e[nt]);return o}(e):function(e){return Fe.call(e)}(e)}function Ei(e,t){return e>t}function Si(e,t){return null!=e&&Le.call(e,t)}function Ii(e,t){return null!=e&&t in Se(e)}function Ai(e,t,i){for(var a=i?Ot:Pt,o=e[0].length,s=e.length,r=s,l=ke(s),c=1/0,u=[];r--;){var h=e[r];r&&t&&(h=Mt(h,Xt(t))),c=bn(h.length,c),l[r]=!i&&(t||o>=120&&h.length>=120)?new Yn(r&&h):n}h=e[0];var d=-1,f=l[0];e:for(;++d<o&&u.length<c;){var p=h[d],g=t?t(p):p;if(p=i||0!==p?p:0,!(f?Zt(f,g):a(u,g,i))){for(r=s;--r;){var m=l[r];if(!(m?Zt(m,g):a(e[r],g,i)))continue e}f&&f.push(g),u.push(p)}}return u}function Di(e,t,i){var a=null==(e=Io(e,t=ba(t,e)))?e:e[Bo(Zo(t))];return null==a?n:Ct(a,e,i)}function Pi(e){return ar(e)&&Ci(e)==m}function Oi(e,t,i,a,o){return e===t||(null==e||null==t||!ar(e)&&!ar(t)?e!=e&&t!=t:function(e,t,i,a,o,s){var r=Gs(e),l=Gs(t),c=r?v:go(e),u=l?v:go(t),h=(c=c==m?C:c)==C,d=(u=u==m?C:u)==C,f=c==u;if(f&&Xs(e)){if(!Xs(t))return!1;r=!0,h=!1}if(f&&!h)return s||(s=new Qn),r||dr(e)?to(e,t,i,a,o,s):function(e,t,n,i,a,o,s){switch(n){case M:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case O:return!(e.byteLength!=t.byteLength||!o(new We(e),new We(t)));case y:case b:case T:return Hs(+e,+t);case _:return e.name==t.name&&e.message==t.message;case S:case A:return e==t+"";case x:var r=rn;case I:var l=1&i;if(r||(r=un),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;i|=2,s.set(e,t);var u=to(r(e),r(t),i,a,o,s);return s.delete(e),u;case D:if(qn)return qn.call(e)==qn.call(t)}return!1}(e,t,c,i,a,o,s);if(!(1&i)){var p=h&&Le.call(e,"__wrapped__"),g=d&&Le.call(t,"__wrapped__");
vendor: 4,434 bytes, line 5555
5555if(p||g){var w=p?e.value():e,k=g?t.value():t;return s||(s=new Qn),o(w,k,i,a,s)}}if(!f)return!1;return s||(s=new Qn),function(e,t,i,a,o,s){var r=1&i,l=io(e),c=l.length,u=io(t),h=u.length;if(c!=h&&!r)return!1;var d=c;for(;d--;){var f=l[d];if(!(r?f in t:Le.call(t,f)))return!1}var p=s.get(e),g=s.get(t);if(p&&g)return p==t&&g==e;var m=!0;s.set(e,t),s.set(t,e);var v=r;for(;++d<c;){var y=e[f=l[d]],b=t[f];if(a)var _=r?a(b,y,f,t,e,s):a(y,b,f,e,t,s);if(!(_===n?y===b||o(y,b,i,a,s):_)){m=!1;break}v||(v="constructor"==f)}if(m&&!v){var w=e.constructor,k=t.constructor;w==k||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof k&&k instanceof k||(m=!1)}return s.delete(e),s.delete(t),m}(e,t,i,a,o,s)}(e,t,i,a,Oi,o))}function Mi(e,t,i,a){var o=i.length,s=o,r=!a;if(null==e)return!s;for(e=Se(e);o--;){var l=i[o];if(r&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var c=(l=i[o])[0],u=e[c],h=l[1];if(r&&l[2]){if(u===n&&!(c in e))return!1}else{var d=new Qn;if(a)var f=a(u,h,c,e,t,d);if(!(f===n?Oi(h,u,3,a,d):f))return!1}}return!0}function Ni(e){return!(!ir(e)||(t=e,qe&&qe in t))&&(er(e)?je:me).test(Uo(e));var t}function Ri(e){return"function"==typeof e?e:null==e?sl:"object"==typeof e?Gs(e)?Ui(e[0],e[1]):Bi(e):gl(e)}function Li(e){if(!To(e))return vn(e);var t=[];for(var n in Se(e))Le.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Vi(e){if(!ir(e))return function(e){var t=[];if(null!=e)for(var n in Se(e))t.push(n);return t}(e);var t=To(e),n=[];for(var i in e)("constructor"!=i||!t&&Le.call(e,i))&&n.push(i);return n}function qi(e,t){return e<t}function Fi(e,t){var n=-1,i=Qs(e)?ke(e.length):[];return di(e,function(e,a,o){i[++n]=t(e,a,o)}),i}function Bi(e){var t=uo(e);return 1==t.length&&t[0][2]?Eo(t[0][0],t[0][1]):function(n){return n===e||Mi(n,e,t)}}function Ui(e,t){return wo(e)&&Co(t)?Eo(Bo(e),t):function(i){var a=Ar(i,e);return a===n&&a===t?Dr(i,e):Oi(t,a,3)}}function ji(e,t,i,a,o){e!==t&&yi(t,function(s,r){if(o||(o=new Qn),ir(s))!function(e,t,i,a,o,s,r){var l=Ao(e,i),c=Ao(t,i),u=r.get(c);if(u)return void ei(e,i,u);var h=s?s(l,c,i+"",e,t,r):n,d=h===n;if(d){var f=Gs(c),p=!f&&Xs(c),g=!f&&!p&&dr(c);h=c,f||p||g?Gs(l)?h=l:$s(l)?h=Aa(l):p?(d=!1,h=xa(c,!0)):g?(d=!1,h=Ca(c,!0)):h=[]:rr(c)||Ks(c)?(h=l,Ks(l)?h=_r(l):ir(l)&&!er(l)||(h=vo(c))):d=!1}d&&(r.set(c,h),o(h,c,a,s,r),r.delete(c));ei(e,i,h)}(e,t,r,i,ji,a,o);else{var l=a?a(Ao(e,r),s,r+"",e,t,o):n;l===n&&(l=s),ei(e,r,l)}},Rr)}function Hi(e,t){var i=e.length;if(i)return bo(t+=t<0?i:0,i)?e[t]:n}function zi(e,t,n){t=t.length?Mt(t,function(e){return Gs(e)?function(t){return xi(t,1===e.length?e[0]:e)}:e}):[sl];var i=-1;return t=Mt(t,Xt(lo())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(Fi(e,function(e,n,a){return{criteria:Mt(t,function(t){return t(e)}),index:++i,value:e}}),function(e,t){return function(e,t,n){var i=-1,a=e.criteria,o=t.criteria,s=a.length,r=n.length;for(;++i<s;){var l=Ea(a[i],o[i]);if(l)return i>=r?l:l*("desc"==n[i]?-1:1)}return e.index-t.index}(e,t,n)})}function Wi(e,t,n){for(var i=-1,a=t.length,o={};++i<a;){var s=t[i],r=xi(e,s);n(r,s)&&Zi(o,ba(s,e),r)}return o}function Ki(e,t,n,i){var a=i?jt:Ut,o=-1,s=t.length,r=e;for(e===t&&(t=Aa(t)),n&&(r=Mt(e,Xt(n)));++o<s;)for(var l=0,c=t[o],u=n?n(c):c;(l=a(r,u,l,i))>-1;)r!==e&&$e.call(r,l,1),$e.call(e,l,1);return e}function Gi(e,t){for(var n=e?t.length:0,i=n-1;n--;){var a=t[n];if(n==i||a!==o){var o=a;bo(a)?$e.call(e,a,1):ha(e,a)}}return e}function Yi(e,t){return e+vt(kn()*(t-e+1))}function Qi(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=vt(t/2))&&(e+=e)}while(t);return n}function $i(e,t){return Oo(So(e,t,sl),e+"")}function Xi(e){return Xn(Hr(e))}function Ji(e,t){var n=Hr(e);return Ro(n,ri(t,0,n.length))}function Zi(e,t,i,a){if(!ir(e))return e;for(var o=-1,s=(t=ba(t,e)).length,r=s-1,l=e;null!=l&&++o<s;){var c=Bo(t[o]),u=i;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=r){var h=l[c];(u=a?a(h,c,l):n)===n&&(u=ir(h)?h:bo(t[o+1])?[]:{})}ti(l,c,u),l=l[c]}return e}var ea=Dn?function(e,t){return Dn.set(e,t),e}:sl,ta=lt?function(e,t){return lt(e,"toString",{configurable:!0,enumerable:!1,value:il(t),writable:!0})}:sl;function na(e){return Ro(Hr(e))}function ia(e,t,n){var i=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var o=ke(a);++i<a;)o[i]=e[i+t];return o}function aa(e,t){var n;return di(e,function(e,i,a){return!(n=t(e,i,a))}),!!n}
vendor: 40,091 bytes, line 5555
5555function oa(e,t,n){var i=0,a=null==e?i:e.length;if("number"==typeof t&&t==t&&a<=2147483647){for(;i<a;){var o=i+a>>>1,s=e[o];null!==s&&!hr(s)&&(n?s<=t:s<t)?i=o+1:a=o}return a}return sa(e,t,sl,n)}function sa(e,t,i,a){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var r=(t=i(t))!=t,l=null===t,c=hr(t),u=t===n;o<s;){var h=vt((o+s)/2),d=i(e[h]),f=d!==n,p=null===d,g=d==d,m=hr(d);if(r)var v=a||g;else v=u?g&&(a||f):l?g&&f&&(a||!p):c?g&&f&&!p&&(a||!m):!p&&!m&&(a?d<=t:d<t);v?o=h+1:s=h}return bn(s,4294967294)}function ra(e,t){for(var n=-1,i=e.length,a=0,o=[];++n<i;){var s=e[n],r=t?t(s):s;if(!n||!Hs(r,l)){var l=r;o[a++]=0===s?0:s}}return o}function la(e){return"number"==typeof e?e:hr(e)?f:+e}function ca(e){if("string"==typeof e)return e;if(Gs(e))return Mt(e,ca)+"";if(hr(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ua(e,t,n){var i=-1,a=Pt,o=e.length,s=!0,r=[],l=r;if(n)s=!1,a=Ot;else if(o>=200){var c=t?null:Qa(e);if(c)return un(c);s=!1,a=Zt,l=new Yn}else l=t?[]:r;e:for(;++i<o;){var u=e[i],h=t?t(u):u;if(u=n||0!==u?u:0,s&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),r.push(u)}else a(l,h,n)||(l!==r&&l.push(h),r.push(u))}return r}function ha(e,t){var n=-1,i=(t=ba(t,e)).length;if(!i)return!0;for(;++n<i;){var a=Bo(t[n]);if("__proto__"===a&&!Le.call(e,"__proto__"))return!1;if(("constructor"===a||"prototype"===a)&&n<i-1)return!1}var o=Io(e,t);return null==o||delete o[Bo(Zo(t))]}function da(e,t,n,i){return Zi(e,t,n(xi(e,t)),i)}function fa(e,t,n,i){for(var a=e.length,o=i?a:-1;(i?o--:++o<a)&&t(e[o],o,e););return n?ia(e,i?0:o,i?o+1:a):ia(e,i?o+1:0,i?a:o)}function pa(e,t){var n=e;return n instanceof zn&&(n=n.value()),Rt(t,function(e,t){return t.func.apply(t.thisArg,Nt([e],t.args))},n)}function ga(e,t,n){var i=e.length;if(i<2)return i?ua(e[0]):[];for(var a=-1,o=ke(i);++a<i;)for(var s=e[a],r=-1;++r<i;)r!=a&&(o[a]=hi(o[a]||s,e[r],t,n));return ua(vi(o,1),t,n)}function ma(e,t,i){for(var a=-1,o=e.length,s=t.length,r={};++a<o;){var l=a<s?t[a]:n;i(r,e[a],l)}return r}function va(e){return $s(e)?e:[]}function ya(e){return"function"==typeof e?e:sl}function ba(e,t){return Gs(e)?e:wo(e,t)?[e]:Fo(wr(e))}var _a=$i;function wa(e,t,i){var a=e.length;return i=i===n?a:i,!t&&i>=a?e:ia(e,t,i)}var ka=ht||function(e){return ft.clearTimeout(e)};function xa(e,t){if(t)return e.slice();var n=e.length,i=Ke?Ke(n):new e.constructor(n);return e.copy(i),i}function Ta(e){var t=new e.constructor(e.byteLength);return new We(t).set(new We(e)),t}function Ca(e,t){var n=t?Ta(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ea(e,t){if(e!==t){var i=e!==n,a=null===e,o=e==e,s=hr(e),r=t!==n,l=null===t,c=t==t,u=hr(t);if(!l&&!u&&!s&&e>t||s&&r&&c&&!l&&!u||a&&r&&c||!i&&c||!o)return 1;if(!a&&!s&&!u&&e<t||u&&i&&o&&!a&&!s||l&&i&&o||!r&&o||!c)return-1}return 0}function Sa(e,t,n,i){for(var a=-1,o=e.length,s=n.length,r=-1,l=t.length,c=yn(o-s,0),u=ke(l+c),h=!i;++r<l;)u[r]=t[r];for(;++a<s;)(h||a<o)&&(u[n[a]]=e[a]);for(;c--;)u[r++]=e[a++];return u}function Ia(e,t,n,i){for(var a=-1,o=e.length,s=-1,r=n.length,l=-1,c=t.length,u=yn(o-r,0),h=ke(u+c),d=!i;++a<u;)h[a]=e[a];for(var f=a;++l<c;)h[f+l]=t[l];for(;++s<r;)(d||a<o)&&(h[f+n[s]]=e[a++]);return h}function Aa(e,t){var n=-1,i=e.length;for(t||(t=ke(i));++n<i;)t[n]=e[n];return t}function Da(e,t,i,a){var o=!i;i||(i={});for(var s=-1,r=t.length;++s<r;){var l=t[s],c=a?a(i[l],e[l],l,i,e):n;c===n&&(c=e[l]),o?oi(i,l,c):ti(i,l,c)}return i}function Pa(e,t){return function(n,i){var a=Gs(n)?Et:ii,o=t?t():{};return a(n,e,lo(i,2),o)}}function Oa(e){return $i(function(t,i){var a=-1,o=i.length,s=o>1?i[o-1]:n,r=o>2?i[2]:n;for(s=e.length>3&&"function"==typeof s?(o--,s):n,r&&_o(i[0],i[1],r)&&(s=o<3?n:s,o=1),t=Se(t);++a<o;){var l=i[a];l&&e(t,l,a,s)}return t})}function Ma(e,t){return function(n,i){if(null==n)return n;if(!Qs(n))return e(n,i);for(var a=n.length,o=t?a:-1,s=Se(n);(t?o--:++o<a)&&!1!==i(s[o],o,s););return n}}function Na(e){return function(t,n,i){for(var a=-1,o=Se(t),s=i(t),r=s.length;r--;){var l=s[e?r:++a];if(!1===n(o[l],l,o))break}return t}}function Ra(e){return function(t){var i=sn(t=wr(t))?dn(t):n,a=i?i[0]:t.charAt(0),o=i?wa(i,1).join(""):t.slice(1);return a[e]()+o}}function La(e){return function(t){return Rt(el(Kr(t).replace(Je,"")),e,"")}}function Va(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Un(e.prototype),i=e.apply(n,t);return ir(i)?i:n}}function qa(e){return function(t,i,a){var o=Se(t);if(!Qs(t)){var s=lo(i,3);t=Nr(t),i=function(e){return s(o[e],e,o)}}var r=e(t,i,a);return r>-1?o[s?t[r]:r]:n}}function Fa(e){return no(function(t){var a=t.length,o=a,s=Hn.prototype.thru;for(e&&t.reverse();o--;){var r=t[o];if("function"!=typeof r)throw new De(i);if(s&&!l&&"wrapper"==so(r))var l=new Hn([],!0)}for(o=l?o:a;++o<a;){var c=so(r=t[o]),u="wrapper"==c?oo(r):n;l=u&&ko(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[so(u[0])].apply(l,u[3]):1==r.length&&ko(r)?l[c]():l.thru(r)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Gs(n))return l.plant(n).value();for(var i=0,o=a?t[i].apply(this,e):n;++i<a;)o=t[i].call(this,o);return o}})}function Ba(e,t,i,a,o,s,r,l,u,h){var d=t&c,f=1&t,p=2&t,g=24&t,m=512&t,v=p?n:Va(e);return function c(){for(var y=arguments.length,b=ke(y),_=y;_--;)b[_]=arguments[_];if(g)var w=ro(c),k=function(e,t){for(var n=e.length,i=0;n--;)e[n]===t&&++i;return i}(b,w);if(a&&(b=Sa(b,a,o,g)),s&&(b=Ia(b,s,r,g)),y-=k,g&&y<h){var x=cn(b,w);return Ga(e,t,Ba,c.placeholder,i,b,x,l,u,h-y)}var T=f?i:this,C=p?T[e]:e;return y=b.length,l?b=function(e,t){var i=e.length,a=bn(t.length,i),o=Aa(e);for(;a--;){var s=t[a];e[a]=bo(s,i)?o[s]:n}return e}(b,l):m&&y>1&&b.reverse(),d&&u<y&&(b.length=u),this&&this!==ft&&this instanceof c&&(C=v||Va(C)),C.apply(T,b)}}function Ua(e,t){return function(n,i){return function(e,t,n,i){return _i(e,function(e,a,o){t(i,n(e),a,o)}),i}(n,e,t(i),{})}}function ja(e,t){return function(i,a){var o;if(i===n&&a===n)return t;if(i!==n&&(o=i),a!==n){if(o===n)return a;"string"==typeof i||"string"==typeof a?(i=ca(i),a=ca(a)):(i=la(i),a=la(a)),o=e(i,a)}return o}}function Ha(e){return no(function(t){return t=Mt(t,Xt(lo())),$i(function(n){var i=this;return e(t,function(e){return Ct(e,i,n)})})})}function za(e,t){var i=(t=t===n?" ":ca(t)).length;if(i<2)return i?Qi(t,e):t;var a=Qi(t,gt(e/hn(t)));return sn(t)?wa(dn(a),0,e).join(""):a.slice(0,e)}function Wa(e){return function(t,i,a){return a&&"number"!=typeof a&&_o(t,i,a)&&(i=a=n),t=mr(t),i===n?(i=t,t=0):i=mr(i),function(e,t,n,i){for(var a=-1,o=yn(gt((t-e)/(n||1)),0),s=ke(o);o--;)s[i?o:++a]=e,e+=n;return s}(t,i,a=a===n?t<i?1:-1:mr(a),e)}}function Ka(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=br(t),n=br(n)),e(t,n)}}function Ga(e,t,i,a,o,s,c,u,h,d){var f=8&t;t|=f?r:l,4&(t&=~(f?l:r))||(t&=-4);var p=[e,t,o,f?s:n,f?c:n,f?n:s,f?n:c,u,h,d],g=i.apply(n,p);return ko(e)&&Do(g,p),g.placeholder=a,Mo(g,e,t)}function Ya(e){var t=Ee[e];return function(e,n){if(e=br(e),(n=null==n?0:bn(vr(n),292))&&Kt(e)){var i=(wr(e)+"e").split("e");return+((i=(wr(t(i[0]+"e"+(+i[1]+n)))+"e").split("e"))[0]+"e"+(+i[1]-n))}return t(e)}}var Qa=Sn&&1/un(new Sn([,-0]))[1]==h?function(e){return new Sn(e)}:hl;function $a(e){return function(t){var n=go(t);return n==x?rn(t):n==I?function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}(t):function(e,t){return Mt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Xa(e,t,a,h,d,f,p,g){var m=2&t;if(!m&&"function"!=typeof e)throw new De(i);var v=h?h.length:0;if(v||(t&=-97,h=d=n),p=p===n?p:yn(vr(p),0),g=g===n?g:vr(g),v-=d?d.length:0,t&l){var y=h,b=d;h=d=n}var _=m?n:oo(e),w=[e,t,a,h,d,y,b,f,p,g];if(_&&function(e,t){var n=e[1],i=t[1],a=n|i,s=a<131,r=i==c&&8==n||i==c&&n==u&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n;if(!s&&!r)return e;1&i&&(e[2]=t[2],a|=1&n?0:4);var l=t[3];if(l){var h=e[3];e[3]=h?Sa(h,l,t[4]):l,e[4]=h?cn(e[3],o):t[4]}(l=t[5])&&(h=e[5],e[5]=h?Ia(h,l,t[6]):l,e[6]=h?cn(e[5],o):t[6]);(l=t[7])&&(e[7]=l);i&c&&(e[8]=null==e[8]?t[8]:bn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=a}(w,_),e=w[0],t=w[1],a=w[2],h=w[3],d=w[4],!(g=w[9]=w[9]===n?m?0:e.length:yn(w[9]-v,0))&&24&t&&(t&=-25),t&&1!=t)k=8==t||t==s?function(e,t,i){var a=Va(e);return function o(){for(var s=arguments.length,r=ke(s),l=s,c=ro(o);l--;)r[l]=arguments[l];var u=s<3&&r[0]!==c&&r[s-1]!==c?[]:cn(r,c);return(s-=u.length)<i?Ga(e,t,Ba,o.placeholder,n,r,u,n,n,i-s):Ct(this&&this!==ft&&this instanceof o?a:e,this,r)}}(e,t,g):t!=r&&33!=t||d.length?Ba.apply(n,w):function(e,t,n,i){var a=1&t,o=Va(e);return function t(){for(var s=-1,r=arguments.length,l=-1,c=i.length,u=ke(c+r),h=this&&this!==ft&&this instanceof t?o:e;++l<c;)u[l]=i[l];for(;r--;)u[l++]=arguments[++s];return Ct(h,a?n:this,u)}}(e,t,a,h);else var k=function(e,t,n){var i=1&t,a=Va(e);return function t(){return(this&&this!==ft&&this instanceof t?a:e).apply(i?n:this,arguments)}}(e,t,a);return Mo((_?ea:Do)(k,w),e,t)}function Ja(e,t,i,a){return e===n||Hs(e,Me[i])&&!Le.call(a,i)?t:e}function Za(e,t,i,a,o,s){return ir(e)&&ir(t)&&(s.set(t,e),ji(e,t,n,Za,s),s.delete(t)),e}function eo(e){return rr(e)?n:e}function to(e,t,i,a,o,s){var r=1&i,l=e.length,c=t.length;if(l!=c&&!(r&&c>l))return!1;var u=s.get(e),h=s.get(t);if(u&&h)return u==t&&h==e;var d=-1,f=!0,p=2&i?new Yn:n;for(s.set(e,t),s.set(t,e);++d<l;){var g=e[d],m=t[d];if(a)var v=r?a(m,g,d,t,e,s):a(g,m,d,e,t,s);if(v!==n){if(v)continue;f=!1;break}if(p){if(!Vt(t,function(e,t){if(!Zt(p,t)&&(g===e||o(g,e,i,a,s)))return p.push(t)})){f=!1;break}}else if(g!==m&&!o(g,m,i,a,s)){f=!1;break}}return s.delete(e),s.delete(t),f}function no(e){return Oo(So(e,n,Yo),e+"")}function io(e){return Ti(e,Nr,fo)}function ao(e){return Ti(e,Rr,po)}var oo=Dn?function(e){return Dn.get(e)}:hl;function so(e){for(var t=e.name+"",n=Pn[t],i=Le.call(Pn,t)?n.length:0;i--;){var a=n[i],o=a.func;if(null==o||o==e)return a.name}return t}function ro(e){return(Le.call(Bn,"placeholder")?Bn:e).placeholder}function lo(){var e=Bn.iteratee||rl;return e=e===rl?Ri:e,arguments.length?e(arguments[0],arguments[1]):e}function co(e,t){var n,i,a=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function uo(e){for(var t=Nr(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,Co(a)]}return t}function ho(e,t){var i=function(e,t){return null==e?n:e[t]}(e,t);return Ni(i)?i:n}var fo=yt?function(e){return null==e?[]:(e=Se(e),Dt(yt(e),function(t){return Qe.call(e,t)}))}:yl,po=yt?function(e){for(var t=[];e;)Nt(t,fo(e)),e=Ge(e);return t}:yl,go=Ci;function mo(e,t,n){for(var i=-1,a=(t=ba(t,e)).length,o=!1;++i<a;){var s=Bo(t[i]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++i!=a?o:!!(a=null==e?0:e.length)&&nr(a)&&bo(s,a)&&(Gs(e)||Ks(e))}function vo(e){return"function"!=typeof e.constructor||To(e)?{}:Un(Ge(e))}function yo(e){return Gs(e)||Ks(e)||!!(Xe&&e&&e[Xe])}function bo(e,t){var n=typeof e;return!!(t=null==t?d:t)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function _o(e,t,n){if(!ir(n))return!1;var i=typeof t;return!!("number"==i?Qs(n)&&bo(t,n.length):"string"==i&&t in n)&&Hs(n[t],e)}function wo(e,t){if(Gs(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!hr(e))||(ee.test(e)||!Z.test(e)||null!=t&&e in Se(t))}function ko(e){var t=so(e),n=Bn[t];if("function"!=typeof n||!(t in zn.prototype))return!1;if(e===n)return!0;var i=oo(n);return!!i&&e===i[0]}(Tn&&go(new Tn(new ArrayBuffer(1)))!=M||Cn&&go(new Cn)!=x||En&&go(En.resolve())!=E||Sn&&go(new Sn)!=I||In&&go(new In)!=P)&&(go=function(e){var t=Ci(e),i=t==C?e.constructor:n,a=i?Uo(i):"";if(a)switch(a){case On:return M;case Mn:return x;case Nn:return E;case Rn:return I;case Ln:return P}return t});var xo=Ne?er:bl;function To(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Me)}function Co(e){return e==e&&!ir(e)}function Eo(e,t){return function(i){return null!=i&&(i[e]===t&&(t!==n||e in Se(i)))}}function So(e,t,i){return t=yn(t===n?e.length-1:t,0),function(){for(var n=arguments,a=-1,o=yn(n.length-t,0),s=ke(o);++a<o;)s[a]=n[t+a];a=-1;for(var r=ke(t+1);++a<t;)r[a]=n[a];return r[t]=i(s),Ct(e,this,r)}}function Io(e,t){return t.length<2?e:xi(e,ia(t,0,-1))}function Ao(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Do=No(ea),Po=pt||function(e,t){return ft.setTimeout(e,t)},Oo=No(ta);function Mo(e,t,n){var i=t+"";return Oo(e,function(e,t){var n=t.length;if(!n)return e;var i=n-1;return t[i]=(n>1?"& ":"")+t[i],t=t.join(n>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(i,function(e,t){return St(g,function(n){var i="_."+n[0];t&n[1]&&!Pt(e,i)&&e.push(i)}),e.sort()}(function(e){var t=e.match(re);return t?t[1].split(le):[]}(i),n)))}function No(e){var t=0,i=0;return function(){var a=_n(),o=16-(a-i);if(i=a,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Ro(e,t){var i=-1,a=e.length,o=a-1;for(t=t===n?a:t;++i<t;){var s=Yi(i,o),r=e[s];e[s]=e[i],e[i]=r}return e.length=t,e}var Lo,Vo,qo,Fo=(Lo=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(te,function(e,n,i,a){t.push(i?a.replace(he,"$1"):n||e)}),t},Vo=Vs(Lo,function(e){return 500===qo.size&&qo.clear(),e}),qo=Vo.cache,Vo);function Bo(e){if("string"==typeof e||hr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Uo(e){if(null!=e){try{return Re.call(e)}catch(ZNe){}try{return e+""}catch(ZNe){}}return""}function jo(e){if(e instanceof zn)return e.clone();var t=new Hn(e.__wrapped__,e.__chain__);return t.__actions__=Aa(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ho=$i(function(e,t){return $s(e)?hi(e,vi(t,1,$s,!0)):[]}),zo=$i(function(e,t){var i=Zo(t);return $s(i)&&(i=n),$s(e)?hi(e,vi(t,1,$s,!0),lo(i,2)):[]}),Wo=$i(function(e,t){var i=Zo(t);return $s(i)&&(i=n),$s(e)?hi(e,vi(t,1,$s,!0),n,i):[]});function Ko(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var a=null==n?0:vr(n);return a<0&&(a=yn(i+a,0)),Bt(e,lo(t,3),a)}function Go(e,t,i){var a=null==e?0:e.length;if(!a)return-1;var o=a-1;return i!==n&&(o=vr(i),o=i<0?yn(a+o,0):bn(o,a-1)),Bt(e,lo(t,3),o,!0)}function Yo(e){return(null==e?0:e.length)?vi(e,1):[]}function Qo(e){return e&&e.length?e[0]:n}var $o=$i(function(e){var t=Mt(e,va);return t.length&&t[0]===e[0]?Ai(t):[]}),Xo=$i(function(e){var t=Zo(e),i=Mt(e,va);return t===Zo(i)?t=n:i.pop(),i.length&&i[0]===e[0]?Ai(i,lo(t,2)):[]}),Jo=$i(function(e){var t=Zo(e),i=Mt(e,va);return(t="function"==typeof t?t:n)&&i.pop(),i.length&&i[0]===e[0]?Ai(i,n,t):[]});function Zo(e){var t=null==e?0:e.length;return t?e[t-1]:n}var es=$i(ts);function ts(e,t){return e&&e.length&&t&&t.length?Ki(e,t):e}var ns=no(function(e,t){var n=null==e?0:e.length,i=si(e,t);return Gi(e,Mt(t,function(e){return bo(e,n)?+e:e}).sort(Ea)),i});function is(e){return null==e?e:xn.call(e)}var as=$i(function(e){return ua(vi(e,1,$s,!0))}),os=$i(function(e){var t=Zo(e);return $s(t)&&(t=n),ua(vi(e,1,$s,!0),lo(t,2))}),ss=$i(function(e){var t=Zo(e);return t="function"==typeof t?t:n,ua(vi(e,1,$s,!0),n,t)});function rs(e){if(!e||!e.length)return[];var t=0;return e=Dt(e,function(e){if($s(e))return t=yn(e.length,t),!0}),Qt(t,function(t){return Mt(e,Wt(t))})}function ls(e,t){if(!e||!e.length)return[];var i=rs(e);return null==t?i:Mt(i,function(e){return Ct(t,n,e)})}var cs=$i(function(e,t){return $s(e)?hi(e,t):[]}),us=$i(function(e){return ga(Dt(e,$s))}),hs=$i(function(e){var t=Zo(e);return $s(t)&&(t=n),ga(Dt(e,$s),lo(t,2))}),ds=$i(function(e){var t=Zo(e);return t="function"==typeof t?t:n,ga(Dt(e,$s),n,t)}),fs=$i(rs);var ps=$i(function(e){var t=e.length,i=t>1?e[t-1]:n;return i="function"==typeof i?(e.pop(),i):n,ls(e,i)});function gs(e){var t=Bn(e);return t.__chain__=!0,t}function ms(e,t){return t(e)}var vs=no(function(e){var t=e.length,i=t?e[0]:0,a=this.__wrapped__,o=function(t){return si(t,e)};return!(t>1||this.__actions__.length)&&a instanceof zn&&bo(i)?((a=a.slice(i,+i+(t?1:0))).__actions__.push({func:ms,args:[o],thisArg:n}),new Hn(a,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(o)});var ys=Pa(function(e,t,n){Le.call(e,n)?++e[n]:oi(e,n,1)});var bs=qa(Ko),_s=qa(Go);function ws(e,t){return(Gs(e)?St:di)(e,lo(t,3))}function ks(e,t){return(Gs(e)?It:fi)(e,lo(t,3))}var xs=Pa(function(e,t,n){Le.call(e,n)?e[n].push(t):oi(e,n,[t])});var Ts=$i(function(e,t,n){var i=-1,a="function"==typeof t,o=Qs(e)?ke(e.length):[];return di(e,function(e){o[++i]=a?Ct(t,e,n):Di(e,t,n)}),o}),Cs=Pa(function(e,t,n){oi(e,n,t)});function Es(e,t){return(Gs(e)?Mt:Fi)(e,lo(t,3))}var Ss=Pa(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});var Is=$i(function(e,t){if(null==e)return[];var n=t.length;return n>1&&_o(e,t[0],t[1])?t=[]:n>2&&_o(t[0],t[1],t[2])&&(t=[t[0]]),zi(e,vi(t,1),[])}),As=dt||function(){return ft.Date.now()};function Ds(e,t,i){return t=i?n:t,t=e&&null==t?e.length:t,Xa(e,c,n,n,n,n,t)}function Ps(e,t){var a;if("function"!=typeof t)throw new De(i);return e=vr(e),function(){return--e>0&&(a=t.apply(this,arguments)),e<=1&&(t=n),a}}var Os=$i(function(e,t,n){var i=1;if(n.length){var a=cn(n,ro(Os));i|=r}return Xa(e,i,t,n,a)}),Ms=$i(function(e,t,n){var i=3;if(n.length){var a=cn(n,ro(Ms));i|=r}return Xa(t,i,e,n,a)});function Ns(e,t,a){var o,s,r,l,c,u,h=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new De(i);function g(t){var i=o,a=s;return o=s=n,h=t,l=e.apply(a,i)}function m(e){var i=e-u;return u===n||i>=t||i<0||f&&e-h>=r}function v(){var e=As();if(m(e))return y(e);c=Po(v,function(e){var n=t-(e-u);return f?bn(n,r-(e-h)):n}(e))}function y(e){return c=n,p&&o?g(e):(o=s=n,l)}function b(){var e=As(),i=m(e);if(o=arguments,s=this,u=e,i){if(c===n)return function(e){return h=e,c=Po(v,t),d?g(e):l}(u);if(f)return ka(c),c=Po(v,t),g(u)}return c===n&&(c=Po(v,t)),l}return t=br(t)||0,ir(a)&&(d=!!a.leading,r=(f="maxWait"in a)?yn(br(a.maxWait)||0,t):r,p="trailing"in a?!!a.trailing:p),b.cancel=function(){c!==n&&ka(c),h=0,o=u=s=c=n},b.flush=function(){return c===n?l:y(As())},b}var Rs=$i(function(e,t){return ui(e,1,t)}),Ls=$i(function(e,t,n){return ui(e,br(t)||0,n)});function Vs(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new De(i);var n=function(){var i=arguments,a=t?t.apply(this,i):i[0],o=n.cache;if(o.has(a))return o.get(a);var s=e.apply(this,i);return n.cache=o.set(a,s)||o,s};return n.cache=new(Vs.Cache||Gn),n}function qs(e){if("function"!=typeof e)throw new De(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Vs.Cache=Gn;var Fs=_a(function(e,t){var n=(t=1==t.length&&Gs(t[0])?Mt(t[0],Xt(lo())):Mt(vi(t,1),Xt(lo()))).length;return $i(function(i){for(var a=-1,o=bn(i.length,n);++a<o;)i[a]=t[a].call(this,i[a]);return Ct(e,this,i)})}),Bs=$i(function(e,t){var i=cn(t,ro(Bs));return Xa(e,r,n,t,i)}),Us=$i(function(e,t){var i=cn(t,ro(Us));return Xa(e,l,n,t,i)}),js=no(function(e,t){return Xa(e,u,n,n,n,t)});function Hs(e,t){return e===t||e!=e&&t!=t}var zs=Ka(Ei),Ws=Ka(function(e,t){return e>=t}),Ks=Pi(function(){return arguments}())?Pi:function(e){return ar(e)&&Le.call(e,"callee")&&!Qe.call(e,"callee")},Gs=ke.isArray,Ys=bt?Xt(bt):function(e){return ar(e)&&Ci(e)==O};function Qs(e){return null!=e&&nr(e.length)&&!er(e)}function $s(e){return ar(e)&&Qs(e)}var Xs=qt||bl,Js=_t?Xt(_t):function(e){return ar(e)&&Ci(e)==b};function Zs(e){if(!ar(e))return!1;var t=Ci(e);return t==_||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!rr(e)}function er(e){if(!ir(e))return!1;var t=Ci(e);return t==w||t==k||"[object AsyncFunction]"==t||"[object Proxy]"==t}function tr(e){return"number"==typeof e&&e==vr(e)}function nr(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function ir(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ar(e){return null!=e&&"object"==typeof e}var or=wt?Xt(wt):function(e){return ar(e)&&go(e)==x};function sr(e){return"number"==typeof e||ar(e)&&Ci(e)==T}function rr(e){if(!ar(e)||Ci(e)!=C)return!1;var t=Ge(e);if(null===t)return!0;var n=Le.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Re.call(n)==Be}var lr=kt?Xt(kt):function(e){return ar(e)&&Ci(e)==S};var cr=xt?Xt(xt):function(e){return ar(e)&&go(e)==I};function ur(e){return"string"==typeof e||!Gs(e)&&ar(e)&&Ci(e)==A}function hr(e){return"symbol"==typeof e||ar(e)&&Ci(e)==D}var dr=Tt?Xt(Tt):function(e){return ar(e)&&nr(e.length)&&!!st[Ci(e)]};var fr=Ka(qi),pr=Ka(function(e,t){return e<=t});function gr(e){if(!e)return[];if(Qs(e))return ur(e)?dn(e):Aa(e);if(et&&e[et])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[et]());var t=go(e);return(t==x?rn:t==I?un:Hr)(e)}function mr(e){return e?(e=br(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function vr(e){var t=mr(e),n=t%1;return t==t?n?t-n:t:0}function yr(e){return e?ri(vr(e),0,p):0}function br(e){if("number"==typeof e)return e;if(hr(e))return f;if(ir(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ir(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=$t(e);var n=ge.test(e);return n||ve.test(e)?ut(e.slice(2),n?2:8):pe.test(e)?f:+e}function _r(e){return Da(e,Rr(e))}function wr(e){return null==e?"":ca(e)}var kr=Oa(function(e,t){if(To(t)||Qs(t))Da(t,Nr(t),e);else for(var n in t)Le.call(t,n)&&ti(e,n,t[n])}),xr=Oa(function(e,t){Da(t,Rr(t),e)}),Tr=Oa(function(e,t,n,i){Da(t,Rr(t),e,i)}),Cr=Oa(function(e,t,n,i){Da(t,Nr(t),e,i)}),Er=no(si);var Sr=$i(function(e,t){e=Se(e);var i=-1,a=t.length,o=a>2?t[2]:n;for(o&&_o(t[0],t[1],o)&&(a=1);++i<a;)for(var s=t[i],r=Rr(s),l=-1,c=r.length;++l<c;){var u=r[l],h=e[u];(h===n||Hs(h,Me[u])&&!Le.call(e,u))&&(e[u]=s[u])}return e}),Ir=$i(function(e){return e.push(n,Za),Ct(Vr,n,e)});function Ar(e,t,i){var a=null==e?n:xi(e,t);return a===n?i:a}function Dr(e,t){return null!=e&&mo(e,t,Ii)}var Pr=Ua(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Fe.call(t)),e[t]=n},il(sl)),Or=Ua(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Fe.call(t)),Le.call(e,t)?e[t].push(n):e[t]=[n]},lo),Mr=$i(Di);function Nr(e){return Qs(e)?$n(e):Li(e)}function Rr(e){return Qs(e)?$n(e,!0):Vi(e)}var Lr=Oa(function(e,t,n){ji(e,t,n)}),Vr=Oa(function(e,t,n,i){ji(e,t,n,i)}),qr=no(function(e,t){var n={};if(null==e)return n;var i=!1;t=Mt(t,function(t){return t=ba(t,e),i||(i=t.length>1),t}),Da(e,ao(e),n),i&&(n=li(n,7,eo));for(var a=t.length;a--;)ha(n,t[a]);return n});var Fr=no(function(e,t){return null==e?{}:function(e,t){return Wi(e,t,function(t,n){return Dr(e,n)})}(e,t)});function Br(e,t){if(null==e)return{};var n=Mt(ao(e),function(e){return[e]});return t=lo(t),Wi(e,n,function(e,n){return t(e,n[0])})}var Ur=$a(Nr),jr=$a(Rr);function Hr(e){return null==e?[]:Jt(e,Nr(e))}var zr=La(function(e,t,n){return t=t.toLowerCase(),e+(n?Wr(t):t)});function Wr(e){return Zr(wr(e).toLowerCase())}function Kr(e){return(e=wr(e))&&e.replace(be,nn).replace(Ze,"")}var Gr=La(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Yr=La(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Qr=Ra("toLowerCase");var $r=La(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});var Xr=La(function(e,t,n){return e+(n?" ":"")+Zr(t)});var Jr=La(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Zr=Ra("toUpperCase");function el(e,t,i){return e=wr(e),(t=i?n:t)===n?function(e){return it.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var tl=$i(function(e,t){try{return Ct(e,n,t)}catch(ZNe){return Zs(ZNe)?ZNe:new Te(ZNe)}}),nl=no(function(e,t){return St(t,function(t){t=Bo(t),oi(e,t,Os(e[t],e))}),e});function il(e){return function(){return e}}var al=Fa(),ol=Fa(!0);function sl(e){return e}function rl(e){return Ri("function"==typeof e?e:li(e,1))}var ll=$i(function(e,t){return function(n){return Di(n,e,t)}}),cl=$i(function(e,t){return function(n){return Di(e,n,t)}});function ul(e,t,n){var i=Nr(t),a=ki(t,i);null!=n||ir(t)&&(a.length||!i.length)||(n=t,t=e,e=this,a=ki(t,Nr(t)));var o=!(ir(n)&&"chain"in n&&!n.chain),s=er(e);return St(a,function(n){var i=t[n];e[n]=i,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Aa(this.__actions__)).push({func:i,args:arguments,thisArg:e}),n.__chain__=t,n}return i.apply(e,Nt([this.value()],arguments))})}),e}function hl(){}var dl=Ha(Mt),fl=Ha(At),pl=Ha(Vt);function gl(e){return wo(e)?Wt(Bo(e)):function(e){return function(t){return xi(t,e)}}(e)}var ml=Wa(),vl=Wa(!0);function yl(){return[]}function bl(){return!1}var _l=ja(function(e,t){return e+t},0),wl=Ya("ceil"),kl=ja(function(e,t){return e/t},1),xl=Ya("floor");var Tl,Cl=ja(function(e,t){return e*t},1),El=Ya("round"),Sl=ja(function(e,t){return e-t},0);return Bn.after=function(e,t){if("function"!=typeof t)throw new De(i);return e=vr(e),function(){if(--e<1)return t.apply(this,arguments)}},Bn.ary=Ds,Bn.assign=kr,Bn.assignIn=xr,Bn.assignInWith=Tr,Bn.assignWith=Cr,Bn.at=Er,Bn.before=Ps,Bn.bind=Os,Bn.bindAll=nl,Bn.bindKey=Ms,Bn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Gs(e)?e:[e]},Bn.chain=gs,Bn.chunk=function(e,t,i){t=(i?_o(e,t,i):t===n)?1:yn(vr(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var o=0,s=0,r=ke(gt(a/t));o<a;)r[s++]=ia(e,o,o+=t);return r},Bn.compact=function(e){for(var t=-1,n=null==e?0:e.length,i=0,a=[];++t<n;){var o=e[t];o&&(a[i++]=o)}return a},Bn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=ke(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Nt(Gs(n)?Aa(n):[n],vi(t,1))},Bn.cond=function(e){var t=null==e?0:e.length,n=lo();return e=t?Mt(e,function(e){if("function"!=typeof e[1])throw new De(i);return[n(e[0]),e[1]]}):[],$i(function(n){for(var i=-1;++i<t;){var a=e[i];if(Ct(a[0],this,n))return Ct(a[1],this,n)}})},Bn.conforms=function(e){return function(e){var t=Nr(e);return function(n){return ci(n,e,t)}}(li(e,1))},Bn.constant=il,Bn.countBy=ys,Bn.create=function(e,t){var n=Un(e);return null==t?n:ai(n,t)},Bn.curry=function e(t,i,a){var o=Xa(t,8,n,n,n,n,n,i=a?n:i);return o.placeholder=e.placeholder,o},Bn.curryRight=function e(t,i,a){var o=Xa(t,s,n,n,n,n,n,i=a?n:i);return o.placeholder=e.placeholder,o},Bn.debounce=Ns,Bn.defaults=Sr,Bn.defaultsDeep=Ir,Bn.defer=Rs,Bn.delay=Ls,Bn.difference=Ho,Bn.differenceBy=zo,Bn.differenceWith=Wo,Bn.drop=function(e,t,i){var a=null==e?0:e.length;return a?ia(e,(t=i||t===n?1:vr(t))<0?0:t,a):[]},Bn.dropRight=function(e,t,i){var a=null==e?0:e.length;return a?ia(e,0,(t=a-(t=i||t===n?1:vr(t)))<0?0:t):[]},Bn.dropRightWhile=function(e,t){return e&&e.length?fa(e,lo(t,3),!0,!0):[]},Bn.dropWhile=function(e,t){return e&&e.length?fa(e,lo(t,3),!0):[]},Bn.fill=function(e,t,i,a){var o=null==e?0:e.length;return o?(i&&"number"!=typeof i&&_o(e,t,i)&&(i=0,a=o),function(e,t,i,a){var o=e.length;for((i=vr(i))<0&&(i=-i>o?0:o+i),(a=a===n||a>o?o:vr(a))<0&&(a+=o),a=i>a?0:yr(a);i<a;)e[i++]=t;return e}(e,t,i,a)):[]},Bn.filter=function(e,t){return(Gs(e)?Dt:mi)(e,lo(t,3))},Bn.flatMap=function(e,t){return vi(Es(e,t),1)},Bn.flatMapDeep=function(e,t){return vi(Es(e,t),h)},Bn.flatMapDepth=function(e,t,i){return i=i===n?1:vr(i),vi(Es(e,t),i)},Bn.flatten=Yo,Bn.flattenDeep=function(e){return(null==e?0:e.length)?vi(e,h):[]},Bn.flattenDepth=function(e,t){return(null==e?0:e.length)?vi(e,t=t===n?1:vr(t)):[]},Bn.flip=function(e){return Xa(e,512)},Bn.flow=al,Bn.flowRight=ol,Bn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,i={};++t<n;){var a=e[t];oi(i,a[0],a[1])}return i},Bn.functions=function(e){return null==e?[]:ki(e,Nr(e))},Bn.functionsIn=function(e){return null==e?[]:ki(e,Rr(e))},Bn.groupBy=xs,Bn.initial=function(e){return(null==e?0:e.length)?ia(e,0,-1):[]},Bn.intersection=$o,Bn.intersectionBy=Xo,Bn.intersectionWith=Jo,Bn.invert=Pr,Bn.invertBy=Or,Bn.invokeMap=Ts,Bn.iteratee=rl,Bn.keyBy=Cs,Bn.keys=Nr,Bn.keysIn=Rr,Bn.map=Es,Bn.mapKeys=function(e,t){var n={};return t=lo(t,3),_i(e,function(e,i,a){oi(n,t(e,i,a),e)}),n},Bn.mapValues=function(e,t){var n={};return t=lo(t,3),_i(e,function(e,i,a){oi(n,i,t(e,i,a))}),n},Bn.matches=function(e){return Bi(li(e,1))},Bn.matchesProperty=function(e,t){return Ui(e,li(t,1))},Bn.memoize=Vs,Bn.merge=Lr,Bn.mergeWith=Vr,Bn.method=ll,Bn.methodOf=cl,Bn.mixin=ul,Bn.negate=qs,Bn.nthArg=function(e){return e=vr(e),$i(function(t){return Hi(t,e)})},Bn.omit=qr,Bn.omitBy=function(e,t){return Br(e,qs(lo(t)))},Bn.once=function(e){return Ps(2,e)},Bn.orderBy=function(e,t,i,a){return null==e?[]:(Gs(t)||(t=null==t?[]:[t]),Gs(i=a?n:i)||(i=null==i?[]:[i]),zi(e,t,i))},Bn.over=dl,Bn.overArgs=Fs,Bn.overEvery=fl,Bn.overSome=pl,Bn.partial=Bs,Bn.partialRight=Us,Bn.partition=Ss,Bn.pick=Fr,Bn.pickBy=Br,Bn.property=gl,Bn.propertyOf=function(e){return function(t){return null==e?n:xi(e,t)}},Bn.pull=es,Bn.pullAll=ts,Bn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ki(e,t,lo(n,2)):e},Bn.pullAllWith=function(e,t,i){return e&&e.length&&t&&t.length?Ki(e,t,n,i):e},Bn.pullAt=ns,Bn.range=ml,Bn.rangeRight=vl,Bn.rearg=js,Bn.reject=function(e,t){return(Gs(e)?Dt:mi)(e,qs(lo(t,3)))},Bn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var i=-1,a=[],o=e.length;for(t=lo(t,3);++i<o;){var s=e[i];t(s,i,e)&&(n.push(s),a.push(i))}return Gi(e,a),n},Bn.rest=function(e,t){if("function"!=typeof e)throw new De(i);return $i(e,t=t===n?t:vr(t))},Bn.reverse=is,Bn.sampleSize=function(e,t,i){return t=(i?_o(e,t,i):t===n)?1:vr(t),(Gs(e)?Jn:Ji)(e,t)},Bn.set=function(e,t,n){return null==e?e:Zi(e,t,n)},Bn.setWith=function(e,t,i,a){return a="function"==typeof a?a:n,null==e?e:Zi(e,t,i,a)},Bn.shuffle=function(e){return(Gs(e)?Zn:na)(e)},Bn.slice=function(e,t,i){var a=null==e?0:e.length;return a?(i&&"number"!=typeof i&&_o(e,t,i)?(t=0,i=a):(t=null==t?0:vr(t),i=i===n?a:vr(i)),ia(e,t,i)):[]},Bn.sortBy=Is,Bn.sortedUniq=function(e){return e&&e.length?ra(e):[]},Bn.sortedUniqBy=function(e,t){return e&&e.length?ra(e,lo(t,2)):[]},Bn.split=function(e,t,i){return i&&"number"!=typeof i&&_o(e,t,i)&&(t=i=n),(i=i===n?p:i>>>0)?(e=wr(e))&&("string"==typeof t||null!=t&&!lr(t))&&!(t=ca(t))&&sn(e)?wa(dn(e),0,i):e.split(t,i):[]},Bn.spread=function(e,t){if("function"!=typeof e)throw new De(i);return t=null==t?0:yn(vr(t),0),$i(function(n){var i=n[t],a=wa(n,0,t);return i&&Nt(a,i),Ct(e,this,a)})},Bn.tail=function(e){var t=null==e?0:e.length;return t?ia(e,1,t):[]},Bn.take=function(e,t,i){return e&&e.length?ia(e,0,(t=i||t===n?1:vr(t))<0?0:t):[]},Bn.takeRight=function(e,t,i){var a=null==e?0:e.length;return a?ia(e,(t=a-(t=i||t===n?1:vr(t)))<0?0:t,a):[]},Bn.takeRightWhile=function(e,t){return e&&e.length?fa(e,lo(t,3),!1,!0):[]},Bn.takeWhile=function(e,t){return e&&e.length?fa(e,lo(t,3)):[]},Bn.tap=function(e,t){return t(e),e},Bn.throttle=function(e,t,n){var a=!0,o=!0;if("function"!=typeof e)throw new De(i);return ir(n)&&(a="leading"in n?!!n.leading:a,o="trailing"in n?!!n.trailing:o),Ns(e,t,{leading:a,maxWait:t,trailing:o})},Bn.thru=ms,Bn.toArray=gr,Bn.toPairs=Ur,Bn.toPairsIn=jr,Bn.toPath=function(e){return Gs(e)?Mt(e,Bo):hr(e)?[e]:Aa(Fo(wr(e)))},Bn.toPlainObject=_r,Bn.transform=function(e,t,n){var i=Gs(e),a=i||Xs(e)||dr(e);if(t=lo(t,4),null==n){var o=e&&e.constructor;n=a?i?new o:[]:ir(e)&&er(o)?Un(Ge(e)):{}}return(a?St:_i)(e,function(e,i,a){return t(n,e,i,a)}),n},Bn.unary=function(e){return Ds(e,1)},Bn.union=as,Bn.unionBy=os,Bn.unionWith=ss,Bn.uniq=function(e){return e&&e.length?ua(e):[]},Bn.uniqBy=function(e,t){return e&&e.length?ua(e,lo(t,2)):[]},Bn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ua(e,n,t):[]},Bn.unset=function(e,t){return null==e||ha(e,t)},Bn.unzip=rs,Bn.unzipWith=ls,Bn.update=function(e,t,n){return null==e?e:da(e,t,ya(n))},Bn.updateWith=function(e,t,i,a){return a="function"==typeof a?a:n,null==e?e:da(e,t,ya(i),a)},Bn.values=Hr,Bn.valuesIn=function(e){return null==e?[]:Jt(e,Rr(e))},Bn.without=cs,Bn.words=el,Bn.wrap=function(e,t){return Bs(ya(t),e)},Bn.xor=us,Bn.xorBy=hs,Bn.xorWith=ds,Bn.zip=fs,Bn.zipObject=function(e,t){return ma(e||[],t||[],ti)},Bn.zipObjectDeep=function(e,t){return ma(e||[],t||[],Zi)},Bn.zipWith=ps,Bn.entries=Ur,Bn.entriesIn=jr,Bn.extend=xr,Bn.extendWith=Tr,ul(Bn,Bn),Bn.add=_l,Bn.attempt=tl,Bn.camelCase=zr,Bn.capitalize=Wr,Bn.ceil=wl,Bn.clamp=function(e,t,i){return i===n&&(i=t,t=n),i!==n&&(i=(i=br(i))==i?i:0),t!==n&&(t=(t=br(t))==t?t:0),ri(br(e),t,i)},Bn.clone=function(e){return li(e,4)},Bn.cloneDeep=function(e){return li(e,5)},Bn.cloneDeepWith=function(e,t){return li(e,5,t="function"==typeof t?t:n)},Bn.cloneWith=function(e,t){return li(e,4,t="function"==typeof t?t:n)},Bn.conformsTo=function(e,t){return null==t||ci(e,t,Nr(t))},Bn.deburr=Kr,Bn.defaultTo=function(e,t){return null==e||e!=e?t:e},Bn.divide=kl,Bn.endsWith=function(e,t,i){e=wr(e),t=ca(t);var a=e.length,o=i=i===n?a:ri(vr(i),0,a);return(i-=t.length)>=0&&e.slice(i,o)==t},Bn.eq=Hs,Bn.escape=function(e){return(e=wr(e))&&Q.test(e)?e.replace(G,an):e},Bn.escapeRegExp=function(e){return(e=wr(e))&&ie.test(e)?e.replace(ne,"\\$&"):e},Bn.every=function(e,t,i){var a=Gs(e)?At:pi;return i&&_o(e,t,i)&&(t=n),a(e,lo(t,3))},Bn.find=bs,Bn.findIndex=Ko,Bn.findKey=function(e,t){return Ft(e,lo(t,3),_i)},Bn.findLast=_s,Bn.findLastIndex=Go,Bn.findLastKey=function(e,t){return Ft(e,lo(t,3),wi)},Bn.floor=xl,Bn.forEach=ws,Bn.forEachRight=ks,Bn.forIn=function(e,t){return null==e?e:yi(e,lo(t,3),Rr)},Bn.forInRight=function(e,t){return null==e?e:bi(e,lo(t,3),Rr)},Bn.forOwn=function(e,t){return e&&_i(e,lo(t,3))},Bn.forOwnRight=function(e,t){return e&&wi(e,lo(t,3))},Bn.get=Ar,Bn.gt=zs,Bn.gte=Ws,Bn.has=function(e,t){return null!=e&&mo(e,t,Si)},Bn.hasIn=Dr,Bn.head=Qo,Bn.identity=sl,Bn.includes=function(e,t,n,i){e=Qs(e)?e:Hr(e),n=n&&!i?vr(n):0;var a=e.length;return n<0&&(n=yn(a+n,0)),ur(e)?n<=a&&e.indexOf(t,n)>-1:!!a&&Ut(e,t,n)>-1},Bn.indexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var a=null==n?0:vr(n);return a<0&&(a=yn(i+a,0)),Ut(e,t,a)},Bn.inRange=function(e,t,i){return t=mr(t),i===n?(i=t,t=0):i=mr(i),function(e,t,n){return e>=bn(t,n)&&e<yn(t,n)}(e=br(e),t,i)},Bn.invoke=Mr,Bn.isArguments=Ks,Bn.isArray=Gs,Bn.isArrayBuffer=Ys,Bn.isArrayLike=Qs,Bn.isArrayLikeObject=$s,Bn.isBoolean=function(e){return!0===e||!1===e||ar(e)&&Ci(e)==y},Bn.isBuffer=Xs,Bn.isDate=Js,Bn.isElement=function(e){return ar(e)&&1===e.nodeType&&!rr(e)},Bn.isEmpty=function(e){if(null==e)return!0;if(Qs(e)&&(Gs(e)||"string"==typeof e||"function"==typeof e.splice||Xs(e)||dr(e)||Ks(e)))return!e.length;var t=go(e);if(t==x||t==I)return!e.size;if(To(e))return!Li(e).length;for(var n in e)if(Le.call(e,n))return!1;return!0},Bn.isEqual=function(e,t){return Oi(e,t)},Bn.isEqualWith=function(e,t,i){var a=(i="function"==typeof i?i:n)?i(e,t):n;return a===n?Oi(e,t,n,i):!!a},Bn.isError=Zs,Bn.isFinite=function(e){return"number"==typeof e&&Kt(e)},Bn.isFunction=er,Bn.isInteger=tr,Bn.isLength=nr,Bn.isMap=or,Bn.isMatch=function(e,t){return e===t||Mi(e,t,uo(t))},Bn.isMatchWith=function(e,t,i){return i="function"==typeof i?i:n,Mi(e,t,uo(t),i)},Bn.isNaN=function(e){return sr(e)&&e!=+e},Bn.isNative=function(e){if(xo(e))throw new Te("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ni(e)},Bn.isNil=function(e){return null==e},Bn.isNull=function(e){return null===e},Bn.isNumber=sr,Bn.isObject=ir,Bn.isObjectLike=ar,Bn.isPlainObject=rr,Bn.isRegExp=lr,Bn.isSafeInteger=function(e){return tr(e)&&e>=-9007199254740991&&e<=d},Bn.isSet=cr,Bn.isString=ur,Bn.isSymbol=hr,Bn.isTypedArray=dr,Bn.isUndefined=function(e){return e===n},Bn.isWeakMap=function(e){return ar(e)&&go(e)==P},Bn.isWeakSet=function(e){return ar(e)&&"[object WeakSet]"==Ci(e)},Bn.join=function(e,t){return null==e?"":mn.call(e,t)},Bn.kebabCase=Gr,Bn.last=Zo,Bn.lastIndexOf=function(e,t,i){var a=null==e?0:e.length;if(!a)return-1;var o=a;return i!==n&&(o=(o=vr(i))<0?yn(a+o,0):bn(o,a-1)),t==t?function(e,t,n){for(var i=n+1;i--;)if(e[i]===t)return i;return i}(e,t,o):Bt(e,Ht,o,!0)},Bn.lowerCase=Yr,Bn.lowerFirst=Qr,Bn.lt=fr,Bn.lte=pr,Bn.max=function(e){return e&&e.length?gi(e,sl,Ei):n},Bn.maxBy=function(e,t){return e&&e.length?gi(e,lo(t,2),Ei):n},Bn.mean=function(e){return zt(e,sl)},Bn.meanBy=function(e,t){return zt(e,lo(t,2))},Bn.min=function(e){return e&&e.length?gi(e,sl,qi):n},Bn.minBy=function(e,t){return e&&e.length?gi(e,lo(t,2),qi):n},Bn.stubArray=yl,Bn.stubFalse=bl,Bn.stubObject=function(){return{}},Bn.stubString=function(){return""},Bn.stubTrue=function(){return!0},Bn.multiply=Cl,Bn.nth=function(e,t){return e&&e.length?Hi(e,vr(t)):n},Bn.noConflict=function(){return ft._===this&&(ft._=Ue),this},Bn.noop=hl,Bn.now=As,Bn.pad=function(e,t,n){e=wr(e);var i=(t=vr(t))?hn(e):0;if(!t||i>=t)return e;var a=(t-i)/2;return za(vt(a),n)+e+za(gt(a),n)},Bn.padEnd=function(e,t,n){e=wr(e);var i=(t=vr(t))?hn(e):0;return t&&i<t?e+za(t-i,n):e},Bn.padStart=function(e,t,n){e=wr(e);var i=(t=vr(t))?hn(e):0;return t&&i<t?za(t-i,n)+e:e},Bn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),wn(wr(e).replace(ae,""),t||0)},Bn.random=function(e,t,i){if(i&&"boolean"!=typeof i&&_o(e,t,i)&&(t=i=n),i===n&&("boolean"==typeof t?(i=t,t=n):"boolean"==typeof e&&(i=e,e=n)),e===n&&t===n?(e=0,t=1):(e=mr(e),t===n?(t=e,e=0):t=mr(t)),e>t){var a=e;e=t,t=a}if(i||e%1||t%1){var o=kn();return bn(e+o*(t-e+ct("1e-"+((o+"").length-1))),t)}return Yi(e,t)},Bn.reduce=function(e,t,n){var i=Gs(e)?Rt:Gt,a=arguments.length<3;return i(e,lo(t,4),n,a,di)},Bn.reduceRight=function(e,t,n){var i=Gs(e)?Lt:Gt,a=arguments.length<3;return i(e,lo(t,4),n,a,fi)},Bn.repeat=function(e,t,i){return t=(i?_o(e,t,i):t===n)?1:vr(t),Qi(wr(e),t)},Bn.replace=function(){var e=arguments,t=wr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Bn.result=function(e,t,i){var a=-1,o=(t=ba(t,e)).length;for(o||(o=1,e=n);++a<o;){var s=null==e?n:e[Bo(t[a])];s===n&&(a=o,s=i),e=er(s)?s.call(e):s}return e},Bn.round=El,Bn.runInContext=e,Bn.sample=function(e){return(Gs(e)?Xn:Xi)(e)},Bn.size=function(e){if(null==e)return 0;if(Qs(e))return ur(e)?hn(e):e.length;var t=go(e);return t==x||t==I?e.size:Li(e).length},Bn.snakeCase=$r,Bn.some=function(e,t,i){var a=Gs(e)?Vt:aa;return i&&_o(e,t,i)&&(t=n),a(e,lo(t,3))},Bn.sortedIndex=function(e,t){return oa(e,t)},Bn.sortedIndexBy=function(e,t,n){return sa(e,t,lo(n,2))},Bn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var i=oa(e,t);if(i<n&&Hs(e[i],t))return i}return-1},Bn.sortedLastIndex=function(e,t){return oa(e,t,!0)},Bn.sortedLastIndexBy=function(e,t,n){return sa(e,t,lo(n,2),!0)},Bn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=oa(e,t,!0)-1;if(Hs(e[n],t))return n}return-1},Bn.startCase=Xr,Bn.startsWith=function(e,t,n){return e=wr(e),n=null==n?0:ri(vr(n),0,e.length),t=ca(t),e.slice(n,n+t.length)==t},Bn.subtract=Sl,Bn.sum=function(e){return e&&e.length?Yt(e,sl):0},Bn.sumBy=function(e,t){return e&&e.length?Yt(e,lo(t,2)):0},Bn.template=function(e,t,i){var a=Bn.templateSettings;i&&_o(e,t,i)&&(t=n),e=wr(e),t=Cr({},t,a,Ja);var o=Cr({},t.imports,a.imports,Ja),s=Nr(o),r=Jt(o,s);St(s,function(e){if(ue.test(e))throw new Te("Invalid `imports` option passed into `_.template`")});var l,c,u=0,h=t.interpolate||_e,d="__p += '",f=Ie((t.escape||_e).source+"|"+h.source+"|"+(h===J?de:_e).source+"|"+(t.evaluate||_e).source+"|$","g"),p="//# sourceURL="+(Le.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ot+"]")+"\n";e.replace(f,function(t,n,i,a,o,s){return i||(i=a),d+=e.slice(u,s).replace(we,on),n&&(l=!0,d+="' +\n__e("+n+") +\n'"),o&&(c=!0,d+="';\n"+o+";\n__p += '"),i&&(d+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),u=s+t.length,t}),d+="';\n";var g=Le.call(t,"variable")&&t.variable;if(g){if(ue.test(g))throw new Te("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(c?d.replace(H,""):d).replace(z,"$1").replace(W,"$1;"),d="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(l?", __e = _.escape":"")+(c?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";
5555\n")+d+"return __p\n}";var m=tl(function(){return Ce(s,p+"return "+d).apply(n,r)});if(m.source=d,Zs(m))throw m;return m},Bn.times=function(e,t){if((e=vr(e))<1||e>d)return[];var n=p,i=bn(e,p);t=lo(t),e-=p;for(var a=Qt(i,t);++n<e;)t(n);return a},Bn.toFinite=mr,Bn.toInteger=vr,Bn.toLength=yr,Bn.toLower=function(e){return wr(e).toLowerCase()},Bn.toNumber=br,Bn.toSafeInteger=function(e){return e?ri(vr(e),-9007199254740991,d):0===e?e:0},Bn.toString=wr,Bn.toUpper=function(e){return wr(e).toUpperCase()},Bn.trim=function(e,t,i){if((e=wr(e))&&(i||t===n))return $t(e);if(!e||!(t=ca(t)))return e;var a=dn(e),o=dn(t);return wa(a,en(a,o),tn(a,o)+1).join("")},Bn.trimEnd=function(e,t,i){if((e=wr(e))&&(i||t===n))return e.slice(0,fn(e)+1);if(!e||!(t=ca(t)))return e;var a=dn(e);return wa(a,0,tn(a,dn(t))+1).join("")},Bn.trimStart=function(e,t,i){if((e=wr(e))&&(i||t===n))return e.replace(ae,"");if(!e||!(t=ca(t)))return e;var a=dn(e);return wa(a,en(a,dn(t))).join("")},Bn.truncate=function(e,t){var i=30,a="...";if(ir(t)){var o="separator"in t?t.separator:o;i="length"in t?vr(t.length):i,a="omission"in t?ca(t.omission):a}var s=(e=wr(e)).length;if(sn(e)){var r=dn(e);s=r.length}if(i>=s)return e;var l=i-hn(a);if(l<1)return a;var c=r?wa(r,0,l).join(""):e.slice(0,l);if(o===n)return c+a;if(r&&(l+=c.length-l),lr(o)){if(e.slice(l).search(o)){var u,h=c;for(o.global||(o=Ie(o.source,wr(fe.exec(o))+"g")),o.lastIndex=0;u=o.exec(h);)var d=u.index;c=c.slice(0,d===n?l:d)}}else if(e.indexOf(ca(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+a},Bn.unescape=function(e){return(e=wr(e))&&Y.test(e)?e.replace(K,pn):e},Bn.uniqueId=function(e){var t=++Ve;return wr(e)+t},Bn.upperCase=Jr,Bn.upperFirst=Zr,Bn.each=ws,Bn.eachRight=ks,Bn.first=Qo,ul(Bn,(Tl={},_i(Bn,function(e,t){Le.call(Bn.prototype,t)||(Tl[t]=e)}),Tl),{chain:!1}),Bn.VERSION="4.18.1",St(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Bn[e].placeholder=Bn}),St(["drop","take"],function(e,t){zn.prototype[e]=function(i){i=i===n?1:yn(vr(i),0);var a=this.__filtered__&&!t?new zn(this):this.clone();return a.__filtered__?a.__takeCount__=bn(i,a.__takeCount__):a.__views__.push({size:bn(i,p),type:e+(a.__dir__<0?"Right":"")}),a},zn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),St(["filter","map","takeWhile"],function(e,t){var n=t+1,i=1==n||3==n;zn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:lo(e,3),type:n}),t.__filtered__=t.__filtered__||i,t}}),St(["head","last"],function(e,t){var n="take"+(t?"Right":"");zn.prototype[e]=function(){return this[n](1).value()[0]}}),St(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");zn.prototype[e]=function(){return this.__filtered__?new zn(this):this[n](1)}}),zn.prototype.compact=function(){return this.filter(sl)},zn.prototype.find=function(e){return this.filter(e).head()},zn.prototype.findLast=function(e){return this.reverse().find(e)},zn.prototype.invokeMap=$i(function(e,t){return"function"==typeof e?new zn(this):this.map(function(n){return Di(n,e,t)})}),zn.prototype.reject=function(e){return this.filter(qs(lo(e)))},zn.prototype.slice=function(e,t){e=vr(e);var i=this;return i.__filtered__&&(e>0||t<0)?new zn(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==n&&(i=(t=vr(t))<0?i.dropRight(-t):i.take(t-e)),i)},zn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zn.prototype.toArray=function(){return this.take(p)},_i(zn.prototype,function(e,t){var i=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),o=Bn[a?"take"+("last"==t?"Right":""):t],s=a||/^find/.test(t);o&&(Bn.prototype[t]=function(){var t=this.__wrapped__,r=a?[1]:arguments,l=t instanceof zn,c=r[0],u=l||Gs(t),h=function(e){var t=o.apply(Bn,Nt([e],r));return a&&d?t[0]:t};u&&i&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,f=!!this.__actions__.length,p=s&&!d,g=l&&!f;if(!s&&u){t=g?t:new zn(this);var m=e.apply(t,r);return m.__actions__.push({func:ms,args:[h],thisArg:n}),new Hn(m,d)}return p&&g?e.apply(this,r):(m=this.thru(h),p?a?m.value()[0]:m.value():m)})}),St(["pop","push","shift","sort","splice","unshift"],function(e){var t=Pe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);Bn.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var a=this.value();return t.apply(Gs(a)?a:[],e)}return this[n](function(n){return t.apply(Gs(n)?n:[],e)})}}),_i(zn.prototype,function(e,t){var n=Bn[t];if(n){var i=n.name+"";Le.call(Pn,i)||(Pn[i]=[]),Pn[i].push({name:t,func:n})}}),Pn[Ba(n,2).name]=[{name:"wrapper",func:n}],zn.prototype.clone=function(){var e=new zn(this.__wrapped__);return e.__actions__=Aa(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Aa(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Aa(this.__views__),e},zn.prototype.reverse=function(){if(this.__filtered__){var e=new zn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Gs(e),i=t<0,a=n?e.length:0,o=function(e,t,n){var i=-1,a=n.length;for(;++i<a;){var o=n[i],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=bn(t,e+s);break;case"takeRight":e=yn(e,t-s)}}return{start:e,end:t}}(0,a,this.__views__),s=o.start,r=o.end,l=r-s,c=i?r:s-1,u=this.__iteratees__,h=u.length,d=0,f=bn(l,this.__takeCount__);if(!n||!i&&a==l&&f==l)return pa(e,this.__actions__);var p=[];e:for(;l--&&d<f;){for(var g=-1,m=e[c+=t];++g<h;){var v=u[g],y=v.iteratee,b=v.type,_=y(m);if(2==b)m=_;else if(!_){if(1==b)continue e;break e}}p[d++]=m}return p},Bn.prototype.at=vs,Bn.prototype.chain=function(){return gs(this)},Bn.prototype.commit=function(){return new Hn(this.value(),this.__chain__)},Bn.prototype.next=function(){this.__values__===n&&(this.__values__=gr(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Bn.prototype.plant=function(e){for(var t,i=this;i instanceof jn;){var a=jo(i);a.__index__=0,a.__values__=n,t?o.__wrapped__=a:t=a;var o=a;i=i.__wrapped__}return o.__wrapped__=e,t},Bn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zn){var t=e;return this.__actions__.length&&(t=new zn(this)),(t=t.reverse()).__actions__.push({func:ms,args:[is],thisArg:n}),new Hn(t,this.__chain__)}return this.thru(is)},Bn.prototype.toJSON=Bn.prototype.valueOf=Bn.prototype.value=function(){return pa(this.__wrapped__,this.__actions__)},Bn.prototype.first=Bn.prototype.head,et&&(Bn.prototype[et]=function(){return this}),Bn}();gt?((gt.exports=gn)._=gn,pt._=gn):ft._=gn}).call(ST)}(pbe,pbe.exports);var gbe=pbe.exports;const mbe={class:"container-fullhd"},vbe={key:0,class:"header text-uppercase"},ybe={class:"content"},bbe={class:"content-grid"},_be={class:"table rounded-3 overflow-hidden"},wbe={colspan:"3"},kbe={class:"header-row"},xbe={class:"quay-title"},Tbe={class:"quay-status"},Cbe={key:0,class:"fas fa-play icon-active"},Ebe={key:1,class:"fas fa-pause icon-pause blink"},Sbe={class:"luot-label"},Ibe={style:{width:"15%"}},Abe={style:{width:"55%"}},Dbe={class:"customer-name"},Pbe=["title","aria-label"],Obe={class:"text-nowrap",style:{width:"30%"}},Mbe={class:"remain-row"},Nbe={class:"marquee-customer-wrap",colspan:"3"},Rbe={class:"marquee-customer"},Lbe={key:0,class:"mx-1"},Vbe={key:0,xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"#e05a66","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevrons-right"}
5555,qbe={key:0,class:"right-panel rounded-3"},Fbe={class:"table rounded-3 overflow-hidden"},Bbe={style:{width:"25%"}},Ube={class:"o-gio-hen"},jbe={key:0,class:"fas fa-check-circle icon-daxacnhan",title:"Äã xác nháºn có mặt","aria-label":"Äã xác nháºn có mặt"},Hbe={key:1,class:"far fa-clock icon-chuaxacnhan",title:"Chưa xác nháºn có mặt","aria-label":"Chưa xác nháºn có mặt"},zbe={style:{width:"60%"}},Wbe={class:"customer-name"},Kbe={style:{width:"15%"}},Gbe={style:{width:"25%"}},Ybe={class:"o-gio-hen"},Qbe={key:0,class:"fas fa-check-circle icon-daxacnhan",title:"Äã xác nháºn có mặt","aria-label":"Äã xác nháºn có mặt"},$be={key:1,class:"far fa-clock icon-chuaxacnhan",title:"Chưa xác nháºn có mặt","aria-label":"Chưa xác nháºn có mặt"},Xbe={style:{width:"60%"}},Jbe={class:"customer-name"},Zbe={style:{width:"15%"}},e_e={class:"remain-row"},t_e={class:"marquee-customer-wrap",colspan:"3"},n_e={class:"marquee-customer"},i_e={key:0,class:"mx-1"},a_e={key:0,xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"#e05a66","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevrons-right"},o_e={key:1},s_e={key:1,class:"info-video"},r_e=["src"],l_e={class:"footer"},c_e={class:"marquee"},u_e={key:0,class:"me-1"},h_e={key:1,class:"me-1"},d_e={key:2,class:"me-1"},f_e={key:3,class:"me-1"},p_e={__name:"ManHinhTrungTamDetail",setup(e){const t=Ll(),n=Vl(),i=n.params.don_vi;let a=n.query.sc||null;const o=JT(),{item:s}=Zs(o),r=wI(),{items:l}=Zs(r),c=y1(),{dsKhachDangPhucVuTheoDonVi:u}=Zs(c),h=Fde();h.realtimeKhachHenGioChuaPhucVuTheoDonVi(i,iQ(new Date),pQ(new Date));const{items:d}=Zs(h),f=It(new Date),p=setInterval(()=>{f.value=new Date},1e3);It([]),It([]);const g=It(5),m=gt({}),v=It([]),y=It(null),b=gt({id:"",stt:"-",hoten:"-",loai:dhe,trangthai:"-"}),_=It(!1);Zn(async()=>{a||(a=localStorage.getItem("screen_id"));const e=a?x(a):null;a&&e&&e.don_vi===i?await t.push({path:"/".concat(i,"/man-hinh"),query:{sc:a}}):await t.push({path:"/".concat(i,"/cai-dat-don-vi")}),await an(()=>{Object.assign(m,JSON.parse(localStorage.getItem(a)))})}),ei(async()=>{try{await o.fetchItemById(i),await r.realtimeItemsByDonViAndStatus(i,!0),await c.realtimeKhachDangPhucVuTheoDonVi(i),(null==m?void 0:m.sohanghienthi)&&(g.value=null==m?void 0:m.sohanghienthi)}catch(eRe){}an(()=>{w(),k()})}),ii(()=>{clearInterval(p)}),pa(()=>n.query.sc,e=>{e&&Object.assign(m,JSON.parse(localStorage.getItem(a)))},{immediate:!0});const w=()=>{v.value.forEach(e=>{if(e){const t=e.textContent.length;e.style.setProperty("--text-length",t)}})},k=()=>{if(y.value){const e=y.value,t=e.textContent.length;e.style.setProperty("--text-length",t)}},x=e=>{const t=localStorage.getItem(e);return t?JSON.parse(t):null},T=bo(()=>{var e;const t=f.value,n=!!(null==(e=s.value)?void 0:e.uutien_vuot_hengio),i={};return(N.value||[]).forEach(e=>{i[e.id]=The({dsKhachHang:(u.value||[]).filter(t=>t.quay===e.id),dsHenGio:(d.value||[]).filter(t=>t.quay===e.id),uuTienVuotHenGio:n,bayGio:t})}),i}),C=bo(()=>{const e=(e,t,n=!1)=>{var i;return{id:e.id,stt:e.ma,loai:e.loai,trangthai:t,dangphucvu:n,hoten:(null==(i=e.goc)?void 0:i.dangkinhanh)?ZT(e.sodienthoai):yhe(e.hoten)}},t={};return Object.entries(T.value).forEach(([n,{hangDoi:i,dangPhucVu:a}])=>{t[n]=[...a?[e(a,"Äang phục vụ",!0)]:[],...i.map(t=>e(t,"Äang chá»"))]}),t}),E=bo(()=>{const e={};return Object.entries(T.value).forEach(([t,{henGioSapToi:n}])=>{n.length&&(e[t]=n.map(e=>({id:e.id,thoigianhengio:e.ma,hoten:yhe(e.hoten),daxacnhan:e.daxacnhan,quay:t})))}),e}),S=bo(()=>{const e=E.value,t=1===Object.keys(e).length,n={};return Object.entries(e).forEach(([e,i])=>{n[e]=t?i.slice(0,g.value):[i[0]]}),n}),I=bo(()=>{const e=E.value,t=1===Object.keys(e).length;return Object.values(e).flatMap(e=>t?e.slice(g.value):e.slice(1))}),A=e=>{var t,n;const i=C.value[e],a=null!=(t=null==i?void 0:i.slice(0,g.value))?t:[];for(;a.length<g.value;)a.push(b);const o=null!=(n=null==i?void 0:i.slice(g.value))?n:[];return{firstFive:a,remain:o,remainCount:o.length}},D=e=>{var t;if(!(null==(t=l.value)?void 0:t.length))return"";const n=l.value.find(t=>
5555t.id===e);return null==n?void 0:n.ten},P=gbe.debounce(w,1e3),O=gbe.debounce(k,1e3);pa(()=>C.value,()=>{P()},{deep:!0}),pa(()=>I.value,()=>{O()},{deep:!0});const M=bo(()=>void 0===(null==m?void 0:m.hienthitieude)||null===(null==m?void 0:m.hienthitieude)||"1"===String(m.hienthitieude)),N=bo(()=>{var e;return(null==(e=null==m?void 0:m.quayhienthi)?void 0:e.length)?l.value.filter(e=>m.quayhienthi.includes(e.id)):l.value}),R=()=>{_.value=!0};return(e,t)=>{var n,a,o,r,l,c,u,h,d,f,p,g,b;const w=ui("router-link");return Ma(),Va(Sa,null,[Ha("div",mbe,[M.value?(Ma(),Va("div",vbe,ee(null==(n=Ot(s))?void 0:n.ten),1)):Qa("",!0),Ha("div",ybe,[Ha("div",bbe,[(Ma(!0),Va(Sa,null,gi(N.value,e=>{var n,i,a,o,s;return Ma(),Va("div",{key:e.id},[Ha("table",_be,[Ha("thead",null,[Ha("tr",null,[Ha("th",wbe,[Ha("div",kbe,[Ha("span",xbe,"QUẦY "+ee(e.ten),1),Ha("span",Tbe,[e.trangthai?(Ma(),Va("i",Cbe)):(Ma(),Va("i",Ebe))]),Ha("span",Sbe,"Khách: "+ee((null==(n=C.value[e.id])?void 0:n.length)||0),1)])])])]),t[1]||(t[1]=Ha("thead",null,[Ha("tr",null,[Ha("th",null,"STT"),Ha("th",null,"TÃN KHÃCH HÃNG"),Ha("th",null,"TRẠNG THÃI")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(null==(i=A(e.id))?void 0:i.firstFive,(e,t)=>(Ma(),Va("tr",{key:(null==e?void 0:e.id)||"trong-".concat(t),class:G({"table-danger text-light":null==e?void 0:e.dangphucvu,"dong-trong":!(null==e?void 0:e.id)})},[Ha("td",Ibe,ee((null==e?void 0:e.stt)||""),1),Ha("td",Abe,[Ha("span",Dbe,ee((null==e?void 0:e.hoten)||""),1),(null==e?void 0:e.loai)&&e.loai!==Ot(dhe)?(Ma(),Va("i",{key:0,class:G([Ot(mhe)[e.loai],"icon-loai icon-loai--".concat(e.loai)]),title:Ot(ghe)[e.loai],"aria-label":Ot(ghe)[e.loai]},null,10,Pbe)):Qa("",!0)]),Ha("td",Obe,ee((null==e?void 0:e.trangthai)||""),1)],2))),128)),Ha("tr",Mbe,[Ha("td",Nbe,[Ha("div",Rbe,[Ha("p",{ref_for:!0,ref_key:"marqueeText",ref:v,class:G({"text-white invisible":!(null==(a=A(e.id))?void 0:a.remainCount)})},[(null==(o=A(e.id))?void 0:o.remainCount)?Qa("",!0):(Ma(),Va("span",Lbe," Không có ngưá»i tiếp theo ")),(Ma(!0),Va(Sa,null,gi(null==(s=A(e.id))?void 0:s.remain,(n,i)=>{var a;return Ma(),Va("span",{key:null==n?void 0:n.id,class:"mx-1"},[Ga(ee(null==n?void 0:n.stt)+" ("+ee(null==n?void 0:n.hoten)+") ",1),i<(null==(a=A(e.id))?void 0:a.remainCount)-1?(Ma(),Va("svg",Vbe,t[0]||(t[0]=[Ha("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Ha("path",{d:"M7 7l5 5l-5 5"},null,-1),Ha("path",{d:"M13 7l5 5l-5 5"},null,-1)]))):Qa("",!0)])}),128))],2)])])])])])])}),128)),"1"==(null==m?void 0:m.hengiotructuyen)?(Ma(),Va("div",qbe,[Ha("table",Fbe,[t[4]||(t[4]=Ha("thead",null,[Ha("tr",null,[Ha("th",{colspan:"3"},[Ha("div",{class:"header-row"},[Ha("span",{class:"quay-title"},"HẸN GIá» GIAO Dá»CH")])])])],-1)),t[5]||(t[5]=Ha("thead",null,[Ha("tr",null,[Ha("th",{style:{width:"25%"}},"THá»I GIAN"),Ha("th",{style:{width:"60%"}},"TÃN KHÃCH HÃNG"),Ha("th",{style:{width:"15%"}},"QUẦY")])],-1)),Ha("tbody",null,[Object.keys(S.value).length>0?(Ma(),Va(Sa,{key:0},[1===Object.keys(S.value).length?(Ma(!0),Va(Sa,{key:0},gi(S.value,(e,t)=>(Ma(),Va(Sa,{key:t},[(Ma(!0),Va(Sa,null,gi(e,e=>(Ma(),Va("tr",{key:null==e?void 0:e.id},[Ha("td",Bbe,[Ha("div",Ube,[Ha("span",null,ee((null==e?void 0:e.thoigianhengio)||""),1),(null==e?void 0:e.daxacnhan)?(Ma(),Va("i",jbe)):(Ma(),Va("i",Hbe))])]),Ha("td",zbe,[Ha("span",Wbe,ee((null==e?void 0:e.hoten)||""),1)]),Ha("td",Kbe,ee(D(t)||""),1)]))),128))],64))),128)):(Ma(!0),Va(Sa,{key:1},gi(S.value,(e,t)=>{var n,i,a;return Ma(),Va("tr",{key:t},[Ha("td",Gbe,[Ha("div",Ybe,[Ha("span",null,ee((null==(n=e[0])?void 0:n.thoigianhengio)||""),1),(null==(i=e[0])?void 0:i.daxacnhan)?(Ma(),Va("i",Qbe)):(Ma(),Va("i",$be))])]),Ha("td",Xbe,[Ha("span",Jbe,ee((null==(a=e[0])?void 0:a.hoten)||""),1)]),Ha("td",Zbe,ee(D(t)||""),1)])}),128)),Ha("tr",e_e,[Ha("td",t_e,[Ha("div",n_e,[Ha("p",{ref_key:"marqueeTextAppoint",ref:y,class:G({"text-white invisible":!I.value.length})},[I.value.length?Qa("",!0):(Ma(),Va("span",i_e," Không có khách hẹn giá» tiếp theo ")),(Ma(!0),Va(Sa,null,gi(I.value,(e,n)=>(Ma(),Va("span",{key:null==e?void 0:e.id,class:"mx-1"},[Ga(ee(null==e?void 0:e.thoigianhengio)+" ("+ee(null==e?void 0:e.hoten)+" - Quầy "+ee(D(e.quay))+") ",1),n<I.value.length-1?(Ma(),Va("svg",a_e,t[2]||(t[2]=[Ha("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Ha("path",{d:"M7 7l5 5l-5 5"},null,-1),Ha("path",{d:"M13 7l5 5l-5 5"},null,-1)]))):Qa("",!0)]))),128))],2)])])])],64)):(Ma(),Va("tr",o_e,t[3]||(t[3]=[Ha("td",{colspan:"3"},[Ha("span",{class:"text-center m-3 h4"},"Không có khách hẹn giá» trá»±c tuyến")],-1)])))])])])):Qa("",!0),"1"==(null==m?void 0:m.video)&&(null==(a=Ot(s))?void 0:a.videolink)?(Ma(),Va("div",s_e,[Ha("iframe",{class:"rounded-3",width:"100%",height:"450",src:null==(o=Ot(s))?void 0:o.videolink,frameborder:"0",allowfullscreen:"",allow:"autoplay; encrypted-media"},null,8,r_e)])):Qa("",!0)])]),Ha("div",l_e,[Ha("div",c_e,[t[9]||(t[9]=Ga(" KÃnh chà o quý khách! Vui lòng chá» Äến lượt. ")),t[10]||(t[10]=Ha("span",{class:"me-1"},"Khách thuá»c diá»n ưu tiên và khách Äã Äặt lá»ch hẹn trá»±c tuyến ÄÆ°á»£c phục vụ trưá»c theo quy Äá»nh.",-1)),(null==(r=Ot(s))?void 0:r.hotline)||(null==(l=Ot(s))?void 0:l.email)||(null==(c=Ot(s))?void 0:c.website)?(Ma(),Va("span",u_e,"Má»i thắc mắc xin liên há»")):Qa("",!0),(null==(u=Ot(s))?void 0:u.hotline)?(Ma(),Va("span",h_e,[t[6]||(t[6]=Ha("i",{class:"fas fa-phone"},null,-1)),Ga(" Hotline: "+ee(null==(h=Ot(s))?void 0:h.hotline),1)])):Qa("",!0),(null==(d=Ot(s))?void 0:d.email)?(Ma(),Va("span",d_e,[t[7]||(t[7]=Ha("i",{class:"fas fa-envelope"},null,-1)),Ga(" Email: "+ee(null==(f=Ot(s))?void 0:f.email),1)])):Qa("",!0),(null==(p=Ot(s))?void 0:p.website)?(Ma(),Va("span",f_e,[t[8]||(t[8]=Ha("i",{class:"fas fa-globe"},null,-1)),Ga(" Website: "+ee(null==(g=Ot(s))?void 0:g.website),1)])):Qa("",!0)])])]),za(w,{to:"/".concat(Ot(i),"/cai-dat-don-vi")},{default:pn(()=>t[11]||(t[11]=[Ha("button",{class:"settings-btn"},[Ha("i",{class:"fas fa-cog text-light"})],-1)])),_:1},8,["to"]),"tv"===(null==(b=Ot(s))?void 0:b.vitriamthanh)?(Ma(),qa(rte,{key:0,showButton:!_.value,onSoundStarted:R},null,8,["showButton"])):Qa("",!0)],64)}}},g_e=CC(p_e,[["__scopeId","data-v-8b3345e0"]]),m_e={class:"container-fullhd"},v_e={key:0,class:"header text-uppercase"},y_e={class:"content"},b_e={class:"content-grid"},__e={class:"info-queue"},w_e={class:"table rounded-3 overflow-hidden"},k_e={style:{width:"7%"}},x_e={class:"icon-cell",style:{width:"5%"}},T_e={key:0,class:"fas fa-play icon-active"},C_e={key:1,class:"fas fa-pause icon-pause blink"},E_e={style:{width:"10%"}},S_e={class:"o-co-icon"},I_e={class:"serving-number"},A_e={class:"o-ten-khach"},D_e={class:"customer-name"},P_e=["title","aria-label"],O_e={style:{width:"10%"},class:"text-pink"},M_e={style:{width:"10%"},class:"so-moi-lay"},N_e={key:1}
5555,R_e={key:0,class:"right-panel rounded-3"},L_e={key:0,class:"info-section"},V_e={key:0,class:"text-center m-3"},q_e={key:1,class:"bang-hen"},F_e={class:"o-gio-hen"},B_e={key:0,class:"fas fa-check-circle icon-daxacnhan",title:"Äã xác nháºn có mặt","aria-label":"Äã xác nháºn có mặt"},U_e={key:1,class:"far fa-clock icon-chuaxacnhan",title:"Chưa xác nháºn có mặt","aria-label":"Chưa xác nháºn có mặt"},j_e={class:"ten-hen"},H_e={key:1,class:"info-video"},z_e=["src"],W_e={class:"footer"},K_e={class:"marquee"},G_e={key:0,class:"me-1"},Y_e={key:1,class:"me-1"},Q_e={key:2,class:"me-1"},$_e={key:3,class:"me-1"},X_e=CC({__name:"ManHinhTrungTamComposite",setup(e){const t=Ll(),n=Vl(),i=n.params.don_vi;let a=n.query.sc||null;const o=It(!1),s=JT(),{item:r}=Zs(s),l=wI(),{items:c}=Zs(l),u=y1(),{dsKhachDangPhucVuTheoDonVi:h}=Zs(u),d=Fde();d.realtimeKhachHenGioChuaPhucVuTheoDonVi(i,iQ(new Date),pQ(new Date));const{items:f}=Zs(d),p=It(new Date);setInterval(()=>{p.value=new Date},1e3);const g=gt({}),m=It({});let v=null;Zn(async()=>{a||(a=localStorage.getItem("screen_id"));const e=a?y(a):null;a&&e&&e.don_vi===i?await t.push({path:"/".concat(i,"/man-hinh"),query:{sc:a}}):await t.push({path:"/".concat(i,"/cai-dat-don-vi")}),await an(()=>{Object.assign(g,JSON.parse(localStorage.getItem(a)))})}),ei(async()=>{try{await s.fetchItemById(i),await l.realtimeItemsByDonViAndStatus(i,!0),await u.realtimeKhachDangPhucVuTheoDonVi(i),v=TT("bo_dem_stt",[["donvi","==",i]],null,null,e=>{const t={};(e||[]).forEach(e=>{e.quay&&(t[e.quay]=e.giatri)}),m.value=t})}catch(eRe){}}),ai(()=>{v&&(v(),v=null)});const y=e=>{const t=localStorage.getItem(e);return t?JSON.parse(t):null};pa(()=>n.query.sc,e=>{e&&Object.assign(g,JSON.parse(localStorage.getItem(a)))},{immediate:!0});const b=bo(()=>{var e;return(null==(e=null==g?void 0:g.quayhienthi)?void 0:e.length)?c.value.filter(e=>g.quayhienthi.includes(e.id)):c.value}),_=bo(()=>new Set(eC(b.value,"id"))),w=bo(()=>{var e;return"1"==(null==g?void 0:g.hengiotructuyen)||"1"==(null==g?void 0:g.video)&&(null==(e=r.value)?void 0:e.videolink)}),k=bo(()=>void 0===(null==g?void 0:g.hienthitieude)||null===(null==g?void 0:g.hienthitieude)||"1"===String(g.hienthitieude)),x=bo(()=>(f.value||[]).filter(e=>_.value.has(e.quay)&&e.ngayhengio.toDate()>p.value).map(e=>{const t=b.value.find(t=>t.id===e.quay),n=(null==t?void 0:t.ten)||"";return{...e,hoten:(i=e.hoten,hC(i)),soQuay:n?n.split(" ").slice(-1).join(""):"-"};var i}).sort((e,t)=>e.ngayhengio.toDate()-t.ngayhengio.toDate())),T=bo(()=>{var e;const t=p.value,n=!!(null==(e=r.value)?void 0:e.uutien_vuot_hengio);return b.value.map(e=>{var i;const{hangDoi:a,dangPhucVu:o}=The({dsKhachHang:(h.value||[]).filter(t=>t.quay===e.id),dsHenGio:(f.value||[]).filter(t=>t.quay===e.id),uuTienVuotHenGio:n,bayGio:t}),s=e.ten||"Quầy không xác Äá»nh";return{id:e.id,quay:e.id,soQuay:s.split(" ").slice(-1).join(""),sttQuay:e.thutu||0,dangPhucVu:o,tiepTheo:a[0]||null,soMoiLay:null!=(i=m.value[e.id])?i:null}}).sort((e,t)=>e.sttQuay-t.sttQuay)}),C=e=>{var t;if(!(null==(t=c.value)?void 0:t.length))return!1;const n=c.value.find(t=>t.id===e);return(null==n?void 0:n.trangthai)||!1},E=()=>{o.value=!0};return(e,t)=>{var n,a,s,l,c,u,h,d,f,p,m,v,y;const b=ui("router-link");return Ma(),Va(Sa,null,[Ha("div",m_e,[k.value?(Ma(),Va("div",v_e,ee(null==(n=Ot(r))?void 0:n.ten),1)):Qa("",!0),Ha("div",y_e,[Ha("div",b_e,[Ha("div",{class:G(["left-panel",{"w-100":!w.value}])},[Ha("div",__e,[Ha("table",w_e,[t[1]||(t[1]=Ha("thead",null,[Ha("tr",null,[Ha("th",{style:{width:"7%"}},"QUẦY"),Ha("th",{style:{width:"5%"}}),Ha("th",{style:{width:"10%"}},"ÄANG PHỤC VỤ"),Ha("th",null,"KHÃCH HÃNG"),Ha("th",{style:{width:"10%"}},"TIẾP THEO"),Ha("th",{style:{width:"10%"}},"Sá» Má»I LẤY")])],-1)),Ha("tbody",null,[T.value.length>0?(Ma(!0),Va(Sa,{key:0},gi(T.value,e=>{var t,n,i;return Ma(),Va("tr",{key:e.id},[Ha("td",k_e,[Ha("span",null,ee(e.soQuay),1)]),Ha("td",x_e,[C(e.quay)?(Ma(),Va("i",T_e)):(Ma(),Va("i",C_e))]),Ha("td",E_e,[Ha("div",S_e,[Ha("span",I_e,ee((null==(t=e.dangPhucVu)?void 0:t.ma)||"..."),1)])]),Ha("td",null,[Ha("div",A_e,[Ha("span",D_e,ee(Ot(yhe)(null==(n=e.dangPhucVu)?void 0:n.hoten)),1),e.dangPhucVu&&e.dangPhucVu.loai!==Ot(dhe)?(Ma(),Va("i",{key:0,class:G([Ot(mhe)[e.dangPhucVu.loai],"icon-loai icon-loai--".concat(e.dangPhucVu.loai)]),title:Ot(ghe)[e.dangPhucVu.loai],"aria-label":Ot(ghe)[e.dangPhucVu.loai]},null,10,P_e)):Qa("",!0)])]),Ha("td",O_e,ee((null==(i=e.tiepTheo)?void 0:i.ma)||"..."),1),Ha("td",M_e,ee(e.soMoiLay||"..."),1)])}),128)):(Ma(),Va("tr",N_e,t[0]||(t[0]=[Ha("td",{colspan:"6"},[Ha("span",{class:"text-center m-3 h4"},"Không có khách hà ng")],-1)])))])])])],2),w.value?(Ma(),Va("div",R_e,["1"==(null==g?void 0:g.hengiotructuyen)?(Ma(),Va("div",L_e,[t[3]||(t[3]=Ha("p",{class:"welcome-text"},"HẸN GIá» GIAO Dá»CH",-1)),0===x.value.length?(Ma(),Va("div",V_e,"Không có lá»ch hẹn sắp tá»i")):(Ma(),Va("table",q_e,[t[2]||(t[2]=Ha("thead",null,[Ha("tr",null,[Ha("th",{style:{width:"30%"}},"THá»I GIAN"),Ha("th",null,"KHÃCH HÃNG"),Ha("th",{style:{width:"16%"}},"QUẦY")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(x.value,e=>(Ma(),Va("tr",{key:e.id},[Ha("td",null,[Ha("div",F_e,[Ha("span",null,ee(e.thoigianhengio),1),e.daxacnhan?(Ma(),Va("i",B_e)):(Ma(),Va("i",U_e))])]),Ha("td",j_e,ee(e.hoten),1),Ha("td",null,ee(e.soQuay),1)]))),128))])]))])):Qa("",!0),"1"==(null==g?void 0:g.video)&&(null==(a=Ot(r))?void 0:a.videolink)?(Ma(),Va("div",H_e,[Ha("iframe",{width:"100%",height:"325",src:null==(s=Ot(r))?void 0:s.videolink,frameborder:"0",allowfullscreen:"",allow:"autoplay; encrypted-media"},null,8,z_e)])):Qa("",!0)])):Qa("",!0)])]),Ha("div",W_e,[Ha("div",K_e,[t[7]||(t[7]=Ga(" KÃnh chà o quý khách! Vui lòng chá» Äến lượt. ")),t[8]||(t[8]=Ha("span",{class:"me-1"},"Khách thuá»c diá»n ưu tiên và khách Äã Äặt lá»ch hẹn trá»±c tuyến ÄÆ°á»£c phục vụ trưá»c theo quy Äá»nh.",-1)),(null==(l=Ot(r))?void 0:l.hotline)||(null==(c=Ot(r))?void 0:c.email)||(null==(u=Ot(r))?void 0:u.website)?(Ma(),Va("span",G_e,"Má»i thắc mắc xin liên há»")):Qa("",!0),(null==(h=Ot(r))?void 0:h.hotline)?(Ma(),Va("span",Y_e,[t[4]||(t[4]=Ha("i",{class:"fas fa-phone"},null,-1)),Ga(" Hotline: "+ee(null==(d=Ot(r))?void 0:d.hotline),1)])):Qa("",!0),(null==(f=Ot(r))?void 0:f.email)?(Ma(),Va("span",Q_e,[t[5]||(t[5]=Ha("i",{class:"fas fa-envelope"},null,-1)),Ga(" Email: "+ee(null==(p=Ot(r))?void 0:p.email),1)])):Qa("",!0),(null==(m=Ot(r))?void 0:m.website)?(Ma(),Va("span",$_e,[t[6]||(t[6]=Ha("i",{class:"fas fa-globe"},null,-1)),Ga(" Website: "+ee(null==(v=Ot(r))?void 0:v.website),1)])):Qa("",!0)])])]),za(b,{to:"/".concat(Ot(i),"/cai-dat-don-vi")},{default:pn(()=>t[9]||(t[9]=[Ha("button",{class:"settings-btn"},[Ha("i",{class:"fas fa-cog text-light"})],-1)])),_:1}
5555,8,["to"]),"tv"===(null==(y=Ot(r))?void 0:y.vitriamthanh)?(Ma(),qa(rte,{key:0,showButton:!o.value,onSoundStarted:E},null,8,["showButton"])):Qa("",!0)],64)}}},[["__scopeId","data-v-b15ef597"]]),J_e={__name:"ManHinhTrungTam",setup(e){const t=Ll(),n=Vl(),i=n.params.don_vi,a=n.query.sc||null,o=gt({});Zn(()=>{a&&localStorage.getItem(a)||t.push({path:"/".concat(i,"/cai-dat-don-vi")}),Object.assign(o,JSON.parse(localStorage.getItem(a)))});const s=bo(()=>"composite"===o.layout?X_e:g_e);return(e,t)=>(Ma(),qa(di(s.value)))}},Z_e={class:"queue-card text-center"},ewe=CC({__name:"NotFound",setup(e){const t=Ll(),n=()=>{t.push("/")};return(e,t)=>(Ma(),Va("div",Z_e,[t[2]||(t[2]=Ha("div",{class:"header-section"},[Ha("h5",{class:"title"},"Há» THá»NG XẾP HÃNG Tá»° Äá»NG")],-1)),Ha("div",{class:"alert-section mt-3"},[t[0]||(t[0]=Ha("div",{class:"alert alert-custom alert-danger shadow-sm",role:"alert"},[Ha("i",{class:"fas fa-exclamation-circle me-2"}),Ha("span",{class:"alert-text text-uppercase"},"Không tìm thấy trang!!!")],-1)),t[1]||(t[1]=Ha("p",{class:"mt-2 text-muted"},"Trang bạn Äang tìm kiếm không tá»n tại hoặc Äã bá» xóa.",-1)),Ha("button",{class:"btn btn-custom btn-gradient-blue",onClick:n},"Quay lại trang chá»§")])]))}},[["__scopeId","data-v-b222a00b"]]),twe={class:"container content-container"},nwe={class:"header"},iwe={class:"text-center text-uppercase"},awe={class:"row mb-3"},owe={class:"col-12 col-md-6 mb-4"},swe={class:"form-group shadow-sm"},rwe={key:0,class:"mt-2"},lwe={class:"text-secondary"},cwe={key:1,class:"mt-2 d-flex gap-4 flex-wrap"},uwe=["id","value"],hwe=["for"],dwe={class:"col-12 col-md-6 mb-4"},fwe={class:"form-group shadow-sm"},pwe=["disabled"],gwe={class:"col-12 col-md-6 mb-4"},mwe={class:"form-group shadow-sm"},vwe={class:"mt-2 d-flex gap-4 flex-wrap"},ywe={class:"form-check"},bwe={class:"form-check"},_we={class:"col-12 col-md-6 mb-4"},wwe={class:"form-group shadow-sm"},kwe={class:"mt-2 d-flex gap-4 flex-wrap"},xwe={class:"form-check"},Twe={class:"form-check"},Cwe={class:"col-12 col-md-6 mb-4"},Ewe={class:"form-group shadow-sm"},Swe={class:"mt-2 d-flex gap-4 flex-wrap"},Iwe={class:"form-check"},Awe={class:"form-check"},Dwe={class:"col-12 col-md-6 mb-4"},Pwe={class:"form-group shadow-sm"},Owe={class:"mt-2 d-flex gap-2 flex-column"},Mwe={class:"form-check form-switch"},Nwe={class:"form-check form-switch"},Rwe=CC({__name:"CaiDatDonVi",setup(e){const t=Ll(),n=Vl(),i=n.params.don_vi,a=JT(),{item:o}=Zs(a),s=wI(),{items:r}=Zs(s),l=ET(),{userAuth:c}=Zs(l),{userRole:u}=Zs(l),h=localStorage.getItem("screen_id")||null,d=bo(()=>"composite"===f.layout),f=gt({quayhienthi:[],sohanghienthi:"5",hengiotructuyen:1,hienthitieude:1,video:0,layout:"detail",don_vi:""});ei(async()=>{try{await Promise.all([l.getAuthUser(),l.getUserAuthRole(),a.fetchItemById(i)]),h&&await an(()=>{Object.assign(f,JSON.parse(localStorage.getItem(h)))}),u.value.role==zT?await Promise.all([s.fetchItemsByDonViAndManger(i,c.value.email,!0)]):await Promise.all([s.realtimeItemsByDonViAndStatus(i,!0)])}catch(eRe){}});const p=async()=>{try{if(!f.quayhienthi||!f.quayhienthi.length)return VT("Vui lòng chá»n quầy hiá»n thá»"),!1;if(!f.layout)return VT("Vui lòng chá»n giao diá»n mà n hình hiá»n thá»"),!1;if("detail"===f.layout&&!f.sohanghienthi)return VT("Vui lòng nháºp sá» lượng hà ng hiá»n thá» trong má»t quầy"),!1;f.don_vi=n.params.don_vi;const e=localStorage.getItem("screen_id"),a=e||tC(16);localStorage.setItem("screen_id",a),localStorage.setItem(a,JSON.stringify(f)),await t.push({path:"/".concat(i,"/man-hinh"),query:{sc:a}})}catch(eRe){VT("Có lá»i xảy ra. Vui lòng thá» lại sau!")}};return(e,t)=>{var n;const a=ui("router-link");return Ma(),Va("div",twe,[Ha("div",nwe,[Ha("h3",iwe,ee(null==(n=Ot(o))?void 0:n.ten),1),t[10]||(t[10]=Ha("h4",{class:"text-center"},"Cà i Äặt mà n hình trung tâm",-1))]),Ha("form",{onSubmit:Es(p,["prevent"]),class:"form-container"},[Ha("div",awe,[Ha("div",owe,[Ha("div",swe,[t[13]||(t[13]=Ha("label",{class:"form-label"},[Ga(" Quầy hiá»n thá» "),Ha("br"),Ha("small",null,[Ha("i",{class:"text-secondary"},"(Lá»±a chá»n các quầy sẽ hiá»n thá» á» mà n hình trung tâm)")])],-1)),Ot(r).length?(Ma(),Va("div",cwe,[(Ma(!0),Va(Sa,null,gi(Ot(r),e=>(Ma(),Va("div",{class:"form-check form-switch",key:e.id},[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:e.id,value:e.id,"onUpdate:modelValue":t[0]||(t[0]=e=>f.quayhienthi=e)},null,8,uwe),[[vs,f.quayhienthi]]),Ha("label",{class:"form-check-label",for:e.id},ee(null==e?void 0:e.ten),9,hwe)]))),128))])):(Ma(),Va("div",rwe,[Ha("small",null,[Ha("i",lwe,[t[12]||(t[12]=Ga("Chưa có quầy ÄÆ°á»£c tạo. Vui lòng tạo ")),za(a,{to:"/".concat(Ot(i),"/quan-ly-quay"),class:"text-link"},{default:pn(()=>t[11]||(t[11]=[Ga("tại Äây")])),_:1},8,["to"])])])]))])]),Ha("div",dwe,[Ha("div",fwe,[t[14]||(t[14]=Ha("label",{class:"form-label",for:"numCustomer"},[Ga(" Sá» lượng khách hà ng hiá»n thá» "),Ha("br"),Ha("small",null,[Ha("i",{class:"text-secondary"},"(Nháºp sá» lượng khách hà ng hiá»n thá» trên từng quầy)")])],-1)),gn(Ha("input",{type:"number",min:"1",class:"form-control",id:"numCustomer",placeholder:"Và dụ: 5","onUpdate:modelValue":t[1]||(t[1]=e=>f.sohanghienthi=e),disabled:d.value},null,8,pwe),[[ms,f.sohanghienthi]])])]),Ha("div",gwe,[Ha("div",mwe,[t[17]||(t[17]=Ha("label",{class:"form-label"},"Hiá»n thá» hẹn giá» trá»±c tuyến",-1)),Ha("div",vwe,[Ha("div",ywe,[gn(Ha("input",{class:"form-check-input",type:"radio",id:"displayOnlineTimer",value:"1","onUpdate:modelValue":t[2]||(t[2]=e=>f.hengiotructuyen=e)}
5555,null,512),[[bs,f.hengiotructuyen]]),t[15]||(t[15]=Ha("label",{class:"form-check-label",for:"displayOnlineTimer"},"Có",-1))]),Ha("div",bwe,[gn(Ha("input",{class:"form-check-input",type:"radio",id:"noDisplayOnlineTimer",value:"0","onUpdate:modelValue":t[3]||(t[3]=e=>f.hengiotructuyen=e)},null,512),[[bs,f.hengiotructuyen]]),t[16]||(t[16]=Ha("label",{class:"form-check-label",for:"noDisplayOnlineTimer"},"Không",-1))])])])]),Ha("div",_we,[Ha("div",wwe,[t[20]||(t[20]=Ha("label",{class:"form-label"},[Ga(" Hiá»n thá» tiêu Äá» "),Ha("br"),Ha("small",null,[Ha("i",{class:"text-secondary"},"(Dải tên ÄÆ¡n vá» chạy ngang trên Äầu mà n hình)")])],-1)),Ha("div",kwe,[Ha("div",xwe,[gn(Ha("input",{class:"form-check-input",type:"radio",id:"displayHeader",value:"1","onUpdate:modelValue":t[4]||(t[4]=e=>f.hienthitieude=e)},null,512),[[bs,f.hienthitieude]]),t[18]||(t[18]=Ha("label",{class:"form-check-label",for:"displayHeader"},"Có",-1))]),Ha("div",Twe,[gn(Ha("input",{class:"form-check-input",type:"radio",id:"noDisplayHeader",value:"0","onUpdate:modelValue":t[5]||(t[5]=e=>f.hienthitieude=e)},null,512),[[bs,f.hienthitieude]]),t[19]||(t[19]=Ha("label",{class:"form-check-label",for:"noDisplayHeader"},"Không",-1))])])])]),Ha("div",Cwe,[Ha("div",Ewe,[t[23]||(t[23]=Ha("label",{class:"form-label"},"Hiá»n thá» video hưá»ng dẫn",-1)),Ha("div",Swe,[Ha("div",Iwe,[gn(Ha("input",{class:"form-check-input",type:"radio",id:"displayVideo",value:"1","onUpdate:modelValue":t[6]||(t[6]=e=>f.video=e)},null,512),[[bs,f.video]]),t[21]||(t[21]=Ha("label",{class:"form-check-label",for:"displayVideo"},"Có",-1))]),Ha("div",Awe,[gn(Ha("input",{class:"form-check-input",type:"radio",id:"noDisplayVideo",value:"0","onUpdate:modelValue":t[7]||(t[7]=e=>f.video=e)},null,512),[[bs,f.video]]),t[22]||(t[22]=Ha("label",{class:"form-check-label",for:"noDisplayVideo"},"Không",-1))])])])]),Ha("div",Dwe,[Ha("div",Pwe,[t[26]||(t[26]=Ha("label",{class:"form-label"},"Lá»±a chá»n mà n hình hiá»n thá»",-1)),Ha("div",Owe,[Ha("div",Mwe,[gn(Ha("input",{class:"form-check-input",type:"radio",id:"detail_screen",value:"detail","onUpdate:modelValue":t[8]||(t[8]=e=>f.layout=e)},null,512),[[bs,f.layout]]),t[24]||(t[24]=Ha("label",{class:"form-check-label",for:"detail_screen"},"Mà n hình chi tiết",-1))]),Ha("div",Nwe,[gn(Ha("input",{class:"form-check-input",type:"radio",id:"composite_screen",value:"composite","onUpdate:modelValue":t[9]||(t[9]=e=>f.layout=e)},null,512),[[bs,f.layout]]),t[25]||(t[25]=Ha("label",{class:"form-check-label",for:"composite_screen"},"Mà n hình tá»ng hợp",-1))])])])])]),t[27]||(t[27]=Ha("div",{class:"d-flex justify-content-end"},[Ha("button",{type:"submit",class:"btn btn-custom btn-gradient-orange"},"Trình chiếu")],-1))],32)])}}},[["__scopeId","data-v-92879585"]]),Lwe={class:"queue-card text-center"};const Vwe=CC({},[["render",function(e,t){return Ma(),Va("div",Lwe,t[0]||(t[0]=[Ha("div",{class:"header-section"},[Ha("h5",{class:"title"},"Há» THá»NG XẾP HÃNG Tá»° Äá»NG")],-1),Ha("div",{class:"alert-section mt-3"},[Ha("div",{class:"alert alert-custom alert-danger shadow-sm",role:"alert"},[Ha("i",{class:"fas fa-exclamation-triangle me-2"}),Ha("span",{class:"alert-text text-uppercase"},"Bạn không có quyá»n truy cáºp!!!")]),Ha("p",{class:"mt-2 text-muted"},"Vui lòng liên há» quản trá» viên nếu bạn cần há» trợ.")],-1)]))}],["__scopeId","data-v-e0a75e9b"]]),qwe={class:"container content-container"},Fwe={class:"button-section"};const Bwe=CC({},[["render",function(e,t){const n=ui("router-link");return Ma(),Va("div",qwe,[t[4]||(t[4]=Ha("div",{class:"header"},[Ha("h3",{class:"text-center"},"BÃO CÃO - THá»NG KÃ")],-1)),Ha("div",Fwe,[za(n,{class:"btn btn-custom btn-gradient-orange",to:"/thong-ke-chung"},{default:pn(()=>t[0]||(t[0]=[Ga(" Thá»ng kê tá»ng hợp chung ")])),_:1}),za(n,{class:"btn btn-custom btn-gradient-orange",to:"/thong-ke-chi-tiet-khach"},{default:pn(()=>t[1]||(t[1]=[Ga(" Thá»ng kê chi tiết khách hà ng ")])),_:1}),za(n,{class:"btn btn-custom btn-gradient-orange",to:"/thong-ke-top-khach"},{default:pn(()=>t[2]||(t[2]=[Ga(" Top khách hà ng giao dá»ch ")])),_:1}),za(n,{class:"btn btn-custom btn-gradient-orange",to:"/tong-quan-don-vi"},{default:pn(()=>t[3]||(t[3]=[Ga(" Tá»ng quan ÄÆ¡n vá» ")])),_:1})])])}],["__scopeId","data-v-f3f7063f"]]),Uwe={class:"container content-container"},jwe={class:"header"},Hwe={class:"text-center text-uppercase"},zwe={class:"button-section"},Wwe={__name:"ThongKeDonVi",setup(e){const t=Vl().params.don_vi,n=JT(),{item:i}=Zs(n),a=It("");return ei(async()=>{await Promise.all([n.fetchItemById(t)]),a.value=i.value.ten||"Không xác Äá»nh"}),(e,t)=>{var n,o,s;const r=ui("router-link");return Ma(),Va("div",Uwe,[Ha("div",jwe,[Ha("h3",Hwe,[t[0]||(t[0]=Ga("CHI TIẾT KHÃCH HÃNG ")),t[1]||(t[1]=Ha("br",null,null,-1)),Ga(ee(a.value),1)])]),Ha("div",zwe,[za(r,{class:"btn btn-custom btn-gradient-orange",to:"/".concat(null==(n=Ot(i))?void 0:n.id,"/thong-ke-c
5555hung")},{default:pn(()=>t[2]||(t[2]=[Ga(" Thá»ng kê tá»ng hợp chung ")])),_:1},8,["to"]),za(r,{class:"btn btn-custom btn-gradient-orange",to:"/".concat(null==(o=Ot(i))?void 0:o.id,"/thong-ke-chi-tiet-khach")},{default:pn(()=>t[3]||(t[3]=[Ga(" Thá»ng kê chi tiết khách hà ng ")])),_:1},8,["to"]),za(r,{class:"btn btn-custom btn-gradient-orange",to:"/".concat(null==(s=Ot(i))?void 0:s.id,"/thong-ke-top-khach")},{default:pn(()=>t[4]||(t[4]=[Ga(" Top khách hà ng giao dá»ch ")])),_:1},8,["to"])])])}}},Kwe=CC(Wwe,[["__scopeId","data-v-14f0a0be"]]),Gwe={class:"queue-card text-center"},Ywe={__name:"DepartNotWork",setup(e){const t=Ll(),n=()=>{t.push("/")};return(e,t)=>(Ma(),Va("div",Gwe,[t[2]||(t[2]=Ha("div",{class:"header-section"},[Ha("h5",{class:"title"},"Há» THá»NG XẾP HÃNG Tá»° Äá»NG")],-1)),Ha("div",{class:"alert-section mt-3"},[t[0]||(t[0]=Ha("div",{class:"alert alert-custom alert-danger shadow-sm",role:"alert"},[Ha("i",{class:"fas fa-exclamation-circle me-2"}),Ha("span",{class:"alert-text text-uppercase"},"Quầy Äã ngừng hoạt Äá»ng")],-1)),t[1]||(t[1]=Ha("p",{class:"mt-2 text-muted"},"Quầy Äã ngừng hoạt Äá»ng hoặc Äã bá» xóa.",-1)),Ha("button",{class:"btn btn-custom btn-gradient-blue",onClick:n},"Quay lại trang chá»§")])]))}},Qwe=CC(Ywe,[["__scopeId","data-v-96d32896"]]),$we={class:"container content-container"},Xwe={class:"p-3"},Jwe={class:"row"},Zwe={class:"col-md-6 col-xl-3 mb-2"},eke={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #6e8efb, #7780e3)",color:"white"}},tke={class:"card-body text-center"},nke={class:"card-text display-6 fw-bold"},ike={class:"col-md-6 col-xl-3 mb-2"},ake={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #ff9d6e, #ff6b6b)",color:"white"}},oke={class:"card-body text-center"},ske={class:"card-text display-6 fw-bold"},rke={class:"col-md-6 col-xl-3 mb-2"},lke={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #6e8efb, #7780e3)",color:"white"}},cke={class:"card-body text-center"},uke={class:"card-text display-6 fw-bold"},hke={class:"col-md-6 col-xl-3 mb-2"},dke={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #ff9d6e, #ff6b6b)",color:"white"}},fke={class:"card-body text-center"},pke={class:"card-text display-6 fw-bold"},gke={class:"card chart-card shadow-sm mt-4"},mke={class:"card-body"},vke={class:"pie-chart-container position-relative"},yke={key:0,class:"no-data-text"},bke={class:"filter-container mt-3"},_ke={class:"row"},wke={class:"col-md-6"},kke={class:"card filter-card shadow-sm"},xke={class:"card-body"},Tke={class:"form-group"},Cke={class:"row"},Eke={class:"col-12 col-md-6 mb-3"},Ske=["value"],Ike={class:"col-12 col-md-6 mb-3"},Ake={class:"col-md-6 mb-3 mb-md-0"},Dke={class:"card filter-card shadow-sm"},Pke={class:"card-body"},Oke={class:"form-group"},Mke={class:"row"},Nke={class:"col-md-6 col-12 mb-3"},Rke={key:0,class:"col-md-6 col-12 mb-3"},Lke=["value"],Vke={key:1,class:"col-md-6 col-12 mb-3"},qke=["value"],Fke={key:2,class:"col-md-6 col-12 mb-3"},Bke={key:3,class:"col-md-6 col-12 mb-3"},Uke={key:0,class:"mt-3"},jke={class:"card chart-card shadow-sm"},Hke={class:"card-body"},zke={class:"text-center section-title"},Wke={class:"fullwidth-chart-container"},Kke=["id"],Gke={key:1,class:"mt-3"},Yke={class:"card chart-card shadow-sm"},Qke={class:"card-body"},$ke={class:"text-center section-title"},Xke={class:"pie-chart-container"},Jke=["id"],Zke={key:0,class:"no-data-text"},exe={class:"card chart-card shadow-sm mt-3"},txe={class:"card-body"},nxe={class:"text-center section-title"},ixe={class:"card chart-card shadow-sm mt-3"},axe={class:"card-body"},oxe={class:"text-center section-title"},sxe=["id"],rxe={class:"card chart-card shadow-sm mt-3"},lxe={class:"card-body"},cxe={class:"text-center section-title"},uxe=["id"],hxe={__name:"ThongKeChung",setup(e){lre.register(Dve),Ll();const t=Gee(),n=JT(),i=wI(),{items:a}=Zs(t),{items:o}=Zs(n),{items:s}=Zs(i),r=gt([]),l=It("year"),c=It((new Date).getFullYear()),u=It(1),h=It(""),d=It(""),f=It(""),p=It("xephang");let g=[],m=null,v={},y=null,b=null,_=It(!1),w=gt({}),k=null;const x=It(0);ei(async()=>{await Promise.all([t.fetchItems(),n.fetchItems(),i.fetchItems()]);const e=new Map;s.value.forEach(t=>{const n=t.ten.match(/\d+/),i=n?parseInt(n[0],10):null;if(null===i){const n=t.ten.toLowerCase();if(e.has(n)){const i=e.get(n);t.hoatdong&&(i.ten=t.ten,i.id=t.id),i.ids.push(t.id)}else e.set(n,{ten:t.ten,id:t.id,ids:[t.id]})}else{const n="Sá» ".concat(i<10?"0"+i:i);if(e.has(i)){const a=e.get(i);t.hoatdong&&(a.ten=n,a.id=t.id),a.ids.push(t.id)}else e.set(i,{ten:n,id:t.id,ids:[t.id]})}}),r.splice(0,r.length,...a.value.filter(e=>e.ngaythongke&&!isNaN(new Date(e.ngaythongke).getTime())).map(t=>{var n;const i=(null==(n=o.value.find(e=>e.id===t.donvi))?void 0:n.ten)||"Unknown",a=Array.from(e.values()).find(e=>e.ids.includes(t.quay)),s=a?a.ten:"Unknown";return{...t,tenDonVi:i,tenQuay:s}}).filter(e=>"Unknown"!==e.tenQuay&&"Quầy không xác Äá»nh"!==e.tenQuay)),await an(),L(),V(),q()});const T=bo(()=>r.reduce((e,t)=>
5555e+(t.soluongkhach||0),0)),C=bo(()=>{const e=new Date,t=new Date(e);t.setDate(e.getDate()-e.getDay()),t.setHours(0,0,0,0);const n=new Date(t);return n.setDate(t.getDate()+6),n.setHours(23,59,59,999),r.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n}).reduce((e,t)=>e+(t.soluongkhach||0),0)}),E=bo(()=>{const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1,0,0,0,0),n=new Date(e.getFullYear(),e.getMonth()+1,0,23,59,59,999);return r.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n}).reduce((e,t)=>e+(t.soluongkhach||0),0)}),S=bo(()=>{const e=(new Date).getFullYear();return r.filter(t=>new Date(t.ngaythongke).getFullYear()===e).reduce((e,t)=>e+(t.soluongkhach||0),0)}),I=bo(()=>[...new Set(r.map(e=>e.tenDonVi))].filter(e=>"Unknown"!==e)),A=bo(()=>f.value?[f.value]:[]),D=bo(()=>[...new Set(r.map(e=>new Date(e.ngaythongke).getFullYear()))].sort((e,t)=>t-e)),P=bo(()=>{const e=c.value,t=u.value-1,n=new Date(e,t,1),i=new Date(e,t+1,0).getDate(),a=n.getDay();return Math.ceil((i+a)/7)}),O=bo(()=>A.value.map(e=>{const t=[...new Set(r.filter(t=>t.tenDonVi===e).map(e=>e.tenQuay))];return{donvi:e,data:t.map(t=>{const n=Array(12).fill(0);return r.filter(n=>n.tenDonVi===e&&n.tenQuay===t&&new Date(n.ngaythongke).getFullYear()===c.value&&(!p.value||n.phanloai===p.value)).forEach(e=>{const t=new Date(e.ngaythongke).getMonth();n[t]+=e.soluongkhach}),{tenQuay:t,monthlyData:n}})}})),M=bo(()=>"week"===l.value||"month"===l.value?"Tháng ".concat(u.value," NÄm ").concat(c.value):"dateRange"===l.value?h.value&&d.value?"Từ ".concat(iC(h.value)," Äến ").concat(iC(d.value)):"Chưa chá»n khoảng thá»i gian":"NÄm ".concat(c.value)),N=bo(()=>"xephang"===p.value?"Khách xếp hà ng":"Khách hẹn giá»"),R=e=>{let t;if("week"===l.value){const n=new Date(c.value,u.value-1,1,0,0,0,0),i=new Date(c.value,u.value,0,23,59,59,999);t=r.filter(t=>{const a=new Date(t.ngaythongke);return t.tenDonVi===e&&a>=n&&a<=i&&(!p.value||t.phanloai===p.value)})}else if("month"===l.value){const n=new Date(c.value,u.value-1,1,0,0,0,0),i=new Date(c.value,u.value,0,23,59,59,999);t=r.filter(t=>{const a=new Date(t.ngaythongke);return t.tenDonVi===e&&a>=n&&a<=i&&(!p.value||t.phanloai===p.value)})}else if("dateRange"===l.value){if(!h.value||!d.value)return{labels:[],datasets:[{label:"Tá»ng sá» khách",data:[],backgroundColor:[],borderWidth:1}]};const n=new Date(h.value),i=new Date(d.value);if(i.setHours(23,59,59,999),isNaN(n.getTime())||isNaN(i.getTime())||i<n)return{labels:[],datasets:[{label:"Tá»ng sá» khách",data:[],backgroundColor:[],borderWidth:1}]};t=r.filter(t=>{const a=new Date(t.ngaythongke);return t.tenDonVi===e&&a>=n&&a<=i&&(!p.value||t.phanloai===p.value)})}else t=r.filter(t=>t.tenDonVi===e&&new Date(t.ngaythongke).getFullYear()===c.value&&(!p.value||t.phanloai===p.value));const n=[...new Set(t.map(e=>e.tenQuay))],i=n.map(e=>t.filter(t=>t.tenQuay===e).reduce((e,t)=>e+(t.soluongkhach||0),0));return{labels:n,datasets:[{label:"Tá»ng sá» khách",data:i,backgroundColor:n.map((e,t)=>"rgba(".concat(50*t%255,", ").concat(100*t%255,", ").concat(150*t%255,", 0.5)")),borderWidth:1}]}},L=()=>{g.forEach(e=>e.destroy()),g=[],f.value&&O.value.forEach(e=>{const t=document.getElementById("barChart-".concat(e.donvi));if(!t)return;const n=new lre(t.getContext("2d"),{type:"bar",data:{labels:Array.from({length:12},(e,t)=>"T".concat(t+1)),datasets:e.data.map((e,t)=>({label:e.tenQuay,data:e.monthlyData,backgroundColor:"rgba(".concat(50*t%255,", ").concat(100*t%255,", ").concat(150*t%255,", 0.5)"),borderColor:"rgba(".concat(50*t%255,", ").concat(100*t%255,", ").concat(150*t%255,", 1)"),borderWidth:1,barThickness:20}))},options:{maintainAspectRatio:!1,scales:{y:{beginAtZero:!0,title:{display:!0,text:"Sá» lượng khách"}},x:{title:{display:!0,text:"Tháng"}}},plugins:{legend:{display:!0,position:"top"},title:{display:!0,text:"Thá»ng kê sá» khách theo quầy qua từng tháng nÄm ".concat(c.value," - ").concat(e.donvi," - ").concat(N.value)},datalabels:{display:!1}}}});g.push(n)})},V=()=>{m&&m.destroy(),Object.values(v).forEach(e=>e.destroy()),v={};const e=document.getElementById("totalPieChart");if(e){const t=(()=>{let e;if("week"===l.value){const t=new Date(c.value,u.value-1,1,0,0,0,0),n=new Date(c.value,u.value,0,23,59,59,999);e=r.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n})}else if("month"===l.value){const t=new Date(c.value,u.value-1,1,0,0,0,0),n=new Date(c.value,u.value,0,23,59,59,999);e=r.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n})}else if("dateRange"===l.value){if(!h.value||!d.value)return{labels:I.value,datasets:[{label:"Tá»ng sá» khách",data:[],backgroundColor:[],borderWidth:1}]};const t=new Date(h.value),n=new Date(d.value);if(n.setHours(23,59,59,999),isNaN(t.getTime())||isNaN(n.getTime())||n<t)return{labels:I.value,datasets:[{label:"Tá»ng sá» khách",data:[],backgroundColor:[],borderWidth:1}]};e=r.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n})}else e=r.filter(e=>new Date(e.ngaythongke).getFullYear()===c.value);const t=I.value.map(t=>e.filter(e=>e.tenDonVi===t).reduce((e,t)=>
5555e+(t.soluongkhach||0),0));return{labels:I.value,datasets:[{label:"Tá»ng sá» khách",data:t,backgroundColor:I.value.map((e,t)=>"rgba(".concat(50*t%255,", ").concat(100*t%255,", ").concat(150*t%255,", 0.5)")),borderWidth:1}]}})();_.value=t.datasets[0].data.every(e=>0===e);const n=t.datasets[0].data.reduce((e,t)=>e+t,0),i=t.datasets[0].data.map(e=>n>0?e/n*100:0);if(n>0){const e=i.reduce((e,t)=>e+t,0);if(Math.abs(e-100)>.1){let n=0,a=t.datasets[0].data[0];t.datasets[0].data.forEach((e,t)=>{e>a&&(a=e,n=t)}),i[n]+=100-e}}m=new lre(e.getContext("2d"),{type:"pie",data:{labels:t.labels.map((e,t)=>{var n;return"".concat(e," (").concat((null==(n=i[t])?void 0:n.toFixed(1))||"0.0","%)")}),datasets:[{label:"Tá»ng sá» khách",data:t.datasets[0].data,backgroundColor:t.datasets[0].backgroundColor,borderWidth:1}]},options:{maintainAspectRatio:!1,plugins:{legend:{display:!0,align:"center",labels:{boxWidth:15,padding:15,font:{size:11}}},title:{display:!0,text:["Tá»ng sá» khách theo ÄÆ¡n vá» (".concat(M.value,")"),"Tá»ng sá»: ".concat(n," khách")],font:{size:14}},datalabels:{color:"#fff",formatter:e=>0===e?"":"".concat(e),font:{size:12,weight:"bold"},display:e=>e.dataset.data[e.dataIndex]>0},tooltip:{callbacks:{label:e=>{var n;const a=e.dataIndex,o=e.raw,s=(null==(n=i[a])?void 0:n.toFixed(1))||"0.0";return"".concat(t.labels[a],": ").concat(o," (").concat(s,"%)")}}}}}})}if(f.value){const e=document.getElementById("pieChart-".concat(f.value));if(e){const t=R(f.value);w[f.value]=t.datasets[0].data.every(e=>0===e);const n=t.datasets[0].data.reduce((e,t)=>e+t,0),i=t.datasets[0].data.map(e=>n>0?e/n*100:0);t.labels.map((e,t)=>"".concat(e," (").concat(i[t].toFixed(1),"%)"));const a=new lre(e.getContext("2d"),{type:"pie",data:{labels:t.labels.map((e,t)=>{var n;return"".concat(e," (").concat((null==(n=i[t])?void 0:n.toFixed(1))||"0.0","%)")}),datasets:[{label:"Tá»ng sá» khách",data:t.datasets[0].data,backgroundColor:t.datasets[0].backgroundColor,borderWidth:1}]},options:{maintainAspectRatio:!1,plugins:{legend:{display:!0,align:"center",labels:{boxWidth:15,padding:15,font:{size:11}}},title:{display:!0,text:["".concat(f.value," - Tá»ng sá» khách theo quầy (").concat(M.value,")"),"Tá»ng sá»: ".concat(n," khách - ").concat(N.value)],font:{size:14}},datalabels:{color:"#fff",formatter:e=>0===e?"":"".concat(e),font:{size:12,weight:"bold"},display:e=>e.dataset.data[e.dataIndex]>0},tooltip:{callbacks:{label:e=>{var n;const a=e.dataIndex,o=e.raw,s=(null==(n=i[a])?void 0:n.toFixed(1))||"0.0";return"".concat(t.labels[a],": ").concat(o," (").concat(s,"%)")}}}}}});v[f.value]=a}}},q=()=>{y&&y.destroy();const e=document.getElementById("lineChart");if(!e||!f.value)return;const t=(()=>{if(!f.value)return null;const e=f.value;let t,n,i=[],a=[];const o=[...new Set(r.filter(t=>t.tenDonVi===e).map(e=>e.tenQuay))];if("year"===l.value)t=new Date(c.value,0,1),n=new Date(c.value,11,31),i=Array.from({length:12},(e,t)=>"T".concat(t+1)),a=o.map((t,n)=>{const i=Array(12).fill(0);return r.filter(n=>n.tenDonVi===e&&n.tenQuay===t&&new Date(n.ngaythongke).getFullYear()===c.value&&(!p.value||n.phanloai===p.value)).forEach(e=>{const t=new Date(e.ngaythongke).getMonth();i[t]+=e.soluongkhach}),{label:t,data:i,borderColor:"rgba(".concat(50*n%255,", ").concat(100*n%255,", ").concat(150*n%255,", 1)"),fill:!1,tension:.1}});else if("month"===l.value){t=new Date(c.value,u.value-1,1),n=new Date(c.value,u.value,0);const s=n.getDate();i=Array.from({length:s},(e,t)=>"".concat(t+1,"/").concat(u.value)),a=o.map((i,a)=>{const o=Array(s).fill(0);return r.filter(a=>a.tenDonVi===e&&a.tenQuay===i&&new Date(a.ngaythongke)>=t&&new Date(a.ngaythongke)<=n&&(!p.value||a.phanloai===p.value)).forEach(e=>{const t=new Date(e.ngaythongke).getDate()-1;o[t]+=e.soluongkhach}),{label:i,data:o,borderColor:"rgba(".concat(50*a%255,", ").concat(100*a%255,", ").concat(150*a%255,", 1)"),fill:!1,tension:.1}})}else if("week"===l.value){t=new Date(c.value,u.value-1,1),n=new Date(c.value,u.value,0);const s=P.value;i=Array.from({length:s},(e,t)=>"Tuần ".concat(t+1)),a=o.map((i,a)=>{const o=Array(s).fill(0);return r.filter(a=>a.tenDonVi===e&&a.tenQuay===i&&new Date(a.ngaythongke)>=t&&new Date(a.ngaythongke)<=n&&(!p.value||a.phanloai===p.value)).forEac
5555h(e=>{const n=new Date(e.ngaythongke),i=Math.floor((n.getDate()+t.getDay()-1)/7);o[i]+=e.soluongkhach}),{label:i,data:o,borderColor:"rgba(".concat(50*a%255,", ").concat(100*a%255,", ").concat(150*a%255,", 1)"),fill:!1,tension:.1}})}else if("dateRange"===l.value){if(!h.value||!d.value)return{labels:[],datasets:[]};if(t=new Date(h.value),n=new Date(d.value),n.setHours(23,59,59,999),isNaN(t.getTime())||isNaN(n.getTime())||n<t)return{labels:[],datasets:[]};const s=Math.ceil((n-t)/864e5)+1;if(s<=0||s>365)return{labels:[],datasets:[]};i=Array.from({length:s},(e,n)=>{const i=new Date(t);return i.setDate(i.getDate()+n),"".concat(i.getDate(),"/").concat(i.getMonth()+1)}),a=o.map((i,a)=>{const o=Array(s).fill(0);return r.filter(a=>a.tenDonVi===e&&a.tenQuay===i&&new Date(a.ngaythongke)>=t&&new Date(a.ngaythongke)<=n&&(!p.value||a.phanloai===p.value)).forEach(e=>{const n=Math.floor((new Date(e.ngaythongke)-t)/864e5);o[n]+=e.soluongkhach}),{label:i,data:o,borderColor:"rgba(".concat(50*a%255,", ").concat(100*a%255,", ").concat(150*a%255,", 1)"),fill:!1,tension:.1}})}return{labels:i,datasets:a}})();t&&t.labels&&0!==t.labels.length&&(y=new lre(e.getContext("2d"),{type:"line",data:{labels:t.labels,datasets:t.datasets},options:{maintainAspectRatio:!1,scales:{y:{beginAtZero:!0,title:{display:!0,text:"Sá» lượng khách"}},x:{title:{display:!0,text:"year"===l.value?"Tháng":"month"===l.value?"Ngà y":"week"===l.value?"Tuần":"Ngà y"}}},plugins:{legend:{display:!0,position:"top"},title:{display:!0,text:"Xu hưá»ng khách theo quầy qua thá»i gian (".concat(M.value,") - ").concat(f.value," - ").concat(N.value)},datalabels:{display:!1},tooltip:{callbacks:{title:function(e){const t=e[0].label;return chartData.tooltipTitle(t)},label:function(e){return"Sá» khách: ".concat(e.raw)}}}},interaction:{mode:"index",intersect:!1},tooltips:{enabled:!0}}}))},F=()=>{b&&b.destroy();const e=document.getElementById("horizontalBarChart-".concat(f.value));if(!e||!f.value)return;const t=R(f.value),n=[...new Set(t.labels)],i=n.map(e=>({quay:e,total:t.datasets[0].data[n.indexOf(e)]})).sort((e,t)=>t.total-e.total).slice(0,5);b=new lre(e.getContext("2d"),{type:"bar",data:{labels:i.map(e=>e.quay),datasets:[{label:"Sá» lượng khách",data:i.map(e=>e.total),backgroundColor:"rgba(75, 192, 192, 0.5)",borderColor:"rgba(75, 192, 192, 1)",borderWidth:1}]},options:{maintainAspectRatio:!1,indexAxis:"y",scales:{x:{beginAtZero:!0,title:{display:!0,text:"Sá» lượng khách"}}},plugins:{legend:{display:!1},title:{display:!0,text:"Top quầy cá»§a ÄÆ¡n vá» ".concat(f.value," (").concat(M.value,") - ").concat(N.value)},tooltip:{callbacks:{title:function(e){const t=e[0].label;return chartData.tooltipTitle(t)},label:function(e){return"Sá» khách: ".concat(e.raw)}}}}}})},B=async()=>{await an(),V(),q(),F(),z()},U=async()=>{await an(),L(),V(),q(),F(),z(),LT("Äã cáºp nháºt dữ liá»u thá»ng kê biá»u Äá».")},j=async()=>{await an(),V(),q(),F(),z(),LT("Äã cáºp nháºt dữ liá»u thá»ng kê biá»u Äá».")},H=async()=>{await an(),L(),V(),q(),F(),z()},z=()=>{if(!f.value)return;k&&k.destroy();const e=document.getElementById("yearStatsChart-".concat(f.value));if(!e)return;let t;if(t="week"===l.value?(()=>{if(!f.value)return null;const e=r.filter(e=>{const t=new Date(e.ngaythongke);return(!p.value||e.phanloai===p.value)&&t.getMonth()+1===u.value&&t.getFullYear()===c.value&&e.tenDonVi===f.value}),t=Array(P.value).fill(0);return e.forEach(e=>{const n=new Date(e.ngaythongke),i=Math.floor((n.getDate()-1+new Date(c.value,u.value-1,1).getDay())/7);i>=0&&i<t.length&&(t[i]+=e.soluongkhach||0)}),{labels:Array.from({length:P.value},(e,t)=>"Tuần ".concat(t+1)),data:t,total:t.reduce((e,t)=>e+t,0),xAxisTitle:"Tuần trong tháng",tooltipTitle:e=>"".concat(e," - Tháng ").concat(u.value,"/").concat(c.value)}})():"month"===l.value?(()=>{if(!f.value)return null;const e=new Date(c.value,u.value,0).getDate(),t=r.filter(e=>{const t=new Date(e.ngaythongke);return e.tenDonVi===f.value&&(!p.value||e.phanloai===p.value)&&t.getMonth()+1===u.value&&t.getFullYear()===c.value}),n=Array(e).fill(0);return t.forEach(t=>{const i=new Date(t.ngaythongke).getDate();i>=1&&i<=e&&(n[i-1]+=t.soluongkhach||0)}),{labels:Array.from({length:e},(e,t)=>"".concat(t+1)),data:n,total:n.reduce((e,t)=>
5555e+t,0),xAxisTitle:"Ngà y trong tháng",tooltipTitle:e=>"Ngà y ".concat(e,"/").concat(u.value,"/").concat(c.value)}})():"dateRange"===l.value?(()=>{if(!f.value)return null;if(!h.value||!d.value)return null;const e=new Date(h.value);e.setHours(0,0,0,0);const t=new Date(d.value);t.setHours(23,59,59,999);const n=Math.ceil((t-e)/864e5)+1,i=r.filter(n=>{const i=new Date(n.ngaythongke);return(!p.value||n.phanloai===p.value)&&i>=e&&i<=t&&n.tenDonVi===f.value}),a=Array(n).fill(0);return i.forEach(t=>{const n=new Date(t.ngaythongke),i=Math.floor((n-e)/864e5);i>=0&&i<a.length&&(a[i]+=t.soluongkhach||0)}),{labels:Array.from({length:n},(t,n)=>{const i=new Date(e);return i.setDate(i.getDate()+n),"".concat(i.getDate(),"/").concat(i.getMonth()+1)}),data:a,total:a.reduce((e,t)=>e+t,0),xAxisTitle:"Ngà y",tooltipTitle:e=>{const[t,n]=e.split("/");return"Ngà y ".concat(t,"/").concat(n,"/").concat(c.value)}}})():(()=>{if(!f.value)return null;const e=r.filter(e=>{const t=new Date(e.ngaythongke);return e.tenDonVi===f.value&&(!p.value||e.phanloai===p.value)&&t.getFullYear()===c.value}),t=Array(12).fill(0);return e.forEach(e=>{const n=new Date(e.ngaythongke).getMonth();t[n]+=e.soluongkhach||0}),{labels:["T1","T2","T3","T4","T5","T6","T7","T8","T9","T10","T11","T12"],data:t,total:t.reduce((e,t)=>e+t,0),xAxisTitle:"Tháng trong nÄm",tooltipTitle:e=>"Tháng ".concat(parseInt(e.substring(1)),"/").concat(c.value)}})(),!t)return;x.value=t.total;const n=window.innerWidth<768;k=new lre(e,{type:n?"line":"bar",data:{labels:t.labels,datasets:[{label:"Sá» lượng khách",data:t.data,backgroundColor:n?"rgba(104, 132, 245, 0.2)":Array.from({length:t.data.length},(e,t)=>"hsla(".concat(30*t%360,", 70%, 50%, 0.7)")),borderColor:n?"rgba(104, 132, 245, 1)":Array.from({length:t.data.length},(e,t)=>"hsla(".concat(30*t%360,", 70%, 50%, 1)")),borderWidth:n?2:1,tension:.3,fill:!n&&void 0,pointBackgroun
5555dColor:n?"rgba(104, 132, 245, 1)":void 0,pointRadius:n?3:void 0,pointHoverRadius:n?5:void 0}]},options:{maintainAspectRatio:!1,responsive:!0,resizeDelay:0,animation:{duration:1e3,easing:"easeOutQuart"},plugins:{title:{display:!0,text:["".concat(f.value," - Thá»ng kê lượng khách (").concat(M.value,")"),"Tá»ng sá»: ".concat(t.total," khách - ").concat(N.value)],font:{size:14}},legend:{display:!1},datalabels:{display:!1},tooltip:{callbacks:{title:function(e){const n=e[0].label;return t.tooltipTitle(n)},label:function(e){return"Sá» khách: ".concat(e.raw)}}}},scales:{y:{beginAtZero:!0,title:{display:!0,text:"Sá» lượng khách"}},x:{title:{display:!0,text:t.xAxisTitle}}}}})};return(e,t)=>(Ma(),Va("div",$we,[t[26]||(t[26]=Ha("div",{class:"header"},[Ha("h3",{class:"text-center text-uppercase"},"THá»NG Kà Tá»NG HỢP CHUNG")],-1)),Ha("div",Xwe,[Ha("div",Jwe,[Ha("div",Zwe,[Ha("div",eke,[Ha("div",tke,[t[7]||(t[7]=Ha("h5",{class:"card-title"},"Tá»ng khách tuần hiá»n tại",-1)),Ha("p",nke,ee(C.value),1)])])]),Ha("div",ike,[Ha("div",ake,[Ha("div",oke,[t[8]||(t[8]=Ha("h5",{class:"card-title"},"Tá»ng khách tháng hiá»n tại",-1)),Ha("p",ske,ee(E.value),1)])])]),Ha("div",rke,[Ha("div",lke,[Ha("div",cke,[t[9]||(t[9]=Ha("h5",{class:"card-title"},"Tá»ng khách nÄm hiá»n tại",-1)),Ha("p",uke,ee(S.value),1)])])]),Ha("div",hke,[Ha("div",dke,[Ha("div",fke,[t[10]||(t[10]=Ha("h5",{class:"card-title"},"Tá»ng sá» khách toà n thá»i gian",-1)),Ha("p",pke,ee(T.value),1)])])])]),Ha("div",gke,[Ha("div",mke,[t[12]||(t[12]=Ha("h4",{class:"section-title text-center"},"Tá»ng sá» khách theo ÄÆ¡n vá»",-1)),Ha("div",vke,[t[11]||(t[11]=Ha("canvas",{id:"totalPieChart",class:"pie-chart",width:"700",height:"700"},null,-1)),Ot(_)?(Ma(),Va("p",yke,"Không có dữ liá»u")):Qa("",!0)])])]),Ha("div",bke,[Ha("div",_ke,[Ha("div",wke,[Ha("div",kke,[t[17]||(t[17]=Ha("div",{class:"card-header"},[Ha("h5",{class:"filter-title"},"Lá»c theo ÄÆ¡n vá»")],-1)),Ha("div",xke,[Ha("div",Tke,[Ha("div",Cke,[Ha("div",Eke,[t[14]||(t[14]=Ha("label",{for:"donViFilter",class:"form-label"},"Chá»n ÄÆ¡n vá»:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[0]||(t[0]=e=>f.value=e),onChange:H,class:"form-control"},[t[13]||(t[13]=Ha("option",{value:"",disabled:"",selected:""},"Chá»n má»t ÄÆ¡n vá»",-1)),(Ma(!0),Va(Sa,null,gi(I.value,e=>(Ma(),Va("option",{key:e,value:e},ee(e),9,Ske))),128))],544),[[_s,f.value]])]),Ha("div",Ike,[t[16]||(t[16]=Ha("label",{for:"typeCustomerFilter",class:"form-label"},"Chá»n loại khách:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[1]||(t[1]=e=>p.value=e),onChange:H,class:"form-control"},t[15]||(t[15]=[Ha("option",{value:"",disabled:"",selected:""},"Chá»n loại khách",-1),Ha("option",{value:"xephang"},"Xếp hà ng",-1),Ha("option",{value:"hengio"},"Hẹn giá»",-1)]),544),[[_s,p.value]])])])])])])]),Ha("div",Ake,[Ha("div",Dke,[t[24]||(t[24]=Ha("div",{class:"card-header"},[Ha("h5",{class:"filter-title"},"Lá»c theo thá»i gian")],-1)),Ha("div",Pke,[Ha("div",Oke,[Ha("div",Mke,[Ha("div",Nke,[t[19]||(t[19]=Ha("label",{for:"filterTypePie",class:"form-label"},"Lá»c theo:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[2]||(t[2]=e=>l.value=e),onChange:B,class:"form-control"},t[18]||(t[18]=[Ha("option",{value:"year"},"NÄm",-1),Ha("option",{value:"month"},"Tháng",-1),Ha("option",{value:"week"},"Tuần",-1),Ha("option",{value:"dateRange"},"Từ ngà y - Äến ngà y",-1)]),544),[[_s,l.value]])]),"dateRange"!==l.value?(Ma(),Va("div",Rke,[t[20]||(t[20]=Ha("label",{for:"yearFilter",class:"form-label"},"NÄm:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[3]||(t[3]=e=>c.value=e),onChange:U,class:"form-control"},[(Ma(!0),Va(Sa,null,gi(D.value,e=>(Ma(),Va("option",{key:e,value:e},ee(e),9,Lke))),128))],544),[[_s,c.value]])])):Qa("",!0),"month"===l.value||"week"===l.value?(Ma(),Va("div",Vke,[t[21]||(t[21]=Ha("label",{for:"monthFilter",class:"form-label"},"Tháng:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[4]||(t[4]=e=>u.value=e),onChange:B,class:"form-control"},[(Ma(),Va(Sa,null,gi(12,e=>Ha("option",{key:e,value:e},"Tháng "+ee(e),9,qke)),64))],544),[[_s,u.value]])])):Qa("",!0),"dateRange"===l.value?(Ma(),Va("div",Fke,[t[22]||(t[22]=Ha("label",{for:"startDate",class:"form-label"},"Từ ngà y:",-1)),gn(Ha("input",{type:"date","onUpdate:modelValue":t[5]||(t[5]=e=>h.value=e),onChange:j,class:"form-control"},null,544),[[ms,h.value]])])):Qa("",!0),"dateRange"===l.value?(Ma(),Va("div",Bke,[t[23]||(t[23]=Ha("label",{for:"endDate",class:"form-label"},"Äến ngà y:",-1)),gn(Ha("input",{type:"date","onUpdate:modelValue":t[6]||(t[6]=e=>d.value=e),onChange:j,class:"form-control"},null,544),[[ms,d.value]])])):Qa("",!0)])])])])])])]),f.value?(Ma(),Va("div",Uke,[Ha("div",jke,[Ha("div",Hke,[Ha("h4",zke,"Thá»ng kê tá»ng lượng khách - "+ee(f.value),1),Ha("div",Wke,[Ha("canvas",{id:"yearStatsChart-"+f.value,class:"full-width-chart"},null,8,Kke)])])])])):Qa("",!0),f.value?(Ma(),Va("div",Gke,[Ha("div",Yke,[Ha("div",Qke,[Ha("h4",$ke,"Tá»ng sá» khách theo quầy cá»§a ÄÆ¡n vá» "+ee(f.value),1),Ha("div",Xke,[Ha("canvas",{id:"pieChart-"+f.value,class:"pie-chart",width:"400",height:"400"},null,8,Jke),Ot(w)[f.value]?(Ma(),Va("p",Zke,"Không có dữ liá»u")):Qa("",!0)])])]),Ha("div",exe,[Ha("div",txe,[Ha("h4",nxe,"Xu hưá»ng khách theo quầy qua thá»i gian - "+ee(f.value),1),t[25]||(t[25]=Ha("canvas",{id:"lineChart",class:"full-width-chart",height:"500"},null,-1))])]),Ha("div",ixe,[Ha("div",axe,[Ha("h4",oxe,"Top quầy cá»§a ÄÆ¡n vá» "+ee(f.value),1),Ha("canvas",{id:"horizontalBarChart-"+f.value,class:"full-width-chart",height:"400"},null,8,sxe)])]),Ha("div",rxe,[Ha("div",lxe,[Ha("h4",cxe,"Thá»ng kê sá» khách theo quầy qua từng tháng - "+ee(f.value),1),Ha("canvas",{id:"barChart-"+f.value,class:"full-width-chart",height:"500"},null,8,uxe)])])])):Qa("",!0)])]))}},dxe=CC(hxe,[["__scopeId","data-v-3c7ee18e"]]),fxe={class:"container content-container"},pxe={class:"p-3"},gxe={class:"row"},mxe={class:"col-md-6 col-xl-3 mb-2"},vxe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #6e8efb, #7780e3)",color:"white"}},yxe={class:"card-body text-center"},bxe={class:"card-text display-6 fw-bold"},_xe={class:"col-md-6 col-xl-3 mb-2"},wxe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #ff9d6e, #ff6b6b)",color:"white"}},kxe={class:"card-body text-center"},xxe={class:"card-text display-6 fw-bold"},Txe={class:"col-md-6 col-xl-3 mb-2"},Cxe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #6e8efb, #7780e3)",color:"white"}},Exe={class:"card-body text-center"},Sxe={class:"card-text display-6 fw-bold"},Ixe={class:"col-md-6 col-xl-3 mb-2"},Axe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #ff9d6e, #ff6b6b)",color:"white"}},Dxe={class:"card-body text-center"},Pxe={class:"card-text display-6 fw-bold"},Oxe={class:"filter-container mt-3"},Mxe={class:"row"},Nxe={class:"col-12 mb-3 mb-md-0"},Rxe={class:"card filter-card shadow-sm"},Lxe={class:"card-body"},Vxe={class:"form-group"},qxe={class:"row"},Fxe={class:"col-md-4 col-12 mb-3"},Bxe=["value"],Uxe={class:"col-md-4 col-12 mb-3"},jxe={class:"col-md-4 col-12 mb-3"},Hxe=["min","max"],zxe={class:"col-12 mb-3 mb-md-0"},Wxe={class:"export-button mt-3 d-flex justify-content-end"},Kxe=["disabled","title"],Gxe={key:0,class:"text-muted small mb-0 mt-2 text-end w-100"},Yxe={class:"table-container mt-4"},Qxe={class:"nav nav-tabs",id:"customerTabs",role:"tablist"}
5555,$xe={class:"nav-item",role:"presentation"},Xxe=["aria-selected"],Jxe={class:"nav-item",role:"presentation"},Zxe=["aria-selected"],eTe={class:"nav-item",role:"presentation"},tTe=["aria-selected"],nTe={class:"tab-content",id:"customerTabContent"},iTe={key:0,class:"text-center py-3"},aTe={key:1,class:"table table-striped table-hover shadow-sm custom-table"},oTe={key:0},sTe={key:0,class:"text-center py-3"},rTe={key:1,class:"table table-striped table-hover shadow-sm custom-table"},lTe={key:0},cTe={key:0,class:"text-center py-3"},uTe={key:1,class:"table table-striped table-hover shadow-sm custom-table"},hTe={key:0},dTe={class:"pagination mt-3 d-flex justify-content-center align-items-center gap-3"},fTe=["disabled"],pTe=["disabled"],gTe={__name:"ThongKeChiTietKhach",setup(e){const t=JT(),n=wI(),i=y1(),a=Gee(),o=Fde(),{items:s}=Zs(t),{items:r}=Zs(n),{items:l}=Zs(a),c=gt([]),u=It(""),h=It(""),d=It(""),f=It(1),p=It(30),g=It(!1),m=It(!1),v=It("xephang"),y=It([]),b=It([]),_=It([]),w=It(null),k=It(null),x=It(null),T=It(!1),C=It(!1),E=It(!1),S=bo(()=>"xephang"===v.value?T.value:"hengio"===v.value?C.value:E.value),I=bo(()=>"uutien"!==v.value&&("xephang"===v.value?!!y.value.length:!!b.value.length)),A=bo(()=>{if(!u.value)return null;const e=new Date(u.value),t=new Date(e);return t.setDate(e.getDate()+29),t.toISOString().split("T")[0]}),D=(new Date).toISOString().split("T")[0],P=bo(()=>{const e=new Date;return e.setDate(e.getDate()-30),e.toISOString().split("T")[0]}),O=bo(()=>s.value),M=bo(()=>c.reduce((e,t)=>e+(t.soluongkhach||0),0)),N=bo(()=>{const e=new Date,t=new Date(e);t.setDate(e.getDate()-e.getDay()),t.setHours(0,0,0,0);const n=new Date(t);return n.setDate(t.getDate()+6),n.setHours(23,59,59,999),c.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n}).reduce((e,t)=>e+(t.soluongkhach||0),0)}),R=bo(()=>{const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1,0,0,0,0),n=new Date(e.getFullYear(),e.getMonth()+1,0,23,59,59,999);return c.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n}).reduce((e,t)=>e+(t.soluongkhach||0),0)}),L=bo(()=>{const e=(new Date).getFullYear();return c.filter(t=>new Date(t.ngaythongke).getFullYear()===e).reduce((e,t)=>e+(t.soluongkhach||0),0)}),V=()=>{if(u.value&&h.value){const e=new Date(u.value),t=new Date(h.value),n=new Date(e);n.setDate(e.getDate()+29),t>n&&(h.value=n.toISOString().split("T")[0])}F()},q=async()=>{var e,t,n,a,s,r;if(!d.value||!u.value||!h.value)return;g.value=!0;const l=new Date(u.value),c=new Date(h.value);c.setHours(23,59,59,999);try{"xephang"===v.value?(await i.fetchItemByKhachDaPhucVuByDonVi(d.value,l,c,p.value,w.value),y.value=i.dsKhachDaPhucVu.data||[],w.value=null==(e=i.dsKhachDaPhucVu)?void 0:e.lastDoc,T.value=null==(t=i.dsKhachDaPhucVu)?void 0:t.hasMore):"hengio"===v.value?(await o.fetchItemByHenGioDaPhucVuByDonVi(d.value,l,c,p.value,k.value),b.value=o.dsHenGioDaPhucVu.data||[],k.value=null==(n=o.dsHenGioDaPhucVu)?void 0:n.lastDoc,C.value=null==(a=o.dsHenGioDaPhucVu)?void 0:a.hasMore):"uutien"===v.value&&(await i.fetchItemByKhachUuTienByDonVi(d.value,l,c,p.value,x.value),_.value=i.dsKhachUuTien.data||[],x.value=null==(s=i.dsKhachUuTien)?void 0:s.lastDoc,E.value=null==(r=i.dsKhachUuTien)?void 0:r.hasMore)}finally{g.value=!1}},F=()=>{f.value=1,w.value=null,k.value=null,x.value=null,q()},B=()=>{f.value>1&&(f.value--,"xephang"===v.value?w.value=null:"hengio"===v.value?k.value=null:"uutien"===v.value&&(x.value=null),q())},U=()=>{("xephang"===v.value&&T.value||"hengio"===v.value&&C.value||"uutien"===v.value&&E.value)&&(f.value++,q())},j=e=>{v.value!==e&&(v.value=e,f.value=1,"xephang"===e?w.value=null:"hengio"===e?k.value=null:"uutien"===e&&(x.value=null),q())},H=async()=>{var e;if(d.value&&u.value&&h.value){m.value=!0;
5555try{const t={donVi:d.value,startDate:u.value,endDate:h.value,type:v.value,tenDonVi:(null==(e=s.value.find(e=>e.id==d.value))?void 0:e.ten)||"ÄÆ¡n vá» không xác Äá»nh"};await i.exportExcel(t);const n=i.excelUrl;if(n){const e=document.createElement("a");e.href=n,e.download="danh-sach-khach-hang-".concat(t.type,"-").concat(sC(u.value,"-"),"-").concat(sC(h.value,"-"),".xlsx"),document.body.appendChild(e),e.click(),document.body.removeChild(e)}}catch(eRe){VT("Có lá»i xảy ra khi xuất file Excel!")}finally{m.value=!1}}else alert("Vui lòng chá»n Äầy Äá»§ bá» lá»c trưá»c khi xuất Excel!")};return ei(async()=>{await Promise.all([a.fetchItems(),t.fetchItems(),n.fetchItems()]),c.splice(0,c.length,...l.value.filter(e=>e.ngaythongke&&!isNaN(new Date(e.ngaythongke).getTime())).map(e=>{var t,n;const i=(null==(t=s.value.find(t=>t.id===e.donvi))?void 0:t.ten)||"Unknown",a=(null==(n=r.value.find(t=>t.id===e.quay))?void 0:n.ten)||"Unknown";return{...e,tenDonVi:i,tenQuay:a}}).filter(e=>"Unknown"!==e.tenQuay&&"Quầy không xác Äá»nh"!==e.tenQuay)),u.value=P.value,h.value=D}),(e,t)=>(Ma(),Va("div",fxe,[t[22]||(t[22]=Ha("div",{class:"header"},[Ha("h3",{class:"text-center text-uppercase"},"THá»NG Kà CHI TIẾT KHÃCH HÃNG")],-1)),Ha("div",pxe,[Ha("div",gxe,[Ha("div",mxe,[Ha("div",vxe,[Ha("div",yxe,[t[6]||(t[6]=Ha("h5",{class:"card-title"},"Tá»ng khách tuần hiá»n tại",-1)),Ha("p",bxe,ee(N.value),1)])])]),Ha("div",_xe,[Ha("div",wxe,[Ha("div",kxe,[t[7]||(t[7]=Ha("h5",{class:"card-title"},"Tá»ng khách tháng hiá»n tại",-1)),Ha("p",xxe,ee(R.value),1)])])]),Ha("div",Txe,[Ha("div",Cxe,[Ha("div",Exe,[t[8]||(t[8]=Ha("h5",{class:"card-title"},"Tá»ng khách nÄm hiá»n tại",-1)),Ha("p",Sxe,ee(L.value),1)])])]),Ha("div",Ixe,[Ha("div",Axe,[Ha("div",Dxe,[t[9]||(t[9]=Ha("h5",{class:"card-title"},"Tá»ng sá» khách toà n thá»i gian",-1)),Ha("p",Pxe,ee(M.value),1)])])])]),Ha("div",Oxe,[Ha("div",Mxe,[Ha("div",Nxe,[Ha("div",Rxe,[t[15]||(t[15]=Ha("div",{class:"card-header"},[Ha("h5",{class:"filter-title"},"Bá» lá»c")],-1)),Ha("div",Lxe,[Ha("div",Vxe,[Ha("div",qxe,[Ha("div",Fxe,[t[11]||(t[11]=Ha("label",{for:"donViFilter",class:"form-label"},"Chá»n ÄÆ¡n vá»:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[0]||(t[0]=e=>d.value=e),onChange:F,class:"form-control"},[t[10]||(t[10]=Ha("option",{value:"",disabled:""},"Chá»n má»t ÄÆ¡n vá»",-1)),(Ma(!0),Va(Sa,null,gi(O.value,e=>(Ma(),Va("option",{key:e.id,value:e.id},ee(e.ten),9,Bxe))),128))],544),[[_s,d.value]])]),Ha("div",Uxe,[t[12]||(t[12]=Ha("label",{for:"startDate",class:"form-label"},"Từ ngà y:",-1)),gn(Ha("input",{type:"date","onUpdate:modelValue":t[1]||(t[1]=e=>u.value=e),onChange:V,class:"form-control"},null,544),[[ms,u.value]])]),Ha("div",jxe,[t[13]||(t[13]=Ha("label",{for:"endDate",class:"form-label"},"Äến ngà y:",-1)),gn(Ha("input",{type:"date","onUpdate:modelValue":t[2]||(t[2]=e=>h.value=e),min:u.value,max:A.value,onChange:F,class:"form-control"},null,40,Hxe),[[ms,h.value]])]),Ha("div",zxe,[Ha("div",Wxe,[Ha("button",{class:"btn btn-custom btn-gradient-blue",disabled:m.value||!I.value,title:"uutien"===v.value?"Chưa há» trợ xuất Excel cho danh sách khách ưu tiên":"",onClick:H},[t[14]||(t[14]=Ha("i",{class:"fas fa-file-export me-2"},null,-1)),Ga(" "+ee(m.value?"Äang xuất file":"Xuất Excel"),1)],8,Kxe),"uutien"===v.value?(Ma(),Va("p",Gxe," Danh sách khách ưu tiên chưa xuất ÄÆ°á»£c Excel. ")):Qa("",!0)])])])])])])])])]),Ha("div",Yxe,[Ha("ul",Qxe,[Ha("li",$xe,[Ha("button",{class:G(["nav-link",{active:"xephang"===v.value}]),id:"xephang-tab",onClick:t[3]||(t[3]=e=>j("xephang")),type:"button",role:"tab","aria-controls":"xephang","aria-selected":"xephang"===v.value}," Khách xếp hà ng ",10,Xxe)]),Ha("li",Jxe,[Ha("button",{class:G(["nav-link",{active:"hengio"===v.value}]),id:"hengio-tab",onClick:t[4]||(t[4]=e=>j("hengio")),type:"button",role:"tab","aria-controls":"hengio","aria-selected":"hengio"===v.value}," Khách hẹn giá» ",10,Zxe)]),Ha("li",eTe,[Ha("button",{class:G(["nav-link",{active:"uutien"===v.value}]),id:"uutien-tab",onClick:t[5]||(t[5]=e=>j("uutien")),type:"button",role:"tab","aria-controls":"uutien","aria-selected":"uutien"===v.value}," Khách ưu tiên ",10,tTe)])]),Ha("div",nTe,[Ha("div",{class:G(["tab-pane fade",{"show active":"xephang"===v.value}
5555]),id:"xephang",role:"tabpanel","aria-labelledby":"xephang-tab"},[g.value?(Ma(),Va("div",iTe,"Äang tải dữ liá»u...")):(Ma(),Va("table",aTe,[t[17]||(t[17]=Ha("thead",null,[Ha("tr",null,[Ha("th",null,"STT"),Ha("th",{scope:"col"},"Há» tên"),Ha("th",{scope:"col"},"Email"),Ha("th",{scope:"col"},"Sá» Äiá»n thoại"),Ha("th",{scope:"col"},"Lấy sá» lúc"),Ha("th",{scope:"col"},"Thá»i gian giao dá»ch")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(y.value,(e,t)=>(Ma(),Va("tr",{key:t},[Ha("td",null,ee(e.stt||"-"),1),Ha("td",null,ee(e.hoten),1),Ha("td",null,ee(e.email||"-"),1),Ha("td",null,ee(e.sodienthoai||"-"),1),Ha("td",null,ee(Ot(aC)(e.taoluc)),1),Ha("td",null,ee(Ot(aC)(e.daphucvu)),1)]))),128)),y.value.length?Qa("",!0):(Ma(),Va("tr",oTe,t[16]||(t[16]=[Ha("td",{colspan:"6",class:"text-center"},"Không có dữ liá»u",-1)])))])]))],2),Ha("div",{class:G(["tab-pane fade",{"show active":"hengio"===v.value}]),id:"hengio",role:"tabpanel","aria-labelledby":"hengio-tab"},[g.value?(Ma(),Va("div",sTe,"Äang tải dữ liá»u...")):(Ma(),Va("table",rTe,[t[19]||(t[19]=Ha("thead",null,[Ha("tr",null,[Ha("th",{scope:"col"},"Há» tên"),Ha("th",{scope:"col"},"Email"),Ha("th",{scope:"col"},"Sá» Äiá»n thoại"),Ha("th",{scope:"col"},"Thá»i gian hẹn"),Ha("th",{scope:"col"},"Xác nháºn"),Ha("th",{scope:"col"},"Thá»i gian giao dá»ch")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(b.value,(e,t)=>(Ma(),Va("tr",{key:t},[Ha("td",null,ee(e.hoten),1),Ha("td",null,ee(e.email||"-"),1),Ha("td",null,ee(e.sodienthoai||"-"),1),Ha("td",null,ee(Ot(aC)(e.ngayhengio)),1),Ha("td",null,[Ha("span",{class:G(e.daxacnhan?"text-success":"text-danger")},ee(e.daxacnhan?"Äã xác nháºn":"Chưa xác nháºn"),3)]),Ha("td",null,ee(Ot(aC)(e.daphucvu)),1)]))),128)),b.value.length?Qa("",!0):(Ma(),Va("tr",lTe,t[18]||(t[18]=[Ha("td",{colspan:"6",class:"text-center"},"Không có dữ liá»u",-1)])))])]))],2),Ha("div",{class:G(["tab-pane fade",{"show active":"uutien"===v.value}]),id:"uutien",role:"tabpanel","aria-labelledby":"uutien-tab"},[g.value?(Ma(),Va("div",cTe,"Äang tải dữ liá»u...")):(Ma(),Va("table",uTe,[t[21]||(t[21]=Ha("thead",null,[Ha("tr",null,[Ha("th",{scope:"col"},"STT"),Ha("th",{scope:"col"},"Há» tên"),Ha("th",{scope:"col"},"Email"),Ha("th",{scope:"col"},"Sá» Äiá»n thoại"),Ha("th",{scope:"col"},"Diá»n ưu tiên"),Ha("th",{scope:"col"},"Lấy sá» lúc"),Ha("th",{scope:"col"},"Thá»i gian giao dá»ch")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(_.value,(e,t)=>(Ma(),Va("tr",{key:t},[Ha("td",null,ee(e.stt||"-"),1),Ha("td",null,ee(e.hoten),1),Ha("td",null,ee(e.email||"-"),1),Ha("td",null,ee(e.sodienthoai||"-"),1),Ha("td",null,ee(e.doi_tuong_uu_tien||"-"),1),Ha("td",null,ee(Ot(aC)(e.taoluc)),1),Ha("td",null,ee(Ot(aC)(e.daphucvu)),1)]))),128)),_.value.length?Qa("",!0):(Ma(),Va("tr",hTe,t[20]||(t[20]=[Ha("td",{colspan:"7",class:"text-center"},"Không có dữ liá»u",-1)])))])]))],2)]),Ha("div",dTe,[Ha("button",{class:"btn btn-custom btn-gradient-blue",disabled:1===f.value||g.value,onClick:B}," Trang trưá»c ",8,fTe),Ha("span",null,"Trang "+ee(f.value),1),Ha("button",{class:"btn btn-custom btn-gradient-blue",disabled:!S.value||g.value,onClick:U}," Trang sau ",8,pTe)])])])]))}},mTe=CC(gTe,[["__scopeId","data-v-8db7642c"]]),vTe={class:"container content-container"},yTe={class:"header"},bTe={class:"text-center text-uppercase"},_Te={class:"p-3"},wTe={class:"row"},kTe={class:"col-md-6 col-lg-3 mb-4"},xTe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #6e8efb, #7780e3)",color:"white"}},TTe={class:"card-body text-center"},CTe={class:"card-text display-6 fw-bold"},ETe={class:"col-md-6 col-lg-3 mb-4"},STe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #ff9d6e, #ff6b6b)",color:"white"}},ITe={class:"card-body text-center"},ATe={class:"card-text display-6 fw-bold"},DTe={class:"col-md-6 col-lg-3 mb-4"},PTe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #6e8efb, #7780e3)",color:"white"}},OTe={class:"card-body text-center"},MTe={class:"card-text display-6 fw-bold"},NTe={class:"col-md-6 col-lg-3 mb-4"},RTe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #ff9d6e, #ff6b6b)",color:"white"}},LTe={class:"card-body text-center"},VTe={class:"card-text display-6 fw-bold"},qTe={class:"filter-container mt-3"},FTe={class:"row"},BTe={class:"col-md-6"},UTe={class:"card filter-card shadow-sm"},jTe={class:"card-body"},HTe={class:"form-group"},zTe={class:"row"},WTe={class:"col-md-6 col-12 mb-3"},KTe=["value"],GTe={class:"col-md-6 col-12 mb-3"},YTe={class:"col-md-6 mb-3 mb-md-0"},QTe={class:"card filter-card shadow-sm"},$Te={class:"card-body"},XTe={class:"form-group"},JTe={class:"row"},ZTe={class:"col-md-6 col-12 mb-3"},eCe={key:0,class:"col-md-6 col-12 mb-3"}
5555,tCe=["value"],nCe={key:1,class:"col-md-6 col-12 mb-3"},iCe=["value"],aCe={key:2,class:"col-md-6 col-12 mb-3"},oCe={key:3,class:"col-md-6 col-12 mb-3"},sCe={key:4,class:"text-danger mt-2"},rCe={class:"mt-3"},lCe={class:"card chart-card shadow-sm"},cCe={class:"card-body"},uCe={class:"text-center section-title"},hCe={class:"card chart-card shadow-sm mt-3"},dCe={class:"card-body"},fCe={class:"pie-chart-container position-relative"},pCe={key:0,class:"no-data-text"},gCe={__name:"ThongKeChungDonVi",setup(e){lre.register(Dve);const t=Vl();Ll();const n=Gee(),i=JT(),a=wI(),{item:o}=Zs(i),{items:s}=Zs(n),{items:r}=Zs(a),l=t.params.don_vi,c=gt([]),u=It("year"),h=It((new Date).getFullYear()),d=It(1),f=It(""),p=It(""),g=It("all"),m=It("xephang"),v=It("");let y=null,b=null,_=null,w=null,k=null,x=It(!1);const T=It(!1);let C=null;const E=It(0);ei(async()=>{await Promise.all([i.fetchItemById(l),a.fetchItemsByDonVi(l),n.fetchItemsByDonVi(l)]),v.value=o.value.ten||"Không xác Äá»nh";const e=new Map;r.value.forEach(t=>{const n=t.ten.match(/\d+/),i=n?parseInt(n[0],10):null;if(null===i){const n=t.ten.toLowerCase();if(e.has(n)){const i=e.get(n);t.hoatdong&&(i.ten=t.ten,i.id=t.id,i.thutu=t.thutu,i.hoatdong=!0),i.ids.push(t.id)}else e.set(n,{ten:t.ten,id:t.id,thutu:t.thutu,hoatdong:t.hoatdong,ids:[t.id]})}else{const n="Sá» ".concat(i<10?"0"+i:i);if(e.has(i)){const a=e.get(i);t.hoatdong&&(a.ten=n,a.id=t.id,a.thutu=t.thutu,a.hoatdong=!0),a.ids.push(t.id)}else e.set(i,{ten:n,id:t.id,thutu:t.thutu,hoatdong:t.hoatdong,ids:[t.id]})}}),c.splice(0,c.length,...s.value.map(t=>{const n=Array.from(e.values()).find(e=>e.ids.includes(t.quay));return n?{...t,tenQuay:n.ten,tenDonVi:v.value,thutu:n.thutu}:null}).filter(e=>e&&"Unknown"!==e.tenQuay&&"Quầy không xác Äá»nh"!==e.tenQuay&&e.donvi===l).sort((e,t)=>e.thutu-t.thutu)),await an(),F()});const S=bo(()=>c.reduce((e,t)=>e+(t.soluongkhach||0),0)),I=bo(()=>{const e=new Date,t=new Date(e);t.setDate(e.getDate()-e.getDay()),t.setHours(0,0,0,0);const n=new Date(t);return n.setDate(t.getDate()+6),n.setHours(23,59,59,999),c.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n}).reduce((e,t)=>e+(t.soluongkhach||0),0)}),A=bo(()=>{const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1,0,0,0,0),n=new Date(e.getFullYear(),e.getMonth()+1,0,23,59,59,999);return c.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n}).reduce((e,t)=>e+(t.soluongkhach||0),0)}),D=bo(()=>{const e=(new Date).getFullYear();return c.filter(t=>new Date(t.ngaythongke).getFullYear()===e).reduce((e,t)=>e+(t.soluongkhach||0),0)}),P=bo(()=>[...new Set(c.map(e=>new Date(e.ngaythongke).getFullYear()))].sort((e,t)=>t-e)),O=bo(()=>{const e=h.value,t=d.value-1,n=new Date(e,t,1),i=new Date(e,t+1,0).getDate(),a=n.getDay();return Math.ceil((i+a)/7)}),M=bo(()=>[...new Set(c.map(e=>e.tenQuay))]),N=bo(()=>"xephang"===m.value?"Khách xếp hà ng":"Khách hẹn giá»"),R=()=>{let e;if("year"===u.value)e=c.filter(e=>new Date(e.ngaythongke).getFullYear()===h.value&&(!m.value||e.phanloai===m.value));else if("month"===u.value){const t=new Date(h.value,d.value-1,1,0,0,0,0),n=new Date(h.value,d.value,0,23,59,59,999);e=c.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n&&(!m.value||e.phanloai===m.value)})}else if("week"===u.value){const t=new Date(h.value,d.value-1,1,0,0,0,0),n=new Date(h.value,d.value,0,23,59,59,999);e=c.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n&&(!m.value||e.phanloai===m.value)})}else if("dateRange"===u.value){if(T.value=!1,!f.value||!p.value)return T.value=!0,[];const t=new Date(f.value);t.setHours(0,0,0,0);const n=new Date(p.value);if(n.setHours(23,59,59,999),isNaN(t.getTime())||isNaN(n.getTime())||n<t)return T.value=!0,[];e=c.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n&&(!m.value||e.phanloai===m.value)})}return e},L=()=>{y&&y.destroy();const e=document.getElementById("barChart");if(!e)return;const t=c.filter(e=>new Date(e.ngaythongke).getFullYear()===h.value&&(!m.value||e.phanloai===m.value)),n=("all"===g.value?[...new Set(t.map(e=>e.tenQuay))]:[g.value]).map(e=>{const n=Array(12).fill(0);return t.filter(t=>
5555t.tenQuay===e).forEach(e=>{const t=new Date(e.ngaythongke).getMonth();n[t]+=e.soluongkhach}),{label:e,data:n}});y=new lre(e.getContext("2d"),{type:"bar",data:{labels:Array.from({length:12},(e,t)=>"T".concat(t+1)),datasets:n.map((e,t)=>({label:e.label,data:e.data,backgroundColor:"rgba(".concat(50*t%255,", ").concat(100*t%255,", ").concat(150*t%255,", 0.5)"),borderColor:"rgba(".concat(50*t%255,", ").concat(100*t%255,", ").concat(150*t%255,", 1)"),borderWidth:1,barThickness:20}))},options:{maintainAspectRatio:!1,scales:{y:{beginAtZero:!0,title:{display:!0,text:"Sá» lượng khách"}},x:{title:{display:!0,text:"Tháng"}}},plugins:{legend:{display:!0,position:"top"},title:{display:!0,text:"Sá» lượng khách qua từng tháng - ".concat(v.value," (NÄm ").concat(h.value,") - ").concat(N.value)},datalabels:{display:!1}}}})},V=()=>{_&&_.destroy();const e=document.getElementById("lineChart");if(!e)return;const t=(()=>{const e=R();return e?"all"!==g.value?e.filter(e=>e.tenQuay===g.value):e:[]})(),n="all"===g.value?[...new Set(t.map(e=>e.tenQuay))]:[g.value];let i=[];if("year"===u.value)i=Array.from({length:12},(e,t)=>"T".concat(t+1));else if("month"===u.value)i=Array.from({length:new Date(h.value,d.value,0).getDate()},(e,t)=>"".concat(t+1));else if("week"===u.value)i=Array.from({length:O.value},(e,t)=>"Tuần ".concat(t+1));else if("dateRange"===u.value){const e=new Date(p.value),t=new Date(f.value),n=Math.ceil((e-t)/864e5)+1;i=n<=0?[]:Array.from({length:n},(e,t)=>{const n=new Date(f.value);return n.setDate(n.getDate()+t),"".concat(n.getDate(),"/").concat(n.getMonth()+1)})}const a=n.map((e,n)=>{const i="year"===u.value?Array(12).fill(0):"month"===u.value?Array(new Date(h.value,d.value,0).getDate()).fill(0):"week"===u.value?Array(O.value).fill(0):Array(Math.max(0,Math.ceil((new Date(p.value)-new Date(f.value))/864e5)+1)).fill(0);return t.filter(t=>t.tenQuay===e).forEach(e=>{const t=new Date(e.ngaythongke),n="year"===u.value?t.getMonth():"month"===u.value?t.getDate()-1:"week"===u.value?Math.floor((t.getDate()-1+new Date(h.value,d.value-1,1).getDay())/7):Math.floor((t-new Date(f.value))/864e5);n>=0&&n<i.length&&(i[n]+=e.soluongkhach)}),{label:e,data:i,borderColor:"rgba(".concat(50*n%255,", ").concat(100*n%255,", ").concat(150*n%255,", 1)"),fill:!1,tension:.1}});_=new lre(e.getContext("2d"),{type:"line",data:{labels:i,datasets:a},options:{maintainAspectRatio:!1,scales:{y:{beginAtZero:!0,title:{display:!0,text:"Sá» lượng khách"}},x:{title:{display:!0,text:"year"===u.value?"Tháng":"month"===u.value?"Ngà y":"week"===u.value?"Tuần":"Ngà y"}}},plugins:{legend:{display:!0,position:"top"},title:{display:!0,text:"Xu hưá»ng khách qua thá»i gian - ".concat(v.value," (").concat(q.value,") - ").concat(N.value)},datalabels:{display:!1}},interaction:{mode:"index",intersect:!1},tooltips:{enabled:!0}}})},q=bo(()=>"week"===u.value||"month"===u.value?"Tháng ".concat(d.value," NÄm ").concat(h.value):"dateRange"===u.value?f.value&&p.value?"Từ ".concat(iC(f.value)," Äến ").concat(iC(p.value)):"Chưa chá»n khoảng thá»i gian":"NÄm ".concat(h.value)),F=()=>{L(),(()=>{b&&b.destroy();const e=document.getElementById("pieChart");if(!e)return;const t=R(),n=[...new Set(t.map(e=>e.tenQuay))],i=n.map(e=>({quay:e,total:t.filter(t=>t.tenQuay===e).reduce((e,t)=>e+t.soluongkhach,0)})),a=i.reduce((e,t)=>e+t.total,0);if(i.forEach(e=>{e.percentage=a>0?e.total/a*100:0}),a>0){const e=i.reduce((e,t)=>e+t.percentage,0);Math.abs(e-100)>.1&&(i.reduce((e,t)=>e.total>t.total?e:t).percentage+=100-e)}x.value=i.every(e=>0===e.total),b=new lre(e.getContext("2d"),{type:"pie",data:{labels:i.map(e=>"".concat(e.quay," (").concat(e.percentage.toFixed(1),"%)")),datasets:[{label:"Tá»ng sá» khách",data:i.map(e=>e.total),backgroundColor:n.map((e,t)=>"rgba(".concat(50*t%255,", ").concat(100*t%255,", ").concat(150*t%255,", 0.5)")),borderWidth:1}]},options:{maintainAspectRatio:!1,plugins:{legend:{display:!0,align:"center",labels:{boxWidth:15,padding:15,font:{size:11}}},title:{display:!0,text:["Tá»· lá» khách theo quầy - ".concat(v.value," (").concat(q.value,") - ").concat(N.value),"Tá»ng sá»: ".concat(a," khách")],font:{size:14}},datalabels:{color:"#fff",formatter:(e,t)=>0===e?"":"".concat(e),font:{size:12,weight:"bold"},display:e=>e.dataset.data[e.dataIndex]>0},tooltip:{callbacks:{label:e=>{const t=e.dataIndex,a=e.raw,o=i[t].percentage.toFixed(1);return"".concat(n[t],": ").concat(a," (").concat(o,"%)")}}}}}})})(),V(),(()=>{w&&w.destroy();const e=document.getElementById("horizontalBarChart");if(!e)return;const t=R(),n=[...new Set(t.map(e=>e.tenQuay))].map(e=>({quay:e,total:t.filter(t=>t.tenQuay===e).reduce((e,t)=>
5555e+t.soluongkhach,0)})).sort((e,t)=>t.total-e.total).slice(0,5);w=new lre(e.getContext("2d"),{type:"bar",data:{labels:n.map(e=>e.quay),datasets:[{label:"Sá» lượng khách",data:n.map(e=>e.total),backgroundColor:"rgba(75, 192, 192, 0.5)",borderColor:"rgba(75, 192, 192, 1)",borderWidth:1}]},options:{maintainAspectRatio:!1,indexAxis:"y",scales:{x:{beginAtZero:!0,title:{display:!0,text:"Sá» lượng khách"}}},plugins:{legend:{display:!1},title:{display:!0,text:"Top quầy - ".concat(v.value," (").concat(q.value,") - ").concat(N.value)}}}})})(),(()=>{k&&k.destroy();const e=document.getElementById("totalAreaChart");if(!e)return;const t=R();let n=[],i=[];if("year"===u.value)n=Array.from({length:12},(e,t)=>"T".concat(t+1)),i=Array(12).fill(0),t.forEach(e=>{const t=new Date(e.ngaythongke).getMonth();i[t]+=e.soluongkhach});else if("month"===u.value){const e=new Date(h.value,d.value,0).getDate();n=Array.from({length:e},(e,t)=>"".concat(t+1)),i=Array(e).fill(0),t.forEach(e=>{const t=new Date(e.ngaythongke).getDate()-1;i[t]+=e.soluongkhach})}else if("week"===u.value)n=Array.from({length:O.value},(e,t)=>"Tuần ".concat(t+1)),i=Array(O.value).fill(0),t.forEach(e=>{const t=new Date(e.ngaythongke),n=Math.floor((t.getDate()-1+new Date(h.value,d.value-1,1).getDay())/7);n>=0&&n<i.length&&(i[n]+=e.soluongkhach)});else if("dateRange"===u.value&&p.value&&f.value){const e=new Date(p.value),a=new Date(f.value),o=Math.max(0,Math.ceil((e-a)/864e5)+1);n=Array.from({length:o},(e,t)=>{const n=new Date(f.value);return n.setDate(n.getDate()+t),"".concat(n.getDate(),"/").concat(n.getMonth()+1)}),i=Array(o).fill(0),t.forEach(e=>{const t=Math.floor((new Date(e.ngaythongke)-a)/864e5);t>=0&&t<i.length&&(i[t]+=e.soluongkhach)})}k=new lre(e.getContext("2d"),{type:"line",data:{labels:n,datasets:[{label:"Tá»ng sá» khách",data:i,borderColor:"rgba(54, 162, 235, 1)",backgroundColor:"rgba(54, 162, 235, 0.2)",fill:!0,tension:.1}]},options:{maintainAspectRatio:!1,scales:{y:{beginAtZero:!0,title:{display:!0,text:"Sá» lượng khách"}},x:{title:{display:!0,text:"year"===u.value?"Tháng":"month"===u.value?"Ngà y":"week"===u.value?"Tuần":"Ngà y"}}},plugins:{legend:{display:!0,position:"top"},title:{display:!0,text:"Tá»ng sá» khách qua thá»i gian - ".concat(v.value," (").concat(q.value,") - ").concat(N.value)},datalabels:{display:!1}},interaction:{mode:"index",intersect:!1},tooltips:{enabled:!0}}})})(),H()},B=async()=>{await an(),L(),V(),H(),LT("Äã cáºp nháºt dữ liá»u thá»ng kê biá»u Äá».")},U=async()=>{await an(),F(),LT("Äã cáºp nháºt dữ liá»u thá»ng kê biá»u Äá».")},j=async()=>{await an(),F(),LT("Äã cáºp nháºt dữ liá»u thá»ng kê biá»u Äá».")},H=()=>{C&&C.destroy();const e=document.getElementById("yearStatsChart");if(!e)return;let t;switch(u.value){case"month":t=(()=>{const e=new Date(h.value,d.value,0).getDate(),t=c.filter(e=>{const t=new Date(e.ngaythongke);return(!m.value||e.phanloai===m.value)&&t.getMonth()+1===d.value&&t.getFullYear()===h.value}),n=Array(e).fill(0);return t.forEach(t=>{const i=new Date(t.ngaythongke).getDate();i>=1&&i<=e&&(n[i-1]+=t.soluongkhach||0)}),{labels:Array.from({length:e},(e,t)=>"".concat(t+1)),data:n,total:n.reduce((e,t)=>e+t,0),xAxisTitle:"Ngà y trong tháng",tooltipTitle:e=>"Ngà y ".concat(e,"/").concat(d.value,"/").concat(h.value)}})();break;case"week":t=(()=>{const e=c.filter(e=>{const t=new Date(e.ngaythongke);return(!m.value||e.phanloai===m.value)&&t.getMonth()+1===d.value&&t.getFullYear()===h.value}),t=Array(O.value).fill(0);return e.forEach(e=>{const n=new Date(e.ngaythongke),i=Math.floor((n.getDate()-1+new Date(h.value,d.value-1,1).getDay())/7);i>=0&&i<t.length&&(t[i]+=e.soluongkhach||0)}),{labels:Array.from({length:O.value},(e,t)=>"Tuần ".concat(t+1)),data:t,total:t.reduce((e,t)=>e+t,0),xAxisTitle:"Tuần trong tháng",tooltipTitle:e=>"".concat(e," - Tháng ").concat(d.value,"/").concat(h.value)}})();break;case"dateRange":t=(()=>{if(!f.value||!p.value)return null;const e=new Date(f.value),t=new Date(p.value),n=Math.ceil((t-e)/864e5)+1,i=c.filter(n=>{const i=new Date(n.ngaythongke);return(!m.value||n.phanloai===m.value)&&i>=e&&i<=t}),a=Array(n).fill(0);
5555return i.forEach(t=>{const n=new Date(t.ngaythongke),i=Math.floor((n-e)/864e5);i>=0&&i<a.length&&(a[i]+=t.soluongkhach||0)}),{labels:Array.from({length:n},(t,n)=>{const i=new Date(e);return i.setDate(i.getDate()+n),"".concat(i.getDate(),"/").concat(i.getMonth()+1)}),data:a,total:a.reduce((e,t)=>e+t,0),xAxisTitle:"Ngà y",tooltipTitle:e=>{const[t,n]=e.split("/");return"Ngà y ".concat(t,"/").concat(n,"/").concat(h.value)}}})();break;default:t=(()=>{const e=c.filter(e=>{const t=new Date(e.ngaythongke);return(!m.value||e.phanloai===m.value)&&t.getFullYear()===h.value}),t=Array(12).fill(0);return e.forEach(e=>{const n=new Date(e.ngaythongke).getMonth();t[n]+=e.soluongkhach||0}),{labels:["T1","T2","T3","T4","T5","T6","T7","T8","T9","T10","T11","T12"],data:t,total:t.reduce((e,t)=>e+t,0),xAxisTitle:"Tháng trong nÄm",tooltipTitle:e=>"Tháng ".concat(parseInt(e.substring(1)),"/").concat(h.value)}})()}if(!t)return;E.value=t.total;const n=window.innerWidth<768;C=new lre(e,{type:n?"line":"bar",data:{labels:t.labels,datasets:[{label:"Sá» lượng khách",data:t.data,backgroundColor:n?"rgba(104, 132, 245, 0.2)":Array.from({length:t.data.length},(e,t)=>"hsla(".concat(30*t%360,", 70%, 50%, 0.7)")),borderColor:n?"rgba(104, 132, 245, 1)":Array.from({length:t.data.length},(e,t)=>"hsla(".concat(30*t%360,", 70%, 50%, 1)")),borderWidth:n?2:1,tension:.3,fill:!n&&void 0,pointBackgroun
5555dColor:n?"rgba(104, 132, 245, 1)":void 0,pointRadius:n?3:void 0,pointHoverRadius:n?5:void 0}]},options:{maintainAspectRatio:!1,responsive:!0,resizeDelay:0,animation:{duration:1e3,easing:"easeOutQuart"},plugins:{title:{display:!0,text:["".concat(v.value," - Thá»ng kê lượng khách (").concat(q.value,")"),"Tá»ng sá»: ".concat(t.total," khách - ").concat(N.value)],font:{size:14}},legend:{display:!1},datalabels:{display:!1},tooltip:{callbacks:{title:function(e){const n=e[0].label;return t.tooltipTitle(n)},label:function(e){return"Sá» khách: ".concat(e.raw)}}}},scales:{y:{beginAtZero:!0,title:{display:!0,text:"Sá» lượng khách"}},x:{title:{display:!0,text:t.xAxisTitle}}}}})};return(e,t)=>(Ma(),Va("div",vTe,[Ha("div",yTe,[Ha("h3",bTe,"THá»NG Kà CHI TIẾT - "+ee(v.value),1)]),Ha("div",_Te,[Ha("div",wTe,[Ha("div",kTe,[Ha("div",xTe,[Ha("div",TTe,[t[7]||(t[7]=Ha("h5",{class:"card-title"},"Tá»ng khách tuần hiá»n tại",-1)),Ha("p",CTe,ee(I.value),1)])])]),Ha("div",ETe,[Ha("div",STe,[Ha("div",ITe,[t[8]||(t[8]=Ha("h5",{class:"card-title"},"Tá»ng khách tháng hiá»n tại",-1)),Ha("p",ATe,ee(A.value),1)])])]),Ha("div",DTe,[Ha("div",PTe,[Ha("div",OTe,[t[9]||(t[9]=Ha("h5",{class:"card-title"},"Tá»ng khách nÄm hiá»n tại",-1)),Ha("p",MTe,ee(D.value),1)])])]),Ha("div",NTe,[Ha("div",RTe,[Ha("div",LTe,[t[10]||(t[10]=Ha("h5",{class:"card-title"},"Tá»ng sá» khách toà n thá»i gian",-1)),Ha("p",VTe,ee(S.value),1)])])])]),Ha("div",qTe,[Ha("div",FTe,[Ha("div",BTe,[Ha("div",UTe,[t[15]||(t[15]=Ha("div",{class:"card-header"},[Ha("h5",{class:"filter-title"},"Lá»c theo quầy và loại khách")],-1)),Ha("div",jTe,[Ha("div",HTe,[Ha("div",zTe,[Ha("div",WTe,[t[12]||(t[12]=Ha("label",{for:"quayFilter",class:"form-label"},"Chá»n quầy:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[0]||(t[0]=e=>g.value=e),onChange:B,class:"form-control"},[t[11]||(t[11]=Ha("option",{value:"all"},"Tất cả quầy",-1)),(Ma(!0),Va(Sa,null,gi(M.value,e=>(Ma(),Va("option",{key:e,value:e},ee(e),9,KTe))),128))],544),[[_s,g.value]])]),Ha("div",GTe,[t[14]||(t[14]=Ha("label",{for:"typeCustomerFilter",class:"form-label"},"Chá»n loại khách:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[1]||(t[1]=e=>m.value=e),onChange:j,class:"form-control"},t[13]||(t[13]=[Ha("option",{value:"xephang"},"Xếp hà ng",-1),Ha("option",{value:"hengio"},"Hẹn giá»",-1)]),544),[[_s,m.value]])])])])])])]),Ha("div",YTe,[Ha("div",QTe,[t[22]||(t[22]=Ha("div",{class:"card-header"},[Ha("h5",{class:"filter-title"},"Lá»c theo thá»i gian")],-1)),Ha("div",$Te,[Ha("div",XTe,[Ha("div",JTe,[Ha("div",ZTe,[t[17]||(t[17]=Ha("label",{for:"filterType",class:"form-label"},"Lá»c theo:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[2]||(t[2]=e=>u.value=e),onChange:U,class:"form-control"},t[16]||(t[16]=[Ha("option",{value:"year"},"NÄm",-1),Ha("option",{value:"month"},"Tháng",-1),Ha("option",{value:"week"},"Tuần",-1),Ha("option",{value:"dateRange"},"Khoảng thá»i gian",-1)]),544),[[_s,u.value]])]),"dateRange"!==u.value?(Ma(),Va("div",eCe,[t[18]||(t[18]=Ha("label",{for:"yearFilter",class:"form-label"},"NÄm:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[3]||(t[3]=e=>h.value=e),onChange:j,class:"form-control"},[(Ma(!0),Va(Sa,null,gi(P.value,e=>(Ma(),Va("option",{key:e,value:e},ee(e),9,tCe))),128))],544),[[_s,h.value]])])):Qa("",!0),"month"===u.value||"week"===u.value?(Ma(),Va("div",nCe,[t[19]||(t[19]=Ha("label",{for:"monthFilter",class:"form-label"},"Tháng:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[4]||(t[4]=e=>d.value=e),onChange:U,class:"form-control"},[(Ma(),Va(Sa,null,gi(12,e=>Ha("option",{key:e,value:e},"Tháng "+ee(e),9,iCe)),64))],544),[[_s,d.value]])])):Qa("",!0),"dateRange"===u.value?(Ma(),Va("div",aCe,[t[20]||(t[20]=Ha("label",{for:"startDate",class:"form-label"},"Từ ngà y:",-1)),gn(Ha("input",{type:"date","onUpdate:modelValue":t[5]||(t[5]=e=>f.value=e),onChange:j,class:"form-control"},null,544),[[ms,f.value]])])):Qa("",!0),"dateRange"===u.value?(Ma(),Va("div",oCe,[t[21]||(t[21]=Ha("label",{for:"endDate",class:"form-label"},"Äến ngà y:",-1)),gn(Ha("input",{type:"date","onUpdate:modelValue":t[6]||(t[6]=e=>p.value=e),onChange:j,class:"form-control"},null,544),[[ms,p.value]])])):Qa("",!0),T.value?(Ma(),Va("p",sCe,"Vui lòng chá»n khoảng thá»i gian hợp lá»")):Qa("",!0)])])])])])])]),Ha("div",rCe,[Ha("div",lCe,[Ha("div",cCe,[Ha("h4",uCe,"Thá»ng kê tá»ng lượng khách - "+ee(v.value),1),t[23]||(t[23]=Ha("div",{class:"fullwidth-chart-container"},[Ha("canvas",{id:"yearStatsChart",class:"full-width-chart"})],-1))])])]),Ha("div",hCe,[Ha("div",dCe,[t[25]||(t[25]=Ha("h4",{class:"section-title text-center"},"Tá»· lá» khách theo quầy",-1)),Ha("div",fCe,[t[24]||(t[24]=Ha("c
5555anvas",{id:"pieChart",class:"pie-chart",width:"700",height:"700"},null,-1)),Ot(x)?(Ma(),Va("p",pCe,"Không có dữ liá»u")):Qa("",!0)])])]),t[26]||(t[26]=Ya('<div class="card chart-card shadow-sm mt-3" data-v-afdd2fad><div class="card-body" data-v-afdd2fad><h4 class="section-title text-center" data-v-afdd2fad>Top quầy</h4><canvas id="horizontalBarChart" class="full-width-chart" height="350" data-v-afdd2fad></canvas></div></div><div class="card chart-card shadow-sm mt-3" data-v-afdd2fad><div class="card-body" data-v-afdd2fad><h4 class="text-center section-title" data-v-afdd2fad>Xu hưá»ng khách theo quầy theo thá»i gian</h4><canvas id="lineChart" class="full-width-chart" height="500" data-v-afdd2fad></canvas></div></div><div class="card chart-card shadow-sm mt-3" data-v-afdd2fad><div class="card-body" data-v-afdd2fad><h4 class="text-center section-title" data-v-afdd2fad>Tá»ng sá» khách cá»§a cả ÄÆ¡n vá» theo thá»i gian</h4><canvas id="totalAreaChart" class="full-width-chart" height="500" data-v-afdd2fad></canvas></div></div><div class="card chart-card shadow-sm mt-3" data-v-afdd2fad><div class="card-body" data-v-afdd2fad><h4 class="text-center section-title" data-v-afdd2fad>Sá» lượng khách theo quầy qua từng tháng</h4><canvas id="barChart" class="full-width-chart" height="500" data-v-afdd2fad></canvas></div></div>',4))])]))}},mCe=CC(gCe,[["__scopeId","data-v-afdd2fad"]]),vCe={class:"container content-container"},yCe={class:"header"},bCe={class:"text-center text-uppercase"},_Ce={class:"p-3"},wCe={class:"row"},kCe={class:"col-md-6 col-lg-3 mb-4"},xCe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #6e8efb, #7780e3)",color:"white"}},TCe={class:"card-body text-center"},CCe={class:"card-text display-6 fw-bold"},ECe={class:"col-md-6 col-lg-3 mb-4"},SCe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #ff9d6e, #ff6b6b)",color:"white"}},ICe={class:"card-body text-center"},ACe={class:"card-text display-6 fw-bold"},DCe={class:"col-md-6 col-lg-3 mb-4"},PCe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #6e8efb, #7780e3)",color:"white"}},OCe={class:"card-body text-center"},MCe={class:"card-text display-6 fw-bold"},NCe={class:"col-md-6 col-lg-3 mb-4"},RCe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #ff9d6e, #ff6b6b)",color:"white"}},LCe={class:"card-body text-center"},VCe={class:"card-text display-6 fw-bold"},qCe={class:"filter-container mt-3"},FCe={class:"row"},BCe={class:"col-12 mb-3 mb-md-0"},UCe={class:"card filter-card shadow-sm"},jCe={class:"card-body"},HCe={class:"form-group"},zCe={class:"row"},WCe={class:"col-md-4 col-12 mb-3"},KCe=["value"],GCe={class:"col-md-4 col-12 mb-3"},YCe={class:"col-md-4 col-12 mb-3"},QCe=["min","max"],$Ce={class:"col-12 mb-3 mb-md-0"},XCe={class:"export-button mt-3 d-flex justify-content-end"},JCe=["disabled","title"],ZCe={key:0,class:"text-muted small mb-0 mt-2 text-end w-100"},eEe={class:"table-container mt-4"},tEe={class:"nav nav-tabs",id:"customerTabs",role:"tablist"},nEe={class:"nav-item",role:"presentation"},iEe=["aria-selected"],aEe={class:"nav-item",role:"presentation"},oEe=["aria-selected"],sEe={class:"nav-item",role:"presentation"},rEe=["aria-selected"],lEe={class:"tab-content",id:"customerTabContent"},cEe={key:0,class:"text-center py-3"},uEe={key:1,class:"table table-striped table-hover shadow-sm custom-table"},hEe={key:0},dEe={key:0,class:"text-center py-3"},fEe={key:1,class:"table table-striped table-hover shadow-sm custom-table"},pEe={key:0},gEe={key:0,class:"text-center py-3"},mEe={key:1,class:"table table-striped table-hover shadow-sm custom-table"},vEe={key:0},yEe={class:"pagination mt-3 d-flex justify-content-center align-items-center gap-3"},bEe=["disabled"],_Ee=["disabled"],wEe={__name:"ThongKeChiTietKhachDonVi",setup(e){const t=Vl(),n=JT(),i=wI(),a=y1(),o=Gee(),s=Fde(),{item:r}=Zs(n),{items:l}=Zs(i),{items:c}=Zs(o),u=t.params.don_vi,h=It(""),d=It(""),f=It(""),p=It(1),g=It(30),m=It(!1),v=It(""),y=gt([]),b=It("xephang"),_=It(!1),w=It([]),k=It([]),x=It([]),T=It(null),C=It(null),E=It(null),S=It
5555(!1),I=It(!1),A=It(!1),D=bo(()=>"xephang"===b.value?S.value:"hengio"===b.value?I.value:A.value),P=bo(()=>"uutien"!==b.value&&("xephang"===b.value?!!w.value.length:!!k.value.length)),O=bo(()=>{if(!h.value)return null;const e=new Date(h.value),t=new Date(e);return t.setDate(e.getDate()+29),t.toISOString().split("T")[0]}),M=(new Date).toISOString().split("T")[0],N=bo(()=>{const e=new Date;return e.setDate(e.getDate()-30),e.toISOString().split("T")[0]}),R=()=>{if(h.value&&d.value){const e=new Date(h.value),t=new Date(d.value),n=new Date(e);n.setDate(e.getDate()+29),t>n&&(d.value=n.toISOString().split("T")[0])}V()},L=async()=>{var e,t,n,i,o,r;if(!h.value||!d.value)return;m.value=!0;const l=new Date(h.value),c=new Date(d.value);c.setHours(23,59,59,999);try{if(""!==f.value)if("xephang"===b.value){if("all"===f.value)await a.fetchItemByKhachDaPhucVuByDonVi(u,l,c,g.value,T.value);else await a.fetchItemByKhachDaPhucVuByDonViAndQuay(u,f.value,l,c,g.value,T.value);w.value=a.dsKhachDaPhucVu.data||[],T.value=null==(e=a.dsKhachDaPhucVu)?void 0:e.lastDoc,S.value=null==(t=a.dsKhachDaPhucVu)?void 0:t.hasMore}else if("hengio"===b.value){if("all"===f.value)await s.fetchItemByHenGioDaPhucVuByDonVi(u,l,c,g.value,C.value);else await s.fetchItemByHenGioDaPhucVuByDonViAndQuay(u,f.value,l,c,g.value,C.value);k.value=s.dsHenGioDaPhucVu.data||[],C.value=null==(n=s.dsHenGioDaPhucVu)?void 0:n.lastDoc,I.value=null==(i=s.dsHenGioDaPhucVu)?void 0:i.hasMore}else if("uutien"===b.value){if("all"===f.value)await a.fetchItemByKhachUuTienByDonVi(u,l,c,g.value,E.value);else await a.fetchItemByKhachUuTienByDonViAndQuay(u,f.value,l,c,g.value,E.value);x.value=a.dsKhachUuTien.data||[],E.value=null==(o=a.dsKhachUuTien)?void 0:o.lastDoc,A.value=null==(r=a.dsKhachUuTien)?void 0:r.hasMore}}finally{m.value=!1}},V=()=>{p.value=1,T.value=null,C.value=null,E.value=null,L()},q=()=>{p.value>1&&(p.value--,"xephang"===b.value?T.value=null:"hengio"===b.value?C.value=null:"uutien"===b.value&&(E.value=null),L())},F=()=>{("xephang"===b.value&&S.value||"hengio"===b.value&&I.value||"uutien"===b.value&&A.value)&&(p.value++,L())},B=e=>{b.value!==e&&(b.value=e,p.value=1,"xephang"===e?T.value=null:"hengio"===e?C.value=null:"uutien"===e&&(E.value=null),L())},U=async()=>{if(f.value&&h.value&&d.value){_.value=!0;try{const e={donVi:u,startDate:h.value,endDate:d.value,type:b.value,tenDonVi:v.value,..."all"!==f.value&&{quay:f.value}};await a.exportExcel(e);const t=a.excelUrl;if(t){const n=document.createElement("a");n.href=t,n.download="danh-sach-khach-hang-".concat(e.type,"-").concat(sC(h.value,"-"),"-").concat(sC(d.value,"-"),".xlsx"),document.body.appendChild(n),n.click(),document.body.removeChild(n)}}catch(eRe){VT("Có lá»i xảy ra khi xuất file Excel!")}finally{_.value=!1}}else alert("Vui lòng chá»n Äầy Äá»§ bá» lá»c trưá»c khi xuất Excel!")};ei(async()=>{await Promise.all([n.fetchItemById(u),i.fetchItemsByDonVi(u),o.fetchItemsByDonVi(u)]),y.splice(0,y.length,...c.value.map(e=>{const t=l.value.find(t=>t.id===e.quay),n=(null==t?void 0:t.ten)||"Unknown",i=(null==t?void 0:t.thutu)||0;return{...e,tenQuay:n,tenDonVi:v.value,thutu:i}}).filter(e=>"Unknown"!==e.tenQuay&&"Quầy không xác Äá»nh"!==e.tenQuay&&e.donvi===u).sort((e,t)=>e.thutu-t.thutu)),l.value=l.value.map(e=>(e.hoatdong||(e.ten="".concat(e.ten," (Ngưng hoạt Äá»ng)")),e)),v.value=r.value.ten||"Không xác Äá»nh",h.value=N.value,d.value=M,L()});const j=bo(()=>y.reduce((e,t)=>e+(t.soluongkhach||0),0)),H=bo(()=>{const e=new Date,t=new Date(e);t.setDate(e.getDate()-e.getDay()),t.setHours(0,0,0,0);const n=new Date(t);return n.setDate(t.getDate()+6),n.setHours(23,59,59,999),y.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n}).reduce((e,t)=>e+(t.soluongkhach||0),0)}),z=bo(()=>{const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1,0,0,0,0),n=new Date(e.getFullYear(),e.getMonth()+1,0,23,59,59,999);return y.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n}).reduce((e,t)=>e+(t.soluongkhach||0),0)}),W=bo(()=>{const e=(new Date).getFullYear();return y.filter(t=>new Date(t.ngaythongke).getFullYear()===e).reduce((e,t)=>
5555e+(t.soluongkhach||0),0)}),K=e=>{var t;if(!(null==(t=l.value)?void 0:t.length))return"";const n=l.value.find(t=>t.id===e);return(null==n?void 0:n.ten)||"-"};return(e,t)=>{var n;return Ma(),Va("div",vCe,[Ha("div",yCe,[Ha("h3",bCe,"CHI TIẾT KHÃCH HÃNG - "+ee((null==(n=Ot(r))?void 0:n.ten)||"ÄÆ¡n vá»"),1)]),Ha("div",_Ce,[Ha("div",wCe,[Ha("div",kCe,[Ha("div",xCe,[Ha("div",TCe,[t[6]||(t[6]=Ha("h5",{class:"card-title"},"Tá»ng khách tuần hiá»n tại",-1)),Ha("p",CCe,ee(H.value),1)])])]),Ha("div",ECe,[Ha("div",SCe,[Ha("div",ICe,[t[7]||(t[7]=Ha("h5",{class:"card-title"},"Tá»ng khách tháng hiá»n tại",-1)),Ha("p",ACe,ee(z.value),1)])])]),Ha("div",DCe,[Ha("div",PCe,[Ha("div",OCe,[t[8]||(t[8]=Ha("h5",{class:"card-title"},"Tá»ng khách nÄm hiá»n tại",-1)),Ha("p",MCe,ee(W.value),1)])])]),Ha("div",NCe,[Ha("div",RCe,[Ha("div",LCe,[t[9]||(t[9]=Ha("h5",{class:"card-title"},"Tá»ng sá» khách toà n thá»i gian",-1)),Ha("p",VCe,ee(j.value),1)])])])]),Ha("div",qCe,[Ha("div",FCe,[Ha("div",BCe,[Ha("div",UCe,[t[16]||(t[16]=Ha("div",{class:"card-header"},[Ha("h5",{class:"filter-title"},"Bá» lá»c")],-1)),Ha("div",jCe,[Ha("div",HCe,[Ha("div",zCe,[Ha("div",WCe,[t[12]||(t[12]=Ha("label",{for:"quayFilter",class:"form-label"},"Chá»n quầy:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[0]||(t[0]=e=>f.value=e),onChange:V,class:"form-control"},[t[10]||(t[10]=Ha("option",{value:"",disabled:""},"Chá»n má»t quầy",-1)),t[11]||(t[11]=Ha("option",{value:"all"},"Tất cả quầy",-1)),(Ma(!0),Va(Sa,null,gi(Ot(l),e=>(Ma(),Va("option",{key:e.id,value:e.id},ee(e.ten),9,KCe))),128))],544),[[_s,f.value]])]),Ha("div",GCe,[t[13]||(t[13]=Ha("label",{for:"startDate",class:"form-label"},"Từ ngà y:",-1)),gn(Ha("input",{type:"date","onUpdate:modelValue":t[1]||(t[1]=e=>h.value=e),onChange:R,class:"form-control"},null,544),[[ms,h.value]])]),Ha("div",YCe,[t[14]||(t[14]=Ha("label",{for:"endDate",class:"form-label"},"Äến ngà y:",-1)),gn(Ha("input",{type:"date","onUpdate:modelValue":t[2]||(t[2]=e=>d.value=e),min:h.value,max:O.value,onChange:V,class:"form-control"},null,40,QCe),[[ms,d.value]])]),Ha("div",$Ce,[Ha("div",XCe,[Ha("button",{class:"btn btn-custom btn-gradient-blue",disabled:_.value||!P.value,title:"uutien"===b.value?"Chưa há» trợ xuất Excel cho danh sách khách ưu tiên":"",onClick:U},[t[15]||(t[15]=Ha("i",{class:"fas fa-file-export me-2"},null,-1)),Ga(" "+ee(_.value?"Äang xuất file":"Xuất Excel"),1)],8,JCe),"uutien"===b.value?(Ma(),Va("p",ZCe," Danh sách khách ưu tiên chưa xuất ÄÆ°á»£c Excel. ")):Qa("",!0)])])])])])])])])]),Ha("div",eEe,[Ha("ul",tEe,[Ha("li",nEe,[Ha("button",{class:G(["nav-link",{active:"xephang"===b.value}]),id:"xephang-tab",onClick:t[3]||(t[3]=e=>B("xephang")),type:"button",role:"tab","aria-controls":"xephang","aria-selected":"xephang"===b.value}," Khách xếp hà ng ",10,iEe)]),Ha("li",aEe,[Ha("button",{class:G(["nav-link",{active:"hengio"===b.value}]),id:"hengio-tab",onClick:t[4]||(t[4]=e=>B("hengio")),type:"button",role:"tab","aria-controls":"hengio","aria-selected":"hengio"===b.value}," Khách hẹn giá» ",10,oEe)]),Ha("li",sEe,[Ha("button",{class:G(["nav-link",{active:"uutien"===b.value}]),id:"uutien-tab",onClick:t[5]||(t[5]=e=>B("uutien")),type:"button",role:"tab","aria-controls":"uutien","aria-selected":"uutien"===b.value}," Khách ưu tiên ",10,rEe)])]),Ha("div",lEe,[Ha("div",{class:G(["tab-pane fade",{"show active":"xephang"===b.value}]),id:"xephang",role:"tabpanel","aria-labelledby":"xephang-tab"},[m.value?(Ma(),Va("div",cEe,"Äang tải dữ liá»u...")):(Ma(),Va("table",uEe,[t[18]||(t[18]=Ha("thead",null,[Ha("tr",null,[Ha("th",null,"STT"),Ha("th",{scope:"col"},"Há» tên"),Ha("th",{scope:"col"},"Email"),Ha("th",{scope:"col"},"Sá» Äiá»n thoại"),Ha("th",{scope:"col"},"Lấy sá» lúc"),Ha("th",{scope:"col"},"Thá»i gian giao dá»ch"),Ha("th",{scope:"col"},"Quầy")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(w.value,(e,t)=>(Ma(),Va("tr",{key:t},[Ha("td",null,ee(e.stt||"-"),1),Ha("td",null,ee(e.hoten),1),Ha("td",null,ee(e.email||"-"),1),Ha("td",null,ee(e.sodienthoai||"-"),1),Ha("td",null,ee(Ot(aC)(e.taoluc)),1),Ha("td",null,ee(Ot(aC)(e.daphucvu)),1),Ha("td",null,ee(K(e.quay)||"-"),1)]))),128)),w.value.length?Qa("",!0):(Ma(),Va("tr",hEe,t[17]||(t[17]=[Ha("td",{colspan:"7",class:"text-center"},"Không có dữ liá»u",-1)])))])]))],2),Ha("div",{class:G(["tab-pane fade",{"show active":"hengio"===b.value}]),id:"hengio",role:"tabpanel","aria-labelledby":"hengio-tab"},[m.value?(Ma(),Va("div",dEe,"Äang tải dữ liá»u...")):(Ma(),Va("table",fEe,[t[20]||(t[20]=Ha("thead",null,[Ha("tr",null,[Ha("th",{scope:"col"},"Há» tên"),Ha("th",{scope:"col"},"Email"),Ha("th",{scope:"col"},"Sá» Äiá»n thoại"),Ha("th",{scope:"col"},"Thá»i gian hẹn"),Ha("th",{scope:"col"},"Xác nháºn"),Ha("th",{scope:"col"},"Thá»i gian giao dá»ch"),Ha("th",{scope:"col"},"Quầy")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(k.value,(e,t)=>(Ma(),Va("tr",{key:t},[Ha("td",null,ee(e.hoten),1),Ha("td",null,ee(e.email||"-"),1),Ha("td",null,ee(e.sodienthoai||"-"),1),Ha("td",null,ee(Ot(aC)(e.ngayhengio)),1),Ha("td",null,[Ha("span",{class:G(e.daxacnhan?"text-success":"text-danger")}
5555,ee(e.daxacnhan?"Äã xác nháºn":"Chưa xác nháºn"),3)]),Ha("td",null,ee(Ot(aC)(e.daphucvu)),1),Ha("td",null,ee(K(e.quay)||"-"),1)]))),128)),k.value.length?Qa("",!0):(Ma(),Va("tr",pEe,t[19]||(t[19]=[Ha("td",{colspan:"7",class:"text-center"},"Không có dữ liá»u",-1)])))])]))],2),Ha("div",{class:G(["tab-pane fade",{"show active":"uutien"===b.value}]),id:"uutien",role:"tabpanel","aria-labelledby":"uutien-tab"},[m.value?(Ma(),Va("div",gEe,"Äang tải dữ liá»u...")):(Ma(),Va("table",mEe,[t[22]||(t[22]=Ha("thead",null,[Ha("tr",null,[Ha("th",{scope:"col"},"STT"),Ha("th",{scope:"col"},"Há» tên"),Ha("th",{scope:"col"},"Email"),Ha("th",{scope:"col"},"Sá» Äiá»n thoại"),Ha("th",{scope:"col"},"Diá»n ưu tiên"),Ha("th",{scope:"col"},"Lấy sá» lúc"),Ha("th",{scope:"col"},"Thá»i gian giao dá»ch"),Ha("th",{scope:"col"},"Quầy")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(x.value,(e,t)=>(Ma(),Va("tr",{key:t},[Ha("td",null,ee(e.stt||"-"),1),Ha("td",null,ee(e.hoten),1),Ha("td",null,ee(e.email||"-"),1),Ha("td",null,ee(e.sodienthoai||"-"),1),Ha("td",null,ee(e.doi_tuong_uu_tien||"-"),1),Ha("td",null,ee(Ot(aC)(e.taoluc)),1),Ha("td",null,ee(Ot(aC)(e.daphucvu)),1),Ha("td",null,ee(K(e.quay)||"-"),1)]))),128)),x.value.length?Qa("",!0):(Ma(),Va("tr",vEe,t[21]||(t[21]=[Ha("td",{colspan:"8",class:"text-center"},"Không có dữ liá»u",-1)])))])]))],2)]),Ha("div",yEe,[Ha("button",{class:"btn btn-custom btn-gradient-blue",disabled:1===p.value||m.value,onClick:q}," Trang trưá»c ",8,bEe),Ha("span",null,"Trang "+ee(p.value),1),Ha("button",{class:"btn btn-custom btn-gradient-blue",disabled:!D.value||m.value,onClick:F}," Trang sau ",8,_Ee)])])])])}}},kEe=CC(wEe,[["__scopeId","data-v-a979d051"]]),xEe={class:"container content-container"},TEe={class:"p-3"},CEe={class:"filter-container mt-3"},EEe={class:"row"},SEe={class:"col-12 mb-3 mb-md-0"},IEe={class:"card filter-card shadow-sm"},AEe={class:"card-body"},DEe={class:"form-group"},PEe={class:"row"},OEe={class:"col-md-3 col-12 mb-3"},MEe=["value"],NEe={class:"col-md-3 col-12 mb-3"},REe=["disabled"],LEe=["value"],VEe={class:"col-md-3 col-12 mb-3"},qEe={key:0,class:"col-md-3 col-12 mb-3"},FEe=["value"],BEe={key:1,class:"col-md-3 col-12 mb-3"},UEe=["value"],jEe={key:2,class:"col-md-3 col-12 mb-3"},HEe=["value"],zEe={class:"col-md-3 col-12 mb-3"},WEe=["value"],KEe={class:"col-12 mb-3 mb-md-0"},GEe={class:"export-button mt-3 d-flex justify-content-end"},YEe=["disabled"],QEe={class:"table-container mt-4"},$Ee={class:"nav nav-tabs",id:"customerTabs",role:"tablist"},XEe={class:"nav-item",role:"presentation"},JEe=["aria-selected"],ZEe={class:"nav-item",role:"presentation"},eSe=["aria-selected"],tSe={class:"tab-content",id:"customerTabContent"},nSe={key:0,class:"text-center py-3"},iSe={key:1,class:"table table-striped table-hover shadow-sm custom-table"},aSe=["onClick"],oSe={key:0},sSe={key:0,class:"text-center py-3"},rSe={key:1,class:"table table-striped table-hover shadow-sm custom-table"},lSe=["onClick"],cSe={key:0},uSe={class:"modal-content"},hSe={class:"modal-header"},dSe={class:"modal-title"},fSe={class:"modal-body"},pSe={class:"table table-striped table-hover custom-table"},gSe={__name:"TopKhach",setup(e){const t=JT(),n=wI(),i=y1(),a=Fde(),{items:o}=Zs(t),{items:s}=Zs(n),r=It(""),l=It(""),c=It(""),u=It((new Date).getFullYear()),h=It((new Date).getMonth()+1),d=It(1),f=It("xephang"),p=It([]),g=It([]),m=It(!1),v=It(null),y=It(!1),b=It(!1),_=It(10),w=It([]),k=[10,20,25,30,50,75,100],x=bo(()=>{const e=(new Date).getFullYear();return Array.from({length:5},(t,n)=>e-2+n)}),T=bo(()=>[{value:1,label:"Tháng 1"},{value:2,label:"Tháng 2"},{value:3,label:"Tháng 3"},{value:4,label:"Tháng 4"},{value:5,label:"Tháng 5"},{value:6,label:"Tháng 6"},{value:7,label:"Tháng 7"},{value:8,label:"Tháng 8"},{value:9,label:"Tháng 9"},{value:10,label:"Tháng 10"},{value:11,label:"Tháng 11"},{value:12,label:"Tháng 12"}]),C=bo(()=>{if(!u.value)return[];const e=u.value,t=[],n=new Date(e,0,1),i=new Date(e,11,31);let a=new Date(n),o=1;for(;a<=i;){const e=new Date(a),n=new Date(a);n.setDate(e.getDate()+6),n>i&&n.setTime(i.getTime()),t.push({value:o,label:"Tuần ".concat(o," (").concat(e.getDate(),"/").concat(e.getMonth()+1," - ").concat(n.getDate(),"/").concat(n.getMonth()+1,")")}),a.setDate(a.getDate()+7),o++}return t}),E=async()=>
5555{if(!r.value||!c.value)return;y.value=!0;const{startTime:e,endTime:t}=(()=>{const e=u.value;let t,n;if("year"===c.value)t=new Date(e,0,1),n=new Date(e,11,31,23,59,59,999);else if("month"===c.value)t=new Date(e,h.value-1,1),n=new Date(e,h.value,0,23,59,59,999);else if("week"===c.value){const i=new Date(e,0,1),a=d.value-1;t=new Date(i),t.setDate(i.getDate()+7*a),n=new Date(t),n.setDate(t.getDate()+6),n.setHours(23,59,59,999);const o=new Date(e,11,31,23,59,59,999);n>o&&(n=o)}return{startTime:t,endTime:n}})();try{if("xephang"===f.value){await i.fetchItemByKhachDaPhucVuByDonVi(r.value,e,t,1e3,null);let n=i.dsKhachDaPhucVu.data||[];l.value&&(n=n.filter(e=>e.quay===l.value));const a={};n.forEach(e=>{var t;const n="".concat(e.hoten||"Không tên","-").concat(e.sodienthoai||"Không sá»");a[n]||(a[n]={...e,soLanDen:0,visits:[]}),a[n].soLanDen+=1,a[n].visits.push({daphucvu:e.daphucvu,tenQuay:(null==(t=s.value.find(t=>t.id===e.quay))?void 0:t.ten)||"Không xác Äá»nh",stt:e.stt,sdt:e.sodienthoai||"-",taoluc:aC(e.taoluc)})}),p.value=Object.values(a).sort((e,t)=>t.soLanDen-e.soLanDen).slice(0,_.value)}else if("hengio"===f.value){await a.fetchItemByHenGioDaPhucVuByDonVi(r.value,e,t,1e3,null);let n=a.dsHenGioDaPhucVu.data||[];l.value&&(n=n.filter(e=>e.quay===l.value));const i={};n.forEach(e=>{var t;const n="".concat(e.hoten||"Không tên","-").concat(e.sodienthoai||"Không sá»");i[n]||(i[n]={...e,soLanDen:0,visits:[]}),i[n].soLanDen+=1,i[n].visits.push({daphucvu:e.daphucvu,tenQuay:(null==(t=s.value.find(t=>t.id===e.quay))?void 0:t.ten)||"Không xác Äá»nh",stt:e.stt||"-",sdt:e.sodienthoai,taoluc:aC(e.ngayhengio)})}),g.value=Object.values(i).sort((e,t)=>t.soLanDen-e.soLanDen).slice(0,_.value)}}finally{y.value=!1}},S=()=>{"year"===c.value?(h.value=null,d.value=1):("month"===c.value||"week"===c.value)&&(h.value=(new Date).getMonth()+1,d.value=1),r.value&&E()},I=()=>{d.value=1,r.value&&E()},A=e=>{f.value!==e&&(f.value=e,r.value&&c.value&&E())},D=e=>{v.value=e,m.value=!0},P=()=>{m.value=!1,v.value=null},O=async()=>{var e,t;if(r.value){b.value=!0;try{const n="xephang"==f.value?p.value:g.value;if(!n.length)return void VT("Không có dữ liá»u khách hà ng!");const a=l.value?(null==(e=w.value.find(e=>e.id===l.value))?void 0:e.ten)||"Quầy không xác Äá»nh":"Tất cả quầy",s={data:n,type:f.value,donVi:(null==(t=o.value.find(e=>e.id==r.value))?void 0:t.ten)||"ÄÆ¡n vá» không xác Äá»nh",quay:a,limit:_.value||10};await i.exportExcelTopKhach(s);const c=i.excelUrl;if(c){const e=document.createElement("a");e.href=c;let t="top-".concat(_.value,"-khach-hang-").concat(f.value);l.value&&(t+="-quay-".concat(rC(a))),e.download="".concat(t,".xlsx"),document.body.appendChild(e),e.click(),document.body.removeChild(e)}}catch(eRe){VT("Có lá»i xảy ra khi xuất file Excel!")}finally{b.value=!1}}else alert("Vui lòng chá»n Äầy Äá»§ bá» lá»c trưá»c khi xuất Excel!")},M=async()=>{l.value="",r.value&&(await n.fetchItemsByDonVi(r.value),w.value=n.items.map(e=>(e.hoatdong||(e.ten="".concat(e.ten," (Ngưng hoạt Äá»ng)")),e)),E())};return ei(async()=>{await Promise.all([t.fetchItems(),n.fetchItems()])}),(e,t)=>(Ma(),Va("div",xEe,[t[26]||(t[26]=Ha("div",{class:"header"},[Ha("h3",{class:"text-center text-uppercase"},"TOP KHÃCH HÃNG GIAO Dá»CH NHIá»U NHẤT")],-1)),Ha("div",TEe,[Ha("div",CEe,[Ha("div",EEe,[Ha("div",SEe,[Ha("div",IEe,[t[20]||(t[20]=Ha("div",{class:"card-header"},[Ha("h5",{class:"filter-title"},"Bá» lá»c")],-1)),Ha("div",AEe,[Ha("div",DEe,[Ha("div",PEe,[Ha("div",OEe,[t[10]||(t[10]=Ha("label",{for:"donVi",class:"form-label"},"ÄÆ¡n vá»:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[0]||(t[0]=e=>r.value=e),onChange:M,class:"form-control"},[t[9]||(t[9]=Ha("option",{value:"",disabled:""},"Chá»n ÄÆ¡n vá»",-1)),(Ma(!0),Va(Sa,null,gi(Ot(o),e=>(Ma(),Va("option",{key:e.id,value:e.id},ee(e.ten),9,MEe))),128))],544),[[_s,r.value]])]),Ha("div",NEe,[t[12]||(t[12]=Ha("label",{for:"quay",class:"form-label"},"Quầy:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[1]||(t[1]=e=>l.value=e),onChange:E,class:"form-control",disabled:!r.value},[t[11]||(t[11]=Ha("option",{value:""},"Tất cả quầy",-1)),(Ma(!0),Va(Sa,null,gi(w.value,e=>(Ma(),Va("option",{key:e.id,value:e.id},ee(e.ten),9,LEe))),128))],40,REe),[[_s,l.value]])]),Ha("div",VEe,[t[14]||(t[14]=Ha("label",{for:"filterType",class:"form-label"},"Loại thá»i gian:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[2]||(t[2]=e=>c.value=e),onChange:S,class:"form-control"},t[13]||(t[13]=[Ha("option",{value:"",disabled:""},"Vui lòng chá»n",-1),Ha("option",{value:"year"},"NÄm",-1),Ha("option",{value:"month"},"Tháng",-1),Ha("option",{value:"week"},"Tuần",-1)]),544),[[_s,c.value]])]),""!==c.value?(Ma(),Va("div",qEe,[t[15]||(t[15]=H
5555a("label",{for:"year",class:"form-label"},"NÄm:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[3]||(t[3]=e=>u.value=e),onChange:I,class:"form-control"},[(Ma(!0),Va(Sa,null,gi(x.value,e=>(Ma(),Va("option",{key:e,value:e},ee(e),9,FEe))),128))],544),[[_s,u.value]])])):Qa("",!0),"month"===c.value?(Ma(),Va("div",BEe,[t[16]||(t[16]=Ha("label",{for:"month",class:"form-label"},"Tháng:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[4]||(t[4]=e=>h.value=e),onChange:E,class:"form-control"},[(Ma(!0),Va(Sa,null,gi(T.value,e=>(Ma(),Va("option",{key:e.value,value:e.value},ee(e.label),9,UEe))),128))],544),[[_s,h.value]])])):Qa("",!0),"week"===c.value?(Ma(),Va("div",jEe,[t[17]||(t[17]=Ha("label",{for:"week",class:"form-label"},"Tuần:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[5]||(t[5]=e=>d.value=e),onChange:E,class:"form-control"},[(Ma(!0),Va(Sa,null,gi(C.value,e=>(Ma(),Va("option",{key:e.value,value:e.value},ee(e.label),9,HEe))),128))],544),[[_s,d.value]])])):Qa("",!0),Ha("div",zEe,[t[18]||(t[18]=Ha("label",{for:"topLimit",class:"form-label"},"Sá» lượng hiá»n thá»:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[6]||(t[6]=e=>_.value=e),onChange:E,class:"form-control",id:"topLimit"},[(Ma(),Va(Sa,null,gi(k,e=>Ha("option",{key:e,value:e},ee(e),9,WEe)),64))],544),[[_s,_.value]])]),Ha("div",KEe,[Ha("div",GEe,[Ha("button",{class:"btn btn-custom btn-gradient-blue",disabled:b.value||!p.value.length&&!g.value.length,onClick:O},[t[19]||(t[19]=Ha("i",{class:"fas fa-file-export me-2"},null,-1)),Ga(" "+ee(b.value?"Äang xuất file":"Xuất Excel"),1)],8,YEe)])])])])])])])])]),Ha("div",QEe,[Ha("ul",$Ee,[Ha("li",XEe,[Ha("button",{class:G(["nav-link",{active:"xephang"===f.value}]),id:"xephang-tab",onClick:t[7]||(t[7]=e=>A("xephang")),type:"button",role:"tab","aria-controls":"xephang","aria-selected":"xephang"===f.value}," Khách xếp hà ng ",10,JEe)]),Ha("li",ZEe,[Ha("button",{class:G(["nav-link",{active:"hengio"===f.value}]),id:"hengio-tab",onClick:t[8]||(t[8]=e=>A("hengio")),type:"button",role:"tab","aria-controls":"hengio","aria-selected":"hengio"===f.value}," Khách hẹn giá» ",10,eSe)])]),Ha("div",tSe,[Ha("div",{class:G(["tab-pane fade",{"show active":"xephang"===f.value}]),id:"xephang",role:"tabpanel","aria-labelledby":"xephang-tab"},[y.value?(Ma(),Va("div",nSe,"Äang tải dữ liá»u...")):(Ma(),Va("table",iSe,[t[22]||(t[22]=Ha("thead",null,[Ha("tr",null,[Ha("th",{scope:"col"},"STT"),Ha("th",{scope:"col"},"Há» tên"),Ha("th",{scope:"col"},"Email"),Ha("th",{scope:"col"},"Sá» Äiá»n thoại"),Ha("th",{scope:"col"},"Sá» lần"),Ha("th",{scope:"col"},"Hà nh Äá»ng")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(p.value,(e,t)=>(Ma(),Va("tr",{key:t},[Ha("td",null,ee(t+1),1),Ha("td",null,ee(e.hoten),1),Ha("td",null,ee(e.email||"-"),1),Ha("td",null,ee(e.sodienthoai||"-"),1),Ha("td",null,ee(e.soLanDen),1),Ha("td",null,[Ha("button",{class:"btn btn-custom btn-gradient-orange btn-sm",onClick:t=>D(e)}," Xem chi tiết ",8,aSe)])]))),128)),p.value.length?Qa("",!0):(Ma(),Va("tr",oSe,t[21]||(t[21]=[Ha("td",{colspan:"6",class:"text-center"},"Không có dữ liá»u",-1)])))])]))],2),Ha("div",{class:G(["tab-pane fade",{"show active":"hengio"===f.value}]),id:"hengio",role:"tabpanel","aria-labelledby":"hengio-tab"},[y.value?(Ma(),Va("div",sSe,"Äang tải dữ liá»u...")):(Ma(),Va("table",rSe,[t[24]||(t[24]=Ha("thead",null,[Ha("tr",null,[Ha("th",{scope:"col"},"STT"),Ha("th",{scope:"col"},"Há» tên"),Ha("th",{scope:"col"},"Email"),Ha("th",{scope:"col"},"Sá» Äiá»n thoại"),Ha("th",{scope:"col"},"Sá» lần"),Ha("th",{scope:"col"},"Hà nh Äá»ng")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(g.value,(e,t)=>(Ma(),Va("tr",{key:t},[Ha("td",null,ee(t+1),1),Ha("td",null,ee(e.hoten),1),Ha("td",null,ee(e.email||"-"),1),Ha("td",null,ee(e.sodienthoai||"-"),1),Ha("td",null,ee(e.soLanDen),1),Ha("td",null,[Ha("button",{class:"btn btn-custom btn-gradient-orange btn-sm",onClick:t=>D(e)}," Xem chi tiết ",8,lSe)])]))),128)),g.value.length?Qa("",!0):(Ma(),Va("tr",cSe,t[23]||(t[23]=[Ha("td",{colspan:"6",class:"text-center"},"Không có dữ liá»u",-1)])))])]))],2)])]),m.value?(Ma(),Va("div",{key:0,class:"modal-overlay",onClick:Es(P,["self"])},[Ha("div",uSe,[Ha("div",hSe,[Ha("h5",dSe,"Chi tiết khách hà ng: "+ee(v.value.hoten),1),Ha("button",{class:"btn-close",onClick:P})]),Ha("div",fSe,[Ha("table",pSe,[t[25]||(t[25]=Ha("thead",null,[Ha("tr",null,[Ha("th",null,"Sá» Äiá»n thoại"),Ha("th",null,"Quầy"),Ha("th",null,"Thá»i gian")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(v.value.visits,(e,t)=>(Ma(),Va("tr",{key:t},[Ha("td",null,ee(e.sdt),1),Ha("td",null,ee(e.tenQuay),1),Ha("td",null,ee(e.taoluc),1)]))),128))])])]),Ha("div",{class:"modal-footer"},[Ha("button",{class:"btn btn-gradient-blue",onClick:P},"Äóng")])])])):Qa("",!0)])]))}},mSe=CC(gSe,[["__scopeId","data-v-d2614e0a"]]),vSe={class:"container content-container"},ySe={class:"header"},bSe={class:"text-center text-uppercase"},_Se={class:"p-3"},wSe={class:"filter-container mt-3"},kSe={class:"row"},xSe={class:"col-12 mb-3 mb-md-0"},TSe={class:"card filter-card shadow-sm"},CSe={class:"card-body"},ESe={class:"form-group"},SSe={class:"row"},ISe={class:"col-md-3 col-12 mb-3"},ASe=["value"],DSe={class:"col-md-3 col-12 mb-3"},PSe={key:0,class:"col-md-3 col-12 mb-3"},OSe=["value"],MSe={key:1,class:"col-md-3 col-12 mb-3"},NSe=["value"],RSe={key:2,class:"col-md-3 col-12 mb-3"},LSe=["value"],VSe={class:"col-md-3 col-12 mb-3"},qSe=["value"],FSe={class:"col-12 mb-3 mb-md-0"},BSe={class:"export-button mt-3 d-flex justify-content-end"},USe=["disabled"],jSe={class:"table-container mt-4"},HSe={class:"nav nav-tabs",id:"customerTabs",role:"tablist"},zSe={class:"nav-item",role:"presentation"},WSe=["aria-selected"],KSe={class:"nav-item",role:"presentation"},GSe=["aria-selected"],YSe={class:"tab-content",id:"customerTabContent"},QSe={key:0,class:"text-center py-3"},$Se={key:1,class:"table table-striped table-hover shadow-sm custom-table"},XSe=["onClick"],JSe={key:0},ZSe={key:0,class:"text-center py-3"},eIe={key:1,class:"table table-striped table-hover shadow-sm custom-table"},tIe=["onClick"],nIe={key:0},iIe={class:"modal-content"},aIe={class:"modal-header"},oIe={class:"modal-title"},sIe={class:"modal-body"},rIe={class:"table table-striped table-hover custom-table"},lIe=CC({__name:"TopKhachDonVi",setup(e){const t=Vl(),n=JT(),i=wI(),a=y1(),o=Fde(),{item:s}=Zs(n),{items:r}=Zs(i),l=t.params.don_vi,c=It(""),u=It((new Date).getFullYear()),h=It((new Date).getMonth()+1),d=It(1),f=It("xephang"),p=It([]),g=It([]),m=
5555It(!1),v=It(null),y=It(!1),b=It(!1),_=It(10),w=It(""),k=[10,20,25,30,50,75,100],x=bo(()=>{const e=(new Date).getFullYear();return Array.from({length:5},(t,n)=>e-2+n)}),T=bo(()=>[{value:1,label:"Tháng 1"},{value:2,label:"Tháng 2"},{value:3,label:"Tháng 3"},{value:4,label:"Tháng 4"},{value:5,label:"Tháng 5"},{value:6,label:"Tháng 6"},{value:7,label:"Tháng 7"},{value:8,label:"Tháng 8"},{value:9,label:"Tháng 9"},{value:10,label:"Tháng 10"},{value:11,label:"Tháng 11"},{value:12,label:"Tháng 12"}]),C=bo(()=>{if(!u.value)return[];const e=u.value,t=[],n=new Date(e,0,1),i=new Date(e,11,31);let a=new Date(n),o=1;for(;a<=i;){const e=new Date(a),n=new Date(a);n.setDate(e.getDate()+6),n>i&&n.setTime(i.getTime()),t.push({value:o,label:"Tuần ".concat(o," (").concat(e.getDate(),"/").concat(e.getMonth()+1," - ").concat(n.getDate(),"/").concat(n.getMonth()+1,")")}),a.setDate(a.getDate()+7),o++}return t}),E=async()=>{if(!c.value)return;y.value=!0;const{startTime:e,endTime:t}=(()=>{const e=u.value;let t,n;if("year"===c.value)t=new Date(e,0,1),n=new Date(e,11,31,23,59,59,999);else if("month"===c.value)t=new Date(e,h.value-1,1),n=new Date(e,h.value,0,23,59,59,999);else if("week"===c.value){const i=new Date(e,0,1),a=d.value-1;t=new Date(i),t.setDate(i.getDate()+7*a),n=new Date(t),n.setDate(t.getDate()+6),n.setHours(23,59,59,999);const o=new Date(e,11,31,23,59,59,999);n>o&&(n=o)}return{startTime:t,endTime:n}})();try{if("xephang"===f.value){await a.fetchItemByKhachDaPhucVuByDonVi(l,e,t,1e3,null);let n=a.dsKhachDaPhucVu.data||[];w.value&&(n=n.filter(e=>e.quay===w.value));const i={};n.forEach(e=>{var t;const n="".concat(e.hoten||"Không tên","-").concat(e.sodienthoai||"Không sá»");i[n]||(i[n]={...e,soLanDen:0,visits:[]}),i[n].soLanDen+=1,i[n].visits.push({daphucvu:e.daphucvu,tenQuay:(null==(t=r.value.find(t=>t.id===e.quay))?void 0:t.ten)||"Không xác Äá»nh",stt:e.stt,sdt:e.sodienthoai||"-",taoluc:aC(e.taoluc)})}),p.value=Object.values(i).sort((e,t)=>t.soLanDen-e.soLanDen).slice(0,_.value)}else if("hengio"===f.value){await o.fetchItemByHenGioDaPhucVuByDonVi(l,e,t,1e3,null);let n=o.dsHenGioDaPhucVu.data||[];w.value&&(n=n.filter(e=>e.quay===w.value));const i={};n.forEach(e=>{var t;const n="".concat(e.hoten||"Không tên","-").concat(e.sodienthoai||"Không sá»");i[n]||(i[n]={...e,soLanDen:0,visits:[]}),i[n].soLanDen+=1,i[n].visits.push({daphucvu:e.daphucvu,tenQuay:(null==(t=r.value.find(t=>t.id===e.quay))?void 0:t.ten)||"Không xác Äá»nh",stt:e.stt||"-",sdt:e.sodienthoai,taoluc:aC(e.ngayhengio)})}),g.value=Object.values(i).sort((e,t)=>t.soLanDen-e.soLanDen).slice(0,_.value)}}finally{y.value=!1}},S=()=>{"year"===c.value?(h.value=null,d.value=1):("month"===c.value||"week"===c.value)&&(h.value=(new Date).getMonth()+1,d.value=1),E()},I=()=>{d.value=1,E()},A=e=>{f.value!==e&&(f.value=e,c.value&&E())},D=e=>{v.value=e,m.value=!0},P=()=>{m.value=!1,v.value=null},O=async()=>{var e,t;b.value=!0;try{const n="xephang"==f.value?p.value:g.value;if(!n.length)return void VT("Không có dữ liá»u khách hà ng!");const i=w.value?(null==(e=r.value.find(e=>e.id===w.value))?void 0:e.ten)||"Quầy không xác Äá»nh":"Tất cả quầy",o={data:n,type:f.value,donVi:(null==(t=s.value)?void 0:t.ten)||"ÄÆ¡n vá» không xác Äá»nh",quay:i,limit:_.value||10};await a.exportExcelTopKhach(o);const l=a.excelUrl;if(l){const e=document.createElement("a");e.href=l;let t="top-".concat(_.value,"-khach-hang-").concat(f.value);w.value&&(t+="-quay-".concat(rC(i))),e.download="".concat(t,".xlsx"),document.body.appendChild(e),e.click(),document.body.removeChild(e)}}catch(eRe){VT("Có lá»i xảy ra khi xuất file Excel!")}finally{b.value=!1}};return ei(async()=>{await Promise.all([n.fetchItemById(l),i.fetchItemsByDonVi(l)]),r.value=r.value.map(e=>(e.hoatdong||(e.ten="".concat(e.ten," (Ngưng hoạt Äá»ng)")),e))}),(e,t)=>{var n;return Ma(),Va("div",vSe,[Ha("div",ySe,[Ha("h3",bSe,[t[8]||(t[8]=Ga("TOP KHÃCH HÃNG GIAO Dá»CH NHIá»U NHẤT ")),t[9]||(t[9]=Ha("br",null,null,-1)),Ga(ee(null==(n=Ot(s))?void 0:n.ten),1)])]),Ha("div",_Se,[Ha("div",wSe,[Ha("div",kSe,[Ha("div",xSe,[Ha("div",TSe,[t[19]||(t[19]=Ha("div",{class:"card-header"},[Ha("h5",{class:"filter-title"},"Bá» lá»c")],-1)),Ha("div",CSe,[Ha("div",ESe,[Ha("div",SSe,[Ha("div",ISe,[t[11]||(t[11]=Ha("label",{for:"quay",class:"form-label"},"Quầy:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[0]||(t[0]=e=>w.value=e),onChange:E,class:"form-control"},[t[10]||(t[10]=Ha("option",{value:""},"Tất cả quầy",-1)),(Ma(!0),Va(Sa,null,gi(Ot(r),e=>(Ma(),Va("option",{key:e.id,value:e.id},ee(e.ten),9,ASe))),128))],544),[[_s,w.value]])]),Ha("div",DSe,[t[13]||(t[13]=Ha("label",{for:"filterType",class:"form-label"},"Loại thá»i gian:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[1]||(t[1]=e=>c.value=e),onChange:S,class:"form-control"},t[12]||(t[12]=[Ha("option",{value:"",disabled:""},"Vui lòng chá»n",-1),Ha("option",{value:"year"},"NÄm",-1),Ha("option",{value:"month"},"Tháng",-1),Ha("option",{value:"week"},"Tuần",-1)]),544),[[_s,c.value]])]),""!==c.value?(Ma(),Va("div",PSe,[t[14]||(t[14]=Ha("label",{for:"year",class:"form-label"},"NÄm:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[2]||(t[2]=e=>u.value=e),onChange:I,class:"form-control"},[(Ma(!0),Va(Sa,null,gi(x.value,e=>(Ma(),Va("option",{key:e,value:e},ee(e),9,OSe))),128))],544),[[_s,u.value]])])):Qa("",!0),"month"===c.value?(Ma(),Va("div",MSe,[t[15]||(t[15]=H
5555a("label",{for:"month",class:"form-label"},"Tháng:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[3]||(t[3]=e=>h.value=e),onChange:E,class:"form-control"},[(Ma(!0),Va(Sa,null,gi(T.value,e=>(Ma(),Va("option",{key:e.value,value:e.value},ee(e.label),9,NSe))),128))],544),[[_s,h.value]])])):Qa("",!0),"week"===c.value?(Ma(),Va("div",RSe,[t[16]||(t[16]=Ha("label",{for:"week",class:"form-label"},"Tuần:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[4]||(t[4]=e=>d.value=e),onChange:E,class:"form-control"},[(Ma(!0),Va(Sa,null,gi(C.value,e=>(Ma(),Va("option",{key:e.value,value:e.value},ee(e.label),9,LSe))),128))],544),[[_s,d.value]])])):Qa("",!0),Ha("div",VSe,[t[17]||(t[17]=Ha("label",{for:"topLimit",class:"form-label"},"Sá» lượng hiá»n thá»:",-1)),gn(Ha("select",{"onUpdate:modelValue":t[5]||(t[5]=e=>_.value=e),onChange:E,class:"form-control",id:"topLimit"},[(Ma(),Va(Sa,null,gi(k,e=>Ha("option",{key:e,value:e},ee(e),9,qSe)),64))],544),[[_s,_.value]])]),Ha("div",FSe,[Ha("div",BSe,[Ha("button",{class:"btn btn-custom btn-gradient-blue",disabled:b.value||!p.value.length&&!g.value.length,onClick:O},[t[18]||(t[18]=Ha("i",{class:"fas fa-file-export me-2"},null,-1)),Ga(" "+ee(b.value?"Äang xuất file":"Xuất Excel"),1)],8,USe)])])])])])])])])]),Ha("div",jSe,[Ha("ul",HSe,[Ha("li",zSe,[Ha("button",{class:G(["nav-link",{active:"xephang"===f.value}]),id:"xephang-tab",onClick:t[6]||(t[6]=e=>A("xephang")),type:"button",role:"tab","aria-controls":"xephang","aria-selected":"xephang"===f.value}," Khách xếp hà ng ",10,WSe)]),Ha("li",KSe,[Ha("button",{class:G(["nav-link",{active:"hengio"===f.value}]),id:"hengio-tab",onClick:t[7]||(t[7]=e=>A("hengio")),type:"button",role:"tab","aria-controls":"hengio","aria-selected":"hengio"===f.value}," Khách hẹn giá» ",10,GSe)])]),Ha("div",YSe,[Ha("div",{class:G(["tab-pane fade",{"show active":"xephang"===f.value}]),id:"xephang",role:"tabpanel","aria-labelledby":"xephang-tab"},[y.value?(Ma(),Va("div",QSe,"Äang tải dữ liá»u...")):(Ma(),Va("table",$Se,[t[21]||(t[21]=Ha("thead",null,[Ha("tr",null,[Ha("th",{scope:"col"},"STT"),Ha("th",{scope:"col"},"Há» tên"),Ha("th",{scope:"col"},"Email"),Ha("th",{scope:"col"},"Sá» Äiá»n thoại"),Ha("th",{scope:"col"},"Sá» lần"),Ha("th",{scope:"col"},"Hà nh Äá»ng")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(p.value,(e,t)=>(Ma(),Va("tr",{key:t},[Ha("td",null,ee(t+1),1),Ha("td",null,ee(e.hoten),1),Ha("td",null,ee(e.email||"-"),1),Ha("td",null,ee(e.sodienthoai||"-"),1),Ha("td",null,ee(e.soLanDen),1),Ha("td",null,[Ha("button",{class:"btn btn-custom btn-gradient-orange btn-sm",onClick:t=>D(e)}," Xem chi tiết ",8,XSe)])]))),128)),p.value.length?Qa("",!0):(Ma(),Va("tr",JSe,t[20]||(t[20]=[Ha("td",{colspan:"6",class:"text-center"},"Không có dữ liá»u",-1)])))])]))],2),Ha("div",{class:G(["tab-pane fade",{"show active":"hengio"===f.value}]),id:"hengio",role:"tabpanel","aria-labelledby":"hengio-tab"},[y.value?(Ma(),Va("div",ZSe,"Äang tải dữ liá»u...")):(Ma(),Va("table",eIe,[t[23]||(t[23]=Ha("thead",null,[Ha("tr",null,[Ha("th",{scope:"col"},"STT"),Ha("th",{scope:"col"},"Há» tên"),Ha("th",{scope:"col"},"Email"),Ha("th",{scope:"col"},"Sá» Äiá»n thoại"),Ha("th",{scope:"col"},"Sá» lần"),Ha("th",{scope:"col"},"Hà nh Äá»ng")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(g.value,(e,t)=>(Ma(),Va("tr",{key:t},[Ha("td",null,ee(t+1),1),Ha("td",null,ee(e.hoten),1),Ha("td",null,ee(e.email||"-"),1),Ha("td",null,ee(e.sodienthoai||"-"),1),Ha("td",null,ee(e.soLanDen),1),Ha("td",null,[Ha("button",{class:"btn btn-custom btn-gradient-orange btn-sm",onClick:t=>D(e)}," Xem chi tiết ",8,tIe)])]))),128)),g.value.length?Qa("",!0):(Ma(),Va("tr",nIe,t[22]||(t[22]=[Ha("td",{colspan:"6",class:"text-center"},"Không có dữ liá»u",-1)])))])]))],2)])]),m.value?(Ma(),Va("div",{key:0,class:"modal-overlay",onClick:Es(P,["self"])},[Ha("div",iIe,[Ha("div",aIe,[Ha("h5",oIe,"Chi tiết khách hà ng: "+ee(v.value.hoten),1),Ha("button",{class:"btn-close",onClick:P})]),Ha("div",sIe,[Ha("table",rIe,[t[24]||(t[24]=Ha("thead",null,[Ha("tr",null,[Ha("th",null,"Sá» Äiá»n thoại"),Ha("th",null,"Quầy"),Ha("th",null,"Thá»i gian")])],-1)),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(v.value.visits,(e,t)=>(Ma(),Va("tr",{key:t},[Ha("td",null,ee(e.sdt),1),Ha("td",null,ee(e.tenQuay),1),Ha("td",null,ee(e.taoluc),1)]))),128))])])]),Ha("div",{class:"modal-footer"},[Ha("button",{class:"btn btn-gradient-blue",onClick:P},"Äóng")])])])):Qa("",!0)])])}}},[["__scopeId","data-v-b0c60a3f"]]),cIe={class:"ticket-container"},uIe={class:"header"},hIe={class:"text-center"},dIe={class:"ticket-grid"},fIe=["onClick"],pIe={class:"ticket-content"},gIe={class:"text-center subtitle"},mIe=CC({__name:"InVeGiay",setup(e){const t=Vl(),n=Ll(),i=t.params.don_vi,a=JT(),{item:o}=Zs(a),s=wI(),{items:r}=Zs(s),l=y1(),c=It(null),u=It({}),h=gt({hoten:"ÄÄng ký nhanh",sodienthoai:"",quay:"",donvi:i,taoluc:Zp.now(),dangphucvu:!1,daphucvu:null,calamviec:!0,stt:null,vegiay:!0}),d=async e=>{var t,n,a;if(!(null==(t=o.value)?void 0:t.ip_printer))return void VT("Máy in chưa ÄÆ°á»£c cấu hình!");if(!e.trangthai)return void(await wO("Quầy ".concat(e.ten,": Lượt khách chá» tại quầy Äã quá thá»i gian là m viá»c dá»± kiến. Vui lòng quay lại sau. Trân trá»ng!"),"Vui lòng chá»n quầy khác hoặc quay lại sau."));var s;if((await(s="In vé cho Quầy: ".concat(e.ten),bO({title:"Xác nháºn in vé",text:s,confirmButtonText:"In vé"}))).isConfirmed){c.value=await(async e=>{try{return await l.fetchItemByKhachMoiNhat(i,e)}catch(eRe){}})(e.id),h.quay=e.id,h.stt=await Wee(i,e.id);try{await l.addItem({...h}),await(async e=>{var t;try{const n=(null==(t=o.value)?void 0:t.ip_network)||"127.0.0.1";await bI.post("http://".concat(n,":3000/print"),e,{headers:{"Content-Type":"application/json"},timeout:7e4}),_O("In vé thà nh công!")}catch(eRe){VT("In vé thất bại!")}})({queueNumber:h.stt,timestamp:aC(h.taoluc),quay:e.ten,donVi:(null==(n=o.value)?void 0:n.ten)||"ÄÆ¡n vá»",ipPrinter:null==(a=o.value)?void 0:a.ip_printer})}catch(eRe){VT("In vé thất bại!")}finally{f()}}},f=()=>{h.sodienthoai="",h.quay="",h.stt=null};Zn(async()=>{var e;try{if(await Promise.all([a.fetchItemById(i),s.fetchEnableItemsByDonVi(i)]),!(null==(e=o.value)?void 0:e.hienthitranginvegiay))return void n.push("/forbidden");r.value&&r.value.length>
55550&&r.value.forEach(e=>{l.realtimeKhachTrongCaLamViecWithCallback(i,e.id,t=>{const n=t.filter(e=>!e.daphucvu&&!e.dangphucvu).length;u.value[e.id]=n})})}catch(eRe){}});const p=bo(()=>r.value.map(e=>({...e,soKhachCho:u.value[e.id]||0})));return(e,t)=>{var n;return Ma(),Va("div",cIe,[Ha("div",uIe,[Ha("h3",hIe,ee(null==(n=Ot(o))?void 0:n.ten),1),t[0]||(t[0]=Ha("p",{class:"text-center subtitle"},"VUI LÃNG BẤM CHá»N QUẦY Äá» LẤY Sá» THỨ Tá»°",-1))]),Ha("div",dIe,[(Ma(!0),Va(Sa,null,gi(p.value,e=>(Ma(),Va("div",{key:e.id,class:G(["ticket-box",{"disabled-ticket":!e.trangthai}]),onClick:t=>e.trangthai?d(e):null},[Ha("div",pIe,[Ha("h4",null,ee(null==e?void 0:e.ten),1),Ha("p",gIe,ee("(Lượt chá»: ".concat(e.soKhachCho).concat(e.trangthai?"":" - Dừng nháºn khách",")")),1),Ha("p",null,ee(e.mota),1)])],10,fIe))),128))])])}}},[["__scopeId","data-v-f79210ae"]]),vIe={class:"modal-dialog"},yIe={class:"modal-content custom-modal"},bIe={class:"modal-body"},_Ie={class:"counter-list"},wIe=["onClick"],kIe={class:"counter-info"},xIe={class:"counter-header"},TIe={class:"counter-sub-header"},CIe={class:"counter-name"},EIe={class:"counter-radio"},SIe=CC({__name:"PriorityModal",props:{listPriorities:{type:Array,default:()=>[]},modelValue:{type:String,default:null}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const i=e,a=n,o=It(null);let s=null;const r=It(i.modelValue);pa(()=>i.modelValue,e=>{r.value=e}),ei(()=>{s=new wV(o.value)});return t({showModal:()=>{s.show()}}),(t,n)=>(Ma(),Va("div",{class:"modal fade",id:"priorityModal",tabindex:"-1","aria-labelledby":"priorityModalLabel",ref_key:"priorityModalRef",ref:o},[Ha("div",vIe,[Ha("div",yIe,[n[0]||(n[0]=Ha("div",{class:"modal-header custom-header"},[Ha("h5",{class:"modal-title",id:"priorityModalLabel"},"Chá»n trưá»ng hợp ưu tiên"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("div",bIe,[Ha("div",_Ie,[(Ma(!0),Va(Sa,null,gi(e.listPriorities,(e,t)=>(Ma(),Va("div",{key:t,class:G(["counter-item",{selected:r.value===e}]),onClick:t=>(e=>{r.value=e,a("update:modelValue",e),s.hide()})(e)},[Ha("div",kIe,[Ha("div",xIe,[Ha("div",TIe,[Ha("div",CIe,ee(e),1)])])]),Ha("div",EIe,[Ha("span",{class:G(["radio-checkmark",{checked:r.value===e}])},null,2)])],10,wIe))),128))])]),n[1]||(n[1]=Ha("div",{class:"modal-footer custom-footer"},[Ha("button",{type:"button",class:"btn btn-custom btn-gradient-blue","data-bs-dismiss":"modal"},"Äóng")],-1))])])],512))}},[["__scopeId","data-v-5707f347"]]),IIe={class:"d-flex justify-content-center align-items-center my-2 my-md-3"},AIe={class:"table-container"},DIe={class:"header"},PIe={class:"logo-section"},OIe=["src","alt"],MIe={class:"queue-card text-center"},NIe={class:"form-content"},RIe={class:"form-group mb-2 text-start"},LIe={class:"form-group mb-2 text-start"},VIe={class:"form-group mb-2 text-start"},qIe={class:"form-group mb-2 text-start"},FIe={key:0},BIe={key:1,class:"text-muted"},UIe={key:0,class:"form-group mb-2 text-start"},jIe={for:"isPriority",class:"form-check-label custom-checkbox-container"},HIe={key:1,class:"form-group mb-2 text-start"},zIe={key:0},WIe={key:1,class:"text-muted"},KIe=["disabled"],GIe={class:"footer"},YIe={key:0},QIe={class:"modal-dialog"},$Ie={class:"modal-content custom-modal"},XIe={class:"modal-body"},JIe={class:"text-center mb-3"},ZIe={class:"number-display"},eAe={class:"badge"},tAe={class:"table custom-table"},nAe={class:"modal-dialog"},iAe={class:"modal-content custom-modal"},aAe={class:"modal-body"},oAe={class:"counter-list"},sAe=["onClick"],rAe={class:"counter-info"},lAe={class:"counter-header"},cAe={class:"counter-sub-header"},uAe={class:"counter-name"},hAe={class:"counter-waiting"},dAe={class:"counter-desc"},fAe={class:"counter-radio"},pAe=CC({__name:"HoTroLaySo",setup(e){const t=Vl(),n=Ll(),i=t.params.don_vi,a=JT(),{item:o}=Zs(a),s=wI(),{items:r}=Zs(s),l=y1();Zs(l);const c=i8(),{item:u}=Zs(c),h=It(null),d=It(!1),f=It({}),p=It(null),g=It(null);let m=null,v=null;Zn(async()=>{var e;try{await a.realtimeItemById(i),(null==(e=o.value)?void 0:e.hienthitranghotro)||n.replace("/forbidden")}catch(eRe){n.replace("/forbidden")}});const y=gt({hoten:"",sodienthoai:"",email:"",quay:"",donvi:i,taoluc:Ek(),dangphucvu:!1,daphucvu:null,calamviec:!0,stt:null,doi_tuong_uu_tien:null}),b=It({}),_=It({}),w=It(!1),k=It(null),x=()=>{k.value&&k.value.showModal()},T=bo(()=>y.doi_tuong_uu_tien||"");pa(w,e=>{e||(y.doi_tuong_uu_tien=null)}),ei(async()=>{try{await Promise.all([s.realtimeItemsByDonViAndStatus(i,!0),c.fetchData()]),r.value.forEach(e
5555=>{l.realtimeKhachTrongCaLamViecWithCallback(i,e.id,t=>{const n=t.filter(e=>!e.daphucvu&&!e.dangphucvu).length;b.value[e.id]=n;const i=t.find(e=>e.dangphucvu);i&&(_.value[e.id]=i)})}),o.value.logo||(o.value.logo="/images/logodanang.png"),v=new wV(document.getElementById("quayModal"))}catch(eRe){}});const C=bo(()=>r.value.map(e=>({...e,soKhachCho:b.value[e.id]||0}))),E=bo(()=>{const e=r.value.find(e=>e.id===f.value.quay);return e?e.mota||"Quầy ".concat(e.ten):""}),S=async()=>{try{const e=await l.addItem({...y,doi_tuong_uu_tien:w.value?y.doi_tuong_uu_tien:null});e.id?(f.value={...e,quay:y.quay,hoten:y.hoten,email:y.email,sodienthoai:y.sodienthoai,stt:y.stt},m=new wV(document.getElementById("thongTinKhachModal")),m.show(),document.getElementById("thongTinKhachModal").addEventListener("hidden.bs.modal",function(){y.hoten="",y.email="",y.sodienthoai="",y.donvi=i,y.taoluc=Ek(),y.dangphucvu=!1,y.daphucvu=null,y.calamviec=!0,y.quay="",y.stt=null},{once:!0})):VT("Há» trợ lấy sá» thất bại. Vui lòng thá» lại sau!")}catch(eRe){VT("Äã xảy ra lá»i. Vui lòng thá» lại sau!")}},I=()=>{const e=r.value.find(e=>e.id===y.quay);return e?Number(e.sobatdau):1001},A=async()=>{try{return await l.fetchItemByKhachMoiNhat(i,y.quay)}catch(eRe){}},D=bo(()=>{if(!f.value||!f.value.quay)return 0;const e=r.value.find(e=>e.id===f.value.quay);if(!e)return 0;const t=_.value[f.value.quay],n=t?t.stt:e.sobatdau;return f.value.stt<=n?0:f.value.stt-n}),P=bo(()=>{if(!f.value||!f.value.quay)return 0;const e=r.value.find(e=>e.id===f.value.quay);return e?e.thoigianphucvu*D.value:0}),O=bo(()=>{if(!f.value||!f.value.quay)return"....";if(0===D.value)return"....";const e=P.value;return o$(new Date((new Date).getTime()+6e4*e),"HH:mm dd/MM/yyyy")}),M=bo(()=>{if(!y.quay)return"";const e=r.value.find(e=>e.id===y.quay);return e?"".concat(e.ten,": ").concat(e.mota):""}),N=()=>{v.show()};return(e,t)=>{var n,a,s,l,c,m,b,_;return Ma(),Va("div",IIe,[Ha("div",AIe,[Ha("div",DIe,[Ha("div",PIe,[Ha("img",{src:null==(n=Ot(o))?void 0:n.logo,width:"55",height:"55",alt:null==(a=Ot(o))?void 0:a.ten},null,8,OIe),Ha("div",null,[Ha("h3",null,ee(null==(s=Ot(o))?void 0:s.ten),1),t[6]||(t[6]=Ha("p",{class:"heading-2"},"Há» thá»ng xếp hà ng tá»± Äá»ng QRCode",-1))])])]),Ha("div",MIe,[Ha("form",{onSubmit:t[5]||(t[5]=Es(e=>(async()=>{if(!y.hoten)return void VT("Vui lòng nháºp há» tên khách hà ng");if(!y.quay)return void VT("Vui lòng chá»n quầy");if(y.sodienthoai&&!uC(y.sodienthoai))return void VT("Sá» Äiá»n thoại không hợp lá». Vui lòng nháºp 10 sá», bắt Äầu bằng 03, 05, 07, 08 hoặc 09.");const e=r.value.find(e=>e.id===y.quay);if(!e.trangthai)return void(await wO("Quầy ".concat(e.ten,": Lượt khách chá» tại quầy Äã quá thá»i gian là m viá»c dá»± kiến. Vui lòng quay lại sau. Trân trá»ng!"),"Vui lòng chá»n quầy khác hoặc quay lại sau."));const t=pC(e,o.value);if(t)VT("Quầy ".concat(e.ten,": ").concat(t,"!"));else{d.value=!0;try{h.value=await A(),I(),y.stt=await Wee(i,y.quay);const e=dC(y);Object.assign(y,e),await S()}catch(eRe){VT("Há» trợ lấy sá» thất bại. Vui lòng thá» lại sau!")}finally{d.value=!1}}})(),["prevent"]))},[t[18]||(t[18]=Ha("h4",{class:"form-title mb-2 mb-md-4"},"Nháºp thông tin",-1)),Ha("div",NIe,[Ha("div",RIe,[t[7]||(t[7]=Ha("label",{for:"name",class:"form-label"},[Ga("Há» và tên "),Ha("span",{class:"text-danger"},"*")],-1)),gn(Ha("input",{type:"text",id:"name",class:"form-input",required:"","onUpdate:modelValue":t[0]||(t[0]=e=>y.hoten=e),placeholder:"Nháºp há» và tên",maxlength:"100"},null,512),[[ms,y.hoten]])]),Ha("div",LIe,[t[8]||(t[8]=Ha("label",{for:"phone",class:"form-label"},"Sá» Äiá»n thoại",-1)),gn(Ha("input",{type:"tel",id:"phone",class:"form-input","onUpdate:modelValue":t[1]||(t[1]=e=>y.sodienthoai=e),placeholder:"Nháºp sá» Äiá»n thoại Äá» nháºn vé"},null,512),[[ms,y.sodienthoai]])]),Ha("div",VIe,[t[9]||(t[9]=Ha("label",{for:"personal-id",class:"form-label"},"Äá»a chá» Email",-1)),gn(Ha("input",{type:"email",id:"personal-id",class:"form-input","onUpdate:modelValue":t[2]||(t[2]=e=>y.email=e),placeholder:"Nháºp email Äá» nháºn vé",maxlength:"100"},null,512),[[ms,y.email]])]),Ha("div",qIe,[t[11]||(t[11]=Ha("label",{for:"service",class:"form-label"},[Ga("Quầy giao dá»ch "),Ha("span",{class:"text-danger"},"*")],-1)),Ha("div",{class:"form-input form-select-custom",onClick:N},[M.value?(Ma(),Va("span",FIe,ee(M.value),1)):(Ma(),Va("span",BIe,"Vui lòng chá»n quầy giao dá»ch")),t[10]||(t[10]=Ha("i",{class:"fas fa-chevron-down"},null,-1))])]),(null==(l=Ot(o))?void 0:l.doi_tuong_uu_tien_enabled)&&Ot(o
5555).doi_tuong_uu_tien_texts.length>0?(Ma(),Va("div",UIe,[Ha("label",jIe,[gn(Ha("input",{class:"form-check-input",type:"checkbox",id:"isPriority","onUpdate:modelValue":t[3]||(t[3]=e=>w.value=e)},null,512),[[vs,w.value]]),t[12]||(t[12]=Ha("span",{class:"custom-checkbox-indicator"},null,-1)),t[13]||(t[13]=Ga(" Là Äá»i tượng ưu tiên "))])])):Qa("",!0),w.value?(Ma(),Va("div",HIe,[t[15]||(t[15]=Ha("label",{for:"priority-type",class:"form-label"},"Trưá»ng hợp ưu tiên",-1)),Ha("div",{class:"form-input form-select-custom",onClick:x},[T.value?(Ma(),Va("span",zIe,ee(T.value),1)):(Ma(),Va("span",WIe,"Vui lòng chá»n trưá»ng hợp ưu tiên")),t[14]||(t[14]=Ha("i",{class:"fas fa-chevron-down"},null,-1))]),t[16]||(t[16]=Ha("div",{class:"alert alert-info custom-alert text-start mt-2 mb-0",role:"alert"},[Ha("ul",{class:"alert-list"},[Ha("li",null,"Lưu ý: ngưá»i thuá»c Äá»i tượng ưu tiên là ngưá»i Äứng tên trá»±c tiếp tại há» sÆ¡ yêu cầu giải quyết thá»§ tục hà nh chÃnh hoặc uá»· quyá»n ÄÆ°á»£c thá»±c hiá»n thá»§ tục hà nh chÃnh. Có giấy tá» pháp lý theo quy Äá»nh."),Ha("li",null,"Sá» thứ tá»± bá» huá»· khi không Äúng Äá»i tượng phục vụ.")])],-1)),(null==(c=Ot(o))?void 0:c.doi_tuong_uu_tien_enabled)?(Ma(),qa(SIe,{key:0,ref_key:"priorityModalRef",ref:k,listPriorities:null==(m=Ot(o))?void 0:m.doi_tuong_uu_tien_texts,modelValue:y.doi_tuong_uu_tien,"onUpdate:modelValue":t[4]||(t[4]=e=>y.doi_tuong_uu_tien=e)},null,8,["listPriorities","modelValue"])):Qa("",!0)])):Qa("",!0),Ha("button",{type:"submit",class:"form-button",disabled:d.value},ee(d.value?"Äang xá» lý...":"Lấy sá»"),9,KIe),t[17]||(t[17]=Ha("div",{class:"alert alert-warning text-center info-alert",role:"alert"},[Ga(" Äiá»n thông tin cần thiết Äá» lấy vé *"),Ha("br"),Ga("Thông tin ÄÆ°á»£c lưu cho các lần tiếp theo ")],-1))])],32)]),Ha("p",GIe,[Ha("span",null,ee((null==(b=Ot(u))?void 0:b.banquyen)||"Há» thá»ng xếp hà ng tá»± Äá»ng QRCode"),1),(null==(_=Ot(u))?void 0:_.thietke)?(Ma(),Va("span",YIe,ee(Ot(u).thietke),1)):Qa("",!0)])]),Ha("div",{class:"modal fade",id:"thongTinKhachModal",tabindex:"-1","aria-labelledby":"thongTinKhachModalLabel",ref_key:"modalThongTinRef",ref:p},[Ha("div",QIe,[Ha("div",$Ie,[t[29]||(t[29]=Ha("div",{class:"modal-header custom-header"},[Ha("h5",{class:"modal-title",id:"thongTinKhachModalLabel"},"Thông tin ÄÄng ký"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("div",XIe,[t[28]||(t[28]=Ha("div",{class:"alert alert-success text-center px-4",role:"alert"}," ÄÄng ký thà nh công! ",-1)),Ha("div",JIe,[Ha("h3",ZIe,[t[19]||(t[19]=Ga("Sá» thứ tá»±: ")),Ha("span",eAe,ee(f.value.stt),1)])]),Ha("table",tAe,[Ha("tbody",null,[Ha("tr",null,[t[20]||(t[20]=Ha("th",{scope:"row"},"Há» và tên",-1)),Ha("td",null,ee(f.value.hoten),1)]),Ha("tr",null,[t[21]||(t[21]=Ha("th",{scope:"row"},"Äá»i tượng ưu tiên",-1)),Ha("td",null,ee(f.value.doi_tuong_uu_tien||"Không"),1)]),Ha("tr",null,[t[22]||(t[22]=Ha("th",{scope:"row"},"Sá» Äiá»n thoại",-1)),Ha("td",null,ee(f.value.sodienthoai||"-"),1)]),Ha("tr",null,[t[23]||(t[23]=Ha("th",{scope:"row"},"Email",-1)),Ha("td",null,ee(f.value.email||"-"),1)]),Ha("tr",null,[t[24]||(t[24]=Ha("th",{scope:"row"},"Quầy",-1)),Ha("td",null,ee(E.value),1)]),Ha("tr",null,[t[25]||(t[25]=Ha("th",{scope:"row"},"Lượt chá»",-1)),Ha("td",null,[Ha("strong",null,ee(D.value),1)])]),Ha("tr",null,[t[26]||(t[26]=Ha("th",{scope:"row"},"Thá»i gian dá»± kiến",-1)),Ha("td",null,[Ha("strong",null,ee(O.value),1)])]),Ha("tr",null,[t[27]||(t[27]=Ha("th",{scope:"row"},"Còn chá»",-1)),Ha("td",null,[Ha("strong",null,ee(P.value)+" phút",1)])])])])]),t[30]||(t[30]=Ha("div",{class:"modal-footer custom-footer"},[Ha("button",{type:"button",class:"btn btn-custom btn-gradient-blue","data-bs-dismiss":"modal"},"Äóng")],-1))])])],512),Ha("div",{class:"modal fade",id:"quayModal",tabindex:"-1","aria-labelledby":"quayModalLabel",ref_key:"quayModalRef",ref:g},[Ha("div",nAe,[Ha("div",iAe,[t[31]||(t[31]=Ha("div",{class:"modal-header custom-header"},[Ha("h5",{class:"modal-title",id:"quayModalLabel"},"Chá»n quầy giao dá»ch"),Ha("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),Ha("div",aAe,[Ha("div",oAe,[(Ma(!0),Va(Sa,null,gi(C.value,e=>{return Ma(),Va("div",{key:e.id,class:G(["counter-item",{disabled:!e.trangthai,selected:y.quay===e.id}]),onClick:t=>(e=>{if(!e.trangthai)return void VT("Quầy ".concat(e.ten," hiá»n Äang dừng nháºn khách!"));const t=pC(e,o.value);t?VT("Quầy ".concat(e.ten,": ").concat(t,"!")):(y.quay=e.id,v.hide())})(e)},[Ha("div",rAe,[Ha("div",lAe,[Ha("div",cAe,[Ha("div",uAe,"Quầy "+ee(e.ten),1),Ha("div",hAe,ee((t=e,gC(t,o.value,
5555new Date,t.soKhachCho))),1)]),Ha("div",dAe,ee(e.mota),1)])]),Ha("div",fAe,[Ha("span",{class:G(["radio-checkmark",{checked:y.quay===e.id}])},null,2)])],10,sAe);var t}),128))])]),t[32]||(t[32]=Ha("div",{class:"modal-footer custom-footer"},[Ha("button",{type:"button",class:"btn btn-custom btn-gradient-blue","data-bs-dismiss":"modal"},"Äóng")],-1))])])],512)])}}},[["__scopeId","data-v-1ea569b5"]]),gAe={class:"container content-container"},mAe={class:"p-3"},vAe={class:"row"},yAe={class:"col-md-6 col-xl-3 mb-2"},bAe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #6e8efb, #7780e3)",color:"white"}},_Ae={class:"card-body text-center"},wAe={class:"card-text display-6 fw-bold"},kAe={class:"col-md-6 col-xl-3 mb-2"},xAe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #ff9d6e, #ff6b6b)",color:"white"}},TAe={class:"card-body text-center"},CAe={class:"card-text display-6 fw-bold"},EAe={class:"col-md-6 col-xl-3 mb-2"},SAe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #6e8efb, #7780e3)",color:"white"}},IAe={class:"card-body text-center"},AAe={class:"card-text display-6 fw-bold"},DAe={class:"col-md-6 col-xl-3 mb-2"},PAe={class:"card total-stat-card shadow-sm",style:{background:"linear-gradient(135deg, #ff9d6e, #ff6b6b)",color:"white"}},OAe={class:"card-body text-center"},MAe={class:"card-text display-6 fw-bold"},NAe={class:"filter-container"},RAe={class:"card filter-card shadow-sm"},LAe={class:"card-body"},VAe={class:"row"},qAe={class:"col-md-6 mb-3"},FAe=["value"],BAe={class:"col-md-6 mb-3"},UAe={class:"charts-container mt-4"},jAe={class:"card chart-card mb-4"},HAe={class:"card-body"},zAe={class:"section-title text-center"},WAe={key:0,class:"chart-loading-overlay"},KAe={class:"row"},GAe={class:"col-lg-8 col-md-7"},YAe={class:"donut-chart-container position-relative"},QAe={class:"donut-center-text"},$Ae={class:"total-value"},XAe={class:"col-lg-4 col-md-5"},JAe={class:"donut-legend"},ZAe={class:"row g-2"},eDe={class:"legend-item"},tDe={class:"legend-text"},nDe={class:"legend-title"},iDe={class:"legend-value"},aDe={class:"card chart-card"},oDe={class:"card-body"},sDe={class:"section-title text-center"},rDe={class:"total-info mt-2"},lDe={class:"badge bg-primary"},cDe={key:0,class:"chart-loading-overlay"},uDe={class:"table-container mt-4"},hDe={class:"card chart-card"},dDe={class:"card-body"},fDe={class:"section-title text-center"},pDe={class:"table-responsive"},gDe={class:"table table-striped custom-table"},mDe=["onClick"],vDe=CC({__name:"TongQuanDonVi",setup(e){const t=Gee(),n=JT(),i=wI(),{items:a}=Zs(t),{items:o}=Zs(n),{items:s}=Zs(i),r=It(!1),l=It(!1),c=It(null),u=It(null),h=It(null),d=It(null),f=It((new Date).getFullYear()),p=It("all"),g=It({month:null,direction:"asc"}),m=gt([]),v=()=>{m.splice(0,m.length);const e=a.value.filter(e=>e.ngaythongke&&!isNaN(new Date(e.ngaythongke).getTime())).map(e=>{var t,n;const i=(null==(t=o.value.find(t=>t.id===e.donvi))?void 0:t.ten)||"Unknown",a=(null==(n=s.value.find(t=>t.id===e.quay))?void 0:n.ten)||"Unknown";return{...e,tenDonVi:i,tenQuay:a}}).filter(e=>"Unknown"!==e.tenDonVi&&"Unknown"!==e.tenQuay&&"Quầy không xác Äá»nh"!==e.tenQuay);m.push(...e)},y=bo(()=>m.length>0?m.reduce((e,t)=>e+(t.soluongkhach||0),0):0),b=bo(()=>{if(0===m.length)return 0;const e=new Date,t=new Date(e);t.setDate(e.getDate()-e.getDay()),t.setHours(0,0,0,0);const n=new Date(t);return n.setDate(t.getDate()+6),n.setHours(23,59,59,999),m.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n}).reduce((e,t)=>e+(t.soluongkhach||0),0)}),_=bo(()=>{if(0===m.length)return 0;const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(e.getFullYear(),e.getMonth()+1,0);return m.filter(e=>{const i=new Date(e.ngaythongke);return i>=t&&i<=n}).reduce((e,t)=>e+(t.soluongkhach||0),0)}),w=bo(()=>{if(0===m.length)return 0;const e=(new Date).getFullYear();return m.filter(t=>new Date(t.ngaythongke).getFullYear()===e).reduce((e,t)=>e+(t.soluongkhach||0),0)}),k=bo(()=>{if(0===m.length)return{data:{},donutData:[],grandTotal:0};const e={},t={};let n=0;o.value.forEach(n=>{"Unknown"!==n.ten&&(e[n.ten]=Array(12).fill(0),t[n.ten]=0)});m.filter(e=>{const t=new Date(e.ngaythongke).getFullYear()===f.value,n="all"===p.value||e.phanloai===p.value;return t&&n}
5555).forEach(i=>{if(i.tenDonVi&&"Unknown"!==i.tenDonVi){const a=new Date(i.ngaythongke).getMonth(),o=i.soluongkhach||0;e[i.tenDonVi][a]+=o,t[i.tenDonVi]+=o,n+=o}});const i=Object.entries(t).map(([e,t])=>({donVi:e,total:t,percentage:n>0?(t/n*100).toFixed(1):"0"})).sort((e,t)=>t.total-e.total);return{data:e,donutData:i,grandTotal:n}}),x=(e,t=1)=>{const n=["#4CAF50","#2196F3","#FF5722","#9C27B0","#FFC107","#00BCD4","#E91E63","#3F51B5","#FF9800","#009688","#8BC34A","#673AB7","#FF4081","#03A9F4","#FFA000","#00BFA5","#7CB342","#448AFF","#FF6E40","#536DFE"];if(e>=n.length){return"hsla(".concat(137.508*e%360,", 80%, 50%, ").concat(t,")")}const i=n[e];return t<1?"".concat(i).concat(Math.round(255*t).toString(16).padStart(2,"0")):i},T=bo(()=>[...new Set(a.value.map(e=>new Date(e.ngaythongke).getFullYear()))].sort((e,t)=>t-e));bo(()=>{const e=Object.entries(k.value.data).map(([e,t])=>({donVi:e,total:t.reduce((e,t)=>e+t,0)})),t=e.reduce((e,t)=>e+t.total,0);return e.map(e=>({...e,percentage:(e.total/t*100).toFixed(1)})).sort((e,t)=>t.total-e.total)});const C=bo(()=>{const e=[],t=f.value-1;return Object.entries(k.value.data).forEach(([n,i])=>{const a=Array(12).fill(0);m.filter(e=>{var i;return new Date(e.ngaythongke).getFullYear()===t&&(null==(i=o.value.find(t=>t.id===e.donvi))?void 0:i.ten)===n&&("all"===p.value||e.phanloai===p.value)}).forEach(e=>{const t=new Date(e.ngaythongke).getMonth();a[t]+=e.soluongkhach||0}),e.push({donVi:n,months:i,previousMonths:a})}),null!==g.value.month&&e.sort((e,t)=>{const n=e.months[g.value.month-1],i=t.months[g.value.month-1];return"asc"===g.value.direction?n-i:i-n}),e}),E=bo(()=>{switch(p.value){case"xephang":return"Khách xếp hà ng";case"hengio":return"Khách hẹn giá»";default:return"Tất cả khách"}}),S=async()=>{try{if(r.value=!0,l.value=!0,await an(),u.value){d.value&&d.value.destroy();const e=u.value.getContext("2d");e&&(d.value=new lre(e,{type:"doughnut",data:{labels:k.value.donutData.map(e=>e.donVi),datasets:[{data:k.value.donutData.map(e=>e.percentage),backgroundColor:k.value.donutData.map((e,t)=>x(t,.8))}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:e=>{const t=k.value.donutData[e.dataIndex];return"".concat(t.donVi,": ").concat(t.total.toLocaleString()," khách (").concat(t.percentage,"%)")}}}}}}))}if(c.value){h.value&&h.value.destroy();const e=c.value.getContext("2d");if(e){const t=Array.from({length:12},(e,t)=>"Tháng ".concat(t+1)),n=Object.entries(k.value.data).map(([e,t],n)=>({label:e,data:t,backgroundColor:x(n,.8),borderColor:x(n,1),borderWidth:1,barPercentage:.7,categoryPercentage:.8}));h.value=new lre(e,{type:"bar",data:{labels:t,datasets:n},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{stacked:!0,grid:{display:!1}},y:{stacked:!0,beginAtZero:!0,grid:{color:"#e9ecef"}}},layout:{padding:{top:20,bottom:20}},plugins:{legend:{position:"bottom",labels:{boxWidth:12,padding:15,font:{size:window.innerWidth<768?10:11}}},tooltip:{mode:"index",intersect:!1,callbacks:{footer:e=>{const t=e.reduce((e,t)=>e+t.parsed.y,0);return"Tá»ng: ".concat(t.toLocaleString()," khách")}}}}}})}}}catch(eRe){}finally{r.value=!1,l.value=!1}},I=e=>e.reduce((e,t)=>e+t,0),A=(e,t)=>t?e>t?"text-success":e<t?"text-danger":"":"",D=(e,t)=>{if(!t)return 0;return Number(((e-t)/t*100).toFixed(1))};return pa([a,o],()=>{v()},{deep:!0}),pa([f,p],async()=>{try{r.value=!0,l.value=!0,await an(),await Promise.all([S()])}catch(eRe){}finally{r.value=!1,l.value=!1}}),ei(async()=>{try{await Promise.all([t.fetchItems(),n.fetchItems(),i.fetchItems()]),v(),await an(),S()}catch(eRe){}}),ai(()=>{h.value&&h.value.destroy(),d.value&&d.value.destroy()}),(e,t)=>(Ma(),Va("div",gAe,[t[17]||(t[17]=Ha("div",{class:"header"},[Ha("h3",{class:"text-center text-uppercase"},"SO SÃNH THá»NG Kà GIá»®A CÃC ÄÆ N Vá»")],-1)),Ha("div",mAe,[Ha("div",vAe,[Ha("div",yAe,[Ha("div",bAe,[Ha("div",_Ae,[t[2]||(t[2]=Ha("h5",{class:"card-title"},"Tá»ng khách tuần hiá»n tại",-1)),Ha("p",wAe,ee(b.value),1)])])]),Ha("div",kAe,[Ha("div",xAe,[Ha("div",TAe,[t[3]||(t[3]=Ha("h5",{class:"card-title"},"Tá»ng khách tháng hiá»n tại",-1)),Ha("p",CAe,ee(_.value),1)])])]),Ha("div",EAe,[Ha("div",SAe,[Ha("div",IAe,[t[4]||(t[4]=Ha("h5",{class:"card-title"},"Tá»ng khách nÄm hiá»n tại",-1)),Ha("p",AAe,ee(w.value),1)])])]),Ha("div",DAe,[Ha("div",PAe,[Ha("div",OAe,[t[5]||(t[5]=Ha("h5",{class:"card-title"},"Tá»ng sá» khách toà n thá»i gian",-1)),Ha("p",MAe,ee(y.value),1)])])])]),Ha("div",NAe,[Ha("div",RAe,[t[9]||(t[9]=Ha("div",{class:"card-header"},[Ha("h5",{class:"filter-title"},"Bá» lá»c")],-1)),Ha("div",LAe,[Ha("div",VAe,[Ha("div",qAe,[t[6]||(t[6]=Ha("label",{class:"form-label"},"NÄm",-1)),gn(Ha("select",{"onUpdate:modelValue":t[0]||(t[0]=e=>f.value=e),class:"form-control"},[(Ma(!0),Va(Sa,null,gi(T.value,e=>(Ma(),Va("option",{key:e,value:e},ee(e),9,FAe))),128))],512),[[_s,f.value]])]),Ha("div",BAe,[t[8]||(t[8]=Ha("label",{class:"form-label"},"Loại khách",-1)),gn(Ha("select",{"onUpdate:modelValue":t[1]||(t[1]=e=>p.value=e),class:"form-control"},t[7]||(t[7]=[Ha("option",{value:"all"},"Tất cả",-1),Ha("option",{value:"xephang"},"Xếp hà ng",-1),Ha("option",{value:"hengio"},"Hẹn giá»",-1)]),512),[[_s,p.value]])])])])])]),Ha("div",UAe,[Ha("div",jAe,[Ha("div",HAe,[Ha("h4",zAe,"Tá»· lá» phân bá» "+ee(E.value.toLowerCase()),1),r.value?(Ma(),Va("div",WAe,t[10]||(t[10]=[Ha("div",{class:"spinner-border text-primary",role:"status"},[Ha("span",{class:"visually-hidden"},"Äang tải...")],-1),Ha("div",{class:"mt-2"},"Äang tải dữ liá»u...",-1)]))):Qa("",!0),Ha("div",KAe,[Ha("div",GAe,[Ha("div",YAe,[Ha("canvas",{ref_key:"donutChart",ref:u},null,512),Ha("div",QAe,[t[11]||(t[11]=Ha("div",{class:"total-label"},"Tá»ng sá»",-1)),Ha("div",$Ae,ee(k.value.grandTotal.toLocaleStr
5555ing()),1)])])]),Ha("div",XAe,[Ha("div",JAe,[Ha("div",ZAe,[(Ma(!0),Va(Sa,null,gi(k.value.donutData,(e,t)=>(Ma(),Va("div",{key:e.donVi,class:"col-6"},[Ha("div",eDe,[Ha("div",{class:"legend-color",style:j({backgroundColor:x(t,.8)})},null,4),Ha("div",tDe,[Ha("div",nDe,ee(e.donVi),1),Ha("div",iDe,ee(e.total.toLocaleString())+" ("+ee(e.percentage)+"%)",1)])])]))),128))])])])])])]),Ha("div",aDe,[Ha("div",oDe,[Ha("h4",sDe,[Ga(" Thá»ng kê sá» lượng "+ee(E.value.toLowerCase())+" theo tháng nÄm "+ee(f.value)+" ",1),Ha("div",rDe,[Ha("span",lDe,"Tá»ng sá»: "+ee(k.value.grandTotal.toLocaleString())+" khách",1)])]),l.value?(Ma(),Va("div",cDe,t[12]||(t[12]=[Ha("div",{class:"spinner-border text-primary",role:"status"},[Ha("span",{class:"visually-hidden"},"Äang tải...")],-1),Ha("div",{class:"mt-2"},"Äang tải dữ liá»u...",-1)]))):Qa("",!0),Ha("canvas",{ref_key:"barChart",ref:c},null,512)])])]),Ha("div",uDe,[Ha("div",hDe,[Ha("div",dDe,[Ha("h4",fDe,"Bảng so sánh chi tiết "+ee(E.value.toLowerCase()),1),Ha("div",pDe,[Ha("table",gDe,[Ha("thead",null,[Ha("tr",null,[t[13]||(t[13]=Ha("th",null,"#",-1)),t[14]||(t[14]=Ha("th",null,"ÄÆ¡n vá»",-1)),(Ma(),Va(Sa,null,gi(12,e=>Ha("th",{key:e},[Ga(" Tháng "+ee(e)+" ",1),Ha("i",{class:"fas fa-sort ms-1",style:{cursor:"pointer"},onClick:t=>(e=>{g.value.month===e?g.value.direction="asc"===g.value.direction?"desc":"asc":g.value={month:e,direction:"asc"}})(e)},null,8,mDe)])),64)),t[15]||(t[15]=Ha("th",null,"Tá»ng",-1)),t[16]||(t[16]=Ha("th",null,"Tá»· lá»",-1))])]),Ha("tbody",null,[(Ma(!0),Va(Sa,null,gi(C.value,(e,t)=>{return Ma(),Va("tr",{key:e.donVi},[Ha("td",null,ee(t+1),1),Ha("td",null,ee(e.donVi),1),(Ma(!0),Va(Sa,null,gi(e.months,(t,n)=>{return Ma(),Va("td",{key:n,class:G((i=t,a=n>0?e.months[n-1]:null,a?i>a?"bg-success-subtle":i<a?"bg-danger-subtle":"":""))},[Ga(ee(t.toLocaleString())+" ",1),n>0&&0!==Number(D(t,e.months[n-1]))?(Ma(),Va("div",{key:0,class:G(["percentage-change",A(t,e.months[n-1])])}," ("+ee(D(t,e.months[n-1]))+"%) ",3)):Qa("",!0)],2);var i,a}),128)),Ha("td",null,[Ha("strong",null,ee(I(e.months).toLocaleString()),1)]),Ha("td",null,ee((n=e.months,(I(n)/C.value.reduce((e,t)=>e+I(t.months),0)*100).toFixed(1)))+"%",1)]);var n}),128))])])])])])])])]))}},[["__scopeId","data-v-47179354"]]),yDe={class:"container content-container"},bDe={class:"px-3"},_De={class:"form-section"},wDe={class:"row"},kDe={class:"col-12 col-md-4 mb-2"},xDe={class:"form-group"},TDe={class:"col-12 col-md-4 mb-2"},CDe={class:"form-group"},EDe={class:"col-12 col-md-4 mb-2"},SDe={class:"form-group"},IDe={class:"form-section"},ADe={class:"row"},DDe={class:"col-12 col-md-6 mb-2"},PDe={class:"form-group"},ODe={class:"col-12 col-md-6 mb-2"},MDe={class:"form-group"},NDe={class:"col-12 col-md-6 mb-2"},RDe={class:"form-group"},LDe={class:"col-12 col-md-6 mb-2"},VDe={class:"form-group"},qDe={class:"d-flex align-items-start gap-4"},FDe=["disabled"],BDe={key:0,class:"mt-2"},UDe={key:0},jDe=["src"],HDe={class:"col-12 col-md-6 mb-4"},zDe={class:"form-group"},WDe={key:0,class:"mt-3 video-container"},KDe=["src"],GDe={class:"d-flex justify-content-end my-4"},YDe=["disabled"],QDe={key:0,class:"spinner-border spinner-border-sm",role:"status","aria-hidden":"true"},$De={key:1},XDe=CC({__name:"CapNhatThongTinDonVi",setup(e){const t=JT(),{items:n}=Zs(t),i=Ll(),a=oG(),{files:o,open:s}=IB(),r=It(!1),l=i.currentRoute.value.params.don_vi,c=gt({ten:"",diachi:"",sodienthoai:"",videolink:"",logo:"",hotline:"",email:"",website:""}),u=bo(()=>{var e,t;if(!c.videolink)return"";if(c.videolink.includes("youtube.com")||c.videolink.includes("youtu.be")){const n=c.videolink.includes("youtube.com")?null==(e=c.videolink.split("v=")[1])?void 0:e.split("&")[0]:null==(t=c.videolink.split("youtu.be/")[1])?void 0:t.split("?")[0];if(n)return"https://www.youtube.com/embed/".concat(n)}return c.videolink}),h=async()=>{var e,n;const i=(null==(e=null==o?void 0:o.value)?void 0:e.length)?o.value[0]:null;if(!i||KT.includes(i.type)){r.value=!0;try{const e=(null==(n=null==o?void 0:o.value)?void 0:n.length)?o.value[0]:null;if(e){const t=tC(10),n="logo/".concat(t),i=oj(a,n),{url:o,upload:s}=lG(i);let r;await s(e);let l=!1;await new Promise(e=>{r=fa(()=>{o.value&&(c.logo=o.value,!l&&r&&(r(),l=!0),e())})})}await t.updateItem(l,c),LT("Cáºp nháºp ÄÆ¡n vá» thà nh công!")}catch(eRe){VT("Cáºp nháºp ÄÆ¡n vá» thất bại!")}finally{r.value=!1}}else VT(GT)};return Zn(async()=>
5555{if(l){await t.fetchItems();const e=n.value.find(e=>e.id===l);if(!e)return void i.push("/forbidden");Object.assign(c,{ten:e.ten,diachi:e.diachi,sodienthoai:e.sodienthoai,videolink:e.videolink,logo:e.logo,hotline:e.hotline,email:e.email,website:e.website})}}),(e,t)=>{var n,i;return Ma(),Va("div",yDe,[t[19]||(t[19]=Ha("div",{class:"header-and-actions d-flex align-items-center mb-3 px-3 py-2"},[Ha("div",{class:"header-title-wrapper flex-grow-1 text-center"},[Ha("h3",null,"CẬP NHẬT THÃNG TIN ÄÆ N Vá»")])],-1)),Ha("div",bDe,[Ha("div",_De,[t[11]||(t[11]=Ha("h5",{class:"section-title"},"Thông tin chung",-1)),Ha("div",wDe,[Ha("div",kDe,[Ha("div",xDe,[t[8]||(t[8]=Ha("label",{for:"unit-name",class:"form-label"},"Tên ÄÆ¡n vá»",-1)),gn(Ha("input",{type:"text",class:"form-control",placeholder:"Nháºp tên ÄÆ¡n vá»","onUpdate:modelValue":t[0]||(t[0]=e=>c.ten=e),required:""},null,512),[[ms,c.ten]])])]),Ha("div",TDe,[Ha("div",CDe,[t[9]||(t[9]=Ha("label",{for:"address",class:"form-label"},"Äá»a chá»",-1)),gn(Ha("input",{type:"text",class:"form-control",placeholder:"Nháºp Äá»a chá»","onUpdate:modelValue":t[1]||(t[1]=e=>c.diachi=e),required:""},null,512),[[ms,c.diachi]])])]),Ha("div",EDe,[Ha("div",SDe,[t[10]||(t[10]=Ha("label",{for:"phone-number",class:"form-label"},"Sá» Äiá»n thoại",-1)),gn(Ha("input",{type:"text",id:"phone-number",class:"form-control",placeholder:"Nháºp sá» Äiá»n thoại","onUpdate:modelValue":t[2]||(t[2]=e=>c.sodienthoai=e),required:""},null,512),[[ms,c.sodienthoai]])])])])]),Ha("div",IDe,[t[18]||(t[18]=Ha("h5",{class:"section-title"},"Thông tin liên há»",-1)),Ha("div",ADe,[Ha("div",DDe,[Ha("div",PDe,[t[12]||(t[12]=Ha("label",{for:"hotline",class:"form-label"},"Hotline",-1)),gn(Ha("input",{id:"hotline",type:"text",class:"form-control",placeholder:"Nháºp sá» hotline","onUpdate:modelValue":t[3]||(t[3]=e=>c.hotline=e)},null,512),[[ms,c.hotline]])])]),Ha("div",ODe,[Ha("div",MDe,[t[13]||(t[13]=Ha("label",{for:"email-org",class:"form-label"},"Äá»a chá» Email",-1)),gn(Ha("input",{id:"email-org",type:"text",class:"form-control",placeholder:"Nháºp Äá»a chá» email ÄÆ¡n vá»","onUpdate:modelValue":t[4]||(t[4]=e=>c.email=e)},null,512),[[ms,c.email]])])]),Ha("div",NDe,[Ha("div",RDe,[t[14]||(t[14]=Ha("label",{for:"website",class:"form-label"},"Website",-1)),gn(Ha("input",{id:"website",type:"text",class:"form-control",placeholder:"Nháºp Äá»a chá» website","onUpdate:modelValue":t[5]||(t[5]=e=>c.website=e)},null,512),[[ms,c.website]])])]),Ha("div",LDe,[Ha("div",VDe,[t[16]||(t[16]=Ha("label",{for:"logo",class:"form-label"},"Logo",-1)),Ha("div",qDe,[Ha("fieldset",{disabled:!!e.uploadTask},[Ha("button",{type:"button",class:"btn btn-custom btn-gradient-blue",onClick:t[6]||(t[6]=e=>Ot(s)({accept:Ot(KT).join(","),multiple:!1}))},t[15]||(t[15]=[Ha("i",{class:"fa fa-upload me-2"},null,-1),Ga(" Chá»n ảnh ")])),1===(null==(n=Ot(o))?void 0:n.length)?(Ma(),Va("div",BDe," File Äã chá»n: "+ee(null==(i=Ot(o)[0])?void 0:i.name),1)):Qa("",!0)],8,FDe),c.logo?(Ma(),Va("div",UDe,[Ha("img",{src:c.logo,alt:"Logo Preview",class:"img-thumbnail",width:"120",height:"120"},null,8,jDe)])):Qa("",!0)])])]),Ha("div",HDe,[Ha("div",zDe,[t[17]||(t[17]=Ha("label",{for:"video",class:"form-label"},"Video tuyên truyá»n",-1)),gn(Ha("input",{id:"video",type:"text",class:"form-control",placeholder:"Nháºp liên kết video","onUpdate:modelValue":t[7]||(t[7]=e=>c.videolink=e)},null,512),[[ms,c.videolink]]),c.videolink?(Ma(),Va("div",WDe,[Ha("iframe",{src:u.value,frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:"",class:"video-iframe"},null,8,KDe)])):Qa("",!0)])])])]),Ha("div",GDe,[Ha("button",{type:"button",class:"btn btn-custom btn-gradient-orange",onClick:h,disabled:r.value},[r.value?(Ma(),Va("span",QDe)):(Ma(),Va("span",$De,"Cáºp nháºt"))],8,YDe)])])])}}},[["__scopeId","data-v-6b9c0ef9"]]),JDe="da_tai_lai_vi_chunk_cu",ZDe=()=>{try{return sessionStorage.getItem(JDe)}catch(e){return null}},ePe=e=>{try{null===e?sessionStorage.removeItem(JDe):sessionStorage.setItem(JDe,e)}catch(t){}},tPe=e=>()=>e().catch(e=>{if(ZDe())throw e;return ePe("1"),window.location.reload(),new Promise(()=>{})}),nPe=[{path:"/",name:"Trang chá»§",component:OC,meta:{authRequired:!0,role:["admin","operator","organization"]}},{path:"/dang-nhap",name:"Trang ÄÄng nháºp",component:yB},{path:"/quan-ly-tai-khoan",name:"Quản lý tà i khoản",component:rB,meta:{authRequired:!0,role:["admin"]}},{path:"/quan-ly-don-vi",name:"Quản lý ÄÆ¡n vá»",component:n8,meta:{authRequired:!0,role:["admin","operator"]}}
5555,{path:"/bao-cao-thong-ke",name:"Báo cáo thá»ng kê",component:Bwe,meta:{authRequired:!0,role:["admin"]}},{path:"/thong-ke-chung",name:"Báo cáo thá»ng kê chung",component:dxe,meta:{authRequired:!0,role:["admin"]}},{path:"/tong-quan-don-vi",name:"Tá»ng quan ÄÆ¡n vá»",component:vDe,meta:{authRequired:!0,role:["admin"]}},{path:"/thong-ke-chi-tiet-khach",name:"Báo cáo thá»ng kê chi tiết khách",component:mTe,meta:{authRequired:!0,role:["admin"]}},{path:"/thong-ke-top-khach",name:"Báo cáo thá»ng kê top khách",component:mSe,meta:{authRequired:!0,role:["admin"]}},{path:"/cau-hinh-he-thong",name:"Cấu hình há» thá»ng",component:k8,meta:{authRequired:!0,role:["admin"]}},{path:"/nhat-ky-he-thong",name:"Nháºt ký há» thá»ng",component:tPe(()=>tr(()=>import("./NhatKyHeThong-BFi31NjN.js"),__vite__mapDeps([0,1]))),meta:{authRequired:!0,role:["admin"]}},{path:"/:don_vi/quan-tri-don-vi",name:"Trang quản trá» ÄÆ¡n vá»",component:I8,meta:{authRequired:!0,role:["admin","operator","organization","department","supporter"]}},{path:"/:don_vi/cap-nhat-thong-tin",name:"Cáºp nháºt thông tin",component:XDe,meta:{authRequired:!0,role:["admin","organization"]}},{path:"/:don_vi/quan-ly-quay",name:"Quản lý quầy",component:Hee,meta:{authRequired:!0,role:["admin","organization"]}},{path:"/:don_vi/bao-cao-thong-ke",name:"Báo cáo thá»ng kê theo ÄÆ¡n vá»",component:Kwe,meta:{authRequired:!0,role:["admin","organization"]}},{path:"/:don_vi/thong-ke-chung",name:"Báo cáo thá»ng kê chung theo ÄÆ¡n vá»",component:mCe,meta:{authRequired:!0,role:["admin","organization"]}},{path:"/:don_vi/thong-ke-chi-tiet-khach",name:"Báo cáo thá»ng kê chi tiết khách ÄÆ¡n vá»",component:kEe,meta:{authRequired:!0,role:["admin","organization"]}},{path:"/:don_vi/thong-ke-top-khach",name:"Báo cáo thá»ng kê top khách ÄÆ¡n vá»",component:lIe,meta:{authRequired:!0,role:["admin","organization"]}},{path:"/:don_vi/hien-thi-qrcode",name:"Hiá»n thá» QRCODE",component:$ue,meta:{authRequired:!0,role:["admin","organization","operator","department"]}},{path:"/:don_vi/in-ve-giay",name:"In vé giấy",component:mIe,meta:{authRequired:!0,role:["admin","organization","operator","department"]}},{path:"/:don_vi/ho-tro-lay-so",name:"Há» trợ lấy sá»",component:pAe,meta:{authRequired:!0,role:["admin","operator","organization","supporter"]}},{path:"/:don_vi/nhap-thong-tin/:token",name:"Nháºp thông tin",component:Nde,beforeEnter:async(e,t,n)=>{const i=Kee(),a=JT(),o=e.params.don_vi,s=e.params.token;try{a.item||await a.fetchItemById(o);const e=a.item;if(s!=(null==e?void 0:e.qrcodecodinh)){const e=await i.fetchItemById(s);!e||e.daquet||e.donvi!==o?n({path:"/".concat(o,"/ma-het-han")}):n()}else s!=e.qrcodecodinh||e.quetqrtinh?n():n("/forbidden")}catch(eRe){n({path:"/".concat(o,"/ma-het-han")})}}},{path:"/:don_vi/hen-gio-giao-dich/:token",name:"Hẹn giá» giao dá»ch",component:Lfe},{path:"/:don_vi/ve-dien-tu/:khach_hang",name:"Vé Äiá»n tá»",component:zge},{path:"/:don_vi/bang-dien-tu",name:"Bảng Äiá»n tá»",component:tPe(()=>tr(()=>import("./BangDienTu-CGc4FFZF.js"),__vite__mapDeps([2,3])))},{path:"/:don_vi/ve-hen-gio/:khach_hang",name:"Vé hẹn giá»",component:_me},{path:"/:don_vi/doi-gio-hen/:khach_hang",name:"Äá»i giá» hẹn",component:Lfe},{path:"/:don_vi/goi-so/:quay",name:"Gá»i sá»",component:fbe,meta:{authRequired:!0,role:["admin","organization","department"]}},{path:"/:don_vi/man-hinh",name:"Mà n hình trung tâm",component:J_e,meta:{authRequired:!0,role:["admin","organization","operator"]}},{path:"/:don_vi/cai-dat-don-vi",name:"Cà i Äặt ÄÆ¡n vá»",component:Rwe,meta:{authRequired:!0,role:["admin","organization","operator"]}},{path:"/:don_vi/ma-het-han",name:"Mã hết hạn",component:zfe},{path:"/:pathMatch(.*)*",name:"Not found",component:ewe},{path:"/forbidden",name:"Forbidden",component:Vwe},{path:"/not-work",name:"DepartNotWork",component:Qwe}],iPe=function(e){const t=ul(e.routes,e),n=e.parseQuery||yl,i=e.stringifyQuery||bl,a=e.history,o=El(),s=El(),r=El(),l=At(Nr);let c=Nr;nr&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=or.bind(null,e=>""+e),h=or.bind(null,Cr),d=or.bind(null,Er);function f(e,o){if(o=ar({},o||l.value),"string"==typeof e){const i=Ir(n,e,o.path),s=t.resolve({path:i.path},o),r=a.createHref(i.fullPath);return ar(i,s,{params:d(s.params),hash:Er(i.hash),redirectedFrom:void 0,href:r})}let s;if(null!=e.path)s=ar({},e,{path:Ir(n,e.path,o.path).path});else{const t=ar({},e.params);for(const e in t)null==t[e]&&delete t[e];s=ar({},e,{params:h(t)}),o.params=h(o.params)}const r=t.resolve(s,o),c=e.hash||"";r.params=u(d(r.params));const f=function(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(i,ar({},e,{hash:(p=c,kr(p).replace(yr,"{").replace(_r,"}").replace(mr,"^")),path:r.path}));var p;const g=a.createHref(f);return ar({fullPath:f,hash:c,query:i===bl?_l(e.query):e.query||{}},r,{redirectedFrom:void 0,href:g})}function p(e){return"string"==typeof e?Ir(n,e,l.value.path):ar({},e)}function g(e,t){if(c!==e)return Zr(8,{from:t,to:e})}function m(e){return y(e)}function v(e){const t=e.matched[e.matched.length-1];if(t&&t.redirect){const{redirect:n}=t;let i="function"==typeof n?n(e):n;return"string"==typeof i&&(i=i.includes("?")||i.includes("#")?i=p(i):{path:i},i.params={}),ar({query:e.query,hash:e.hash,params:null!=i.path?{}:e.params},i)}}function y(e,t){const n=c=f(e),a=l.value,o=e.state,s=e.force,r=!0===e.replace,u=v(n);if(u)return y(ar(p(u),{state:"object"==typeof u?ar({},o,u.state):o,force:s,replace:r}),t||n);const h=n;let d;return h.redirectedFrom=t,!s&&function(e,t,n){const i=t.matched.length-1,a=n.matched.length-1;return i>-1&&i===a&&Dr(t.matched[i],n.matched[a])&&Pr(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}(i,a,n)&&(d=Zr(16,{to:h,from:a}),P(a,a,!0,!1)),(d?Promise.resolve(d):w(h,a)).catch(e=>el(e)?el(e,2)?e:D(e):A(e,h,a)).then(e=>{if(e){if(el(e,2))return y(ar({replace:r},p(e.to),{state:"object"==typeof e.to?ar({},o,e.to.state):o,force:s}),t||h)}else e=x(h,a,!0,r,o);return k(h,a,e),e})}function b(e,t){const n=g(e,t);return n?Promise.reject(n):Promise.resolve()}function _(e){const t=N.values().next().value;return t&&"function"==typeof t.runWithContext?t.runWithContext(e):e()}function w(e,t){let n;const[i,a,r]=function(e,t){const n=[],i=[],a=[],o=Math.max(t.matched.length,e.matched.length);for(let s=0;s<o;s++){const o=t.matched[s];o&&(e.matched.find(e=>Dr(e,o))?i.push(o):n.push(o));const r=e.matched[s];r&&(t.matched.find(e=>Dr(e,r))||a.push(r))}return[n,i,a]}(e,t);n=Il(i.reverse(),"beforeRouteLeave",e,t);for(const o of i)o.leaveGuards.forEach(i=>
vendor: 1,031 bytes, line 5555
5555{n.push(Sl(i,e,t))});const l=b.bind(null,e,t);return n.push(l),L(n).then(()=>{n=[];for(const i of o.list())n.push(Sl(i,e,t));return n.push(l),L(n)}).then(()=>{n=Il(a,"beforeRouteUpdate",e,t);for(const i of a)i.updateGuards.forEach(i=>{n.push(Sl(i,e,t))});return n.push(l),L(n)}).then(()=>{n=[];for(const i of r)if(i.beforeEnter)if(rr(i.beforeEnter))for(const a of i.beforeEnter)n.push(Sl(a,e,t));else n.push(Sl(i.beforeEnter,e,t));return n.push(l),L(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=Il(r,"beforeRouteEnter",e,t,_),n.push(l),L(n))).then(()=>{n=[];for(const i of s.list())n.push(Sl(i,e,t));return n.push(l),L(n)}).catch(e=>el(e,8)?e:Promise.reject(e))}function k(e,t,n){r.list().forEach(i=>_(()=>i(e,t,n)))}function x(e,t,n,i,o){const s=g(e,t);if(s)return s;const r=t===Nr,c=nr?history.state:{};n&&(i||r?a.replace(e.fullPath,ar({scroll:r&&c&&c.scroll},o)):a.push(e.fullPath,o)),l.value=e,P(e,t,n,r),D()}let T;function C(){T||(T=a.listen((e,t,n)=>{if(!R.listening)return;const i=f(e),o=v(i);if(o)return void
5555y(ar(o,{replace:!0}),i).catch(sr);c=i;const s=l.value;var r,u;nr&&(r=zr(s.fullPath,n.delta),u=jr(),Wr.set(r,u)),w(i,s).catch(e=>el(e,12)?e:el(e,2)?(y(e.to,i).then(e=>{el(e,20)&&!n.delta&&n.type===Rr.pop&&a.go(-1,!1)}).catch(sr),Promise.reject()):(n.delta&&a.go(-n.delta,!1),A(e,i,s))).then(e=>{(e=e||x(i,s,!1))&&(n.delta&&!el(e,8)?a.go(-n.delta,!1):n.type===Rr.pop&&el(e,20)&&a.go(-1,!1)),k(i,s,e)}).catch(sr)}))}let E,S=El(),I=El();function A(e,t,n){D(e);const i=I.list();return i.length&&i.forEach(i=>i(e,t,n)),Promise.reject(e)}function D(e){return E||(E=!e,C(),S.list().forEach(([t,n])=>e?n(e):t()),S.reset()),e}function P(t,n,i,a){const{scrollBehavior:o}=e;if(!nr||!o)return Promise.resolve();const s=!i&&function(e){const t=Wr.get(e);return Wr.delete(e),t}(zr(t.fullPath,0))||(a||!i)&&history.state&&history.state.scroll||null;return an().then(()=>o(t,n,s)).then(e=>e&&Hr(e)).catch(e=>A(e,t,n))}const O=e=>a.go(e);let M;const N=new Set,R={currentRoute:l,listening:!0,addRoute:function(e,n){let i,a;return Qr(e)?(i=t.getRecordMatcher(e),a=n):a=e,t.addRoute(a,i)},removeRoute:function(e){const n=t.getRecordMatcher(e);n&&t.removeRoute(n)},clearRoutes:t.clearRoutes,hasRoute:function(e){return!!t.getRecordMatcher(e)},getRoutes:function(){return t.getRoutes().map(e=>e.record)},resolve:f,options:e,push:m,replace:function(e){return m(ar(p(e),{replace:!0}))},go:O,back:()=>O(-1),forward:()=>O(1),beforeEach:o.add,beforeResolve:s.add,afterEach:r.add,onError:I.add,isReady:function(){return E&&l.value!==Nr?Promise.resolve():new Promise((e,t)=>{S.add([e,t])})},install(e){e.component("RouterLink",Dl),e.component("RouterView",Rl),e.config.globalProperties.$router=this,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>Ot(l)}),nr&&!M&&l.value===Nr&&(M=!0,m(a.location).catch(e=>{}));const t={};for(const i in Nr)Object.defineProperty(t,i,{get:()=>l.value[i],enumerable:!0});e.provide(xl,this),e.provide(Tl,mt(t)),e.provide(Cl,l);const n=e.unmount;N.add(e),e.unmount=function(){N.delete(e),N.size<1&&(c=Nr,T&&T(),T=null,l.value=Nr,M=!1,E=!1),n()}}};function L(e){return e.reduce((e,t)=>e.then(()=>_(t)),Promise.resolve())}return R}({history:function(e){const t=Yr(e=Fr(e)),n=function(e,t,n,i){let a=[],o=[],s=null;const r=({state:o})=>{const r=Kr(e,location),l=n.value,c=t.value;let u=0;if(o){if(n.value=r,t.value=o,s&&s===l)return void(s=null);u=c?o.position-c.position:0}else i(r);a.forEach(e=>{e(n.value,l,{delta:u,type:Rr.pop,direction:u?u>0?Vr.forward:Vr.back:Vr.unknown})})};function l(){const{history:e}=window;e.state&&e.replaceState(ar({},e.state,{scroll:jr()}),"")}return window.addEventListener("popstate",r),window.addEventListener("beforeunload",l,{passive:!0}),{pauseListeners:function(){s=n.value},listen:function(e){a.push(e);const t=()=>{const t=a.indexOf(e);t>-1&&a.splice(t,1)};return o.push(t),t},destroy:function(){for(const e of o)e();o=[],window.removeEventListener("popstate",r),window.removeEventListener("beforeunload",l)}}}(e,t.state,t.location,t.replace),i=ar({location:"",base:e,go:function(e,t=!0){t||n.pauseListeners(),history.go(e)},createHref:Ur.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}(),routes:nPe});iPe.beforeEach(async(e,t,n)=>{var i;if(!e.matched.some(e=>e.meta.authRequired))return n();const a=await new Promise(e=>{const t=dp().onAuthStateChanged(n=>{t(),e(n)})});if(!a)return n("/dang-nhap");const o=ET(),s=JT(),r=wI();await Promise.all([o.getUserAuthRole()]);const l=o.userRole,c=(null==(i=null==e?void 0:e.meta)?void 0:i.role)||null,u=(null==e?void 0:e.params)||null;if(c&&(!l||!c.includes(l.role)))return n("/forbidden");if(null==u?void 0:u.don_vi){await Promise.all([s.fetchItemById(null==u?void 0:u.don_vi),r.fetchItemsByDonViAndManger(null==u?void 0:u.don_vi,a.email)]);const t=s.item;let i=r.items;if("Quản lý quầy"===e.name&&!1===(null==t?void 0:t.quanlyquay))return n("/forbidden");switch(l.role){case UT:case HT:case jT:if(t&&!t.quanly.includes(a.email))return n("/forbidden");break;case zT:if((null==u?void 0:u.quay)&&i.length&&(i=i.filter(e=>e.id==(null==u?void 0:u.quay))),!i.length)return n("/forbidden")}}return n()}),iPe.afterEach(()=>{ZDe()&&ePe(null)});const aPe={class:"navbar navbar-dark fixed-top"},oPe={class:"container-fluid d-flex align-items-center justify-content-between px-0"},sPe=["src"],rPe={class:"d-flex align-items-center ms-auto user-section"},lPe={key:0,class:"text-white me-3 d-none d-lg-flex flex-column flex-xl-row align-items-center user-info"},cPe={class:"my-0 mx-2"},uPe={class:"badge bg-danger d-flex align-items-center"},hPe=CC({__name:"TheHeader",props:["cauHinh"],setup(e){const t=Ll(),n=Vl(),i=JT(),{item:a}=Zs(i),o=ET(),{userAuth:s}=Zs(o),{userRole:r}=Zs(o),l=e,c=It(""),u=It(""),h=bo(()=>n.params.don_vi||null);pa(()=>{var e,t;
5555return[h.value,null==(e=a.value)?void 0:e.logo,null==(t=l.cauHinh)?void 0:t.logo]},([e,t,n])=>{c.value=e&&t?t:n||"/images/logodanang.png"},{immediate:!0}),pa(()=>{var e;return[null==(e=l.cauHinh)?void 0:e.tenhethong]},([e])=>{u.value=e||"Há» thá»ng xếp hà ng tá»± Äá»ng QR CODE"},{immediate:!0}),ei(async()=>{try{h.value&&await i.fetchItemById(h.value),await Promise.all([o.getAuthUser(),o.getUserAuthRole()])}catch(eRe){}});const d=()=>{"Cà i Äặt ÄÆ¡n vá»"!=t.currentRoute.value.name?t.back():t.push("/".concat(t.currentRoute.value.params.don_vi,"/quan-tri-don-vi"))},f=()=>{t.push("/")},p=async()=>{var e;(e=rT,Rc(e).signOut()).then(()=>{t.push("/dang-nhap")}).catch(e=>{VT("Lá»i xảy ra!")})};return(e,t)=>{var n,i;return Ma(),Va("nav",aPe,[Ha("div",oPe,[Ha("a",{class:"btn btn-custom btn-gradient-light me-3",onClick:d},t[0]||(t[0]=[Ha("i",{class:"fas fa-arrow-left me-2 d-md-none"},null,-1),Ha("span",{class:"d-none d-md-inline"},"Quay lại",-1)])),Ha("a",{class:"navbar-brand d-flex align-items-center navbar-brand-center",onClick:f},[Ha("img",{src:c.value,alt:"Logo",width:"40",height:"40",class:"d-inline-block align-top me-2 d-none d-md-inline rounded-circle shadow-sm"},null,8,sPe),Ha("h3",null,ee(u.value),1)]),Ha("div",rPe,[Ot(s)?(Ma(),Va("div",lPe,[Ha("span",cPe,ee(null==(n=Ot(s))?void 0:n.email),1),Ha("span",uPe,ee(Ot(nC)(null==(i=Ot(r))?void 0:i.role)),1)])):Qa("",!0),Ha("button",{class:"btn btn-custom btn-gradient-light",onClick:p},t[1]||(t[1]=[Ha("i",{class:"fas fa-sign-out-alt me-2 d-md-none"},null,-1),Ha("span",{class:"d-none d-md-inline"},"ÄÄng xuất",-1)]))])])])}}},[["__scopeId","data-v-b2cb2c56"]]),dPe={class:"navbar navbar-dark fixed-top"},fPe={class:"container-fluid d-flex justify-content-center"},pPe=["src"],gPe={__name:"TheHeader2",props:["cauHinh"],setup(e){Ll();const t=Vl(),n=JT(),{item:i}=Zs(n),a=e,o=bo(()=>t.params.don_vi||null),s=It(""),r=It("");return pa(()=>{var e,t;return[o.value,null==(e=i.value)?void 0:e.logo,null==(t=a.cauHinh)?void 0:t.logo]},([e,t,n])=>{s.value=e&&t?t:n||"/images/logodanang.png"},{immediate:!0}),pa(()=>{var e;return[null==(e=a.cauHinh)?void 0:e.tenhethong]},([e])=>{r.value=e||"Há» thá»ng xếp hà ng tá»± Äá»ng QR CODE"},{immediate:!0}),ei(async()=>{try{o.value&&await n.fetchItemById(o.value)}catch(eRe){}}),(e,t)=>(Ma(),Va("nav",dPe,[Ha("div",fPe,[Ha("a",{class:"navbar-brand d-flex align-items-center",href:"#",onClick:t[0]||(t[0]=(...t)=>e.goHome&&e.goHome(...t))},[Ha("img",{src:s.value,alt:"Logo",width:"40",height:"40",class:"d-inline-block align-top me-2 d-none d-md-inline rounded-circle shadow-sm"},null,8,pPe),Ha("h3",null,ee(r.value),1)])])]))}},mPe=CC(gPe,[["__scopeId","data-v-6621c1f3"]]),vPe={class:"footer text-center"},yPe={class:"footer-content"},bPe={class:"mb-0"},_Pe={class:"mb-0"},wPe=CC({__name:"TheFooter",props:["cauHinh"],setup(e){const t=It(""),n=It(""),i=e;return fa(()=>{t.value=i.cauHinh&&i.cauHinh.banquyen?i.cauHinh.banquyen:"",n.value=i.cauHinh&&i.cauHinh.thietke?i.cauHinh.thietke:""}),(e,i)=>(Ma(),Va("footer",vPe,[Ha("div",yPe,[Ha("p",bPe,ee(t.value),1),Ha("p",_Pe,ee(n.value),1)])]))}},[["__scopeId","data-v-ae1a3fb6"]]),kPe={class:"page-wrapper"},xPe={class:"h-100"},TPe=CC({__name:"App",setup(e){const t=Vl(),n=i8(),{item:i}=Zs(n),a=It(!1),o=["Nháºp thông tin","Hẹn giá» giao dá»ch","Äá»i giá» hẹn","Mã hết hạn","Vé Äiá»n tá»","Vé hẹn giá»","Not found","Trang ÄÄng nháºp","Hiá»n thá» QRCODE","Mà n hình trung tâm","In vé giấy","Bảng Äiá»n tá»"],s=["Trang ÄÄng nháºp","In vé giấy"],r=["Mà n hình trung tâm","Nháºp thông tin","Hẹn giá» giao dá»ch","Äá»i giá» hẹn","Vé Äiá»n tá»","Vé hẹn giá»","In vé giấy","Mã hết hạn","Bảng Äiá»n tá»","Hiá»n thá» QRCODE"],l=bo(()=>!o.includes(t.name)),c=bo(()=>s.includes(t.name)),u=bo(()=>!r.includes(t.name));document.addEventListener("contextmenu",e=>e.preventDefault()),document.addEventListener("keydown",e=>{("F12"===e.key||e.ctrlKey&&e.shiftKey&&"I"===e.key||e.ctrlKey&&e.shiftKey&&"J"===e.key||e.ctrlKey&&"U"===e.key)&&e.preventDefault()}),ei(async()=>{await Promise.all([n.fetchData()]),an(()=>{a.value=!0})}),pa(()=>t.fullPath,()=>{a.value=!1,an(()=>{a.value=!0})});const h=bo(()=>i.value);return(e,n)=>(Ma(),Va("div",kPe,[a.value&&l.value?(Ma(),qa(hPe,{key:0,cauHinh:h.value}
5555,null,8,["cauHinh"])):Qa("",!0),a.value&&c.value?(Ma(),qa(mPe,{key:1,cauHinh:h.value},null,8,["cauHinh"])):Qa("",!0),Ha("div",xPe,[(Ma(),qa(Ot(Rl),{key:Ot(t).fullPath}))]),a.value&&u.value?(Ma(),qa(wPe,{key:2,cauHinh:h.value},null,8,["cauHinh"])):Qa("",!0)]))}},[["__scopeId","data-v-bf439f62"]]);!function(){const e=new Map,t={set(t,n,i){e.has(t)||e.set(t,new Map);const a=e.get(t);(a.has(n)||0===a.size)&&a.set(n,i)},get:(t,n)=>e.has(t)&&e.get(t).get(n)||null,remove(t,n){if(!e.has(t))return;const i=e.get(t);i.delete(n),0===i.size&&e.delete(t)}},n="transitionend",i=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(e,t)=>"#".concat(CSS.escape(t)))),e),a=e=>{e.dispatchEvent(new Event(n))},o=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),s=e=>o(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(i(e)):null,r=e=>{if(!o(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const t=e.closest("summary");if(t&&t.parentNode!==n)return!1;if(null===t)return!1}return t},l=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")),c=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?c(e.parentNode):null},u=()=>{},h=e=>{e.offsetHeight},d=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,f=[],p=()=>"rtl"===document.documentElement.dir,g=e=>{var t;t=()=>{const t=d();if(t){const n=e.NAME,i=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=i,e.jQueryInterface)}},"loading"===document.readyState?(f.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of f)e()}),f.push(t)):t()},m=(e,t=[],n=e)=>"function"==typeof e?e(...t):n,v=(e,t,i=!0)=>{if(!i)return void m(e);const o=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const i=Number.parseFloat(t),a=Number.parseFloat(n);return i||a?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0})(t)+5;let s=!1;const r=({target:i})=>{i===t&&(s=!0,t.removeEventListener(n,r),m(e))};t.addEventListener(n,r),setTimeout(()=>{s||a(t)},o)},y=(e,t,n,i)=>{const a=e.length;let o=e.indexOf(t);return-1===o?!n&&i?e[a-1]:e[0]:(o+=n?1:-1,i&&(o=(o+a)%a),e[Math.max(0,Math.min(o,a-1))])},b=/[^.]*(?=\..*)\.|.*/,_=/\..*/,w=/::\d+$/,k={};let x=1;
5555const T={mouseenter:"mouseover",mouseleave:"mouseout"},C=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function E(e,t){return t&&"".concat(t,"::").concat(x++)||e.uidEvent||x++}function S(e){const t=E(e);return e.uidEvent=t,k[t]=k[t]||{},k[t]}function I(e,t,n=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===n)}function A(e,t,n){const i="string"==typeof t,a=i?n:t||n;let o=M(e);return C.has(o)||(o=e),[i,a,o]}function D(e,t,n,i,a){if("string"!=typeof t||!e)return;let[o,s,r]=A(t,n,i);var l;t in T&&(l=s,s=function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return l.call(this,e)});const c=S(e),u=c[r]||(c[r]={}),h=I(u,s,o?n:null);if(h)return void(h.oneOff=h.oneOff&&a);const d=E(s,t.replace(b,"")),f=o?function(e,t,n){return function i(a){const o=e.querySelectorAll(t);for(let{target:s}=a;s&&s!==this;s=s.parentNode)for(const r of o)if(r===s)return R(a,{delegateTarget:s}),i.oneOff&&N.off(e,a.type,t,n),n.apply(s,[a])}}(e,n,s):function(e,t){return function n(i){return R(i,{delegateTarget:e}),n.oneOff&&N.off(e,i.type,t),t.apply(e,[i])}}(e,s);f.delegationSelector=o?n:null,f.callable=s,f.oneOff=a,f.uidEvent=d,u[d]=f,e.addEventListener(r,f,o)}function P(e,t,n,i,a){const o=I(t[n],i,a);o&&(e.removeEventListener(n,o,Boolean(a)),delete t[n][o.uidEvent])}function O(e,t,n,i){const a=t[n]||{};for(const[o,s]of Object.entries(a))o.includes(i)&&P(e,t,n,s.callable,s.delegationSelector)}function M(e){return e=e.replace(_,""),T[e]||e}const N={on(e,t,n,i){D(e,t,n,i,!1)},one(e,t,n,i){D(e,t,n,i,!0)},off(e,t,n,i){if("string"!=typeof t||!e)return;const[a,o,s]=A(t,n,i),r=s!==t,l=S(e),c=l[s]||{},u=t.startsWith(".");if(void 0===o){if(u)for(const n of Object.keys(l))O(e,l,n,t.slice(1));for(const[n,i]of Object.entries(c)){const a=n.replace(w,"");r&&!t.includes(a)||P(e,l,s,i.callable,i.delegationSelector)}}else{if(!Object.keys(c).length)return;P(e,l,s,o,a?n:null)}},trigger(e,t,n){if("string"!=typeof t||!e)return null;const i=d();let a=null,o=!0,s=!0,r=!1;t!==M(t)&&i&&(a=i.Event(t,n),i(e).trigger(a),o=!a.isPropagationStopped(),s=!a.isImmediatePropagationStopped(),r=a.isDefaultPrevented());const l=R(new Event(t,{bubbles:o,cancelable:!0}),n);return r&&l.preventDefault(),s&&e.dispatchEvent(l),l.defaultPrevented&&a&&a.preventDefault(),l}};function R(e,t={}){for(const[i,a]of Object.entries(t))try{e[i]=a}catch(n){Object.defineProperty(e,i,{configurable:!0,get:()=>a})}return e}function L(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function V(e){return e.replace(/[A-Z]/g,e=>"-".concat(e.toLowerCase()))}const q={setDataAttribute(e,t,n){e.setAttribute("data-bs-".concat(V(t)),n)},removeDataAttribute(e,t){e.removeAttribute("data-bs-".concat(V(t)))},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter(e=>e.startsWith("bs")&&!e.startsWith("bsConfig"));for(const i of n){let n=i.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),t[n]=L(e.dataset[i])}return t},getDataAttribute:(e,t)=>L(e.getAttribute("data-bs-".concat(V(t))))};class F{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=o(t)?q.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...o(t)?q.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[i,a]of Object.entries(t)){const t=e[i],s=o(t)?"element":null==(n=t)?"".concat(n):Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(a).test(s))throw new TypeError("".concat(this.constructor.NAME.toUpperCase(),': Option "').concat(i,'" provided type "').concat(s,'" but expected type "').concat(a,'".'))}var n}}class B extends F{constructor(e,n){super(),(e=s(e))&&(this._element=e,this._config=this._getConfig(n),t.set(this._element,this.constructor.DATA_KEY,this))}dispose(){t.remove(this._element,this.constructor.DATA_KEY),N.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){v(e,t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return t.get(s(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.3.3"}static get DATA_KEY(){return"bs.".concat(this.NAME)}static get EVENT_KEY(){return".".concat(this.DATA_KEY)}static eventName(e){return"".concat(e).concat(this.EVENT_KEY)}}const U=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n="#".concat(n.split("#")[1])),t=n&&"#"!==n?n.trim():null}return t?t.split(",").map(e=>i(e)).join(","):null},j={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>
5555[].concat(...e.children).filter(e=>e.matches(t)),parents(e,t){const n=[];let i=e.parentNode.closest(t);for(;i;)n.push(i),i=i.parentNode.closest(t);return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(e=>"".concat(e,':not([tabindex^="-"])')).join(",");return this.find(t,e).filter(e=>!l(e)&&r(e))},getSelectorFromElement(e){const t=U(e);return t&&j.findOne(t)?t:null},getElementFromSelector(e){const t=U(e);return t?j.findOne(t):null},getMultipleElementsFromSelector(e){const t=U(e);return t?j.find(t):[]}},H=(e,t="hide")=>{const n="click.dismiss".concat(e.EVENT_KEY),i=e.NAME;N.on(document,n,'[data-bs-dismiss="'.concat(i,'"]'),function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),l(this))return;const a=j.getElementFromSelector(this)||this.closest(".".concat(i));e.getOrCreateInstance(a)[t]()})},z=".bs.alert",W="close".concat(z),K="closed".concat(z);class G extends B{static get NAME(){return"alert"}close(){if(N.trigger(this._element,W).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,e)}_destroyElement(){this._element.remove(),N.trigger(this._element,K),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=G.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}})}}H(G,"close"),g(G);const Y='[data-bs-toggle="button"]';class Q extends B{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each(function(){const t=Q.getOrCreateInstance(this);"toggle"===e&&t[e]()})}}N.on(document,"click.bs.button.data-api",Y,e=>{e.preventDefault();const t=e.target.closest(Y);Q.getOrCreateInstance(t).toggle()}),g(Q);const $=".bs.swipe",X="touchstart".concat($),J="touchmove".concat($),Z="touchend".concat($),ee="pointerdown".concat($),te="pointerup".concat($),ne={endCallback:null,leftCallback:null,rightCallback:null},ie={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class ae extends F{constructor(e,t){super(),this._element=e,e&&ae.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return ne}static get DefaultType(){return ie}static get NAME(){return"swipe"}dispose(){N.off(this._element,$)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),m(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&m(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(N.on(this._element,ee,e=>this._start(e)),N.on(this._element,te,e=>this._end(e)),this._element.classList.add("pointer-event")):(N.on(this._element,X,e=>this._start(e)),N.on(this._element,J,e=>this._move(e)),N.on(this._element,Z,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const oe=".bs.carousel",se=".data-api",re="next",le="prev",ce="left",ue="right",he="slide".concat(oe),de="slid".concat(oe),fe="keydown".concat(oe),pe="mouseenter".concat(oe),ge="mouseleave".concat(oe),me="dragstart".concat(oe),ve="load".concat(oe).concat(se),ye="click".concat(oe).concat(se),be="carousel",_e="active",we=".active",ke=".carousel-item",xe=we+ke,Te={ArrowLeft:ue,ArrowRight:ce},Ce={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Ee={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Se extends B{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=j.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===be&&this.cycle()}static get Default(){return Ce}static get DefaultType(){return Ee}static get NAME(){return"carousel"}next(){this._slide(re)}nextWhenVisible(){!document.hidden&&r(this._element)&&this.next()}prev(){this._slide(le)}pause(){this._isSliding&&a(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?N.one(this._element,de,()=>this.cycle()):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void N.one(this._element,de,()=>this.to(e));const n=this._getItemIndex(this._getActive());if(n===e)return;const i=e>n?re:le;this._slide(i,t[e])}
vendor: 4,478 bytes, line 5555
5555dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&N.on(this._element,fe,e=>this._keydown(e)),"hover"===this._config.pause&&(N.on(this._element,pe,()=>this.pause()),N.on(this._element,ge,()=>this._maybeEnableCycle())),this._config.touch&&ae.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of j.find(".carousel-item img",this._element))N.on(t,me,e=>e.preventDefault());const e={leftCallback:()=>this._slide(this._directionToOrder(ce)),rightCallback:()=>this._slide(this._directionToOrder(ue)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new ae(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=Te[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=j.findOne(we,this._indicatorsElement);t.classList.remove(_e),t.removeAttribute("aria-current");const n=j.findOne('[data-bs-slide-to="'.concat(e,'"]'),this._indicatorsElement);n&&(n.classList.add(_e),n.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const n=this._getActive(),i=e===re,a=t||y(this._getItems(),n,i,this._config.wrap);if(a===n)return;const o=this._getItemIndex(a),s=t=>N.trigger(this._element,t,{relatedTarget:a,direction:this._orderToDirection(e),from:this._getItemIndex(n),to:o});if(s(he).defaultPrevented)return;if(!n||!a)return;const r=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=a;const l=i?"carousel-item-start":"carousel-item-end",c=i?"carousel-item-next":"carousel-item-prev";a.classList.add(c),h(a),n.classList.add(l),a.classList.add(l),this._queueCallback(()=>{a.classList.remove(l,c),a.classList.add(_e),n.classList.remove(_e,c,l),this._isSliding=!1,s(de)},n,this._isAnimated()),r&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return j.findOne(xe,this._element)}_getItems(){return j.find(ke,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return p()?e===ce?le:re:e===ce?re:le}_orderToDirection(e){return p()?e===le?ce:ue:e===le?ue:ce}static jQueryInterface(e){return this.each(function(){const t=Se.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}else t.to(e)})}}N.on(document,ye,"[data-bs-slide], [data-bs-slide-to]",function(e){const t=j.getElementFromSelector(this);if(!t||!t.classList.contains(be))return;e.preventDefault();const n=Se.getOrCreateInstance(t),i=this.getAttribute("data-bs-slide-to");return i?(n.to(i),void n._maybeEnableCycle()):"next"===q.getDataAttribute(this,"slide")?(n.next(),void n._maybeEnableCycle()):(n.prev(),void n._maybeEnableCycle())}),N.on(window,ve,()=>{const e=j.find('[data-bs-ride="carousel"]');for(const t of e)Se.getOrCreateInstance(t)}),g(Se);const Ie=".bs.collapse",Ae="show".concat(Ie),De="shown".concat(Ie),Pe="hide".concat(Ie),Oe="hidden".concat(Ie),Me="click".concat(Ie,".data-api"),Ne="show",Re="collapse",Le="collapsing",Ve=":scope .".concat(Re," .").concat(Re),qe='[data-bs-toggle="collapse"]',Fe={parent:null,toggle:!0},Be={parent:"(null|element)",toggle:"boolean"};class Ue extends B{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const n=j.find(qe);for(const i of n){const e=j.getSelectorFromElement(i),t=j.find(e).filter(e=>e===this._element);null!==e&&t.length&&this._triggerArray.push(i)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Fe}static get DefaultType(){return Be}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];
5555if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(e=>e!==this._element).map(e=>Ue.getOrCreateInstance(e,{toggle:!1}))),e.length&&e[0]._isTransitioning)return;if(N.trigger(this._element,Ae).defaultPrevented)return;for(const i of e)i.hide();const t=this._getDimension();this._element.classList.remove(Re),this._element.classList.add(Le),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const n="scroll".concat(t[0].toUpperCase()+t.slice(1));this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Le),this._element.classList.add(Re,Ne),this._element.style[t]="",N.trigger(this._element,De)},this._element,!0),this._element.style[t]="".concat(this._element[n],"px")}hide(){if(this._isTransitioning||!this._isShown())return;if(N.trigger(this._element,Pe).defaultPrevented)return;const e=this._getDimension();this._element.style[e]="".concat(this._element.getBoundingClientRect()[e],"px"),h(this._element),this._element.classList.add(Le),this._element.classList.remove(Re,Ne);for(const t of this._triggerArray){const e=j.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0,this._element.style[e]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Le),this._element.classList.add(Re),N.trigger(this._element,Oe)},this._element,!0)}_isShown(e=this._element){return e.classList.contains(Ne)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=s(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(qe);for(const t of e){const e=j.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=j.find(Ve,this._config.parent);return j.find(e,this._config.parent).filter(e=>!t.includes(e))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const n of e)n.classList.toggle("collapsed",!t),n.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const n=Ue.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e]()}})}}N.on(document,Me,qe,function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const t of j.getMultipleElementsFromSelector(this))Ue.getOrCreateInstance(t,{toggle:!1}).toggle()}),g(Ue);var je="top",He="bottom",ze="right",We="left",Ke="auto",Ge=[je,He,ze,We],Ye="start",Qe="end",$e="clippingParents",Xe="viewport",Je="popper",Ze="reference",et=Ge.reduce(function(e,t){return e.concat([t+"-"+Ye,t+"-"+Qe])},[]),tt=[].concat(Ge,[Ke]).reduce(function(e,t){return e.concat([t,t+"-"+Ye,t+"-"+Qe])},[]),nt="beforeRead",it="read",at="afterRead",ot="beforeMain",st="main",rt="afterMain",lt="beforeWrite",ct="write",ut="afterWrite",ht=[nt,it,at,ot,st,rt,lt,ct,ut];function dt(e){return e?(e.nodeName||"").toLowerCase():null}function ft(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function pt(e){return e instanceof ft(e).Element||e instanceof Element}function gt(e){return e instanceof ft(e).HTMLElement||e instanceof HTMLElement}function mt(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ft(e).ShadowRoot||e instanceof ShadowRoot)}const vt={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},a=t.elements[e];
vendor: 4,653 bytes, line 5555
5555gt(a)&&dt(a)&&(Object.assign(a.style,n),Object.keys(i).forEach(function(e){var t=i[e];!1===t?a.removeAttribute(e):a.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var i=t.elements[e],a=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});gt(i)&&dt(i)&&(Object.assign(i.style,o),Object.keys(a).forEach(function(e){i.removeAttribute(e)}))})}},requires:["computeStyles"]};function yt(e){return e.split("-")[0]}var bt=Math.max,_t=Math.min,wt=Math.round;function kt(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function xt(){return!/^((?!chrome|android).)*safari/i.test(kt())}function Tt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var i=e.getBoundingClientRect(),a=1,o=1;t&>(e)&&(a=e.offsetWidth>0&&wt(i.width)/e.offsetWidth||1,o=e.offsetHeight>0&&wt(i.height)/e.offsetHeight||1);var s=(pt(e)?ft(e):window).visualViewport,r=!xt()&&n,l=(i.left+(r&&s?s.offsetLeft:0))/a,c=(i.top+(r&&s?s.offsetTop:0))/o,u=i.width/a,h=i.height/o;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l,x:l,y:c}}function Ct(e){var t=Tt(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function Et(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&mt(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function St(e){return ft(e).getComputedStyle(e)}function It(e){return["table","td","th"].indexOf(dt(e))>=0}function At(e){return((pt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Dt(e){return"html"===dt(e)?e:e.assignedSlot||e.parentNode||(mt(e)?e.host:null)||At(e)}function Pt(e){return gt(e)&&"fixed"!==St(e).position?e.offsetParent:null}function Ot(e){for(var t=ft(e),n=Pt(e);n&&It(n)&&"static"===St(n).position;)n=Pt(n);return n&&("html"===dt(n)||"body"===dt(n)&&"static"===St(n).position)?t:n||function(e){var t=/firefox/i.test(kt());if(/Trident/i.test(kt())&>(e)&&"fixed"===St(e).position)return null;var n=Dt(e);for(mt(n)&&(n=n.host);gt(n)&&["html","body"].indexOf(dt(n))<0;){var i=St(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}function Mt(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Nt(e,t,n){return bt(e,_t(t,n))}function Rt(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Lt(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}const Vt={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n,i,a=e.state,o=e.name,s=e.options,r=a.elements.arrow,l=a.modifiersData.popperOffsets,c=yt(a.placement),u=Mt(c),h=[We,ze].indexOf(c)>=0?"height":"width";if(r&&l){var d=(n=s.padding,i=a,Rt("number"!=typeof(n="function"==typeof n?n(Object.assign({},i.rects,{placement:i.placement})):n)?n:Lt(n,Ge))),f=Ct(r),p="y"===u?je:We,g="y"===u?He:ze,m=a.rects.reference[h]+a.rects.reference[u]-l[u]-a.rects.popper[h],v=l[u]-a.rects.reference[u],y=Ot(r),b=y?"y"===u?y.clientHeight||0:y.clientWidth||0:0,_=m/2-v/2,w=d[p],k=b-f[h]-d[g],x=b/2-f[h]/2+_,T=Nt(w,x,k),C=u;a.modifiersData[o]=((t={})[C]=T,t.centerOffset=T-x,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&Et(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qt(e){return e.split("-")[1]}var Ft={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Bt(e){var t,n=e.popper,i=e.popperRect,a=e.placement,o=e.variation,s=e.offsets,r=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,h=e.isFixed,d=s.x,f=void 0===d?0:d,p=s.y,g=void 0===p?0:p,m="function"==typeof u?u({x:f,y:g}):{x:f,y:g};f=m.x,g=m.y;var v=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),b=We,_=je,w=window;if(c){var k=Ot(n),x="clientHeight",T="clientWidth";k===ft(n)&&"static"!==St(k=At(n)).position&&"absolute"===r&&(x="scrollHeight",T="scrollWidth"),(a===je||(a===We||a===ze)&&o===Qe)&&(_=He,g-=(h&&k===w&&w.visualVie
5555wport?w.visualViewport.height:k[x])-i.height,g*=l?1:-1),a!==We&&(a!==je&&a!==He||o!==Qe)||(b=ze,f-=(h&&k===w&&w.visualViewport?w.visualViewport.width:k[T])-i.width,f*=l?1:-1)}var C,E,S,I,A,D,P=Object.assign({position:r},c&&Ft),O=!0===u?(E={x:f,y:g},S=ft(n),I=E.x,A=E.y,D=S.devicePixelRatio||1,{x:wt(I*D)/D||0,y:wt(A*D)/D||0}):{x:f,y:g};return f=O.x,g=O.y,l?Object.assign({},P,((C={})[_]=y?"0":"",C[b]=v?"0":"",C.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",C)):Object.assign({},P,((t={})[_]=y?g+"px":"",t[b]=v?f+"px":"",t.transform="",t))}const Ut={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,a=void 0===i||i,o=n.adaptive,s=void 0===o||o,r=n.roundOffsets,l=void 0===r||r,c={placement:yt(t.placement),variation:qt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:a,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Bt(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Bt(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var jt={passive:!0};const Ht={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,a=i.scroll,o=void 0===a||a,s=i.resize,r=void 0===s||s,l=ft(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(e){e.addEventListener("scroll",n.update,jt)}),r&&l.addEventListener("resize",n.update,jt),function(){o&&c.forEach(function(e){e.removeEventListener("scroll",n.update,jt)}),r&&l.removeEventListener("resize",n.update,jt)}},data:{}};var zt={left:"right",right:"left",bottom:"top",top:"bottom"};function Wt(e){return e.replace(/left|right|bottom|top/g,function(e){return zt[e]})}var Kt={start:"end",end:"start"};function Gt(e){return e.replace(/start|end/g,function(e){return Kt[e]})}function Yt(e){var t=ft(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Qt(e){return Tt(At(e)).left+Yt(e).scrollLeft}function $t(e){var t=St(e),n=t.overflow,i=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+i)}function Xt(e){return["html","body","#document"].indexOf(dt(e))>=0?e.ownerDocument.body:gt(e)&&$t(e)?e:Xt(Dt(e))}function Jt(e,t){var n;void 0===t&&(t=[]);var i=Xt(e),a=i===(null==(n=e.ownerDocument)?void 0:n.body),o=ft(i),s=a?[o].concat(o.visualViewport||[],$t(i)?i:[]):i,r=t.concat(s);return a?r:r.concat(Jt(Dt(s)))}function Zt(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function en(e,t,n){return t===Xe?Zt(function(e,t){var n=ft(e),i=At(e),a=n.visualViewport,o=i.clientWidth,s=i.clientHeight,r=0,l=0;if(a){o=a.width,s=a.height;var c=xt();(c||!c&&"fixed"===t)&&(r=a.offsetLeft,l=a.offsetTop)}return{width:o,height:s,x:r+Qt(e),y:l}}(e,n)):pt(t)?((a=Tt(i=t,!1,"fixed"===n)).top=a.top+i.clientTop,a.left=a.left+i.clientLeft,a.bottom=a.top+i.clientHeight,a.right=a.left+i.clientWidth,a.width=i.clientWidth,a.height=i.clientHeight,a.x=a.left,a.y=a.top,a):Zt(function(e){var t,n=At(e),i=Yt(e),a=null==(t=e.ownerDocument)?void 0:t.body,o=bt(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=bt(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),r=-i.scrollLeft+Qt(e),l=-i.scrollTop;return"rtl"===St(a||n).direction&&(r+=bt(n.clientWidth,a?a.clientWidth:0)-o),{width:o,height:s,x:r,y:l}}(At(e)));var i,a}function tn(e){var t,n=e.reference,i=e.element,a=e.placement,o=a?yt(a):null,s=a?qt(a):null,r=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(o){case je:t={x:r,y:n.y-i.height};break;case He:t={x:r,y:n.y+n.height};break;case ze:t={x:n.x+n.width,y:l};break;case We:t={x:n.x-i.width,y:l};break;default:t={x:n.x,y:n.y}}var c=o?Mt(o):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case Ye:t[c]=t[c]-(n[u]/2-i[u]/2);break;case Qe:t[c]=t[c]+(n[u]/2-i[u]/2)}}return t}function nn(e,t){void 0===t&&(t={});var n,i,a,o,s,r,l,c,u,h,d,f=t,p=f.placement,g=void 0===p?e.placement:p,m=f.strategy,v=void 0===m?e.strategy:m,y=f.boundary,b=void 0===y?$e:y,_=f.rootBoundary,w=void 0===_?Xe:_,k=f.elementContext,x=void 0===k?Je:k,T=f.altBoundary,C=void 0!==T&&T,E=f.padding,S=void 0===E?0:E,I=Rt("number"!=typeof S?S:Lt(S,Ge)),A=x===Je?Ze:Je,D=e.rects.popper,P=e.elements[C?A:x],O=(n=pt(P)?P:P.contextElement||At(e.elements.popper),a=w,o=v,c="clippingParents"===(i=b)?(r=Jt(Dt(s=n)),pt(l=["absolute","fixed"].indexOf(St(s).position)>=0&>(s)?Ot(s):s)?r.filter(function(e){return pt(e)&&Et(e,l)&&"body"!==dt(e)}):[]):[].concat(i),u=[].concat(c,[a]),h=u[0],d=u.reduce(function(e,t){var i=en(n,t,o);return e.top=bt(i.top,e.top),e.right=_t(i.right,e.right),e.bottom=_t(i.bottom,e.bottom),e.left=bt(i.left,e.left),e},en(n,h,o)),d.width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d),M=Tt(e.elements.reference),N=tn({reference:M,element:D,strategy:"absolute",placement:g}),R=Zt(Object.assign({},D,N)),L=x===Je?R:M,V={top:O.top-L.top+I.top,bottom:L.bottom-O.bottom+I.bottom,left:O.left-L.left+I.left,right:L.right-O.right+I.right},q=e.modifiersData.offset;if(x===Je&&q){var F=q[g];
vendor: 10,489 bytes, line 5555
5555Object.keys(V).forEach(function(e){var t=[ze,He].indexOf(e)>=0?1:-1,n=[je,He].indexOf(e)>=0?"y":"x";V[e]+=F[n]*t})}return V}function an(e,t){void 0===t&&(t={});var n=t,i=n.placement,a=n.boundary,o=n.rootBoundary,s=n.padding,r=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?tt:l,u=qt(i),h=u?r?et:et.filter(function(e){return qt(e)===u}):Ge,d=h.filter(function(e){return c.indexOf(e)>=0});0===d.length&&(d=h);var f=d.reduce(function(t,n){return t[n]=nn(e,{placement:n,boundary:a,rootBoundary:o,padding:s})[yt(n)],t},{});return Object.keys(f).sort(function(e,t){return f[e]-f[t]})}const on={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var a=n.mainAxis,o=void 0===a||a,s=n.altAxis,r=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,h=n.rootBoundary,d=n.altBoundary,f=n.flipVariations,p=void 0===f||f,g=n.allowedAutoPlacements,m=t.options.placement,v=yt(m),y=l||(v!==m&&p?function(e){if(yt(e)===Ke)return[];var t=Wt(e);return[Gt(e),t,Gt(t)]}(m):[Wt(m)]),b=[m].concat(y).reduce(function(e,n){return e.concat(yt(n)===Ke?an(t,{placement:n,boundary:u,rootBoundary:h,padding:c,flipVariations:p,allowedAutoPlacements:g}):n)},[]),_=t.rects.reference,w=t.rects.popper,k=new Map,x=!0,T=b[0],C=0;C<b.length;C++){var E=b[C],S=yt(E),I=qt(E)===Ye,A=[je,He].indexOf(S)>=0,D=A?"width":"height",P=nn(t,{placement:E,boundary:u,rootBoundary:h,altBoundary:d,padding:c}),O=A?I?ze:We:I?He:je;_[D]>w[D]&&(O=Wt(O));var M=Wt(O),N=[];if(o&&N.push(P[S]<=0),r&&N.push(P[O]<=0,P[M]<=0),N.every(function(e){return e})){T=E,x=!1;break}k.set(E,N)}if(x)for(var R=function(e){var t=b.find(function(t){var n=k.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return T=t,"break"},L=p?3:1;L>0&&"break"!==R(L);L--);t.placement!==T&&(t.modifiersData[i]._skip=!0,t.placement=T,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function sn(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function rn(e){return[je,ze,He,We].some(function(t){return e[t]>=0})}const ln={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,a=t.rects.popper,o=t.modifiersData.preventOverflow,s=nn(t,{elementContext:"reference"}),r=nn(t,{altBoundary:!0}),l=sn(s,i),c=sn(r,a,o),u=rn(l),h=rn(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}},cn={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,a=n.offset,o=void 0===a?[0,0]:a,s=tt.reduce(function(e,n){return e[n]=(i=n,a=t.rects,s=o,r=yt(i),l=[We,je].indexOf(r)>=0?-1:1,c="function"==typeof s?s(Object.assign({},a,{placement:i})):s,u=c[0],h=c[1],u=u||0,h=(h||0)*l,[We,ze].indexOf(r)>=0?{x:h,y:u}:{x:u,y:h}),e;var i,a,s,r,l,c,u,h},{}),r=s[t.placement],l=r.x,c=r.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=s}},un={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=tn({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},hn={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t,n,i=e.state,a=e.options,o=e.name,s=a.mainAxis,r=void 0===s||s,l=a.altAxis,c=void 0!==l&&l,u=a.boundary,h=a.rootBoundary,d=a.altBoundary,f=a.padding,p=a.tether,g=void 0===p||p,m=a.tetherOffset,v=void 0===m?0:m,y=nn(i,{boundary:u,rootBoundary:h,padding:f,altBoundary:d}),b=yt(i.placement),_=qt(i.placement),w=!_,k=Mt(b),x="x"===k?"y":"x",T=i.modifiersData.popperOffsets,C=i.rects.reference,E=i.rects.popper,S="function"==typeof v?v(Object.assign({},i.rects,{placement:i.placement})):v,I="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),A=i.modifiersData.offset?i.modifiersData.offset[i.placement]:null,D={x:0,y:0};if(T){if(r){var P,O="y"===k?je:We,M="y"===k?He:ze,N="y"===k?"height":"width",R=T[k],L=R+y[O],V=R-y[M],q=g?-E[N]/2:0,F=_===Ye?C[N]:E[N],B=_===Ye?-E[N]:-C[N],U=i.elements.arrow,j=g&&U?Ct(U):{width:0,height:0},H=i.modifiersData["arrow#persistent"]?i.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},z=H[O],W=H[M],K=Nt(0,C[N],j[N]),G=w?C[N]/2-q-K-z-I.mainAxis:F-K-z-I.mainAxis,Y=w?-C[N]/2+q+K+W+I.mainAxis:B+K+W+I.mainAxis,Q=i.elements.arrow&&Ot(i.elements.arrow),$=Q?"y"===k?Q.clientTop||0:Q.clientLeft||0:0,X=null!=(P=null==A?void 0:A[k])?P:0,J=R+Y-X,Z=Nt(g?_t(L,R+G-X-$):L,R,g?bt(V,J):V);T[k]=Z,D[k]=Z-R}if(c){var ee,te="x"===k?je:We,ne="x"===k?He:ze,ie=T[x],ae="y"===x?"height":"width",oe=ie+y[te],se=ie-y[ne],re=-1!==[je,We].indexOf(b),le=null!=(ee=null==A?void 0:A[x])?ee:0,ce=re?oe:ie-C[ae]-E[ae]-le+I.altAxis,ue=re?ie+C[ae]+E[ae]-le-I.altAxis:se,he=g&&re?(n=Nt(ce,ie,t=ue))>t?t:n:Nt(g?ce:oe,ie,g?ue:se);T[x]=he,D[x]=he-ie}i.modifiersData[o]=D}},requiresIfExists:["offset"]};function dn(e,t,n){void 0===n&&(n=!1);var i,a,o,s,r,l,c=gt(t),u=gt(t)&&(s=(o=t).getBoundingClientRect(),r=wt(s.width)/o.offsetWidth||1,l=wt(s.height)/o.offsetHeight||1,1!==r||1!==l),h=At(t),d=Tt(e,u,n),f={scrollLeft:0,scrollTop:0},p={x:0,y:0};return(c||!c&&!n)&&(("body"!==dt(t)||$t(h))&&(f=(i=t)!==ft(i)&>(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:Yt(i)),gt(t)?((p=Tt(t,!0)).x+=t.clientLeft,p.y+=t.clientTop):h&&(p.x=Qt(h))),{x:d.left+f.scrollLeft-p.x,y:d.top+f.scrollTop-p.y,width:d.width,height:d.height}}function fn(e){var t=new Map,n=new Set,i=[];function a(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var i=t.get(e);i&&a(i)}}),i.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){n.has(e.name)||a(e)}),i}var pn={placement:"bottom",modifiers:[],strategy:"absolute"};function gn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function mn(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,i=void 0===n?[]:n,a=t.defaultOptions,o=void 0===a?pn:a;return function(e,t,n){void 0===n&&(n=o);var a,s,r={placement:"bottom",orderedModifiers:[],options:Object.assign({},pn,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,u={state:r,setOptions:function(n){var a="function"==typeof n?n(r.options):n;h(),r.options=Object.assign({},o,r.options,a),r.scrollParents={reference:pt(e)?Jt(e):e.contextElement?Jt(e.contextElement):[],popper:Jt(t)};var s,c,d,f,p=(s=[].concat(i,r.options.modifiers),c=s.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{}),d=Object.keys(c).map(function(e){return c[e]}),f=fn(d),ht.reduce(function(e,t){return e.concat(f.filter(function(e){return e.phase===t}))},[]));return r.orderedModifiers=p.filter(function(e){return e.enabled}),r.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,i=void 0===n?{}:n,a=e.effect;if("function"==typeof a){var o=a({state:r,name:t,instance:u,options:i});l.push(o||function(){})}}),u.update()},forceUpdate:function(){if(!c){var e=r.elements,t=e.reference,n=e.popper;if(gn(t,n)){r.rects={reference:dn(t,Ot(n),"fixed"===r.options.strategy),popper:Ct(n)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach(function(e){return r.modifiersData[e.name]=Object.assign({},e.data)});for(var i=0;i<r.orderedModifiers.length;i++)if(!0!==r.reset){var a=r.orderedModifiers[i],o=a.fn,s=a.options,l=void 0===s?{}:s,h=a.name;"function"==typeof o&&(r=o({state:r,options:l,name:h,instance:u})||r)}else r.reset=!1,i=-1}}},update:(a=function(){return new Promise(function(e){u.forceUpdate(),e(r)})},function(){return s||(s=new Promise(function(e){Promise.resolve().then(function(){s=void 0,e(a())})})),s}),destroy:function(){h(),c=!0}};if(!gn(e,t))return u;function h(){l.forEach(function(e){return e()}),l=[]}return u.setOptions(n).then(function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)}),u}}var vn=mn(),yn=mn({defaultModifiers:[Ht,un,Ut,vt]}),bn=mn({defaultModifiers:[Ht,un,Ut,vt,cn,on,hn,Vt,ln]});const _n=Object.freeze(Object.defineProperty({__proto__:null,afterMain:rt,afterRead:at,afterWrite:ut,applyStyles:vt,arrow:Vt,auto:Ke,basePlacements:Ge,beforeMain:ot,beforeRead:nt,beforeWrite:lt,bottom:He,clippingParents:$e,computeStyles:Ut,createPopper:bn,createPopperBase:vn,createPopperLite:yn,detectOverflow:nn,end:Qe,eventListeners:Ht,flip:on,hide:ln,left:We,main:st,modifierPhases:ht,offset:cn,placements:tt,popper:Je,popperGenerator:mn,popperOffsets:un,preventOverflow:hn,read:it,reference:Ze,right:ze,start:Ye,top:je,variationPlacements:et,viewport:Xe,write:ct},Symbol.toStringTag,{value:"Module"})),wn="dropdown",kn=".bs.dropdown",xn=".data-api",Tn="ArrowUp",Cn="ArrowDown",En="hide".concat(kn),Sn="hidden".concat(kn),In="show".concat(kn),An="shown".concat(kn),Dn="click".concat(kn).concat(xn),Pn="keydown".concat(kn).concat(xn),On="keyup".concat(kn).concat(xn),Mn="show",Nn='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',Rn="".concat(Nn,".").concat(Mn),Ln=".dropdown-menu",Vn=p()?"top-end":"top-start",qn=p()?"top-start":"top-end",Fn=p()?"bottom-end":"bottom-start",Bn=p()?"bottom-start":"bottom-end",Un=p()?"left-start":"right-start",jn=p()?"right-start":"left-start",Hn={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},zn={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Wn extends B{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=j.next(this._element,Ln)[0]||j.prev(this._element,Ln)[0]||j.findOne(Ln,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Hn}static get DefaultType(){return zn}static get NAME(){return wn}toggle(){return this._isShown()?this.hide():this.show()}show(){if(l(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!N.trigger(this._element,In,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".
5555navbar-nav"))for(const e of[].concat(...document.body.children))N.on(e,"mouseover",u);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Mn),this._element.classList.add(Mn),N.trigger(this._element,An,e)}}hide(){if(l(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!N.trigger(this._element,En,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))N.off(e,"mouseover",u);this._popper&&this._popper.destroy(),this._menu.classList.remove(Mn),this._element.classList.remove(Mn),this._element.setAttribute("aria-expanded","false"),q.removeDataAttribute(this._menu,"popper"),N.trigger(this._element,Sn,e)}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!o(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError("".concat(wn.toUpperCase(),': Option "reference" provided type "object" without a required "getBoundingClientRect" method.'));return e}_createPopper(){if(void 0===_n)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;"parent"===this._config.reference?e=this._parent:o(this._config.reference)?e=s(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=bn(e,this._menu,t)}_isShown(){return this._menu.classList.contains(Mn)}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return Un;if(e.classList.contains("dropstart"))return jn;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?qn:Vn:t?Bn:Fn}
vendor: 5,409 bytes, line 5555
5555_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(q.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...m(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const n=j.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(e=>r(e));n.length&&y(n,t,e===Cn,!n.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=Wn.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e]()}})}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=j.find(Rn);for(const n of t){const t=Wn.getInstance(n);if(!t||!1===t._config.autoClose)continue;const i=e.composedPath(),a=i.includes(t._menu);if(i.includes(t._element)||"inside"===t._config.autoClose&&!a||"outside"===t._config.autoClose&&a)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const o={relatedTarget:t._element};"click"===e.type&&(o.clickEvent=e),t._completeHide(o)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),n="Escape"===e.key,i=[Tn,Cn].includes(e.key);if(!i&&!n)return;if(t&&!n)return;e.preventDefault();const a=this.matches(Nn)?this:j.prev(this,Nn)[0]||j.next(this,Nn)[0]||j.findOne(Nn,e.delegateTarget.parentNode),o=Wn.getOrCreateInstance(a);if(i)return e.stopPropagation(),o.show(),void o._selectMenuItem(e);o._isShown()&&(e.stopPropagation(),o.hide(),a.focus())}}N.on(document,Pn,Nn,Wn.dataApiKeydownHandler),N.on(document,Pn,Ln,Wn.dataApiKeydownHandler),N.on(document,Dn,Wn.clearMenus),N.on(document,On,Wn.clearMenus),N.on(document,Dn,Nn,function(e){e.preventDefault(),Wn.getOrCreateInstance(this).toggle()}),g(Wn);const Kn="backdrop",Gn="show",Yn="mousedown.bs.".concat(Kn),Qn={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},$n={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Xn extends F{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return Qn}static get DefaultType(){return $n}static get NAME(){return Kn}show(e){if(!this._config.isVisible)return void m(e);this._append();const t=this._getElement();this._config.isAnimated&&h(t),t.classList.add(Gn),this._emulateAnimation(()=>{m(e)})}hide(e){this._config.isVisible?(this._getElement().classList.remove(Gn),this._emulateAnimation(()=>{this.dispose(),m(e)})):m(e)}dispose(){this._isAppended&&(N.off(this._element,Yn),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=s(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),N.on(e,Yn,()=>{m(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){v(e,this._getElement(),this._config.isAnimated)}}const Jn=".bs.focustrap",Zn="focusin".concat(Jn),ei="keydown.tab".concat(Jn),ti="backward",ni={autofocus:!0,trapElement:null},ii={autofocus:"boolean",trapElement:"element"};class ai extends F{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return ni}static get DefaultType(){return ii}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),N.off(document,Jn),N.on(document,Zn,e=>this._handleFocusin(e)),N.on(document,ei,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,N.off(document,Jn))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const n=j.focusableChildren(t);0===n.length?t.focus():this._lastTabNavDirection===ti?n[n.length-1].focus():n[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?ti:"forward")}}const oi=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",si=".sticky-top",ri="padding-right",li="margin-right";class ci{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,ri,t=>t+e),this._setElementAttributes(oi,ri,t=>t+e),this._setElementAttributes(si,li,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,ri),this._resetElementAttributes(oi,ri),this._resetElementAttributes(si,li)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}
vendor: 9,585 bytes, line 5555
5555_setElementAttributes(e,t,n){const i=this.getWidth();this._applyManipulationCallback(e,e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+i)return;this._saveInitialAttribute(e,t);const a=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,"".concat(n(Number.parseFloat(a)),"px"))})}_saveInitialAttribute(e,t){const n=e.style.getPropertyValue(t);n&&q.setDataAttribute(e,t,n)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,e=>{const n=q.getDataAttribute(e,t);null!==n?(q.removeDataAttribute(e,t),e.style.setProperty(t,n)):e.style.removeProperty(t)})}_applyManipulationCallback(e,t){if(o(e))t(e);else for(const n of j.find(e,this._element))t(n)}}const ui=".bs.modal",hi="hide".concat(ui),di="hidePrevented".concat(ui),fi="hidden".concat(ui),pi="show".concat(ui),gi="shown".concat(ui),mi="resize".concat(ui),vi="click.dismiss".concat(ui),yi="mousedown.dismiss".concat(ui),bi="keydown.dismiss".concat(ui),_i="click".concat(ui,".data-api"),wi="modal-open",ki="show",xi="modal-static",Ti={backdrop:!0,focus:!0,keyboard:!0},Ci={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Ei extends B{constructor(e,t){super(e,t),this._dialog=j.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new ci,this._addEventListeners()}static get Default(){return Ti}static get DefaultType(){return Ci}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||N.trigger(this._element,pi,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(wi),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){this._isShown&&!this._isTransitioning&&(N.trigger(this._element,hi).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(ki),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){N.off(window,ui),N.off(this._dialog,ui),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Xn({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new ai({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=j.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),h(this._element),this._element.classList.add(ki),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,N.trigger(this._element,gi,{relatedTarget:e})},this._dialog,this._isAnimated())}_addEventListeners(){N.on(this._element,bi,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),N.on(window,mi,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),N.on(this._element,yi,e=>{N.one(this._element,vi,t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(wi),this._resetAdjustments(),this._scrollBar.reset(),N.trigger(this._element,fi)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(N.trigger(this._element,di).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(xi)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(xi),this._queueCallback(()=>{this._element.classList.remove(xi),this._queueCallback(()=>{this._element.style.overflowY=t},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;if(n&&!e){const e=p()?"paddingLeft":"paddingRight";this._element.style[e]="".concat(t,"px")}if(!n&&e){const e=p()?"paddingRight":"paddingLeft";this._element.style[e]="".concat(t,"px")}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const n=Ei.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e](t)}})}}N.on(document,_i,'[data-bs-toggle="modal"]',function(e){const t=j.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),N.one(t,pi,e=>{e.defaultPrevented||N.one(t,fi,()=>{r(this)&&this.focus()})});const n=j.findOne(".modal.show");n&&Ei.getInstance(n).hide(),Ei.getOrCreateInstance(t).toggle(this)}),H(Ei),g(Ei);const Si=".bs.offcanvas",Ii=".data-api",Ai="load".concat(Si).concat(Ii),Di="show",Pi="showing",Oi="hiding",Mi=".offcanvas.show",Ni="show".concat(Si),Ri="shown".concat(Si),Li="hide".concat(Si),Vi="hidePrevented".concat(Si),qi="hidden".concat(Si),Fi="resize".concat(Si),Bi="click".concat(Si).concat(Ii),Ui="keydown.dismiss".concat(Si),ji={backdrop:!0,keyboard:!0,scroll:!1},Hi={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class zi extends B{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return ji}static get DefaultType(){return Hi}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||N.trigger(this._element,Ni,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new ci).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Pi),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Di),this._element.classList.remove(Pi),N.trigger(this._element,Ri,{relatedTarget:e})},this._element,!0))}hide(){this._isShown&&(N.trigger(this._element,Li).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Oi),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(Di,Oi),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new ci).reset(),N.trigger(this._element,qi)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new Xn({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():N.trigger(this._element,Vi)}:null})}_initializeFocusTrap(){return new ai({trapElement:this._element})}_addEventListeners(){N.on(this._element,Ui,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():N.trigger(this._element,Vi))})}static jQueryInterface(e){return this.each(function(){const t=zi.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}})}}N.on(document,Bi,'[data-bs-toggle="offcanvas"]',function(e){const t=j.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),l(this))return;N.one(t,qi,()=>{r(this)&&this.focus()});const n=j.findOne(Mi);n&&n!==t&&zi.getInstance(n).hide(),zi.getOrCreateInstance(t).toggle(this)}),N.on(window,Ai,()=>{for(const e of j.find(Mi))zi.getOrCreateInstance(e).show()}),N.on(window,Fi,()=>{for(const e of j.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&zi.getOrCreateInstance(e).hide()}),H(zi),g(zi);const Wi={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Ki=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Gi=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Yi=(e,t)=>{const n=e.nodeName.toLowerCase();return t.includes(n)?!Ki.has(n)||Boolean(Gi.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(n))},Qi={allowList:Wi,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},$i={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Xi={entry:"(string|element|function|null)",selector:"(string|element)"};class Ji extends F{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return Qi}static get DefaultType(){return $i}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(e=>
vendor: 4,604 bytes, line 5555
5555this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[i,a]of Object.entries(this._config.content))this._setContent(e,a,i);const t=e.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&t.classList.add(...n.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,n]of Object.entries(e))super._typeCheckConfig({selector:t,entry:n},Xi)}_setContent(e,t,n){const i=j.findOne(n,e);i&&((t=this._resolvePossibleFunction(t))?o(t)?this._putElementInTemplate(s(t),i):this._config.html?i.innerHTML=this._maybeSanitize(t):i.textContent=t:i.remove())}_maybeSanitize(e){return this._config.sanitize?function(e,t,n){if(!e.length)return e;if(n&&"function"==typeof n)return n(e);const i=(new window.DOMParser).parseFromString(e,"text/html"),a=[].concat(...i.body.querySelectorAll("*"));for(const o of a){const e=o.nodeName.toLowerCase();if(!Object.keys(t).includes(e)){o.remove();continue}const n=[].concat(...o.attributes),i=[].concat(t["*"]||[],t[e]||[]);for(const t of n)Yi(t,i)||o.removeAttribute(t.nodeName)}return i.body.innerHTML}(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return m(e,[this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const Zi=new Set(["sanitize","allowList","sanitizeFn"]),ea="fade",ta="show",na=".modal",ia="hide.bs.modal",aa="hover",oa="focus",sa={AUTO:"auto",TOP:"top",RIGHT:p()?"left":"right",BOTTOM:"bottom",LEFT:p()?"right":"left"},ra={allowList:Wi,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},la={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class ca extends B{constructor(e,t){if(void 0===_n)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return ra}static get DefaultType(){return la}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),N.off(this._element.closest(na),ia,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=N.trigger(this._element,this.constructor.eventName("show")),t=(c(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));const{container:i}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(i.append(n),N.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(n),n.classList.add(ta),"ontouchstart"in document.documentElement)for(const a of[].concat(...document.body.children))N.on(a,"mouseover",u);this._queueCallback(()=>{N.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}
vendor: 5,399 bytes, line 5555
5555hide(){if(this._isShown()&&!N.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(ta),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))N.off(e,"mouseover",u);this._activeTrigger.click=!1,this._activeTrigger[oa]=!1,this._activeTrigger[aa]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),N.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(ea,ta),t.classList.add("bs-".concat(this.constructor.NAME,"-auto"));const n=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add(ea),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new Ji({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(ea)}_isShown(){return this.tip&&this.tip.classList.contains(ta)}_createPopper(e){const t=m(this._config.placement,[this,e,this._element]),n=sa[t.toUpperCase()];return bn(this._element,e,this._getPopperConfig(n))}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return m(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:".".concat(this.constructor.NAME,"-arrow")}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return{...t,...m(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)N.on(this._element,this.constructor.eventName("click"),this._config.selector,e=>{this._initializeOnDelegatedTarget(e).toggle()});else if("manual"!==t){const e=t===aa?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),n=t===aa?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");N.on(this._element,e,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?oa:aa]=!0,t._enter()}),N.on(this._element,n,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?oa:aa]=t._element.contains(e.relatedTarget),t._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},N.on(this._element.closest(na),ia,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=q.getDataAttributes(this._element);for(const n of Object.keys(t))Zi.has(n)&&delete t[n];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:s(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,n]of Object.entries(this._config))this.constructor.Default[t]!==n&&(e[t]=n);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=ca.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError('No method n
5555amed "'.concat(e,'"'));t[e]()}})}}g(ca);const ua={...ca.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},ha={...ca.DefaultType,content:"(null|string|element|function)"};class da extends ca{static get Default(){return ua}static get DefaultType(){return ha}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=da.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e]()}})}}g(da);const fa=".bs.scrollspy",pa="activate".concat(fa),ga="click".concat(fa),ma="load".concat(fa,".data-api"),va="active",ya="[href]",ba=".nav-link",_a="".concat(ba,", .nav-item > ").concat(ba,", .list-group-item"),wa={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},ka={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class xa extends B{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return wa}static get DefaultType(){return ka}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=s(e.target)||document.body,e.rootMargin=e.offset?"".concat(e.offset,"px 0px -30%"):e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map(e=>Number.parseFloat(e))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(N.off(this._config.target,ga),N.on(this._config.target,ga,ya,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const n=this._rootElement||window,i=t.offsetTop-this._element.offsetTop;if(n.scrollTo)return void n.scrollTo({top:i,behavior:"smooth"});n.scrollTop=i}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(e=>this._observerCallback(e),e)}_observerCallback(e){const t=e=>this._targetLinks.get("#".concat(e.target.id)),n=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},i=(this._rootElement||document.documentElement).scrollTop,a=i>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=i;for(const o of e){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(o));continue}const e=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(a&&e){if(n(o),!i)return}else a||e||n(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=j.find(ya,this._config.target);for(const t of e){if(!t.hash||l(t))continue;const e=j.findOne(decodeURI(t.hash),this._element);r(e)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(va),this._activateParents(e),N.trigger(this._element,pa,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))j.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(va);else for(const t of j.parents(e,".nav, .list-group"))for(const e of j.prev(t,_a))e.classList.add(va)}_clearActiveClass(e){e.classList.remove(va);const t=j.find("".concat(ya,".").concat(va),e);for(const n of t)n.classList.remove(va)}static jQueryInterface(e){return this.each(function(){const t=xa.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method n
5555amed "'.concat(e,'"'));t[e]()}})}}N.on(window,ma,()=>{for(const e of j.find('[data-bs-spy="scroll"]'))xa.getOrCreateInstance(e)}),g(xa);const Ta=".bs.tab",Ca="hide".concat(Ta),Ea="hidden".concat(Ta),Sa="show".concat(Ta),Ia="shown".concat(Ta),Aa="click".concat(Ta),Da="keydown".concat(Ta),Pa="load".concat(Ta),Oa="ArrowLeft",Ma="ArrowRight",Na="ArrowUp",Ra="ArrowDown",La="Home",Va="End",qa="active",Fa="fade",Ba="show",Ua=".dropdown-toggle",ja=":not(".concat(Ua,")"),Ha='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',za=".nav-link".concat(ja,", .list-group-item").concat(ja,', [role="tab"]').concat(ja,", ").concat(Ha),Wa=".".concat(qa,'[data-bs-toggle="tab"], .').concat(qa,'[data-bs-toggle="pill"], .').concat(qa,'[data-bs-toggle="list"]');class Ka extends B{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),N.on(this._element,Da,e=>this._keydown(e)))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),n=t?N.trigger(t,Ca,{relatedTarget:e}):null;N.trigger(e,Sa,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){e&&(e.classList.add(qa),this._activate(j.getElementFromSelector(e)),this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),N.trigger(e,Ia,{relatedTarget:t})):e.classList.add(Ba)},e,e.classList.contains(Fa)))}_deactivate(e,t){e&&(e.classList.remove(qa),e.blur(),this._deactivate(j.getElementFromSelector(e)),this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),N.trigger(e,Ea,{relatedTarget:t})):e.classList.remove(Ba)},e,e.classList.contains(Fa)))}_keydown(e){if(![Oa,Ma,Na,Ra,La,Va].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(e=>!l(e));let n;if([La,Va].includes(e.key))n=t[e.key===La?0:t.length-1];else{const i=[Ma,Ra].includes(e.key);n=y(t,e.target,i,!0)}n&&(n.focus({preventScroll:!0}),Ka.getOrCreateInstance(n).show())}_getChildren(){return j.find(za,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const n of t)this._setInitialAttributesOnChild(n)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute("aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=j.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby","".concat(e.id)))}_toggleDropDown(e,t){const n=this._getOuterElement(e);if(!n.classList.contains("dropdown"))return;const i=(e,i)=>{const a=j.findOne(e,n);a&&a.classList.toggle(i,t)};i(Ua,qa),i(".dropdown-menu",Ba),n.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}_elemIsActive(e){return e.classList.contains(qa)}_getInnerElement(e){return e.matches(za)?e:j.findOne(za,e)}
5555_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}static jQueryInterface(e){return this.each(function(){const t=Ka.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e]()}})}}N.on(document,Aa,Ha,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),l(this)||Ka.getOrCreateInstance(this).show()}),N.on(window,Pa,()=>{for(const e of j.find(Wa))Ka.getOrCreateInstance(e)}),g(Ka);const Ga=".bs.toast",Ya="mouseover".concat(Ga),Qa="mouseout".concat(Ga),$a="focusin".concat(Ga),Xa="focusout".concat(Ga),Ja="hide".concat(Ga),Za="hidden".concat(Ga),eo="show".concat(Ga),to="shown".concat(Ga),no="hide",io="show",ao="showing",oo={animation:"boolean",autohide:"boolean",delay:"number"},so={animation:!0,autohide:!0,delay:5e3};class ro extends B{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return so}static get DefaultType(){return oo}static get NAME(){return"toast"}show(){N.trigger(this._element,eo).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(no),h(this._element),this._element.classList.add(io,ao),this._queueCallback(()=>{this._element.classList.remove(ao),N.trigger(this._element,to),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(N.trigger(this._element,Ja).defaultPrevented||(this._element.classList.add(ao),this._queueCallback(()=>{this._element.classList.add(no),this._element.classList.remove(ao,io),N.trigger(this._element,Za)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(io),super.dispose()}isShown(){return this._element.classList.contains(io)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){N.on(this._element,Ya,e=>this._onInteraction(e,!0)),N.on(this._element,Qa,e=>this._onInteraction(e,!1)),N.on(this._element,$a,e=>this._onInteraction(e,!0)),N.on(this._element,Xa,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=ro.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}})}}H(ro),g(ro)}();var CPe={exports:{}};CPe.exports=function(e){function t(i){if(n[i])return n[i].exports;var a=n[i]={exports:{},id:i,loaded:!1};return e[i].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="dist/",t(0)}([function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},o=(i(n(1)),n(6)),s=i(o),r=i(n(7)),l=i(n(8)),c=i(n(9)),u=i(n(10)),h=i(n(11)),d=i(n(14)),f=[],p=!1,g={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,startEvent:"DOMContentLoaded",throttleDelay:99,debounceDelay:50,disableMutationObserver:!1},m=function(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(p=!0),p)return f=(0,h.default)(f,g),(0,u.default)(f,g.once),f},v=function(){f=(0,d.default)(),m()},y=function(){f.forEach(function(e,t){e.node.removeAttribute("data-aos"),e.node.removeAttribute("data-aos-easing"),e.node.removeAttribute("data-aos-duration"),e.node.removeAttribute("data-aos-delay")})},b=function(e){return!0===e||"mobile"===e&&c.default.mobile()||"phone"===e&&c.default.phone()||"tablet"===e&&c.default.tablet()||"function"==typeof e&&!0===e()},_=function(e){g=a(g,e),f=(0,d.default)();var t=document.all&&!window.atob;return b(g.disable)||t?y():(g.disableMutationObserver||l.default.isSupported()||(g.disableMutationObserver=!0),document.querySelector("body").setAttribute("data-aos-easing",g.easing),document.querySelector("body").setAttribute("data-aos-duration",g.duration),document.querySelector("body").setAttribute("data-aos-delay",g.delay),"DOMContentLoaded"===g.startEvent&&["complete","
5555interactive"].indexOf(document.readyState)>-1?m(!0):"load"===g.startEvent?window.addEventListener(g.startEvent,function(){m(!0)}):document.addEventListener(g.startEvent,function(){m(!0)}),window.addEventListener("resize",(0,r.default)(m,g.debounceDelay,!0)),window.addEventListener("orientationchange",(0,r.default)(m,g.debounceDelay,!0)),window.addEventListener("scroll",(0,s.default)(function(){(0,u.default)(f,g.once)},g.throttleDelay)),g.disableMutationObserver||l.default.ready("[data-aos]",v),f)};e.exports={init:_,refresh:m,refreshHard:v}},function(e,t){},,,,,function(e,t){(function(t){function n(e,t,n){function i(t){var n=g,i=m;return g=m=void 0,T=t,y=e.apply(i,n)}function o(e){return T=e,b=setTimeout(u,t),C?i(e):y}function s(e){var n=t-(e-_);return E?k(n,v-(e-T)):n}function l(e){var n=e-_;return void 0===_||n>=t||n<0||E&&e-T>=v}function u(){var e=x();return l(e)?h(e):void(b=setTimeout(u,s(e)))}function h(e){return b=void 0,S&&g?i(e):(g=m=void 0,y)}function d(){void 0!==b&&clearTimeout(b),T=0,g=_=m=b=void 0}function f(){return void 0===b?y:h(x())}function p(){var e=x(),n=l(e);if(g=arguments,m=this,_=e,n){if(void 0===b)return o(_);if(E)return b=setTimeout(u,t),i(_)}return void 0===b&&(b=setTimeout(u,t)),y}var g,m,v,y,b,_,T=0,C=!1,E=!1,S=!0;if("function"!=typeof e)throw new TypeError(c);return t=r(t)||0,a(n)&&(C=!!n.leading,v=(E="maxWait"in n)?w(r(n.maxWait)||0,t):v,S="trailing"in n?!!n.trailing:S),p.cancel=d,p.flush=f,p}function i(e,t,i){var o=!0,s=!0;if("function"!=typeof e)throw new TypeError(c);return a(i)&&(o="leading"in i?!!i.leading:o,s="trailing"in i?!!i.trailing:s),n(e,t,{leading:o,maxWait:t,trailing:s})}function a(e){var t=void 0===e?"undefined":l(e);return!!e&&("object"==t||"function"==t)}function o(e){return!!e&&"object"==(void 0===e?"undefined":l(e))}function s(e){return"symbol"==(void 0===e?"undefined":l(e))||o(e)&&_.call(e)==h}function r(e){if("number"==typeof e)return e;if(s(e))return u;if(a(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=a(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(d,"");var n=p.test(e);return n||g.test(e)?m(e.slice(2),n?2:8):f.test(e)?u:+e}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c="Expected a function",u=NaN,h="[object Symbol]",d=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,g=/^0o[0-7]+$/i,m=parseInt,v="object"==(void 0===t?"undefined":l(t))&&t&&t.Object===Object&&t,y="object"==("undefined"==typeof self?"undefined":l(self))&&self&&self.Object===Object&&self,b=v||y||Function("return this")(),_=Object.prototype.toString,w=Math.max,k=Math.min,x=function(){return b.Date.now()};e.exports=i}).call(t,function(){return this}())},function(e,t){(function(t){function n(e,t,n){function a(t){var n=g,i=m;return g=m=void 0,T=t,y=e.apply(i,n)}function o(e){return T=e,b=setTimeout(u,t),C?a(e):y}function r(e){var n=t-(e-x);return E?w(n,v-(e-T)):n}function c(e){var n=e-x;return void 0===x||n>=t||n<0||E&&e-T>=v}function u(){var e=k();return c(e)?h(e):void(b=setTimeout(u,r(e)))}function h(e){return b=void 0,S&&g?a(e):(g=m=void 0,y)}function d(){void 0!==b&&clearTimeout(b),T=0,g=x=m=b=void 0}function f(){return void 0===b?y:h(k())}function p(){var e=k(),n=c(e);if(g=arguments,m=this,x=e,n){if(void 0===b)return o(x);if(E)return b=setTimeout(u,t),a(x)}return void 0===b&&(b=setTimeout(u,t)),y}var g,m,v,y,b,x,T=0,C=!1,E=!1,S=!0;if("function"!=typeof e)throw new TypeError(l);return t=s(t)||0,i(n)&&(C=!!n.leading,v=(E="maxWait"in n)?_(s(n.maxWait)||0,t):v,S="trailing"in n?!!n.trailing:S),p.cancel=d,p.flush=f,p}function i(e){var t=void 0===e?"undefined":r(e);return!!e&&("object"==t||"function"==t)}function a(e){return!!e&&"object"==(void 0===e?"undefined":r(e))}function o(e){return"symbol"==(void 0===e?"undefined":r(e))||a(e)&&b.call(e)==u}function s(e){if("number"==typeof e)return e;if(o(e))return c;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(h,"");var n=f.test(e);return n||p.test(e)?g(e.slice(2),n?2:8):d.test(e)?c:+e}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l="Expected a function",c=NaN,u="[object Symbol]",h=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,p=/^0o[0-7]+$/i,g=parseInt,m="object"==(void 0===t?"undefined":r(t))&&t&&t.Object===Object&&t,v="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,y=m||v||Function("return this")(),b=Object.prototype.toString,_=Math.max,w=Math.min,k=function(){return y.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t){function n(e){var t=void 0,i=void 0;for(t=0;t<e.length;t+=1){if((i=e[t]).dataset&&i.dataset.aos)return!0;
5555if(i.children&&n(i.children))return!0}return!1}function i(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function a(){return!!i()}function o(e,t){var n=window.document,a=new(i())(s);r=t,a.observe(n.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}function s(e){e&&e.forEach(function(e){var t=Array.prototype.slice.call(e.addedNodes),i=Array.prototype.slice.call(e.removedNodes);if(n(t.concat(i)))return r()})}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){};t.default={isSupported:a,ready:o}},function(e,t){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(){return navigator.userAgent||navigator.vendor||window.opera||""}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,s=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,r=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,l=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
5555sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,c=function(){function e(){n(this,e)}return a(e,[{key:"phone",value:function(){var e=i();return!(!o.test(e)&&!s.test(e.substr(0,4)))}},{key:"mobile",value:function(){var e=i();return!(!r.test(e)&&!l.test(e.substr(0,4)))}},{key:"tablet",value:function(){return this.mobile()&&!this.phone()}}]),e}();t.default=new c},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,n){var i=e.node.getAttribute("data-aos-once");t>e.position?e.node.classList.add("aos-animate"):void 0!==i&&("false"===i||!n&&"true"!==i)&&e.node.classList.remove("aos-animate")},i=function(e,t){var i=window.pageYOffset,a=window.innerHeight;e.forEach(function(e,o){n(e,a+i,t)})};t.default=i},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(n(12)),o=function(e,t){return e.forEach(function(e,n){e.node.classList.add("aos-init"),e.position=(0,a.default)(e.node,t.offset)}),e};t.default=o},function(e,t,n){function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(n(13)),o=function(e,t){var n=0,i=0,o=window.innerHeight,s={offset:e.getAttribute("data-aos-offset"),anchor:e.getAttribute("data-aos-anchor"),anchorPlacement:e.getAttribute("data-aos-anchor-placement")};switch(s.offset&&!isNaN(s.offset)&&(i=parseInt(s.offset)),s.anchor&&document.querySelectorAll(s.anchor)&&(e=document.querySelectorAll(s.anchor)[0]),n=(0,a.default)(e).top,s.anchorPlacement){case"top-bottom":break;case"center-bottom":n+=e.offsetHeight/2;break;case"bottom-bottom":n+=e.offsetHeight;break;case"top-center":n+=o/2;break;case"bottom-center":n+=o/2+e.offsetHeight;break;case"center-center":n+=o/2+e.offsetHeight/2;break;case"top-top":n+=o;break;case"bottom-top":n+=e.offsetHeight+o;break;case"center-top":n+=e.offsetHeight/2+o}return s.anchorPlacement||s.offset||isNaN(t)||(i=t),n+i};t.default=o},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-("BODY"!=e.tagName?e.scrollLeft:0),n+=e.offsetTop-("BODY"!=e.tagName?e.scrollTop:0),e=e.offsetParent;return{top:n,left:t}};t.default=n},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e=e||document.querySelectorAll("[data-aos]"),Array.prototype.map.call(e,function(e){return{node:e}})};t.default=n}]);const EPe=IT(CPe.exports);function SPe(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e} 5556/*! 5557 * Splide.js 5558 * Version : 4.1.3 5559 * License : MIT 5560 * Copyright: 2022 Naotoshi Fujita 5561 */var IPe="(prefers-reduced-motion: reduce)",APe={CREATED:1,MOUNTED:2,IDLE:3,MOVING:4,SCROLLING:5,DRAGGING:6,DESTROYED:7};function DPe(e){e.length=0}function PPe(e,t,n){return Array.prototype.slice.call(e,t,n)}function OPe(e){return e.bind.apply(e,[null].concat(PPe(arguments,1)))}var MPe=setTimeout,NPe=function(){};function RPe(e){return requestAnimationFrame(e)}function LPe(e,t){return typeof t===e}function VPe(e){return!jPe(e)&&LPe("object",e)}var qPe=Array.isArray,FPe=OPe(LPe,"function"),BPe=OPe(LPe,"string"),UPe=OPe(LPe,"undefined");function jPe(e){return null===e}function HPe(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch(ZNe){return!1}}function zPe(e){return qPe(e)?e:[e]}function WPe(e,t){zPe(e).forEach(t)}function KPe(e,t){return e.indexOf(t)>-1}function GPe(e,t){return e.push.apply(e,zPe(t)),e}function YPe(e,t,n){e&&WPe(t,function(t){t&&e.classList[n?"add":"remove"](t)})}function QPe(e,t){YPe(e,BPe(t)?t.split(" "):t,!0)}function $Pe(e,t){WPe(t,e.appendChild.bind(e))}function XPe(e,t){WPe(e,function(e){var n=(t||e).parentNode;n&&n.insertBefore(e,t)})}function JPe(e,t){return HPe(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function ZPe(e,t){var n=e?PPe(e.children):[];return t?n.filter(function(e){return JPe(e,t)}):n}function eOe(e,t){return t?ZPe(e,t)[0]:e.firstElementChild}var tOe=Object.keys;
vendor: 26,391 bytes, line 5561
5561function nOe(e,t,n){return e&&(n?tOe(e).reverse():tOe(e)).forEach(function(n){"__proto__"!==n&&t(e[n],n)}),e}function iOe(e){return PPe(arguments,1).forEach(function(t){nOe(t,function(n,i){e[i]=t[i]})}),e}function aOe(e){return PPe(arguments,1).forEach(function(t){nOe(t,function(t,n){qPe(t)?e[n]=t.slice():VPe(t)?e[n]=aOe({},VPe(e[n])?e[n]:{},t):e[n]=t})}),e}function oOe(e,t){WPe(t||tOe(e),function(t){delete e[t]})}function sOe(e,t){WPe(e,function(e){WPe(t,function(t){e&&e.removeAttribute(t)})})}function rOe(e,t,n){VPe(t)?nOe(t,function(t,n){rOe(e,n,t)}):WPe(e,function(e){jPe(n)||""===n?sOe(e,t):e.setAttribute(t,String(n))})}function lOe(e,t,n){var i=document.createElement(e);return t&&(BPe(t)?QPe(i,t):rOe(i,t)),n&&$Pe(n,i),i}function cOe(e,t,n){if(UPe(n))return getComputedStyle(e)[t];jPe(n)||(e.style[t]=""+n)}function uOe(e,t){cOe(e,"display",t)}function hOe(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function dOe(e,t){return e.getAttribute(t)}function fOe(e,t){return e&&e.classList.contains(t)}function pOe(e){return e.getBoundingClientRect()}function gOe(e){WPe(e,function(e){e&&e.parentNode&&e.parentNode.removeChild(e)})}function mOe(e){return eOe((new DOMParser).parseFromString(e,"text/html").body)}function vOe(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function yOe(e,t){return e&&e.querySelector(t)}function bOe(e,t){return t?PPe(e.querySelectorAll(t)):[]}function _Oe(e,t){YPe(e,t,!1)}function wOe(e){return e.timeStamp}function kOe(e){return BPe(e)?e:e?e+"px":""}var xOe="splide",TOe="data-"+xOe;function COe(e,t){if(!e)throw new Error("["+xOe+"] "+(t||""))}var EOe=Math.min,SOe=Math.max,IOe=Math.floor,AOe=Math.ceil,DOe=Math.abs;function POe(e,t,n){return DOe(e-t)<n}function OOe(e,t,n,i){var a=EOe(t,n),o=SOe(t,n);return i?a<e&&e<o:a<=e&&e<=o}function MOe(e,t,n){var i=EOe(t,n),a=SOe(t,n);return EOe(SOe(i,e),a)}function NOe(e){return+(e>0)-+(e<0)}function ROe(e,t){return WPe(t,function(t){e=e.replace("%s",""+t)}),e}function LOe(e){return e<10?"0"+e:""+e}var VOe={};function qOe(){var e=[];function t(e,t,n){WPe(e,function(e){e&&WPe(t,function(t){t.split(" ").forEach(function(t){var i=t.split(".");n(e,i[0],i[1])})})})}return{bind:function(n,i,a,o){t(n,i,function(t,n,i){var s="addEventListener"in t,r=s?t.removeEventListener.bind(t,n,a,o):t.removeListener.bind(t,a);s?t.addEventListener(n,a,o):t.addListener(a),e.push([t,n,i,a,r])})},unbind:function(n,i,a){t(n,i,function(t,n,i){e=e.filter(function(e){return!!(e[0]!==t||e[1]!==n||e[2]!==i||a&&e[3]!==a)||(e[4](),!1)})})},dispatch:function(e,t,n){var i,a=!0;return"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:a,detail:n}):(i=document.createEvent("CustomEvent")).initCustomEvent(t,a,!1,n),e.dispatchEvent(i),i},destroy:function(){e.forEach(function(e){e[4]()}),DPe(e)}}}var FOe="mounted",BOe="ready",UOe="move",jOe="moved",HOe="click",zOe="active",WOe="inactive",KOe="visible",GOe="hidden",YOe="refresh",QOe="updated",$Oe="resize",XOe="resized",JOe="drag",ZOe="dragging",eMe="dragged",tMe="scroll",nMe="scrolled",iMe="destroy",aMe="arrows:mounted",oMe="arrows:updated",sMe="pagination:mounted",rMe="pagination:updated",lMe="navigation:mounted",cMe="autoplay:play",uMe="autoplay:playing",hMe="autoplay:pause",dMe="lazyload:loaded",fMe="sk",pMe="sh",gMe="ei";function mMe(e){var t=e?e.event.bus:document.createDocumentFragment(),n=qOe();return e&&e.event.on(iMe,n.destroy),iOe(n,{bus:t,on:function(e,i){n.bind(t,zPe(e).join(" "),function(e){i.apply(i,qPe(e.detail)?e.detail:[])})},off:OPe(n.unbind,t),emit:function(e){n.dispatch(t,e,PPe(arguments,1))}})}function vMe(e,t,n,i){var a,o,s=Date.now,r=0,l=!0,c=0;function u(){if(!l){if(r=e?EOe((s()-a)/e,1):1,n&&n(r),r>=1&&(t(),a=s(),i&&++c>=i))return h();o=RPe(u)}}function h(){l=!0}function d(){o&&cancelAnimationFrame(o),r=0,o=0,l=!0}return{start:function(t){t||d(),a=s()-(t?r*e:0),l=!1,o=RPe(u)},rewind:function(){a=s(),r=0,n&&n(r)},pause:h,cancel:d,set:function(t){e=t},isPaused:function(){return l}}}var yMe="Arrow",bMe=yMe+"Left",_Me=yMe+"Right",wMe=yMe+"Up",kMe=yMe+"Down",xMe="ttb",TMe={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[wMe,_Me],ArrowRight:[kMe,bMe]};var CMe="role",EMe="tabindex",SMe="aria-",IMe=SMe+"controls",AMe=SMe+"current",DMe=SMe+"selected",PMe=SMe+"label",OMe=SMe+"labelledby",MMe=SMe+"hidden",NMe=SMe+"orientation",RMe=SMe+"roledescription",LMe=SMe+"live",VMe=SMe+"busy",qMe=SMe+"atomic",FMe=[CMe,EMe,"disabled",IMe,AMe,PMe,OMe,MMe,NMe,RMe],BMe=xOe+"__",UMe="is-",jMe=xOe,HMe=BMe+"track",zMe=BMe+"list",WMe=BMe+"slide",KMe=WMe+"--clone",GMe=WMe+"__container",YMe=BMe+"arrows",QMe=BMe+"arrow",$Me=QMe+"--prev",XMe=QMe+"--next",JMe=BMe+"pagination",ZMe=JMe+"__page",eNe=BMe+"progress"+"__bar",tNe=BMe+"toggle",nNe=BMe+"sr",iNe=UMe+"initialized",aNe=UMe+"active",oNe=UMe+"prev",sNe=UMe+"next",rNe=UMe+"visible",lNe=UMe+"loading",cNe=UMe+"focus-in",uNe=UMe+"overflow",hNe=[aNe,rNe,oNe,sNe,lNe,cNe,uNe],dNe={slide:WMe,clone:KMe,arrows:YMe,arrow:QMe,prev:$Me,next:XMe,pagination:JMe,page:ZMe,spinner:BMe+"spinner"};var fNe="touchstart mousedown",pNe="touchmove mousemove",gNe="touchend touchcancel mouseup click";var mNe="slide",vNe="loop",yNe="fade";function bNe(e,t,n,i){var a,o=mMe(e),s=o.on,r=o.emit,l=o.bind,c=e.Components,u=e.root,h=e.options,d=h.isNavigation,f=h.updateOnMove,p=h.i18n,g=h.pagination,m=h.slideFocus,v=c.Direction.resolve,y=dOe(i,"style"),b=dOe(i,PMe),_=n>-1,w=eOe(i,"."+GMe);function k(){var a=e.splides.map(function(e){var n=e.splide.Components.Slides.getAt(t);return n?n.slide.id:""}).join(" ");rOe(i,PMe,ROe(p.slideX,(_?n:t)+1)),rOe(i,IMe,a),rOe(i,CMe,m?"button":""),m&&sOe(i,RMe)}function x(){a||T()}function T(){if(!a){var n=e.index;(o=C())!==fOe(i,aNe)&&(YPe(i,aNe,o),rOe(i,AMe,d&&o||""),r(o?zOe:WOe,E)),function(){var t=function(){if(e.is(yNe))return C();var t=pOe(c.Elements.track),n=pOe(i),a=v("left",!0),o=v("right",!0);return IOe(t[a])<=AOe(n[a])&&IOe(n[o])<=AOe(t[o])}(),n=!t&&(!C()||_);e.state.is([4,5])||rOe(i,MMe,n||"");rOe(bOe(i,h.focusableNodes||""),EMe,n?-1:""),m&&rOe(i,EMe,n?-1:0);t!==fOe(i,rNe)&&(YPe(i,rNe,t),r(t?KOe:GOe,E));if(!t&&document.activeElement===i){var a=c.Slides.getAt(e.index);a&&hOe(a.slide)}}(),YPe(i,oNe,t===n-1),YPe(i,sNe,t===n+1)}var o}function C(){var i=e.index;return i===t||h.cloneStatus&&i===n}var E={index:t,slideIndex:n,slide:i,container:w,isClone:_,mount:function(){_||(i.id=u.id+"-slide"+LOe(t+1),rOe(i,CMe,g?"tabpanel":"group"),rOe(i,RMe,p.slide),rOe(i,PMe,b||ROe(p.slideLabel,[t+1,e.length]))),l(i,"click",OPe(r,HOe,E)),l(i,"keydown",OPe(r,fMe,E)),s([jOe,pMe,nMe],T),s(lMe,k),f&&s(UOe,x)},destroy:function(){a=!0,o.destroy(),_Oe(i,hNe),sOe(i,FMe),rOe(i,"style",y),rOe(i,PMe,b||"")},update:T,style:function(e,t,n){cOe(n&&w||i,e,t)},isWithin:function(n,i){var a=DOe(n-t);return _||!h.rewind&&!e.is(vNe)||(a=EOe(a,e.length-a)),a<=i}};return E}var _Ne=TOe+"-interval";var wNe={passive:!1,capture:!0};var kNe={Spacebar:" ",Right:_Me,Left:bMe,Up:wMe,Down:kMe};function xNe(e){return e=BPe(e)?e:e.key,kNe[e]||e}var TNe="keydown";var CNe=TOe+"-lazy",ENe=CNe+"-srcset",SNe="["+CNe+"], ["+ENe+"]";var INe=[" ","Enter"];var ANe=Object.freeze({__proto__:null,Media:function(e,t,n){var i=e.state,a=n.breakpoints||{},o=n.reducedMotion||{},s=qOe(),r=[];function l(e){e&&s.destroy()}function c(e,t){var n=matchMedia(t);s.bind(n,"change",u),r.push([e,n])}function u(){var t=i.is(7),a=n.direction,o=r.reduce(function(e,t){return aOe(e,t[1].matches?t[0]:{})},{});oOe(n),h(o),n.destroy?e.destroy("completely"===n.destroy):t?(l(!0),e.mount()):a!==n.direction&&e.refresh()}function h(t,a,o){aOe(n,t),a&&aOe(Object.getPrototypeOf(n),t),!o&&i.is(1)||e.emit(QOe,n)}return{setup:function(){var e="min"===n.mediaQuery;tOe(a).sort(function(t,n){return e?+t-+n:+n-+t}).forEach(function(t){c(a[t],"("+(e?"min":"max")+"-width:"+t+"px)")}),c(o,IPe),u()},destroy:l,reduce:function(e){matchMedia(IPe).matches&&(e?aOe(n,o):oOe(n,tOe(o)))},set:h}},Direction:function(e,t,n){return{resolve:function(e,t,i){var a="rtl"!==(i=i||n.direction)||t?i===xMe?0:-1:1;return TMe[e]&&TMe[e][a]||e.replace(/width|left|right/i,function(e,t){var n=TMe[e.toLowerCase()][a]||e;return t>0?n.charAt(0).toUpperCase()+n.slice(1):n})},orient:function(e){return e*("rtl"===n.direction?1:-1)}}},Elements:function(e,t,n){var i,a,o,s=mMe(e),r=s.on,l=s.bind,c=e.root,u=n.i18n,h={},d=[],f=[],p=[];function g(){i=y("."+HMe),a=eOe(i,"."+zMe),COe(i&&a,"A track/list element is missing."),GPe(d,ZPe(a,"."+WMe+":not(."+KMe+")")),nOe({arrows:YMe,pagination:JMe,prev:$Me,next:XMe,bar:eNe,toggle:tNe},function(e,t){h[t]=y("."+e)}),iOe(h,{root:c,track:i,list:a,slides:d}),function(){var e=c.id||(o=xOe,""+o+LOe(VOe[o]=(VOe[o]||0)+1)),t=n.role;var o;c.id=e,i.id=i.id||e+"-track",a.id=a.id||e+"-list",!dOe(c,CMe)&&"SECTION"!==c.tagName&&t&&rOe(c,CMe,t);rOe(c,RMe,u.carousel),rOe(a,CMe,"presentation")}(),v()}function m(e){var t=FMe.concat("style");DPe(d),_Oe(c,f),_Oe(i,p),sOe([i,a],t),sOe(c,e?t:["style",RMe])}function v(){_Oe(c,f),_Oe(i,p),f=b(jMe),p=b(HMe),QPe(c,f),QPe(i,p),rOe(c,PMe,n.label),rOe(c,OMe,n.labelledby)}function y(e){var t=yOe(c,e);return t&&function(e,t){if(FPe(e.closest))return e.closest(t);for(var n=e;n&&1===n.nodeType&&!JPe(n,t);)n=n.parentElement;return n}(t,"."+jMe)===c?t:void 0}function b(e){return[e+"--"+n.type,e+"--"+n.direction,n.drag&&e+"--draggable",n.isNavigation&&e+"--nav",e===jMe&&aNe]}return iOe(h,{setup:g,mount:function(){r(YOe,m),r(YOe,g),r(QOe,v),l(document,fNe+" keydown",function(e){o="keydown"===e.type},{capture:!0}),l(c,"focusin",function(){YPe(c,cNe,!!o)})},destroy:m})},Slides:function(e,t,n){var i=mMe(e),a=i.on,o=i.emit,s=i.bind,r=t.Elements,l=r.slides,c=r.list,u=[];function h(){l.forEach(function(e,t){f(e,t,-1)})}function d(){g(function(e){e.destroy()}),DPe(u)}function f(t,n,i){var a=bNe(e,n,i,t);a.mount(),u.push(a),u.sort(function(e,t){return e.index-t.index})}function p(e){return e?m(function(e){return!e.isClone}):u}function g(e,t){p(t).forEach(e)}function m(e){return u.filter(FPe(e)?e:function(t){return BPe(e)?JPe(t.slide,e):KPe(zPe(e),t.index)})}return{mount:function(){h(),a(YOe,d),a(YOe,h)},destroy:d,update:function(){g(function(e){e.update()})},register:f,get:p,getIn:function(e){var i=t.Controller,a=i.toIndex(e),o=i.hasFocus()?1:n.perPage;return m(function(e){return OOe(e.index,a,a+o-1)})},getAt:function(e){return m(e)[0]},add:function(e,t){WPe(e,function(e){if(BPe(e)&&(e=mOe(e)),HPe(e)){var i=l[t];i?XPe(e,i):$Pe(c,e),QPe(e,n.classes.slide),function(e,t){var n=bOe(e,"img"),i=n.length;i?n.forEach(function(e){s(e,"load error",function(){--i||t()})}):t()}(e,OPe(o,$Oe))}}),o(YOe)},remove:function(e){gOe(m(e).map(function(e){return e.slide})),o(YOe)},forEach:g,filter:m,style:function(e,t,n){g(function(i){i.style(e,t,n)})},getLength:function(e){return e?l.length:u.length},isEnough:function(){return u.length>n.perPage}}},Layout:function(e,t,n){var i,a,o,s=mMe(e),r=s.on,l=s.bind,c=s.emit,u=t.Slides,h=t.Direction.resolve,d=t.Elements,f=d.root,p=d.track,g=d.list,m=u.getAt,v=u.style;function y(){i=n.direction===xMe,cOe(f,"maxWidth",kOe(n.width)),cOe(p,h("paddingLeft"),_(!1)),cOe(p,h("paddingRight"),_(!0)),b(!0)}function b(e){var t=pOe(f);(e||a.width!==t.width||a.height!==t.height)&&(cOe(p,"height",function(){var e="";i&&(COe(e=w(),"height or heightRatio is missing."),e="calc("+e+" - "+_(!1)+" - "+_(!0)+")");return e}()),v(h("marginRight"),kOe(n.gap)),v("width",n.autoWidth?null:kOe(n.fixedWidth)||(i?"":k())),v("height",kOe(n.fixedHeight)||(i?n.autoHeight?null:k():w()),!0),a=t,c(XOe),o!==(o=I())&&(YPe(f,uNe,o),c("overflow",o)))}function _(e){var t=n.padding,i=h(e?"right":"left");return t&&kOe(t[i]||(VPe(t)?0:t))||"0px"}function w(){return kOe(n.height||pOe(g).width*n.heightRatio)}function k(){var e=kOe(n.gap);return"calc((100%"+(e&&" + "+e)+")/"+(n.perPage||1)+(e&&" - "+e)+")"}function x(){return pOe(g)[h("width")]}function T(e,t){var n=m(e||0);return n?pOe(n.slide)[h("width")]+(t?0:S()):0}function C(e,t){var n=m(e);if(n){var i=pOe(n.slide)[h("right")],a=pOe(g)[h("left")];return DOe(i-a)+(t?0:S())}return 0}function E(t){return C(e.length-1)-C(0)+T(0,t)}function S(){var e=m(0);return e&&parseFloat(cOe(e.slide,h("marginRight")))||0}function I(){return e.is(yNe)||E(!0)>x()}return{mount:function(){var e,t;y(),l(window,"resize load",(e=OPe(c,$Oe),t=vMe(0,e,null,1),function(){t.isPaused()&&t.start()})),r([QOe,YOe],y),r($Oe,b)},resize:b,listSize:x,slideSize:T,sliderSize:E,totalSize:C,getPadding:function(e){return parseFloat(cOe(p,h("padding"+(e?"Right":"Left"))))||0},isOverflow:I}},Clones:function(e,t,n){var i,a=mMe(e),o=a.on,s=t.Elements,r=t.Slides,l=t.Direction.resolve,c=[];function u(){o(YOe,h),o([QOe,$Oe],f),(i=p())&&(!function(t){var i=r.get().slice(),a=i.length;if(a){for(;i.length<t;)GPe(i,i);GPe(i.slice(-t),i.slice(0,t)).forEach(function(o,l){var u=l<t,h=function(t,i){var a=t.cloneNode(!0);return QPe(a,n.classes.clone),a.id=e.root.id+"-clone"+LOe(i+1),a}(o.slide,l);u?XPe(h,i[0].slide):$Pe(s.list,h),GPe(c,h),r.register(h,l-t+(u?0:a),o.index)})}}(i),t.Layout.resize(!0))}function h(){d(),u()}function d(){gOe(c),DPe(c),a.destroy()}function f(){var e=p();i!==e&&(i<e||!e)&&a.emit(YOe)}function p(){var i=n.clones;if(e.is(vNe)){if(UPe(i)){var a=n[l("fixedWidth")]&&t.Layout.slideSize(0);i=a&&AOe(pOe(s.track)[l("width")]/a)||n[l("autoWidth")]&&e.length||2*n.perPage}}else i=0;return i}return{mount:u,destroy:d}},Move:function(e,t,n){var i,a=mMe(e),o=a.on,s=a.emit,r=e.state.set,l=t.Layout,c=l.slideSize,u=l.getPadding,h=l.totalSize,d=l.listSize,f=l.sliderSize,p=t.Direction,g=p.resolve,m=p.orient,v=t.Elements,y=v.list,b=v.track;function _(){t.Controller.isBusy()||(t.Scroll.cancel(),w(e.index),t.Slides.update())}function w(e){k(E(e,!0))}function k(n,i){if(!e.is(yNe)){var a=i?n:function(n){if(e.is(vNe)){var i=C(n),a=i>t.Controller.getEnd();(i<0||a)&&(n=x(n,a))}return n}(n);cOe(y,"transform","translate"+g("X")+"("+a+"px)"),n!==a&&s(pMe)}}function x(e,t){var n=e-I(t),i=f();return e-=m(i*(AOe(DOe(n)/i)||1))*(t?1:-1)}function T(){k(S(),!0),i.cancel()}function C(e){for(var n=t.Slides.get(),i=0,a=1/0,o=0;o<n.length;o++){var s=n[o].index,r=DOe(E(s,!0)-e);if(!(r<=a))break;a=r,i=s}return i}function E(t,i){var a=m(h(t-1)-function(e){var t=n.focus;return"center"===t?(d()-c(e,!0))/2:+t*c(e)||0}(t));return i?function(t){n.trimSpace&&e.is(mNe)&&(t=MOe(t,0,m(f(!0)-d())));return t}(a):a}function S(){var e=g("left");return pOe(y)[e]-pOe(b)[e]+m(u(!1))}function I(e){return E(e?t.Controller.getEnd():0,!!n.trimSpace)}return{mount:function(){i=t.Transition,o([FOe,XOe,QOe,YOe],_)},move:function(e,t,n,a){var o,l;e!==t&&(o=e>n,l=m(x(S(),o)),o?l>=0:l<=y[g("scrollWidth")]-pOe(b)[g("width")])&&(T(),k(x(S(),e>n),!0)),r(4),s(UOe,t,n,e),i.start(t,function(){r(3),s(jOe,t,n,e),a&&a()})},jump:w,translate:k,shift:x,cancel:T,toIndex:C,toPosition:E,getPosition:S,getLimit:I,exceededLimit:function(e,t){t=UPe(t)?S():t;var n=!0!==e&&m(t)<m(I(!1)),i=!1!==e&&m(t)>m(I(!0));return n||i},reposition:_}},Controller:function(e,t,n){var i,a,o,s,r=mMe(e),l=r.on,c=r.emit,u=t.Move,h=u.getPosition,d=u.getLimit,f=u.toPosition,p=t.Slides,g=p.isEnough,m=p.getLength,v=n.omitEnd,y=e.is(vNe),b=e.is(mNe),_=OPe(E,!1),w=OPe(E,!0),k=n.start||0,x=k;function T(){a=m(!0),o=n.perMove,s=n.perPage,i=A();var e=MOe(k,0,v?i:a-1);e!==k&&(k=e,u.reposition())}function C(){i!==A()&&c(gMe)}function E(e,t){var n=o||(M()?1:s),a=S(k+n*(e?-1:1),k,!(o||M()));return-1===a&&b&&!POe(h(),d(!e),1)?e?0:i:t?a:I(a)}function S(t,r,l){if(g()||M()){var c=function(t){if(b&&"move"===n.trimSpace&&t!==k)for(var i=h();i===f(t,!0)&&OOe(t,0,e.length-1,!n.rewind);)t<k?--t:++t;return t}(t);c!==t&&(r=t,t=c,l=!1),t<0||t>i?t=o||!OOe(0,t,r,!0)&&!OOe(i,r,t,!0)?y?l?t<0?-(a%s||s):a:t:n.rewind?t<0?i:0:-1:D(P(t)):l&&t!==r&&(t=D(P(r)+(t<r?-1:1)))}else t=-1;return t}function I(e){return y?(e+a)%a||0:e}function A(){for(var e=a-(M()||y&&o?1:s);v&&e-- >0;)if(f(a-1,!0)!==f(e,!0)){e++;break}return MOe(e,0,a-1)}function D(e){return MOe(M()?e:s*e,0,i)}function P(e){return M()?EOe(e,i):IOe((e>=i?a-1:e)/s)}function O(e){e!==k&&(x=k,k=e)}function M(){return!UPe(n.focus)||n.isNavigation}function N(){return e.state.is([4,5])&&!!n.waitForTransition}return{mount:function(){T(),l([QOe,YOe,gMe],T),l(XOe,C)},go:function(e,t,n){if(!N()){var a=function(e){var t=k;if(BPe(e)){var n=e.match(/([+\-<>])(\d+)?/)||[],a=n[1],o=n[2];"+"===a||"-"===a?t=S(k+ +(""+a+(+o||1)),k):">"===a?t=o?D(+o):_(!0):"<"===a&&(t=w(!0))}else t=y?e:MOe(e,0,i);return t}(e),o=I(a);o>-1&&(t||o!==k)&&(O(o),u.move(a,o,x,n))}},scroll:function(e,n,a,o){t.Scroll.scroll(e,n,a,function(){var e=I(u.toIndex(h()));O(v?EOe(e,i):e),o&&o()})},getNext:_,getPrev:w,getAdjacent:E,getEnd:A,setIndex:O,getIndex:function(e){return e?x:k},toIndex:D,toPage:P,toDest:function(e){var t=u.toIndex(e);return b?MOe(t,0,i):t},hasFocus:M,isBusy:N}},Arrows:function(e,t,n){var i,a,o=mMe(e),s=o.on,r=o.bind,l=o.emit,c=n.classes,u=n.i18n,h=t.Elements,d=t.Controller,f=h.arrows,p=h.track,g=f,m=h.prev,v=h.next,y={};function b(){!function(){var e=n.arrows;!e||m&&v||(g=f||lOe("div",c.arrows),m=x(!0),v=x(!1),i=!0,$Pe(g,[m,v]),!f&&XPe(g,p));m&&v&&(iOe(y,{prev:m,next:v}),uOe(g,e?"":"none"),QPe(g,a=YMe+"--"+n.direction),e&&(s([FOe,jOe,YOe,nMe,gMe],T),r(v,"click",OPe(k,">")),r(m,"click",OPe(k,"<")),T(),rOe([m,v],IMe,p.id),l(aMe,m,v)))}(),s(QOe,_)}function _(){w(),b()}function w(){o.destroy(),_Oe(g,a),i?(gOe(f?[m,v]:g),m=v=null):sOe([m,v],FMe)}function k(e){d.go(e,!0)}function x(e){return mOe('<button class="'+c.arrow+" "+(e?c.prev:c.next)+'" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40" focusable="false"><path d="'+(n.arrowPath||"m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z")+'" />')}function T(){if(m&&v){var t=e.index,n=d.getPrev(),i=d.getNext(),a=n>-1&&t<n?u.last:u.prev,o=i>-1&&t>i?u.first:u.next;m.disabled=n<0,v.disabled=i<0,rOe(m,PMe,a),rOe(v,PMe,o),l(oMe,m,v,n,i)}}return{arrows:y,mount:b,destroy:w,update:T}},Autoplay:function(e,t,n){var i,a,o=mMe(e),s=o.on,r=o.bind,l=o.emit,c=vMe(n.interval,e.go.bind(e,">"),function(e){var t=h.bar;t&&cOe(t,"width",100*e+"%"),l(uMe,e)}),u=c.isPaused,h=t.Elements,d=t.Elements,f=d.root,p=d.toggle,g=n.autoplay,m="pause"===g;function v(){u()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),a=i=m=!1,_(),l(cMe))}function y(e){void 0===e&&(e=!0),m=!!e,_(),u()||(c.pause(),l(hMe))}function b(){m||(i||a?y(!1):v())}function _(){p&&(YPe(p,aNe,!m),rOe(p,PMe,n.i18n[m?"play":"pause"]))}function w(e){var i=t.Slides.getAt(e);c.set(i&&+dOe(i.slide,_Ne)||n.interval)}return{mount:function(){g&&(!function(){n.pauseOnHover&&r(f,"mouseenter mouseleave",function(e){i="mouseenter"===e.type,b()});n.pauseOnFocus&&r(f,"focusin focusout",function(e){a="focusin"===e.type,b()});p&&r(p,"click",function(){m?v():y(!0)});s([UOe,tMe,YOe],c.rewind),s(UOe,w)}(),p&&rOe(p,IMe,h.track.id),m||v(),_())},destroy:c.cancel,play:v,pause:y,isPaused:u}},Cover:function(e,t,n){var i=mMe(e).on;function a(e){t.Slides.forEach(function(t){var n=eOe(t.container||t.slide,"img");n&&n.src&&o(e,n,t)})}function o(e,t,n){n.style("background",e?'center/cover no-repeat url("'+t.src+'")':"",!0),uOe(t,e?"none":"")}return{mount:function(){n.cover&&(i(dMe,OPe(o,!0)),i([FOe,QOe,YOe],OPe(a,!0)))},destroy:OPe(a,!1)}},Scroll:function(e,t,n){var i,a,o=mMe(e),s=o.on,r=o.emit,l=e.state.set,c=t.Move,u=c.getPosition,h=c.getLimit,d=c.exceededLimit,f=c.translate,p=e.is(mNe),g=1;function m(e,n,o,s,h){var f=u();if(b(),o&&(!p||!d())){var m=t.Layout.sliderSize(),_=NOe(e)*m*IOe(DOe(e)/m)||0;e=c.toPosition(t.Controller.toDest(e%m))+_}var w=POe(f,e,1);g=1,n=w?0:n||SOe(DOe(e-f)/1.5,800),a=s,i=vMe(n,v,OPe(y,f,e,h),1),l(5),r(tMe),i.start()}function v(){l(3),a&&a(),r(nMe)}function y(e,t,i,o){var s,r,l=u(),c=(e+(t-e)*(s=o,(r=n.easingFunc)?r(s):1-Math.pow(1-s,4))-l)*g;f(l+c),p&&!i&&d()&&(g*=.6,DOe(c)<10&&m(h(d(!0)),600,!1,a,!0))}function b(){i&&i.cancel()}function _(){i&&!i.isPaused()&&(b(),v())}return{mount:function(){s(UOe,b),s([QOe,YOe],_)},destroy:b,scroll:m,cancel:_}},Drag:function(e,t,n){var i,a,o,s,r,l,c,u,h=mMe(e),d=h.on,f=h.emit,p=h.bind,g=h.unbind,m=e.state,v=t.Move,y=t.Scroll,b=t.Controller,_=t.Elements.track,w=t.Media.reduce,k=t.Direction,x=k.resolve,T=k.orient,C=v.getPosition,E=v.exceededLimit,S=!1;function I(){var e=n.drag;F(!e),s="free"===e}function A(e){if(l=!1,!c){var t=q(e);i=e.target,a=n.noDrag,JPe(i,"."+ZMe+", ."+QMe)||a&&JPe(i,a)||!t&&e.button||(b.isBusy()?vOe(e,!0):(u=t?_:window,r=m.is([4,5]),o=null,p(u,pNe,D,wNe),p(u,gNe,P,wNe),v.cancel(),y.cancel(),M(e)))}var i,a}function D(t){if(m.is(6)||(m.set(6),f(JOe)),t.cancelable)if(r){v.translate(i+N(t)/(S&&e.is(mNe)?5:1));var a=R(t)>200,o=S!==(S=E());(a||o)&&M(t),l=!0,f(ZOe),vOe(t)}else(function(e){return DOe(N(e))>DOe(N(e,!0))})(t)&&(r=function(e){var t=n.dragMinThreshold,i=VPe(t),a=i&&t.mouse||0,o=(i?t.touch:+t)||10;return DOe(N(e))>(q(e)?o:a)}(t),vOe(t))}function P(i){m.is(6)&&(m.set(3),f(eMe)),r&&(!function(i){var a=function(t){if(e.is(vNe)||!S){var n=R(t);if(n&&n<200)return N(t)/n}return 0}(i),o=function(e){return C()+NOe(e)*EOe(DOe(e)*(n.flickPower||600),s?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}(a),r=n.rewind&&n.rewindByDrag;w(!1),s?b.scroll(o,0,n.snap):e.is(yNe)?b.go(T(NOe(a))<0?r?"<":"-":r?">":"+"):e.is(mNe)&&S&&r?b.go(E(!0)?">":"<"):b.go(b.toDest(o),!0);w(!0)}(i),vOe(i)),g(u,pNe,D),g(u,gNe,P),r=!1}function O(e){!c&&l&&vOe(e,!0)}function M(e){o=a,a=e,i=C()}function N(e,t){return V(e,t)-V(L(e),t)}function R(e){return wOe(e)-wOe(L(e))}function L(e){return a===e&&o||a}function V(e,t){return(q(e)?e.changedTouches[0]:e)["page"+x(t?"Y":"X")]}function q(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}function F(e){c=e}return{mount:function(){p(_,pNe,NPe,wNe),p(_,gNe,NPe,wNe),p(_,fNe,A,wNe),p(_,"click",O,{capture:!0}),p(_,"dragstart",vOe),d([FOe,QOe],I)},disable:F,isDragging:function(){return r}}},Keyboard:function(e,t,n){var i,a,o=mMe(e),s=o.on,r=o.bind,l=o.unbind,c=e.root,u=t.Direction.resolve;function h(){var e=n.keyboard;e&&(i="global"===e?window:c,r(i,TNe,p))}function d(){l(i,TNe)}function f(){var e=a;a=!0,MPe(function(){a=e})}function p(t){if(!a){var n=xNe(t);n===u(bMe)?e.go("<"):n===u(_Me)&&e.go(">")}}return{mount:function(){h(),s(QOe,d),s(QOe,h),s(UOe,f)},destroy:d,disable:function(e){a=e}}},LazyLoad:function(e,t,n){var i=mMe(e),a=i.on,o=i.off,s=i.bind,r=i.emit,l="sequential"===n.lazyLoad,c=[jOe,nMe],u=[];function h(){DPe(u),t.Slides.forEach(function(e){bOe(e.slide,SNe).forEach(function(t){var i=dOe(t,CNe),a=dOe(t,ENe);if(i!==t.src||a!==t.srcset){var o=n.classes.spinner,s=t.parentElement,r=eOe(s,"."+o)||lOe("span",o,s);u.push([t,e,r]),t.src||uOe(t,"none")}})}),l?g():(o(c),a(c,d),d())}function d(){(u=u.filter(function(t){var i=n.perPage*((n.preloadPages||1)+1)-1;return!t[1].isWithin(e.index,i)||f(t)})).length||o(c)}function f(e){var t=e[0];QPe(e[1].slide,lNe),s(t,"load error",OPe(p,e)),rOe(t,"src",dOe(t,CNe)),rOe(t,"srcset",dOe(t,ENe)),sOe(t,CNe),sOe(t,ENe)}function p(e,t){var n=e[0],i=e[1];_Oe(i.slide,lNe),"error"!==t.type&&(gOe(e[2]),uOe(n,""),r(dMe,n,i),r($Oe)),l&&g()}function g(){u.length&&f(u.shift())}return{mount:function(){n.lazyLoad&&(h(),a(YOe,h))},destroy:OPe(DPe,u),check:d}},Pagination:function(e,t,n){var i,a,o=mMe(e),s=o.on,r=o.emit,l=o.bind,c=t.Slides,u=t.Elements,h=t.Controller,d=h.hasFocus,f=h.getIndex,p=h.go,g=t.Direction.resolve,m=u.pagination,v=[];function y(){i&&(gOe(m?PPe(i.children):i),_Oe(i,a),DPe(v),i=null),o.destroy()}function b(e){p(">"+e,!0)}function _(e,t){var n=v.length,i=xNe(t),a=w(),o=-1;i===g(_Me,!1,a)?o=++e%n:i===g(bMe,!1,a)?o=(--e+n)%n:"Home"===i?o=0:"End"===i&&(o=n-1);var s=v[o];s&&(hOe(s.button),p(">"+o),vOe(t,!0))}function w(){return n.paginationDirection||n.direction}function k(e){return v[h.toPage(e)]}function x(){var e=k(f(!0)),t=k(f());if(e){var n=e.button;_Oe(n,aNe),sOe(n,DMe),rOe(n,EMe,-1)}if(t){var a=t.button;QPe(a,aNe),rOe(a,DMe,!0),rOe(a,EMe,"")}r(rMe,{list:i,items:v},e,t)}return{items:v,mount:function t(){y(),s([QOe,YOe,gMe],t);var o=n.pagination;m&&uOe(m,o?"":"none"),o&&(s([UOe,tMe,nMe],x),function(){var t=e.length,o=n.classes,s=n.i18n,r=n.perPage,f=d()?h.getEnd()+1:AOe(t/r);QPe(i=m||lOe("ul",o.pagination,u.track.parentElement),a=JMe+"--"+w()),rOe(i,CMe,"tablist"),rOe(i,PMe,s.select),rOe(i,NMe,w()===xMe?"vertical":"");for(var p=0;p<f;p++){var g=lOe("li",null,i),y=lOe("button",{class:o.page,type:"button"},g),k=c.getIn(p).map(function(e){return e.slide.id}),x=!d()&&r>1?s.pageX:s.slideX;l(y,"click",OPe(b,p)),n.paginationKeyboard&&l(y,"keydown",OPe(_,p)),rOe(g,CMe,"presentation"),rOe(y,CMe,"tab"),rOe(y,IMe,k.join(" ")),rOe(y,PMe,ROe(x,p+1)),rOe(y,EMe,-1),v.push({li:g,button:y,page:p})}}(),x(),r(sMe,{list:i,items:v},k(e.index)))},destroy:y,getAt:k,update:x}},Sync:function(e,t,n){var i=n.isNavigation,a=n.slideFocus,o=[];function s(){var t,n;e.splides.forEach(function(t){t.isParent||(l(e,t.splide),l(t.splide,e))}),i&&(t=mMe(e),(n=t.on)(HOe,u),n(fMe,h),n([FOe,QOe],c),o.push(t),t.emit(lMe,e.splides))}function r(){o.forEach(function(e){e.destroy()}),DPe(o)}function l(e,t){var n=mMe(e);n.on(UOe,function(e,n,i){t.go(t.is(vNe)?i:e)}),o.push(n)}function c(){rOe(t.Elements.list,NMe,n.direction===xMe?"vertical":"")}function u(t){e.go(t.index)}function h(e,t){KPe(INe,xNe(t))&&(u(e),vOe(t))}return{setup:OPe(t.Media.set,{slideFocus:UPe(a)?i:a},!0),mount:s,destroy:r,remount:function(){r(),s()}}},Wheel:function(e,t,n){var i=mMe(e).bind,a=0;function o(i){if(i.cancelable){var o=i.deltaY,s=o<0,r=wOe(i),l=n.wheelMinThreshold||0,c=n.wheelSleep||0;DOe(o)>l&&r-a>c&&(e.go(s?"<":">"),a=r),function(i){return!n.releaseWheel||e.state.is(4)||-1!==t.Controller.getAdjacent(i)}(s)&&vOe(i)}}return{mount:function(){n.wheel&&i(t.Elements.track,"wheel",o,wNe)}}},Live:function(e,t,n){var i=mMe(e).on,a=t.Elements.track,o=n.live&&!n.isNavigation,s=lOe("span",nNe),r=vMe(90,OPe(l,!1));function l(e){rOe(a,VMe,e),e?($Pe(a,s),r.start()):(gOe(s),r.cancel())}function c(e){o&&rOe(a,LMe,e?"off":"polite")}return{mount:function(){o&&(c(!t.Autoplay.isPaused()),rOe(a,qMe,!0),s.textContent="â¦",i(cMe,OPe(c,!0)),i(hMe,OPe(c,!1)),i([jOe,nMe],OPe(l,!0)))},disable:c,destroy:function(){sOe(a,[LMe,qMe,VMe]),gOe(s)}}}}),DNe={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace
5561:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:dNe,i18n:{prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function PNe(e,t,n){var i=t.Slides;function a(){i.forEach(function(e){e.style("transform","translateX(-"+100*e.index+"%)")})}return{mount:function(){mMe(e).on([FOe,YOe],a)},start:function(e,t){i.style("transition","opacity "+n.speed+"ms "+n.easing),MPe(t)},cancel:NPe}}function ONe(e,t,n){var i,a=t.Move,o=t.Controller,s=t.Scroll,r=t.Elements.list,l=OPe(cOe,r,"transition");function c(){l(""),s.cancel()}return{mount:function(){mMe(e).bind(r,"transitionend",function(e){e.target===r&&i&&(c(),i())})},start:function(t,r){var c=a.toPosition(t,!0),u=a.getPosition(),h=function(t){var i=n.rewindSpeed;if(e.is(mNe)&&i){var a=o.getIndex(!0),s=o.getEnd();if(0===a&&t>=s||a>=s&&0===t)return i}return n.speed}(t);DOe(c-u)>=1&&h>=1?n.useScroll?s.scroll(c,h,!1,r):(l("transform "+h+"ms "+n.easing),a.translate(c,!0),i=r):(a.jump(t),r())},cancel:c}}var MNe=function(){function e(t,n){var i;this.event=mMe(),this.Components={},this.state=(i=1,{set:function(e){i=e},is:function(e){return KPe(zPe(e),i)}}),this.splides=[],this._o={},this._E={};var a=BPe(t)?yOe(document,t):t;COe(a,a+" is invalid."),this.root=a,n=aOe({label:dOe(a,PMe)||"",labelledby:dOe(a,OMe)||""},DNe,e.defaults,n||{});try{aOe(n,JSON.parse(dOe(a,TOe)))}catch(ZNe){COe(!1,"Invalid JSON")}this._o=Object.create(aOe({},n))}var t=e.prototype;return t.mount=function(e,t){var n=this,i=this.state,a=this.Components;return COe(i.is([1,7]),"Already mounted!"),i.set(1),this._C=a,this._T=t||this._T||(this.is(yNe)?PNe:ONe),this._E=e||this._E,nOe(iOe({},ANe,this._E,{Transition:this._T}),function(e,t){var i=e(n,a,n._o);a[t]=i,i.setup&&i.setup()}),nOe(a,function(e){e.mount&&e.mount()}),this.emit(FOe),QPe(this.root,iNe),i.set(3),this.emit(BOe),this},t.sync=function(e){return this.splides.push({splide:e}),e.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this._C.Sync.remount(),e.Components.Sync.remount()),this},t.go=function(e){return this._C.Controller.go(e),this},t.on=function(e,t){return this.event.on(e,t),this},t.off=function(e){return this.event.off(e),this},t.emit=function(e){var t;return(t=this.event).emit.apply(t,[e].concat(PPe(arguments,1))),this},t.add=function(e,t){return this._C.Slides.add(e,t),this},t.remove=function(e){return this._C.Slides.remove(e),this},t.is=function(e){return this._o.type===e},t.refresh=function(){return this.emit(YOe),this},t.destroy=function(e){void 0===e&&(e=!0);var t=this.event,n=this.state;return n.is(1)?mMe(this).on(BOe,this.destroy.bind(this,e)):(nOe(this._C,function(t){t.destroy&&t.destroy(e)},!0),t.emit(iMe),t.destroy(),e&&DPe(this.splides),n.set(7)),this},SPe(e,[{key:"options",get:function(){return this._o},set:function(e){this._C.Media.set(e,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e}(),NNe=MNe;NNe.defaults={},NNe.STATES=APe;const RNe=[zOe,aMe,oMe,hMe,cMe,uMe,HOe,iMe,JOe,eMe,ZOe,GOe,WOe,dMe,FOe,UOe,jOe,lMe,sMe,rMe,YOe,$Oe,XOe,tMe,nMe,QOe,KOe],LNe="splide";function VNe(e){return null!==e&&"object"==typeof e}function qNe(e,t){const n=e;return function(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const a=n[i];if("__proto__"!==a&&!1===t(e[a],a))break}}}(t,(e,t)=>{Array.isArray(e)?n[t]=e.slice():VNe(e)?n[t]=qNe(VNe(n[t])?n[t]:{},e):n[t]=e}),n}const FNe=(e,t)=>{const n=e.__vccOpts||e;for(const[i,a]of t)n[i]=a;return n},BNe={class:"splide__track"},UNe={class:"splide__list"};const jNe=FNe(jn({name:"SplideTrack",setup(){ni(()=>{var e;const t=Hi(LNe);null==(e=null==t?void 0:t.value)||e.refresh()})}}),[["render",function(e,t,n,i,a,o){return Ma(),Va("div",BNe,[Ha("ul",UNe,[vi(e.$slots,"default")])])}]]),HNe=jn({name:"Splide",emits:RNe.map(e=>"splide:".concat(e)),components:{SplideTrack:jNe},props:{tag:{default:"div",type:String},options:{default:{},type:Object},extensions:Object,transition:Function,hasTrack:{default:!0,type:Boolean}}
5561,setup(e,t){const n=It(),i=It();ei(()=>{var a;i.value&&(n.value=new NNe(i.value,e.options),a=n.value,RNe.forEach(e=>{a.on(e,(...n)=>{t.emit("splide:".concat(e),a,...n)})}),n.value.mount(e.extensions,e.transition))}),ii(()=>{var e;null==(e=n.value)||e.destroy()}),pa(()=>qNe({},e.options),e=>{n.value&&(n.value.options=e)},{deep:!0}),ji(LNe,n);const a=bo(()=>{var e;return(null==(e=n.value)?void 0:e.index)||0}),o=bo(()=>{var e;return(null==(e=n.value)?void 0:e.length)||0});return{splide:n,root:i,index:a,length:o,go:function(e){var t;null==(t=n.value)||t.go(e)},sync:function(e){var t;null==(t=n.value)||t.sync(e)}}}});const zNe=FNe(HNe,[["render",function(e,t,n,i,a,o){const s=ui("SplideTrack");return Ma(),qa(di(e.tag),{class:"splide",ref:"root"},{default:pn(()=>[e.hasTrack?(Ma(),qa(s,{key:0},{default:pn(()=>[vi(e.$slots,"default")]),_:3})):vi(e.$slots,"default",{key:1})]),_:3},512)}]]),WNe={class:"splide__slide"};const KNe=FNe(jn({name:"SplideSlide"}),[["render",function(e,t,n,i,a,o){return Ma(),Va("li",WNe,[vi(e.$slots,"default")])}]]);let GNe=0;const YNe=new Set,QNe=e=>String(null!=e?e:"").slice(0,2e3),$Ne=async(e,t="")=>{var n,i,a,o;try{if(!rT.currentUser)return;if(GNe>=20)return;const s=QNe((null==e?void 0:e.message)||e),r=QNe((null==e?void 0:e.stack)||""),l="".concat(t,"|").concat(s);if(YNe.has(l))return;YNe.add(l),GNe+=1,await kk(cw(sT,"nhat_ky_loi"),{thongdiep:s,nganxep:r,boicanh:t,donvi:(null==(a=null==(i=null==(n=iPe.currentRoute)?void 0:n.value)?void 0:i.params)?void 0:a.don_vi)||"",duongdan:QNe(null==(o=window.location)?void 0:o.pathname),trinhduyet:QNe(null==navigator?void 0:navigator.userAgent),nguoidung:rT.currentUser.uid,taoluc:new Date})}catch(ZNe){}};EPe.init();const XNe=((...e)=>{const t=Ps().createApp(...e),{mount:n}=t;return t.mount=e=>{const i=function(e){if(_(e)){return document.querySelector(e)}return e}(e);if(!i)return;const a=t._component;b(a)||a.render||a.template||(a.template=i.innerHTML),1===i.nodeType&&(i.textContent="");const o=n(i,!1,function(e){if(e instanceof SVGElement)return"svg";if("function"==typeof MathMLElement&&e instanceof MathMLElement)return"mathml"}(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t})(TPe),JNe=function(){const e=se(!0),t=e.run(()=>It({}));let n=[],i=[];const a=Tt({install(e){Ns(a),a._a=e,e.provide(Rs,a),e.config.globalProperties.$pinia=a,i.forEach(e=>n.push(e)),i=[]},use(e){return this._a?n.push(e):i.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return a}();XNe.use(JNe),XNe.use(iPe),XNe.use(function(e,{firebaseApp:t,modules:n=[]}){e.provide(Dj,t);for(const i of n)i(t,e)},{firebaseApp:aT}),XNe.config.errorHandler=(e,t,n)=>{$Ne(e,"vue:".concat(n||""))},window.addEventListener("error",e=>{$Ne(e.error||e.message,"window.error")}),window.addEventListener("unhandledrejection",e=>{$Ne(e.reason,"unhandledrejection")}),"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/firebase-messaging-sw.js").then(e=>{}).catch(e=>{})}),XNe.component("Splide",zNe),XNe.component("SplideSlide",KNe),XNe.mount("#app");export{$he as $,oT as A,eT as B,lT as C,cT as D,uw as E,Sa as F,mk as G,_k as H,Ak as I,bk as J,lre as K,Dve as L,Vl as M,JT as N,Zs as O,wI as P,y1 as Q,Fde as R,Gee as S,i8 as T,ii as U,pa as V,Es as W,za as X,fpe as Y,qa as Z,CC as _,i as __vite_legacy_guard,Va as a,wge as a0,r$ as a1,o$ as a2,uhe as a3,che as a4,f1 as a5,p1 as a6,The as a7,iQ as a8,pQ as a9,an as aa,Ha as b,bo as c,_s as d,gi as e,Ga as f,Qa as g,Jw as h,tk as i,yk as j,cw as k,ik as l,sT as m,Ma as n,ei as o,G as p,$w as q,It as r,ok as s,ee as t,Ot as u,ms as v,gn as w,rT as x,tf as y,Js as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.