110 lines
522 KiB
JavaScript
110 lines
522 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jszip.min-KAUKf24L.js","assets/_commonjsHelpers-Cpj98o6Y.js"])))=>i.map(i=>d[i]);
|
||
var VS=Object.defineProperty;var qS=(n,t,e)=>t in n?VS(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Z=(n,t,e)=>qS(n,typeof t!="symbol"?t+"":t,e);import{c as uc,g as Jm}from"./_commonjsHelpers-Cpj98o6Y.js";const $S="modulepreload",XS=function(n){return"/build/"+n},Rp={},YS=function(t,e,i){let r=Promise.resolve();if(e&&e.length>0){let a=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));r=a(e.map(h=>{if(h=XS(h),h in Rp)return;Rp[h]=!0;const d=h.endsWith(".css"),b=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${b}`))return;const _=document.createElement("link");if(_.rel=d?"stylesheet":$S,d||(_.as="script"),_.crossOrigin="",_.href=h,u&&_.setAttribute("nonce",u),document.head.appendChild(_),d)return new Promise((x,S)=>{_.addEventListener("load",x),_.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return r.then(a=>{for(const l of a||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var co={exports:{}};/**
|
||
* @license
|
||
* Lodash <https://lodash.com/>
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*/var KS=co.exports,Dp;function GS(){return Dp||(Dp=1,function(n,t){(function(){var e,i="4.17.23",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",h=500,d="__lodash_placeholder__",b=1,_=2,x=4,S=1,C=2,T=1,P=2,R=4,B=8,H=16,D=32,L=64,N=128,W=256,V=512,X=30,K="...",Q=800,rt=16,lt=1,ut=2,it=3,ot=1/0,mt=9007199254740991,kt=17976931348623157e292,Zt=NaN,Et=4294967295,Ht=Et-1,se=Et>>>1,Vt=[["ary",N],["bind",T],["bindKey",P],["curry",B],["curryRight",H],["flip",V],["partial",D],["partialRight",L],["rearg",W]],Ot="[object Arguments]",Qt="[object Array]",ai="[object AsyncFunction]",Pt="[object Boolean]",zt="[object Date]",Jr="[object DOMException]",un="[object Error]",he="[object Function]",ci="[object GeneratorFunction]",ye="[object Map]",Ue="[object Number]",Mi="[object Null]",ke="[object Object]",Ri="[object Promise]",gr="[object Proxy]",_e="[object RegExp]",te="[object Set]",yn="[object String]",Nn="[object Symbol]",Di="[object Undefined]",_n="[object WeakMap]",Fn="[object WeakSet]",wn="[object ArrayBuffer]",Tt="[object DataView]",Zr="[object Float32Array]",Qr="[object Float64Array]",ts="[object Int8Array]",es="[object Int16Array]",ns="[object Int32Array]",is="[object Uint8Array]",rs="[object Uint8ClampedArray]",ss="[object Uint16Array]",os="[object Uint32Array]",as=/\b__p \+= '';/g,cs=/\b(__p \+=) '' \+/g,wl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,qo=/&(?:amp|lt|gt|quot|#39);/g,$o=/[&<>"']/g,xl=RegExp(qo.source),Sl=RegExp($o.source),ls=/<%-([\s\S]+?)%>/g,Tl=/<%([\s\S]+?)%>/g,Je=/<%=([\s\S]+?)%>/g,Ol=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Cl=/^\w*$/,Al=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,us=/[\\^$.*+?()[\]{}|]/g,li=RegExp(us.source),hs=/^\s+/,Xo=/\s/,Yo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ko=/\{\n\/\* \[wrapped with (.+)\] \*/,Go=/,? & /,kl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,El=/[()=,{}\[\]\/\s]/,Pl=/\\(\\)?/g,mr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Jo=/\w*$/,Zo=/^[-+]0x[0-9a-f]+$/i,Ml=/^0b[01]+$/i,Rl=/^\[object .+?Constructor\]$/,Dl=/^0o[0-7]+$/i,Ll=/^(?:0|[1-9]\d*)$/,Il=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vr=/($^)/,Nl=/['\n\r\u2028\u2029\\]/g,br="\\ud800-\\udfff",Qo="\\u0300-\\u036f",Bn="\\ufe20-\\ufe2f",Fl="\\u20d0-\\u20ff",ta=Qo+Bn+Fl,ea="\\u2700-\\u27bf",na="a-z\\xdf-\\xf6\\xf8-\\xff",Bl="\\xac\\xb1\\xd7\\xf7",Hl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",zl="\\u2000-\\u206f",Wl=" \\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",ia="A-Z\\xc0-\\xd6\\xd8-\\xde",yr="\\ufe0e\\ufe0f",ra=Bl+Hl+zl+Wl,fs="['’]",ds="["+br+"]",sa="["+ra+"]",_r="["+ta+"]",oa="\\d+",jl="["+ea+"]",aa="["+na+"]",ca="[^"+br+ra+oa+ea+na+ia+"]",ps="\\ud83c[\\udffb-\\udfff]",Ul="(?:"+_r+"|"+ps+")",wr="[^"+br+"]",gs="(?:\\ud83c[\\udde6-\\uddff]){2}",ms="[\\ud800-\\udbff][\\udc00-\\udfff]",ui="["+ia+"]",la="\\u200d",ua="(?:"+aa+"|"+ca+")",Vl="(?:"+ui+"|"+ca+")",ha="(?:"+fs+"(?:d|ll|m|re|s|t|ve))?",fa="(?:"+fs+"(?:D|LL|M|RE|S|T|VE))?",da=Ul+"?",pa="["+yr+"]?",hn="(?:"+la+"(?:"+[wr,gs,ms].join("|")+")"+pa+da+")*",ql="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ga="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ma=pa+da+hn,Hn="(?:"+[jl,gs,ms].join("|")+")"+ma,$l="(?:"+[wr+_r+"?",_r,gs,ms,ds].join("|")+")",vs=RegExp(fs,"g"),Xl=RegExp(_r,"g"),bs=RegExp(ps+"(?="+ps+")|"+$l+ma,"g"),Yl=RegExp([ui+"?"+aa+"+"+ha+"(?="+[sa,ui,"$"].join("|")+")",Vl+"+"+fa+"(?="+[sa,ui+ua,"$"].join("|")+")",ui+"?"+ua+"+"+ha,ui+"+"+fa,ga,ql,oa,Hn].join("|"),"g"),Kl=RegExp("["+la+br+ta+yr+"]"),Gl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ys=["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"],Jl=-1,Lt={};Lt[Zr]=Lt[Qr]=Lt[ts]=Lt[es]=Lt[ns]=Lt[is]=Lt[rs]=Lt[ss]=Lt[os]=!0,Lt[Ot]=Lt[Qt]=Lt[wn]=Lt[Pt]=Lt[Tt]=Lt[zt]=Lt[un]=Lt[he]=Lt[ye]=Lt[Ue]=Lt[ke]=Lt[_e]=Lt[te]=Lt[yn]=Lt[_n]=!1;var Rt={};Rt[Ot]=Rt[Qt]=Rt[wn]=Rt[Tt]=Rt[Pt]=Rt[zt]=Rt[Zr]=Rt[Qr]=Rt[ts]=Rt[es]=Rt[ns]=Rt[ye]=Rt[Ue]=Rt[ke]=Rt[_e]=Rt[te]=Rt[yn]=Rt[Nn]=Rt[is]=Rt[rs]=Rt[ss]=Rt[os]=!0,Rt[un]=Rt[he]=Rt[_n]=!1;var Zl={À:"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:"'n",ſ:"s"},xr={"&":"&","<":"<",">":">",'"':""","'":"'"},Ql={"&":"&","<":"<",">":">",""":'"',"'":"'"},Li={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tu=parseFloat,eu=parseInt,hi=typeof uc=="object"&&uc&&uc.Object===Object&&uc,nu=typeof self=="object"&&self&&self.Object===Object&&self,ee=hi||nu||Function("return this")(),_s=t&&!t.nodeType&&t,zn=_s&&!0&&n&&!n.nodeType&&n,va=zn&&zn.exports===_s,ws=va&&hi.process,Ee=function(){try{var v=zn&&zn.require&&zn.require("util").types;return v||ws&&ws.binding&&ws.binding("util")}catch{}}(),ba=Ee&&Ee.isArrayBuffer,ya=Ee&&Ee.isDate,Sr=Ee&&Ee.isMap,xn=Ee&&Ee.isRegExp,_a=Ee&&Ee.isSet,wa=Ee&&Ee.isTypedArray;function we(v,w,O){switch(O.length){case 0:return v.call(w);case 1:return v.call(w,O[0]);case 2:return v.call(w,O[0],O[1]);case 3:return v.call(w,O[0],O[1],O[2])}return v.apply(w,O)}function iu(v,w,O,F){for(var U=-1,J=v==null?0:v.length;++U<J;){var G=v[U];w(F,G,O(G),v)}return F}function xe(v,w){for(var O=-1,F=v==null?0:v.length;++O<F&&w(v[O],O,v)!==!1;);return v}function ru(v,w){for(var O=v==null?0:v.length;O--&&w(v[O],O,v)!==!1;);return v}function xs(v,w){for(var O=-1,F=v==null?0:v.length;++O<F;)if(!w(v[O],O,v))return!1;return!0}function Sn(v,w){for(var O=-1,F=v==null?0:v.length,U=0,J=[];++O<F;){var G=v[O];w(G,O,v)&&(J[U++]=G)}return J}function Tr(v,w){var O=v==null?0:v.length;return!!O&&On(v,w,0)>-1}function Ss(v,w,O){for(var F=-1,U=v==null?0:v.length;++F<U;)if(O(w,v[F]))return!0;return!1}function It(v,w){for(var O=-1,F=v==null?0:v.length,U=Array(F);++O<F;)U[O]=w(v[O],O,v);return U}function Tn(v,w){for(var O=-1,F=w.length,U=v.length;++O<F;)v[U+O]=w[O];return v}function Ts(v,w,O,F){var U=-1,J=v==null?0:v.length;for(F&&J&&(O=v[++U]);++U<J;)O=w(O,v[U],U,v);return O}function su(v,w,O,F){var U=v==null?0:v.length;for(F&&U&&(O=v[--U]);U--;)O=w(O,v[U],U,v);return O}function Os(v,w){for(var O=-1,F=v==null?0:v.length;++O<F;)if(w(v[O],O,v))return!0;return!1}var ou=Cs("length");function xa(v){return v.split("")}function au(v){return v.match(kl)||[]}function Sa(v,w,O){var F;return O(v,function(U,J,G){if(w(U,J,G))return F=J,!1}),F}function ft(v,w,O,F){for(var U=v.length,J=O+(F?1:-1);F?J--:++J<U;)if(w(v[J],J,v))return J;return-1}function On(v,w,O){return w===w?mu(v,w,O):ft(v,Ta,O)}function Or(v,w,O,F){for(var U=O-1,J=v.length;++U<J;)if(F(v[U],w))return U;return-1}function Ta(v){return v!==v}function Oa(v,w){var O=v==null?0:v.length;return O?Es(v,w)/O:Zt}function Cs(v){return function(w){return w==null?e:w[v]}}function As(v){return function(w){return v==null?e:v[w]}}function ks(v,w,O,F,U){return U(v,function(J,G,et){O=F?(F=!1,J):w(O,J,G,et)}),O}function cu(v,w){var O=v.length;for(v.sort(w);O--;)v[O]=v[O].value;return v}function Es(v,w){for(var O,F=-1,U=v.length;++F<U;){var J=w(v[F]);J!==e&&(O=O===e?J:O+J)}return O}function Ps(v,w){for(var O=-1,F=Array(v);++O<v;)F[O]=w(O);return F}function lu(v,w){return It(w,function(O){return[O,v[O]]})}function Ca(v){return v&&v.slice(0,Ma(v)+1).replace(hs,"")}function Se(v){return function(w){return v(w)}}function Ms(v,w){return It(w,function(O){return v[O]})}function Ii(v,w){return v.has(w)}function Aa(v,w){for(var O=-1,F=v.length;++O<F&&On(w,v[O],0)>-1;);return O}function ka(v,w){for(var O=v.length;O--&&On(w,v[O],0)>-1;);return O}function fi(v,w){for(var O=v.length,F=0;O--;)v[O]===w&&++F;return F}var uu=As(Zl),hu=As(xr);function fu(v){return"\\"+Li[v]}function Ea(v,w){return v==null?e:v[w]}function di(v){return Kl.test(v)}function du(v){return Gl.test(v)}function pu(v){for(var w,O=[];!(w=v.next()).done;)O.push(w.value);return O}function Rs(v){var w=-1,O=Array(v.size);return v.forEach(function(F,U){O[++w]=[U,F]}),O}function Pa(v,w){return function(O){return v(w(O))}}function Cn(v,w){for(var O=-1,F=v.length,U=0,J=[];++O<F;){var G=v[O];(G===w||G===d)&&(v[O]=d,J[U++]=O)}return J}function Cr(v){var w=-1,O=Array(v.size);return v.forEach(function(F){O[++w]=F}),O}function gu(v){var w=-1,O=Array(v.size);return v.forEach(function(F){O[++w]=[F,F]}),O}function mu(v,w,O){for(var F=O-1,U=v.length;++F<U;)if(v[F]===w)return F;return-1}function vu(v,w,O){for(var F=O+1;F--;)if(v[F]===w)return F;return F}function pi(v){return di(v)?Ds(v):ou(v)}function Ve(v){return di(v)?bu(v):xa(v)}function Ma(v){for(var w=v.length;w--&&Xo.test(v.charAt(w)););return w}var Ra=As(Ql);function Ds(v){for(var w=bs.lastIndex=0;bs.test(v);)++w;return w}function bu(v){return v.match(bs)||[]}function m(v){return v.match(Yl)||[]}var p=function v(w){w=w==null?ee:g.defaults(ee.Object(),w,g.pick(ee,ys));var O=w.Array,F=w.Date,U=w.Error,J=w.Function,G=w.Math,et=w.Object,Wt=w.RegExp,Ze=w.String,Pe=w.TypeError,Ni=O.prototype,yu=J.prototype,Wn=et.prototype,Ar=w["__core-js_shared__"],Fi=yu.toString,Ct=Wn.hasOwnProperty,_u=0,Ls=function(){var o=/[^.]+$/.exec(Ar&&Ar.keys&&Ar.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Bi=Wn.toString,Da=Fi.call(et),Is=ee._,Ns=Wt("^"+Fi.call(Ct).replace(us,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hi=va?w.Buffer:e,An=w.Symbol,kr=w.Uint8Array,La=Hi?Hi.allocUnsafe:e,Er=Pa(et.getPrototypeOf,et),Fs=et.create,$f=Wn.propertyIsEnumerable,Ia=Ni.splice,Xf=An?An.isConcatSpreadable:e,Bs=An?An.iterator:e,zi=An?An.toStringTag:e,Na=function(){try{var o=qi(et,"defineProperty");return o({},"",{}),o}catch{}}(),Ub=w.clearTimeout!==ee.clearTimeout&&w.clearTimeout,Vb=F&&F.now!==ee.Date.now&&F.now,qb=w.setTimeout!==ee.setTimeout&&w.setTimeout,Fa=G.ceil,Ba=G.floor,wu=et.getOwnPropertySymbols,$b=Hi?Hi.isBuffer:e,Yf=w.isFinite,Xb=Ni.join,Yb=Pa(et.keys,et),ne=G.max,fe=G.min,Kb=F.now,Gb=w.parseInt,Kf=G.random,Jb=Ni.reverse,xu=qi(w,"DataView"),Hs=qi(w,"Map"),Su=qi(w,"Promise"),Pr=qi(w,"Set"),zs=qi(w,"WeakMap"),Ws=qi(et,"create"),Ha=zs&&new zs,Mr={},Zb=$i(xu),Qb=$i(Hs),ty=$i(Su),ey=$i(Pr),ny=$i(zs),za=An?An.prototype:e,js=za?za.valueOf:e,Gf=za?za.toString:e;function k(o){if($t(o)&&!pt(o)&&!(o instanceof wt)){if(o instanceof Qe)return o;if(Ct.call(o,"__wrapped__"))return Jd(o)}return new Qe(o)}var Rr=function(){function o(){}return function(c){if(!qt(c))return{};if(Fs)return Fs(c);o.prototype=c;var f=new o;return o.prototype=e,f}}();function Wa(){}function Qe(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=e}k.templateSettings={escape:ls,evaluate:Tl,interpolate:Je,variable:"",imports:{_:k}},k.prototype=Wa.prototype,k.prototype.constructor=k,Qe.prototype=Rr(Wa.prototype),Qe.prototype.constructor=Qe;function wt(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Et,this.__views__=[]}function iy(){var o=new wt(this.__wrapped__);return o.__actions__=Me(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Me(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Me(this.__views__),o}function ry(){if(this.__filtered__){var o=new wt(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function sy(){var o=this.__wrapped__.value(),c=this.__dir__,f=pt(o),y=c<0,A=f?o.length:0,E=v_(0,A,this.__views__),M=E.start,I=E.end,z=I-M,q=y?I:M-1,$=this.__iteratees__,Y=$.length,tt=0,nt=fe(z,this.__takeCount__);if(!f||!y&&A==z&&nt==z)return _d(o,this.__actions__);var at=[];t:for(;z--&&tt<nt;){q+=c;for(var vt=-1,ct=o[q];++vt<Y;){var yt=$[vt],St=yt.iteratee,Xe=yt.type,Ce=St(ct);if(Xe==ut)ct=Ce;else if(!Ce){if(Xe==lt)continue t;break t}}at[tt++]=ct}return at}wt.prototype=Rr(Wa.prototype),wt.prototype.constructor=wt;function Wi(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var y=o[c];this.set(y[0],y[1])}}function oy(){this.__data__=Ws?Ws(null):{},this.size=0}function ay(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function cy(o){var c=this.__data__;if(Ws){var f=c[o];return f===u?e:f}return Ct.call(c,o)?c[o]:e}function ly(o){var c=this.__data__;return Ws?c[o]!==e:Ct.call(c,o)}function uy(o,c){var f=this.__data__;return this.size+=this.has(o)?0:1,f[o]=Ws&&c===e?u:c,this}Wi.prototype.clear=oy,Wi.prototype.delete=ay,Wi.prototype.get=cy,Wi.prototype.has=ly,Wi.prototype.set=uy;function jn(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var y=o[c];this.set(y[0],y[1])}}function hy(){this.__data__=[],this.size=0}function fy(o){var c=this.__data__,f=ja(c,o);if(f<0)return!1;var y=c.length-1;return f==y?c.pop():Ia.call(c,f,1),--this.size,!0}function dy(o){var c=this.__data__,f=ja(c,o);return f<0?e:c[f][1]}function py(o){return ja(this.__data__,o)>-1}function gy(o,c){var f=this.__data__,y=ja(f,o);return y<0?(++this.size,f.push([o,c])):f[y][1]=c,this}jn.prototype.clear=hy,jn.prototype.delete=fy,jn.prototype.get=dy,jn.prototype.has=py,jn.prototype.set=gy;function Un(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var y=o[c];this.set(y[0],y[1])}}function my(){this.size=0,this.__data__={hash:new Wi,map:new(Hs||jn),string:new Wi}}function vy(o){var c=tc(this,o).delete(o);return this.size-=c?1:0,c}function by(o){return tc(this,o).get(o)}function yy(o){return tc(this,o).has(o)}function _y(o,c){var f=tc(this,o),y=f.size;return f.set(o,c),this.size+=f.size==y?0:1,this}Un.prototype.clear=my,Un.prototype.delete=vy,Un.prototype.get=by,Un.prototype.has=yy,Un.prototype.set=_y;function ji(o){var c=-1,f=o==null?0:o.length;for(this.__data__=new Un;++c<f;)this.add(o[c])}function wy(o){return this.__data__.set(o,u),this}function xy(o){return this.__data__.has(o)}ji.prototype.add=ji.prototype.push=wy,ji.prototype.has=xy;function fn(o){var c=this.__data__=new jn(o);this.size=c.size}function Sy(){this.__data__=new jn,this.size=0}function Ty(o){var c=this.__data__,f=c.delete(o);return this.size=c.size,f}function Oy(o){return this.__data__.get(o)}function Cy(o){return this.__data__.has(o)}function Ay(o,c){var f=this.__data__;if(f instanceof jn){var y=f.__data__;if(!Hs||y.length<r-1)return y.push([o,c]),this.size=++f.size,this;f=this.__data__=new Un(y)}return f.set(o,c),this.size=f.size,this}fn.prototype.clear=Sy,fn.prototype.delete=Ty,fn.prototype.get=Oy,fn.prototype.has=Cy,fn.prototype.set=Ay;function Jf(o,c){var f=pt(o),y=!f&&Xi(o),A=!f&&!y&&yi(o),E=!f&&!y&&!A&&Nr(o),M=f||y||A||E,I=M?Ps(o.length,Ze):[],z=I.length;for(var q in o)(c||Ct.call(o,q))&&!(M&&(q=="length"||A&&(q=="offset"||q=="parent")||E&&(q=="buffer"||q=="byteLength"||q=="byteOffset")||Xn(q,z)))&&I.push(q);return I}function Zf(o){var c=o.length;return c?o[Lu(0,c-1)]:e}function ky(o,c){return ec(Me(o),Ui(c,0,o.length))}function Ey(o){return ec(Me(o))}function Tu(o,c,f){(f!==e&&!dn(o[c],f)||f===e&&!(c in o))&&Vn(o,c,f)}function Us(o,c,f){var y=o[c];(!(Ct.call(o,c)&&dn(y,f))||f===e&&!(c in o))&&Vn(o,c,f)}function ja(o,c){for(var f=o.length;f--;)if(dn(o[f][0],c))return f;return-1}function Py(o,c,f,y){return gi(o,function(A,E,M){c(y,A,f(A),M)}),y}function Qf(o,c){return o&&En(c,oe(c),o)}function My(o,c){return o&&En(c,De(c),o)}function Vn(o,c,f){c=="__proto__"&&Na?Na(o,c,{configurable:!0,enumerable:!0,value:f,writable:!0}):o[c]=f}function Ou(o,c){for(var f=-1,y=c.length,A=O(y),E=o==null;++f<y;)A[f]=E?e:sh(o,c[f]);return A}function Ui(o,c,f){return o===o&&(f!==e&&(o=o<=f?o:f),c!==e&&(o=o>=c?o:c)),o}function tn(o,c,f,y,A,E){var M,I=c&b,z=c&_,q=c&x;if(f&&(M=A?f(o,y,A,E):f(o)),M!==e)return M;if(!qt(o))return o;var $=pt(o);if($){if(M=y_(o),!I)return Me(o,M)}else{var Y=de(o),tt=Y==he||Y==ci;if(yi(o))return Sd(o,I);if(Y==ke||Y==Ot||tt&&!A){if(M=z||tt?{}:jd(o),!I)return z?c_(o,My(M,o)):a_(o,Qf(M,o))}else{if(!Rt[Y])return A?o:{};M=__(o,Y,I)}}E||(E=new fn);var nt=E.get(o);if(nt)return nt;E.set(o,M),vp(o)?o.forEach(function(ct){M.add(tn(ct,c,f,ct,o,E))}):gp(o)&&o.forEach(function(ct,yt){M.set(yt,tn(ct,c,f,yt,o,E))});var at=q?z?qu:Vu:z?De:oe,vt=$?e:at(o);return xe(vt||o,function(ct,yt){vt&&(yt=ct,ct=o[yt]),Us(M,yt,tn(ct,c,f,yt,o,E))}),M}function Ry(o){var c=oe(o);return function(f){return td(f,o,c)}}function td(o,c,f){var y=f.length;if(o==null)return!y;for(o=et(o);y--;){var A=f[y],E=c[A],M=o[A];if(M===e&&!(A in o)||!E(M))return!1}return!0}function ed(o,c,f){if(typeof o!="function")throw new Pe(a);return Gs(function(){o.apply(e,f)},c)}function Vs(o,c,f,y){var A=-1,E=Tr,M=!0,I=o.length,z=[],q=c.length;if(!I)return z;f&&(c=It(c,Se(f))),y?(E=Ss,M=!1):c.length>=r&&(E=Ii,M=!1,c=new ji(c));t:for(;++A<I;){var $=o[A],Y=f==null?$:f($);if($=y||$!==0?$:0,M&&Y===Y){for(var tt=q;tt--;)if(c[tt]===Y)continue t;z.push($)}else E(c,Y,y)||z.push($)}return z}var gi=kd(kn),nd=kd(Au,!0);function Dy(o,c){var f=!0;return gi(o,function(y,A,E){return f=!!c(y,A,E),f}),f}function Ua(o,c,f){for(var y=-1,A=o.length;++y<A;){var E=o[y],M=c(E);if(M!=null&&(I===e?M===M&&!$e(M):f(M,I)))var I=M,z=E}return z}function Ly(o,c,f,y){var A=o.length;for(f=gt(f),f<0&&(f=-f>A?0:A+f),y=y===e||y>A?A:gt(y),y<0&&(y+=A),y=f>y?0:yp(y);f<y;)o[f++]=c;return o}function id(o,c){var f=[];return gi(o,function(y,A,E){c(y,A,E)&&f.push(y)}),f}function ue(o,c,f,y,A){var E=-1,M=o.length;for(f||(f=x_),A||(A=[]);++E<M;){var I=o[E];c>0&&f(I)?c>1?ue(I,c-1,f,y,A):Tn(A,I):y||(A[A.length]=I)}return A}var Cu=Ed(),rd=Ed(!0);function kn(o,c){return o&&Cu(o,c,oe)}function Au(o,c){return o&&rd(o,c,oe)}function Va(o,c){return Sn(c,function(f){return Yn(o[f])})}function Vi(o,c){c=vi(c,o);for(var f=0,y=c.length;o!=null&&f<y;)o=o[Pn(c[f++])];return f&&f==y?o:e}function sd(o,c,f){var y=c(o);return pt(o)?y:Tn(y,f(o))}function Te(o){return o==null?o===e?Di:Mi:zi&&zi in et(o)?m_(o):E_(o)}function ku(o,c){return o>c}function Iy(o,c){return o!=null&&Ct.call(o,c)}function Ny(o,c){return o!=null&&c in et(o)}function Fy(o,c,f){return o>=fe(c,f)&&o<ne(c,f)}function Eu(o,c,f){for(var y=f?Ss:Tr,A=o[0].length,E=o.length,M=E,I=O(E),z=1/0,q=[];M--;){var $=o[M];M&&c&&($=It($,Se(c))),z=fe($.length,z),I[M]=!f&&(c||A>=120&&$.length>=120)?new ji(M&&$):e}$=o[0];var Y=-1,tt=I[0];t:for(;++Y<A&&q.length<z;){var nt=$[Y],at=c?c(nt):nt;if(nt=f||nt!==0?nt:0,!(tt?Ii(tt,at):y(q,at,f))){for(M=E;--M;){var vt=I[M];if(!(vt?Ii(vt,at):y(o[M],at,f)))continue t}tt&&tt.push(at),q.push(nt)}}return q}function By(o,c,f,y){return kn(o,function(A,E,M){c(y,f(A),E,M)}),y}function qs(o,c,f){c=vi(c,o),o=$d(o,c);var y=o==null?o:o[Pn(nn(c))];return y==null?e:we(y,o,f)}function od(o){return $t(o)&&Te(o)==Ot}function Hy(o){return $t(o)&&Te(o)==wn}function zy(o){return $t(o)&&Te(o)==zt}function $s(o,c,f,y,A){return o===c?!0:o==null||c==null||!$t(o)&&!$t(c)?o!==o&&c!==c:Wy(o,c,f,y,$s,A)}function Wy(o,c,f,y,A,E){var M=pt(o),I=pt(c),z=M?Qt:de(o),q=I?Qt:de(c);z=z==Ot?ke:z,q=q==Ot?ke:q;var $=z==ke,Y=q==ke,tt=z==q;if(tt&&yi(o)){if(!yi(c))return!1;M=!0,$=!1}if(tt&&!$)return E||(E=new fn),M||Nr(o)?Hd(o,c,f,y,A,E):p_(o,c,z,f,y,A,E);if(!(f&S)){var nt=$&&Ct.call(o,"__wrapped__"),at=Y&&Ct.call(c,"__wrapped__");if(nt||at){var vt=nt?o.value():o,ct=at?c.value():c;return E||(E=new fn),A(vt,ct,f,y,E)}}return tt?(E||(E=new fn),g_(o,c,f,y,A,E)):!1}function jy(o){return $t(o)&&de(o)==ye}function Pu(o,c,f,y){var A=f.length,E=A,M=!y;if(o==null)return!E;for(o=et(o);A--;){var I=f[A];if(M&&I[2]?I[1]!==o[I[0]]:!(I[0]in o))return!1}for(;++A<E;){I=f[A];var z=I[0],q=o[z],$=I[1];if(M&&I[2]){if(q===e&&!(z in o))return!1}else{var Y=new fn;if(y)var tt=y(q,$,z,o,c,Y);if(!(tt===e?$s($,q,S|C,y,Y):tt))return!1}}return!0}function ad(o){if(!qt(o)||T_(o))return!1;var c=Yn(o)?Ns:Rl;return c.test($i(o))}function Uy(o){return $t(o)&&Te(o)==_e}function Vy(o){return $t(o)&&de(o)==te}function qy(o){return $t(o)&&ac(o.length)&&!!Lt[Te(o)]}function cd(o){return typeof o=="function"?o:o==null?Le:typeof o=="object"?pt(o)?hd(o[0],o[1]):ud(o):Pp(o)}function Mu(o){if(!Ks(o))return Yb(o);var c=[];for(var f in et(o))Ct.call(o,f)&&f!="constructor"&&c.push(f);return c}function $y(o){if(!qt(o))return k_(o);var c=Ks(o),f=[];for(var y in o)y=="constructor"&&(c||!Ct.call(o,y))||f.push(y);return f}function Ru(o,c){return o<c}function ld(o,c){var f=-1,y=Re(o)?O(o.length):[];return gi(o,function(A,E,M){y[++f]=c(A,E,M)}),y}function ud(o){var c=Xu(o);return c.length==1&&c[0][2]?Vd(c[0][0],c[0][1]):function(f){return f===o||Pu(f,o,c)}}function hd(o,c){return Ku(o)&&Ud(c)?Vd(Pn(o),c):function(f){var y=sh(f,o);return y===e&&y===c?oh(f,o):$s(c,y,S|C)}}function qa(o,c,f,y,A){o!==c&&Cu(c,function(E,M){if(A||(A=new fn),qt(E))Xy(o,c,M,f,qa,y,A);else{var I=y?y(Ju(o,M),E,M+"",o,c,A):e;I===e&&(I=E),Tu(o,M,I)}},De)}function Xy(o,c,f,y,A,E,M){var I=Ju(o,f),z=Ju(c,f),q=M.get(z);if(q){Tu(o,f,q);return}var $=E?E(I,z,f+"",o,c,M):e,Y=$===e;if(Y){var tt=pt(z),nt=!tt&&yi(z),at=!tt&&!nt&&Nr(z);$=z,tt||nt||at?pt(I)?$=I:Yt(I)?$=Me(I):nt?(Y=!1,$=Sd(z,!0)):at?(Y=!1,$=Td(z,!0)):$=[]:Js(z)||Xi(z)?($=I,Xi(I)?$=_p(I):(!qt(I)||Yn(I))&&($=jd(z))):Y=!1}Y&&(M.set(z,$),A($,z,y,E,M),M.delete(z)),Tu(o,f,$)}function fd(o,c){var f=o.length;if(f)return c+=c<0?f:0,Xn(c,f)?o[c]:e}function dd(o,c,f){c.length?c=It(c,function(E){return pt(E)?function(M){return Vi(M,E.length===1?E[0]:E)}:E}):c=[Le];var y=-1;c=It(c,Se(st()));var A=ld(o,function(E,M,I){var z=It(c,function(q){return q(E)});return{criteria:z,index:++y,value:E}});return cu(A,function(E,M){return o_(E,M,f)})}function Yy(o,c){return pd(o,c,function(f,y){return oh(o,y)})}function pd(o,c,f){for(var y=-1,A=c.length,E={};++y<A;){var M=c[y],I=Vi(o,M);f(I,M)&&Xs(E,vi(M,o),I)}return E}function Ky(o){return function(c){return Vi(c,o)}}function Du(o,c,f,y){var A=y?Or:On,E=-1,M=c.length,I=o;for(o===c&&(c=Me(c)),f&&(I=It(o,Se(f)));++E<M;)for(var z=0,q=c[E],$=f?f(q):q;(z=A(I,$,z,y))>-1;)I!==o&&Ia.call(I,z,1),Ia.call(o,z,1);return o}function gd(o,c){for(var f=o?c.length:0,y=f-1;f--;){var A=c[f];if(f==y||A!==E){var E=A;Xn(A)?Ia.call(o,A,1):Fu(o,A)}}return o}function Lu(o,c){return o+Ba(Kf()*(c-o+1))}function Gy(o,c,f,y){for(var A=-1,E=ne(Fa((c-o)/(f||1)),0),M=O(E);E--;)M[y?E:++A]=o,o+=f;return M}function Iu(o,c){var f="";if(!o||c<1||c>mt)return f;do c%2&&(f+=o),c=Ba(c/2),c&&(o+=o);while(c);return f}function bt(o,c){return Zu(qd(o,c,Le),o+"")}function Jy(o){return Zf(Fr(o))}function Zy(o,c){var f=Fr(o);return ec(f,Ui(c,0,f.length))}function Xs(o,c,f,y){if(!qt(o))return o;c=vi(c,o);for(var A=-1,E=c.length,M=E-1,I=o;I!=null&&++A<E;){var z=Pn(c[A]),q=f;if(z==="__proto__"||z==="constructor"||z==="prototype")return o;if(A!=M){var $=I[z];q=y?y($,z,I):e,q===e&&(q=qt($)?$:Xn(c[A+1])?[]:{})}Us(I,z,q),I=I[z]}return o}var md=Ha?function(o,c){return Ha.set(o,c),o}:Le,Qy=Na?function(o,c){return Na(o,"toString",{configurable:!0,enumerable:!1,value:ch(c),writable:!0})}:Le;function t_(o){return ec(Fr(o))}function en(o,c,f){var y=-1,A=o.length;c<0&&(c=-c>A?0:A+c),f=f>A?A:f,f<0&&(f+=A),A=c>f?0:f-c>>>0,c>>>=0;for(var E=O(A);++y<A;)E[y]=o[y+c];return E}function e_(o,c){var f;return gi(o,function(y,A,E){return f=c(y,A,E),!f}),!!f}function $a(o,c,f){var y=0,A=o==null?y:o.length;if(typeof c=="number"&&c===c&&A<=se){for(;y<A;){var E=y+A>>>1,M=o[E];M!==null&&!$e(M)&&(f?M<=c:M<c)?y=E+1:A=E}return A}return Nu(o,c,Le,f)}function Nu(o,c,f,y){var A=0,E=o==null?0:o.length;if(E===0)return 0;c=f(c);for(var M=c!==c,I=c===null,z=$e(c),q=c===e;A<E;){var $=Ba((A+E)/2),Y=f(o[$]),tt=Y!==e,nt=Y===null,at=Y===Y,vt=$e(Y);if(M)var ct=y||at;else q?ct=at&&(y||tt):I?ct=at&&tt&&(y||!nt):z?ct=at&&tt&&!nt&&(y||!vt):nt||vt?ct=!1:ct=y?Y<=c:Y<c;ct?A=$+1:E=$}return fe(E,Ht)}function vd(o,c){for(var f=-1,y=o.length,A=0,E=[];++f<y;){var M=o[f],I=c?c(M):M;if(!f||!dn(I,z)){var z=I;E[A++]=M===0?0:M}}return E}function bd(o){return typeof o=="number"?o:$e(o)?Zt:+o}function qe(o){if(typeof o=="string")return o;if(pt(o))return It(o,qe)+"";if($e(o))return Gf?Gf.call(o):"";var c=o+"";return c=="0"&&1/o==-ot?"-0":c}function mi(o,c,f){var y=-1,A=Tr,E=o.length,M=!0,I=[],z=I;if(f)M=!1,A=Ss;else if(E>=r){var q=c?null:f_(o);if(q)return Cr(q);M=!1,A=Ii,z=new ji}else z=c?[]:I;t:for(;++y<E;){var $=o[y],Y=c?c($):$;if($=f||$!==0?$:0,M&&Y===Y){for(var tt=z.length;tt--;)if(z[tt]===Y)continue t;c&&z.push(Y),I.push($)}else A(z,Y,f)||(z!==I&&z.push(Y),I.push($))}return I}function Fu(o,c){c=vi(c,o);var f=-1,y=c.length;if(!y)return!0;for(var A=o==null||typeof o!="object"&&typeof o!="function";++f<y;){var E=c[f];if(typeof E=="string"){if(E==="__proto__"&&!Ct.call(o,"__proto__"))return!1;if(E==="constructor"&&f+1<y&&typeof c[f+1]=="string"&&c[f+1]==="prototype"){if(A&&f===0)continue;return!1}}}var M=$d(o,c);return M==null||delete M[Pn(nn(c))]}function yd(o,c,f,y){return Xs(o,c,f(Vi(o,c)),y)}function Xa(o,c,f,y){for(var A=o.length,E=y?A:-1;(y?E--:++E<A)&&c(o[E],E,o););return f?en(o,y?0:E,y?E+1:A):en(o,y?E+1:0,y?A:E)}function _d(o,c){var f=o;return f instanceof wt&&(f=f.value()),Ts(c,function(y,A){return A.func.apply(A.thisArg,Tn([y],A.args))},f)}function Bu(o,c,f){var y=o.length;if(y<2)return y?mi(o[0]):[];for(var A=-1,E=O(y);++A<y;)for(var M=o[A],I=-1;++I<y;)I!=A&&(E[A]=Vs(E[A]||M,o[I],c,f));return mi(ue(E,1),c,f)}function wd(o,c,f){for(var y=-1,A=o.length,E=c.length,M={};++y<A;){var I=y<E?c[y]:e;f(M,o[y],I)}return M}function Hu(o){return Yt(o)?o:[]}function zu(o){return typeof o=="function"?o:Le}function vi(o,c){return pt(o)?o:Ku(o,c)?[o]:Gd(Mt(o))}var n_=bt;function bi(o,c,f){var y=o.length;return f=f===e?y:f,!c&&f>=y?o:en(o,c,f)}var xd=Ub||function(o){return ee.clearTimeout(o)};function Sd(o,c){if(c)return o.slice();var f=o.length,y=La?La(f):new o.constructor(f);return o.copy(y),y}function Wu(o){var c=new o.constructor(o.byteLength);return new kr(c).set(new kr(o)),c}function i_(o,c){var f=c?Wu(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function r_(o){var c=new o.constructor(o.source,Jo.exec(o));return c.lastIndex=o.lastIndex,c}function s_(o){return js?et(js.call(o)):{}}function Td(o,c){var f=c?Wu(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function Od(o,c){if(o!==c){var f=o!==e,y=o===null,A=o===o,E=$e(o),M=c!==e,I=c===null,z=c===c,q=$e(c);if(!I&&!q&&!E&&o>c||E&&M&&z&&!I&&!q||y&&M&&z||!f&&z||!A)return 1;if(!y&&!E&&!q&&o<c||q&&f&&A&&!y&&!E||I&&f&&A||!M&&A||!z)return-1}return 0}function o_(o,c,f){for(var y=-1,A=o.criteria,E=c.criteria,M=A.length,I=f.length;++y<M;){var z=Od(A[y],E[y]);if(z){if(y>=I)return z;var q=f[y];return z*(q=="desc"?-1:1)}}return o.index-c.index}function Cd(o,c,f,y){for(var A=-1,E=o.length,M=f.length,I=-1,z=c.length,q=ne(E-M,0),$=O(z+q),Y=!y;++I<z;)$[I]=c[I];for(;++A<M;)(Y||A<E)&&($[f[A]]=o[A]);for(;q--;)$[I++]=o[A++];return $}function Ad(o,c,f,y){for(var A=-1,E=o.length,M=-1,I=f.length,z=-1,q=c.length,$=ne(E-I,0),Y=O($+q),tt=!y;++A<$;)Y[A]=o[A];for(var nt=A;++z<q;)Y[nt+z]=c[z];for(;++M<I;)(tt||A<E)&&(Y[nt+f[M]]=o[A++]);return Y}function Me(o,c){var f=-1,y=o.length;for(c||(c=O(y));++f<y;)c[f]=o[f];return c}function En(o,c,f,y){var A=!f;f||(f={});for(var E=-1,M=c.length;++E<M;){var I=c[E],z=y?y(f[I],o[I],I,f,o):e;z===e&&(z=o[I]),A?Vn(f,I,z):Us(f,I,z)}return f}function a_(o,c){return En(o,Yu(o),c)}function c_(o,c){return En(o,zd(o),c)}function Ya(o,c){return function(f,y){var A=pt(f)?iu:Py,E=c?c():{};return A(f,o,st(y,2),E)}}function Dr(o){return bt(function(c,f){var y=-1,A=f.length,E=A>1?f[A-1]:e,M=A>2?f[2]:e;for(E=o.length>3&&typeof E=="function"?(A--,E):e,M&&Oe(f[0],f[1],M)&&(E=A<3?e:E,A=1),c=et(c);++y<A;){var I=f[y];I&&o(c,I,y,E)}return c})}function kd(o,c){return function(f,y){if(f==null)return f;if(!Re(f))return o(f,y);for(var A=f.length,E=c?A:-1,M=et(f);(c?E--:++E<A)&&y(M[E],E,M)!==!1;);return f}}function Ed(o){return function(c,f,y){for(var A=-1,E=et(c),M=y(c),I=M.length;I--;){var z=M[o?I:++A];if(f(E[z],z,E)===!1)break}return c}}function l_(o,c,f){var y=c&T,A=Ys(o);function E(){var M=this&&this!==ee&&this instanceof E?A:o;return M.apply(y?f:this,arguments)}return E}function Pd(o){return function(c){c=Mt(c);var f=di(c)?Ve(c):e,y=f?f[0]:c.charAt(0),A=f?bi(f,1).join(""):c.slice(1);return y[o]()+A}}function Lr(o){return function(c){return Ts(kp(Ap(c).replace(vs,"")),o,"")}}function Ys(o){return function(){var c=arguments;switch(c.length){case 0:return new o;case 1:return new o(c[0]);case 2:return new o(c[0],c[1]);case 3:return new o(c[0],c[1],c[2]);case 4:return new o(c[0],c[1],c[2],c[3]);case 5:return new o(c[0],c[1],c[2],c[3],c[4]);case 6:return new o(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new o(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var f=Rr(o.prototype),y=o.apply(f,c);return qt(y)?y:f}}function u_(o,c,f){var y=Ys(o);function A(){for(var E=arguments.length,M=O(E),I=E,z=Ir(A);I--;)M[I]=arguments[I];var q=E<3&&M[0]!==z&&M[E-1]!==z?[]:Cn(M,z);if(E-=q.length,E<f)return Id(o,c,Ka,A.placeholder,e,M,q,e,e,f-E);var $=this&&this!==ee&&this instanceof A?y:o;return we($,this,M)}return A}function Md(o){return function(c,f,y){var A=et(c);if(!Re(c)){var E=st(f,3);c=oe(c),f=function(I){return E(A[I],I,A)}}var M=o(c,f,y);return M>-1?A[E?c[M]:M]:e}}function Rd(o){return $n(function(c){var f=c.length,y=f,A=Qe.prototype.thru;for(o&&c.reverse();y--;){var E=c[y];if(typeof E!="function")throw new Pe(a);if(A&&!M&&Qa(E)=="wrapper")var M=new Qe([],!0)}for(y=M?y:f;++y<f;){E=c[y];var I=Qa(E),z=I=="wrapper"?$u(E):e;z&&Gu(z[0])&&z[1]==(N|B|D|W)&&!z[4].length&&z[9]==1?M=M[Qa(z[0])].apply(M,z[3]):M=E.length==1&&Gu(E)?M[I]():M.thru(E)}return function(){var q=arguments,$=q[0];if(M&&q.length==1&&pt($))return M.plant($).value();for(var Y=0,tt=f?c[Y].apply(this,q):$;++Y<f;)tt=c[Y].call(this,tt);return tt}})}function Ka(o,c,f,y,A,E,M,I,z,q){var $=c&N,Y=c&T,tt=c&P,nt=c&(B|H),at=c&V,vt=tt?e:Ys(o);function ct(){for(var yt=arguments.length,St=O(yt),Xe=yt;Xe--;)St[Xe]=arguments[Xe];if(nt)var Ce=Ir(ct),Ye=fi(St,Ce);if(y&&(St=Cd(St,y,A,nt)),E&&(St=Ad(St,E,M,nt)),yt-=Ye,nt&&yt<q){var Kt=Cn(St,Ce);return Id(o,c,Ka,ct.placeholder,f,St,Kt,I,z,q-yt)}var pn=Y?f:this,Gn=tt?pn[o]:o;return yt=St.length,I?St=P_(St,I):at&&yt>1&&St.reverse(),$&&z<yt&&(St.length=z),this&&this!==ee&&this instanceof ct&&(Gn=vt||Ys(Gn)),Gn.apply(pn,St)}return ct}function Dd(o,c){return function(f,y){return By(f,o,c(y),{})}}function Ga(o,c){return function(f,y){var A;if(f===e&&y===e)return c;if(f!==e&&(A=f),y!==e){if(A===e)return y;typeof f=="string"||typeof y=="string"?(f=qe(f),y=qe(y)):(f=bd(f),y=bd(y)),A=o(f,y)}return A}}function ju(o){return $n(function(c){return c=It(c,Se(st())),bt(function(f){var y=this;return o(c,function(A){return we(A,y,f)})})})}function Ja(o,c){c=c===e?" ":qe(c);var f=c.length;if(f<2)return f?Iu(c,o):c;var y=Iu(c,Fa(o/pi(c)));return di(c)?bi(Ve(y),0,o).join(""):y.slice(0,o)}function h_(o,c,f,y){var A=c&T,E=Ys(o);function M(){for(var I=-1,z=arguments.length,q=-1,$=y.length,Y=O($+z),tt=this&&this!==ee&&this instanceof M?E:o;++q<$;)Y[q]=y[q];for(;z--;)Y[q++]=arguments[++I];return we(tt,A?f:this,Y)}return M}function Ld(o){return function(c,f,y){return y&&typeof y!="number"&&Oe(c,f,y)&&(f=y=e),c=Kn(c),f===e?(f=c,c=0):f=Kn(f),y=y===e?c<f?1:-1:Kn(y),Gy(c,f,y,o)}}function Za(o){return function(c,f){return typeof c=="string"&&typeof f=="string"||(c=rn(c),f=rn(f)),o(c,f)}}function Id(o,c,f,y,A,E,M,I,z,q){var $=c&B,Y=$?M:e,tt=$?e:M,nt=$?E:e,at=$?e:E;c|=$?D:L,c&=~($?L:D),c&R||(c&=-4);var vt=[o,c,A,nt,Y,at,tt,I,z,q],ct=f.apply(e,vt);return Gu(o)&&Xd(ct,vt),ct.placeholder=y,Yd(ct,o,c)}function Uu(o){var c=G[o];return function(f,y){if(f=rn(f),y=y==null?0:fe(gt(y),292),y&&Yf(f)){var A=(Mt(f)+"e").split("e"),E=c(A[0]+"e"+(+A[1]+y));return A=(Mt(E)+"e").split("e"),+(A[0]+"e"+(+A[1]-y))}return c(f)}}var f_=Pr&&1/Cr(new Pr([,-0]))[1]==ot?function(o){return new Pr(o)}:hh;function Nd(o){return function(c){var f=de(c);return f==ye?Rs(c):f==te?gu(c):lu(c,o(c))}}function qn(o,c,f,y,A,E,M,I){var z=c&P;if(!z&&typeof o!="function")throw new Pe(a);var q=y?y.length:0;if(q||(c&=-97,y=A=e),M=M===e?M:ne(gt(M),0),I=I===e?I:gt(I),q-=A?A.length:0,c&L){var $=y,Y=A;y=A=e}var tt=z?e:$u(o),nt=[o,c,f,y,A,$,Y,E,M,I];if(tt&&A_(nt,tt),o=nt[0],c=nt[1],f=nt[2],y=nt[3],A=nt[4],I=nt[9]=nt[9]===e?z?0:o.length:ne(nt[9]-q,0),!I&&c&(B|H)&&(c&=-25),!c||c==T)var at=l_(o,c,f);else c==B||c==H?at=u_(o,c,I):(c==D||c==(T|D))&&!A.length?at=h_(o,c,f,y):at=Ka.apply(e,nt);var vt=tt?md:Xd;return Yd(vt(at,nt),o,c)}function Fd(o,c,f,y){return o===e||dn(o,Wn[f])&&!Ct.call(y,f)?c:o}function Bd(o,c,f,y,A,E){return qt(o)&&qt(c)&&(E.set(c,o),qa(o,c,e,Bd,E),E.delete(c)),o}function d_(o){return Js(o)?e:o}function Hd(o,c,f,y,A,E){var M=f&S,I=o.length,z=c.length;if(I!=z&&!(M&&z>I))return!1;var q=E.get(o),$=E.get(c);if(q&&$)return q==c&&$==o;var Y=-1,tt=!0,nt=f&C?new ji:e;for(E.set(o,c),E.set(c,o);++Y<I;){var at=o[Y],vt=c[Y];if(y)var ct=M?y(vt,at,Y,c,o,E):y(at,vt,Y,o,c,E);if(ct!==e){if(ct)continue;tt=!1;break}if(nt){if(!Os(c,function(yt,St){if(!Ii(nt,St)&&(at===yt||A(at,yt,f,y,E)))return nt.push(St)})){tt=!1;break}}else if(!(at===vt||A(at,vt,f,y,E))){tt=!1;break}}return E.delete(o),E.delete(c),tt}function p_(o,c,f,y,A,E,M){switch(f){case Tt:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case wn:return!(o.byteLength!=c.byteLength||!E(new kr(o),new kr(c)));case Pt:case zt:case Ue:return dn(+o,+c);case un:return o.name==c.name&&o.message==c.message;case _e:case yn:return o==c+"";case ye:var I=Rs;case te:var z=y&S;if(I||(I=Cr),o.size!=c.size&&!z)return!1;var q=M.get(o);if(q)return q==c;y|=C,M.set(o,c);var $=Hd(I(o),I(c),y,A,E,M);return M.delete(o),$;case Nn:if(js)return js.call(o)==js.call(c)}return!1}function g_(o,c,f,y,A,E){var M=f&S,I=Vu(o),z=I.length,q=Vu(c),$=q.length;if(z!=$&&!M)return!1;for(var Y=z;Y--;){var tt=I[Y];if(!(M?tt in c:Ct.call(c,tt)))return!1}var nt=E.get(o),at=E.get(c);if(nt&&at)return nt==c&&at==o;var vt=!0;E.set(o,c),E.set(c,o);for(var ct=M;++Y<z;){tt=I[Y];var yt=o[tt],St=c[tt];if(y)var Xe=M?y(St,yt,tt,c,o,E):y(yt,St,tt,o,c,E);if(!(Xe===e?yt===St||A(yt,St,f,y,E):Xe)){vt=!1;break}ct||(ct=tt=="constructor")}if(vt&&!ct){var Ce=o.constructor,Ye=c.constructor;Ce!=Ye&&"constructor"in o&&"constructor"in c&&!(typeof Ce=="function"&&Ce instanceof Ce&&typeof Ye=="function"&&Ye instanceof Ye)&&(vt=!1)}return E.delete(o),E.delete(c),vt}function $n(o){return Zu(qd(o,e,tp),o+"")}function Vu(o){return sd(o,oe,Yu)}function qu(o){return sd(o,De,zd)}var $u=Ha?function(o){return Ha.get(o)}:hh;function Qa(o){for(var c=o.name+"",f=Mr[c],y=Ct.call(Mr,c)?f.length:0;y--;){var A=f[y],E=A.func;if(E==null||E==o)return A.name}return c}function Ir(o){var c=Ct.call(k,"placeholder")?k:o;return c.placeholder}function st(){var o=k.iteratee||lh;return o=o===lh?cd:o,arguments.length?o(arguments[0],arguments[1]):o}function tc(o,c){var f=o.__data__;return S_(c)?f[typeof c=="string"?"string":"hash"]:f.map}function Xu(o){for(var c=oe(o),f=c.length;f--;){var y=c[f],A=o[y];c[f]=[y,A,Ud(A)]}return c}function qi(o,c){var f=Ea(o,c);return ad(f)?f:e}function m_(o){var c=Ct.call(o,zi),f=o[zi];try{o[zi]=e;var y=!0}catch{}var A=Bi.call(o);return y&&(c?o[zi]=f:delete o[zi]),A}var Yu=wu?function(o){return o==null?[]:(o=et(o),Sn(wu(o),function(c){return $f.call(o,c)}))}:fh,zd=wu?function(o){for(var c=[];o;)Tn(c,Yu(o)),o=Er(o);return c}:fh,de=Te;(xu&&de(new xu(new ArrayBuffer(1)))!=Tt||Hs&&de(new Hs)!=ye||Su&&de(Su.resolve())!=Ri||Pr&&de(new Pr)!=te||zs&&de(new zs)!=_n)&&(de=function(o){var c=Te(o),f=c==ke?o.constructor:e,y=f?$i(f):"";if(y)switch(y){case Zb:return Tt;case Qb:return ye;case ty:return Ri;case ey:return te;case ny:return _n}return c});function v_(o,c,f){for(var y=-1,A=f.length;++y<A;){var E=f[y],M=E.size;switch(E.type){case"drop":o+=M;break;case"dropRight":c-=M;break;case"take":c=fe(c,o+M);break;case"takeRight":o=ne(o,c-M);break}}return{start:o,end:c}}function b_(o){var c=o.match(Ko);return c?c[1].split(Go):[]}function Wd(o,c,f){c=vi(c,o);for(var y=-1,A=c.length,E=!1;++y<A;){var M=Pn(c[y]);if(!(E=o!=null&&f(o,M)))break;o=o[M]}return E||++y!=A?E:(A=o==null?0:o.length,!!A&&ac(A)&&Xn(M,A)&&(pt(o)||Xi(o)))}function y_(o){var c=o.length,f=new o.constructor(c);return c&&typeof o[0]=="string"&&Ct.call(o,"index")&&(f.index=o.index,f.input=o.input),f}function jd(o){return typeof o.constructor=="function"&&!Ks(o)?Rr(Er(o)):{}}function __(o,c,f){var y=o.constructor;switch(c){case wn:return Wu(o);case Pt:case zt:return new y(+o);case Tt:return i_(o,f);case Zr:case Qr:case ts:case es:case ns:case is:case rs:case ss:case os:return Td(o,f);case ye:return new y;case Ue:case yn:return new y(o);case _e:return r_(o);case te:return new y;case Nn:return s_(o)}}function w_(o,c){var f=c.length;if(!f)return o;var y=f-1;return c[y]=(f>1?"& ":"")+c[y],c=c.join(f>2?", ":" "),o.replace(Yo,`{
|
||
/* [wrapped with `+c+`] */
|
||
`)}function x_(o){return pt(o)||Xi(o)||!!(Xf&&o&&o[Xf])}function Xn(o,c){var f=typeof o;return c=c??mt,!!c&&(f=="number"||f!="symbol"&&Ll.test(o))&&o>-1&&o%1==0&&o<c}function Oe(o,c,f){if(!qt(f))return!1;var y=typeof c;return(y=="number"?Re(f)&&Xn(c,f.length):y=="string"&&c in f)?dn(f[c],o):!1}function Ku(o,c){if(pt(o))return!1;var f=typeof o;return f=="number"||f=="symbol"||f=="boolean"||o==null||$e(o)?!0:Cl.test(o)||!Ol.test(o)||c!=null&&o in et(c)}function S_(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Gu(o){var c=Qa(o),f=k[c];if(typeof f!="function"||!(c in wt.prototype))return!1;if(o===f)return!0;var y=$u(f);return!!y&&o===y[0]}function T_(o){return!!Ls&&Ls in o}var O_=Ar?Yn:dh;function Ks(o){var c=o&&o.constructor,f=typeof c=="function"&&c.prototype||Wn;return o===f}function Ud(o){return o===o&&!qt(o)}function Vd(o,c){return function(f){return f==null?!1:f[o]===c&&(c!==e||o in et(f))}}function C_(o){var c=sc(o,function(y){return f.size===h&&f.clear(),y}),f=c.cache;return c}function A_(o,c){var f=o[1],y=c[1],A=f|y,E=A<(T|P|N),M=y==N&&f==B||y==N&&f==W&&o[7].length<=c[8]||y==(N|W)&&c[7].length<=c[8]&&f==B;if(!(E||M))return o;y&T&&(o[2]=c[2],A|=f&T?0:R);var I=c[3];if(I){var z=o[3];o[3]=z?Cd(z,I,c[4]):I,o[4]=z?Cn(o[3],d):c[4]}return I=c[5],I&&(z=o[5],o[5]=z?Ad(z,I,c[6]):I,o[6]=z?Cn(o[5],d):c[6]),I=c[7],I&&(o[7]=I),y&N&&(o[8]=o[8]==null?c[8]:fe(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=A,o}function k_(o){var c=[];if(o!=null)for(var f in et(o))c.push(f);return c}function E_(o){return Bi.call(o)}function qd(o,c,f){return c=ne(c===e?o.length-1:c,0),function(){for(var y=arguments,A=-1,E=ne(y.length-c,0),M=O(E);++A<E;)M[A]=y[c+A];A=-1;for(var I=O(c+1);++A<c;)I[A]=y[A];return I[c]=f(M),we(o,this,I)}}function $d(o,c){return c.length<2?o:Vi(o,en(c,0,-1))}function P_(o,c){for(var f=o.length,y=fe(c.length,f),A=Me(o);y--;){var E=c[y];o[y]=Xn(E,f)?A[E]:e}return o}function Ju(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var Xd=Kd(md),Gs=qb||function(o,c){return ee.setTimeout(o,c)},Zu=Kd(Qy);function Yd(o,c,f){var y=c+"";return Zu(o,w_(y,M_(b_(y),f)))}function Kd(o){var c=0,f=0;return function(){var y=Kb(),A=rt-(y-f);if(f=y,A>0){if(++c>=Q)return arguments[0]}else c=0;return o.apply(e,arguments)}}function ec(o,c){var f=-1,y=o.length,A=y-1;for(c=c===e?y:c;++f<c;){var E=Lu(f,A),M=o[E];o[E]=o[f],o[f]=M}return o.length=c,o}var Gd=C_(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(Al,function(f,y,A,E){c.push(A?E.replace(Pl,"$1"):y||f)}),c});function Pn(o){if(typeof o=="string"||$e(o))return o;var c=o+"";return c=="0"&&1/o==-ot?"-0":c}function $i(o){if(o!=null){try{return Fi.call(o)}catch{}try{return o+""}catch{}}return""}function M_(o,c){return xe(Vt,function(f){var y="_."+f[0];c&f[1]&&!Tr(o,y)&&o.push(y)}),o.sort()}function Jd(o){if(o instanceof wt)return o.clone();var c=new Qe(o.__wrapped__,o.__chain__);return c.__actions__=Me(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function R_(o,c,f){(f?Oe(o,c,f):c===e)?c=1:c=ne(gt(c),0);var y=o==null?0:o.length;if(!y||c<1)return[];for(var A=0,E=0,M=O(Fa(y/c));A<y;)M[E++]=en(o,A,A+=c);return M}function D_(o){for(var c=-1,f=o==null?0:o.length,y=0,A=[];++c<f;){var E=o[c];E&&(A[y++]=E)}return A}function L_(){var o=arguments.length;if(!o)return[];for(var c=O(o-1),f=arguments[0],y=o;y--;)c[y-1]=arguments[y];return Tn(pt(f)?Me(f):[f],ue(c,1))}var I_=bt(function(o,c){return Yt(o)?Vs(o,ue(c,1,Yt,!0)):[]}),N_=bt(function(o,c){var f=nn(c);return Yt(f)&&(f=e),Yt(o)?Vs(o,ue(c,1,Yt,!0),st(f,2)):[]}),F_=bt(function(o,c){var f=nn(c);return Yt(f)&&(f=e),Yt(o)?Vs(o,ue(c,1,Yt,!0),e,f):[]});function B_(o,c,f){var y=o==null?0:o.length;return y?(c=f||c===e?1:gt(c),en(o,c<0?0:c,y)):[]}function H_(o,c,f){var y=o==null?0:o.length;return y?(c=f||c===e?1:gt(c),c=y-c,en(o,0,c<0?0:c)):[]}function z_(o,c){return o&&o.length?Xa(o,st(c,3),!0,!0):[]}function W_(o,c){return o&&o.length?Xa(o,st(c,3),!0):[]}function j_(o,c,f,y){var A=o==null?0:o.length;return A?(f&&typeof f!="number"&&Oe(o,c,f)&&(f=0,y=A),Ly(o,c,f,y)):[]}function Zd(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var A=f==null?0:gt(f);return A<0&&(A=ne(y+A,0)),ft(o,st(c,3),A)}function Qd(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var A=y-1;return f!==e&&(A=gt(f),A=f<0?ne(y+A,0):fe(A,y-1)),ft(o,st(c,3),A,!0)}function tp(o){var c=o==null?0:o.length;return c?ue(o,1):[]}function U_(o){var c=o==null?0:o.length;return c?ue(o,ot):[]}function V_(o,c){var f=o==null?0:o.length;return f?(c=c===e?1:gt(c),ue(o,c)):[]}function q_(o){for(var c=-1,f=o==null?0:o.length,y={};++c<f;){var A=o[c];y[A[0]]=A[1]}return y}function ep(o){return o&&o.length?o[0]:e}function $_(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var A=f==null?0:gt(f);return A<0&&(A=ne(y+A,0)),On(o,c,A)}function X_(o){var c=o==null?0:o.length;return c?en(o,0,-1):[]}var Y_=bt(function(o){var c=It(o,Hu);return c.length&&c[0]===o[0]?Eu(c):[]}),K_=bt(function(o){var c=nn(o),f=It(o,Hu);return c===nn(f)?c=e:f.pop(),f.length&&f[0]===o[0]?Eu(f,st(c,2)):[]}),G_=bt(function(o){var c=nn(o),f=It(o,Hu);return c=typeof c=="function"?c:e,c&&f.pop(),f.length&&f[0]===o[0]?Eu(f,e,c):[]});function J_(o,c){return o==null?"":Xb.call(o,c)}function nn(o){var c=o==null?0:o.length;return c?o[c-1]:e}function Z_(o,c,f){var y=o==null?0:o.length;if(!y)return-1;var A=y;return f!==e&&(A=gt(f),A=A<0?ne(y+A,0):fe(A,y-1)),c===c?vu(o,c,A):ft(o,Ta,A,!0)}function Q_(o,c){return o&&o.length?fd(o,gt(c)):e}var t0=bt(np);function np(o,c){return o&&o.length&&c&&c.length?Du(o,c):o}function e0(o,c,f){return o&&o.length&&c&&c.length?Du(o,c,st(f,2)):o}function n0(o,c,f){return o&&o.length&&c&&c.length?Du(o,c,e,f):o}var i0=$n(function(o,c){var f=o==null?0:o.length,y=Ou(o,c);return gd(o,It(c,function(A){return Xn(A,f)?+A:A}).sort(Od)),y});function r0(o,c){var f=[];if(!(o&&o.length))return f;var y=-1,A=[],E=o.length;for(c=st(c,3);++y<E;){var M=o[y];c(M,y,o)&&(f.push(M),A.push(y))}return gd(o,A),f}function Qu(o){return o==null?o:Jb.call(o)}function s0(o,c,f){var y=o==null?0:o.length;return y?(f&&typeof f!="number"&&Oe(o,c,f)?(c=0,f=y):(c=c==null?0:gt(c),f=f===e?y:gt(f)),en(o,c,f)):[]}function o0(o,c){return $a(o,c)}function a0(o,c,f){return Nu(o,c,st(f,2))}function c0(o,c){var f=o==null?0:o.length;if(f){var y=$a(o,c);if(y<f&&dn(o[y],c))return y}return-1}function l0(o,c){return $a(o,c,!0)}function u0(o,c,f){return Nu(o,c,st(f,2),!0)}function h0(o,c){var f=o==null?0:o.length;if(f){var y=$a(o,c,!0)-1;if(dn(o[y],c))return y}return-1}function f0(o){return o&&o.length?vd(o):[]}function d0(o,c){return o&&o.length?vd(o,st(c,2)):[]}function p0(o){var c=o==null?0:o.length;return c?en(o,1,c):[]}function g0(o,c,f){return o&&o.length?(c=f||c===e?1:gt(c),en(o,0,c<0?0:c)):[]}function m0(o,c,f){var y=o==null?0:o.length;return y?(c=f||c===e?1:gt(c),c=y-c,en(o,c<0?0:c,y)):[]}function v0(o,c){return o&&o.length?Xa(o,st(c,3),!1,!0):[]}function b0(o,c){return o&&o.length?Xa(o,st(c,3)):[]}var y0=bt(function(o){return mi(ue(o,1,Yt,!0))}),_0=bt(function(o){var c=nn(o);return Yt(c)&&(c=e),mi(ue(o,1,Yt,!0),st(c,2))}),w0=bt(function(o){var c=nn(o);return c=typeof c=="function"?c:e,mi(ue(o,1,Yt,!0),e,c)});function x0(o){return o&&o.length?mi(o):[]}function S0(o,c){return o&&o.length?mi(o,st(c,2)):[]}function T0(o,c){return c=typeof c=="function"?c:e,o&&o.length?mi(o,e,c):[]}function th(o){if(!(o&&o.length))return[];var c=0;return o=Sn(o,function(f){if(Yt(f))return c=ne(f.length,c),!0}),Ps(c,function(f){return It(o,Cs(f))})}function ip(o,c){if(!(o&&o.length))return[];var f=th(o);return c==null?f:It(f,function(y){return we(c,e,y)})}var O0=bt(function(o,c){return Yt(o)?Vs(o,c):[]}),C0=bt(function(o){return Bu(Sn(o,Yt))}),A0=bt(function(o){var c=nn(o);return Yt(c)&&(c=e),Bu(Sn(o,Yt),st(c,2))}),k0=bt(function(o){var c=nn(o);return c=typeof c=="function"?c:e,Bu(Sn(o,Yt),e,c)}),E0=bt(th);function P0(o,c){return wd(o||[],c||[],Us)}function M0(o,c){return wd(o||[],c||[],Xs)}var R0=bt(function(o){var c=o.length,f=c>1?o[c-1]:e;return f=typeof f=="function"?(o.pop(),f):e,ip(o,f)});function rp(o){var c=k(o);return c.__chain__=!0,c}function D0(o,c){return c(o),o}function nc(o,c){return c(o)}var L0=$n(function(o){var c=o.length,f=c?o[0]:0,y=this.__wrapped__,A=function(E){return Ou(E,o)};return c>1||this.__actions__.length||!(y instanceof wt)||!Xn(f)?this.thru(A):(y=y.slice(f,+f+(c?1:0)),y.__actions__.push({func:nc,args:[A],thisArg:e}),new Qe(y,this.__chain__).thru(function(E){return c&&!E.length&&E.push(e),E}))});function I0(){return rp(this)}function N0(){return new Qe(this.value(),this.__chain__)}function F0(){this.__values__===e&&(this.__values__=bp(this.value()));var o=this.__index__>=this.__values__.length,c=o?e:this.__values__[this.__index__++];return{done:o,value:c}}function B0(){return this}function H0(o){for(var c,f=this;f instanceof Wa;){var y=Jd(f);y.__index__=0,y.__values__=e,c?A.__wrapped__=y:c=y;var A=y;f=f.__wrapped__}return A.__wrapped__=o,c}function z0(){var o=this.__wrapped__;if(o instanceof wt){var c=o;return this.__actions__.length&&(c=new wt(this)),c=c.reverse(),c.__actions__.push({func:nc,args:[Qu],thisArg:e}),new Qe(c,this.__chain__)}return this.thru(Qu)}function W0(){return _d(this.__wrapped__,this.__actions__)}var j0=Ya(function(o,c,f){Ct.call(o,f)?++o[f]:Vn(o,f,1)});function U0(o,c,f){var y=pt(o)?xs:Dy;return f&&Oe(o,c,f)&&(c=e),y(o,st(c,3))}function V0(o,c){var f=pt(o)?Sn:id;return f(o,st(c,3))}var q0=Md(Zd),$0=Md(Qd);function X0(o,c){return ue(ic(o,c),1)}function Y0(o,c){return ue(ic(o,c),ot)}function K0(o,c,f){return f=f===e?1:gt(f),ue(ic(o,c),f)}function sp(o,c){var f=pt(o)?xe:gi;return f(o,st(c,3))}function op(o,c){var f=pt(o)?ru:nd;return f(o,st(c,3))}var G0=Ya(function(o,c,f){Ct.call(o,f)?o[f].push(c):Vn(o,f,[c])});function J0(o,c,f,y){o=Re(o)?o:Fr(o),f=f&&!y?gt(f):0;var A=o.length;return f<0&&(f=ne(A+f,0)),cc(o)?f<=A&&o.indexOf(c,f)>-1:!!A&&On(o,c,f)>-1}var Z0=bt(function(o,c,f){var y=-1,A=typeof c=="function",E=Re(o)?O(o.length):[];return gi(o,function(M){E[++y]=A?we(c,M,f):qs(M,c,f)}),E}),Q0=Ya(function(o,c,f){Vn(o,f,c)});function ic(o,c){var f=pt(o)?It:ld;return f(o,st(c,3))}function tw(o,c,f,y){return o==null?[]:(pt(c)||(c=c==null?[]:[c]),f=y?e:f,pt(f)||(f=f==null?[]:[f]),dd(o,c,f))}var ew=Ya(function(o,c,f){o[f?0:1].push(c)},function(){return[[],[]]});function nw(o,c,f){var y=pt(o)?Ts:ks,A=arguments.length<3;return y(o,st(c,4),f,A,gi)}function iw(o,c,f){var y=pt(o)?su:ks,A=arguments.length<3;return y(o,st(c,4),f,A,nd)}function rw(o,c){var f=pt(o)?Sn:id;return f(o,oc(st(c,3)))}function sw(o){var c=pt(o)?Zf:Jy;return c(o)}function ow(o,c,f){(f?Oe(o,c,f):c===e)?c=1:c=gt(c);var y=pt(o)?ky:Zy;return y(o,c)}function aw(o){var c=pt(o)?Ey:t_;return c(o)}function cw(o){if(o==null)return 0;if(Re(o))return cc(o)?pi(o):o.length;var c=de(o);return c==ye||c==te?o.size:Mu(o).length}function lw(o,c,f){var y=pt(o)?Os:e_;return f&&Oe(o,c,f)&&(c=e),y(o,st(c,3))}var uw=bt(function(o,c){if(o==null)return[];var f=c.length;return f>1&&Oe(o,c[0],c[1])?c=[]:f>2&&Oe(c[0],c[1],c[2])&&(c=[c[0]]),dd(o,ue(c,1),[])}),rc=Vb||function(){return ee.Date.now()};function hw(o,c){if(typeof c!="function")throw new Pe(a);return o=gt(o),function(){if(--o<1)return c.apply(this,arguments)}}function ap(o,c,f){return c=f?e:c,c=o&&c==null?o.length:c,qn(o,N,e,e,e,e,c)}function cp(o,c){var f;if(typeof c!="function")throw new Pe(a);return o=gt(o),function(){return--o>0&&(f=c.apply(this,arguments)),o<=1&&(c=e),f}}var eh=bt(function(o,c,f){var y=T;if(f.length){var A=Cn(f,Ir(eh));y|=D}return qn(o,y,c,f,A)}),lp=bt(function(o,c,f){var y=T|P;if(f.length){var A=Cn(f,Ir(lp));y|=D}return qn(c,y,o,f,A)});function up(o,c,f){c=f?e:c;var y=qn(o,B,e,e,e,e,e,c);return y.placeholder=up.placeholder,y}function hp(o,c,f){c=f?e:c;var y=qn(o,H,e,e,e,e,e,c);return y.placeholder=hp.placeholder,y}function fp(o,c,f){var y,A,E,M,I,z,q=0,$=!1,Y=!1,tt=!0;if(typeof o!="function")throw new Pe(a);c=rn(c)||0,qt(f)&&($=!!f.leading,Y="maxWait"in f,E=Y?ne(rn(f.maxWait)||0,c):E,tt="trailing"in f?!!f.trailing:tt);function nt(Kt){var pn=y,Gn=A;return y=A=e,q=Kt,M=o.apply(Gn,pn),M}function at(Kt){return q=Kt,I=Gs(yt,c),$?nt(Kt):M}function vt(Kt){var pn=Kt-z,Gn=Kt-q,Mp=c-pn;return Y?fe(Mp,E-Gn):Mp}function ct(Kt){var pn=Kt-z,Gn=Kt-q;return z===e||pn>=c||pn<0||Y&&Gn>=E}function yt(){var Kt=rc();if(ct(Kt))return St(Kt);I=Gs(yt,vt(Kt))}function St(Kt){return I=e,tt&&y?nt(Kt):(y=A=e,M)}function Xe(){I!==e&&xd(I),q=0,y=z=A=I=e}function Ce(){return I===e?M:St(rc())}function Ye(){var Kt=rc(),pn=ct(Kt);if(y=arguments,A=this,z=Kt,pn){if(I===e)return at(z);if(Y)return xd(I),I=Gs(yt,c),nt(z)}return I===e&&(I=Gs(yt,c)),M}return Ye.cancel=Xe,Ye.flush=Ce,Ye}var fw=bt(function(o,c){return ed(o,1,c)}),dw=bt(function(o,c,f){return ed(o,rn(c)||0,f)});function pw(o){return qn(o,V)}function sc(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new Pe(a);var f=function(){var y=arguments,A=c?c.apply(this,y):y[0],E=f.cache;if(E.has(A))return E.get(A);var M=o.apply(this,y);return f.cache=E.set(A,M)||E,M};return f.cache=new(sc.Cache||Un),f}sc.Cache=Un;function oc(o){if(typeof o!="function")throw new Pe(a);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function gw(o){return cp(2,o)}var mw=n_(function(o,c){c=c.length==1&&pt(c[0])?It(c[0],Se(st())):It(ue(c,1),Se(st()));var f=c.length;return bt(function(y){for(var A=-1,E=fe(y.length,f);++A<E;)y[A]=c[A].call(this,y[A]);return we(o,this,y)})}),nh=bt(function(o,c){var f=Cn(c,Ir(nh));return qn(o,D,e,c,f)}),dp=bt(function(o,c){var f=Cn(c,Ir(dp));return qn(o,L,e,c,f)}),vw=$n(function(o,c){return qn(o,W,e,e,e,c)});function bw(o,c){if(typeof o!="function")throw new Pe(a);return c=c===e?c:gt(c),bt(o,c)}function yw(o,c){if(typeof o!="function")throw new Pe(a);return c=c==null?0:ne(gt(c),0),bt(function(f){var y=f[c],A=bi(f,0,c);return y&&Tn(A,y),we(o,this,A)})}function _w(o,c,f){var y=!0,A=!0;if(typeof o!="function")throw new Pe(a);return qt(f)&&(y="leading"in f?!!f.leading:y,A="trailing"in f?!!f.trailing:A),fp(o,c,{leading:y,maxWait:c,trailing:A})}function ww(o){return ap(o,1)}function xw(o,c){return nh(zu(c),o)}function Sw(){if(!arguments.length)return[];var o=arguments[0];return pt(o)?o:[o]}function Tw(o){return tn(o,x)}function Ow(o,c){return c=typeof c=="function"?c:e,tn(o,x,c)}function Cw(o){return tn(o,b|x)}function Aw(o,c){return c=typeof c=="function"?c:e,tn(o,b|x,c)}function kw(o,c){return c==null||td(o,c,oe(c))}function dn(o,c){return o===c||o!==o&&c!==c}var Ew=Za(ku),Pw=Za(function(o,c){return o>=c}),Xi=od(function(){return arguments}())?od:function(o){return $t(o)&&Ct.call(o,"callee")&&!$f.call(o,"callee")},pt=O.isArray,Mw=ba?Se(ba):Hy;function Re(o){return o!=null&&ac(o.length)&&!Yn(o)}function Yt(o){return $t(o)&&Re(o)}function Rw(o){return o===!0||o===!1||$t(o)&&Te(o)==Pt}var yi=$b||dh,Dw=ya?Se(ya):zy;function Lw(o){return $t(o)&&o.nodeType===1&&!Js(o)}function Iw(o){if(o==null)return!0;if(Re(o)&&(pt(o)||typeof o=="string"||typeof o.splice=="function"||yi(o)||Nr(o)||Xi(o)))return!o.length;var c=de(o);if(c==ye||c==te)return!o.size;if(Ks(o))return!Mu(o).length;for(var f in o)if(Ct.call(o,f))return!1;return!0}function Nw(o,c){return $s(o,c)}function Fw(o,c,f){f=typeof f=="function"?f:e;var y=f?f(o,c):e;return y===e?$s(o,c,e,f):!!y}function ih(o){if(!$t(o))return!1;var c=Te(o);return c==un||c==Jr||typeof o.message=="string"&&typeof o.name=="string"&&!Js(o)}function Bw(o){return typeof o=="number"&&Yf(o)}function Yn(o){if(!qt(o))return!1;var c=Te(o);return c==he||c==ci||c==ai||c==gr}function pp(o){return typeof o=="number"&&o==gt(o)}function ac(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=mt}function qt(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function $t(o){return o!=null&&typeof o=="object"}var gp=Sr?Se(Sr):jy;function Hw(o,c){return o===c||Pu(o,c,Xu(c))}function zw(o,c,f){return f=typeof f=="function"?f:e,Pu(o,c,Xu(c),f)}function Ww(o){return mp(o)&&o!=+o}function jw(o){if(O_(o))throw new U(s);return ad(o)}function Uw(o){return o===null}function Vw(o){return o==null}function mp(o){return typeof o=="number"||$t(o)&&Te(o)==Ue}function Js(o){if(!$t(o)||Te(o)!=ke)return!1;var c=Er(o);if(c===null)return!0;var f=Ct.call(c,"constructor")&&c.constructor;return typeof f=="function"&&f instanceof f&&Fi.call(f)==Da}var rh=xn?Se(xn):Uy;function qw(o){return pp(o)&&o>=-mt&&o<=mt}var vp=_a?Se(_a):Vy;function cc(o){return typeof o=="string"||!pt(o)&&$t(o)&&Te(o)==yn}function $e(o){return typeof o=="symbol"||$t(o)&&Te(o)==Nn}var Nr=wa?Se(wa):qy;function $w(o){return o===e}function Xw(o){return $t(o)&&de(o)==_n}function Yw(o){return $t(o)&&Te(o)==Fn}var Kw=Za(Ru),Gw=Za(function(o,c){return o<=c});function bp(o){if(!o)return[];if(Re(o))return cc(o)?Ve(o):Me(o);if(Bs&&o[Bs])return pu(o[Bs]());var c=de(o),f=c==ye?Rs:c==te?Cr:Fr;return f(o)}function Kn(o){if(!o)return o===0?o:0;if(o=rn(o),o===ot||o===-ot){var c=o<0?-1:1;return c*kt}return o===o?o:0}function gt(o){var c=Kn(o),f=c%1;return c===c?f?c-f:c:0}function yp(o){return o?Ui(gt(o),0,Et):0}function rn(o){if(typeof o=="number")return o;if($e(o))return Zt;if(qt(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=qt(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=Ca(o);var f=Ml.test(o);return f||Dl.test(o)?eu(o.slice(2),f?2:8):Zo.test(o)?Zt:+o}function _p(o){return En(o,De(o))}function Jw(o){return o?Ui(gt(o),-mt,mt):o===0?o:0}function Mt(o){return o==null?"":qe(o)}var Zw=Dr(function(o,c){if(Ks(c)||Re(c)){En(c,oe(c),o);return}for(var f in c)Ct.call(c,f)&&Us(o,f,c[f])}),wp=Dr(function(o,c){En(c,De(c),o)}),lc=Dr(function(o,c,f,y){En(c,De(c),o,y)}),Qw=Dr(function(o,c,f,y){En(c,oe(c),o,y)}),tx=$n(Ou);function ex(o,c){var f=Rr(o);return c==null?f:Qf(f,c)}var nx=bt(function(o,c){o=et(o);var f=-1,y=c.length,A=y>2?c[2]:e;for(A&&Oe(c[0],c[1],A)&&(y=1);++f<y;)for(var E=c[f],M=De(E),I=-1,z=M.length;++I<z;){var q=M[I],$=o[q];($===e||dn($,Wn[q])&&!Ct.call(o,q))&&(o[q]=E[q])}return o}),ix=bt(function(o){return o.push(e,Bd),we(xp,e,o)});function rx(o,c){return Sa(o,st(c,3),kn)}function sx(o,c){return Sa(o,st(c,3),Au)}function ox(o,c){return o==null?o:Cu(o,st(c,3),De)}function ax(o,c){return o==null?o:rd(o,st(c,3),De)}function cx(o,c){return o&&kn(o,st(c,3))}function lx(o,c){return o&&Au(o,st(c,3))}function ux(o){return o==null?[]:Va(o,oe(o))}function hx(o){return o==null?[]:Va(o,De(o))}function sh(o,c,f){var y=o==null?e:Vi(o,c);return y===e?f:y}function fx(o,c){return o!=null&&Wd(o,c,Iy)}function oh(o,c){return o!=null&&Wd(o,c,Ny)}var dx=Dd(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=Bi.call(c)),o[c]=f},ch(Le)),px=Dd(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=Bi.call(c)),Ct.call(o,c)?o[c].push(f):o[c]=[f]},st),gx=bt(qs);function oe(o){return Re(o)?Jf(o):Mu(o)}function De(o){return Re(o)?Jf(o,!0):$y(o)}function mx(o,c){var f={};return c=st(c,3),kn(o,function(y,A,E){Vn(f,c(y,A,E),y)}),f}function vx(o,c){var f={};return c=st(c,3),kn(o,function(y,A,E){Vn(f,A,c(y,A,E))}),f}var bx=Dr(function(o,c,f){qa(o,c,f)}),xp=Dr(function(o,c,f,y){qa(o,c,f,y)}),yx=$n(function(o,c){var f={};if(o==null)return f;var y=!1;c=It(c,function(E){return E=vi(E,o),y||(y=E.length>1),E}),En(o,qu(o),f),y&&(f=tn(f,b|_|x,d_));for(var A=c.length;A--;)Fu(f,c[A]);return f});function _x(o,c){return Sp(o,oc(st(c)))}var wx=$n(function(o,c){return o==null?{}:Yy(o,c)});function Sp(o,c){if(o==null)return{};var f=It(qu(o),function(y){return[y]});return c=st(c),pd(o,f,function(y,A){return c(y,A[0])})}function xx(o,c,f){c=vi(c,o);var y=-1,A=c.length;for(A||(A=1,o=e);++y<A;){var E=o==null?e:o[Pn(c[y])];E===e&&(y=A,E=f),o=Yn(E)?E.call(o):E}return o}function Sx(o,c,f){return o==null?o:Xs(o,c,f)}function Tx(o,c,f,y){return y=typeof y=="function"?y:e,o==null?o:Xs(o,c,f,y)}var Tp=Nd(oe),Op=Nd(De);function Ox(o,c,f){var y=pt(o),A=y||yi(o)||Nr(o);if(c=st(c,4),f==null){var E=o&&o.constructor;A?f=y?new E:[]:qt(o)?f=Yn(E)?Rr(Er(o)):{}:f={}}return(A?xe:kn)(o,function(M,I,z){return c(f,M,I,z)}),f}function Cx(o,c){return o==null?!0:Fu(o,c)}function Ax(o,c,f){return o==null?o:yd(o,c,zu(f))}function kx(o,c,f,y){return y=typeof y=="function"?y:e,o==null?o:yd(o,c,zu(f),y)}function Fr(o){return o==null?[]:Ms(o,oe(o))}function Ex(o){return o==null?[]:Ms(o,De(o))}function Px(o,c,f){return f===e&&(f=c,c=e),f!==e&&(f=rn(f),f=f===f?f:0),c!==e&&(c=rn(c),c=c===c?c:0),Ui(rn(o),c,f)}function Mx(o,c,f){return c=Kn(c),f===e?(f=c,c=0):f=Kn(f),o=rn(o),Fy(o,c,f)}function Rx(o,c,f){if(f&&typeof f!="boolean"&&Oe(o,c,f)&&(c=f=e),f===e&&(typeof c=="boolean"?(f=c,c=e):typeof o=="boolean"&&(f=o,o=e)),o===e&&c===e?(o=0,c=1):(o=Kn(o),c===e?(c=o,o=0):c=Kn(c)),o>c){var y=o;o=c,c=y}if(f||o%1||c%1){var A=Kf();return fe(o+A*(c-o+tu("1e-"+((A+"").length-1))),c)}return Lu(o,c)}var Dx=Lr(function(o,c,f){return c=c.toLowerCase(),o+(f?Cp(c):c)});function Cp(o){return ah(Mt(o).toLowerCase())}function Ap(o){return o=Mt(o),o&&o.replace(Il,uu).replace(Xl,"")}function Lx(o,c,f){o=Mt(o),c=qe(c);var y=o.length;f=f===e?y:Ui(gt(f),0,y);var A=f;return f-=c.length,f>=0&&o.slice(f,A)==c}function Ix(o){return o=Mt(o),o&&Sl.test(o)?o.replace($o,hu):o}function Nx(o){return o=Mt(o),o&&li.test(o)?o.replace(us,"\\$&"):o}var Fx=Lr(function(o,c,f){return o+(f?"-":"")+c.toLowerCase()}),Bx=Lr(function(o,c,f){return o+(f?" ":"")+c.toLowerCase()}),Hx=Pd("toLowerCase");function zx(o,c,f){o=Mt(o),c=gt(c);var y=c?pi(o):0;if(!c||y>=c)return o;var A=(c-y)/2;return Ja(Ba(A),f)+o+Ja(Fa(A),f)}function Wx(o,c,f){o=Mt(o),c=gt(c);var y=c?pi(o):0;return c&&y<c?o+Ja(c-y,f):o}function jx(o,c,f){o=Mt(o),c=gt(c);var y=c?pi(o):0;return c&&y<c?Ja(c-y,f)+o:o}function Ux(o,c,f){return f||c==null?c=0:c&&(c=+c),Gb(Mt(o).replace(hs,""),c||0)}function Vx(o,c,f){return(f?Oe(o,c,f):c===e)?c=1:c=gt(c),Iu(Mt(o),c)}function qx(){var o=arguments,c=Mt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var $x=Lr(function(o,c,f){return o+(f?"_":"")+c.toLowerCase()});function Xx(o,c,f){return f&&typeof f!="number"&&Oe(o,c,f)&&(c=f=e),f=f===e?Et:f>>>0,f?(o=Mt(o),o&&(typeof c=="string"||c!=null&&!rh(c))&&(c=qe(c),!c&&di(o))?bi(Ve(o),0,f):o.split(c,f)):[]}var Yx=Lr(function(o,c,f){return o+(f?" ":"")+ah(c)});function Kx(o,c,f){return o=Mt(o),f=f==null?0:Ui(gt(f),0,o.length),c=qe(c),o.slice(f,f+c.length)==c}function Gx(o,c,f){var y=k.templateSettings;f&&Oe(o,c,f)&&(c=e),o=Mt(o),c=lc({},c,y,Fd);var A=lc({},c.imports,y.imports,Fd),E=oe(A),M=Ms(A,E),I,z,q=0,$=c.interpolate||vr,Y="__p += '",tt=Wt((c.escape||vr).source+"|"+$.source+"|"+($===Je?mr:vr).source+"|"+(c.evaluate||vr).source+"|$","g"),nt="//# sourceURL="+(Ct.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Jl+"]")+`
|
||
`;o.replace(tt,function(ct,yt,St,Xe,Ce,Ye){return St||(St=Xe),Y+=o.slice(q,Ye).replace(Nl,fu),yt&&(I=!0,Y+=`' +
|
||
__e(`+yt+`) +
|
||
'`),Ce&&(z=!0,Y+=`';
|
||
`+Ce+`;
|
||
__p += '`),St&&(Y+=`' +
|
||
((__t = (`+St+`)) == null ? '' : __t) +
|
||
'`),q=Ye+ct.length,ct}),Y+=`';
|
||
`;var at=Ct.call(c,"variable")&&c.variable;if(!at)Y=`with (obj) {
|
||
`+Y+`
|
||
}
|
||
`;else if(El.test(at))throw new U(l);Y=(z?Y.replace(as,""):Y).replace(cs,"$1").replace(wl,"$1;"),Y="function("+(at||"obj")+`) {
|
||
`+(at?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(I?", __e = _.escape":"")+(z?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+Y+`return __p
|
||
}`;var vt=Ep(function(){return J(E,nt+"return "+Y).apply(e,M)});if(vt.source=Y,ih(vt))throw vt;return vt}function Jx(o){return Mt(o).toLowerCase()}function Zx(o){return Mt(o).toUpperCase()}function Qx(o,c,f){if(o=Mt(o),o&&(f||c===e))return Ca(o);if(!o||!(c=qe(c)))return o;var y=Ve(o),A=Ve(c),E=Aa(y,A),M=ka(y,A)+1;return bi(y,E,M).join("")}function tS(o,c,f){if(o=Mt(o),o&&(f||c===e))return o.slice(0,Ma(o)+1);if(!o||!(c=qe(c)))return o;var y=Ve(o),A=ka(y,Ve(c))+1;return bi(y,0,A).join("")}function eS(o,c,f){if(o=Mt(o),o&&(f||c===e))return o.replace(hs,"");if(!o||!(c=qe(c)))return o;var y=Ve(o),A=Aa(y,Ve(c));return bi(y,A).join("")}function nS(o,c){var f=X,y=K;if(qt(c)){var A="separator"in c?c.separator:A;f="length"in c?gt(c.length):f,y="omission"in c?qe(c.omission):y}o=Mt(o);var E=o.length;if(di(o)){var M=Ve(o);E=M.length}if(f>=E)return o;var I=f-pi(y);if(I<1)return y;var z=M?bi(M,0,I).join(""):o.slice(0,I);if(A===e)return z+y;if(M&&(I+=z.length-I),rh(A)){if(o.slice(I).search(A)){var q,$=z;for(A.global||(A=Wt(A.source,Mt(Jo.exec(A))+"g")),A.lastIndex=0;q=A.exec($);)var Y=q.index;z=z.slice(0,Y===e?I:Y)}}else if(o.indexOf(qe(A),I)!=I){var tt=z.lastIndexOf(A);tt>-1&&(z=z.slice(0,tt))}return z+y}function iS(o){return o=Mt(o),o&&xl.test(o)?o.replace(qo,Ra):o}var rS=Lr(function(o,c,f){return o+(f?" ":"")+c.toUpperCase()}),ah=Pd("toUpperCase");function kp(o,c,f){return o=Mt(o),c=f?e:c,c===e?du(o)?m(o):au(o):o.match(c)||[]}var Ep=bt(function(o,c){try{return we(o,e,c)}catch(f){return ih(f)?f:new U(f)}}),sS=$n(function(o,c){return xe(c,function(f){f=Pn(f),Vn(o,f,eh(o[f],o))}),o});function oS(o){var c=o==null?0:o.length,f=st();return o=c?It(o,function(y){if(typeof y[1]!="function")throw new Pe(a);return[f(y[0]),y[1]]}):[],bt(function(y){for(var A=-1;++A<c;){var E=o[A];if(we(E[0],this,y))return we(E[1],this,y)}})}function aS(o){return Ry(tn(o,b))}function ch(o){return function(){return o}}function cS(o,c){return o==null||o!==o?c:o}var lS=Rd(),uS=Rd(!0);function Le(o){return o}function lh(o){return cd(typeof o=="function"?o:tn(o,b))}function hS(o){return ud(tn(o,b))}function fS(o,c){return hd(o,tn(c,b))}var dS=bt(function(o,c){return function(f){return qs(f,o,c)}}),pS=bt(function(o,c){return function(f){return qs(o,f,c)}});function uh(o,c,f){var y=oe(c),A=Va(c,y);f==null&&!(qt(c)&&(A.length||!y.length))&&(f=c,c=o,o=this,A=Va(c,oe(c)));var E=!(qt(f)&&"chain"in f)||!!f.chain,M=Yn(o);return xe(A,function(I){var z=c[I];o[I]=z,M&&(o.prototype[I]=function(){var q=this.__chain__;if(E||q){var $=o(this.__wrapped__),Y=$.__actions__=Me(this.__actions__);return Y.push({func:z,args:arguments,thisArg:o}),$.__chain__=q,$}return z.apply(o,Tn([this.value()],arguments))})}),o}function gS(){return ee._===this&&(ee._=Is),this}function hh(){}function mS(o){return o=gt(o),bt(function(c){return fd(c,o)})}var vS=ju(It),bS=ju(xs),yS=ju(Os);function Pp(o){return Ku(o)?Cs(Pn(o)):Ky(o)}function _S(o){return function(c){return o==null?e:Vi(o,c)}}var wS=Ld(),xS=Ld(!0);function fh(){return[]}function dh(){return!1}function SS(){return{}}function TS(){return""}function OS(){return!0}function CS(o,c){if(o=gt(o),o<1||o>mt)return[];var f=Et,y=fe(o,Et);c=st(c),o-=Et;for(var A=Ps(y,c);++f<o;)c(f);return A}function AS(o){return pt(o)?It(o,Pn):$e(o)?[o]:Me(Gd(Mt(o)))}function kS(o){var c=++_u;return Mt(o)+c}var ES=Ga(function(o,c){return o+c},0),PS=Uu("ceil"),MS=Ga(function(o,c){return o/c},1),RS=Uu("floor");function DS(o){return o&&o.length?Ua(o,Le,ku):e}function LS(o,c){return o&&o.length?Ua(o,st(c,2),ku):e}function IS(o){return Oa(o,Le)}function NS(o,c){return Oa(o,st(c,2))}function FS(o){return o&&o.length?Ua(o,Le,Ru):e}function BS(o,c){return o&&o.length?Ua(o,st(c,2),Ru):e}var HS=Ga(function(o,c){return o*c},1),zS=Uu("round"),WS=Ga(function(o,c){return o-c},0);function jS(o){return o&&o.length?Es(o,Le):0}function US(o,c){return o&&o.length?Es(o,st(c,2)):0}return k.after=hw,k.ary=ap,k.assign=Zw,k.assignIn=wp,k.assignInWith=lc,k.assignWith=Qw,k.at=tx,k.before=cp,k.bind=eh,k.bindAll=sS,k.bindKey=lp,k.castArray=Sw,k.chain=rp,k.chunk=R_,k.compact=D_,k.concat=L_,k.cond=oS,k.conforms=aS,k.constant=ch,k.countBy=j0,k.create=ex,k.curry=up,k.curryRight=hp,k.debounce=fp,k.defaults=nx,k.defaultsDeep=ix,k.defer=fw,k.delay=dw,k.difference=I_,k.differenceBy=N_,k.differenceWith=F_,k.drop=B_,k.dropRight=H_,k.dropRightWhile=z_,k.dropWhile=W_,k.fill=j_,k.filter=V0,k.flatMap=X0,k.flatMapDeep=Y0,k.flatMapDepth=K0,k.flatten=tp,k.flattenDeep=U_,k.flattenDepth=V_,k.flip=pw,k.flow=lS,k.flowRight=uS,k.fromPairs=q_,k.functions=ux,k.functionsIn=hx,k.groupBy=G0,k.initial=X_,k.intersection=Y_,k.intersectionBy=K_,k.intersectionWith=G_,k.invert=dx,k.invertBy=px,k.invokeMap=Z0,k.iteratee=lh,k.keyBy=Q0,k.keys=oe,k.keysIn=De,k.map=ic,k.mapKeys=mx,k.mapValues=vx,k.matches=hS,k.matchesProperty=fS,k.memoize=sc,k.merge=bx,k.mergeWith=xp,k.method=dS,k.methodOf=pS,k.mixin=uh,k.negate=oc,k.nthArg=mS,k.omit=yx,k.omitBy=_x,k.once=gw,k.orderBy=tw,k.over=vS,k.overArgs=mw,k.overEvery=bS,k.overSome=yS,k.partial=nh,k.partialRight=dp,k.partition=ew,k.pick=wx,k.pickBy=Sp,k.property=Pp,k.propertyOf=_S,k.pull=t0,k.pullAll=np,k.pullAllBy=e0,k.pullAllWith=n0,k.pullAt=i0,k.range=wS,k.rangeRight=xS,k.rearg=vw,k.reject=rw,k.remove=r0,k.rest=bw,k.reverse=Qu,k.sampleSize=ow,k.set=Sx,k.setWith=Tx,k.shuffle=aw,k.slice=s0,k.sortBy=uw,k.sortedUniq=f0,k.sortedUniqBy=d0,k.split=Xx,k.spread=yw,k.tail=p0,k.take=g0,k.takeRight=m0,k.takeRightWhile=v0,k.takeWhile=b0,k.tap=D0,k.throttle=_w,k.thru=nc,k.toArray=bp,k.toPairs=Tp,k.toPairsIn=Op,k.toPath=AS,k.toPlainObject=_p,k.transform=Ox,k.unary=ww,k.union=y0,k.unionBy=_0,k.unionWith=w0,k.uniq=x0,k.uniqBy=S0,k.uniqWith=T0,k.unset=Cx,k.unzip=th,k.unzipWith=ip,k.update=Ax,k.updateWith=kx,k.values=Fr,k.valuesIn=Ex,k.without=O0,k.words=kp,k.wrap=xw,k.xor=C0,k.xorBy=A0,k.xorWith=k0,k.zip=E0,k.zipObject=P0,k.zipObjectDeep=M0,k.zipWith=R0,k.entries=Tp,k.entriesIn=Op,k.extend=wp,k.extendWith=lc,uh(k,k),k.add=ES,k.attempt=Ep,k.camelCase=Dx,k.capitalize=Cp,k.ceil=PS,k.clamp=Px,k.clone=Tw,k.cloneDeep=Cw,k.cloneDeepWith=Aw,k.cloneWith=Ow,k.conformsTo=kw,k.deburr=Ap,k.defaultTo=cS,k.divide=MS,k.endsWith=Lx,k.eq=dn,k.escape=Ix,k.escapeRegExp=Nx,k.every=U0,k.find=q0,k.findIndex=Zd,k.findKey=rx,k.findLast=$0,k.findLastIndex=Qd,k.findLastKey=sx,k.floor=RS,k.forEach=sp,k.forEachRight=op,k.forIn=ox,k.forInRight=ax,k.forOwn=cx,k.forOwnRight=lx,k.get=sh,k.gt=Ew,k.gte=Pw,k.has=fx,k.hasIn=oh,k.head=ep,k.identity=Le,k.includes=J0,k.indexOf=$_,k.inRange=Mx,k.invoke=gx,k.isArguments=Xi,k.isArray=pt,k.isArrayBuffer=Mw,k.isArrayLike=Re,k.isArrayLikeObject=Yt,k.isBoolean=Rw,k.isBuffer=yi,k.isDate=Dw,k.isElement=Lw,k.isEmpty=Iw,k.isEqual=Nw,k.isEqualWith=Fw,k.isError=ih,k.isFinite=Bw,k.isFunction=Yn,k.isInteger=pp,k.isLength=ac,k.isMap=gp,k.isMatch=Hw,k.isMatchWith=zw,k.isNaN=Ww,k.isNative=jw,k.isNil=Vw,k.isNull=Uw,k.isNumber=mp,k.isObject=qt,k.isObjectLike=$t,k.isPlainObject=Js,k.isRegExp=rh,k.isSafeInteger=qw,k.isSet=vp,k.isString=cc,k.isSymbol=$e,k.isTypedArray=Nr,k.isUndefined=$w,k.isWeakMap=Xw,k.isWeakSet=Yw,k.join=J_,k.kebabCase=Fx,k.last=nn,k.lastIndexOf=Z_,k.lowerCase=Bx,k.lowerFirst=Hx,k.lt=Kw,k.lte=Gw,k.max=DS,k.maxBy=LS,k.mean=IS,k.meanBy=NS,k.min=FS,k.minBy=BS,k.stubArray=fh,k.stubFalse=dh,k.stubObject=SS,k.stubString=TS,k.stubTrue=OS,k.multiply=HS,k.nth=Q_,k.noConflict=gS,k.noop=hh,k.now=rc,k.pad=zx,k.padEnd=Wx,k.padStart=jx,k.parseInt=Ux,k.random=Rx,k.reduce=nw,k.reduceRight=iw,k.repeat=Vx,k.replace=qx,k.result=xx,k.round=zS,k.runInContext=v,k.sample=sw,k.size=cw,k.snakeCase=$x,k.some=lw,k.sortedIndex=o0,k.sortedIndexBy=a0,k.sortedIndexOf=c0,k.sortedLastIndex=l0,k.sortedLastIndexBy=u0,k.sortedLastIndexOf=h0,k.startCase=Yx,k.startsWith=Kx,k.subtract=WS,k.sum=jS,k.sumBy=US,k.template=Gx,k.times=CS,k.toFinite=Kn,k.toInteger=gt,k.toLength=yp,k.toLower=Jx,k.toNumber=rn,k.toSafeInteger=Jw,k.toString=Mt,k.toUpper=Zx,k.trim=Qx,k.trimEnd=tS,k.trimStart=eS,k.truncate=nS,k.unescape=iS,k.uniqueId=kS,k.upperCase=rS,k.upperFirst=ah,k.each=sp,k.eachRight=op,k.first=ep,uh(k,function(){var o={};return kn(k,function(c,f){Ct.call(k.prototype,f)||(o[f]=c)}),o}(),{chain:!1}),k.VERSION=i,xe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){k[o].placeholder=k}),xe(["drop","take"],function(o,c){wt.prototype[o]=function(f){f=f===e?1:ne(gt(f),0);var y=this.__filtered__&&!c?new wt(this):this.clone();return y.__filtered__?y.__takeCount__=fe(f,y.__takeCount__):y.__views__.push({size:fe(f,Et),type:o+(y.__dir__<0?"Right":"")}),y},wt.prototype[o+"Right"]=function(f){return this.reverse()[o](f).reverse()}}),xe(["filter","map","takeWhile"],function(o,c){var f=c+1,y=f==lt||f==it;wt.prototype[o]=function(A){var E=this.clone();return E.__iteratees__.push({iteratee:st(A,3),type:f}),E.__filtered__=E.__filtered__||y,E}}),xe(["head","last"],function(o,c){var f="take"+(c?"Right":"");wt.prototype[o]=function(){return this[f](1).value()[0]}}),xe(["initial","tail"],function(o,c){var f="drop"+(c?"":"Right");wt.prototype[o]=function(){return this.__filtered__?new wt(this):this[f](1)}}),wt.prototype.compact=function(){return this.filter(Le)},wt.prototype.find=function(o){return this.filter(o).head()},wt.prototype.findLast=function(o){return this.reverse().find(o)},wt.prototype.invokeMap=bt(function(o,c){return typeof o=="function"?new wt(this):this.map(function(f){return qs(f,o,c)})}),wt.prototype.reject=function(o){return this.filter(oc(st(o)))},wt.prototype.slice=function(o,c){o=gt(o);var f=this;return f.__filtered__&&(o>0||c<0)?new wt(f):(o<0?f=f.takeRight(-o):o&&(f=f.drop(o)),c!==e&&(c=gt(c),f=c<0?f.dropRight(-c):f.take(c-o)),f)},wt.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},wt.prototype.toArray=function(){return this.take(Et)},kn(wt.prototype,function(o,c){var f=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),A=k[y?"take"+(c=="last"?"Right":""):c],E=y||/^find/.test(c);A&&(k.prototype[c]=function(){var M=this.__wrapped__,I=y?[1]:arguments,z=M instanceof wt,q=I[0],$=z||pt(M),Y=function(yt){var St=A.apply(k,Tn([yt],I));return y&&tt?St[0]:St};$&&f&&typeof q=="function"&&q.length!=1&&(z=$=!1);var tt=this.__chain__,nt=!!this.__actions__.length,at=E&&!tt,vt=z&&!nt;if(!E&&$){M=vt?M:new wt(this);var ct=o.apply(M,I);return ct.__actions__.push({func:nc,args:[Y],thisArg:e}),new Qe(ct,tt)}return at&&vt?o.apply(this,I):(ct=this.thru(Y),at?y?ct.value()[0]:ct.value():ct)})}),xe(["pop","push","shift","sort","splice","unshift"],function(o){var c=Ni[o],f=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",y=/^(?:pop|shift)$/.test(o);k.prototype[o]=function(){var A=arguments;if(y&&!this.__chain__){var E=this.value();return c.apply(pt(E)?E:[],A)}return this[f](function(M){return c.apply(pt(M)?M:[],A)})}}),kn(wt.prototype,function(o,c){var f=k[c];if(f){var y=f.name+"";Ct.call(Mr,y)||(Mr[y]=[]),Mr[y].push({name:c,func:f})}}),Mr[Ka(e,P).name]=[{name:"wrapper",func:e}],wt.prototype.clone=iy,wt.prototype.reverse=ry,wt.prototype.value=sy,k.prototype.at=L0,k.prototype.chain=I0,k.prototype.commit=N0,k.prototype.next=F0,k.prototype.plant=H0,k.prototype.reverse=z0,k.prototype.toJSON=k.prototype.valueOf=k.prototype.value=W0,k.prototype.first=k.prototype.head,Bs&&(k.prototype[Bs]=B0),k},g=p();zn?((zn.exports=g)._=g,_s._=g):ee._=g}).call(KS)}(co,co.exports)),co.exports}var JS=GS();const ZS=Jm(JS);function Zm(n,t){return function(){return n.apply(t,arguments)}}const{toString:QS}=Object.prototype,{getPrototypeOf:pf}=Object,{iterator:cl,toStringTag:Qm}=Symbol,ll=(n=>t=>{const e=QS.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),bn=n=>(n=n.toLowerCase(),t=>ll(t)===n),ul=n=>t=>typeof t===n,{isArray:Gr}=Array,jr=ul("undefined");function No(n){return n!==null&&!jr(n)&&n.constructor!==null&&!jr(n.constructor)&&Fe(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const tv=bn("ArrayBuffer");function tT(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&tv(n.buffer),t}const eT=ul("string"),Fe=ul("function"),ev=ul("number"),Fo=n=>n!==null&&typeof n=="object",nT=n=>n===!0||n===!1,Dc=n=>{if(ll(n)!=="object")return!1;const t=pf(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Qm in n)&&!(cl in n)},iT=n=>{if(!Fo(n)||No(n))return!1;try{return Object.keys(n).length===0&&Object.getPrototypeOf(n)===Object.prototype}catch{return!1}},rT=bn("Date"),sT=bn("File"),oT=n=>!!(n&&typeof n.uri<"u"),aT=n=>n&&typeof n.getParts<"u",cT=bn("Blob"),lT=bn("FileList"),uT=n=>Fo(n)&&Fe(n.pipe);function hT(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Lp=hT(),Ip=typeof Lp.FormData<"u"?Lp.FormData:void 0,fT=n=>{let t;return n&&(Ip&&n instanceof Ip||Fe(n.append)&&((t=ll(n))==="formdata"||t==="object"&&Fe(n.toString)&&n.toString()==="[object FormData]"))},dT=bn("URLSearchParams"),[pT,gT,mT,vT]=["ReadableStream","Request","Response","Headers"].map(bn),bT=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Bo(n,t,{allOwnKeys:e=!1}={}){if(n===null||typeof n>"u")return;let i,r;if(typeof n!="object"&&(n=[n]),Gr(n))for(i=0,r=n.length;i<r;i++)t.call(null,n[i],i,n);else{if(No(n))return;const s=e?Object.getOwnPropertyNames(n):Object.keys(n),a=s.length;let l;for(i=0;i<a;i++)l=s[i],t.call(null,n[l],l,n)}}function nv(n,t){if(No(n))return null;t=t.toLowerCase();const e=Object.keys(n);let i=e.length,r;for(;i-- >0;)if(r=e[i],t===r.toLowerCase())return r;return null}const ir=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,iv=n=>!jr(n)&&n!==ir;function zh(){const{caseless:n,skipUndefined:t}=iv(this)&&this||{},e={},i=(r,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const a=n&&nv(e,s)||s;Dc(e[a])&&Dc(r)?e[a]=zh(e[a],r):Dc(r)?e[a]=zh({},r):Gr(r)?e[a]=r.slice():(!t||!jr(r))&&(e[a]=r)};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Bo(arguments[r],i);return e}const yT=(n,t,e,{allOwnKeys:i}={})=>(Bo(t,(r,s)=>{e&&Fe(r)?Object.defineProperty(n,s,{value:Zm(r,e),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(n,s,{value:r,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),n),_T=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),wT=(n,t,e,i)=>{n.prototype=Object.create(t.prototype,i),Object.defineProperty(n.prototype,"constructor",{value:n,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},xT=(n,t,e,i)=>{let r,s,a;const l={};if(t=t||{},n==null)return t;do{for(r=Object.getOwnPropertyNames(n),s=r.length;s-- >0;)a=r[s],(!i||i(a,n,t))&&!l[a]&&(t[a]=n[a],l[a]=!0);n=e!==!1&&pf(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},ST=(n,t,e)=>{n=String(n),(e===void 0||e>n.length)&&(e=n.length),e-=t.length;const i=n.indexOf(t,e);return i!==-1&&i===e},TT=n=>{if(!n)return null;if(Gr(n))return n;let t=n.length;if(!ev(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=n[t];return e},OT=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&pf(Uint8Array)),CT=(n,t)=>{const i=(n&&n[cl]).call(n);let r;for(;(r=i.next())&&!r.done;){const s=r.value;t.call(n,s[0],s[1])}},AT=(n,t)=>{let e;const i=[];for(;(e=n.exec(t))!==null;)i.push(e);return i},kT=bn("HTMLFormElement"),ET=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,i,r){return i.toUpperCase()+r}),Np=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),PT=bn("RegExp"),rv=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),i={};Bo(e,(r,s)=>{let a;(a=t(r,s,n))!==!1&&(i[s]=a||r)}),Object.defineProperties(n,i)},MT=n=>{rv(n,(t,e)=>{if(Fe(n)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const i=n[e];if(Fe(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},RT=(n,t)=>{const e={},i=r=>{r.forEach(s=>{e[s]=!0})};return Gr(n)?i(n):i(String(n).split(t)),e},DT=()=>{},LT=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t;function IT(n){return!!(n&&Fe(n.append)&&n[Qm]==="FormData"&&n[cl])}const NT=n=>{const t=new Array(10),e=(i,r)=>{if(Fo(i)){if(t.indexOf(i)>=0)return;if(No(i))return i;if(!("toJSON"in i)){t[r]=i;const s=Gr(i)?[]:{};return Bo(i,(a,l)=>{const u=e(a,r+1);!jr(u)&&(s[l]=u)}),t[r]=void 0,s}}return i};return e(n,0)},FT=bn("AsyncFunction"),BT=n=>n&&(Fo(n)||Fe(n))&&Fe(n.then)&&Fe(n.catch),sv=((n,t)=>n?setImmediate:t?((e,i)=>(ir.addEventListener("message",({source:r,data:s})=>{r===ir&&s===e&&i.length&&i.shift()()},!1),r=>{i.push(r),ir.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",Fe(ir.postMessage)),HT=typeof queueMicrotask<"u"?queueMicrotask.bind(ir):typeof process<"u"&&process.nextTick||sv,zT=n=>n!=null&&Fe(n[cl]),j={isArray:Gr,isArrayBuffer:tv,isBuffer:No,isFormData:fT,isArrayBufferView:tT,isString:eT,isNumber:ev,isBoolean:nT,isObject:Fo,isPlainObject:Dc,isEmptyObject:iT,isReadableStream:pT,isRequest:gT,isResponse:mT,isHeaders:vT,isUndefined:jr,isDate:rT,isFile:sT,isReactNativeBlob:oT,isReactNative:aT,isBlob:cT,isRegExp:PT,isFunction:Fe,isStream:uT,isURLSearchParams:dT,isTypedArray:OT,isFileList:lT,forEach:Bo,merge:zh,extend:yT,trim:bT,stripBOM:_T,inherits:wT,toFlatObject:xT,kindOf:ll,kindOfTest:bn,endsWith:ST,toArray:TT,forEachEntry:CT,matchAll:AT,isHTMLForm:kT,hasOwnProperty:Np,hasOwnProp:Np,reduceDescriptors:rv,freezeMethods:MT,toObjectSet:RT,toCamelCase:ET,noop:DT,toFiniteNumber:LT,findKey:nv,global:ir,isContextDefined:iv,isSpecCompliantForm:IT,toJSONObject:NT,isAsyncFn:FT,isThenable:BT,setImmediate:sv,asap:HT,isIterable:zT};let ht=class ov extends Error{static from(t,e,i,r,s,a){const l=new ov(t.message,e||t.code,i,r,s);return l.cause=t,l.name=t.name,t.status!=null&&l.status==null&&(l.status=t.status),a&&Object.assign(l,a),l}constructor(t,e,i,r,s){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,e&&(this.code=e),i&&(this.config=i),r&&(this.request=r),s&&(this.response=s,this.status=s.status)}toJSON(){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:j.toJSONObject(this.config),code:this.code,status:this.status}}};ht.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";ht.ERR_BAD_OPTION="ERR_BAD_OPTION";ht.ECONNABORTED="ECONNABORTED";ht.ETIMEDOUT="ETIMEDOUT";ht.ERR_NETWORK="ERR_NETWORK";ht.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";ht.ERR_DEPRECATED="ERR_DEPRECATED";ht.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";ht.ERR_BAD_REQUEST="ERR_BAD_REQUEST";ht.ERR_CANCELED="ERR_CANCELED";ht.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";ht.ERR_INVALID_URL="ERR_INVALID_URL";const WT=null;function Wh(n){return j.isPlainObject(n)||j.isArray(n)}function av(n){return j.endsWith(n,"[]")?n.slice(0,-2):n}function ph(n,t,e){return n?n.concat(t).map(function(r,s){return r=av(r),!e&&s?"["+r+"]":r}).join(e?".":""):t}function jT(n){return j.isArray(n)&&!n.some(Wh)}const UT=j.toFlatObject(j,{},null,function(t){return/^is[A-Z]/.test(t)});function hl(n,t,e){if(!j.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,e=j.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,T){return!j.isUndefined(T[C])});const i=e.metaTokens,r=e.visitor||d,s=e.dots,a=e.indexes,u=(e.Blob||typeof Blob<"u"&&Blob)&&j.isSpecCompliantForm(t);if(!j.isFunction(r))throw new TypeError("visitor must be a function");function h(S){if(S===null)return"";if(j.isDate(S))return S.toISOString();if(j.isBoolean(S))return S.toString();if(!u&&j.isBlob(S))throw new ht("Blob is not supported. Use a Buffer instead.");return j.isArrayBuffer(S)||j.isTypedArray(S)?u&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function d(S,C,T){let P=S;if(j.isReactNative(t)&&j.isReactNativeBlob(S))return t.append(ph(T,C,s),h(S)),!1;if(S&&!T&&typeof S=="object"){if(j.endsWith(C,"{}"))C=i?C:C.slice(0,-2),S=JSON.stringify(S);else if(j.isArray(S)&&jT(S)||(j.isFileList(S)||j.endsWith(C,"[]"))&&(P=j.toArray(S)))return C=av(C),P.forEach(function(B,H){!(j.isUndefined(B)||B===null)&&t.append(a===!0?ph([C],H,s):a===null?C:C+"[]",h(B))}),!1}return Wh(S)?!0:(t.append(ph(T,C,s),h(S)),!1)}const b=[],_=Object.assign(UT,{defaultVisitor:d,convertValue:h,isVisitable:Wh});function x(S,C){if(!j.isUndefined(S)){if(b.indexOf(S)!==-1)throw Error("Circular reference detected in "+C.join("."));b.push(S),j.forEach(S,function(P,R){(!(j.isUndefined(P)||P===null)&&r.call(t,P,j.isString(R)?R.trim():R,C,_))===!0&&x(P,C?C.concat(R):[R])}),b.pop()}}if(!j.isObject(n))throw new TypeError("data must be an object");return x(n),t}function Fp(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function gf(n,t){this._pairs=[],n&&hl(n,this,t)}const cv=gf.prototype;cv.append=function(t,e){this._pairs.push([t,e])};cv.toString=function(t){const e=t?function(i){return t.call(this,i,Fp)}:Fp;return this._pairs.map(function(r){return e(r[0])+"="+e(r[1])},"").join("&")};function VT(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function lv(n,t,e){if(!t)return n;const i=e&&e.encode||VT,r=j.isFunction(e)?{serialize:e}:e,s=r&&r.serialize;let a;if(s?a=s(t,r):a=j.isURLSearchParams(t)?t.toString():new gf(t,r).toString(i),a){const l=n.indexOf("#");l!==-1&&(n=n.slice(0,l)),n+=(n.indexOf("?")===-1?"?":"&")+a}return n}class Bp{constructor(){this.handlers=[]}use(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){j.forEach(this.handlers,function(i){i!==null&&t(i)})}}const mf={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},qT=typeof URLSearchParams<"u"?URLSearchParams:gf,$T=typeof FormData<"u"?FormData:null,XT=typeof Blob<"u"?Blob:null,YT={isBrowser:!0,classes:{URLSearchParams:qT,FormData:$T,Blob:XT},protocols:["http","https","file","blob","url","data"]},vf=typeof window<"u"&&typeof document<"u",jh=typeof navigator=="object"&&navigator||void 0,KT=vf&&(!jh||["ReactNative","NativeScript","NS"].indexOf(jh.product)<0),GT=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",JT=vf&&window.location.href||"http://localhost",ZT=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:vf,hasStandardBrowserEnv:KT,hasStandardBrowserWebWorkerEnv:GT,navigator:jh,origin:JT},Symbol.toStringTag,{value:"Module"})),me={...ZT,...YT};function QT(n,t){return hl(n,new me.classes.URLSearchParams,{visitor:function(e,i,r,s){return me.isNode&&j.isBuffer(e)?(this.append(i,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function tO(n){return j.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function eO(n){const t={},e=Object.keys(n);let i;const r=e.length;let s;for(i=0;i<r;i++)s=e[i],t[s]=n[s];return t}function uv(n){function t(e,i,r,s){let a=e[s++];if(a==="__proto__")return!0;const l=Number.isFinite(+a),u=s>=e.length;return a=!a&&j.isArray(r)?r.length:a,u?(j.hasOwnProp(r,a)?r[a]=[r[a],i]:r[a]=i,!l):((!r[a]||!j.isObject(r[a]))&&(r[a]=[]),t(e,i,r[a],s)&&j.isArray(r[a])&&(r[a]=eO(r[a])),!l)}if(j.isFormData(n)&&j.isFunction(n.entries)){const e={};return j.forEachEntry(n,(i,r)=>{t(tO(i),r,e,0)}),e}return null}function nO(n,t,e){if(j.isString(n))try{return(t||JSON.parse)(n),j.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(e||JSON.stringify)(n)}const Ho={transitional:mf,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const i=e.getContentType()||"",r=i.indexOf("application/json")>-1,s=j.isObject(t);if(s&&j.isHTMLForm(t)&&(t=new FormData(t)),j.isFormData(t))return r?JSON.stringify(uv(t)):t;if(j.isArrayBuffer(t)||j.isBuffer(t)||j.isStream(t)||j.isFile(t)||j.isBlob(t)||j.isReadableStream(t))return t;if(j.isArrayBufferView(t))return t.buffer;if(j.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return QT(t,this.formSerializer).toString();if((l=j.isFileList(t))||i.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return hl(l?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||r?(e.setContentType("application/json",!1),nO(t)):t}],transformResponse:[function(t){const e=this.transitional||Ho.transitional,i=e&&e.forcedJSONParsing,r=this.responseType==="json";if(j.isResponse(t)||j.isReadableStream(t))return t;if(t&&j.isString(t)&&(i&&!this.responseType||r)){const a=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(l){if(a)throw l.name==="SyntaxError"?ht.from(l,ht.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:me.classes.FormData,Blob:me.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};j.forEach(["delete","get","head","post","put","patch"],n=>{Ho.headers[n]={}});const iO=j.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"]),rO=n=>{const t={};let e,i,r;return n&&n.split(`
|
||
`).forEach(function(a){r=a.indexOf(":"),e=a.substring(0,r).trim().toLowerCase(),i=a.substring(r+1).trim(),!(!e||t[e]&&iO[e])&&(e==="set-cookie"?t[e]?t[e].push(i):t[e]=[i]:t[e]=t[e]?t[e]+", "+i:i)}),t},Hp=Symbol("internals");function Zs(n){return n&&String(n).trim().toLowerCase()}function Lc(n){return n===!1||n==null?n:j.isArray(n)?n.map(Lc):String(n)}function sO(n){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=e.exec(n);)t[i[1]]=i[2];return t}const oO=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function gh(n,t,e,i,r){if(j.isFunction(i))return i.call(this,t,e);if(r&&(t=e),!!j.isString(t)){if(j.isString(i))return t.indexOf(i)!==-1;if(j.isRegExp(i))return i.test(t)}}function aO(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,i)=>e.toUpperCase()+i)}function cO(n,t){const e=j.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(n,i+e,{value:function(r,s,a){return this[i].call(this,t,r,s,a)},configurable:!0})})}let Be=class{constructor(t){t&&this.set(t)}set(t,e,i){const r=this;function s(l,u,h){const d=Zs(u);if(!d)throw new Error("header name must be a non-empty string");const b=j.findKey(r,d);(!b||r[b]===void 0||h===!0||h===void 0&&r[b]!==!1)&&(r[b||u]=Lc(l))}const a=(l,u)=>j.forEach(l,(h,d)=>s(h,d,u));if(j.isPlainObject(t)||t instanceof this.constructor)a(t,e);else if(j.isString(t)&&(t=t.trim())&&!oO(t))a(rO(t),e);else if(j.isObject(t)&&j.isIterable(t)){let l={},u,h;for(const d of t){if(!j.isArray(d))throw TypeError("Object iterator must return a key-value pair");l[h=d[0]]=(u=l[h])?j.isArray(u)?[...u,d[1]]:[u,d[1]]:d[1]}a(l,e)}else t!=null&&s(e,t,i);return this}get(t,e){if(t=Zs(t),t){const i=j.findKey(this,t);if(i){const r=this[i];if(!e)return r;if(e===!0)return sO(r);if(j.isFunction(e))return e.call(this,r,i);if(j.isRegExp(e))return e.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Zs(t),t){const i=j.findKey(this,t);return!!(i&&this[i]!==void 0&&(!e||gh(this,this[i],i,e)))}return!1}delete(t,e){const i=this;let r=!1;function s(a){if(a=Zs(a),a){const l=j.findKey(i,a);l&&(!e||gh(i,i[l],l,e))&&(delete i[l],r=!0)}}return j.isArray(t)?t.forEach(s):s(t),r}clear(t){const e=Object.keys(this);let i=e.length,r=!1;for(;i--;){const s=e[i];(!t||gh(this,this[s],s,t,!0))&&(delete this[s],r=!0)}return r}normalize(t){const e=this,i={};return j.forEach(this,(r,s)=>{const a=j.findKey(i,s);if(a){e[a]=Lc(r),delete e[s];return}const l=t?aO(s):String(s).trim();l!==s&&delete e[s],e[l]=Lc(r),i[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return j.forEach(this,(i,r)=>{i!=null&&i!==!1&&(e[r]=t&&j.isArray(i)?i.join(", "):i)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
|
||
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const i=new this(t);return e.forEach(r=>i.set(r)),i}static accessor(t){const i=(this[Hp]=this[Hp]={accessors:{}}).accessors,r=this.prototype;function s(a){const l=Zs(a);i[l]||(cO(r,a),i[l]=!0)}return j.isArray(t)?t.forEach(s):s(t),this}};Be.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);j.reduceDescriptors(Be.prototype,({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(i){this[e]=i}}});j.freezeMethods(Be);function mh(n,t){const e=this||Ho,i=t||e,r=Be.from(i.headers);let s=i.data;return j.forEach(n,function(l){s=l.call(e,s,r.normalize(),t?t.status:void 0)}),r.normalize(),s}function hv(n){return!!(n&&n.__CANCEL__)}let zo=class extends ht{constructor(t,e,i){super(t??"canceled",ht.ERR_CANCELED,e,i),this.name="CanceledError",this.__CANCEL__=!0}};function fv(n,t,e){const i=e.config.validateStatus;!e.status||!i||i(e.status)?n(e):t(new ht("Request failed with status code "+e.status,[ht.ERR_BAD_REQUEST,ht.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function lO(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function uO(n,t){n=n||10;const e=new Array(n),i=new Array(n);let r=0,s=0,a;return t=t!==void 0?t:1e3,function(u){const h=Date.now(),d=i[s];a||(a=h),e[r]=u,i[r]=h;let b=s,_=0;for(;b!==r;)_+=e[b++],b=b%n;if(r=(r+1)%n,r===s&&(s=(s+1)%n),h-a<t)return;const x=d&&h-d;return x?Math.round(_*1e3/x):void 0}}function hO(n,t){let e=0,i=1e3/t,r,s;const a=(h,d=Date.now())=>{e=d,r=null,s&&(clearTimeout(s),s=null),n(...h)};return[(...h)=>{const d=Date.now(),b=d-e;b>=i?a(h,d):(r=h,s||(s=setTimeout(()=>{s=null,a(r)},i-b)))},()=>r&&a(r)]}const Yc=(n,t,e=3)=>{let i=0;const r=uO(50,250);return hO(s=>{const a=s.loaded,l=s.lengthComputable?s.total:void 0,u=a-i,h=r(u),d=a<=l;i=a;const b={loaded:a,total:l,progress:l?a/l:void 0,bytes:u,rate:h||void 0,estimated:h&&l&&d?(l-a)/h:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};n(b)},e)},zp=(n,t)=>{const e=n!=null;return[i=>t[0]({lengthComputable:e,total:n,loaded:i}),t[1]]},Wp=n=>(...t)=>j.asap(()=>n(...t)),fO=me.hasStandardBrowserEnv?((n,t)=>e=>(e=new URL(e,me.origin),n.protocol===e.protocol&&n.host===e.host&&(t||n.port===e.port)))(new URL(me.origin),me.navigator&&/(msie|trident)/i.test(me.navigator.userAgent)):()=>!0,dO=me.hasStandardBrowserEnv?{write(n,t,e,i,r,s,a){if(typeof document>"u")return;const l=[`${n}=${encodeURIComponent(t)}`];j.isNumber(e)&&l.push(`expires=${new Date(e).toUTCString()}`),j.isString(i)&&l.push(`path=${i}`),j.isString(r)&&l.push(`domain=${r}`),s===!0&&l.push("secure"),j.isString(a)&&l.push(`SameSite=${a}`),document.cookie=l.join("; ")},read(n){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+n+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(n){this.write(n,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function pO(n){return typeof n!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function gO(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}function dv(n,t,e){let i=!pO(t);return n&&(i||e==!1)?gO(n,t):t}const jp=n=>n instanceof Be?{...n}:n;function lr(n,t){t=t||{};const e={};function i(h,d,b,_){return j.isPlainObject(h)&&j.isPlainObject(d)?j.merge.call({caseless:_},h,d):j.isPlainObject(d)?j.merge({},d):j.isArray(d)?d.slice():d}function r(h,d,b,_){if(j.isUndefined(d)){if(!j.isUndefined(h))return i(void 0,h,b,_)}else return i(h,d,b,_)}function s(h,d){if(!j.isUndefined(d))return i(void 0,d)}function a(h,d){if(j.isUndefined(d)){if(!j.isUndefined(h))return i(void 0,h)}else return i(void 0,d)}function l(h,d,b){if(b in t)return i(h,d);if(b in n)return i(void 0,h)}const u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(h,d,b)=>r(jp(h),jp(d),b,!0)};return j.forEach(Object.keys({...n,...t}),function(d){if(d==="__proto__"||d==="constructor"||d==="prototype")return;const b=j.hasOwnProp(u,d)?u[d]:r,_=b(n[d],t[d],d);j.isUndefined(_)&&b!==l||(e[d]=_)}),e}const pv=n=>{const t=lr({},n);let{data:e,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:s,headers:a,auth:l}=t;if(t.headers=a=Be.from(a),t.url=lv(dv(t.baseURL,t.url,t.allowAbsoluteUrls),n.params,n.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),j.isFormData(e)){if(me.hasStandardBrowserEnv||me.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(j.isFunction(e.getHeaders)){const u=e.getHeaders(),h=["content-type","content-length"];Object.entries(u).forEach(([d,b])=>{h.includes(d.toLowerCase())&&a.set(d,b)})}}if(me.hasStandardBrowserEnv&&(i&&j.isFunction(i)&&(i=i(t)),i||i!==!1&&fO(t.url))){const u=r&&s&&dO.read(s);u&&a.set(r,u)}return t},mO=typeof XMLHttpRequest<"u",vO=mO&&function(n){return new Promise(function(e,i){const r=pv(n);let s=r.data;const a=Be.from(r.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:h}=r,d,b,_,x,S;function C(){x&&x(),S&&S(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let T=new XMLHttpRequest;T.open(r.method.toUpperCase(),r.url,!0),T.timeout=r.timeout;function P(){if(!T)return;const B=Be.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),D={data:!l||l==="text"||l==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:B,config:n,request:T};fv(function(N){e(N),C()},function(N){i(N),C()},D),T=null}"onloadend"in T?T.onloadend=P:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.indexOf("file:")===0)||setTimeout(P)},T.onabort=function(){T&&(i(new ht("Request aborted",ht.ECONNABORTED,n,T)),T=null)},T.onerror=function(H){const D=H&&H.message?H.message:"Network Error",L=new ht(D,ht.ERR_NETWORK,n,T);L.event=H||null,i(L),T=null},T.ontimeout=function(){let H=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const D=r.transitional||mf;r.timeoutErrorMessage&&(H=r.timeoutErrorMessage),i(new ht(H,D.clarifyTimeoutError?ht.ETIMEDOUT:ht.ECONNABORTED,n,T)),T=null},s===void 0&&a.setContentType(null),"setRequestHeader"in T&&j.forEach(a.toJSON(),function(H,D){T.setRequestHeader(D,H)}),j.isUndefined(r.withCredentials)||(T.withCredentials=!!r.withCredentials),l&&l!=="json"&&(T.responseType=r.responseType),h&&([_,S]=Yc(h,!0),T.addEventListener("progress",_)),u&&T.upload&&([b,x]=Yc(u),T.upload.addEventListener("progress",b),T.upload.addEventListener("loadend",x)),(r.cancelToken||r.signal)&&(d=B=>{T&&(i(!B||B.type?new zo(null,n,T):B),T.abort(),T=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const R=lO(r.url);if(R&&me.protocols.indexOf(R)===-1){i(new ht("Unsupported protocol "+R+":",ht.ERR_BAD_REQUEST,n));return}T.send(s||null)})},bO=(n,t)=>{const{length:e}=n=n?n.filter(Boolean):[];if(t||e){let i=new AbortController,r;const s=function(h){if(!r){r=!0,l();const d=h instanceof Error?h:this.reason;i.abort(d instanceof ht?d:new zo(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,s(new ht(`timeout of ${t}ms exceeded`,ht.ETIMEDOUT))},t);const l=()=>{n&&(a&&clearTimeout(a),a=null,n.forEach(h=>{h.unsubscribe?h.unsubscribe(s):h.removeEventListener("abort",s)}),n=null)};n.forEach(h=>h.addEventListener("abort",s));const{signal:u}=i;return u.unsubscribe=()=>j.asap(l),u}},yO=function*(n,t){let e=n.byteLength;if(e<t){yield n;return}let i=0,r;for(;i<e;)r=i+t,yield n.slice(i,r),i=r},_O=async function*(n,t){for await(const e of wO(n))yield*yO(e,t)},wO=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const t=n.getReader();try{for(;;){const{done:e,value:i}=await t.read();if(e)break;yield i}}finally{await t.cancel()}},Up=(n,t,e,i)=>{const r=_O(n,t);let s=0,a,l=u=>{a||(a=!0,i&&i(u))};return new ReadableStream({async pull(u){try{const{done:h,value:d}=await r.next();if(h){l(),u.close();return}let b=d.byteLength;if(e){let _=s+=b;e(_)}u.enqueue(new Uint8Array(d))}catch(h){throw l(h),h}},cancel(u){return l(u),r.return()}},{highWaterMark:2})},Vp=64*1024,{isFunction:hc}=j,xO=(({Request:n,Response:t})=>({Request:n,Response:t}))(j.global),{ReadableStream:qp,TextEncoder:$p}=j.global,Xp=(n,...t)=>{try{return!!n(...t)}catch{return!1}},SO=n=>{n=j.merge.call({skipUndefined:!0},xO,n);const{fetch:t,Request:e,Response:i}=n,r=t?hc(t):typeof fetch=="function",s=hc(e),a=hc(i);if(!r)return!1;const l=r&&hc(qp),u=r&&(typeof $p=="function"?(S=>C=>S.encode(C))(new $p):async S=>new Uint8Array(await new e(S).arrayBuffer())),h=s&&l&&Xp(()=>{let S=!1;const C=new e(me.origin,{body:new qp,method:"POST",get duplex(){return S=!0,"half"}}).headers.has("Content-Type");return S&&!C}),d=a&&l&&Xp(()=>j.isReadableStream(new i("").body)),b={stream:d&&(S=>S.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!b[S]&&(b[S]=(C,T)=>{let P=C&&C[S];if(P)return P.call(C);throw new ht(`Response type '${S}' is not supported`,ht.ERR_NOT_SUPPORT,T)})});const _=async S=>{if(S==null)return 0;if(j.isBlob(S))return S.size;if(j.isSpecCompliantForm(S))return(await new e(me.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(j.isArrayBufferView(S)||j.isArrayBuffer(S))return S.byteLength;if(j.isURLSearchParams(S)&&(S=S+""),j.isString(S))return(await u(S)).byteLength},x=async(S,C)=>{const T=j.toFiniteNumber(S.getContentLength());return T??_(C)};return async S=>{let{url:C,method:T,data:P,signal:R,cancelToken:B,timeout:H,onDownloadProgress:D,onUploadProgress:L,responseType:N,headers:W,withCredentials:V="same-origin",fetchOptions:X}=pv(S),K=t||fetch;N=N?(N+"").toLowerCase():"text";let Q=bO([R,B&&B.toAbortSignal()],H),rt=null;const lt=Q&&Q.unsubscribe&&(()=>{Q.unsubscribe()});let ut;try{if(L&&h&&T!=="get"&&T!=="head"&&(ut=await x(W,P))!==0){let Et=new e(C,{method:"POST",body:P,duplex:"half"}),Ht;if(j.isFormData(P)&&(Ht=Et.headers.get("content-type"))&&W.setContentType(Ht),Et.body){const[se,Vt]=zp(ut,Yc(Wp(L)));P=Up(Et.body,Vp,se,Vt)}}j.isString(V)||(V=V?"include":"omit");const it=s&&"credentials"in e.prototype,ot={...X,signal:Q,method:T.toUpperCase(),headers:W.normalize().toJSON(),body:P,duplex:"half",credentials:it?V:void 0};rt=s&&new e(C,ot);let mt=await(s?K(rt,X):K(C,ot));const kt=d&&(N==="stream"||N==="response");if(d&&(D||kt&<)){const Et={};["status","statusText","headers"].forEach(Ot=>{Et[Ot]=mt[Ot]});const Ht=j.toFiniteNumber(mt.headers.get("content-length")),[se,Vt]=D&&zp(Ht,Yc(Wp(D),!0))||[];mt=new i(Up(mt.body,Vp,se,()=>{Vt&&Vt(),lt&<()}),Et)}N=N||"text";let Zt=await b[j.findKey(b,N)||"text"](mt,S);return!kt&<&<(),await new Promise((Et,Ht)=>{fv(Et,Ht,{data:Zt,headers:Be.from(mt.headers),status:mt.status,statusText:mt.statusText,config:S,request:rt})})}catch(it){throw lt&<(),it&&it.name==="TypeError"&&/Load failed|fetch/i.test(it.message)?Object.assign(new ht("Network Error",ht.ERR_NETWORK,S,rt,it&&it.response),{cause:it.cause||it}):ht.from(it,it&&it.code,S,rt,it&&it.response)}}},TO=new Map,gv=n=>{let t=n&&n.env||{};const{fetch:e,Request:i,Response:r}=t,s=[i,r,e];let a=s.length,l=a,u,h,d=TO;for(;l--;)u=s[l],h=d.get(u),h===void 0&&d.set(u,h=l?new Map:SO(t)),d=h;return h};gv();const bf={http:WT,xhr:vO,fetch:{get:gv}};j.forEach(bf,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const Yp=n=>`- ${n}`,OO=n=>j.isFunction(n)||n===null||n===!1;function CO(n,t){n=j.isArray(n)?n:[n];const{length:e}=n;let i,r;const s={};for(let a=0;a<e;a++){i=n[a];let l;if(r=i,!OO(i)&&(r=bf[(l=String(i)).toLowerCase()],r===void 0))throw new ht(`Unknown adapter '${l}'`);if(r&&(j.isFunction(r)||(r=r.get(t))))break;s[l||"#"+a]=r}if(!r){const a=Object.entries(s).map(([u,h])=>`adapter ${u} `+(h===!1?"is not supported by the environment":"is not available in the build"));let l=e?a.length>1?`since :
|
||
`+a.map(Yp).join(`
|
||
`):" "+Yp(a[0]):"as no adapter specified";throw new ht("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r}const mv={getAdapter:CO,adapters:bf};function vh(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new zo(null,n)}function Kp(n){return vh(n),n.headers=Be.from(n.headers),n.data=mh.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),mv.getAdapter(n.adapter||Ho.adapter,n)(n).then(function(i){return vh(n),i.data=mh.call(n,n.transformResponse,i),i.headers=Be.from(i.headers),i},function(i){return hv(i)||(vh(n),i&&i.response&&(i.response.data=mh.call(n,n.transformResponse,i.response),i.response.headers=Be.from(i.response.headers))),Promise.reject(i)})}const vv="1.13.6",fl={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{fl[n]=function(i){return typeof i===n||"a"+(t<1?"n ":" ")+n}});const Gp={};fl.transitional=function(t,e,i){function r(s,a){return"[Axios v"+vv+"] Transitional option '"+s+"'"+a+(i?". "+i:"")}return(s,a,l)=>{if(t===!1)throw new ht(r(a," has been removed"+(e?" in "+e:"")),ht.ERR_DEPRECATED);return e&&!Gp[a]&&(Gp[a]=!0,console.warn(r(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(s,a,l):!0}};fl.spelling=function(t){return(e,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};function AO(n,t,e){if(typeof n!="object")throw new ht("options must be an object",ht.ERR_BAD_OPTION_VALUE);const i=Object.keys(n);let r=i.length;for(;r-- >0;){const s=i[r],a=t[s];if(a){const l=n[s],u=l===void 0||a(l,s,n);if(u!==!0)throw new ht("option "+s+" must be "+u,ht.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new ht("Unknown option "+s,ht.ERR_BAD_OPTION)}}const Ic={assertOptions:AO,validators:fl},sn=Ic.validators;let sr=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Bp,response:new Bp}}async request(t,e){try{return await this._request(t,e)}catch(i){if(i instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?s&&!String(i.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(i.stack+=`
|
||
`+s):i.stack=s}catch{}}throw i}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=lr(this.defaults,e);const{transitional:i,paramsSerializer:r,headers:s}=e;i!==void 0&&Ic.assertOptions(i,{silentJSONParsing:sn.transitional(sn.boolean),forcedJSONParsing:sn.transitional(sn.boolean),clarifyTimeoutError:sn.transitional(sn.boolean),legacyInterceptorReqResOrdering:sn.transitional(sn.boolean)},!1),r!=null&&(j.isFunction(r)?e.paramsSerializer={serialize:r}:Ic.assertOptions(r,{encode:sn.function,serialize:sn.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Ic.assertOptions(e,{baseUrl:sn.spelling("baseURL"),withXsrfToken:sn.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=s&&j.merge(s.common,s[e.method]);s&&j.forEach(["delete","get","head","post","put","patch","common"],S=>{delete s[S]}),e.headers=Be.concat(a,s);const l=[];let u=!0;this.interceptors.request.forEach(function(C){if(typeof C.runWhen=="function"&&C.runWhen(e)===!1)return;u=u&&C.synchronous;const T=e.transitional||mf;T&&T.legacyInterceptorReqResOrdering?l.unshift(C.fulfilled,C.rejected):l.push(C.fulfilled,C.rejected)});const h=[];this.interceptors.response.forEach(function(C){h.push(C.fulfilled,C.rejected)});let d,b=0,_;if(!u){const S=[Kp.bind(this),void 0];for(S.unshift(...l),S.push(...h),_=S.length,d=Promise.resolve(e);b<_;)d=d.then(S[b++],S[b++]);return d}_=l.length;let x=e;for(;b<_;){const S=l[b++],C=l[b++];try{x=S(x)}catch(T){C.call(this,T);break}}try{d=Kp.call(this,x)}catch(S){return Promise.reject(S)}for(b=0,_=h.length;b<_;)d=d.then(h[b++],h[b++]);return d}getUri(t){t=lr(this.defaults,t);const e=dv(t.baseURL,t.url,t.allowAbsoluteUrls);return lv(e,t.params,t.paramsSerializer)}};j.forEach(["delete","get","head","options"],function(t){sr.prototype[t]=function(e,i){return this.request(lr(i||{},{method:t,url:e,data:(i||{}).data}))}});j.forEach(["post","put","patch"],function(t){function e(i){return function(s,a,l){return this.request(lr(l||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}sr.prototype[t]=e(),sr.prototype[t+"Form"]=e(!0)});let kO=class bv{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(s){e=s});const i=this;this.promise.then(r=>{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](r);i._listeners=null}),this.promise.then=r=>{let s;const a=new Promise(l=>{i.subscribe(l),s=l}).then(r);return a.cancel=function(){i.unsubscribe(s)},a},t(function(s,a,l){i.reason||(i.reason=new zo(s,a,l),e(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=i=>{t.abort(i)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new bv(function(r){t=r}),cancel:t}}};function EO(n){return function(e){return n.apply(null,e)}}function PO(n){return j.isObject(n)&&n.isAxiosError===!0}const Uh={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Uh).forEach(([n,t])=>{Uh[t]=n});function yv(n){const t=new sr(n),e=Zm(sr.prototype.request,t);return j.extend(e,sr.prototype,t,{allOwnKeys:!0}),j.extend(e,t,null,{allOwnKeys:!0}),e.create=function(r){return yv(lr(n,r))},e}const Jt=yv(Ho);Jt.Axios=sr;Jt.CanceledError=zo;Jt.CancelToken=kO;Jt.isCancel=hv;Jt.VERSION=vv;Jt.toFormData=hl;Jt.AxiosError=ht;Jt.Cancel=Jt.CanceledError;Jt.all=function(t){return Promise.all(t)};Jt.spread=EO;Jt.isAxiosError=PO;Jt.mergeConfig=lr;Jt.AxiosHeaders=Be;Jt.formToJSON=n=>uv(j.isHTMLForm(n)?new FormData(n):n);Jt.getAdapter=mv.getAdapter;Jt.HttpStatusCode=Uh;Jt.default=Jt;const{Axios:qM,AxiosError:$M,CanceledError:XM,isCancel:YM,CancelToken:KM,VERSION:GM,all:JM,Cancel:ZM,isAxiosError:QM,spread:tR,toFormData:eR,AxiosHeaders:nR,HttpStatusCode:iR,formToJSON:rR,getAdapter:sR,mergeConfig:oR}=Jt;window._=ZS;window.axios=Jt;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.axios&&window.axios.interceptors.response.use(n=>n,n=>(n.response&&n.response.status===419&&(n.response.data&&n.response.data.action==="redirect"&&n.response.data.redirect_url?window.location.href=n.response.data.redirect_url:window.location.href="/login"),Promise.reject(n)));var He="top",cn="bottom",ln="right",ze="left",yf="auto",Wo=[He,cn,ln,ze],Ur="start",Oo="end",MO="clippingParents",_v="viewport",Qs="popper",RO="reference",Jp=Wo.reduce(function(n,t){return n.concat([t+"-"+Ur,t+"-"+Oo])},[]),wv=[].concat(Wo,[yf]).reduce(function(n,t){return n.concat([t,t+"-"+Ur,t+"-"+Oo])},[]),DO="beforeRead",LO="read",IO="afterRead",NO="beforeMain",FO="main",BO="afterMain",HO="beforeWrite",zO="write",WO="afterWrite",jO=[DO,LO,IO,NO,FO,BO,HO,zO,WO];function In(n){return n?(n.nodeName||"").toLowerCase():null}function Ge(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function ur(n){var t=Ge(n).Element;return n instanceof t||n instanceof Element}function an(n){var t=Ge(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function _f(n){if(typeof ShadowRoot>"u")return!1;var t=Ge(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function UO(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},r=t.attributes[e]||{},s=t.elements[e];!an(s)||!In(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(a){var l=r[a];l===!1?s.removeAttribute(a):s.setAttribute(a,l===!0?"":l)}))})}function VO(n){var t=n.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(i){var r=t.elements[i],s=t.attributes[i]||{},a=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:e[i]),l=a.reduce(function(u,h){return u[h]="",u},{});!an(r)||!In(r)||(Object.assign(r.style,l),Object.keys(s).forEach(function(u){r.removeAttribute(u)}))})}}const qO={name:"applyStyles",enabled:!0,phase:"write",fn:UO,effect:VO,requires:["computeStyles"]};function Dn(n){return n.split("-")[0]}var or=Math.max,Kc=Math.min,Vr=Math.round;function Vh(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function xv(){return!/^((?!chrome|android).)*safari/i.test(Vh())}function qr(n,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var i=n.getBoundingClientRect(),r=1,s=1;t&&an(n)&&(r=n.offsetWidth>0&&Vr(i.width)/n.offsetWidth||1,s=n.offsetHeight>0&&Vr(i.height)/n.offsetHeight||1);var a=ur(n)?Ge(n):window,l=a.visualViewport,u=!xv()&&e,h=(i.left+(u&&l?l.offsetLeft:0))/r,d=(i.top+(u&&l?l.offsetTop:0))/s,b=i.width/r,_=i.height/s;return{width:b,height:_,top:d,right:h+b,bottom:d+_,left:h,x:h,y:d}}function wf(n){var t=qr(n),e=n.offsetWidth,i=n.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:n.offsetLeft,y:n.offsetTop,width:e,height:i}}function Sv(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&_f(e)){var i=t;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function si(n){return Ge(n).getComputedStyle(n)}function $O(n){return["table","td","th"].indexOf(In(n))>=0}function Ei(n){return((ur(n)?n.ownerDocument:n.document)||window.document).documentElement}function dl(n){return In(n)==="html"?n:n.assignedSlot||n.parentNode||(_f(n)?n.host:null)||Ei(n)}function Zp(n){return!an(n)||si(n).position==="fixed"?null:n.offsetParent}function XO(n){var t=/firefox/i.test(Vh()),e=/Trident/i.test(Vh());if(e&&an(n)){var i=si(n);if(i.position==="fixed")return null}var r=dl(n);for(_f(r)&&(r=r.host);an(r)&&["html","body"].indexOf(In(r))<0;){var s=si(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function jo(n){for(var t=Ge(n),e=Zp(n);e&&$O(e)&&si(e).position==="static";)e=Zp(e);return e&&(In(e)==="html"||In(e)==="body"&&si(e).position==="static")?t:e||XO(n)||t}function xf(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function vo(n,t,e){return or(n,Kc(t,e))}function YO(n,t,e){var i=vo(n,t,e);return i>e?e:i}function Tv(){return{top:0,right:0,bottom:0,left:0}}function Ov(n){return Object.assign({},Tv(),n)}function Cv(n,t){return t.reduce(function(e,i){return e[i]=n,e},{})}var KO=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Ov(typeof t!="number"?t:Cv(t,Wo))};function GO(n){var t,e=n.state,i=n.name,r=n.options,s=e.elements.arrow,a=e.modifiersData.popperOffsets,l=Dn(e.placement),u=xf(l),h=[ze,ln].indexOf(l)>=0,d=h?"height":"width";if(!(!s||!a)){var b=KO(r.padding,e),_=wf(s),x=u==="y"?He:ze,S=u==="y"?cn:ln,C=e.rects.reference[d]+e.rects.reference[u]-a[u]-e.rects.popper[d],T=a[u]-e.rects.reference[u],P=jo(s),R=P?u==="y"?P.clientHeight||0:P.clientWidth||0:0,B=C/2-T/2,H=b[x],D=R-_[d]-b[S],L=R/2-_[d]/2+B,N=vo(H,L,D),W=u;e.modifiersData[i]=(t={},t[W]=N,t.centerOffset=N-L,t)}}function JO(n){var t=n.state,e=n.options,i=e.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||Sv(t.elements.popper,r)&&(t.elements.arrow=r))}const ZO={name:"arrow",enabled:!0,phase:"main",fn:GO,effect:JO,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $r(n){return n.split("-")[1]}var QO={top:"auto",right:"auto",bottom:"auto",left:"auto"};function t1(n,t){var e=n.x,i=n.y,r=t.devicePixelRatio||1;return{x:Vr(e*r)/r||0,y:Vr(i*r)/r||0}}function Qp(n){var t,e=n.popper,i=n.popperRect,r=n.placement,s=n.variation,a=n.offsets,l=n.position,u=n.gpuAcceleration,h=n.adaptive,d=n.roundOffsets,b=n.isFixed,_=a.x,x=_===void 0?0:_,S=a.y,C=S===void 0?0:S,T=typeof d=="function"?d({x,y:C}):{x,y:C};x=T.x,C=T.y;var P=a.hasOwnProperty("x"),R=a.hasOwnProperty("y"),B=ze,H=He,D=window;if(h){var L=jo(e),N="clientHeight",W="clientWidth";if(L===Ge(e)&&(L=Ei(e),si(L).position!=="static"&&l==="absolute"&&(N="scrollHeight",W="scrollWidth")),L=L,r===He||(r===ze||r===ln)&&s===Oo){H=cn;var V=b&&L===D&&D.visualViewport?D.visualViewport.height:L[N];C-=V-i.height,C*=u?1:-1}if(r===ze||(r===He||r===cn)&&s===Oo){B=ln;var X=b&&L===D&&D.visualViewport?D.visualViewport.width:L[W];x-=X-i.width,x*=u?1:-1}}var K=Object.assign({position:l},h&&QO),Q=d===!0?t1({x,y:C},Ge(e)):{x,y:C};if(x=Q.x,C=Q.y,u){var rt;return Object.assign({},K,(rt={},rt[H]=R?"0":"",rt[B]=P?"0":"",rt.transform=(D.devicePixelRatio||1)<=1?"translate("+x+"px, "+C+"px)":"translate3d("+x+"px, "+C+"px, 0)",rt))}return Object.assign({},K,(t={},t[H]=R?C+"px":"",t[B]=P?x+"px":"",t.transform="",t))}function e1(n){var t=n.state,e=n.options,i=e.gpuAcceleration,r=i===void 0?!0:i,s=e.adaptive,a=s===void 0?!0:s,l=e.roundOffsets,u=l===void 0?!0:l,h={placement:Dn(t.placement),variation:$r(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Qp(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Qp(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const n1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:e1,data:{}};var fc={passive:!0};function i1(n){var t=n.state,e=n.instance,i=n.options,r=i.scroll,s=r===void 0?!0:r,a=i.resize,l=a===void 0?!0:a,u=Ge(t.elements.popper),h=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&h.forEach(function(d){d.addEventListener("scroll",e.update,fc)}),l&&u.addEventListener("resize",e.update,fc),function(){s&&h.forEach(function(d){d.removeEventListener("scroll",e.update,fc)}),l&&u.removeEventListener("resize",e.update,fc)}}const r1={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:i1,data:{}};var s1={left:"right",right:"left",bottom:"top",top:"bottom"};function Nc(n){return n.replace(/left|right|bottom|top/g,function(t){return s1[t]})}var o1={start:"end",end:"start"};function tg(n){return n.replace(/start|end/g,function(t){return o1[t]})}function Sf(n){var t=Ge(n),e=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:e,scrollTop:i}}function Tf(n){return qr(Ei(n)).left+Sf(n).scrollLeft}function a1(n,t){var e=Ge(n),i=Ei(n),r=e.visualViewport,s=i.clientWidth,a=i.clientHeight,l=0,u=0;if(r){s=r.width,a=r.height;var h=xv();(h||!h&&t==="fixed")&&(l=r.offsetLeft,u=r.offsetTop)}return{width:s,height:a,x:l+Tf(n),y:u}}function c1(n){var t,e=Ei(n),i=Sf(n),r=(t=n.ownerDocument)==null?void 0:t.body,s=or(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=or(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-i.scrollLeft+Tf(n),u=-i.scrollTop;return si(r||e).direction==="rtl"&&(l+=or(e.clientWidth,r?r.clientWidth:0)-s),{width:s,height:a,x:l,y:u}}function Of(n){var t=si(n),e=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+r+i)}function Av(n){return["html","body","#document"].indexOf(In(n))>=0?n.ownerDocument.body:an(n)&&Of(n)?n:Av(dl(n))}function bo(n,t){var e;t===void 0&&(t=[]);var i=Av(n),r=i===((e=n.ownerDocument)==null?void 0:e.body),s=Ge(i),a=r?[s].concat(s.visualViewport||[],Of(i)?i:[]):i,l=t.concat(a);return r?l:l.concat(bo(dl(a)))}function qh(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function l1(n,t){var e=qr(n,!1,t==="fixed");return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function eg(n,t,e){return t===_v?qh(a1(n,e)):ur(t)?l1(t,e):qh(c1(Ei(n)))}function u1(n){var t=bo(dl(n)),e=["absolute","fixed"].indexOf(si(n).position)>=0,i=e&&an(n)?jo(n):n;return ur(i)?t.filter(function(r){return ur(r)&&Sv(r,i)&&In(r)!=="body"}):[]}function h1(n,t,e,i){var r=t==="clippingParents"?u1(n):[].concat(t),s=[].concat(r,[e]),a=s[0],l=s.reduce(function(u,h){var d=eg(n,h,i);return u.top=or(d.top,u.top),u.right=Kc(d.right,u.right),u.bottom=Kc(d.bottom,u.bottom),u.left=or(d.left,u.left),u},eg(n,a,i));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function kv(n){var t=n.reference,e=n.element,i=n.placement,r=i?Dn(i):null,s=i?$r(i):null,a=t.x+t.width/2-e.width/2,l=t.y+t.height/2-e.height/2,u;switch(r){case He:u={x:a,y:t.y-e.height};break;case cn:u={x:a,y:t.y+t.height};break;case ln:u={x:t.x+t.width,y:l};break;case ze:u={x:t.x-e.width,y:l};break;default:u={x:t.x,y:t.y}}var h=r?xf(r):null;if(h!=null){var d=h==="y"?"height":"width";switch(s){case Ur:u[h]=u[h]-(t[d]/2-e[d]/2);break;case Oo:u[h]=u[h]+(t[d]/2-e[d]/2);break}}return u}function Co(n,t){t===void 0&&(t={});var e=t,i=e.placement,r=i===void 0?n.placement:i,s=e.strategy,a=s===void 0?n.strategy:s,l=e.boundary,u=l===void 0?MO:l,h=e.rootBoundary,d=h===void 0?_v:h,b=e.elementContext,_=b===void 0?Qs:b,x=e.altBoundary,S=x===void 0?!1:x,C=e.padding,T=C===void 0?0:C,P=Ov(typeof T!="number"?T:Cv(T,Wo)),R=_===Qs?RO:Qs,B=n.rects.popper,H=n.elements[S?R:_],D=h1(ur(H)?H:H.contextElement||Ei(n.elements.popper),u,d,a),L=qr(n.elements.reference),N=kv({reference:L,element:B,placement:r}),W=qh(Object.assign({},B,N)),V=_===Qs?W:L,X={top:D.top-V.top+P.top,bottom:V.bottom-D.bottom+P.bottom,left:D.left-V.left+P.left,right:V.right-D.right+P.right},K=n.modifiersData.offset;if(_===Qs&&K){var Q=K[r];Object.keys(X).forEach(function(rt){var lt=[ln,cn].indexOf(rt)>=0?1:-1,ut=[He,cn].indexOf(rt)>=0?"y":"x";X[rt]+=Q[ut]*lt})}return X}function f1(n,t){t===void 0&&(t={});var e=t,i=e.placement,r=e.boundary,s=e.rootBoundary,a=e.padding,l=e.flipVariations,u=e.allowedAutoPlacements,h=u===void 0?wv:u,d=$r(i),b=d?l?Jp:Jp.filter(function(S){return $r(S)===d}):Wo,_=b.filter(function(S){return h.indexOf(S)>=0});_.length===0&&(_=b);var x=_.reduce(function(S,C){return S[C]=Co(n,{placement:C,boundary:r,rootBoundary:s,padding:a})[Dn(C)],S},{});return Object.keys(x).sort(function(S,C){return x[S]-x[C]})}function d1(n){if(Dn(n)===yf)return[];var t=Nc(n);return[tg(n),t,tg(t)]}function p1(n){var t=n.state,e=n.options,i=n.name;if(!t.modifiersData[i]._skip){for(var r=e.mainAxis,s=r===void 0?!0:r,a=e.altAxis,l=a===void 0?!0:a,u=e.fallbackPlacements,h=e.padding,d=e.boundary,b=e.rootBoundary,_=e.altBoundary,x=e.flipVariations,S=x===void 0?!0:x,C=e.allowedAutoPlacements,T=t.options.placement,P=Dn(T),R=P===T,B=u||(R||!S?[Nc(T)]:d1(T)),H=[T].concat(B).reduce(function(Vt,Ot){return Vt.concat(Dn(Ot)===yf?f1(t,{placement:Ot,boundary:d,rootBoundary:b,padding:h,flipVariations:S,allowedAutoPlacements:C}):Ot)},[]),D=t.rects.reference,L=t.rects.popper,N=new Map,W=!0,V=H[0],X=0;X<H.length;X++){var K=H[X],Q=Dn(K),rt=$r(K)===Ur,lt=[He,cn].indexOf(Q)>=0,ut=lt?"width":"height",it=Co(t,{placement:K,boundary:d,rootBoundary:b,altBoundary:_,padding:h}),ot=lt?rt?ln:ze:rt?cn:He;D[ut]>L[ut]&&(ot=Nc(ot));var mt=Nc(ot),kt=[];if(s&&kt.push(it[Q]<=0),l&&kt.push(it[ot]<=0,it[mt]<=0),kt.every(function(Vt){return Vt})){V=K,W=!1;break}N.set(K,kt)}if(W)for(var Zt=S?3:1,Et=function(Ot){var Qt=H.find(function(ai){var Pt=N.get(ai);if(Pt)return Pt.slice(0,Ot).every(function(zt){return zt})});if(Qt)return V=Qt,"break"},Ht=Zt;Ht>0;Ht--){var se=Et(Ht);if(se==="break")break}t.placement!==V&&(t.modifiersData[i]._skip=!0,t.placement=V,t.reset=!0)}}const g1={name:"flip",enabled:!0,phase:"main",fn:p1,requiresIfExists:["offset"],data:{_skip:!1}};function ng(n,t,e){return e===void 0&&(e={x:0,y:0}),{top:n.top-t.height-e.y,right:n.right-t.width+e.x,bottom:n.bottom-t.height+e.y,left:n.left-t.width-e.x}}function ig(n){return[He,ln,cn,ze].some(function(t){return n[t]>=0})}function m1(n){var t=n.state,e=n.name,i=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,a=Co(t,{elementContext:"reference"}),l=Co(t,{altBoundary:!0}),u=ng(a,i),h=ng(l,r,s),d=ig(u),b=ig(h);t.modifiersData[e]={referenceClippingOffsets:u,popperEscapeOffsets:h,isReferenceHidden:d,hasPopperEscaped:b},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":b})}const v1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:m1};function b1(n,t,e){var i=Dn(n),r=[ze,He].indexOf(i)>=0?-1:1,s=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,a=s[0],l=s[1];return a=a||0,l=(l||0)*r,[ze,ln].indexOf(i)>=0?{x:l,y:a}:{x:a,y:l}}function y1(n){var t=n.state,e=n.options,i=n.name,r=e.offset,s=r===void 0?[0,0]:r,a=wv.reduce(function(d,b){return d[b]=b1(b,t.rects,s),d},{}),l=a[t.placement],u=l.x,h=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=h),t.modifiersData[i]=a}const _1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:y1};function w1(n){var t=n.state,e=n.name;t.modifiersData[e]=kv({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const x1={name:"popperOffsets",enabled:!0,phase:"read",fn:w1,data:{}};function S1(n){return n==="x"?"y":"x"}function T1(n){var t=n.state,e=n.options,i=n.name,r=e.mainAxis,s=r===void 0?!0:r,a=e.altAxis,l=a===void 0?!1:a,u=e.boundary,h=e.rootBoundary,d=e.altBoundary,b=e.padding,_=e.tether,x=_===void 0?!0:_,S=e.tetherOffset,C=S===void 0?0:S,T=Co(t,{boundary:u,rootBoundary:h,padding:b,altBoundary:d}),P=Dn(t.placement),R=$r(t.placement),B=!R,H=xf(P),D=S1(H),L=t.modifiersData.popperOffsets,N=t.rects.reference,W=t.rects.popper,V=typeof C=="function"?C(Object.assign({},t.rects,{placement:t.placement})):C,X=typeof V=="number"?{mainAxis:V,altAxis:V}:Object.assign({mainAxis:0,altAxis:0},V),K=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Q={x:0,y:0};if(L){if(s){var rt,lt=H==="y"?He:ze,ut=H==="y"?cn:ln,it=H==="y"?"height":"width",ot=L[H],mt=ot+T[lt],kt=ot-T[ut],Zt=x?-W[it]/2:0,Et=R===Ur?N[it]:W[it],Ht=R===Ur?-W[it]:-N[it],se=t.elements.arrow,Vt=x&&se?wf(se):{width:0,height:0},Ot=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Tv(),Qt=Ot[lt],ai=Ot[ut],Pt=vo(0,N[it],Vt[it]),zt=B?N[it]/2-Zt-Pt-Qt-X.mainAxis:Et-Pt-Qt-X.mainAxis,Jr=B?-N[it]/2+Zt+Pt+ai+X.mainAxis:Ht+Pt+ai+X.mainAxis,un=t.elements.arrow&&jo(t.elements.arrow),he=un?H==="y"?un.clientTop||0:un.clientLeft||0:0,ci=(rt=K==null?void 0:K[H])!=null?rt:0,ye=ot+zt-ci-he,Ue=ot+Jr-ci,Mi=vo(x?Kc(mt,ye):mt,ot,x?or(kt,Ue):kt);L[H]=Mi,Q[H]=Mi-ot}if(l){var ke,Ri=H==="x"?He:ze,gr=H==="x"?cn:ln,_e=L[D],te=D==="y"?"height":"width",yn=_e+T[Ri],Nn=_e-T[gr],Di=[He,ze].indexOf(P)!==-1,_n=(ke=K==null?void 0:K[D])!=null?ke:0,Fn=Di?yn:_e-N[te]-W[te]-_n+X.altAxis,wn=Di?_e+N[te]+W[te]-_n-X.altAxis:Nn,Tt=x&&Di?YO(Fn,_e,wn):vo(x?Fn:yn,_e,x?wn:Nn);L[D]=Tt,Q[D]=Tt-_e}t.modifiersData[i]=Q}}const O1={name:"preventOverflow",enabled:!0,phase:"main",fn:T1,requiresIfExists:["offset"]};function C1(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function A1(n){return n===Ge(n)||!an(n)?Sf(n):C1(n)}function k1(n){var t=n.getBoundingClientRect(),e=Vr(t.width)/n.offsetWidth||1,i=Vr(t.height)/n.offsetHeight||1;return e!==1||i!==1}function E1(n,t,e){e===void 0&&(e=!1);var i=an(t),r=an(t)&&k1(t),s=Ei(t),a=qr(n,r,e),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!e)&&((In(t)!=="body"||Of(s))&&(l=A1(t)),an(t)?(u=qr(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=Tf(s))),{x:a.left+l.scrollLeft-u.x,y:a.top+l.scrollTop-u.y,width:a.width,height:a.height}}function P1(n){var t=new Map,e=new Set,i=[];n.forEach(function(s){t.set(s.name,s)});function r(s){e.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(l){if(!e.has(l)){var u=t.get(l);u&&r(u)}}),i.push(s)}return n.forEach(function(s){e.has(s.name)||r(s)}),i}function M1(n){var t=P1(n);return jO.reduce(function(e,i){return e.concat(t.filter(function(r){return r.phase===i}))},[])}function R1(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function D1(n){var t=n.reduce(function(e,i){var r=e[i.name];return e[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,e},{});return Object.keys(t).map(function(e){return t[e]})}var rg={placement:"bottom",modifiers:[],strategy:"absolute"};function sg(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];return!t.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function L1(n){n===void 0&&(n={});var t=n,e=t.defaultModifiers,i=e===void 0?[]:e,r=t.defaultOptions,s=r===void 0?rg:r;return function(l,u,h){h===void 0&&(h=s);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},rg,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},b=[],_=!1,x={state:d,setOptions:function(P){var R=typeof P=="function"?P(d.options):P;C(),d.options=Object.assign({},s,d.options,R),d.scrollParents={reference:ur(l)?bo(l):l.contextElement?bo(l.contextElement):[],popper:bo(u)};var B=M1(D1([].concat(i,d.options.modifiers)));return d.orderedModifiers=B.filter(function(H){return H.enabled}),S(),x.update()},forceUpdate:function(){if(!_){var P=d.elements,R=P.reference,B=P.popper;if(sg(R,B)){d.rects={reference:E1(R,jo(B),d.options.strategy==="fixed"),popper:wf(B)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(X){return d.modifiersData[X.name]=Object.assign({},X.data)});for(var H=0;H<d.orderedModifiers.length;H++){if(d.reset===!0){d.reset=!1,H=-1;continue}var D=d.orderedModifiers[H],L=D.fn,N=D.options,W=N===void 0?{}:N,V=D.name;typeof L=="function"&&(d=L({state:d,options:W,name:V,instance:x})||d)}}}},update:R1(function(){return new Promise(function(T){x.forceUpdate(),T(d)})}),destroy:function(){C(),_=!0}};if(!sg(l,u))return x;x.setOptions(h).then(function(T){!_&&h.onFirstUpdate&&h.onFirstUpdate(T)});function S(){d.orderedModifiers.forEach(function(T){var P=T.name,R=T.options,B=R===void 0?{}:R,H=T.effect;if(typeof H=="function"){var D=H({state:d,name:P,instance:x,options:B}),L=function(){};b.push(D||L)}})}function C(){b.forEach(function(T){return T()}),b=[]}return x}}var I1=[r1,x1,n1,qO,_1,g1,O1,ZO,v1],N1=L1({defaultModifiers:I1}),Ev=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],Gc=Ev.join(","),Pv=typeof Element>"u",hr=Pv?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$h=!Pv&&Element.prototype.getRootNode?function(n){return n.getRootNode()}:function(n){return n.ownerDocument},Mv=function(t,e,i){var r=Array.prototype.slice.apply(t.querySelectorAll(Gc));return e&&hr.call(t,Gc)&&r.unshift(t),r=r.filter(i),r},Rv=function n(t,e,i){for(var r=[],s=Array.from(t);s.length;){var a=s.shift();if(a.tagName==="SLOT"){var l=a.assignedElements(),u=l.length?l:a.children,h=n(u,!0,i);i.flatten?r.push.apply(r,h):r.push({scope:a,candidates:h})}else{var d=hr.call(a,Gc);d&&i.filter(a)&&(e||!t.includes(a))&&r.push(a);var b=a.shadowRoot||typeof i.getShadowRoot=="function"&&i.getShadowRoot(a),_=!i.shadowRootFilter||i.shadowRootFilter(a);if(b&&_){var x=n(b===!0?a.children:b.children,!0,i);i.flatten?r.push.apply(r,x):r.push({scope:a,candidates:x})}else s.unshift.apply(s,a.children)}}return r},Dv=function(t,e){return t.tabIndex<0&&(e||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||t.isContentEditable)&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},F1=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},Lv=function(t){return t.tagName==="INPUT"},B1=function(t){return Lv(t)&&t.type==="hidden"},H1=function(t){var e=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(i){return i.tagName==="SUMMARY"});return e},z1=function(t,e){for(var i=0;i<t.length;i++)if(t[i].checked&&t[i].form===e)return t[i]},W1=function(t){if(!t.name)return!0;var e=t.form||$h(t),i=function(l){return e.querySelectorAll('input[type="radio"][name="'+l+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=i(window.CSS.escape(t.name));else try{r=i(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var s=z1(r,t.form);return!s||s===t},j1=function(t){return Lv(t)&&t.type==="radio"},U1=function(t){return j1(t)&&!W1(t)},og=function(t){var e=t.getBoundingClientRect(),i=e.width,r=e.height;return i===0&&r===0},V1=function(t,e){var i=e.displayCheck,r=e.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=hr.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(hr.call(a,"details:not([open]) *"))return!0;var l=$h(t).host,u=(l==null?void 0:l.ownerDocument.contains(l))||t.ownerDocument.contains(t);if(!i||i==="full"){if(typeof r=="function"){for(var h=t;t;){var d=t.parentElement,b=$h(t);if(d&&!d.shadowRoot&&r(d)===!0)return og(t);t.assignedSlot?t=t.assignedSlot:!d&&b!==t.ownerDocument?t=b.host:t=d}t=h}if(u)return!t.getClientRects().length}else if(i==="non-zero-area")return og(t);return!1},q1=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if(e.tagName==="FIELDSET"&&e.disabled){for(var i=0;i<e.children.length;i++){var r=e.children.item(i);if(r.tagName==="LEGEND")return hr.call(e,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}e=e.parentElement}return!1},Jc=function(t,e){return!(e.disabled||B1(e)||V1(e,t)||H1(e)||q1(e))},Xh=function(t,e){return!(U1(e)||Dv(e)<0||!Jc(t,e))},$1=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},X1=function n(t){var e=[],i=[];return t.forEach(function(r,s){var a=!!r.scope,l=a?r.scope:r,u=Dv(l,a),h=a?n(r.candidates):l;u===0?a?e.push.apply(e,h):e.push(l):i.push({documentOrder:s,tabIndex:u,item:r,isScope:a,content:h})}),i.sort(F1).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(e)},Y1=function(t,e){e=e||{};var i;return e.getShadowRoot?i=Rv([t],e.includeContainer,{filter:Xh.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:$1}):i=Mv(t,e.includeContainer,Xh.bind(null,e)),X1(i)},Iv=function(t,e){e=e||{};var i;return e.getShadowRoot?i=Rv([t],e.includeContainer,{filter:Jc.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):i=Mv(t,e.includeContainer,Jc.bind(null,e)),i},dc=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return hr.call(t,Gc)===!1?!1:Xh(e,t)},K1=Ev.concat("iframe").join(","),Fc=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return hr.call(t,K1)===!1?!1:Jc(e,t)};function ag(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),e.push.apply(e,i)}return e}function cg(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?ag(Object(e),!0).forEach(function(i){G1(n,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):ag(Object(e)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(e,i))})}return n}function G1(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var lg=function(){var n=[];return{activateTrap:function(e){if(n.length>0){var i=n[n.length-1];i!==e&&i.pause()}var r=n.indexOf(e);r===-1||n.splice(r,1),n.push(e)},deactivateTrap:function(e){var i=n.indexOf(e);i!==-1&&n.splice(i,1),n.length>0&&n[n.length-1].unpause()}}}(),J1=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Z1=function(t){return t.key==="Escape"||t.key==="Esc"||t.keyCode===27},Q1=function(t){return t.key==="Tab"||t.keyCode===9},ug=function(t){return setTimeout(t,0)},hg=function(t,e){var i=-1;return t.every(function(r,s){return e(r)?(i=s,!1):!0}),i},to=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];return typeof t=="function"?t.apply(void 0,i):t},pc=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},tC=function(t,e){var i=(e==null?void 0:e.document)||document,r=cg({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},e),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},a,l=function(L,N,W){return L&&L[N]!==void 0?L[N]:r[W||N]},u=function(L){return s.containerGroups.findIndex(function(N){var W=N.container,V=N.tabbableNodes;return W.contains(L)||V.find(function(X){return X===L})})},h=function(L){var N=r[L];if(typeof N=="function"){for(var W=arguments.length,V=new Array(W>1?W-1:0),X=1;X<W;X++)V[X-1]=arguments[X];N=N.apply(void 0,V)}if(N===!0&&(N=void 0),!N){if(N===void 0||N===!1)return N;throw new Error("`".concat(L,"` was specified but was not a node, or did not return a node"))}var K=N;if(typeof N=="string"&&(K=i.querySelector(N),!K))throw new Error("`".concat(L,"` as selector refers to no known node"));return K},d=function(){var L=h("initialFocus");if(L===!1)return!1;if(L===void 0)if(u(i.activeElement)>=0)L=i.activeElement;else{var N=s.tabbableGroups[0],W=N&&N.firstTabbableNode;L=W||h("fallbackFocus")}if(!L)throw new Error("Your focus-trap needs to have at least one focusable element");return L},b=function(){if(s.containerGroups=s.containers.map(function(L){var N=Y1(L,r.tabbableOptions),W=Iv(L,r.tabbableOptions);return{container:L,tabbableNodes:N,focusableNodes:W,firstTabbableNode:N.length>0?N[0]:null,lastTabbableNode:N.length>0?N[N.length-1]:null,nextTabbableNode:function(X){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Q=W.findIndex(function(rt){return rt===X});if(!(Q<0))return K?W.slice(Q+1).find(function(rt){return dc(rt,r.tabbableOptions)}):W.slice(0,Q).reverse().find(function(rt){return dc(rt,r.tabbableOptions)})}}}),s.tabbableGroups=s.containerGroups.filter(function(L){return L.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!h("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},_=function D(L){if(L!==!1&&L!==i.activeElement){if(!L||!L.focus){D(d());return}L.focus({preventScroll:!!r.preventScroll}),s.mostRecentlyFocusedNode=L,J1(L)&&L.select()}},x=function(L){var N=h("setReturnFocus",L);return N||(N===!1?!1:L)},S=function(L){var N=pc(L);if(!(u(N)>=0)){if(to(r.clickOutsideDeactivates,L)){a.deactivate({returnFocus:r.returnFocusOnDeactivate&&!Fc(N,r.tabbableOptions)});return}to(r.allowOutsideClick,L)||L.preventDefault()}},C=function(L){var N=pc(L),W=u(N)>=0;W||N instanceof Document?W&&(s.mostRecentlyFocusedNode=N):(L.stopImmediatePropagation(),_(s.mostRecentlyFocusedNode||d()))},T=function(L){var N=pc(L);b();var W=null;if(s.tabbableGroups.length>0){var V=u(N),X=V>=0?s.containerGroups[V]:void 0;if(V<0)L.shiftKey?W=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:W=s.tabbableGroups[0].firstTabbableNode;else if(L.shiftKey){var K=hg(s.tabbableGroups,function(ot){var mt=ot.firstTabbableNode;return N===mt});if(K<0&&(X.container===N||Fc(N,r.tabbableOptions)&&!dc(N,r.tabbableOptions)&&!X.nextTabbableNode(N,!1))&&(K=V),K>=0){var Q=K===0?s.tabbableGroups.length-1:K-1,rt=s.tabbableGroups[Q];W=rt.lastTabbableNode}}else{var lt=hg(s.tabbableGroups,function(ot){var mt=ot.lastTabbableNode;return N===mt});if(lt<0&&(X.container===N||Fc(N,r.tabbableOptions)&&!dc(N,r.tabbableOptions)&&!X.nextTabbableNode(N))&&(lt=V),lt>=0){var ut=lt===s.tabbableGroups.length-1?0:lt+1,it=s.tabbableGroups[ut];W=it.firstTabbableNode}}}else W=h("fallbackFocus");W&&(L.preventDefault(),_(W))},P=function(L){if(Z1(L)&&to(r.escapeDeactivates,L)!==!1){L.preventDefault(),a.deactivate();return}if(Q1(L)){T(L);return}},R=function(L){var N=pc(L);u(N)>=0||to(r.clickOutsideDeactivates,L)||to(r.allowOutsideClick,L)||(L.preventDefault(),L.stopImmediatePropagation())},B=function(){if(s.active)return lg.activateTrap(a),s.delayInitialFocusTimer=r.delayInitialFocus?ug(function(){_(d())}):_(d()),i.addEventListener("focusin",C,!0),i.addEventListener("mousedown",S,{capture:!0,passive:!1}),i.addEventListener("touchstart",S,{capture:!0,passive:!1}),i.addEventListener("click",R,{capture:!0,passive:!1}),i.addEventListener("keydown",P,{capture:!0,passive:!1}),a},H=function(){if(s.active)return i.removeEventListener("focusin",C,!0),i.removeEventListener("mousedown",S,!0),i.removeEventListener("touchstart",S,!0),i.removeEventListener("click",R,!0),i.removeEventListener("keydown",P,!0),a};return a={get active(){return s.active},get paused(){return s.paused},activate:function(L){if(s.active)return this;var N=l(L,"onActivate"),W=l(L,"onPostActivate"),V=l(L,"checkCanFocusTrap");V||b(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=i.activeElement,N&&N();var X=function(){V&&b(),B(),W&&W()};return V?(V(s.containers.concat()).then(X,X),this):(X(),this)},deactivate:function(L){if(!s.active)return this;var N=cg({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},L);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,H(),s.active=!1,s.paused=!1,lg.deactivateTrap(a);var W=l(N,"onDeactivate"),V=l(N,"onPostDeactivate"),X=l(N,"checkCanReturnFocus"),K=l(N,"returnFocus","returnFocusOnDeactivate");W&&W();var Q=function(){ug(function(){K&&_(x(s.nodeFocusedBeforeActivation)),V&&V()})};return K&&X?(X(x(s.nodeFocusedBeforeActivation)).then(Q,Q),this):(Q(),this)},pause:function(){return s.paused||!s.active?this:(s.paused=!0,H(),this)},unpause:function(){return!s.paused||!s.active?this:(s.paused=!1,b(),B(),this)},updateContainerElements:function(L){var N=[].concat(L).filter(Boolean);return s.containers=N.map(function(W){return typeof W=="string"?i.querySelector(W):W}),s.active&&b(),this}},a.updateContainerElements(t),a};function eC(n){let t,e;window.addEventListener("focusin",()=>{t=e,e=document.activeElement}),n.magic("focus",i=>{let r=i;return{__noscroll:!1,__wrapAround:!1,within(s){return r=s,this},withoutScrolling(){return this.__noscroll=!0,this},noscroll(){return this.__noscroll=!0,this},withWrapAround(){return this.__wrapAround=!0,this},wrap(){return this.withWrapAround()},focusable(s){return Fc(s)},previouslyFocused(){return t},lastFocused(){return t},focused(){return e},focusables(){return Array.isArray(r)?r:Iv(r,{displayCheck:"none"})},all(){return this.focusables()},isFirst(s){let a=this.all();return a[0]&&a[0].isSameNode(s)},isLast(s){let a=this.all();return a.length&&a.slice(-1)[0].isSameNode(s)},getFirst(){return this.all()[0]},getLast(){return this.all().slice(-1)[0]},getNext(){let s=this.all(),a=document.activeElement;if(s.indexOf(a)!==-1)return this.__wrapAround&&s.indexOf(a)===s.length-1?s[0]:s[s.indexOf(a)+1]},getPrevious(){let s=this.all(),a=document.activeElement;if(s.indexOf(a)!==-1)return this.__wrapAround&&s.indexOf(a)===0?s.slice(-1)[0]:s[s.indexOf(a)-1]},first(){this.focus(this.getFirst())},last(){this.focus(this.getLast())},next(){this.focus(this.getNext())},previous(){this.focus(this.getPrevious())},prev(){return this.previous()},focus(s){s&&setTimeout(()=>{s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),s.focus({preventScroll:this.__noscroll})})}}}),n.directive("trap",n.skipDuringClone((i,{expression:r,modifiers:s},{effect:a,evaluateLater:l,cleanup:u})=>{let h=l(r),d=!1,b={escapeDeactivates:!1,allowOutsideClick:!0,fallbackFocus:()=>i};if(s.includes("noautofocus"))b.initialFocus=!1;else{let T=i.querySelector("[autofocus]");T&&(b.initialFocus=T)}let _=tC(i,b),x=()=>{},S=()=>{};const C=()=>{x(),x=()=>{},S(),S=()=>{},_.deactivate({returnFocus:!s.includes("noreturn")})};a(()=>h(T=>{d!==T&&(T&&!d&&(s.includes("noscroll")&&(S=nC()),s.includes("inert")&&(x=fg(i)),setTimeout(()=>{_.activate()},15)),!T&&d&&C(),d=!!T)})),u(C)},(i,{expression:r,modifiers:s},{evaluate:a})=>{s.includes("inert")&&a(r)&&fg(i)}))}function fg(n){let t=[];return Nv(n,e=>{let i=e.hasAttribute("aria-hidden");e.setAttribute("aria-hidden","true"),t.push(()=>i||e.removeAttribute("aria-hidden"))}),()=>{for(;t.length;)t.pop()()}}function Nv(n,t){n.isSameNode(document.body)||!n.parentNode||Array.from(n.parentNode.children).forEach(e=>{e.isSameNode(n)?Nv(n.parentNode,t):t(e)})}function nC(){let n=document.documentElement.style.overflow,t=document.documentElement.style.paddingRight,e=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=`${e}px`,()=>{document.documentElement.style.overflow=n,document.documentElement.style.paddingRight=t}}var iC=eC;/*! Bundled license information:
|
||
|
||
tabbable/dist/index.esm.js:
|
||
(*!
|
||
* tabbable 5.3.3
|
||
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
||
*)
|
||
|
||
focus-trap/dist/focus-trap.esm.js:
|
||
(*!
|
||
* focus-trap 6.9.4
|
||
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
||
*)
|
||
*/var dg="​";function bh(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}function pg(n){return function(t){if(Array.isArray(t))return bh(t)}(n)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(n)||function(t,e){if(t){if(typeof t=="string")return bh(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return bh(t,e)}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Oi={isEnabled:function(){var n;return(n=window.TAGIFY_DEBUG)===null||n===void 0||n},log:function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];var i;this.isEnabled()&&(i=console).log.apply(i,["[Tagify]:"].concat(pg(t)))},warn:function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];var i;this.isEnabled()&&(i=console).warn.apply(i,["[Tagify]:"].concat(pg(t)))}},lo=function(n,t,e,i){return n=""+n,t=""+t,i&&(n=n.trim(),t=t.trim()),e?n==t:n.toLowerCase()==t.toLowerCase()},gg=function(n,t){return n&&Array.isArray(n)&&n.map(function(e){return Yh(e,t)})};function Yh(n,t){var e,i={};for(e in n)t.indexOf(e)<0&&(i[e]=n[e]);return i}function yh(n){return new DOMParser().parseFromString(n.trim(),"text/html").body.firstElementChild}function mg(n,t){for(t=t||"previous";n=n[t+"Sibling"];)if(n.nodeType==3)return n}function Qi(n){return typeof n=="string"?n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/`|'/g,"'"):n}function gn(n){var t=Object.prototype.toString.call(n).split(" ")[1].slice(0,-1);return n===Object(n)&&t!="Array"&&t!="Function"&&t!="RegExp"&&t!="HTMLUnknownElement"}function ie(n,t,e){var i,r;function s(a,l){for(var u in l)if(l.hasOwnProperty(u)){if(gn(l[u])){gn(a[u])?s(a[u],l[u]):a[u]=Object.assign({},l[u]);continue}if(Array.isArray(l[u])){a[u]=Object.assign([],l[u]);continue}a[u]=l[u]}}return i=n,((r=Object)!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?r[Symbol.hasInstance](i):i instanceof r)||(n={}),s(n,t),e&&s(n,e),n}function vg(){var n=[],t={},e=!0,i=!1,r=void 0;try{for(var s,a=arguments[Symbol.iterator]();!(e=(s=a.next()).done);e=!0){var l=s.value,u=!0,h=!1,d=void 0;try{for(var b,_=l[Symbol.iterator]();!(u=(b=_.next()).done);u=!0){var x=b.value;gn(x)?t[x.value]||(n.push(x),t[x.value]=1):n.includes(x)||n.push(x)}}catch(S){h=!0,d=S}finally{try{u||_.return==null||_.return()}finally{if(h)throw d}}}}catch(S){i=!0,r=S}finally{try{e||a.return==null||a.return()}finally{if(i)throw r}}return n}function gc(n){return String.prototype.normalize?typeof n=="string"?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:n}var bg=function(){return/(?=.*chrome)(?=.*android)/i.test(navigator.userAgent)};function yg(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,function(n){return(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16)})}function nr(n){var t,e=Fv.call(this,n),i=n==null||(t=n.classList)===null||t===void 0?void 0:t.contains(this.settings.classNames.tag);return e&&i}function _g(n){return Fv.call(this,n)&&(n==null?void 0:n.closest(this.settings.classNames.tagSelector))}function Fv(n){var t;return(n==null||(t=n.closest)===null||t===void 0?void 0:t.call(n,this.settings.classNames.namespaceSelector))===this.DOM.scope}function Bv(n,t){var e=window.getSelection();return t=t||e.getRangeAt(0),typeof n=="string"&&(n=document.createTextNode(n)),t&&(t.deleteContents(),t.insertNode(n)),n}function Ft(n,t,e){return n?(t&&(n.__tagifyTagData=e?t:ie({},n.__tagifyTagData||{},t)),n.__tagifyTagData):(Oi.warn("tag element doesn't exist",{tagElm:n,data:t}),t)}function _i(n){if(n&&n.parentNode){var t=n,e=window.getSelection(),i=e.getRangeAt(0);e.rangeCount&&(i.setStartAfter(t),i.collapse(!0),e.removeAllRanges(),e.addRange(i))}}function Hv(n,t){n.forEach(function(e){if(Ft(e.previousSibling)||!e.previousSibling){var i=document.createTextNode("");e.before(i),t&&_i(i)}})}var _h={delimiters:",",pattern:null,tagTextProp:"value",maxTags:1/0,callbacks:{},addTagOnBlur:!0,addTagOn:["blur","tab","enter"],onChangeAfterBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,userInput:!0,focusable:!0,focusInputOnRemove:!0,keepInvalidTags:!1,createInvalidTags:!0,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,pasteAsTags:!0,editTags:{clicks:2,keepInvalid:!0},transformTag:function(){},trim:!0,a11y:{focusableTags:!1},mixMode:{insertAfterTag:" "},autoComplete:{enabled:!0,rightKey:!1,tabKey:!1},classNames:{namespace:"tagify",mixMode:"tagify--mix",selectMode:"tagify--select",input:"tagify__input",focus:"tagify--focus",tagNoAnimation:"tagify--noAnim",tagInvalid:"tagify--invalid",tagNotAllowed:"tagify--notAllowed",scopeLoading:"tagify--loading",hasMaxTags:"tagify--hasMaxTags",hasNoTags:"tagify--noTags",empty:"tagify--empty",inputInvalid:"tagify__input--invalid",dropdown:"tagify__dropdown",dropdownWrapper:"tagify__dropdown__wrapper",dropdownHeader:"tagify__dropdown__header",dropdownFooter:"tagify__dropdown__footer",dropdownItem:"tagify__dropdown__item",dropdownItemActive:"tagify__dropdown__item--active",dropdownItemHidden:"tagify__dropdown__item--hidden",dropdownItemSelected:"tagify__dropdown__item--selected",dropdownInital:"tagify__dropdown--initial",tag:"tagify__tag",tagText:"tagify__tag-text",tagX:"tagify__tag__removeBtn",tagLoading:"tagify__tag--loading",tagEditing:"tagify__tag--editable",tagFlash:"tagify__tag--flash",tagHide:"tagify__tag--hide"},dropdown:{classname:"",enabled:2,maxItems:10,searchKeys:["value","searchBy"],fuzzySearch:!0,caseSensitive:!1,accentedSearch:!0,includeSelectedTags:!1,escapeHTML:!0,highlightFirst:!0,closeOnSelect:!0,clearOnSelect:!0,position:"all",appendTarget:null},hooks:{beforeRemoveTag:function(){return Promise.resolve()},beforePaste:function(){return Promise.resolve()},suggestionClick:function(){return Promise.resolve()},beforeKeyDown:function(){return Promise.resolve()}}};function rC(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function sC(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{},i=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(e).filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),i.forEach(function(r){rC(n,r,e[r])})}return n}function oC(n,t){return t=t??{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):function(e,i){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r.push.apply(r,s)}return r}(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n}function wh(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}function aC(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function cC(n){return function(t){if(Array.isArray(t))return wh(t)}(n)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(n)||function(t,e){if(t){if(typeof t=="string")return wh(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return wh(t,e)}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lC(){for(var n in this.dropdown={},this._dropdown)this.dropdown[n]=typeof this._dropdown[n]=="function"?this._dropdown[n].bind(this):this._dropdown[n];this.dropdown.refs(),this.DOM.dropdown.__tagify=this}var mc,Br,uC=(mc=function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{},i=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(e).filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),i.forEach(function(r){aC(n,r,e[r])})}return n}({},{events:{binding:function(){var n=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],t=this.dropdown.events.callbacks,e=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this,null),onKeyDown:t.onKeyDown.bind(this),onMouseOver:t.onMouseOver.bind(this),onMouseLeave:t.onMouseLeave.bind(this),onClick:t.onClick.bind(this),onScroll:t.onScroll.bind(this)},i=n?"addEventListener":"removeEventListener";this.settings.dropdown.position!="manual"&&(document[i]("scroll",e.position,!0),window[i]("resize",e.position),window[i]("keydown",e.onKeyDown)),this.DOM.dropdown[i]("mouseover",e.onMouseOver),this.DOM.dropdown[i]("mouseleave",e.onMouseLeave),this.DOM.dropdown[i]("mousedown",e.onClick),this.DOM.dropdown.content[i]("scroll",e.onScroll)},callbacks:{onKeyDown:function(n){var t=this;if(this.state.hasFocus&&!this.state.composing){var e=this.settings,i=e.dropdown.includeSelectedTags,r=this.DOM.dropdown.querySelector(e.classNames.dropdownItemActiveSelector),s=this.dropdown.getSuggestionDataByNode(r),a=e.mode=="mix",l=e.mode=="select";e.hooks.beforeKeyDown(n,{tagify:this}).then(function(u){switch(n.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":n.preventDefault();var h=t.dropdown.getAllSuggestionsRefs(),d=n.key=="ArrowUp"||n.key=="Up";r&&(r=t.dropdown.getNextOrPrevOption(r,!d)),r&&r.matches(e.classNames.dropdownItemSelector)||(r=h[d?h.length-1:0]),t.dropdown.highlightOption(r,!0);break;case"PageUp":case"PageDown":var b;n.preventDefault();var _=t.dropdown.getAllSuggestionsRefs(),x=Math.floor(t.DOM.dropdown.content.clientHeight/((b=_[0])===null||b===void 0?void 0:b.offsetHeight))||1,S=n.key==="PageUp";if(r){var C=_.indexOf(r),T=S?Math.max(0,C-x):Math.min(_.length-1,C+x);r=_[T]}else r=_[0];t.dropdown.highlightOption(r,!0);break;case"Home":case"End":n.preventDefault();var P=t.dropdown.getAllSuggestionsRefs();r=P[n.key==="Home"?0:P.length-1],t.dropdown.highlightOption(r,!0);break;case"Escape":case"Esc":t.dropdown.hide();break;case"ArrowRight":if(t.state.actions.ArrowLeft||e.autoComplete.rightKey)return;case"Tab":var R=!e.autoComplete.rightKey||!e.autoComplete.tabKey;if(!a&&!l&&r&&R&&!t.state.editing&&s){n.preventDefault();var B=t.dropdown.getMappedValue(s);return t.state.autoCompleteData=s,t.input.autocomplete.set.call(t,B),!1}return!0;case"Enter":n.preventDefault(),t.state.actions.selectOption=!0,setTimeout(function(){return t.state.actions.selectOption=!1},100),e.hooks.suggestionClick(n,{tagify:t,tagData:s,suggestionElm:r}).then(function(){if(r){var D=i?r:t.dropdown.getNextOrPrevOption(r,!d);t.dropdown.selectOption(r,n,function(){if(D){var L=D.getAttribute("value");D=t.dropdown.getSuggestionNodeByValue(L),t.dropdown.highlightOption(D)}})}else t.dropdown.hide(),a||t.addTags(t.state.inputText.trim(),!0)}).catch(function(D){return Oi.warn(D)});break;case"Backspace":if(a||t.state.editing.scope)return;var H=t.input.raw.call(t);H!=""&&H.charCodeAt(0)!=8203||(e.backspace===!0?t.removeTags():e.backspace=="edit"&&setTimeout(t.editTag.bind(t),0))}})}},onMouseOver:function(n){var t=n.target.closest(this.settings.classNames.dropdownItemSelector);this.dropdown.highlightOption(t)},onMouseLeave:function(n){this.dropdown.highlightOption()},onClick:function(n){var t=this;if(n.button==0&&n.target!=this.DOM.dropdown&&n.target!=this.DOM.dropdown.content){var e=n.target.closest(this.settings.classNames.dropdownItemSelector),i=this.dropdown.getSuggestionDataByNode(e);this.state.actions.selectOption=!0,setTimeout(function(){return t.state.actions.selectOption=!1},100),this.settings.hooks.suggestionClick(n,{tagify:this,tagData:i,suggestionElm:e}).then(function(){e?t.dropdown.selectOption(e,n):t.dropdown.hide()}).catch(function(r){return Oi.warn(r)})}},onScroll:function(n){var t=n.target,e=t.scrollTop/(t.scrollHeight-t.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(e)})}}},refilter:function(n){n=n||this.state.dropdown.query||"",this.suggestedListItems=this.dropdown.filterListItems(n),this.dropdown.fill(),this.suggestedListItems.length||this.dropdown.hide(),this.trigger("dropdown:updated",this.DOM.dropdown)},getSuggestionDataByNode:function(n){for(var t,e=n&&n.getAttribute("value"),i=this.suggestedListItems.length;i--;){if(gn(t=this.suggestedListItems[i])&&t.value==e)return t;if(t==e)return{value:t}}},getSuggestionNodeByValue:function(n){return this.dropdown.getAllSuggestionsRefs().find(function(t){return t.getAttribute("value")===n})},getNextOrPrevOption:function(n){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],e=this.dropdown.getAllSuggestionsRefs(),i=e.findIndex(function(r){return r===n});return t?e[i+1]:e[i-1]},highlightOption:function(n,t){var e,i=this.settings.classNames.dropdownItemActive;if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(i),this.state.ddItemElm.removeAttribute("aria-selected")),!n)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);e=this.dropdown.getSuggestionDataByNode(n),this.state.ddItemData=e,this.state.ddItemElm=n,n.classList.add(i),n.setAttribute("aria-selected",!0),t&&(n.parentNode.scrollTop=n.clientHeight+n.offsetTop-n.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,e),this.dropdown.position())},selectOption:function(n,t,e){var i=this,r=this.settings,s=r.dropdown.includeSelectedTags,a=r.dropdown,l=a.clearOnSelect,u=a.closeOnSelect;if(!n)return this.addTags(this.state.inputText,!0),void(u&&this.dropdown.hide());t=t||{};var h=n.getAttribute("value"),d=h=="noMatch",b=r.mode=="mix",_=this.suggestedListItems.find(function(S){var C;return((C=S.value)!==null&&C!==void 0?C:S)==h});if(this.trigger("dropdown:select",{data:_,elm:n,event:t}),_||d){if(this.state.editing){var x=this.normalizeTags([_])[0];_=r.transformTag.call(this,x)||x,this.onEditTagDone(null,ie({__isValid:!0},_))}else this[b?"addMixTags":"addTags"]([_||this.input.raw.call(this)],l);(b||this.DOM.input.parentNode)&&(setTimeout(function(){i.DOM.input.focus(),i.toggleFocusClass(!0)}),u&&setTimeout(this.dropdown.hide.bind(this)),s?e&&e():(n.addEventListener("transitionend",function(){i.dropdown.fillHeaderFooter(),setTimeout(function(){n.remove(),i.dropdown.refilter(),e&&e()},100)},{once:!0}),n.classList.add(this.settings.classNames.dropdownItemHidden)))}else u&&setTimeout(this.dropdown.hide.bind(this))},selectAll:function(n){this.suggestedListItems.length=0,this.dropdown.hide(),this.dropdown.filterListItems("");var t=this.dropdown.filterListItems("");return n||(t=this.state.dropdown.suggestions),this.addTags(t,!0),this},filterListItems:function(n,t){var e,i,r,s,a,l,u=function(){var D,L,N=void 0,W=void 0;D=S[B],i=((L=Object)!=null&&typeof Symbol<"u"&&L[Symbol.hasInstance]?L[Symbol.hasInstance](D):D instanceof L)?S[B]:{value:S[B]};var V,X=Object.keys(i).some(function(K){return R.includes(K)})?R:["value"];b.fuzzySearch&&!t.exact?(s=X.reduce(function(K,Q){return K+" "+(i[Q]||"")},"").toLowerCase().trim(),b.accentedSearch&&(s=gc(s),l=gc(l)),N=s.indexOf(l)==0,W=s===l,V=s,r=l.toLowerCase().split(" ").every(function(K){return V.includes(K.toLowerCase())})):(N=!0,r=X.some(function(K){var Q=""+(i[K]||"");return b.accentedSearch&&(Q=gc(Q),l=gc(l)),b.caseSensitive||(Q=Q.toLowerCase()),W=Q===l,t.exact?Q===l:Q.indexOf(l)==0})),a=!b.includeSelectedTags&&e.isTagDuplicate(gn(i)?i.value:i),r&&!a&&(W&&N?x.push(i):b.sortby=="startsWith"&&N?_.unshift(i):_.push(i))},h=this,d=this.settings,b=d.dropdown,_=(t=t||{},[]),x=[],S=d.whitelist,C=b.maxItems>=0?b.maxItems:1/0,T=b.includeSelectedTags,P=typeof b.sortby=="function",R=b.searchKeys,B=0;if(!(n=d.mode=="select"&&this.value.length&&this.value[0][d.tagTextProp]==n?"":n)||!R.length){_=T?S:S.filter(function(D){return!h.isTagDuplicate(gn(D)?D.value:D)});var H=P?b.sortby(_,l):_.slice(0,C);return this.state.dropdown.suggestions=H,H}for(l=b.caseSensitive?""+n:(""+n).toLowerCase();B<S.length;B++)e=this,u();return this.state.dropdown.suggestions=x.concat(_),H=P?b.sortby(x.concat(_),l):x.concat(_).slice(0,C),this.state.dropdown.suggestions=H,H},getMappedValue:function(n){var t=this.settings.dropdown.mapValueTo;return t?typeof t=="function"?t(n):n[t]||n.value:n.value},createListHTML:function(n){var t=this;return ie([],n).map(function(e,i){typeof e!="string"&&typeof e!="number"||(e={value:e});var r=t.dropdown.getMappedValue(e);return r=typeof r=="string"&&t.settings.dropdown.escapeHTML?Qi(r):r,t.settings.templates.dropdownItem.apply(t,[oC(sC({},e),{mappedValue:r}),t])}).join("")}}),Br=(Br={refs:function(){this.DOM.dropdown=this.parseTemplate("dropdown",[this.settings]),this.DOM.dropdown.content=this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-wrapper']")},getHeaderRef:function(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-header']")},getFooterRef:function(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-footer']")},getAllSuggestionsRefs:function(){return cC(this.DOM.dropdown.content.querySelectorAll(this.settings.classNames.dropdownItemSelector))},show:function(n){var t,e,i,r=this,s=this.settings,a=s.mode=="mix"&&!s.enforceWhitelist,l=!s.whitelist||!s.whitelist.length,u=s.dropdown.position=="manual";if(n=n===void 0?this.state.inputText:n,!(l&&!a&&!s.templates.dropdownItemNoMatch||s.dropdown.enabled===!1||this.state.isLoading||this.settings.readonly)){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems(n),n&&!this.suggestedListItems.length&&(this.trigger("dropdown:noMatch",n),s.templates.dropdownItemNoMatch&&(i=s.templates.dropdownItemNoMatch.call(this,{value:n}))),!i){if(this.suggestedListItems.length)n&&a&&!this.state.editing.scope&&!lo(this.suggestedListItems[0].value,n)&&this.suggestedListItems.unshift({value:n});else{if(!n||!a||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),void this.dropdown.hide();this.suggestedListItems=[{value:n}]}e=""+(gn(t=this.suggestedListItems[0])?t.value:t),s.autoComplete&&e&&e.indexOf(n)==0&&this.input.autocomplete.suggest.call(this,t)}this.dropdown.fill(i),s.dropdown.highlightFirst&&this.dropdown.highlightOption(this.DOM.dropdown.content.querySelector(s.classNames.dropdownItemSelector)),this.state.dropdown.visible||setTimeout(this.dropdown.events.binding.bind(this)),this.state.dropdown.visible=n||!0,this.state.dropdown.query=n,this.setStateSelection(),u||setTimeout(function(){r.dropdown.position(),r.dropdown.render()}),setTimeout(function(){r.trigger("dropdown:show",r.DOM.dropdown)})}},hide:function(n){var t=this,e=this.DOM,i=e.scope,r=e.dropdown,s=this.settings.dropdown.position=="manual"&&!n;if(r&&document.body.contains(r)&&!s)return window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),i.setAttribute("aria-expanded",!1),r.parentNode.removeChild(r),setTimeout(function(){t.state.dropdown.visible=!1},100),this.state.dropdown.query=this.state.ddItemData=this.state.ddItemElm=this.state.selection=null,this.state.tag&&this.state.tag.value.length&&(this.state.flaggedTags[this.state.tag.baseOffset]=this.state.tag),this.trigger("dropdown:hide",r),this},toggle:function(n){this.dropdown[this.state.dropdown.visible&&!n?"hide":"show"]()},getAppendTarget:function(){var n=this.settings.dropdown;return typeof n.appendTarget=="function"?n.appendTarget():n.appendTarget},render:function(){var n,t,e,i=this,r=(n=this.DOM.dropdown,(e=n.cloneNode(!0)).style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(e),t=e.clientHeight,e.parentNode.removeChild(e),t),s=this.settings,a=this.dropdown.getAppendTarget();return s.dropdown.enabled===!1||(this.DOM.scope.setAttribute("aria-expanded",!0),document.body.contains(this.DOM.dropdown)||(this.DOM.dropdown.classList.add(s.classNames.dropdownInital),this.dropdown.position(r),a.appendChild(this.DOM.dropdown),setTimeout(function(){return i.DOM.dropdown.classList.remove(s.classNames.dropdownInital)}))),this},fill:function(n){n=typeof n=="string"?n:this.dropdown.createListHTML(n||this.suggestedListItems);var t,e=this.settings.templates.dropdownContent.call(this,n);this.DOM.dropdown.content.innerHTML=(t=e)?t.replace(/\>[\r\n ]+\</g,"><").split(/>\s+</).join("><").trim():""},fillHeaderFooter:function(){var n=this.dropdown.filterListItems(this.state.dropdown.query),t=this.parseTemplate("dropdownHeader",[n]),e=this.parseTemplate("dropdownFooter",[n]),i=this.dropdown.getHeaderRef(),r=this.dropdown.getFooterRef();t&&(i==null||i.parentNode.replaceChild(t,i)),e&&(r==null||r.parentNode.replaceChild(e,r))},position:function(n){var t=this.settings.dropdown,e=this.dropdown.getAppendTarget();if(t.position!="manual"&&e){var i,r,s,a,l,u,h,d,b,_,x=this.DOM.dropdown,S=t.RTL,C=e===document.body,T=e===this.DOM.scope,P=C?window.pageYOffset:e.scrollTop,R=document.fullscreenElement||document.webkitFullscreenElement||document.documentElement,B=R.clientHeight,H=Math.max(R.clientWidth||0,window.innerWidth||0),D=H>480?t.position:"all",L=this.DOM[D=="input"?"input":"scope"];if(n=n||x.clientHeight,this.state.dropdown.visible){if(D=="text"?(s=(i=function(){var V=document.getSelection();if(V.rangeCount){var X,K,Q=V.getRangeAt(0),rt=Q.startContainer,lt=Q.startOffset;if(lt>0)return(K=document.createRange()).setStart(rt,lt-1),K.setEnd(rt,lt),{left:(X=K.getBoundingClientRect()).right,top:X.top,bottom:X.bottom};if(rt.getBoundingClientRect)return rt.getBoundingClientRect()}return{left:-9999,top:-9999}}()).bottom,r=i.top,a=i.left,l="auto"):(u=function(V){var X=0,K=0;for(V=V.parentNode;V&&V!=R;)X+=V.offsetTop||0,K+=V.offsetLeft||0,V=V.parentNode;return{top:X,left:K}}(e),i=L.getBoundingClientRect(),r=T?-1:i.top-u.top,s=(T?i.height:i.bottom-u.top)-1,a=T?-1:i.left-u.left,l=i.width+"px"),!C){var N=function(){for(var V=0,X=t.appendTarget.parentNode;X;)V+=X.scrollTop||0,X=X.parentNode;return V}();r+=N,s+=N}var W;r=Math.floor(r),s=Math.ceil(s),d=H-a<120,b=((h=(W=t.placeAbove)!==null&&W!==void 0?W:B-i.bottom<n)?r:s)+P,_=a+(S&&i.width||0)+window.pageXOffset,_=D=="text"&&d?"right: 0;":"left: ".concat(_,"px;"),x.style.cssText="".concat(_," top: ").concat(b,"px; min-width: ").concat(l,"; max-width: ").concat(l),x.setAttribute("placement",h?"top":"bottom"),x.setAttribute("position",D)}}}})!=null?Br:{},Object.getOwnPropertyDescriptors?Object.defineProperties(mc,Object.getOwnPropertyDescriptors(Br)):function(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e.push.apply(e,i)}return e}(Object(Br)).forEach(function(n){Object.defineProperty(mc,n,Object.getOwnPropertyDescriptor(Br,n))}),mc),eo="@yaireo/tagify/",hC={empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},fC={wrapper:function(n,t){return'<tags class="'.concat(t.classNames.namespace," ").concat(t.mode?"".concat(t.classNames[t.mode+"Mode"]):""," ").concat(n.className,`"
|
||
`).concat(t.readonly?"readonly":"",`
|
||
`).concat(t.disabled?"disabled":"",`
|
||
`).concat(t.required?"required":"",`
|
||
`).concat(t.mode==="select"?"spellcheck='false'":"",`
|
||
tabIndex="-1">
|
||
`).concat(this.settings.templates.input.call(this),`
|
||
`).concat(dg,`
|
||
</tags>`)},input:function(){var n=this.settings,t=n.placeholder||dg;return"<span ".concat(!n.readonly&&n.userInput?"contenteditable":"",' data-can-editable tabIndex="0" data-placeholder="').concat(t,'" aria-placeholder="').concat(n.placeholder||"",`"
|
||
class="`).concat(n.classNames.input,`"
|
||
role="textbox"
|
||
autocapitalize="false"
|
||
autocorrect="off"
|
||
aria-autocomplete="both"
|
||
aria-multiline="`).concat(n.mode=="mix",'"></span>')},tag:function(n,t){var e=t.settings;return'<tag title="'.concat(n.title||n.value,`"
|
||
contenteditable='false'
|
||
tabIndex="`).concat(e.a11y.focusableTags?0:-1,`"
|
||
class="`).concat(e.classNames.tag," ").concat(n.class||"",`"
|
||
`).concat(this.getAttributes(n),`>
|
||
<x title='' tabIndex="`).concat(e.a11y.focusableTags?0:-1,'" class="').concat(e.classNames.tagX,`" role='button' aria-label='remove tag'></x>
|
||
<div>
|
||
<span `).concat(e.mode==="select"&&e.userInput?"contenteditable='true'":"",` autocapitalize="false" autocorrect="off" spellcheck='false' class="`).concat(e.classNames.tagText,'">').concat(n[e.tagTextProp]||n.value,`</span>
|
||
</div>
|
||
</tag>`)},dropdown:function(n){var t=n.dropdown,e=t.position=="manual";return'<div class="'.concat(e?"":n.classNames.dropdown," ").concat(t.classname,'" role="listbox" aria-labelledby="dropdown" dir="').concat(t.RTL?"rtl":"",`">
|
||
<div data-selector='tagify-suggestions-wrapper' class="`).concat(n.classNames.dropdownWrapper,`"></div>
|
||
</div>`)},dropdownContent:function(n){var t=this.settings.templates,e=this.state.dropdown.suggestions;return`
|
||
`.concat(t.dropdownHeader.call(this,e),`
|
||
`).concat(n,`
|
||
`).concat(t.dropdownFooter.call(this,e),`
|
||
`)},dropdownItem:function(n){return"<div ".concat(this.getAttributes(n),`
|
||
class='`).concat(this.settings.classNames.dropdownItem," ").concat(this.isTagDuplicate(n.value)?this.settings.classNames.dropdownItemSelected:""," ").concat(n.class||"",`'
|
||
tabindex="0"
|
||
role="option">`).concat(n.mappedValue||n.value,"</div>")},dropdownHeader:function(n){return`<header data-selector='tagify-suggestions-header' class="`.concat(this.settings.classNames.dropdownHeader,'"></header>')},dropdownFooter:function(n){var t=n.length-this.settings.dropdown.maxItems;return t>0?`<footer data-selector='tagify-suggestions-footer' class="`.concat(this.settings.classNames.dropdownFooter,`">
|
||
`).concat(t,` more items. Refine your search.
|
||
</footer>`):""},dropdownItemNoMatch:null};function wg(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}function xg(n,t){return t!=null&&typeof Symbol<"u"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](n):n instanceof t}function dC(n,t){return function(e){if(Array.isArray(e))return e}(n)||function(e,i){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var s,a,l=[],u=!0,h=!1;try{for(r=r.call(e);!(u=(s=r.next()).done)&&(l.push(s.value),!i||l.length!==i);u=!0);}catch(d){h=!0,a=d}finally{try{u||r.return==null||r.return()}finally{if(h)throw a}}return l}}(n,t)||function(e,i){if(e){if(typeof e=="string")return wg(e,i);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wg(e,i)}}(n,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xh(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}function Yi(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function Sg(n,t){return t!=null&&typeof Symbol<"u"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](n):n instanceof t}function pC(n,t){return t=t??{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):function(e,i){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r.push.apply(r,s)}return r}(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n}function Sh(n){return function(t){if(Array.isArray(t))return xh(t)}(n)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(n)||function(t,e){if(t){if(typeof t=="string")return xh(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return xh(t,e)}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var gC={customBinding:function(){var n=this;this.customEventsList.forEach(function(t){n.on(t,n.settings.callbacks[t])})},binding:function(){var n,t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],e=this.settings,i=this.events.callbacks,r=t?"addEventListener":"removeEventListener";if(!(this.state.mainEvents&&t||e.disabled||e.readonly)){for(var s in this.state.mainEvents=t,t&&!this.listeners.main&&(this.events.bindGlobal.call(this),this.settings.isJQueryPlugin&&jQuery(this.DOM.originalInput).on("tagify.removeAllTags",this.removeAllTags.bind(this))),n=this.listeners.main=this.listeners.main||{keydown:["input",i.onKeydown.bind(this)],click:["scope",i.onClickScope.bind(this)],dblclick:e.mode!="select"&&["scope",i.onDoubleClickScope.bind(this)],paste:["input",i.onPaste.bind(this)],drop:["input",i.onDrop.bind(this)],compositionstart:["input",i.onCompositionStart.bind(this)],compositionend:["input",i.onCompositionEnd.bind(this)]})n[s]&&this.DOM[n[s][0]][r](s,n[s][1]);var a=this.listeners.main.inputMutationObserver||new MutationObserver(i.onInputDOMChange.bind(this));a.disconnect(),e.mode=="mix"&&a.observe(this.DOM.input,{childList:!0}),this.events.bindOriginaInputListener.call(this)}},bindOriginaInputListener:function(n){var t=(n||0)+500;this.listeners.main&&(clearInterval(this.listeners.main.originalInputValueObserverInterval),this.listeners.main.originalInputValueObserverInterval=setInterval(this.events.callbacks.observeOriginalInputValue.bind(this),t))},bindGlobal:function(n){var t,e=this.events.callbacks,i=n?"removeEventListener":"addEventListener";if(this.listeners&&(n||!this.listeners.global)){this.listeners.global=this.listeners.global||[{type:this.isIE?"keydown":"input",target:this.DOM.input,cb:e[this.isIE?"onInputIE":"onInput"].bind(this)},{type:"keydown",target:window,cb:e.onWindowKeyDown.bind(this)},{type:"focusin",target:this.DOM.scope,cb:e.onFocusBlur.bind(this)},{type:"focusout",target:this.DOM.scope,cb:e.onFocusBlur.bind(this)},{type:"click",target:document,cb:e.onClickAnywhere.bind(this),useCapture:!0}];var r=!0,s=!1,a=void 0;try{for(var l,u=this.listeners.global[Symbol.iterator]();!(r=(l=u.next()).done);r=!0)(t=l.value).target[i](t.type,t.cb,!!t.useCapture)}catch(h){s=!0,a=h}finally{try{r||u.return==null||u.return()}finally{if(s)throw a}}}},unbindGlobal:function(){this.events.bindGlobal.call(this,!0)},callbacks:{onFocusBlur:function(n){var t,e,i=this.settings,r=_g.call(this,n.relatedTarget),s=nr.call(this,n.target),a=n.target.classList.contains(i.classNames.tagX),l=n.type=="focusin",u=n.type=="focusout";a&&i.mode!="mix"&&i.focusInputOnRemove&&this.DOM.input.focus(),r&&l&&!s&&!a&&this.toggleFocusClass(this.state.hasFocus=+new Date);var h=n.target?this.trim(this.DOM.input.textContent):"",d=(e=this.value)===null||e===void 0||(t=e[0])===null||t===void 0?void 0:t[i.tagTextProp],b=i.dropdown.enabled>=0,_={relatedTarget:n.relatedTarget},x=this.state.actions.selectOption&&(b||!i.dropdown.closeOnSelect),S=this.state.actions.addNew&&b;if(u){if(n.relatedTarget===this.DOM.scope)return this.dropdown.hide(),void this.DOM.input.focus();this.postUpdate(),i.onChangeAfterBlur&&this.triggerChangeEvent()}if(!(x||S||a))if(this.state.hasFocus=!(!l&&!r)&&+new Date,this.toggleFocusClass(this.state.hasFocus),i.mode!="mix"){if(l){if(!i.focusable)return;var C=i.dropdown.enabled===0&&!this.state.dropdown.visible,T=this.DOM.scope.querySelector(this.settings.classNames.tagTextSelector);return this.trigger("focus",_),void(C&&!s&&(this.dropdown.show(this.value.length?"":void 0),i.mode==="select"&&this.setRangeAtStartEnd(!1,T)))}if(u){if(this.trigger("blur",_),this.loading(!1),i.mode=="select"){if(this.value.length){var P=this.getTagElms()[0];h=this.trim(P.textContent)}d===h&&(h="")}h&&!this.state.actions.selectOption&&i.addTagOnBlur&&i.addTagOn.includes("blur")&&this.addTags(h,!0)}r||(this.DOM.input.removeAttribute("style"),this.dropdown.hide())}else l?this.trigger("focus",_):u&&(this.trigger("blur",_),this.loading(!1),this.dropdown.hide(),this.state.dropdown.visible=void 0,this.setStateSelection())},onCompositionStart:function(n){this.state.composing=!0},onCompositionEnd:function(n){this.state.composing=!1},onWindowKeyDown:function(n){var t,e=this.settings,i=document.activeElement,r=_g.call(this,i)&&this.DOM.scope.contains(i),s=i===this.DOM.input,a=r&&i.hasAttribute("readonly"),l=this.DOM.scope.querySelector(this.settings.classNames.tagTextSelector),u=this.state.dropdown.visible;if((n.key==="Tab"&&u||this.state.hasFocus||r&&!a)&&!s){t=i.nextElementSibling;var h=n.target.classList.contains(e.classNames.tagX);switch(n.key){case"Backspace":e.readonly||this.state.editing||(this.removeTags(i),(t||this.DOM.input).focus());break;case"Enter":if(h)return void this.removeTags(n.target.parentNode);e.a11y.focusableTags&&nr.call(this,i)&&setTimeout(this.editTag.bind(this),0,i);break;case"ArrowDown":this.state.dropdown.visible||e.mode=="mix"||this.dropdown.show();break;case"Tab":l==null||l.focus()}}},onKeydown:function(n){var t=this,e=this.settings;if(!this.state.composing&&e.userInput){e.mode=="select"&&e.enforceWhitelist&&this.value.length&&n.key!="Tab"&&n.preventDefault();var i=this.trim(n.target.textContent);this.trigger("keydown",{event:n}),e.hooks.beforeKeyDown(n,{tagify:this}).then(function(r){if(e.mode=="mix"){switch(n.key){case"Left":case"ArrowLeft":t.state.actions.ArrowLeft=!0;break;case"Delete":case"Backspace":if(t.state.editing)return;var s=document.getSelection(),a=n.key=="Delete"&&s.anchorOffset==(s.anchorNode.length||0),l=s.anchorNode.previousSibling,u=s.anchorNode.nodeType==1||!s.anchorOffset&&l&&l.nodeType==1&&s.anchorNode.previousSibling;(function(P){var R=document.createElement("div");P.replace(/\&#?[0-9a-z]+;/gi,function(B){return R.innerHTML=B,R.innerText})})(t.DOM.input.innerHTML);var h,d,b,_=t.getTagElms(),x=s.anchorNode.length===1&&s.anchorNode.nodeValue=="";if(e.backspace=="edit"&&u)return h=s.anchorNode.nodeType==1?null:s.anchorNode.previousElementSibling,setTimeout(t.editTag.bind(t),0,h),void n.preventDefault();if(bg()&&Sg(u,Element))return b=mg(u),u.hasAttribute("readonly")||u.remove(),t.DOM.input.focus(),void setTimeout(function(){_i(b),t.DOM.input.click()});if(s.anchorNode.nodeName=="BR")return;if((a||u)&&s.anchorNode.nodeType==1?d=s.anchorOffset==0?a?_[0]:null:_[Math.min(_.length,s.anchorOffset)-1]:a?d=s.anchorNode.nextElementSibling:Sg(u,Element)&&(d=u),s.anchorNode.nodeType==3&&!s.anchorNode.nodeValue&&s.anchorNode.previousElementSibling&&n.preventDefault(),(u||a)&&!e.backspace||s.type!="Range"&&!s.anchorOffset&&s.anchorNode==t.DOM.input&&n.key!="Delete")return void n.preventDefault();if(s.type!="Range"&&d&&d.hasAttribute("readonly"))return void _i(mg(d));n.key=="Delete"&&x&&Ft(s.anchorNode.nextSibling)&&t.removeTags(s.anchorNode.nextSibling)}return!0}var S=e.dropdown.position=="manual";switch(n.key){case"Backspace":e.mode=="select"&&e.enforceWhitelist&&t.value.length?t.removeTags():t.state.dropdown.visible&&e.dropdown.position!="manual"||n.target.textContent!=""&&i.charCodeAt(0)!=8203||(e.backspace===!0?t.removeTags():e.backspace=="edit"&&setTimeout(t.editTag.bind(t),0));break;case"Esc":case"Escape":if(t.state.dropdown.visible)return;n.target.blur();break;case"Down":case"ArrowDown":t.state.dropdown.visible||t.dropdown.show();break;case"ArrowRight":var C=t.state.inputSuggestion||t.state.ddItemData;if(C&&e.autoComplete.rightKey)return void t.addTags([C],!0);break;case"Tab":return!0;case"Enter":if(t.state.dropdown.visible&&!S)return;n.preventDefault();var T=t.state.autoCompleteData||i;setTimeout(function(){t.state.dropdown.visible&&!S||t.state.actions.selectOption||!e.addTagOn.includes(n.key.toLowerCase())||(t.addTags([T],!0),t.state.autoCompleteData=null)})}}).catch(function(r){return r})}},onInput:function(n){this.postUpdate();var t=this.settings;if(t.mode=="mix")return this.events.callbacks.onMixTagsInput.call(this,n);var e=this.input.normalize.call(this,void 0,{trim:!1}),i=e.length>=t.dropdown.enabled,r={value:e,inputElm:this.DOM.input},s=this.validateTag({value:e});t.mode=="select"&&this.toggleScopeValidation(s),r.isValid=s,this.state.inputText!=e&&(this.input.set.call(this,e,!1),e.search(t.delimiters)!=-1?this.addTags(e)&&this.input.set.call(this):t.dropdown.enabled>=0&&this.dropdown[i?"show":"hide"](e),this.trigger("input",r))},onMixTagsInput:function(n){var t,e,i,r,s,a,l,u,h=this,d=this.settings,b=this.value.length,_=this.getTagElms(),x=document.createDocumentFragment(),S=window.getSelection().getRangeAt(0),C=[].map.call(_,function(T){return Ft(T).value});if(n.inputType=="deleteContentBackward"&&bg()&&this.events.callbacks.onKeydown.call(this,{target:n.target,key:"Backspace"}),Hv(this.getTagElms()),this.value.slice().forEach(function(T){T.readonly&&!C.includes(T.value)&&x.appendChild(h.createTagElem(T))}),x.childNodes.length&&(S.insertNode(x),this.setRangeAtStartEnd(!1,x.lastChild)),_.length!=b)return this.value=[].map.call(this.getTagElms(),function(T){return Ft(T)}),void this.update({withoutChangeEvent:!0});if(this.hasMaxTags())return!0;if(window.getSelection&&(a=window.getSelection()).rangeCount>0&&a.anchorNode.nodeType==3){if((S=a.getRangeAt(0).cloneRange()).collapse(!0),S.setStart(a.focusNode,0),i=(t=S.toString().slice(0,S.endOffset)).split(d.pattern).length-1,(e=t.match(d.pattern))&&(r=t.slice(t.lastIndexOf(e[e.length-1]))),r){if(this.state.actions.ArrowLeft=!1,this.state.tag={prefix:r.match(d.pattern)[0],value:r.replace(d.pattern,"")},this.state.tag.baseOffset=a.baseOffset-this.state.tag.value.length,u=this.state.tag.value.match(d.delimiters))return this.state.tag.value=this.state.tag.value.replace(d.delimiters,""),this.state.tag.delimiters=u[0],this.addTags(this.state.tag.value,d.dropdown.clearOnSelect),void this.dropdown.hide();s=this.state.tag.value.length>=d.dropdown.enabled;try{l=(l=this.state.flaggedTags[this.state.tag.baseOffset]).prefix==this.state.tag.prefix&&l.value[0]==this.state.tag.value[0],this.state.flaggedTags[this.state.tag.baseOffset]&&!this.state.tag.value&&delete this.state.flaggedTags[this.state.tag.baseOffset]}catch{}(l||i<this.state.mixMode.matchedPatternCount)&&(s=!1)}else this.state.flaggedTags={};this.state.mixMode.matchedPatternCount=i}setTimeout(function(){h.update({withoutChangeEvent:!0}),h.trigger("input",ie({},h.state.tag,{textContent:h.DOM.input.textContent})),h.state.tag&&h.dropdown[s?"show":"hide"](h.state.tag.value)},10)},onInputIE:function(n){var t=this;setTimeout(function(){t.events.callbacks.onInput.call(t,n)})},observeOriginalInputValue:function(){this.DOM.originalInput.parentNode||this.destroy(),this.DOM.originalInput.value!=this.DOM.originalInput.tagifyValue&&this.loadOriginalValues()},onClickAnywhere:function(n){if(n.target!=this.DOM.scope&&!this.DOM.scope.contains(n.target)){this.toggleFocusClass(!1),this.state.hasFocus=!1;var t=n.target.closest(this.settings.classNames.dropdownSelector);(t==null?void 0:t.__tagify)!=this&&this.dropdown.hide()}},onClickScope:function(n){var t=this.settings,e=n.target.closest("."+t.classNames.tag);n.target,this.DOM.scope;var i=+new Date-this.state.hasFocus;if(!n.target.classList.contains(t.classNames.tagX))return e&&!this.state.editing?(this.trigger("click",{tag:e,index:this.getNodeIndex(e),data:Ft(e),event:n}),void(t.editTags!==1&&t.editTags.clicks!==1&&t.mode!="select"||this.events.callbacks.onDoubleClickScope.call(this,n))):void(n.target==this.DOM.input&&(t.mode=="mix"&&this.fixFirefoxLastTagNoCaret(),i>500||!t.focusable)?this.state.dropdown.visible?this.dropdown.hide():t.dropdown.enabled===0&&t.mode!="mix"&&this.dropdown.show(this.value.length?"":void 0):t.mode!="select"||t.dropdown.enabled!==0||this.state.dropdown.visible||(this.events.callbacks.onDoubleClickScope.call(this,pC(function(r){for(var s=1;s<arguments.length;s++){var a=arguments[s]!=null?arguments[s]:{},l=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(l=l.concat(Object.getOwnPropertySymbols(a).filter(function(u){return Object.getOwnPropertyDescriptor(a,u).enumerable}))),l.forEach(function(u){Yi(r,u,a[u])})}return r}({},n),{target:this.getTagElms()[0]})),!t.userInput&&this.dropdown.show()));this.removeTags(n.target.parentNode)},onPaste:function(n){var t=this;n.preventDefault();var e,i,r,s=this.settings;if(!s.userInput)return!1;s.readonly||(i=n.clipboardData||window.clipboardData,r=i.getData("Text"),s.hooks.beforePaste(n,{tagify:this,pastedText:r,clipboardData:i}).then(function(a){a===void 0&&(a=r),a&&(t.injectAtCaret(a,window.getSelection().getRangeAt(0)),t.settings.mode=="mix"?t.events.callbacks.onMixTagsInput.call(t,n):t.settings.pasteAsTags?e=t.addTags(t.state.inputText+a,!0):(t.state.inputText=a,t.dropdown.show(a))),t.trigger("paste",{event:n,pastedText:r,clipboardData:i,tagsElems:e})}).catch(function(a){return a}))},onDrop:function(n){n.preventDefault()},onEditTagInput:function(n,t){var e,i=n.closest("."+this.settings.classNames.tag),r=this.getNodeIndex(i),s=Ft(i),a=this.input.normalize.call(this,n),l=(Yi(e={},this.settings.tagTextProp,a),Yi(e,"__tagId",s.__tagId),e),u=this.validateTag(l);this.editTagChangeDetected(ie(s,l))||n.originalIsValid!==!0||(u=!0),i.classList.toggle(this.settings.classNames.tagInvalid,u!==!0),s.__isValid=u,i.title=u===!0?s.title||s.value:u,a.length>=this.settings.dropdown.enabled&&(this.state.editing&&(this.state.editing.value=a),this.dropdown.show(a)),this.trigger("edit:input",{tag:i,index:r,data:ie({},this.value[r],{newValue:a}),event:t})},onEditTagPaste:function(n,t){var e=(t.clipboardData||window.clipboardData).getData("Text");t.preventDefault();var i=Bv(e);this.setRangeAtStartEnd(!1,i)},onEditTagClick:function(n,t){this.events.callbacks.onClickScope.call(this,t)},onEditTagFocus:function(n){this.state.editing={scope:n,input:n.querySelector("[contenteditable]")}},onEditTagBlur:function(n,t){var e=nr.call(this,t.relatedTarget);if(this.settings.mode=="select"&&e&&t.relatedTarget.contains(t.target))this.dropdown.hide();else if(this.state.editing&&(this.state.hasFocus||this.toggleFocusClass(),this.DOM.scope.contains(document.activeElement)||this.trigger("blur",{}),this.DOM.scope.contains(n))){var i,r,s,a=this.settings,l=n.closest("."+a.classNames.tag),u=Ft(l),h=this.input.normalize.call(this,n),d=(Yi(i={},a.tagTextProp,h),Yi(i,"__tagId",u.__tagId),i),b=u.__originalData,_=this.editTagChangeDetected(ie(u,d)),x=this.validateTag(d);if(h)if(_){var S;if(r=this.hasMaxTags(),s=ie({},b,(Yi(S={},a.tagTextProp,this.trim(h)),Yi(S,"__isValid",x),S)),a.transformTag.call(this,s,b),(x=(!r||b.__isValid===!0)&&this.validateTag(s))!==!0){if(this.trigger("invalid",{data:s,tag:l,message:x}),a.editTags.keepInvalid)return;a.keepInvalidTags?s.__isValid=x:s=b}else a.keepInvalidTags&&(delete s.title,delete s["aria-invalid"],delete s.class);this.onEditTagDone(l,s)}else this.onEditTagDone(l,b);else this.onEditTagDone(l)}},onEditTagkeydown:function(n,t){if(!this.state.composing)switch(this.trigger("edit:keydown",{event:n}),n.key){case"Esc":case"Escape":this.state.editing=!1,t.__tagifyTagData.__originalData.value?t.parentNode.replaceChild(t.__tagifyTagData.__originalHTML,t):t.remove();break;case"Enter":case"Tab":n.preventDefault(),setTimeout(function(){return n.target.blur()},0)}},onDoubleClickScope:function(n){var t=n.target.closest("."+this.settings.classNames.tag);if(t){var e,i,r=Ft(t),s=this.settings;(r==null?void 0:r.editable)!==!1&&(e=t.classList.contains(this.settings.classNames.tagEditing),i=t.hasAttribute("readonly"),s.readonly||e||i||!this.settings.editTags||!s.userInput||(this.events.callbacks.onEditTagFocus.call(this,t),this.editTag(t)),this.toggleFocusClass(!0),s.mode!="select"&&this.trigger("dblclick",{tag:t,index:this.getNodeIndex(t),data:Ft(t)}))}},onInputDOMChange:function(n){var t=this;n.forEach(function(i){i.addedNodes.forEach(function(r){if(r.outerHTML=="<div><br></div>")r.replaceWith(document.createElement("br"));else if(r.nodeType==1&&r.querySelector(t.settings.classNames.tagSelector)){var s,a=document.createTextNode("");r.childNodes[0].nodeType==3&&r.previousSibling.nodeName!="BR"&&(a=document.createTextNode(`
|
||
`)),(s=r).replaceWith.apply(s,Sh([a].concat(Sh(Sh(r.childNodes).slice(0,-1))))),_i(a)}else if(nr.call(t,r)){var l;if(((l=r.previousSibling)===null||l===void 0?void 0:l.nodeType)!=3||r.previousSibling.textContent||r.previousSibling.remove(),r.previousSibling&&r.previousSibling.nodeName=="BR"){r.previousSibling.replaceWith(`
|
||
`);for(var u=r.nextSibling,h="";u;)h+=u.textContent,u=u.nextSibling;h.trim()&&_i(r.previousSibling)}else r.previousSibling&&!Ft(r.previousSibling)||r.before("")}}),i.removedNodes.forEach(function(r){r&&r.nodeName=="BR"&&nr.call(t,e)&&(t.removeTags(e),t.fixFirefoxLastTagNoCaret())})});var e=this.DOM.input.lastChild;e&&e.nodeValue==""&&e.remove(),e&&e.nodeName=="BR"||this.DOM.input.appendChild(document.createElement("br"))}}};function Th(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}function Kh(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function Jn(n,t){return t!=null&&typeof Symbol<"u"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](n):n instanceof t}function Tg(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{},i=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(e).filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),i.forEach(function(r){Kh(n,r,e[r])})}return n}function vc(n){return function(t){if(Array.isArray(t))return Th(t)}(n)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(n)||function(t,e){if(t){if(typeof t=="string")return Th(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Th(t,e)}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bc(n,t){if(!n){Oi.warn("input element not found",n);var e=new Proxy(this,{get:function(){return function(){return e}}});return e}if(n.__tagify)return Oi.warn("input element is already Tagified - Same instance is returned.",n),n.__tagify;var i;ie(this,function(r){var s=document.createTextNode(""),a={};function l(u,h,d){d&&h.split(/\s+/g).forEach(function(b){return s[u+"EventListener"].call(s,b,d)})}return{removeAllCustomListeners:function(){Object.entries(a).forEach(function(u){var h=dC(u,2),d=h[0];h[1].forEach(function(b){return l("remove",d,b)})}),a={}},off:function(u,h){return u&&(h?l("remove",u,h):u.split(/\s+/g).forEach(function(d){var b;(b=a[d])===null||b===void 0||b.forEach(function(_){return l("remove",d,_)}),delete a[d]})),this},on:function(u,h){return h&&typeof h=="function"&&(u.split(/\s+/g).forEach(function(d){Array.isArray(a[d])?a[d].push(h):a[d]=[h]}),l("add",u,h)),this},trigger:function(u,h,d){var b;if(d=d||{cloneData:!0},u)if(r.settings.isJQueryPlugin)u=="remove"&&(u="removeTag"),jQuery(r.DOM.originalInput).triggerHandler(u,[h]);else{try{var _=typeof h=="object"?h:{value:h};if((_=d.cloneData?ie({},_):_).tagify=this,h.event&&(_.event=this.cloneEvent(h.event)),xg(h,Object))for(var x in h)xg(h[x],HTMLElement)&&(_[x]=h[x]);b=new CustomEvent(u,{detail:_})}catch(S){Oi.warn(S)}s.dispatchEvent(b)}}}}(this)),this.isFirefox=/firefox|fxios/i.test(navigator.userAgent)&&!/seamonkey/i.test(navigator.userAgent),this.isIE=window.document.documentMode,t=t||{},this.getPersistedData=(i=t.id,function(r){var s;if(i){var a,l="/"+r;if(((s=localStorage)===null||s===void 0?void 0:s.getItem(eo+i+"/v"))===1)try{a=JSON.parse(localStorage[eo+i+l])}catch{}return a}}),this.setPersistedData=function(r){var s;return r?((s=localStorage)===null||s===void 0||s.setItem(eo+r+"/v",1),function(a,l){var u,h="/"+l,d=JSON.stringify(a);a&&l&&((u=localStorage)===null||u===void 0||u.setItem(eo+r+h,d),dispatchEvent(new Event("storage")))}):function(){}}(t.id),this.clearPersistedData=function(r){return function(s){var a=eo+"/"+r+"/";if(s)localStorage.removeItem(a+s);else for(var l in localStorage)l.includes(a)&&localStorage.removeItem(l)}}(t.id),this.applySettings(n,t),this.state={inputText:"",editing:!1,composing:!1,actions:{},mixMode:{},dropdown:{},flaggedTags:{}},this.value=[],this.listeners={},this.DOM={},this.build(n),lC.call(this),this.getCSSVars(),this.loadOriginalValues(),this.events.customBinding.call(this),this.events.binding.call(this),n.autofocus&&this.DOM.input.focus(),n.__tagify=this}Bc.prototype={_dropdown:uC,placeCaretAfterNode:_i,getSetTagData:Ft,helpers:{sameStr:lo,removeCollectionProp:gg,omit:Yh,isObject:gn,parseHTML:yh,escapeHTML:Qi,extend:ie,concatWithoutDups:vg,getUID:yg,isNodeTag:nr},customEventsList:["change","add","remove","invalid","input","paste","click","keydown","focus","blur","edit:input","edit:beforeUpdate","edit:updated","edit:start","edit:keydown","dropdown:show","dropdown:hide","dropdown:select","dropdown:updated","dropdown:noMatch","dropdown:scroll"],dataProps:["__isValid","__removed","__originalData","__originalHTML","__tagId"],trim:function(n){return this.settings.trim&&n&&typeof n=="string"?n.trim():n},parseHTML:yh,templates:fC,parseTemplate:function(n,t){return yh((n=this.settings.templates[n]||n).apply(this,t))},set whitelist(n){var t=n&&Array.isArray(n);this.settings.whitelist=t?n:[],this.setPersistedData(t?n:[],"whitelist")},get whitelist(){return this.settings.whitelist},set userInput(n){this.settings.userInput=!!n,this.setContentEditable(!!n)},get userInput(){return this.settings.userInput},generateClassSelectors:function(n){var t=function(i){var r=i;Object.defineProperty(n,r+"Selector",{get:function(){return"."+this[r].split(" ")[0]}})};for(var e in n)t(e)},applySettings:function(n,t){var e,i;_h.templates=this.templates;var r=ie({},_h,t.mode=="mix"?{dropdown:{position:"text"}}:{}),s=this.settings=ie({},r,t);if(s.disabled=n.hasAttribute("disabled"),s.readonly=s.readonly||n.hasAttribute("readonly"),s.placeholder=Qi(n.getAttribute("placeholder")||s.placeholder||""),s.required=n.hasAttribute("required"),this.generateClassSelectors(s.classNames),this.isIE&&(s.autoComplete=!1),["whitelist","blacklist"].forEach(function(l){var u=n.getAttribute("data-"+l);u&&Jn(u=u.split(s.delimiters),Array)&&(s[l]=u)}),"autoComplete"in t&&!gn(t.autoComplete)&&(s.autoComplete=_h.autoComplete,s.autoComplete.enabled=t.autoComplete),s.mode=="mix"&&(s.pattern=s.pattern||/@/,s.autoComplete.rightKey=!0,s.delimiters=t.delimiters||null,s.tagTextProp&&!s.dropdown.searchKeys.includes(s.tagTextProp)&&s.dropdown.searchKeys.push(s.tagTextProp)),n.pattern)try{s.pattern=new RegExp(n.pattern)}catch{}if(s.delimiters){s._delimiters=s.delimiters;try{s.delimiters=new RegExp(this.settings.delimiters,"g")}catch{}}(s.disabled||s.readonly)&&(s.userInput=!1),this.TEXTS=Tg({},hC,s.texts||{}),s.mode=="select"&&(s.dropdown.includeSelectedTags=!0),(s.mode!="select"||!((e=t.dropdown)===null||e===void 0)&&e.enabled)&&s.userInput||(s.dropdown.enabled=0),s.disabled&&(s.dropdown.enabled=!1),s.dropdown.appendTarget=((i=t.dropdown)===null||i===void 0?void 0:i.appendTarget)||document.body,s.dropdown.includeSelectedTags===void 0&&(s.dropdown.includeSelectedTags=s.duplicates);var a=this.getPersistedData("whitelist");Array.isArray(a)&&(this.whitelist=Array.isArray(s.whitelist)?vg(s.whitelist,a):a)},getAttributes:function(n){var t,e=this.getCustomAttributes(n),i="";for(t in e)i+=" "+t+(n[t]!==void 0?'="'.concat(e[t],'"'):"");return i},getCustomAttributes:function(n){if(!gn(n))return"";var t,e={};for(t in n)t.slice(0,2)!="__"&&t!="class"&&n.hasOwnProperty(t)&&n[t]!==void 0&&(e[t]=Qi(n[t]));return e},setStateSelection:function(){var n=window.getSelection(),t={anchorOffset:n.anchorOffset,anchorNode:n.anchorNode,range:n.getRangeAt&&n.rangeCount&&n.getRangeAt(0)};return this.state.selection=t,t},getCSSVars:function(){var n,t,e,i=getComputedStyle(this.DOM.scope,null);this.CSSVars={tagHideTransition:(n=function(r){if(!r)return{};var s=(r=r.trim().split(" ")[0]).split(/\d+/g).filter(function(a){return a}).pop().trim();return{value:+r.split(s).filter(function(a){return a})[0].trim(),unit:s}}((e="tag-hide-transition",i.getPropertyValue("--"+e))),t=n.value,n.unit=="s"?1e3*t:t)}},build:function(n){var t=this.DOM,e=n.closest("label");this.settings.mixMode.integrated?(t.originalInput=null,t.scope=n,t.input=n):(t.originalInput=n,t.originalInput_tabIndex=n.tabIndex,t.scope=this.parseTemplate("wrapper",[n,this.settings]),t.input=t.scope.querySelector(this.settings.classNames.inputSelector),n.parentNode.insertBefore(t.scope,n),n.tabIndex=-1),e&&e.setAttribute("for","")},destroy:function(){var n;this.events.unbindGlobal.call(this),(n=this.DOM.scope.parentNode)===null||n===void 0||n.removeChild(this.DOM.scope),this.DOM.originalInput.tabIndex=this.DOM.originalInput_tabIndex,delete this.DOM.originalInput.__tagify,this.dropdown.hide(!0),this.removeAllCustomListeners(),clearTimeout(this.dropdownHide__bindEventsTimeout),clearInterval(this.listeners.main.originalInputValueObserverInterval)},loadOriginalValues:function(n){var t,e=this.settings;if(this.state.blockChangeEvent=!0,n===void 0){var i=this.getPersistedData("value");n=i&&!this.DOM.originalInput.value?i:e.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value}if(this.removeAllTags(),n)if(e.mode=="mix")this.parseMixTags(n),(t=this.DOM.input.lastChild)&&t.tagName=="BR"||this.DOM.input.insertAdjacentHTML("beforeend","<br>");else{try{Jn(JSON.parse(n),Array)&&(n=JSON.parse(n))}catch{}this.addTags(n,!0).forEach(function(r){return r&&r.classList.add(e.classNames.tagNoAnimation)})}else this.postUpdate();this.state.lastOriginalValueReported=e.mixMode.integrated?"":this.DOM.originalInput.value},cloneEvent:function(n){var t={};for(var e in n)e!="path"&&(t[e]=n[e]);return t},loading:function(n){return this.state.isLoading=n,this.DOM.scope.classList[n?"add":"remove"](this.settings.classNames.scopeLoading),this},tagLoading:function(n,t){return n&&n.classList[t?"add":"remove"](this.settings.classNames.tagLoading),this},toggleClass:function(n,t){typeof n=="string"&&this.DOM.scope.classList.toggle(n,t)},toggleScopeValidation:function(n){var t=n===!0||n===void 0;!this.settings.required&&n&&n===this.TEXTS.empty&&(t=!0),this.toggleClass(this.settings.classNames.tagInvalid,!t),this.DOM.scope.title=t?"":n},toggleFocusClass:function(n){this.toggleClass(this.settings.classNames.focus,!!n)},setPlaceholder:function(n){var t=this;["data","aria"].forEach(function(e){return t.DOM.input.setAttribute("".concat(e,"-placeholder"),n)})},triggerChangeEvent:function(){if(!this.settings.mixMode.integrated){var n=this.DOM.originalInput,t=this.state.lastOriginalValueReported!==n.value,e=new CustomEvent("change",{bubbles:!0});t&&(this.state.lastOriginalValueReported=n.value,e.simulated=!0,n._valueTracker&&n._valueTracker.setValue(Math.random()),n.dispatchEvent(e),this.trigger("change",this.state.lastOriginalValueReported),n.value=this.state.lastOriginalValueReported)}},events:gC,fixFirefoxLastTagNoCaret:function(){},setRangeAtStartEnd:function(n,t){if(t){n=typeof n=="number"?n:!!n,t=t.lastChild||t;var e=document.getSelection();if(Jn(e.focusNode,Element)&&!this.DOM.input.contains(e.focusNode))return!0;try{e.rangeCount>=1&&["Start","End"].forEach(function(i){return e.getRangeAt(0)["set"+i](t,n||t.length)})}catch(i){console.warn(i)}}},insertAfterTag:function(n,t){if(t=t||this.settings.mixMode.insertAfterTag,n&&n.parentNode&&t)return t=typeof t=="string"?document.createTextNode(t):t,n.parentNode.insertBefore(t,n.nextSibling),t},editTagChangeDetected:function(n){var t=n.__originalData;for(var e in t)if(!this.dataProps.includes(e)&&n[e]!=t[e])return!0;return!1},getTagTextNode:function(n){return n.querySelector(this.settings.classNames.tagTextSelector)},setTagTextNode:function(n,t){this.getTagTextNode(n).innerHTML=Qi(t)},editTag:function(n,t){var e=this;n=n||this.getLastTag(),t=t||{};var i=this.settings,r=this.getTagTextNode(n),s=this.getNodeIndex(n),a=Ft(n),l=this.events.callbacks,u=!0,h=i.mode=="select";if(!h&&this.dropdown.hide(),r){if(!Jn(a,Object)||!("editable"in a)||a.editable)return a=Ft(n,{__originalData:ie({},a),__originalHTML:n.cloneNode(!0)}),Ft(a.__originalHTML,a.__originalData),r.setAttribute("contenteditable",!0),n.classList.add(i.classNames.tagEditing),this.events.callbacks.onEditTagFocus.call(this,n),r.addEventListener("click",l.onEditTagClick.bind(this,n)),r.addEventListener("blur",l.onEditTagBlur.bind(this,this.getTagTextNode(n))),r.addEventListener("input",l.onEditTagInput.bind(this,r)),r.addEventListener("paste",l.onEditTagPaste.bind(this,r)),r.addEventListener("keydown",function(d){return l.onEditTagkeydown.call(e,d,n)}),r.addEventListener("compositionstart",l.onCompositionStart.bind(this)),r.addEventListener("compositionend",l.onCompositionEnd.bind(this)),t.skipValidation||(u=this.editTagToggleValidity(n)),r.originalIsValid=u,this.trigger("edit:start",{tag:n,index:s,data:a,isValid:u}),r.focus(),!h&&this.setRangeAtStartEnd(!1,r),i.dropdown.enabled===0&&!h&&this.dropdown.show(),this.state.hasFocus=!0,this}else Oi.warn("Cannot find element in Tag template: .",i.classNames.tagTextSelector)},editTagToggleValidity:function(n,t){var e;if(t=t||Ft(n))return(e=!("__isValid"in t)||t.__isValid===!0)||this.removeTagsFromValue(n),this.update(),n.classList.toggle(this.settings.classNames.tagNotAllowed,!e),t.__isValid=e,t.__isValid;Oi.warn("tag has no data: ",n,t)},onEditTagDone:function(n,t){n=n||this.state.editing.scope,t=t||{};var e,i,r=this.settings,s={tag:n,index:this.getNodeIndex(n),previousData:Ft(n),data:t};this.trigger("edit:beforeUpdate",s,{cloneData:!1}),this.state.editing=!1,delete t.__originalData,delete t.__originalHTML,n&&n.parentNode&&(((i=t[r.tagTextProp])!==void 0?!((e=(i+="").trim)===null||e===void 0)&&e.call(i):!(r.tagTextProp in t)&&t.value)?(n=this.replaceTag(n,t),this.editTagToggleValidity(n,t),r.a11y.focusableTags?n.focus():r.mode!="select"&&_i(n)):this.removeTags(n)),this.trigger("edit:updated",s),r.dropdown.closeOnSelect&&this.dropdown.hide(),this.settings.keepInvalidTags&&this.reCheckInvalidTags()},replaceTag:function(n,t){t&&t.value!==""&&t.value!==void 0||(t=n.__tagifyTagData),t.__isValid&&t.__isValid!=1&&ie(t,this.getInvalidTagAttrs(t,t.__isValid));var e=this.createTagElem(t);return n.parentNode.replaceChild(e,n),this.updateValueByDOMTags(),e},updateValueByDOMTags:function(){var n=this;this.value.length=0;var t=this.settings.classNames,e=[t.tagNotAllowed.split(" ")[0],t.tagHide];[].forEach.call(this.getTagElms(),function(i){vc(i.classList).some(function(r){return e.includes(r)})||n.value.push(Ft(i))}),this.update(),this.dropdown.refilter()},injectAtCaret:function(n,t){var e;if(t=t||((e=this.state.selection)===null||e===void 0?void 0:e.range),typeof n=="string"&&(n=document.createTextNode(n)),!t&&n)return this.appendMixTags(n),this;var i=Bv(n,t);return this.setRangeAtStartEnd(!1,i),this.updateValueByDOMTags(),this.update(),this},input:{set:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],e=this.settings,i=e.dropdown.closeOnSelect;this.state.inputText=n,t&&(this.DOM.input.innerHTML=Qi(""+n),n&&this.toggleClass(e.classNames.empty,!this.DOM.input.innerHTML)),!n&&i&&this.dropdown.hide.bind(this),this.input.autocomplete.suggest.call(this),this.input.validate.call(this)},raw:function(){return this.DOM.input.textContent},validate:function(){var n=!this.state.inputText||this.validateTag({value:this.state.inputText})===!0;return this.DOM.input.classList.toggle(this.settings.classNames.inputInvalid,!n),n},normalize:function(n,t){var e=n||this.DOM.input,i=[];e.childNodes.forEach(function(r){return r.nodeType==3&&i.push(r.nodeValue)}),i=i.join(`
|
||
`);try{i=i.replace(/(?:\r\n|\r|\n)/g,this.settings.delimiters.source.charAt(0))}catch{}return i=i.replace(/\s/g," "),t!=null&&t.trim?this.trim(i):i},autocomplete:{suggest:function(n){if(this.settings.autoComplete.enabled){typeof(n=n||{value:""})!="object"&&(n={value:n});var t=this.dropdown.getMappedValue(n);if(typeof t!="number"){var e=this.state.inputText.toLowerCase(),i=t.substr(0,this.state.inputText.length).toLowerCase(),r=t.substring(this.state.inputText.length);t&&this.state.inputText&&i==e?(this.DOM.input.setAttribute("data-suggest",r),this.state.inputSuggestion=n):(this.DOM.input.removeAttribute("data-suggest"),delete this.state.inputSuggestion)}}},set:function(n){var t=this.DOM.input.getAttribute("data-suggest"),e=n||(t?this.state.inputText+t:null);return!!e&&(this.settings.mode=="mix"?this.replaceTextWithNode(document.createTextNode(this.state.tag.prefix+e)):(this.input.set.call(this,e),this.setRangeAtStartEnd(!1,this.DOM.input)),this.input.autocomplete.suggest.call(this),this.dropdown.hide(),!0)}}},getTagIdx:function(n){return this.value.findIndex(function(t){return t.__tagId==(n||{}).__tagId})},getNodeIndex:function(n){var t=0;if(n)for(;n=n.previousElementSibling;)t++;return t},getTagElms:function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];var i="."+vc(this.settings.classNames.tag.split(" ")).concat(vc(t)).join(".");return[].slice.call(this.DOM.scope.querySelectorAll(i))},getLastTag:function(){var n=this.settings.classNames,t=this.DOM.scope.querySelectorAll("".concat(n.tagSelector,":not(.").concat(n.tagHide,"):not([readonly])"));return t[t.length-1]},isTagDuplicate:function(n,t,e){var i=0,r=!0,s=!1,a=void 0;try{for(var l,u=this.value[Symbol.iterator]();!(r=(l=u.next()).done);r=!0){var h=l.value;lo(this.trim(""+n),h.value,t)&&e!=h.__tagId&&i++}}catch(d){s=!0,a=d}finally{try{r||u.return==null||u.return()}finally{if(s)throw a}}return i},getTagIndexByValue:function(n){var t=this,e=[],i=this.settings.dropdown.caseSensitive;return this.getTagElms().forEach(function(r,s){r.__tagifyTagData&&lo(t.trim(r.__tagifyTagData.value),n,i)&&e.push(s)}),e},getTagElmByValue:function(n){var t=this.getTagIndexByValue(n)[0];return this.getTagElms()[t]},flashTag:function(n){var t=this;n&&(n.classList.add(this.settings.classNames.tagFlash),setTimeout(function(){n.classList.remove(t.settings.classNames.tagFlash)},100))},isTagBlacklisted:function(n){return n=this.trim(n.toLowerCase()),this.settings.blacklist.filter(function(t){return(""+t).toLowerCase()==n}).length},isTagWhitelisted:function(n){return!!this.getWhitelistItem(n)},getWhitelistItem:function(n,t,e){t=t||"value";var i,r=this.settings;return(e=e||r.whitelist).some(function(s){var a=typeof s=="object"?s[t]||s.value:s;if(lo(a,n,r.dropdown.caseSensitive,r.trim))return i=typeof s=="object"?s:{value:s},!0}),i||t!="value"||r.tagTextProp=="value"||(i=this.getWhitelistItem(n,r.tagTextProp,e)),i},validateTag:function(n){var t=this.settings,e="value"in n?"value":t.tagTextProp,i=this.trim(n[e]+"");return(n[e]+"").trim()?t.mode!="mix"&&t.pattern&&Jn(t.pattern,RegExp)&&!t.pattern.test(i)?this.TEXTS.pattern:!t.duplicates&&this.isTagDuplicate(i,t.dropdown.caseSensitive,n.__tagId)?this.TEXTS.duplicate:this.isTagBlacklisted(i)||t.enforceWhitelist&&!this.isTagWhitelisted(i)?this.TEXTS.notAllowed:!t.validate||t.validate(n):this.TEXTS.empty},getInvalidTagAttrs:function(n,t){return{"aria-invalid":!0,class:"".concat(n.class||""," ").concat(this.settings.classNames.tagNotAllowed).trim(),title:t}},hasMaxTags:function(){return this.value.length>=this.settings.maxTags&&this.TEXTS.exceed},setReadonly:function(n,t){var e=this.settings;this.DOM.scope.contains(document.activeElement)&&document.activeElement.blur(),e[t||"readonly"]=n,this.DOM.scope[(n?"set":"remove")+"Attribute"](t||"readonly",!0),this.settings.userInput=!0,this.setContentEditable(!n)},setContentEditable:function(n){this.DOM.scope.querySelectorAll("[data-can-editable]").forEach(function(t){t.contentEditable=n,t.tabIndex=n?0:-1})},setDisabled:function(n){this.setReadonly(n,"disabled")},normalizeTags:function(n){var t=this,e=this.settings,i=e.whitelist,r=e.delimiters,s=e.mode,a=e.tagTextProp,l=[],u=!!i&&Jn(i[0],Object),h=Array.isArray(n),d=h&&n[0].value,b=function(_){return(_+"").split(r).reduce(function(x,S){var C,T=t.trim(S);return T&&x.push((Kh(C={},a,T),Kh(C,"value",T),C)),x},[])};if(typeof n=="number"&&(n=n.toString()),typeof n=="string"){if(!n.trim())return[];n=b(n)}else h&&(n=n.reduce(function(_,x){if(gn(x)){var S=ie({},x);a in S||(a="value"),S[a]=t.trim(S[a]),(S[a]||S[a]===0)&&_.push(S)}else if(x!=null&&x!==""&&x!==void 0){var C;(C=_).push.apply(C,vc(b(x)))}return _},[]));return u&&!d&&(n.forEach(function(_){var x=l.map(function(T){return T.value}),S=t.dropdown.filterListItems.call(t,_[a],{exact:!0});t.settings.duplicates||(S=S.filter(function(T){return!x.includes(T.value)}));var C=S.length>1?t.getWhitelistItem(_[a],a,S):S[0];C&&Jn(C,Object)?l.push(C):s!="mix"&&(_.value==null&&(_.value=_[a]),l.push(_))}),l.length&&(n=l)),n},parseMixTags:function(n){var t=this,e=this.settings,i=e.mixTagsInterpolator,r=e.duplicates,s=e.transformTag,a=e.enforceWhitelist,l=e.maxTags,u=e.tagTextProp,h=[];n=n.split(i[0]).map(function(b,_){var x,S,C,T=b.split(i[1]),P=T[0],R=h.length==l;try{if(P==+P)throw Error;S=JSON.parse(P)}catch{S=t.normalizeTags(P)[0]||{value:P}}if(s.call(t,S),R||!(T.length>1)||a&&!t.isTagWhitelisted(S.value)||!r&&t.isTagDuplicate(S.value)){if(b)return _?i[0]+b:b}else S[x=S[u]?u:"value"]=t.trim(S[x]),C=t.createTagElem(S),h.push(S),C.classList.add(t.settings.classNames.tagNoAnimation),T[0]=C.outerHTML,t.value.push(S);return T.join("")}).join(""),this.DOM.input.innerHTML=n,this.DOM.input.appendChild(document.createTextNode("")),this.DOM.input.normalize();var d=this.getTagElms();return d.forEach(function(b,_){return Ft(b,h[_])}),this.update({withoutChangeEvent:!0}),Hv(d,this.state.hasFocus),n},replaceTextWithNode:function(n,t){if(this.state.tag||t){t=t||this.state.tag.prefix+this.state.tag.value;var e,i,r=this.state.selection||window.getSelection(),s=r.anchorNode,a=this.state.tag.delimiters?this.state.tag.delimiters.length:0;return s.splitText(r.anchorOffset-a),(e=s.nodeValue.lastIndexOf(t))==-1||(i=s.splitText(e),n&&s.parentNode.replaceChild(n,i)),!0}},prepareNewTagNode:function(n,t){t=t||{};var e=this.settings,i=[],r={},s=Object.assign({},n,{value:n.value+""});if(n=Object.assign({},s),e.transformTag.call(this,n),n.__isValid=this.hasMaxTags()||this.validateTag(n),n.__isValid!==!0){if(t.skipInvalid)return;if(ie(r,this.getInvalidTagAttrs(n,n.__isValid),{__preInvalidData:s}),n.__isValid==this.TEXTS.duplicate&&this.flashTag(this.getTagElmByValue(n.value)),!e.createInvalidTags)return void i.push(n.value)}return"readonly"in n&&(n.readonly?r["aria-readonly"]=!0:delete n.readonly),{tagElm:this.createTagElem(n,r),tagData:n,aggregatedInvalidInput:i}},postProcessNewTagNode:function(n,t){var e=this,i=this.settings,r=t.__isValid;r&&r===!0?this.value.push(t):(this.trigger("invalid",{data:t,index:this.value.length,tag:n,message:r}),i.keepInvalidTags||setTimeout(function(){return e.removeTags(n,!0)},1e3)),this.dropdown.position()},selectTag:function(n,t){var e=this;if(!this.settings.enforceWhitelist||this.isTagWhitelisted(t.value)){this.state.actions.selectOption&&setTimeout(function(){return e.setRangeAtStartEnd(!1,e.DOM.input)});var i=this.getLastTag();return i?this.replaceTag(i,t):this.appendTag(n),this.value[0]=t,this.update(),this.trigger("add",{tag:n,data:t}),[n]}},addEmptyTag:function(n){var t=ie({value:""},n||{}),e=this.createTagElem(t);Ft(e,t),this.appendTag(e),this.editTag(e,{skipValidation:!0}),this.toggleFocusClass(!0)},addTags:function(n,t,e){var i=this,r=[],s=this.settings,a=[],l=document.createDocumentFragment(),u=[];if(!n||n.length==0)return r;switch(n=this.normalizeTags(n),s.mode){case"mix":return this.addMixTags(n);case"select":t=!1,this.removeAllTags()}return this.DOM.input.removeAttribute("style"),n.forEach(function(h){var d=i.prepareNewTagNode(h,{skipInvalid:e||s.skipInvalid});if(d){var b=d.tagElm;if(h=d.tagData,a=d.aggregatedInvalidInput,r.push(b),s.mode=="select")return i.selectTag(b,h);l.appendChild(b),i.postProcessNewTagNode(b,h),u.push({tagElm:b,tagData:h})}}),this.appendTag(l),u.forEach(function(h){var d=h.tagElm,b=h.tagData;return i.trigger("add",{tag:d,index:i.getTagIdx(b),data:b})}),this.update(),n.length&&t&&(this.input.set.call(this,s.createInvalidTags?"":a.join(s._delimiters)),this.setRangeAtStartEnd(!1,this.DOM.input)),this.dropdown.refilter(),r},addMixTags:function(n){var t=this;if((n=this.normalizeTags(n))[0].prefix||this.state.tag)return this.prefixedTextToTag(n[0]);var e=document.createDocumentFragment();return n.forEach(function(i){var r=t.prepareNewTagNode(i);e.appendChild(r.tagElm),t.insertAfterTag(r.tagElm),t.postProcessNewTagNode(r.tagElm,r.tagData)}),this.appendMixTags(e),e.children},appendMixTags:function(n){var t=!!this.state.selection;t?this.injectAtCaret(n):(this.DOM.input.focus(),(t=this.setStateSelection()).range.setStart(this.DOM.input,t.range.endOffset),t.range.setEnd(this.DOM.input,t.range.endOffset),this.DOM.input.appendChild(n),this.updateValueByDOMTags(),this.update())},prefixedTextToTag:function(n){var t,e,i,r=this,s=this.settings,a=(t=this.state.tag)===null||t===void 0?void 0:t.delimiters;if(n.prefix=n.prefix||this.state.tag?this.state.tag.prefix:(s.pattern.source||s.pattern)[0],i=this.prepareNewTagNode(n),e=i.tagElm,this.replaceTextWithNode(e)||this.DOM.input.appendChild(e),setTimeout(function(){return e.classList.add(r.settings.classNames.tagNoAnimation)},300),this.update(),!a){var l=this.insertAfterTag(e)||e;setTimeout(_i,0,l)}return this.state.tag=null,this.postProcessNewTagNode(e,i.tagData),e},appendTag:function(n){var t=this.DOM,e=t.input;t.scope.insertBefore(n,e)},createTagElem:function(n,t){n.__tagId=yg();var e,i=ie({},n,Tg({value:Qi(n.value+"")},t));return function(r){for(var s,a=document.createNodeIterator(r,NodeFilter.SHOW_TEXT,null,!1);s=a.nextNode();)s.textContent.trim()||s.parentNode.removeChild(s)}(e=this.parseTemplate("tag",[i,this])),Ft(e,n),e},reCheckInvalidTags:function(){var n=this,t=this.settings;this.getTagElms(t.classNames.tagNotAllowed).forEach(function(e,i){var r=Ft(e),s=n.hasMaxTags(),a=n.validateTag(r),l=a===!0&&!s;if(t.mode=="select"&&n.toggleScopeValidation(a),l)return r=r.__preInvalidData?r.__preInvalidData:{value:r.value},n.replaceTag(e,r);e.title=s||a})},removeTags:function(n,t,e){var i,r=this,s=this.settings;if(n=n&&Jn(n,HTMLElement)?[n]:Jn(n,Array)?n:n?[n]:[this.getLastTag()].filter(function(a){return a}),i=n.reduce(function(a,l){l&&typeof l=="string"&&(l=r.getTagElmByValue(l));var u=Ft(l);return l&&u&&!u.readonly&&a.push({node:l,idx:r.getTagIdx(u),data:Ft(l,{__removed:!0})}),a},[]),e=typeof e=="number"?e:this.CSSVars.tagHideTransition,s.mode=="select"&&(e=0,this.input.set.call(this)),i.length==1&&s.mode!="select"&&i[0].node.classList.contains(s.classNames.tagNotAllowed)&&(t=!0),i.length)return s.hooks.beforeRemoveTag(i,{tagify:this}).then(function(){var a=function(l){l.node.parentNode&&(l.node.parentNode.removeChild(l.node),t?s.keepInvalidTags&&this.trigger("remove",{tag:l.node,index:l.idx}):(this.trigger("remove",{tag:l.node,index:l.idx,data:l.data}),this.dropdown.refilter(),this.dropdown.position(),this.DOM.input.normalize(),s.keepInvalidTags&&this.reCheckInvalidTags()))};e&&e>10&&i.length==1?(function(l){l.node.style.width=parseFloat(window.getComputedStyle(l.node).width)+"px",document.body.clientTop,l.node.classList.add(s.classNames.tagHide),setTimeout(a.bind(this),e,l)}).call(r,i[0]):i.forEach(a.bind(r)),t||(r.removeTagsFromValue(i.map(function(l){return l.node})),r.update(),s.mode=="select"&&s.userInput&&r.setContentEditable(!0))}).catch(function(a){})},removeTagsFromDOM:function(){this.getTagElms().forEach(function(n){return n.remove()})},removeTagsFromValue:function(n){var t=this;(n=Array.isArray(n)?n:[n]).forEach(function(e){var i=Ft(e),r=t.getTagIdx(i);r>-1&&t.value.splice(r,1)})},removeAllTags:function(n){var t=this;n=n||{},this.value=[],this.settings.mode=="mix"?this.DOM.input.innerHTML="":this.removeTagsFromDOM(),this.dropdown.refilter(),this.dropdown.position(),this.state.dropdown.visible&&setTimeout(function(){t.DOM.input.focus()}),this.settings.mode=="select"&&(this.input.set.call(this),this.settings.userInput&&this.setContentEditable(!0)),this.update(n)},postUpdate:function(){this.state.blockChangeEvent=!1;var n,t,e=this.settings,i=e.classNames,r=e.mode=="mix"?e.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value.trim():this.value.length+this.input.raw.call(this).length;this.toggleClass(i.hasMaxTags,this.value.length>=e.maxTags),this.toggleClass(i.hasNoTags,!this.value.length),this.toggleClass(i.empty,!r),e.mode=="select"&&this.toggleScopeValidation((t=this.value)===null||t===void 0||(n=t[0])===null||n===void 0?void 0:n.__isValid)},setOriginalInputValue:function(n){var t=this.DOM.originalInput;this.settings.mixMode.integrated||(t.value=n,t.tagifyValue=t.value,this.setPersistedData(n,"value"))},update:function(n){clearTimeout(this.debouncedUpdateTimeout),this.debouncedUpdateTimeout=setTimeout((function(){var t=this.getInputValue();this.setOriginalInputValue(t),this.settings.onChangeAfterBlur&&(n||{}).withoutChangeEvent||this.state.blockChangeEvent||this.triggerChangeEvent(),this.postUpdate()}).bind(this),100),this.events.bindOriginaInputListener.call(this,100)},getInputValue:function(){var n=this.getCleanValue();return this.settings.mode=="mix"?this.getMixedTagsAsString(n):n.length?this.settings.originalInputValueFormat?this.settings.originalInputValueFormat(n):JSON.stringify(n):""},getCleanValue:function(n){return gg(n||this.value,this.dataProps)},getMixedTagsAsString:function(){var n="",t=this,e=this.settings,i=e.originalInputValueFormat||JSON.stringify,r=e.mixTagsInterpolator;return function s(a){a.childNodes.forEach(function(l){if(l.nodeType==1){var u=Ft(l);if(l.tagName=="BR"&&(n+=`\r
|
||
`),u&&nr.call(t,l)){if(u.__removed)return;n+=r[0]+i(Yh(u,t.dataProps))+r[1]}else l.getAttribute("style")||["B","I","U"].includes(l.tagName)?n+=l.textContent:l.tagName!="DIV"&&l.tagName!="P"||(n+=`\r
|
||
`,s(l))}else n+=l.textContent})}(this.DOM.input),n}},Bc.prototype.removeTag=Bc.prototype.removeTags;function yo(n){"@babel/helpers - typeof";return yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yo(n)}function ce(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function mC(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function le(n,t,e){return t&&mC(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Ao(){return Ao=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Ao.apply(this,arguments)}function We(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&Gh(n,t)}function Zc(n){return Zc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Zc(n)}function Gh(n,t){return Gh=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},Gh(n,t)}function vC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function bC(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function yC(n,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bC(n)}function je(n){var t=vC();return function(){var i=Zc(n),r;if(t){var s=Zc(this).constructor;r=Reflect.construct(i,arguments,s)}else r=i.apply(this,arguments);return yC(this,r)}}var Cf=function(){function n(){ce(this,n)}return le(n,[{key:"listenForWhisper",value:function(e,i){return this.listen(".client-"+e,i)}},{key:"notification",value:function(e){return this.listen(".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated",e)}},{key:"stopListeningForWhisper",value:function(e,i){return this.stopListening(".client-"+e,i)}}]),n}(),zv=function(){function n(t){ce(this,n),this.namespace=t}return le(n,[{key:"format",value:function(e){return[".","\\"].includes(e.charAt(0))?e.substring(1):(this.namespace&&(e=this.namespace+"."+e),e.replace(/\./g,"\\"))}},{key:"setNamespace",value:function(e){this.namespace=e}}]),n}();function _C(n){try{new n}catch(t){if(t.message.includes("is not a constructor"))return!1}return!0}var Af=function(n){We(e,n);var t=je(e);function e(i,r,s){var a;return ce(this,e),a=t.call(this),a.name=r,a.pusher=i,a.options=s,a.eventFormatter=new zv(a.options.namespace),a.subscribe(),a}return le(e,[{key:"subscribe",value:function(){this.subscription=this.pusher.subscribe(this.name)}},{key:"unsubscribe",value:function(){this.pusher.unsubscribe(this.name)}},{key:"listen",value:function(r,s){return this.on(this.eventFormatter.format(r),s),this}},{key:"listenToAll",value:function(r){var s=this;return this.subscription.bind_global(function(a,l){if(!a.startsWith("pusher:")){var u=s.options.namespace.replace(/\./g,"\\"),h=a.startsWith(u)?a.substring(u.length+1):"."+a;r(h,l)}}),this}},{key:"stopListening",value:function(r,s){return s?this.subscription.unbind(this.eventFormatter.format(r),s):this.subscription.unbind(this.eventFormatter.format(r)),this}},{key:"stopListeningToAll",value:function(r){return r?this.subscription.unbind_global(r):this.subscription.unbind_global(),this}},{key:"subscribed",value:function(r){return this.on("pusher:subscription_succeeded",function(){r()}),this}},{key:"error",value:function(r){return this.on("pusher:subscription_error",function(s){r(s)}),this}},{key:"on",value:function(r,s){return this.subscription.bind(r,s),this}}]),e}(Cf),Wv=function(n){We(e,n);var t=je(e);function e(){return ce(this,e),t.apply(this,arguments)}return le(e,[{key:"whisper",value:function(r,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(r),s),this}}]),e}(Af),wC=function(n){We(e,n);var t=je(e);function e(){return ce(this,e),t.apply(this,arguments)}return le(e,[{key:"whisper",value:function(r,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(r),s),this}}]),e}(Af),xC=function(n){We(e,n);var t=je(e);function e(){return ce(this,e),t.apply(this,arguments)}return le(e,[{key:"here",value:function(r){return this.on("pusher:subscription_succeeded",function(s){r(Object.keys(s.members).map(function(a){return s.members[a]}))}),this}},{key:"joining",value:function(r){return this.on("pusher:member_added",function(s){r(s.info)}),this}},{key:"whisper",value:function(r,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(r),s),this}},{key:"leaving",value:function(r){return this.on("pusher:member_removed",function(s){r(s.info)}),this}}]),e}(Wv),jv=function(n){We(e,n);var t=je(e);function e(i,r,s){var a;return ce(this,e),a=t.call(this),a.events={},a.listeners={},a.name=r,a.socket=i,a.options=s,a.eventFormatter=new zv(a.options.namespace),a.subscribe(),a}return le(e,[{key:"subscribe",value:function(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"unsubscribe",value:function(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"listen",value:function(r,s){return this.on(this.eventFormatter.format(r),s),this}},{key:"stopListening",value:function(r,s){return this.unbindEvent(this.eventFormatter.format(r),s),this}},{key:"subscribed",value:function(r){return this.on("connect",function(s){r(s)}),this}},{key:"error",value:function(r){return this}},{key:"on",value:function(r,s){var a=this;return this.listeners[r]=this.listeners[r]||[],this.events[r]||(this.events[r]=function(l,u){a.name===l&&a.listeners[r]&&a.listeners[r].forEach(function(h){return h(u)})},this.socket.on(r,this.events[r])),this.listeners[r].push(s),this}},{key:"unbind",value:function(){var r=this;Object.keys(this.events).forEach(function(s){r.unbindEvent(s)})}},{key:"unbindEvent",value:function(r,s){this.listeners[r]=this.listeners[r]||[],s&&(this.listeners[r]=this.listeners[r].filter(function(a){return a!==s})),(!s||this.listeners[r].length===0)&&(this.events[r]&&(this.socket.removeListener(r,this.events[r]),delete this.events[r]),delete this.listeners[r])}}]),e}(Cf),Uv=function(n){We(e,n);var t=je(e);function e(){return ce(this,e),t.apply(this,arguments)}return le(e,[{key:"whisper",value:function(r,s){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(r),data:s}),this}}]),e}(jv),SC=function(n){We(e,n);var t=je(e);function e(){return ce(this,e),t.apply(this,arguments)}return le(e,[{key:"here",value:function(r){return this.on("presence:subscribed",function(s){r(s.map(function(a){return a.user_info}))}),this}},{key:"joining",value:function(r){return this.on("presence:joining",function(s){return r(s.user_info)}),this}},{key:"whisper",value:function(r,s){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(r),data:s}),this}},{key:"leaving",value:function(r){return this.on("presence:leaving",function(s){return r(s.user_info)}),this}}]),e}(Uv),Qc=function(n){We(e,n);var t=je(e);function e(){return ce(this,e),t.apply(this,arguments)}return le(e,[{key:"subscribe",value:function(){}},{key:"unsubscribe",value:function(){}},{key:"listen",value:function(r,s){return this}},{key:"listenToAll",value:function(r){return this}},{key:"stopListening",value:function(r,s){return this}},{key:"subscribed",value:function(r){return this}},{key:"error",value:function(r){return this}},{key:"on",value:function(r,s){return this}}]),e}(Cf),Vv=function(n){We(e,n);var t=je(e);function e(){return ce(this,e),t.apply(this,arguments)}return le(e,[{key:"whisper",value:function(r,s){return this}}]),e}(Qc),TC=function(n){We(e,n);var t=je(e);function e(){return ce(this,e),t.apply(this,arguments)}return le(e,[{key:"whisper",value:function(r,s){return this}}]),e}(Qc),OC=function(n){We(e,n);var t=je(e);function e(){return ce(this,e),t.apply(this,arguments)}return le(e,[{key:"here",value:function(r){return this}},{key:"joining",value:function(r){return this}},{key:"whisper",value:function(r,s){return this}},{key:"leaving",value:function(r){return this}}]),e}(Vv),kf=function(){function n(t){ce(this,n),this._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},broadcaster:"pusher",csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"},this.setOptions(t),this.connect()}return le(n,[{key:"setOptions",value:function(e){this.options=Ao(this._defaultOptions,e);var i=this.csrfToken();return i&&(this.options.auth.headers["X-CSRF-TOKEN"]=i,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=i),i=this.options.bearerToken,i&&(this.options.auth.headers.Authorization="Bearer "+i,this.options.userAuthentication.headers.Authorization="Bearer "+i),e}},{key:"csrfToken",value:function(){var e;return typeof window<"u"&&window.Laravel&&window.Laravel.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"&&(e=document.querySelector('meta[name="csrf-token"]'))?e.getAttribute("content"):null}}]),n}(),Og=function(n){We(e,n);var t=je(e);function e(){var i;return ce(this,e),i=t.apply(this,arguments),i.channels={},i}return le(e,[{key:"connect",value:function(){typeof this.options.client<"u"?this.pusher=this.options.client:this.options.Pusher?this.pusher=new this.options.Pusher(this.options.key,this.options):this.pusher=new Pusher(this.options.key,this.options)}},{key:"signin",value:function(){this.pusher.signin()}},{key:"listen",value:function(r,s,a){return this.channel(r).listen(s,a)}},{key:"channel",value:function(r){return this.channels[r]||(this.channels[r]=new Af(this.pusher,r,this.options)),this.channels[r]}},{key:"privateChannel",value:function(r){return this.channels["private-"+r]||(this.channels["private-"+r]=new Wv(this.pusher,"private-"+r,this.options)),this.channels["private-"+r]}},{key:"encryptedPrivateChannel",value:function(r){return this.channels["private-encrypted-"+r]||(this.channels["private-encrypted-"+r]=new wC(this.pusher,"private-encrypted-"+r,this.options)),this.channels["private-encrypted-"+r]}},{key:"presenceChannel",value:function(r){return this.channels["presence-"+r]||(this.channels["presence-"+r]=new xC(this.pusher,"presence-"+r,this.options)),this.channels["presence-"+r]}},{key:"leave",value:function(r){var s=this,a=[r,"private-"+r,"private-encrypted-"+r,"presence-"+r];a.forEach(function(l,u){s.leaveChannel(l)})}},{key:"leaveChannel",value:function(r){this.channels[r]&&(this.channels[r].unsubscribe(),delete this.channels[r])}},{key:"socketId",value:function(){return this.pusher.connection.socket_id}},{key:"disconnect",value:function(){this.pusher.disconnect()}}]),e}(kf),Cg=function(n){We(e,n);var t=je(e);function e(){var i;return ce(this,e),i=t.apply(this,arguments),i.channels={},i}return le(e,[{key:"connect",value:function(){var r=this,s=this.getSocketIO();return this.socket=s(this.options.host,this.options),this.socket.on("reconnect",function(){Object.values(r.channels).forEach(function(a){a.subscribe()})}),this.socket}},{key:"getSocketIO",value:function(){if(typeof this.options.client<"u")return this.options.client;if(typeof io<"u")return io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}},{key:"listen",value:function(r,s,a){return this.channel(r).listen(s,a)}},{key:"channel",value:function(r){return this.channels[r]||(this.channels[r]=new jv(this.socket,r,this.options)),this.channels[r]}},{key:"privateChannel",value:function(r){return this.channels["private-"+r]||(this.channels["private-"+r]=new Uv(this.socket,"private-"+r,this.options)),this.channels["private-"+r]}},{key:"presenceChannel",value:function(r){return this.channels["presence-"+r]||(this.channels["presence-"+r]=new SC(this.socket,"presence-"+r,this.options)),this.channels["presence-"+r]}},{key:"leave",value:function(r){var s=this,a=[r,"private-"+r,"presence-"+r];a.forEach(function(l){s.leaveChannel(l)})}},{key:"leaveChannel",value:function(r){this.channels[r]&&(this.channels[r].unsubscribe(),delete this.channels[r])}},{key:"socketId",value:function(){return this.socket.id}},{key:"disconnect",value:function(){this.socket.disconnect()}}]),e}(kf),CC=function(n){We(e,n);var t=je(e);function e(){var i;return ce(this,e),i=t.apply(this,arguments),i.channels={},i}return le(e,[{key:"connect",value:function(){}},{key:"listen",value:function(r,s,a){return new Qc}},{key:"channel",value:function(r){return new Qc}},{key:"privateChannel",value:function(r){return new Vv}},{key:"encryptedPrivateChannel",value:function(r){return new TC}},{key:"presenceChannel",value:function(r){return new OC}},{key:"leave",value:function(r){}},{key:"leaveChannel",value:function(r){}},{key:"socketId",value:function(){return"fake-socket-id"}},{key:"disconnect",value:function(){}}]),e}(kf),AC=function(){function n(t){ce(this,n),this.options=t,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}return le(n,[{key:"channel",value:function(e){return this.connector.channel(e)}},{key:"connect",value:function(){if(this.options.broadcaster=="reverb")this.connector=new Og(Ao(Ao({},this.options),{cluster:""}));else if(this.options.broadcaster=="pusher")this.connector=new Og(this.options);else if(this.options.broadcaster=="socket.io")this.connector=new Cg(this.options);else if(this.options.broadcaster=="null")this.connector=new CC(this.options);else if(typeof this.options.broadcaster=="function"&&_C(this.options.broadcaster))this.connector=new this.options.broadcaster(this.options);else throw new Error("Broadcaster ".concat(yo(this.options.broadcaster)," ").concat(this.options.broadcaster," is not supported."))}},{key:"disconnect",value:function(){this.connector.disconnect()}},{key:"join",value:function(e){return this.connector.presenceChannel(e)}},{key:"leave",value:function(e){this.connector.leave(e)}},{key:"leaveChannel",value:function(e){this.connector.leaveChannel(e)}},{key:"leaveAllChannels",value:function(){for(var e in this.connector.channels)this.leaveChannel(e)}},{key:"listen",value:function(e,i,r){return this.connector.listen(e,i,r)}},{key:"private",value:function(e){return this.connector.privateChannel(e)}},{key:"encryptedPrivate",value:function(e){if(this.connector instanceof Cg)throw new Error("Broadcaster ".concat(yo(this.options.broadcaster)," ").concat(this.options.broadcaster," does not support encrypted private channels."));return this.connector.encryptedPrivateChannel(e)}},{key:"socketId",value:function(){return this.connector.socketId()}},{key:"registerInterceptors",value:function(){typeof Vue=="function"&&Vue.http&&this.registerVueRequestInterceptor(),typeof axios=="function"&&this.registerAxiosRequestInterceptor(),typeof jQuery=="function"&&this.registerjQueryAjaxSetup(),(typeof Turbo>"u"?"undefined":yo(Turbo))==="object"&&this.registerTurboRequestInterceptor()}},{key:"registerVueRequestInterceptor",value:function(){var e=this;Vue.http.interceptors.push(function(i,r){e.socketId()&&i.headers.set("X-Socket-ID",e.socketId()),r()})}},{key:"registerAxiosRequestInterceptor",value:function(){var e=this;axios.interceptors.request.use(function(i){return e.socketId()&&(i.headers["X-Socket-Id"]=e.socketId()),i})}},{key:"registerjQueryAjaxSetup",value:function(){var e=this;typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter(function(i,r,s){e.socketId()&&s.setRequestHeader("X-Socket-Id",e.socketId())})}},{key:"registerTurboRequestInterceptor",value:function(){var e=this;document.addEventListener("turbo:before-fetch-request",function(i){i.detail.fetchOptions.headers["X-Socket-Id"]=e.socketId()})}}]),n}(),Oh={exports:{}};/*!
|
||
* Pusher JavaScript Library v7.6.0
|
||
* https://pusher.com/
|
||
*
|
||
* Copyright 2020, Pusher
|
||
* Released under the MIT licence.
|
||
*/var Ag;function kC(){return Ag||(Ag=1,function(n,t){(function(i,r){n.exports=r()})(window,function(){return function(e){var i={};function r(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return e[s].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=i,r.d=function(s,a,l){r.o(s,a)||Object.defineProperty(s,a,{enumerable:!0,get:l})},r.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},r.t=function(s,a){if(a&1&&(s=r(s)),a&8||a&4&&typeof s=="object"&&s&&s.__esModule)return s;var l=Object.create(null);if(r.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:s}),a&2&&typeof s!="string")for(var u in s)r.d(l,u,(function(h){return s[h]}).bind(null,u));return l},r.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return r.d(a,"a",a),a},r.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},r.p="",r(r.s=2)}([function(e,i,r){var s=this&&this.__extends||function(){var C=function(T,P){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,B){R.__proto__=B}||function(R,B){for(var H in B)B.hasOwnProperty(H)&&(R[H]=B[H])},C(T,P)};return function(T,P){C(T,P);function R(){this.constructor=T}T.prototype=P===null?Object.create(P):(R.prototype=P.prototype,new R)}}();Object.defineProperty(i,"__esModule",{value:!0});var a=256,l=function(){function C(T){T===void 0&&(T="="),this._paddingCharacter=T}return C.prototype.encodedLength=function(T){return this._paddingCharacter?(T+2)/3*4|0:(T*8+5)/6|0},C.prototype.encode=function(T){for(var P="",R=0;R<T.length-2;R+=3){var B=T[R]<<16|T[R+1]<<8|T[R+2];P+=this._encodeByte(B>>>3*6&63),P+=this._encodeByte(B>>>2*6&63),P+=this._encodeByte(B>>>1*6&63),P+=this._encodeByte(B>>>0*6&63)}var H=T.length-R;if(H>0){var B=T[R]<<16|(H===2?T[R+1]<<8:0);P+=this._encodeByte(B>>>3*6&63),P+=this._encodeByte(B>>>2*6&63),H===2?P+=this._encodeByte(B>>>1*6&63):P+=this._paddingCharacter||"",P+=this._paddingCharacter||""}return P},C.prototype.maxDecodedLength=function(T){return this._paddingCharacter?T/4*3|0:(T*6+7)/8|0},C.prototype.decodedLength=function(T){return this.maxDecodedLength(T.length-this._getPaddingLength(T))},C.prototype.decode=function(T){if(T.length===0)return new Uint8Array(0);for(var P=this._getPaddingLength(T),R=T.length-P,B=new Uint8Array(this.maxDecodedLength(R)),H=0,D=0,L=0,N=0,W=0,V=0,X=0;D<R-4;D+=4)N=this._decodeChar(T.charCodeAt(D+0)),W=this._decodeChar(T.charCodeAt(D+1)),V=this._decodeChar(T.charCodeAt(D+2)),X=this._decodeChar(T.charCodeAt(D+3)),B[H++]=N<<2|W>>>4,B[H++]=W<<4|V>>>2,B[H++]=V<<6|X,L|=N&a,L|=W&a,L|=V&a,L|=X&a;if(D<R-1&&(N=this._decodeChar(T.charCodeAt(D)),W=this._decodeChar(T.charCodeAt(D+1)),B[H++]=N<<2|W>>>4,L|=N&a,L|=W&a),D<R-2&&(V=this._decodeChar(T.charCodeAt(D+2)),B[H++]=W<<4|V>>>2,L|=V&a),D<R-3&&(X=this._decodeChar(T.charCodeAt(D+3)),B[H++]=V<<6|X,L|=X&a),L!==0)throw new Error("Base64Coder: incorrect characters for decoding");return B},C.prototype._encodeByte=function(T){var P=T;return P+=65,P+=25-T>>>8&6,P+=51-T>>>8&-75,P+=61-T>>>8&-15,P+=62-T>>>8&3,String.fromCharCode(P)},C.prototype._decodeChar=function(T){var P=a;return P+=(42-T&T-44)>>>8&-a+T-43+62,P+=(46-T&T-48)>>>8&-a+T-47+63,P+=(47-T&T-58)>>>8&-a+T-48+52,P+=(64-T&T-91)>>>8&-a+T-65+0,P+=(96-T&T-123)>>>8&-a+T-97+26,P},C.prototype._getPaddingLength=function(T){var P=0;if(this._paddingCharacter){for(var R=T.length-1;R>=0&&T[R]===this._paddingCharacter;R--)P++;if(T.length<4||P>2)throw new Error("Base64Coder: incorrect padding")}return P},C}();i.Coder=l;var u=new l;function h(C){return u.encode(C)}i.encode=h;function d(C){return u.decode(C)}i.decode=d;var b=function(C){s(T,C);function T(){return C!==null&&C.apply(this,arguments)||this}return T.prototype._encodeByte=function(P){var R=P;return R+=65,R+=25-P>>>8&6,R+=51-P>>>8&-75,R+=61-P>>>8&-13,R+=62-P>>>8&49,String.fromCharCode(R)},T.prototype._decodeChar=function(P){var R=a;return R+=(44-P&P-46)>>>8&-a+P-45+62,R+=(94-P&P-96)>>>8&-a+P-95+63,R+=(47-P&P-58)>>>8&-a+P-48+52,R+=(64-P&P-91)>>>8&-a+P-65+0,R+=(96-P&P-123)>>>8&-a+P-97+26,R},T}(l);i.URLSafeCoder=b;var _=new b;function x(C){return _.encode(C)}i.encodeURLSafe=x;function S(C){return _.decode(C)}i.decodeURLSafe=S,i.encodedLength=function(C){return u.encodedLength(C)},i.maxDecodedLength=function(C){return u.maxDecodedLength(C)},i.decodedLength=function(C){return u.decodedLength(C)}},function(e,i,r){Object.defineProperty(i,"__esModule",{value:!0});var s="utf8: invalid string",a="utf8: invalid source encoding";function l(d){for(var b=new Uint8Array(u(d)),_=0,x=0;x<d.length;x++){var S=d.charCodeAt(x);S<128?b[_++]=S:S<2048?(b[_++]=192|S>>6,b[_++]=128|S&63):S<55296?(b[_++]=224|S>>12,b[_++]=128|S>>6&63,b[_++]=128|S&63):(x++,S=(S&1023)<<10,S|=d.charCodeAt(x)&1023,S+=65536,b[_++]=240|S>>18,b[_++]=128|S>>12&63,b[_++]=128|S>>6&63,b[_++]=128|S&63)}return b}i.encode=l;function u(d){for(var b=0,_=0;_<d.length;_++){var x=d.charCodeAt(_);if(x<128)b+=1;else if(x<2048)b+=2;else if(x<55296)b+=3;else if(x<=57343){if(_>=d.length-1)throw new Error(s);_++,b+=4}else throw new Error(s)}return b}i.encodedLength=u;function h(d){for(var b=[],_=0;_<d.length;_++){var x=d[_];if(x&128){var S=void 0;if(x<224){if(_>=d.length)throw new Error(a);var C=d[++_];if((C&192)!==128)throw new Error(a);x=(x&31)<<6|C&63,S=128}else if(x<240){if(_>=d.length-1)throw new Error(a);var C=d[++_],T=d[++_];if((C&192)!==128||(T&192)!==128)throw new Error(a);x=(x&15)<<12|(C&63)<<6|T&63,S=2048}else if(x<248){if(_>=d.length-2)throw new Error(a);var C=d[++_],T=d[++_],P=d[++_];if((C&192)!==128||(T&192)!==128||(P&192)!==128)throw new Error(a);x=(x&15)<<18|(C&63)<<12|(T&63)<<6|P&63,S=65536}else throw new Error(a);if(x<S||x>=55296&&x<=57343)throw new Error(a);if(x>=65536){if(x>1114111)throw new Error(a);x-=65536,b.push(String.fromCharCode(55296|x>>10)),x=56320|x&1023}}b.push(String.fromCharCode(x))}return b.join("")}i.decode=h},function(e,i,r){e.exports=r(3).default},function(e,i,r){r.r(i);var s=function(){function m(p,g){this.lastId=0,this.prefix=p,this.name=g}return m.prototype.create=function(p){this.lastId++;var g=this.lastId,v=this.prefix+g,w=this.name+"["+g+"]",O=!1,F=function(){O||(p.apply(null,arguments),O=!0)};return this[g]=F,{number:g,id:v,name:w,callback:F}},m.prototype.remove=function(p){delete this[p.number]},m}(),a=new s("_pusher_script_","Pusher.ScriptReceivers"),l={VERSION:"7.6.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:"mt1",userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},u=l,h=function(){function m(p){this.options=p,this.receivers=p.receivers||a,this.loading={}}return m.prototype.load=function(p,g,v){var w=this;if(w.loading[p]&&w.loading[p].length>0)w.loading[p].push(v);else{w.loading[p]=[v];var O=ft.createScriptRequest(w.getPath(p,g)),F=w.receivers.create(function(U){if(w.receivers.remove(F),w.loading[p]){var J=w.loading[p];delete w.loading[p];for(var G=function(Wt){Wt||O.cleanup()},et=0;et<J.length;et++)J[et](U,G)}});O.send(F)}},m.prototype.getRoot=function(p){var g,v=ft.getDocument().location.protocol;return p&&p.useTLS||v==="https:"?g=this.options.cdn_https:g=this.options.cdn_http,g.replace(/\/*$/,"")+"/"+this.options.version},m.prototype.getPath=function(p,g){return this.getRoot(g)+"/"+p+this.options.suffix+".js"},m}(),d=h,b=new s("_pusher_dependencies","Pusher.DependenciesReceivers"),_=new d({cdn_http:u.cdn_http,cdn_https:u.cdn_https,version:u.VERSION,suffix:u.dependency_suffix,receivers:b}),x={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},S=function(m){var p="See:",g=x.urls[m];if(!g)return"";var v;return g.fullUrl?v=g.fullUrl:g.path&&(v=x.baseUrl+g.path),v?p+" "+v:""},C={buildLogSuffix:S},T;(function(m){m.UserAuthentication="user-authentication",m.ChannelAuthorization="channel-authorization"})(T||(T={}));var P=function(){var m=function(p,g){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var O in w)w.hasOwnProperty(O)&&(v[O]=w[O])},m(p,g)};return function(p,g){m(p,g);function v(){this.constructor=p}p.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}(),R=function(m){P(p,m);function p(g){var v=this.constructor,w=m.call(this,g)||this;return Object.setPrototypeOf(w,v.prototype),w}return p}(Error),B=function(m){P(p,m);function p(g){var v=this.constructor,w=m.call(this,g)||this;return Object.setPrototypeOf(w,v.prototype),w}return p}(Error),H=function(m){P(p,m);function p(g){var v=this.constructor,w=m.call(this,g)||this;return Object.setPrototypeOf(w,v.prototype),w}return p}(Error),D=function(m){P(p,m);function p(g){var v=this.constructor,w=m.call(this,g)||this;return Object.setPrototypeOf(w,v.prototype),w}return p}(Error),L=function(m){P(p,m);function p(g){var v=this.constructor,w=m.call(this,g)||this;return Object.setPrototypeOf(w,v.prototype),w}return p}(Error),N=function(m){P(p,m);function p(g){var v=this.constructor,w=m.call(this,g)||this;return Object.setPrototypeOf(w,v.prototype),w}return p}(Error),W=function(m){P(p,m);function p(g){var v=this.constructor,w=m.call(this,g)||this;return Object.setPrototypeOf(w,v.prototype),w}return p}(Error),V=function(m){P(p,m);function p(g){var v=this.constructor,w=m.call(this,g)||this;return Object.setPrototypeOf(w,v.prototype),w}return p}(Error),X=function(m){P(p,m);function p(g,v){var w=this.constructor,O=m.call(this,v)||this;return O.status=g,Object.setPrototypeOf(O,w.prototype),O}return p}(Error),K=function(m,p,g,v,w){var O=ft.createXHR();O.open("POST",g.endpoint,!0),O.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var F in g.headers)O.setRequestHeader(F,g.headers[F]);if(g.headersProvider!=null){var U=g.headersProvider();for(var F in U)O.setRequestHeader(F,U[F])}return O.onreadystatechange=function(){if(O.readyState===4)if(O.status===200){var J=void 0,G=!1;try{J=JSON.parse(O.responseText),G=!0}catch{w(new X(200,"JSON returned from "+v.toString()+" endpoint was invalid, yet status code was 200. Data was: "+O.responseText),null)}G&&w(null,J)}else{var et="";switch(v){case T.UserAuthentication:et=C.buildLogSuffix("authenticationEndpoint");break;case T.ChannelAuthorization:et="Clients must be authorized to join private or presence channels. "+C.buildLogSuffix("authorizationEndpoint");break}w(new X(O.status,"Unable to retrieve auth string from "+v.toString()+" endpoint - "+("received status: "+O.status+" from "+g.endpoint+". "+et)),null)}},O.send(p),O},Q=K;function rt(m){return kt(ot(m))}var lt=String.fromCharCode,ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",it=function(m){var p=m.charCodeAt(0);return p<128?m:p<2048?lt(192|p>>>6)+lt(128|p&63):lt(224|p>>>12&15)+lt(128|p>>>6&63)+lt(128|p&63)},ot=function(m){return m.replace(/[^\x00-\x7F]/g,it)},mt=function(m){var p=[0,2,1][m.length%3],g=m.charCodeAt(0)<<16|(m.length>1?m.charCodeAt(1):0)<<8|(m.length>2?m.charCodeAt(2):0),v=[ut.charAt(g>>>18),ut.charAt(g>>>12&63),p>=2?"=":ut.charAt(g>>>6&63),p>=1?"=":ut.charAt(g&63)];return v.join("")},kt=window.btoa||function(m){return m.replace(/[\s\S]{1,3}/g,mt)},Zt=function(){function m(p,g,v,w){var O=this;this.clear=g,this.timer=p(function(){O.timer&&(O.timer=w(O.timer))},v)}return m.prototype.isRunning=function(){return this.timer!==null},m.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},m}(),Et=Zt,Ht=function(){var m=function(p,g){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var O in w)w.hasOwnProperty(O)&&(v[O]=w[O])},m(p,g)};return function(p,g){m(p,g);function v(){this.constructor=p}p.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}();function se(m){window.clearTimeout(m)}function Vt(m){window.clearInterval(m)}var Ot=function(m){Ht(p,m);function p(g,v){return m.call(this,setTimeout,se,g,function(w){return v(),null})||this}return p}(Et),Qt=function(m){Ht(p,m);function p(g,v){return m.call(this,setInterval,Vt,g,function(w){return v(),w})||this}return p}(Et),ai={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(m){return new Ot(0,m)},method:function(m){var p=Array.prototype.slice.call(arguments,1);return function(g){return g[m].apply(g,p.concat(arguments))}}},Pt=ai;function zt(m){for(var p=[],g=1;g<arguments.length;g++)p[g-1]=arguments[g];for(var v=0;v<p.length;v++){var w=p[v];for(var O in w)w[O]&&w[O].constructor&&w[O].constructor===Object?m[O]=zt(m[O]||{},w[O]):m[O]=w[O]}return m}function Jr(){for(var m=["Pusher"],p=0;p<arguments.length;p++)typeof arguments[p]=="string"?m.push(arguments[p]):m.push(Fn(arguments[p]));return m.join(" : ")}function un(m,p){var g=Array.prototype.indexOf;if(m===null)return-1;if(g&&m.indexOf===g)return m.indexOf(p);for(var v=0,w=m.length;v<w;v++)if(m[v]===p)return v;return-1}function he(m,p){for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&p(m[g],g,m)}function ci(m){var p=[];return he(m,function(g,v){p.push(v)}),p}function ye(m){var p=[];return he(m,function(g){p.push(g)}),p}function Ue(m,p,g){for(var v=0;v<m.length;v++)p.call(g||window,m[v],v,m)}function Mi(m,p){for(var g=[],v=0;v<m.length;v++)g.push(p(m[v],v,m,g));return g}function ke(m,p){var g={};return he(m,function(v,w){g[w]=p(v)}),g}function Ri(m,p){p=p||function(w){return!!w};for(var g=[],v=0;v<m.length;v++)p(m[v],v,m,g)&&g.push(m[v]);return g}function gr(m,p){var g={};return he(m,function(v,w){(p&&p(v,w,m,g)||v)&&(g[w]=v)}),g}function _e(m){var p=[];return he(m,function(g,v){p.push([v,g])}),p}function te(m,p){for(var g=0;g<m.length;g++)if(p(m[g],g,m))return!0;return!1}function yn(m,p){for(var g=0;g<m.length;g++)if(!p(m[g],g,m))return!1;return!0}function Nn(m){return ke(m,function(p){return typeof p=="object"&&(p=Fn(p)),encodeURIComponent(rt(p.toString()))})}function Di(m){var p=gr(m,function(v){return v!==void 0}),g=Mi(_e(Nn(p)),Pt.method("join","=")).join("&");return g}function _n(m){var p=[],g=[];return function v(w,O){var F,U,J;switch(typeof w){case"object":if(!w)return null;for(F=0;F<p.length;F+=1)if(p[F]===w)return{$ref:g[F]};if(p.push(w),g.push(O),Object.prototype.toString.apply(w)==="[object Array]")for(J=[],F=0;F<w.length;F+=1)J[F]=v(w[F],O+"["+F+"]");else{J={};for(U in w)Object.prototype.hasOwnProperty.call(w,U)&&(J[U]=v(w[U],O+"["+JSON.stringify(U)+"]"))}return J;case"number":case"string":case"boolean":return w}}(m,"$")}function Fn(m){try{return JSON.stringify(m)}catch{return JSON.stringify(_n(m))}}var wn=function(){function m(){this.globalLog=function(p){window.console&&window.console.log&&window.console.log(p)}}return m.prototype.debug=function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];this.log(this.globalLog,p)},m.prototype.warn=function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];this.log(this.globalLogWarn,p)},m.prototype.error=function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];this.log(this.globalLogError,p)},m.prototype.globalLogWarn=function(p){window.console&&window.console.warn?window.console.warn(p):this.globalLog(p)},m.prototype.globalLogError=function(p){window.console&&window.console.error?window.console.error(p):this.globalLogWarn(p)},m.prototype.log=function(p){var g=Jr.apply(this,arguments);if(Ds.log)Ds.log(g);else if(Ds.logToConsole){var v=p.bind(this);v(g)}},m}(),Tt=new wn,Zr=function(m,p,g,v,w){(g.headers!==void 0||g.headersProvider!=null)&&Tt.warn("To send headers with the "+v.toString()+" request, you must use AJAX, rather than JSONP.");var O=m.nextAuthCallbackID.toString();m.nextAuthCallbackID++;var F=m.getDocument(),U=F.createElement("script");m.auth_callbacks[O]=function(et){w(null,et)};var J="Pusher.auth_callbacks['"+O+"']";U.src=g.endpoint+"?callback="+encodeURIComponent(J)+"&"+p;var G=F.getElementsByTagName("head")[0]||F.documentElement;G.insertBefore(U,G.firstChild)},Qr=Zr,ts=function(){function m(p){this.src=p}return m.prototype.send=function(p){var g=this,v="Error loading "+g.src;g.script=document.createElement("script"),g.script.id=p.id,g.script.src=g.src,g.script.type="text/javascript",g.script.charset="UTF-8",g.script.addEventListener?(g.script.onerror=function(){p.callback(v)},g.script.onload=function(){p.callback(null)}):g.script.onreadystatechange=function(){(g.script.readyState==="loaded"||g.script.readyState==="complete")&&p.callback(null)},g.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(g.errorScript=document.createElement("script"),g.errorScript.id=p.id+"_error",g.errorScript.text=p.name+"('"+v+"');",g.script.async=g.errorScript.async=!1):g.script.async=!0;var w=document.getElementsByTagName("head")[0];w.insertBefore(g.script,w.firstChild),g.errorScript&&w.insertBefore(g.errorScript,g.script.nextSibling)},m.prototype.cleanup=function(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null},m}(),es=ts,ns=function(){function m(p,g){this.url=p,this.data=g}return m.prototype.send=function(p){if(!this.request){var g=Di(this.data),v=this.url+"/"+p.number+"?"+g;this.request=ft.createScriptRequest(v),this.request.send(p)}},m.prototype.cleanup=function(){this.request&&this.request.cleanup()},m}(),is=ns,rs=function(m,p){return function(g,v){var w="http"+(p?"s":"")+"://",O=w+(m.host||m.options.host)+m.options.path,F=ft.createJSONPRequest(O,g),U=ft.ScriptReceivers.create(function(J,G){a.remove(U),F.cleanup(),G&&G.host&&(m.host=G.host),v&&v(J,G)});F.send(U)}},ss={name:"jsonp",getAgent:rs},os=ss;function as(m,p,g){var v=m+(p.useTLS?"s":""),w=p.useTLS?p.hostTLS:p.hostNonTLS;return v+"://"+w+g}function cs(m,p){var g="/app/"+m,v="?protocol="+u.PROTOCOL+"&client=js&version="+u.VERSION+(p?"&"+p:"");return g+v}var wl={getInitial:function(m,p){var g=(p.httpPath||"")+cs(m,"flash=false");return as("ws",p,g)}},qo={getInitial:function(m,p){var g=(p.httpPath||"/pusher")+cs(m);return as("http",p,g)}},$o={getInitial:function(m,p){return as("http",p,p.httpPath||"/pusher")},getPath:function(m,p){return cs(m)}},xl=function(){function m(){this._callbacks={}}return m.prototype.get=function(p){return this._callbacks[ls(p)]},m.prototype.add=function(p,g,v){var w=ls(p);this._callbacks[w]=this._callbacks[w]||[],this._callbacks[w].push({fn:g,context:v})},m.prototype.remove=function(p,g,v){if(!p&&!g&&!v){this._callbacks={};return}var w=p?[ls(p)]:ci(this._callbacks);g||v?this.removeCallback(w,g,v):this.removeAllCallbacks(w)},m.prototype.removeCallback=function(p,g,v){Ue(p,function(w){this._callbacks[w]=Ri(this._callbacks[w]||[],function(O){return g&&g!==O.fn||v&&v!==O.context}),this._callbacks[w].length===0&&delete this._callbacks[w]},this)},m.prototype.removeAllCallbacks=function(p){Ue(p,function(g){delete this._callbacks[g]},this)},m}(),Sl=xl;function ls(m){return"_"+m}var Tl=function(){function m(p){this.callbacks=new Sl,this.global_callbacks=[],this.failThrough=p}return m.prototype.bind=function(p,g,v){return this.callbacks.add(p,g,v),this},m.prototype.bind_global=function(p){return this.global_callbacks.push(p),this},m.prototype.unbind=function(p,g,v){return this.callbacks.remove(p,g,v),this},m.prototype.unbind_global=function(p){return p?(this.global_callbacks=Ri(this.global_callbacks||[],function(g){return g!==p}),this):(this.global_callbacks=[],this)},m.prototype.unbind_all=function(){return this.unbind(),this.unbind_global(),this},m.prototype.emit=function(p,g,v){for(var w=0;w<this.global_callbacks.length;w++)this.global_callbacks[w](p,g);var O=this.callbacks.get(p),F=[];if(v?F.push(g,v):g&&F.push(g),O&&O.length>0)for(var w=0;w<O.length;w++)O[w].fn.apply(O[w].context||window,F);else this.failThrough&&this.failThrough(p,g);return this},m}(),Je=Tl,Ol=function(){var m=function(p,g){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var O in w)w.hasOwnProperty(O)&&(v[O]=w[O])},m(p,g)};return function(p,g){m(p,g);function v(){this.constructor=p}p.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}(),Cl=function(m){Ol(p,m);function p(g,v,w,O,F){var U=m.call(this)||this;return U.initialize=ft.transportConnectionInitializer,U.hooks=g,U.name=v,U.priority=w,U.key=O,U.options=F,U.state="new",U.timeline=F.timeline,U.activityTimeout=F.activityTimeout,U.id=U.timeline.generateUniqueID(),U}return p.prototype.handlesActivityChecks=function(){return!!this.hooks.handlesActivityChecks},p.prototype.supportsPing=function(){return!!this.hooks.supportsPing},p.prototype.connect=function(){var g=this;if(this.socket||this.state!=="initialized")return!1;var v=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(v,this.options)}catch(w){return Pt.defer(function(){g.onError(w),g.changeState("closed")}),!1}return this.bindListeners(),Tt.debug("Connecting",{transport:this.name,url:v}),this.changeState("connecting"),!0},p.prototype.close=function(){return this.socket?(this.socket.close(),!0):!1},p.prototype.send=function(g){var v=this;return this.state==="open"?(Pt.defer(function(){v.socket&&v.socket.send(g)}),!0):!1},p.prototype.ping=function(){this.state==="open"&&this.supportsPing()&&this.socket.ping()},p.prototype.onOpen=function(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0},p.prototype.onError=function(g){this.emit("error",{type:"WebSocketError",error:g}),this.timeline.error(this.buildTimelineMessage({error:g.toString()}))},p.prototype.onClose=function(g){g?this.changeState("closed",{code:g.code,reason:g.reason,wasClean:g.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0},p.prototype.onMessage=function(g){this.emit("message",g)},p.prototype.onActivity=function(){this.emit("activity")},p.prototype.bindListeners=function(){var g=this;this.socket.onopen=function(){g.onOpen()},this.socket.onerror=function(v){g.onError(v)},this.socket.onclose=function(v){g.onClose(v)},this.socket.onmessage=function(v){g.onMessage(v)},this.supportsPing()&&(this.socket.onactivity=function(){g.onActivity()})},p.prototype.unbindListeners=function(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))},p.prototype.changeState=function(g,v){this.state=g,this.timeline.info(this.buildTimelineMessage({state:g,params:v})),this.emit(g,v)},p.prototype.buildTimelineMessage=function(g){return zt({cid:this.id},g)},p}(Je),Al=Cl,us=function(){function m(p){this.hooks=p}return m.prototype.isSupported=function(p){return this.hooks.isSupported(p)},m.prototype.createConnection=function(p,g,v,w){return new Al(this.hooks,p,g,v,w)},m}(),li=us,hs=new li({urls:wl,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!ft.getWebSocketAPI()},isSupported:function(){return!!ft.getWebSocketAPI()},getSocket:function(m){return ft.createWebSocket(m)}}),Xo={urls:qo,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Yo=zt({getSocket:function(m){return ft.HTTPFactory.createStreamingSocket(m)}},Xo),Ko=zt({getSocket:function(m){return ft.HTTPFactory.createPollingSocket(m)}},Xo),Go={isSupported:function(){return ft.isXHRSupported()}},kl=new li(zt({},Yo,Go)),El=new li(zt({},Ko,Go)),Pl={ws:hs,xhr_streaming:kl,xhr_polling:El},mr=Pl,Jo=new li({file:"sockjs",urls:$o,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(m,p){return new window.SockJS(m,null,{js_path:_.getPath("sockjs",{useTLS:p.useTLS}),ignore_null_origin:p.ignoreNullOrigin})},beforeOpen:function(m,p){m.send(JSON.stringify({path:p}))}}),Zo={isSupported:function(m){var p=ft.isXDRSupported(m.useTLS);return p}},Ml=new li(zt({},Yo,Zo)),Rl=new li(zt({},Ko,Zo));mr.xdr_streaming=Ml,mr.xdr_polling=Rl,mr.sockjs=Jo;var Dl=mr,Ll=function(){var m=function(p,g){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var O in w)w.hasOwnProperty(O)&&(v[O]=w[O])},m(p,g)};return function(p,g){m(p,g);function v(){this.constructor=p}p.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}(),Il=function(m){Ll(p,m);function p(){var g=m.call(this)||this,v=g;return window.addEventListener!==void 0&&(window.addEventListener("online",function(){v.emit("online")},!1),window.addEventListener("offline",function(){v.emit("offline")},!1)),g}return p.prototype.isOnline=function(){return window.navigator.onLine===void 0?!0:window.navigator.onLine},p}(Je),vr=new Il,Nl=function(){function m(p,g,v){this.manager=p,this.transport=g,this.minPingDelay=v.minPingDelay,this.maxPingDelay=v.maxPingDelay,this.pingDelay=void 0}return m.prototype.createConnection=function(p,g,v,w){var O=this;w=zt({},w,{activityTimeout:this.pingDelay});var F=this.transport.createConnection(p,g,v,w),U=null,J=function(){F.unbind("open",J),F.bind("closed",G),U=Pt.now()},G=function(et){if(F.unbind("closed",G),et.code===1002||et.code===1003)O.manager.reportDeath();else if(!et.wasClean&&U){var Wt=Pt.now()-U;Wt<2*O.maxPingDelay&&(O.manager.reportDeath(),O.pingDelay=Math.max(Wt/2,O.minPingDelay))}};return F.bind("open",J),F},m.prototype.isSupported=function(p){return this.manager.isAlive()&&this.transport.isSupported(p)},m}(),br=Nl,Qo={decodeMessage:function(m){try{var p=JSON.parse(m.data),g=p.data;if(typeof g=="string")try{g=JSON.parse(p.data)}catch{}var v={event:p.event,channel:p.channel,data:g};return p.user_id&&(v.user_id=p.user_id),v}catch(w){throw{type:"MessageParseError",error:w,data:m.data}}},encodeMessage:function(m){return JSON.stringify(m)},processHandshake:function(m){var p=Qo.decodeMessage(m);if(p.event==="pusher:connection_established"){if(!p.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:p.data.socket_id,activityTimeout:p.data.activity_timeout*1e3}}else{if(p.event==="pusher:error")return{action:this.getCloseAction(p.data),error:this.getCloseError(p.data)};throw"Invalid handshake"}},getCloseAction:function(m){return m.code<4e3?m.code>=1002&&m.code<=1004?"backoff":null:m.code===4e3?"tls_only":m.code<4100?"refused":m.code<4200?"backoff":m.code<4300?"retry":"refused"},getCloseError:function(m){return m.code!==1e3&&m.code!==1001?{type:"PusherError",data:{code:m.code,message:m.reason||m.message}}:null}},Bn=Qo,Fl=function(){var m=function(p,g){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var O in w)w.hasOwnProperty(O)&&(v[O]=w[O])},m(p,g)};return function(p,g){m(p,g);function v(){this.constructor=p}p.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}(),ta=function(m){Fl(p,m);function p(g,v){var w=m.call(this)||this;return w.id=g,w.transport=v,w.activityTimeout=v.activityTimeout,w.bindListeners(),w}return p.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},p.prototype.send=function(g){return this.transport.send(g)},p.prototype.send_event=function(g,v,w){var O={event:g,data:v};return w&&(O.channel=w),Tt.debug("Event sent",O),this.send(Bn.encodeMessage(O))},p.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},p.prototype.close=function(){this.transport.close()},p.prototype.bindListeners=function(){var g=this,v={message:function(O){var F;try{F=Bn.decodeMessage(O)}catch(U){g.emit("error",{type:"MessageParseError",error:U,data:O.data})}if(F!==void 0){switch(Tt.debug("Event recd",F),F.event){case"pusher:error":g.emit("error",{type:"PusherError",data:F.data});break;case"pusher:ping":g.emit("ping");break;case"pusher:pong":g.emit("pong");break}g.emit("message",F)}},activity:function(){g.emit("activity")},error:function(O){g.emit("error",O)},closed:function(O){w(),O&&O.code&&g.handleCloseEvent(O),g.transport=null,g.emit("closed")}},w=function(){he(v,function(O,F){g.transport.unbind(F,O)})};he(v,function(O,F){g.transport.bind(F,O)})},p.prototype.handleCloseEvent=function(g){var v=Bn.getCloseAction(g),w=Bn.getCloseError(g);w&&this.emit("error",w),v&&this.emit(v,{action:v,error:w})},p}(Je),ea=ta,na=function(){function m(p,g){this.transport=p,this.callback=g,this.bindListeners()}return m.prototype.close=function(){this.unbindListeners(),this.transport.close()},m.prototype.bindListeners=function(){var p=this;this.onMessage=function(g){p.unbindListeners();var v;try{v=Bn.processHandshake(g)}catch(w){p.finish("error",{error:w}),p.transport.close();return}v.action==="connected"?p.finish("connected",{connection:new ea(v.id,p.transport),activityTimeout:v.activityTimeout}):(p.finish(v.action,{error:v.error}),p.transport.close())},this.onClosed=function(g){p.unbindListeners();var v=Bn.getCloseAction(g)||"backoff",w=Bn.getCloseError(g);p.finish(v,{error:w})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},m.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},m.prototype.finish=function(p,g){this.callback(zt({transport:this.transport,action:p},g))},m}(),Bl=na,Hl=function(){function m(p,g){this.timeline=p,this.options=g||{}}return m.prototype.send=function(p,g){this.timeline.isEmpty()||this.timeline.send(ft.TimelineTransport.getAgent(this,p),g)},m}(),zl=Hl,Wl=function(){var m=function(p,g){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var O in w)w.hasOwnProperty(O)&&(v[O]=w[O])},m(p,g)};return function(p,g){m(p,g);function v(){this.constructor=p}p.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}(),ia=function(m){Wl(p,m);function p(g,v){var w=m.call(this,function(O,F){Tt.debug("No callbacks on "+g+" for "+O)})||this;return w.name=g,w.pusher=v,w.subscribed=!1,w.subscriptionPending=!1,w.subscriptionCancelled=!1,w}return p.prototype.authorize=function(g,v){return v(null,{auth:""})},p.prototype.trigger=function(g,v){if(g.indexOf("client-")!==0)throw new R("Event '"+g+"' does not start with 'client-'");if(!this.subscribed){var w=C.buildLogSuffix("triggeringClientEvents");Tt.warn("Client event triggered before channel 'subscription_succeeded' event . "+w)}return this.pusher.send_event(g,v,this.name)},p.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},p.prototype.handleEvent=function(g){var v=g.event,w=g.data;if(v==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(g);else if(v==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(g);else if(v.indexOf("pusher_internal:")!==0){var O={};this.emit(v,w,O)}},p.prototype.handleSubscriptionSucceededEvent=function(g){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",g.data)},p.prototype.handleSubscriptionCountEvent=function(g){g.data.subscription_count&&(this.subscriptionCount=g.data.subscription_count),this.emit("pusher:subscription_count",g.data)},p.prototype.subscribe=function(){var g=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(v,w){v?(g.subscriptionPending=!1,Tt.error(v.toString()),g.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:v.message},v instanceof X?{status:v.status}:{}))):g.pusher.send_event("pusher:subscribe",{auth:w.auth,channel_data:w.channel_data,channel:g.name})}))},p.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},p.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},p.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},p}(Je),yr=ia,ra=function(){var m=function(p,g){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var O in w)w.hasOwnProperty(O)&&(v[O]=w[O])},m(p,g)};return function(p,g){m(p,g);function v(){this.constructor=p}p.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}(),fs=function(m){ra(p,m);function p(){return m!==null&&m.apply(this,arguments)||this}return p.prototype.authorize=function(g,v){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:g},v)},p}(yr),ds=fs,sa=function(){function m(){this.reset()}return m.prototype.get=function(p){return Object.prototype.hasOwnProperty.call(this.members,p)?{id:p,info:this.members[p]}:null},m.prototype.each=function(p){var g=this;he(this.members,function(v,w){p(g.get(w))})},m.prototype.setMyID=function(p){this.myID=p},m.prototype.onSubscription=function(p){this.members=p.presence.hash,this.count=p.presence.count,this.me=this.get(this.myID)},m.prototype.addMember=function(p){return this.get(p.user_id)===null&&this.count++,this.members[p.user_id]=p.user_info,this.get(p.user_id)},m.prototype.removeMember=function(p){var g=this.get(p.user_id);return g&&(delete this.members[p.user_id],this.count--),g},m.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},m}(),_r=sa,oa=function(){var m=function(p,g){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var O in w)w.hasOwnProperty(O)&&(v[O]=w[O])},m(p,g)};return function(p,g){m(p,g);function v(){this.constructor=p}p.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}(),jl=function(m,p,g,v){function w(O){return O instanceof g?O:new g(function(F){F(O)})}return new(g||(g=Promise))(function(O,F){function U(et){try{G(v.next(et))}catch(Wt){F(Wt)}}function J(et){try{G(v.throw(et))}catch(Wt){F(Wt)}}function G(et){et.done?O(et.value):w(et.value).then(U,J)}G((v=v.apply(m,p||[])).next())})},aa=function(m,p){var g={label:0,sent:function(){if(O[0]&1)throw O[1];return O[1]},trys:[],ops:[]},v,w,O,F;return F={next:U(0),throw:U(1),return:U(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function U(G){return function(et){return J([G,et])}}function J(G){if(v)throw new TypeError("Generator is already executing.");for(;g;)try{if(v=1,w&&(O=G[0]&2?w.return:G[0]?w.throw||((O=w.return)&&O.call(w),0):w.next)&&!(O=O.call(w,G[1])).done)return O;switch(w=0,O&&(G=[G[0]&2,O.value]),G[0]){case 0:case 1:O=G;break;case 4:return g.label++,{value:G[1],done:!1};case 5:g.label++,w=G[1],G=[0];continue;case 7:G=g.ops.pop(),g.trys.pop();continue;default:if(O=g.trys,!(O=O.length>0&&O[O.length-1])&&(G[0]===6||G[0]===2)){g=0;continue}if(G[0]===3&&(!O||G[1]>O[0]&&G[1]<O[3])){g.label=G[1];break}if(G[0]===6&&g.label<O[1]){g.label=O[1],O=G;break}if(O&&g.label<O[2]){g.label=O[2],g.ops.push(G);break}O[2]&&g.ops.pop(),g.trys.pop();continue}G=p.call(m,g)}catch(et){G=[6,et],w=0}finally{v=O=0}if(G[0]&5)throw G[1];return{value:G[0]?G[1]:void 0,done:!0}}},ca=function(m){oa(p,m);function p(g,v){var w=m.call(this,g,v)||this;return w.members=new _r,w}return p.prototype.authorize=function(g,v){var w=this;m.prototype.authorize.call(this,g,function(O,F){return jl(w,void 0,void 0,function(){var U,J;return aa(this,function(G){switch(G.label){case 0:return O?[3,3]:(F=F,F.channel_data==null?[3,1]:(U=JSON.parse(F.channel_data),this.members.setMyID(U.user_id),[3,3]));case 1:return[4,this.pusher.user.signinDonePromise];case 2:if(G.sent(),this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else return J=C.buildLogSuffix("authorizationEndpoint"),Tt.error("Invalid auth response for channel '"+this.name+"', "+("expected 'channel_data' field. "+J+", ")+"or the user should be signed in."),v("Invalid auth response"),[2];G.label=3;case 3:return v(O,F),[2]}})})})},p.prototype.handleEvent=function(g){var v=g.event;if(v.indexOf("pusher_internal:")===0)this.handleInternalEvent(g);else{var w=g.data,O={};g.user_id&&(O.user_id=g.user_id),this.emit(v,w,O)}},p.prototype.handleInternalEvent=function(g){var v=g.event,w=g.data;switch(v){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(g);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(g);break;case"pusher_internal:member_added":var O=this.members.addMember(w);this.emit("pusher:member_added",O);break;case"pusher_internal:member_removed":var F=this.members.removeMember(w);F&&this.emit("pusher:member_removed",F);break}},p.prototype.handleSubscriptionSucceededEvent=function(g){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(g.data),this.emit("pusher:subscription_succeeded",this.members))},p.prototype.disconnect=function(){this.members.reset(),m.prototype.disconnect.call(this)},p}(ds),ps=ca,Ul=r(1),wr=r(0),gs=function(){var m=function(p,g){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var O in w)w.hasOwnProperty(O)&&(v[O]=w[O])},m(p,g)};return function(p,g){m(p,g);function v(){this.constructor=p}p.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}(),ms=function(m){gs(p,m);function p(g,v,w){var O=m.call(this,g,v)||this;return O.key=null,O.nacl=w,O}return p.prototype.authorize=function(g,v){var w=this;m.prototype.authorize.call(this,g,function(O,F){if(O){v(O,F);return}var U=F.shared_secret;if(!U){v(new Error("No shared_secret key in auth payload for encrypted channel: "+w.name),null);return}w.key=Object(wr.decode)(U),delete F.shared_secret,v(null,F)})},p.prototype.trigger=function(g,v){throw new N("Client events are not currently supported for encrypted channels")},p.prototype.handleEvent=function(g){var v=g.event,w=g.data;if(v.indexOf("pusher_internal:")===0||v.indexOf("pusher:")===0){m.prototype.handleEvent.call(this,g);return}this.handleEncryptedEvent(v,w)},p.prototype.handleEncryptedEvent=function(g,v){var w=this;if(!this.key){Tt.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!v.ciphertext||!v.nonce){Tt.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+v);return}var O=Object(wr.decode)(v.ciphertext);if(O.length<this.nacl.secretbox.overheadLength){Tt.error("Expected encrypted event ciphertext length to be "+this.nacl.secretbox.overheadLength+", got: "+O.length);return}var F=Object(wr.decode)(v.nonce);if(F.length<this.nacl.secretbox.nonceLength){Tt.error("Expected encrypted event nonce length to be "+this.nacl.secretbox.nonceLength+", got: "+F.length);return}var U=this.nacl.secretbox.open(O,F,this.key);if(U===null){Tt.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,function(J,G){if(J){Tt.error("Failed to make a request to the authEndpoint: "+G+". Unable to fetch new key, so dropping encrypted event");return}if(U=w.nacl.secretbox.open(O,F,w.key),U===null){Tt.error("Failed to decrypt event with new key. Dropping encrypted event");return}w.emit(g,w.getDataToEmit(U))});return}this.emit(g,this.getDataToEmit(U))},p.prototype.getDataToEmit=function(g){var v=Object(Ul.decode)(g);try{return JSON.parse(v)}catch{return v}},p}(ds),ui=ms,la=function(){var m=function(p,g){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var O in w)w.hasOwnProperty(O)&&(v[O]=w[O])},m(p,g)};return function(p,g){m(p,g);function v(){this.constructor=p}p.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}(),ua=function(m){la(p,m);function p(g,v){var w=m.call(this)||this;w.state="initialized",w.connection=null,w.key=g,w.options=v,w.timeline=w.options.timeline,w.usingTLS=w.options.useTLS,w.errorCallbacks=w.buildErrorCallbacks(),w.connectionCallbacks=w.buildConnectionCallbacks(w.errorCallbacks),w.handshakeCallbacks=w.buildHandshakeCallbacks(w.errorCallbacks);var O=ft.getNetwork();return O.bind("online",function(){w.timeline.info({netinfo:"online"}),(w.state==="connecting"||w.state==="unavailable")&&w.retryIn(0)}),O.bind("offline",function(){w.timeline.info({netinfo:"offline"}),w.connection&&w.sendActivityCheck()}),w.updateStrategy(),w}return p.prototype.connect=function(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}},p.prototype.send=function(g){return this.connection?this.connection.send(g):!1},p.prototype.send_event=function(g,v,w){return this.connection?this.connection.send_event(g,v,w):!1},p.prototype.disconnect=function(){this.disconnectInternally(),this.updateState("disconnected")},p.prototype.isUsingTLS=function(){return this.usingTLS},p.prototype.startConnecting=function(){var g=this,v=function(w,O){w?g.runner=g.strategy.connect(0,v):O.action==="error"?(g.emit("error",{type:"HandshakeError",error:O.error}),g.timeline.error({handshakeError:O.error})):(g.abortConnecting(),g.handshakeCallbacks[O.action](O))};this.runner=this.strategy.connect(0,v)},p.prototype.abortConnecting=function(){this.runner&&(this.runner.abort(),this.runner=null)},p.prototype.disconnectInternally=function(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var g=this.abandonConnection();g.close()}},p.prototype.updateStrategy=function(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})},p.prototype.retryIn=function(g){var v=this;this.timeline.info({action:"retry",delay:g}),g>0&&this.emit("connecting_in",Math.round(g/1e3)),this.retryTimer=new Ot(g||0,function(){v.disconnectInternally(),v.connect()})},p.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},p.prototype.setUnavailableTimer=function(){var g=this;this.unavailableTimer=new Ot(this.options.unavailableTimeout,function(){g.updateState("unavailable")})},p.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},p.prototype.sendActivityCheck=function(){var g=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Ot(this.options.pongTimeout,function(){g.timeline.error({pong_timed_out:g.options.pongTimeout}),g.retryIn(0)})},p.prototype.resetActivityCheck=function(){var g=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new Ot(this.activityTimeout,function(){g.sendActivityCheck()}))},p.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},p.prototype.buildConnectionCallbacks=function(g){var v=this;return zt({},g,{message:function(w){v.resetActivityCheck(),v.emit("message",w)},ping:function(){v.send_event("pusher:pong",{})},activity:function(){v.resetActivityCheck()},error:function(w){v.emit("error",w)},closed:function(){v.abandonConnection(),v.shouldRetry()&&v.retryIn(1e3)}})},p.prototype.buildHandshakeCallbacks=function(g){var v=this;return zt({},g,{connected:function(w){v.activityTimeout=Math.min(v.options.activityTimeout,w.activityTimeout,w.connection.activityTimeout||1/0),v.clearUnavailableTimer(),v.setConnection(w.connection),v.socket_id=v.connection.id,v.updateState("connected",{socket_id:v.socket_id})}})},p.prototype.buildErrorCallbacks=function(){var g=this,v=function(w){return function(O){O.error&&g.emit("error",{type:"WebSocketError",error:O.error}),w(O)}};return{tls_only:v(function(){g.usingTLS=!0,g.updateStrategy(),g.retryIn(0)}),refused:v(function(){g.disconnect()}),backoff:v(function(){g.retryIn(1e3)}),retry:v(function(){g.retryIn(0)})}},p.prototype.setConnection=function(g){this.connection=g;for(var v in this.connectionCallbacks)this.connection.bind(v,this.connectionCallbacks[v]);this.resetActivityCheck()},p.prototype.abandonConnection=function(){if(this.connection){this.stopActivityCheck();for(var g in this.connectionCallbacks)this.connection.unbind(g,this.connectionCallbacks[g]);var v=this.connection;return this.connection=null,v}},p.prototype.updateState=function(g,v){var w=this.state;if(this.state=g,w!==g){var O=g;O==="connected"&&(O+=" with new socket ID "+v.socket_id),Tt.debug("State changed",w+" -> "+O),this.timeline.info({state:g,params:v}),this.emit("state_change",{previous:w,current:g}),this.emit(g,v)}},p.prototype.shouldRetry=function(){return this.state==="connecting"||this.state==="connected"},p}(Je),Vl=ua,ha=function(){function m(){this.channels={}}return m.prototype.add=function(p,g){return this.channels[p]||(this.channels[p]=da(p,g)),this.channels[p]},m.prototype.all=function(){return ye(this.channels)},m.prototype.find=function(p){return this.channels[p]},m.prototype.remove=function(p){var g=this.channels[p];return delete this.channels[p],g},m.prototype.disconnect=function(){he(this.channels,function(p){p.disconnect()})},m}(),fa=ha;function da(m,p){if(m.indexOf("private-encrypted-")===0){if(p.config.nacl)return hn.createEncryptedChannel(m,p,p.config.nacl);var g="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",v=C.buildLogSuffix("encryptedChannelSupport");throw new N(g+". "+v)}else{if(m.indexOf("private-")===0)return hn.createPrivateChannel(m,p);if(m.indexOf("presence-")===0)return hn.createPresenceChannel(m,p);if(m.indexOf("#")===0)throw new B('Cannot create a channel with name "'+m+'".');return hn.createChannel(m,p)}}var pa={createChannels:function(){return new fa},createConnectionManager:function(m,p){return new Vl(m,p)},createChannel:function(m,p){return new yr(m,p)},createPrivateChannel:function(m,p){return new ds(m,p)},createPresenceChannel:function(m,p){return new ps(m,p)},createEncryptedChannel:function(m,p,g){return new ui(m,p,g)},createTimelineSender:function(m,p){return new zl(m,p)},createHandshake:function(m,p){return new Bl(m,p)},createAssistantToTheTransportManager:function(m,p,g){return new br(m,p,g)}},hn=pa,ql=function(){function m(p){this.options=p||{},this.livesLeft=this.options.lives||1/0}return m.prototype.getAssistant=function(p){return hn.createAssistantToTheTransportManager(this,p,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},m.prototype.isAlive=function(){return this.livesLeft>0},m.prototype.reportDeath=function(){this.livesLeft-=1},m}(),ga=ql,ma=function(){function m(p,g){this.strategies=p,this.loop=!!g.loop,this.failFast=!!g.failFast,this.timeout=g.timeout,this.timeoutLimit=g.timeoutLimit}return m.prototype.isSupported=function(){return te(this.strategies,Pt.method("isSupported"))},m.prototype.connect=function(p,g){var v=this,w=this.strategies,O=0,F=this.timeout,U=null,J=function(G,et){et?g(null,et):(O=O+1,v.loop&&(O=O%w.length),O<w.length?(F&&(F=F*2,v.timeoutLimit&&(F=Math.min(F,v.timeoutLimit))),U=v.tryStrategy(w[O],p,{timeout:F,failFast:v.failFast},J)):g(!0))};return U=this.tryStrategy(w[O],p,{timeout:F,failFast:this.failFast},J),{abort:function(){U.abort()},forceMinPriority:function(G){p=G,U&&U.forceMinPriority(G)}}},m.prototype.tryStrategy=function(p,g,v,w){var O=null,F=null;return v.timeout>0&&(O=new Ot(v.timeout,function(){F.abort(),w(!0)})),F=p.connect(g,function(U,J){U&&O&&O.isRunning()&&!v.failFast||(O&&O.ensureAborted(),w(U,J))}),{abort:function(){O&&O.ensureAborted(),F.abort()},forceMinPriority:function(U){F.forceMinPriority(U)}}},m}(),Hn=ma,$l=function(){function m(p){this.strategies=p}return m.prototype.isSupported=function(){return te(this.strategies,Pt.method("isSupported"))},m.prototype.connect=function(p,g){return Xl(this.strategies,p,function(v,w){return function(O,F){if(w[v].error=O,O){bs(w)&&g(!0);return}Ue(w,function(U){U.forceMinPriority(F.transport.priority)}),g(null,F)}})},m}(),vs=$l;function Xl(m,p,g){var v=Mi(m,function(w,O,F,U){return w.connect(p,g(O,U))});return{abort:function(){Ue(v,Yl)},forceMinPriority:function(w){Ue(v,function(O){O.forceMinPriority(w)})}}}function bs(m){return yn(m,function(p){return!!p.error})}function Yl(m){!m.error&&!m.aborted&&(m.abort(),m.aborted=!0)}var Kl=function(){function m(p,g,v){this.strategy=p,this.transports=g,this.ttl=v.ttl||1800*1e3,this.usingTLS=v.useTLS,this.timeline=v.timeline}return m.prototype.isSupported=function(){return this.strategy.isSupported()},m.prototype.connect=function(p,g){var v=this.usingTLS,w=Jl(v),O=[this.strategy];if(w&&w.timestamp+this.ttl>=Pt.now()){var F=this.transports[w.transport];F&&(this.timeline.info({cached:!0,transport:w.transport,latency:w.latency}),O.push(new Hn([F],{timeout:w.latency*2+1e3,failFast:!0})))}var U=Pt.now(),J=O.pop().connect(p,function G(et,Wt){et?(Rt(v),O.length>0?(U=Pt.now(),J=O.pop().connect(p,G)):g(et)):(Lt(v,Wt.transport.name,Pt.now()-U),g(null,Wt))});return{abort:function(){J.abort()},forceMinPriority:function(G){p=G,J&&J.forceMinPriority(G)}}},m}(),Gl=Kl;function ys(m){return"pusherTransport"+(m?"TLS":"NonTLS")}function Jl(m){var p=ft.getLocalStorage();if(p)try{var g=p[ys(m)];if(g)return JSON.parse(g)}catch{Rt(m)}return null}function Lt(m,p,g){var v=ft.getLocalStorage();if(v)try{v[ys(m)]=Fn({timestamp:Pt.now(),transport:p,latency:g})}catch{}}function Rt(m){var p=ft.getLocalStorage();if(p)try{delete p[ys(m)]}catch{}}var Zl=function(){function m(p,g){var v=g.delay;this.strategy=p,this.options={delay:v}}return m.prototype.isSupported=function(){return this.strategy.isSupported()},m.prototype.connect=function(p,g){var v=this.strategy,w,O=new Ot(this.options.delay,function(){w=v.connect(p,g)});return{abort:function(){O.ensureAborted(),w&&w.abort()},forceMinPriority:function(F){p=F,w&&w.forceMinPriority(F)}}},m}(),xr=Zl,Ql=function(){function m(p,g,v){this.test=p,this.trueBranch=g,this.falseBranch=v}return m.prototype.isSupported=function(){var p=this.test()?this.trueBranch:this.falseBranch;return p.isSupported()},m.prototype.connect=function(p,g){var v=this.test()?this.trueBranch:this.falseBranch;return v.connect(p,g)},m}(),Li=Ql,tu=function(){function m(p){this.strategy=p}return m.prototype.isSupported=function(){return this.strategy.isSupported()},m.prototype.connect=function(p,g){var v=this.strategy.connect(p,function(w,O){O&&v.abort(),g(w,O)});return v},m}(),eu=tu;function hi(m){return function(){return m.isSupported()}}var nu=function(m,p,g){var v={};function w(Hi,An,kr,La,Er){var Fs=g(m,Hi,An,kr,La,Er);return v[Hi]=Fs,Fs}var O=Object.assign({},p,{hostNonTLS:m.wsHost+":"+m.wsPort,hostTLS:m.wsHost+":"+m.wssPort,httpPath:m.wsPath}),F=Object.assign({},O,{useTLS:!0}),U=Object.assign({},p,{hostNonTLS:m.httpHost+":"+m.httpPort,hostTLS:m.httpHost+":"+m.httpsPort,httpPath:m.httpPath}),J={loop:!0,timeout:15e3,timeoutLimit:6e4},G=new ga({lives:2,minPingDelay:1e4,maxPingDelay:m.activityTimeout}),et=new ga({lives:2,minPingDelay:1e4,maxPingDelay:m.activityTimeout}),Wt=w("ws","ws",3,O,G),Ze=w("wss","ws",3,F,G),Pe=w("sockjs","sockjs",1,U),Ni=w("xhr_streaming","xhr_streaming",1,U,et),yu=w("xdr_streaming","xdr_streaming",1,U,et),Wn=w("xhr_polling","xhr_polling",1,U),Ar=w("xdr_polling","xdr_polling",1,U),Fi=new Hn([Wt],J),Ct=new Hn([Ze],J),_u=new Hn([Pe],J),Ls=new Hn([new Li(hi(Ni),Ni,yu)],J),Bi=new Hn([new Li(hi(Wn),Wn,Ar)],J),Da=new Hn([new Li(hi(Ls),new vs([Ls,new xr(Bi,{delay:4e3})]),Bi)],J),Is=new Li(hi(Da),Da,_u),Ns;return p.useTLS?Ns=new vs([Fi,new xr(Is,{delay:2e3})]):Ns=new vs([Fi,new xr(Ct,{delay:2e3}),new xr(Is,{delay:5e3})]),new Gl(new eu(new Li(hi(Wt),Ns,Is)),v,{ttl:18e5,timeline:p.timeline,useTLS:p.useTLS})},ee=nu,_s=function(){var m=this;m.timeline.info(m.buildTimelineMessage({transport:m.name+(m.options.useTLS?"s":"")})),m.hooks.isInitialized()?m.changeState("initialized"):m.hooks.file?(m.changeState("initializing"),_.load(m.hooks.file,{useTLS:m.options.useTLS},function(p,g){m.hooks.isInitialized()?(m.changeState("initialized"),g(!0)):(p&&m.onError(p),m.onClose(),g(!1))})):m.onClose()},zn={getRequest:function(m){var p=new window.XDomainRequest;return p.ontimeout=function(){m.emit("error",new H),m.close()},p.onerror=function(g){m.emit("error",g),m.close()},p.onprogress=function(){p.responseText&&p.responseText.length>0&&m.onChunk(200,p.responseText)},p.onload=function(){p.responseText&&p.responseText.length>0&&m.onChunk(200,p.responseText),m.emit("finished",200),m.close()},p},abortRequest:function(m){m.ontimeout=m.onerror=m.onprogress=m.onload=null,m.abort()}},va=zn,ws=function(){var m=function(p,g){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var O in w)w.hasOwnProperty(O)&&(v[O]=w[O])},m(p,g)};return function(p,g){m(p,g);function v(){this.constructor=p}p.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}(),Ee=256*1024,ba=function(m){ws(p,m);function p(g,v,w){var O=m.call(this)||this;return O.hooks=g,O.method=v,O.url=w,O}return p.prototype.start=function(g){var v=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){v.close()},ft.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(g)},p.prototype.close=function(){this.unloader&&(ft.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},p.prototype.onChunk=function(g,v){for(;;){var w=this.advanceBuffer(v);if(w)this.emit("chunk",{status:g,data:w});else break}this.isBufferTooLong(v)&&this.emit("buffer_too_long")},p.prototype.advanceBuffer=function(g){var v=g.slice(this.position),w=v.indexOf(`
|
||
`);return w!==-1?(this.position+=w+1,v.slice(0,w)):null},p.prototype.isBufferTooLong=function(g){return this.position===g.length&&g.length>Ee},p}(Je),ya=ba,Sr;(function(m){m[m.CONNECTING=0]="CONNECTING",m[m.OPEN=1]="OPEN",m[m.CLOSED=3]="CLOSED"})(Sr||(Sr={}));var xn=Sr,_a=1,wa=function(){function m(p,g){this.hooks=p,this.session=xs(1e3)+"/"+Sn(8),this.location=we(g),this.readyState=xn.CONNECTING,this.openStream()}return m.prototype.send=function(p){return this.sendRaw(JSON.stringify([p]))},m.prototype.ping=function(){this.hooks.sendHeartbeat(this)},m.prototype.close=function(p,g){this.onClose(p,g,!0)},m.prototype.sendRaw=function(p){if(this.readyState===xn.OPEN)try{return ft.createSocketRequest("POST",xe(iu(this.location,this.session))).start(p),!0}catch{return!1}else return!1},m.prototype.reconnect=function(){this.closeStream(),this.openStream()},m.prototype.onClose=function(p,g,v){this.closeStream(),this.readyState=xn.CLOSED,this.onclose&&this.onclose({code:p,reason:g,wasClean:v})},m.prototype.onChunk=function(p){if(p.status===200){this.readyState===xn.OPEN&&this.onActivity();var g,v=p.data.slice(0,1);switch(v){case"o":g=JSON.parse(p.data.slice(1)||"{}"),this.onOpen(g);break;case"a":g=JSON.parse(p.data.slice(1)||"[]");for(var w=0;w<g.length;w++)this.onEvent(g[w]);break;case"m":g=JSON.parse(p.data.slice(1)||"null"),this.onEvent(g);break;case"h":this.hooks.onHeartbeat(this);break;case"c":g=JSON.parse(p.data.slice(1)||"[]"),this.onClose(g[0],g[1],!0);break}}},m.prototype.onOpen=function(p){this.readyState===xn.CONNECTING?(p&&p.hostname&&(this.location.base=ru(this.location.base,p.hostname)),this.readyState=xn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)},m.prototype.onEvent=function(p){this.readyState===xn.OPEN&&this.onmessage&&this.onmessage({data:p})},m.prototype.onActivity=function(){this.onactivity&&this.onactivity()},m.prototype.onError=function(p){this.onerror&&this.onerror(p)},m.prototype.openStream=function(){var p=this;this.stream=ft.createSocketRequest("POST",xe(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",function(g){p.onChunk(g)}),this.stream.bind("finished",function(g){p.hooks.onFinished(p,g)}),this.stream.bind("buffer_too_long",function(){p.reconnect()});try{this.stream.start()}catch(g){Pt.defer(function(){p.onError(g),p.onClose(1006,"Could not start streaming",!1)})}},m.prototype.closeStream=function(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)},m}();function we(m){var p=/([^\?]*)\/*(\??.*)/.exec(m);return{base:p[1],queryString:p[2]}}function iu(m,p){return m.base+"/"+p+"/xhr_send"}function xe(m){var p=m.indexOf("?")===-1?"?":"&";return m+p+"t="+ +new Date+"&n="+_a++}function ru(m,p){var g=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(m);return g[1]+p+g[3]}function xs(m){return ft.randomInt(m)}function Sn(m){for(var p=[],g=0;g<m;g++)p.push(xs(32).toString(32));return p.join("")}var Tr=wa,Ss={getReceiveURL:function(m,p){return m.base+"/"+p+"/xhr_streaming"+m.queryString},onHeartbeat:function(m){m.sendRaw("[]")},sendHeartbeat:function(m){m.sendRaw("[]")},onFinished:function(m,p){m.onClose(1006,"Connection interrupted ("+p+")",!1)}},It=Ss,Tn={getReceiveURL:function(m,p){return m.base+"/"+p+"/xhr"+m.queryString},onHeartbeat:function(){},sendHeartbeat:function(m){m.sendRaw("[]")},onFinished:function(m,p){p===200?m.reconnect():m.onClose(1006,"Connection interrupted ("+p+")",!1)}},Ts=Tn,su={getRequest:function(m){var p=ft.getXHRAPI(),g=new p;return g.onreadystatechange=g.onprogress=function(){switch(g.readyState){case 3:g.responseText&&g.responseText.length>0&&m.onChunk(g.status,g.responseText);break;case 4:g.responseText&&g.responseText.length>0&&m.onChunk(g.status,g.responseText),m.emit("finished",g.status),m.close();break}},g},abortRequest:function(m){m.onreadystatechange=null,m.abort()}},Os=su,ou={createStreamingSocket:function(m){return this.createSocket(It,m)},createPollingSocket:function(m){return this.createSocket(Ts,m)},createSocket:function(m,p){return new Tr(m,p)},createXHR:function(m,p){return this.createRequest(Os,m,p)},createRequest:function(m,p,g){return new ya(m,p,g)}},xa=ou;xa.createXDR=function(m,p){return this.createRequest(va,m,p)};var au=xa,Sa={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:a,DependenciesReceivers:b,getDefaultStrategy:ee,Transports:Dl,transportConnectionInitializer:_s,HTTPFactory:au,TimelineTransport:os,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(m){var p=this;window.Pusher=m;var g=function(){p.onDocumentBody(m.ready)};window.JSON?g():_.load("json2",{},g)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:Q,jsonp:Qr}},onDocumentBody:function(m){var p=this;document.body?m():setTimeout(function(){p.onDocumentBody(m)},0)},createJSONPRequest:function(m,p){return new is(m,p)},createScriptRequest:function(m){return new es(m)},getLocalStorage:function(){try{return window.localStorage}catch{return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){var m=this.getXHRAPI();return new m},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return vr},createWebSocket:function(m){var p=this.getWebSocketAPI();return new p(m)},createSocketRequest:function(m,p){if(this.isXHRSupported())return this.HTTPFactory.createXHR(m,p);if(this.isXDRSupported(p.indexOf("https:")===0))return this.HTTPFactory.createXDR(m,p);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var m=this.getXHRAPI();return!!m&&new m().withCredentials!==void 0},isXDRSupported:function(m){var p=m?"https:":"http:",g=this.getProtocol();return!!window.XDomainRequest&&g===p},addUnloadListener:function(m){window.addEventListener!==void 0?window.addEventListener("unload",m,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",m)},removeUnloadListener:function(m){window.addEventListener!==void 0?window.removeEventListener("unload",m,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",m)},randomInt:function(m){var p=function(){var g=window.crypto||window.msCrypto,v=g.getRandomValues(new Uint32Array(1))[0];return v/Math.pow(2,32)};return Math.floor(p()*m)}},ft=Sa,On;(function(m){m[m.ERROR=3]="ERROR",m[m.INFO=6]="INFO",m[m.DEBUG=7]="DEBUG"})(On||(On={}));var Or=On,Ta=function(){function m(p,g,v){this.key=p,this.session=g,this.events=[],this.options=v||{},this.sent=0,this.uniqueID=0}return m.prototype.log=function(p,g){p<=this.options.level&&(this.events.push(zt({},g,{timestamp:Pt.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},m.prototype.error=function(p){this.log(Or.ERROR,p)},m.prototype.info=function(p){this.log(Or.INFO,p)},m.prototype.debug=function(p){this.log(Or.DEBUG,p)},m.prototype.isEmpty=function(){return this.events.length===0},m.prototype.send=function(p,g){var v=this,w=zt({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],p(w,function(O,F){O||v.sent++,g&&g(O,F)}),!0},m.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},m}(),Oa=Ta,Cs=function(){function m(p,g,v,w){this.name=p,this.priority=g,this.transport=v,this.options=w||{}}return m.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},m.prototype.connect=function(p,g){var v=this;if(this.isSupported()){if(this.priority<p)return ks(new D,g)}else return ks(new V,g);var w=!1,O=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),F=null,U=function(){O.unbind("initialized",U),O.connect()},J=function(){F=hn.createHandshake(O,function(Ze){w=!0,Wt(),g(null,Ze)})},G=function(Ze){Wt(),g(Ze)},et=function(){Wt();var Ze;Ze=Fn(O),g(new L(Ze))},Wt=function(){O.unbind("initialized",U),O.unbind("open",J),O.unbind("error",G),O.unbind("closed",et)};return O.bind("initialized",U),O.bind("open",J),O.bind("error",G),O.bind("closed",et),O.initialize(),{abort:function(){w||(Wt(),F?F.close():O.close())},forceMinPriority:function(Ze){w||v.priority<Ze&&(F?F.close():O.close())}}},m}(),As=Cs;function ks(m,p){return Pt.defer(function(){p(m)}),{abort:function(){},forceMinPriority:function(){}}}var cu=ft.Transports,Es=function(m,p,g,v,w,O){var F=cu[g];if(!F)throw new W(g);var U=(!m.enabledTransports||un(m.enabledTransports,p)!==-1)&&(!m.disabledTransports||un(m.disabledTransports,p)===-1),J;return U?(w=Object.assign({ignoreNullOrigin:m.ignoreNullOrigin},w),J=new As(p,v,O?O.getAssistant(F):F,w)):J=Ps,J},Ps={isSupported:function(){return!1},connect:function(m,p){var g=Pt.defer(function(){p(new V)});return{abort:function(){g.ensureAborted()},forceMinPriority:function(){}}}},lu=function(m,p){var g="socket_id="+encodeURIComponent(m.socketId);for(var v in p.params)g+="&"+encodeURIComponent(v)+"="+encodeURIComponent(p.params[v]);if(p.paramsProvider!=null){var w=p.paramsProvider();for(var v in w)g+="&"+encodeURIComponent(v)+"="+encodeURIComponent(w[v])}return g},Ca=function(m){if(typeof ft.getAuthorizers()[m.transport]>"u")throw"'"+m.transport+"' is not a recognized auth transport";return function(p,g){var v=lu(p,m);ft.getAuthorizers()[m.transport](ft,v,m,T.UserAuthentication,g)}},Se=Ca,Ms=function(m,p){var g="socket_id="+encodeURIComponent(m.socketId);g+="&channel_name="+encodeURIComponent(m.channelName);for(var v in p.params)g+="&"+encodeURIComponent(v)+"="+encodeURIComponent(p.params[v]);if(p.paramsProvider!=null){var w=p.paramsProvider();for(var v in w)g+="&"+encodeURIComponent(v)+"="+encodeURIComponent(w[v])}return g},Ii=function(m){if(typeof ft.getAuthorizers()[m.transport]>"u")throw"'"+m.transport+"' is not a recognized auth transport";return function(p,g){var v=Ms(p,m);ft.getAuthorizers()[m.transport](ft,v,m,T.ChannelAuthorization,g)}},Aa=Ii,ka=function(m,p,g){var v={authTransport:p.transport,authEndpoint:p.endpoint,auth:{params:p.params,headers:p.headers}};return function(w,O){var F=m.channel(w.channelName),U=g(F,v);U.authorize(w.socketId,O)}},fi=function(){return fi=Object.assign||function(m){for(var p,g=1,v=arguments.length;g<v;g++){p=arguments[g];for(var w in p)Object.prototype.hasOwnProperty.call(p,w)&&(m[w]=p[w])}return m},fi.apply(this,arguments)};function uu(m,p){var g={activityTimeout:m.activityTimeout||u.activityTimeout,cluster:m.cluster||u.cluster,httpPath:m.httpPath||u.httpPath,httpPort:m.httpPort||u.httpPort,httpsPort:m.httpsPort||u.httpsPort,pongTimeout:m.pongTimeout||u.pongTimeout,statsHost:m.statsHost||u.stats_host,unavailableTimeout:m.unavailableTimeout||u.unavailableTimeout,wsPath:m.wsPath||u.wsPath,wsPort:m.wsPort||u.wsPort,wssPort:m.wssPort||u.wssPort,enableStats:du(m),httpHost:hu(m),useTLS:di(m),wsHost:fu(m),userAuthenticator:pu(m),channelAuthorizer:Pa(m,p)};return"disabledTransports"in m&&(g.disabledTransports=m.disabledTransports),"enabledTransports"in m&&(g.enabledTransports=m.enabledTransports),"ignoreNullOrigin"in m&&(g.ignoreNullOrigin=m.ignoreNullOrigin),"timelineParams"in m&&(g.timelineParams=m.timelineParams),"nacl"in m&&(g.nacl=m.nacl),g}function hu(m){return m.httpHost?m.httpHost:m.cluster?"sockjs-"+m.cluster+".pusher.com":u.httpHost}function fu(m){return m.wsHost?m.wsHost:m.cluster?Ea(m.cluster):Ea(u.cluster)}function Ea(m){return"ws-"+m+".pusher.com"}function di(m){return ft.getProtocol()==="https:"?!0:m.forceTLS!==!1}function du(m){return"enableStats"in m?m.enableStats:"disableStats"in m?!m.disableStats:!1}function pu(m){var p=fi(fi({},u.userAuthentication),m.userAuthentication);return"customHandler"in p&&p.customHandler!=null?p.customHandler:Se(p)}function Rs(m,p){var g;return"channelAuthorization"in m?g=fi(fi({},u.channelAuthorization),m.channelAuthorization):(g={transport:m.authTransport||u.authTransport,endpoint:m.authEndpoint||u.authEndpoint},"auth"in m&&("params"in m.auth&&(g.params=m.auth.params),"headers"in m.auth&&(g.headers=m.auth.headers)),"authorizer"in m&&(g.customHandler=ka(p,g,m.authorizer))),g}function Pa(m,p){var g=Rs(m,p);return"customHandler"in g&&g.customHandler!=null?g.customHandler:Aa(g)}var Cn=function(){var m=function(p,g){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var O in w)w.hasOwnProperty(O)&&(v[O]=w[O])},m(p,g)};return function(p,g){m(p,g);function v(){this.constructor=p}p.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}(),Cr=function(m){Cn(p,m);function p(g){var v=m.call(this,function(w,O){Tt.debug("No callbacks on watchlist events for "+w)})||this;return v.pusher=g,v.bindWatchlistInternalEvent(),v}return p.prototype.handleEvent=function(g){var v=this;g.data.events.forEach(function(w){v.emit(w.name,w)})},p.prototype.bindWatchlistInternalEvent=function(){var g=this;this.pusher.connection.bind("message",function(v){var w=v.event;w==="pusher_internal:watchlist_events"&&g.handleEvent(v)})},p}(Je),gu=Cr;function mu(){var m,p,g=new Promise(function(v,w){m=v,p=w});return{promise:g,resolve:m,reject:p}}var vu=mu,pi=function(){var m=function(p,g){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var O in w)w.hasOwnProperty(O)&&(v[O]=w[O])},m(p,g)};return function(p,g){m(p,g);function v(){this.constructor=p}p.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}(),Ve=function(m){pi(p,m);function p(g){var v=m.call(this,function(w,O){Tt.debug("No callbacks on user for "+w)})||this;return v.signin_requested=!1,v.user_data=null,v.serverToUserChannel=null,v.signinDonePromise=null,v._signinDoneResolve=null,v._onAuthorize=function(w,O){if(w){Tt.warn("Error during signin: "+w),v._cleanup();return}v.pusher.send_event("pusher:signin",{auth:O.auth,user_data:O.user_data})},v.pusher=g,v.pusher.connection.bind("state_change",function(w){var O=w.previous,F=w.current;O!=="connected"&&F==="connected"&&v._signin(),O==="connected"&&F!=="connected"&&(v._cleanup(),v._newSigninPromiseIfNeeded())}),v.watchlist=new gu(g),v.pusher.connection.bind("message",function(w){var O=w.event;O==="pusher:signin_success"&&v._onSigninSuccess(w.data),v.serverToUserChannel&&v.serverToUserChannel.name===w.channel&&v.serverToUserChannel.handleEvent(w)}),v}return p.prototype.signin=function(){this.signin_requested||(this.signin_requested=!0,this._signin())},p.prototype._signin=function(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))},p.prototype._onSigninSuccess=function(g){try{this.user_data=JSON.parse(g.user_data)}catch{Tt.error("Failed parsing user data after signin: "+g.user_data),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){Tt.error("user_data doesn't contain an id. user_data: "+this.user_data),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()},p.prototype._subscribeChannels=function(){var g=this,v=function(w){w.subscriptionPending&&w.subscriptionCancelled?w.reinstateSubscription():!w.subscriptionPending&&g.pusher.connection.state==="connected"&&w.subscribe()};this.serverToUserChannel=new yr("#server-to-user-"+this.user_data.id,this.pusher),this.serverToUserChannel.bind_global(function(w,O){w.indexOf("pusher_internal:")===0||w.indexOf("pusher:")===0||g.emit(w,O)}),v(this.serverToUserChannel)},p.prototype._cleanup=function(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()},p.prototype._newSigninPromiseIfNeeded=function(){if(this.signin_requested&&!(this.signinDonePromise&&!this.signinDonePromise.done)){var g=vu(),v=g.promise,w=g.resolve;v.done=!1;var O=function(){v.done=!0};v.then(O).catch(O),this.signinDonePromise=v,this._signinDoneResolve=w}},p}(Je),Ma=Ve,Ra=function(){function m(p,g){var v=this;if(bu(p),g=g||{},!g.cluster&&!(g.wsHost||g.httpHost)){var w=C.buildLogSuffix("javascriptQuickStart");Tt.warn("You should always specify a cluster when connecting. "+w)}"disableStats"in g&&Tt.warn("The disableStats option is deprecated in favor of enableStats"),this.key=p,this.config=uu(g,this),this.channels=hn.createChannels(),this.global_emitter=new Je,this.sessionID=ft.randomInt(1e9),this.timeline=new Oa(this.key,this.sessionID,{cluster:this.config.cluster,features:m.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Or.INFO,version:u.VERSION}),this.config.enableStats&&(this.timelineSender=hn.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+ft.TimelineTransport.name}));var O=function(F){return ft.getDefaultStrategy(v.config,F,Es)};this.connection=hn.createConnectionManager(this.key,{getStrategy:O,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",function(){v.subscribeAll(),v.timelineSender&&v.timelineSender.send(v.connection.isUsingTLS())}),this.connection.bind("message",function(F){var U=F.event,J=U.indexOf("pusher_internal:")===0;if(F.channel){var G=v.channel(F.channel);G&&G.handleEvent(F)}J||v.global_emitter.emit(F.event,F.data)}),this.connection.bind("connecting",function(){v.channels.disconnect()}),this.connection.bind("disconnected",function(){v.channels.disconnect()}),this.connection.bind("error",function(F){Tt.warn(F)}),m.instances.push(this),this.timeline.info({instances:m.instances.length}),this.user=new Ma(this),m.isReady&&this.connect()}return m.ready=function(){m.isReady=!0;for(var p=0,g=m.instances.length;p<g;p++)m.instances[p].connect()},m.getClientFeatures=function(){return ci(gr({ws:ft.Transports.ws},function(p){return p.isSupported({})}))},m.prototype.channel=function(p){return this.channels.find(p)},m.prototype.allChannels=function(){return this.channels.all()},m.prototype.connect=function(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var p=this.connection.isUsingTLS(),g=this.timelineSender;this.timelineSenderTimer=new Qt(6e4,function(){g.send(p)})}},m.prototype.disconnect=function(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)},m.prototype.bind=function(p,g,v){return this.global_emitter.bind(p,g,v),this},m.prototype.unbind=function(p,g,v){return this.global_emitter.unbind(p,g,v),this},m.prototype.bind_global=function(p){return this.global_emitter.bind_global(p),this},m.prototype.unbind_global=function(p){return this.global_emitter.unbind_global(p),this},m.prototype.unbind_all=function(p){return this.global_emitter.unbind_all(),this},m.prototype.subscribeAll=function(){var p;for(p in this.channels.channels)this.channels.channels.hasOwnProperty(p)&&this.subscribe(p)},m.prototype.subscribe=function(p){var g=this.channels.add(p,this);return g.subscriptionPending&&g.subscriptionCancelled?g.reinstateSubscription():!g.subscriptionPending&&this.connection.state==="connected"&&g.subscribe(),g},m.prototype.unsubscribe=function(p){var g=this.channels.find(p);g&&g.subscriptionPending?g.cancelSubscription():(g=this.channels.remove(p),g&&g.subscribed&&g.unsubscribe())},m.prototype.send_event=function(p,g,v){return this.connection.send_event(p,g,v)},m.prototype.shouldUseTLS=function(){return this.config.useTLS},m.prototype.signin=function(){this.user.signin()},m.instances=[],m.isReady=!1,m.logToConsole=!1,m.Runtime=ft,m.ScriptReceivers=ft.ScriptReceivers,m.DependenciesReceivers=ft.DependenciesReceivers,m.auth_callbacks=ft.auth_callbacks,m}(),Ds=i.default=Ra;function bu(m){if(m==null)throw"You must pass your app key when you instantiate Pusher."}ft.setup(Ra)}])})}(Oh)),Oh.exports}var EC=kC();const PC=Jm(EC);/*!
|
||
* @kurkle/color v0.3.4
|
||
* https://github.com/kurkle/color#readme
|
||
* (c) 2024 Jukka Kurkela
|
||
* Released under the MIT License
|
||
*/function Uo(n){return n+.5|0}const wi=(n,t,e)=>Math.max(Math.min(n,e),t);function uo(n){return wi(Uo(n*2.55),0,255)}function Ci(n){return wi(Uo(n*255),0,255)}function ei(n){return wi(Uo(n/2.55)/100,0,1)}function kg(n){return wi(Uo(n*100),0,100)}const on={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},Jh=[..."0123456789ABCDEF"],MC=n=>Jh[n&15],RC=n=>Jh[(n&240)>>4]+Jh[n&15],bc=n=>(n&240)>>4===(n&15),DC=n=>bc(n.r)&&bc(n.g)&&bc(n.b)&&bc(n.a);function LC(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&on[n[1]]*17,g:255&on[n[2]]*17,b:255&on[n[3]]*17,a:t===5?on[n[4]]*17:255}:(t===7||t===9)&&(e={r:on[n[1]]<<4|on[n[2]],g:on[n[3]]<<4|on[n[4]],b:on[n[5]]<<4|on[n[6]],a:t===9?on[n[7]]<<4|on[n[8]]:255})),e}const IC=(n,t)=>n<255?t(n):"";function NC(n){var t=DC(n)?MC:RC;return n?"#"+t(n.r)+t(n.g)+t(n.b)+IC(n.a,t):void 0}const FC=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function qv(n,t,e){const i=t*Math.min(e,1-e),r=(s,a=(s+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function BC(n,t,e){const i=(r,s=(r+n/60)%6)=>e-e*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function HC(n,t,e){const i=qv(n,1,.5);let r;for(t+e>1&&(r=1/(t+e),t*=r,e*=r),r=0;r<3;r++)i[r]*=1-t-e,i[r]+=t;return i}function zC(n,t,e,i,r){return n===r?(t-e)/i+(t<e?6:0):t===r?(e-n)/i+2:(n-t)/i+4}function Ef(n){const e=n.r/255,i=n.g/255,r=n.b/255,s=Math.max(e,i,r),a=Math.min(e,i,r),l=(s+a)/2;let u,h,d;return s!==a&&(d=s-a,h=l>.5?d/(2-s-a):d/(s+a),u=zC(e,i,r,d,s),u=u*60+.5),[u|0,h||0,l]}function Pf(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Ci)}function Mf(n,t,e){return Pf(qv,n,t,e)}function WC(n,t,e){return Pf(HC,n,t,e)}function jC(n,t,e){return Pf(BC,n,t,e)}function $v(n){return(n%360+360)%360}function UC(n){const t=FC.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?uo(+t[5]):Ci(+t[5]));const r=$v(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=WC(r,s,a):t[1]==="hsv"?i=jC(r,s,a):i=Mf(r,s,a),{r:i[0],g:i[1],b:i[2],a:e}}function VC(n,t){var e=Ef(n);e[0]=$v(e[0]+t),e=Mf(e),n.r=e[0],n.g=e[1],n.b=e[2]}function qC(n){if(!n)return;const t=Ef(n),e=t[0],i=kg(t[1]),r=kg(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${ei(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const Eg={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"},Pg={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"};function $C(){const n={},t=Object.keys(Pg),e=Object.keys(Eg);let i,r,s,a,l;for(i=0;i<t.length;i++){for(a=l=t[i],r=0;r<e.length;r++)s=e[r],l=l.replace(s,Eg[s]);s=parseInt(Pg[a],16),n[l]=[s>>16&255,s>>8&255,s&255]}return n}let yc;function XC(n){yc||(yc=$C(),yc.transparent=[0,0,0,0]);const t=yc[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const YC=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function KC(n){const t=YC.exec(n);let e=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?uo(a):wi(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?uo(i):wi(i,0,255)),r=255&(t[4]?uo(r):wi(r,0,255)),s=255&(t[6]?uo(s):wi(s,0,255)),{r:i,g:r,b:s,a:e}}}function GC(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ei(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Ch=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Hr=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function JC(n,t,e){const i=Hr(ei(n.r)),r=Hr(ei(n.g)),s=Hr(ei(n.b));return{r:Ci(Ch(i+e*(Hr(ei(t.r))-i))),g:Ci(Ch(r+e*(Hr(ei(t.g))-r))),b:Ci(Ch(s+e*(Hr(ei(t.b))-s))),a:n.a+e*(t.a-n.a)}}function _c(n,t,e){if(n){let i=Ef(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Mf(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Xv(n,t){return n&&Object.assign(t||{},n)}function Mg(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Ci(n[3]))):(t=Xv(n,{r:0,g:0,b:0,a:1}),t.a=Ci(t.a)),t}function ZC(n){return n.charAt(0)==="r"?KC(n):UC(n)}class ko{constructor(t){if(t instanceof ko)return t;const e=typeof t;let i;e==="object"?i=Mg(t):e==="string"&&(i=LC(t)||XC(t)||ZC(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Xv(this._rgb);return t&&(t.a=ei(t.a)),t}set rgb(t){this._rgb=Mg(t)}rgbString(){return this._valid?GC(this._rgb):void 0}hexString(){return this._valid?NC(this._rgb):void 0}hslString(){return this._valid?qC(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let s;const a=e===s?.5:e,l=2*a-1,u=i.a-r.a,h=((l*u===-1?l:(l+u)/(1+l*u))+1)/2;s=1-h,i.r=255&h*i.r+s*r.r+.5,i.g=255&h*i.g+s*r.g+.5,i.b=255&h*i.b+s*r.b+.5,i.a=a*i.a+(1-a)*r.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=JC(this._rgb,t._rgb,e)),this}clone(){return new ko(this.rgb)}alpha(t){return this._rgb.a=Ci(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Uo(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return _c(this._rgb,2,t),this}darken(t){return _c(this._rgb,2,-t),this}saturate(t){return _c(this._rgb,1,t),this}desaturate(t){return _c(this._rgb,1,-t),this}rotate(t){return VC(this._rgb,t),this}}/*!
|
||
* Chart.js v4.5.0
|
||
* https://www.chartjs.org
|
||
* (c) 2025 Chart.js Contributors
|
||
* Released under the MIT License
|
||
*/function Zn(){}const QC=(()=>{let n=0;return()=>n++})();function _t(n){return n==null}function jt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function xt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Xt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Ke(n,t){return Xt(n)?n:t}function dt(n,t){return typeof n>"u"?t:n}const tA=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Yv=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Nt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Dt(n,t,e,i){let r,s,a;if(jt(n))for(s=n.length,r=0;r<s;r++)t.call(e,n[r],r);else if(xt(n))for(a=Object.keys(n),s=a.length,r=0;r<s;r++)t.call(e,n[a[r]],a[r])}function tl(n,t){let e,i,r,s;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],s=t[e],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function el(n){if(jt(n))return n.map(el);if(xt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=el(n[e[r]]);return t}return n}function Kv(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function eA(n,t,e,i){if(!Kv(n))return;const r=t[n],s=e[n];xt(r)&&xt(s)?Eo(r,s,i):t[n]=el(s)}function Eo(n,t,e){const i=jt(t)?t:[t],r=i.length;if(!xt(n))return n;e=e||{};const s=e.merger||eA;let a;for(let l=0;l<r;++l){if(a=i[l],!xt(a))continue;const u=Object.keys(a);for(let h=0,d=u.length;h<d;++h)s(u[h],n,a,e)}return n}function _o(n,t){return Eo(n,t,{merger:nA})}function nA(n,t,e){if(!Kv(n))return;const i=t[n],r=e[n];xt(i)&&xt(r)?_o(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=el(r))}const Rg={"":n=>n,x:n=>n.x,y:n=>n.y};function iA(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function rA(n){const t=iA(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Ai(n,t){return(Rg[t]||(Rg[t]=rA(t)))(n)}function Rf(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Po=n=>typeof n<"u",ki=n=>typeof n=="function",Dg=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function sA(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const At=Math.PI,Bt=2*At,oA=Bt+At,nl=Number.POSITIVE_INFINITY,aA=At/180,Gt=At/2,Ki=At/4,Lg=At*2/3,xi=Math.log10,Ln=Math.sign;function wo(n,t,e){return Math.abs(n-t)<e}function Ig(n){const t=Math.round(n);n=wo(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(xi(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function cA(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,s)=>r-s).pop(),t}function lA(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Xr(n){return!lA(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function uA(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Gv(n,t,e){let i,r,s;for(i=0,r=n.length;i<r;i++)s=n[i][e],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function mn(n){return n*(At/180)}function Df(n){return n*(180/At)}function Ng(n){if(!Xt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Jv(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let s=Math.atan2(i,e);return s<-.5*At&&(s+=Bt),{angle:s,distance:r}}function Zh(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function hA(n,t){return(n-t+oA)%Bt-At}function ge(n){return(n%Bt+Bt)%Bt}function Mo(n,t,e,i){const r=ge(n),s=ge(t),a=ge(e),l=ge(s-r),u=ge(a-r),h=ge(r-s),d=ge(r-a);return r===s||r===a||i&&s===a||l>u&&h<d}function ae(n,t,e){return Math.max(t,Math.min(e,n))}function fA(n){return ae(n,-32768,32767)}function ni(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Lf(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,e(s)?r=s:i=s;return{lo:r,hi:i}}const ii=(n,t,e,i)=>Lf(n,e,i?r=>{const s=n[r][t];return s<e||s===e&&n[r+1][t]===e}:r=>n[r][t]<e),dA=(n,t,e)=>Lf(n,e,i=>n[i][t]>=e);function pA(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const Zv=["push","pop","shift","splice","unshift"];function gA(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Zv.forEach(e=>{const i="_onData"+Rf(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return n._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),a}})})}function Fg(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Zv.forEach(s=>{delete n[s]}),delete n._chartjs)}function Qv(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const tb=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function eb(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,tb.call(window,()=>{i=!1,n.apply(t,e)}))}}function mA(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const If=n=>n==="start"?"left":n==="end"?"right":"center",pe=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,vA=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function nb(n,t,e){const i=t.length;let r=0,s=i;if(n._sorted){const{iScale:a,vScale:l,_parsed:u}=n,h=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,d=a.axis,{min:b,max:_,minDefined:x,maxDefined:S}=a.getUserBounds();if(x){if(r=Math.min(ii(u,d,b).lo,e?i:ii(t,d,a.getPixelForValue(b)).lo),h){const C=u.slice(0,r+1).reverse().findIndex(T=>!_t(T[l.axis]));r-=Math.max(0,C)}r=ae(r,0,i-1)}if(S){let C=Math.max(ii(u,a.axis,_,!0).hi+1,e?0:ii(t,d,a.getPixelForValue(_),!0).hi+1);if(h){const T=u.slice(C-1).findIndex(P=>!_t(P[l.axis]));C+=Math.max(0,T)}s=ae(C,r,i)-r}else s=i-r}return{start:r,count:s}}function ib(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),s}const wc=n=>n===0||n===1,Bg=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Bt/e)),Hg=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Bt/e)+1,xo={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Gt)+1,easeOutSine:n=>Math.sin(n*Gt),easeInOutSine:n=>-.5*(Math.cos(At*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>wc(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>wc(n)?n:Bg(n,.075,.3),easeOutElastic:n=>wc(n)?n:Hg(n,.075,.3),easeInOutElastic(n){return wc(n)?n:n<.5?.5*Bg(n*2,.1125,.45):.5+.5*Hg(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-xo.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?xo.easeInBounce(n*2)*.5:xo.easeOutBounce(n*2-1)*.5+.5};function Nf(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function zg(n){return Nf(n)?n:new ko(n)}function Ah(n){return Nf(n)?n:new ko(n).saturate(.5).darken(.1).hexString()}const bA=["x","y","borderWidth","radius","tension"],yA=["color","borderColor","backgroundColor"];function _A(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:yA},numbers:{type:"number",properties:bA}}),n.describe("animations",{_fallback:"animation"}),n.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:t=>t|0}}}})}function wA(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Wg=new Map;function xA(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Wg.get(e);return i||(i=new Intl.NumberFormat(n,t),Wg.set(e,i)),i}function Vo(n,t,e){return xA(t,e).format(n)}const rb={values(n){return jt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,s=n;if(e.length>1){const h=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(h<1e-4||h>1e15)&&(r="scientific"),s=SA(n,e)}const a=xi(Math.abs(s)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),u={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(u,this.options.ticks.format),Vo(n,i,u)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(xi(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?rb.numeric.call(this,n,t,e):""}};function SA(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var pl={formatters:rb};function TA(n){n.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:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.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:pl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const fr=Object.create(null),Qh=Object.create(null);function So(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const s=e[i];n=n[s]||(n[s]=Object.create(null))}return n}function kh(n,t,e){return typeof t=="string"?Eo(So(n,t),e):Eo(So(n,""),t)}class OA{constructor(t,e){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=i=>i.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={},this.hoverBackgroundColor=(i,r)=>Ah(r.backgroundColor),this.hoverBorderColor=(i,r)=>Ah(r.borderColor),this.hoverColor=(i,r)=>Ah(r.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(t),this.apply(e)}set(t,e){return kh(this,t,e)}get(t){return So(this,t)}describe(t,e){return kh(Qh,t,e)}override(t,e){return kh(fr,t,e)}route(t,e,i,r){const s=So(this,t),a=So(this,i),l="_"+e;Object.defineProperties(s,{[l]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const u=this[l],h=a[r];return xt(u)?Object.assign({},h,u):dt(u,h)},set(u){this[l]=u}}})}apply(t){t.forEach(e=>e(this))}}var Ut=new OA({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[_A,wA,TA]);function CA(n){return!n||_t(n.size)||_t(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function il(n,t,e,i,r){let s=t[r];return s||(s=t[r]=n.measureText(r).width,e.push(r)),s>i&&(i=s),i}function AA(n,t,e,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let a=0;const l=e.length;let u,h,d,b,_;for(u=0;u<l;u++)if(b=e[u],b!=null&&!jt(b))a=il(n,r,s,a,b);else if(jt(b))for(h=0,d=b.length;h<d;h++)_=b[h],_!=null&&!jt(_)&&(a=il(n,r,s,a,_));n.restore();const x=s.length/2;if(x>e.length){for(u=0;u<x;u++)delete r[s[u]];s.splice(0,x)}return a}function Gi(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function jg(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function tf(n,t,e,i){sb(n,t,e,i,null)}function sb(n,t,e,i,r){let s,a,l,u,h,d,b,_;const x=t.pointStyle,S=t.rotation,C=t.radius;let T=(S||0)*aA;if(x&&typeof x=="object"&&(s=x.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(T),n.drawImage(x,-x.width/2,-x.height/2,x.width,x.height),n.restore();return}if(!(isNaN(C)||C<=0)){switch(n.beginPath(),x){default:r?n.ellipse(e,i,r/2,C,0,0,Bt):n.arc(e,i,C,0,Bt),n.closePath();break;case"triangle":d=r?r/2:C,n.moveTo(e+Math.sin(T)*d,i-Math.cos(T)*C),T+=Lg,n.lineTo(e+Math.sin(T)*d,i-Math.cos(T)*C),T+=Lg,n.lineTo(e+Math.sin(T)*d,i-Math.cos(T)*C),n.closePath();break;case"rectRounded":h=C*.516,u=C-h,a=Math.cos(T+Ki)*u,b=Math.cos(T+Ki)*(r?r/2-h:u),l=Math.sin(T+Ki)*u,_=Math.sin(T+Ki)*(r?r/2-h:u),n.arc(e-b,i-l,h,T-At,T-Gt),n.arc(e+_,i-a,h,T-Gt,T),n.arc(e+b,i+l,h,T,T+Gt),n.arc(e-_,i+a,h,T+Gt,T+At),n.closePath();break;case"rect":if(!S){u=Math.SQRT1_2*C,d=r?r/2:u,n.rect(e-d,i-u,2*d,2*u);break}T+=Ki;case"rectRot":b=Math.cos(T)*(r?r/2:C),a=Math.cos(T)*C,l=Math.sin(T)*C,_=Math.sin(T)*(r?r/2:C),n.moveTo(e-b,i-l),n.lineTo(e+_,i-a),n.lineTo(e+b,i+l),n.lineTo(e-_,i+a),n.closePath();break;case"crossRot":T+=Ki;case"cross":b=Math.cos(T)*(r?r/2:C),a=Math.cos(T)*C,l=Math.sin(T)*C,_=Math.sin(T)*(r?r/2:C),n.moveTo(e-b,i-l),n.lineTo(e+b,i+l),n.moveTo(e+_,i-a),n.lineTo(e-_,i+a);break;case"star":b=Math.cos(T)*(r?r/2:C),a=Math.cos(T)*C,l=Math.sin(T)*C,_=Math.sin(T)*(r?r/2:C),n.moveTo(e-b,i-l),n.lineTo(e+b,i+l),n.moveTo(e+_,i-a),n.lineTo(e-_,i+a),T+=Ki,b=Math.cos(T)*(r?r/2:C),a=Math.cos(T)*C,l=Math.sin(T)*C,_=Math.sin(T)*(r?r/2:C),n.moveTo(e-b,i-l),n.lineTo(e+b,i+l),n.moveTo(e+_,i-a),n.lineTo(e-_,i+a);break;case"line":a=r?r/2:Math.cos(T)*C,l=Math.sin(T)*C,n.moveTo(e-a,i-l),n.lineTo(e+a,i+l);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(T)*(r?r/2:C),i+Math.sin(T)*C);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function ri(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function gl(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function ml(n){n.restore()}function kA(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const s=(t.x+e.x)/2;n.lineTo(s,t.y),n.lineTo(s,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function EA(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function PA(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),_t(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function MA(n,t,e,i,r){if(r.strikethrough||r.underline){const s=n.measureText(i),a=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,u=e-s.actualBoundingBoxAscent,h=e+s.actualBoundingBoxDescent,d=r.strikethrough?(u+h)/2:h;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(a,d),n.lineTo(l,d),n.stroke()}}function RA(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function dr(n,t,e,i,r,s={}){const a=jt(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,h;for(n.save(),n.font=r.string,PA(n,s),u=0;u<a.length;++u)h=a[u],s.backdrop&&RA(n,s.backdrop),l&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),_t(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(h,e,i,s.maxWidth)),n.fillText(h,e,i,s.maxWidth),MA(n,e,i,h,s),i+=Number(r.lineHeight);n.restore()}function Ro(n,t){const{x:e,y:i,w:r,h:s,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*At,At,!0),n.lineTo(e,i+s-a.bottomLeft),n.arc(e+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,At,Gt,!0),n.lineTo(e+r-a.bottomRight,i+s),n.arc(e+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,Gt,0,!0),n.lineTo(e+r,i+a.topRight),n.arc(e+r-a.topRight,i+a.topRight,a.topRight,0,-Gt,!0),n.lineTo(e+a.topLeft,i)}const DA=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,LA=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function IA(n,t){const e=(""+n).match(DA);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const NA=n=>+n||0;function Ff(n,t){const e={},i=xt(t),r=i?Object.keys(t):t,s=xt(n)?i?a=>dt(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of r)e[a]=NA(s(a));return e}function ob(n){return Ff(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ar(n){return Ff(n,["topLeft","topRight","bottomLeft","bottomRight"])}function be(n){const t=ob(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function re(n,t){n=n||{},t=t||Ut.font;let e=dt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=dt(n.style,t.style);i&&!(""+i).match(LA)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:dt(n.family,t.family),lineHeight:IA(dt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:dt(n.weight,t.weight),string:""};return r.string=CA(r),r}function ho(n,t,e,i){let r,s,a;for(r=0,s=n.length;r<s;++r)if(a=n[r],a!==void 0&&a!==void 0)return a}function FA(n,t,e){const{min:i,max:r}=n,s=Yv(t,(r-i)/2),a=(l,u)=>e&&l===0?0:l+u;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Pi(n,t){return Object.assign(Object.create(n),t)}function Bf(n,t=[""],e,i,r=()=>n[0]){const s=e||n;typeof i>"u"&&(i=ub("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>Bf([l,...n],t,s,i)};return new Proxy(a,{deleteProperty(l,u){return delete l[u],delete l._keys,delete n[0][u],!0},get(l,u){return cb(l,u,()=>qA(u,t,n,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,u){return Vg(l).includes(u)},ownKeys(l){return Vg(l)},set(l,u,h){const d=l._storage||(l._storage=r());return l[u]=d[u]=h,delete l._keys,!0}})}function Yr(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:ab(n,i),setContext:s=>Yr(n,s,e,i),override:s=>Yr(n.override(s),t,e,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete n[a],!0},get(s,a,l){return cb(s,a,()=>HA(s,a,l))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(s,a,l){return n[a]=l,delete s[a],!0}})}function ab(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:ki(e)?e:()=>e,isIndexable:ki(i)?i:()=>i}}const BA=(n,t)=>n?n+Rf(t):t,Hf=(n,t)=>xt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function cb(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function HA(n,t,e){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=n;let l=i[t];return ki(l)&&a.isScriptable(t)&&(l=zA(t,l,n,e)),jt(l)&&l.length&&(l=WA(t,l,n,a.isIndexable)),Hf(t,l)&&(l=Yr(l,r,s&&s[t],a)),l}function zA(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_stack:l}=e;if(l.has(n))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+n);l.add(n);let u=t(s,a||i);return l.delete(n),Hf(n,u)&&(u=zf(r._scopes,r,n,u)),u}function WA(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:l}=e;if(typeof s.index<"u"&&i(n))return t[s.index%t.length];if(xt(t[0])){const u=t,h=r._scopes.filter(d=>d!==u);t=[];for(const d of u){const b=zf(h,r,n,d);t.push(Yr(b,s,a&&a[n],l))}}return t}function lb(n,t,e){return ki(n)?n(t,e):n}const jA=(n,t)=>n===!0?t:typeof n=="string"?Ai(t,n):void 0;function UA(n,t,e,i,r){for(const s of t){const a=jA(e,s);if(a){n.add(a);const l=lb(a._fallback,e,r);if(typeof l<"u"&&l!==e&&l!==i)return l}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function zf(n,t,e,i){const r=t._rootScopes,s=lb(t._fallback,e,i),a=[...n,...r],l=new Set;l.add(i);let u=Ug(l,a,e,s||e,i);return u===null||typeof s<"u"&&s!==e&&(u=Ug(l,a,s,u,i),u===null)?!1:Bf(Array.from(l),[""],r,s,()=>VA(t,e,i))}function Ug(n,t,e,i,r){for(;e;)e=UA(n,t,e,i,r);return e}function VA(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return jt(r)&&xt(e)?e:r||{}}function qA(n,t,e,i){let r;for(const s of t)if(r=ub(BA(s,n),e),typeof r<"u")return Hf(n,r)?zf(e,i,n,r):r}function ub(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Vg(n){let t=n._keys;return t||(t=n._keys=$A(n._scopes)),t}function $A(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function hb(n,t,e,i){const{iScale:r}=n,{key:s="r"}=this._parsing,a=new Array(i);let l,u,h,d;for(l=0,u=i;l<u;++l)h=l+e,d=t[h],a[l]={r:r.parse(Ai(d,s),h)};return a}const XA=Number.EPSILON||1e-14,Kr=(n,t)=>t<n.length&&!n[t].skip&&n[t],fb=n=>n==="x"?"y":"x";function YA(n,t,e,i){const r=n.skip?t:n,s=t,a=e.skip?t:e,l=Zh(s,r),u=Zh(a,s);let h=l/(l+u),d=u/(l+u);h=isNaN(h)?0:h,d=isNaN(d)?0:d;const b=i*h,_=i*d;return{previous:{x:s.x-b*(a.x-r.x),y:s.y-b*(a.y-r.y)},next:{x:s.x+_*(a.x-r.x),y:s.y+_*(a.y-r.y)}}}function KA(n,t,e){const i=n.length;let r,s,a,l,u,h=Kr(n,0);for(let d=0;d<i-1;++d)if(u=h,h=Kr(n,d+1),!(!u||!h)){if(wo(t[d],0,XA)){e[d]=e[d+1]=0;continue}r=e[d]/t[d],s=e[d+1]/t[d],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(a=3/Math.sqrt(l),e[d]=r*a*t[d],e[d+1]=s*a*t[d])}}function GA(n,t,e="x"){const i=fb(e),r=n.length;let s,a,l,u=Kr(n,0);for(let h=0;h<r;++h){if(a=l,l=u,u=Kr(n,h+1),!l)continue;const d=l[e],b=l[i];a&&(s=(d-a[e])/3,l[`cp1${e}`]=d-s,l[`cp1${i}`]=b-s*t[h]),u&&(s=(u[e]-d)/3,l[`cp2${e}`]=d+s,l[`cp2${i}`]=b+s*t[h])}}function JA(n,t="x"){const e=fb(t),i=n.length,r=Array(i).fill(0),s=Array(i);let a,l,u,h=Kr(n,0);for(a=0;a<i;++a)if(l=u,u=h,h=Kr(n,a+1),!!u){if(h){const d=h[t]-u[t];r[a]=d!==0?(h[e]-u[e])/d:0}s[a]=l?h?Ln(r[a-1])!==Ln(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}KA(n,r,s),GA(n,s,t)}function xc(n,t,e){return Math.max(Math.min(n,e),t)}function ZA(n,t){let e,i,r,s,a,l=ri(n[0],t);for(e=0,i=n.length;e<i;++e)a=s,s=l,l=e<i-1&&ri(n[e+1],t),s&&(r=n[e],a&&(r.cp1x=xc(r.cp1x,t.left,t.right),r.cp1y=xc(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=xc(r.cp2x,t.left,t.right),r.cp2y=xc(r.cp2y,t.top,t.bottom)))}function QA(n,t,e,i,r){let s,a,l,u;if(t.spanGaps&&(n=n.filter(h=>!h.skip)),t.cubicInterpolationMode==="monotone")JA(n,r);else{let h=i?n[n.length-1]:n[0];for(s=0,a=n.length;s<a;++s)l=n[s],u=YA(h,l,n[Math.min(s+1,a-(i?0:1))%a],t.tension),l.cp1x=u.previous.x,l.cp1y=u.previous.y,l.cp2x=u.next.x,l.cp2y=u.next.y,h=l}t.capBezierPoints&&ZA(n,e)}function Wf(){return typeof window<"u"&&typeof document<"u"}function jf(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function rl(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const vl=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function tk(n,t){return vl(n).getPropertyValue(t)}const ek=["top","right","bottom","left"];function cr(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const s=ek[r];i[s]=parseFloat(n[t+"-"+s+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const nk=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function ik(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(nk(r,s,n.target))l=r,u=s;else{const h=t.getBoundingClientRect();l=i.clientX-h.left,u=i.clientY-h.top,a=!0}return{x:l,y:u,box:a}}function tr(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=vl(e),s=r.boxSizing==="border-box",a=cr(r,"padding"),l=cr(r,"border","width"),{x:u,y:h,box:d}=ik(n,e),b=a.left+(d&&l.left),_=a.top+(d&&l.top);let{width:x,height:S}=t;return s&&(x-=a.width+l.width,S-=a.height+l.height),{x:Math.round((u-b)/x*e.width/i),y:Math.round((h-_)/S*e.height/i)}}function rk(n,t,e){let i,r;if(t===void 0||e===void 0){const s=n&&jf(n);if(!s)t=n.clientWidth,e=n.clientHeight;else{const a=s.getBoundingClientRect(),l=vl(s),u=cr(l,"border","width"),h=cr(l,"padding");t=a.width-h.width-u.width,e=a.height-h.height-u.height,i=rl(l.maxWidth,s,"clientWidth"),r=rl(l.maxHeight,s,"clientHeight")}}return{width:t,height:e,maxWidth:i||nl,maxHeight:r||nl}}const Sc=n=>Math.round(n*10)/10;function sk(n,t,e,i){const r=vl(n),s=cr(r,"margin"),a=rl(r.maxWidth,n,"clientWidth")||nl,l=rl(r.maxHeight,n,"clientHeight")||nl,u=rk(n,t,e);let{width:h,height:d}=u;if(r.boxSizing==="content-box"){const _=cr(r,"border","width"),x=cr(r,"padding");h-=x.width+_.width,d-=x.height+_.height}return h=Math.max(0,h-s.width),d=Math.max(0,i?h/i:d-s.height),h=Sc(Math.min(h,a,u.maxWidth)),d=Sc(Math.min(d,l,u.maxHeight)),h&&!d&&(d=Sc(h/2)),(t!==void 0||e!==void 0)&&i&&u.height&&d>u.height&&(d=u.height,h=Sc(Math.floor(d*i))),{width:h,height:d}}function qg(n,t,e){const i=t||1,r=Math.floor(n.height*i),s=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(n.currentDevicePixelRatio=i,a.height=r,a.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const ok=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Wf()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function $g(n,t){const e=tk(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function er(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function ak(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function ck(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},s={x:t.cp1x,y:t.cp1y},a=er(n,r,e),l=er(r,s,e),u=er(s,t,e),h=er(a,l,e),d=er(l,u,e);return er(h,d,e)}const lk=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},uk=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Wr(n,t,e){return n?lk(t,e):uk()}function db(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function pb(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function gb(n){return n==="angle"?{between:Mo,compare:hA,normalize:ge}:{between:ni,compare:(t,e)=>t-e,normalize:t=>t}}function Xg({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function hk(n,t,e){const{property:i,start:r,end:s}=e,{between:a,normalize:l}=gb(i),u=t.length;let{start:h,end:d,loop:b}=n,_,x;if(b){for(h+=u,d+=u,_=0,x=u;_<x&&a(l(t[h%u][i]),r,s);++_)h--,d--;h%=u,d%=u}return d<h&&(d+=u),{start:h,end:d,loop:b,style:n.style}}function mb(n,t,e){if(!e)return[n];const{property:i,start:r,end:s}=e,a=t.length,{compare:l,between:u,normalize:h}=gb(i),{start:d,end:b,loop:_,style:x}=hk(n,t,e),S=[];let C=!1,T=null,P,R,B;const H=()=>u(r,B,P)&&l(r,B)!==0,D=()=>l(s,P)===0||u(s,B,P),L=()=>C||H(),N=()=>!C||D();for(let W=d,V=d;W<=b;++W)R=t[W%a],!R.skip&&(P=h(R[i]),P!==B&&(C=u(P,r,s),T===null&&L()&&(T=l(P,r)===0?W:V),T!==null&&N()&&(S.push(Xg({start:T,end:W,loop:_,count:a,style:x})),T=null),V=W,B=P));return T!==null&&S.push(Xg({start:T,end:b,loop:_,count:a,style:x})),S}function vb(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const s=mb(i[r],n.points,t);s.length&&e.push(...s)}return e}function fk(n,t,e,i){let r=0,s=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(s+=r);s>r&&n[s%t].skip;)s--;return s%=t,{start:r,end:s}}function dk(n,t,e,i){const r=n.length,s=[];let a=t,l=n[t],u;for(u=t+1;u<=e;++u){const h=n[u%r];h.skip||h.stop?l.skip||(i=!1,s.push({start:t%r,end:(u-1)%r,loop:i}),t=a=h.stop?u:null):(a=u,l.skip&&(t=u)),l=h}return a!==null&&s.push({start:t%r,end:a%r,loop:i}),s}function pk(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const s=!!n._loop,{start:a,end:l}=fk(e,r,s,i);if(i===!0)return Yg(n,[{start:a,end:l,loop:s}],e,t);const u=l<a?l+r:l,h=!!n._fullLoop&&a===0&&l===r-1;return Yg(n,dk(e,a,u,h),e,t)}function Yg(n,t,e,i){return!i||!i.setContext||!e?t:gk(n,t,e,i)}function gk(n,t,e,i){const r=n._chart.getContext(),s=Kg(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,u=e.length,h=[];let d=s,b=t[0].start,_=b;function x(S,C,T,P){const R=l?-1:1;if(S!==C){for(S+=u;e[S%u].skip;)S-=R;for(;e[C%u].skip;)C+=R;S%u!==C%u&&(h.push({start:S%u,end:C%u,loop:T,style:P}),d=P,b=C%u)}}for(const S of t){b=l?b:S.start;let C=e[b%u],T;for(_=b+1;_<=S.end;_++){const P=e[_%u];T=Kg(i.setContext(Pi(r,{type:"segment",p0:C,p1:P,p0DataIndex:(_-1)%u,p1DataIndex:_%u,datasetIndex:a}))),mk(T,d)&&x(b,_-1,S.loop,d),C=P,d=T}b<_-1&&x(b,_-1,S.loop,d)}return h}function Kg(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function mk(n,t){if(!t)return!1;const e=[],i=function(r,s){return Nf(s)?(e.includes(s)||e.push(s),e.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function Tc(n,t,e){return n.options.clip?n[e]:t[e]}function vk(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Tc(e,t,"left"),right:Tc(e,t,"right"),top:Tc(i,t,"top"),bottom:Tc(i,t,"bottom")}:t}function bb(n,t){const e=t._clip;if(e.disabled)return!1;const i=vk(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}/*!
|
||
* Chart.js v4.5.0
|
||
* https://www.chartjs.org
|
||
* (c) 2025 Chart.js Contributors
|
||
* Released under the MIT License
|
||
*/class bk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const s=e.listeners[r],a=e.duration;s.forEach(l=>l({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=tb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let a=s.length-1,l=!1,u;for(;a>=0;--a)u=s[a],u._active?(u._total>i.duration&&(i.duration=u._total),u.tick(t),l=!0):(s[a]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Qn=new bk;const Gg="transparent",yk={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=zg(n||Gg),r=i.valid&&zg(t||Gg);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class _k{constructor(t,e,i,r){const s=e[i];r=ho([t.to,r,s,t.from]);const a=ho([t.from,s,r]);this._active=!0,this._fn=t.fn||yk[t.type||typeof a],this._easing=xo[t.easing]||xo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,a=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=ho([t.to,e,r,t.from]),this._from=ho([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,s=this._from,a=this._loop,l=this._to;let u;if(this._active=s!==l&&(a||e<i),!this._active){this._target[r]=l,this._notify(!0);return}if(e<0){this._target[r]=s;return}u=e/i%2,u=a&&u>1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[r]=this._fn(s,l,u)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][e]()}}class yb{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!xt(t))return;const e=Object.keys(Ut.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!xt(s))return;const a={};for(const l of e)a[l]=s[l];(jt(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,e){const i=e.options,r=xk(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&wk(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(e),l=Date.now();let u;for(u=a.length-1;u>=0;--u){const h=a[u];if(h.charAt(0)==="$")continue;if(h==="options"){r.push(...this._animateOptions(t,e));continue}const d=e[h];let b=s[h];const _=i.get(h);if(b)if(_&&b.active()){b.update(_,d,l);continue}else b.cancel();if(!_||!_.duration){t[h]=d;continue}s[h]=b=new _k(_,t,h,d),r.push(b)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return Qn.add(this._chart,i),!0}}function wk(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=n[i[r]];s&&s.active()&&e.push(s.wait())}return Promise.all(e)}function xk(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Jg(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,s=e.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function Sk(n,t,e){if(e===!1)return!1;const i=Jg(n,e),r=Jg(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function Tk(n){let t,e,i,r;return xt(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function _b(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)e.push(i[r].index);return e}function Zg(n,t,e,i={}){const r=n.keys,s=i.mode==="single";let a,l,u,h;if(t===null)return;let d=!1;for(a=0,l=r.length;a<l;++a){if(u=+r[a],u===e){if(d=!0,i.all)continue;break}h=n.values[u],Xt(h)&&(s||t===0||Ln(t)===Ln(h))&&(t+=h)}return!d&&!i.all?0:t}function Ok(n,t){const{iScale:e,vScale:i}=t,r=e.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(n),l=new Array(a.length);let u,h,d;for(u=0,h=a.length;u<h;++u)d=a[u],l[u]={[r]:d,[s]:n[d]};return l}function Eh(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Ck(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function Ak(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function kk(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Qg(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=n[r.index];if(e&&s>0||!e&&s<0)return r.index}return null}function tm(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:s,vScale:a,index:l}=i,u=s.axis,h=a.axis,d=Ck(s,a,i),b=t.length;let _;for(let x=0;x<b;++x){const S=t[x],{[u]:C,[h]:T}=S,P=S._stacks||(S._stacks={});_=P[h]=kk(r,d,C),_[l]=T,_._top=Qg(_,a,!0,i.type),_._bottom=Qg(_,a,!1,i.type);const R=_._visualValues||(_._visualValues={});R[l]=T}}function Ph(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Ek(n,t){return Pi(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Pk(n,t,e){return Pi(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function no(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][e]===void 0)return;delete s[i][e],s[i]._visualValues!==void 0&&s[i]._visualValues[e]!==void 0&&delete s[i]._visualValues[e]}}}const Mh=n=>n==="reset"||n==="none",em=(n,t)=>t?n:Object.assign({},n),Mk=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:_b(e,!0),values:null};class vn{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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 t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Eh(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&no(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(b,_,x,S)=>b==="x"?_:b==="r"?S:x,s=e.xAxisID=dt(i.xAxisID,Ph(t,"x")),a=e.yAxisID=dt(i.yAxisID,Ph(t,"y")),l=e.rAxisID=dt(i.rAxisID,Ph(t,"r")),u=e.indexAxis,h=e.iAxisID=r(u,s,a,l),d=e.vAxisID=r(u,a,s,l);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(l),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Fg(this._data,this),t._stacked&&no(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(xt(e)){const r=this._cachedMeta;this._data=Ok(e,r)}else if(i!==e){if(i){Fg(i,this);const r=this._cachedMeta;no(r),r._parsed=[]}e&&Object.isExtensible(e)&&gA(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=e._stacked;e._stacked=Eh(e.vScale,e),e.stack!==i.stack&&(r=!0,no(e),e.stack=i.stack),this._resyncElements(t),(r||s!==e._stacked)&&(tm(this,e._parsed),e._stacked=Eh(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,l=s.axis;let u=t===0&&e===r.length?!0:i._sorted,h=t>0&&i._parsed[t-1],d,b,_;if(this._parsing===!1)i._parsed=r,i._sorted=!0,_=r;else{jt(r[t])?_=this.parseArrayData(i,r,t,e):xt(r[t])?_=this.parseObjectData(i,r,t,e):_=this.parsePrimitiveData(i,r,t,e);const x=()=>b[l]===null||h&&b[l]<h[l];for(d=0;d<e;++d)i._parsed[d+t]=b=_[d],u&&(x()&&(u=!1),h=b);i._sorted=u}a&&tm(this,_)}parsePrimitiveData(t,e,i,r){const{iScale:s,vScale:a}=t,l=s.axis,u=a.axis,h=s.getLabels(),d=s===a,b=new Array(r);let _,x,S;for(_=0,x=r;_<x;++_)S=_+i,b[_]={[l]:d||s.parse(h[S],S),[u]:a.parse(e[S],S)};return b}parseArrayData(t,e,i,r){const{xScale:s,yScale:a}=t,l=new Array(r);let u,h,d,b;for(u=0,h=r;u<h;++u)d=u+i,b=e[d],l[u]={x:s.parse(b[0],d),y:a.parse(b[1],d)};return l}parseObjectData(t,e,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,h=new Array(r);let d,b,_,x;for(d=0,b=r;d<b;++d)_=d+i,x=e[_],h[d]={x:s.parse(Ai(x,l),_),y:a.parse(Ai(x,u),_)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,s=this._cachedMeta,a=e[t.axis],l={keys:_b(r,!0),values:e._stacks[t.axis]._visualValues};return Zg(l,a,s.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const s=i[e.axis];let a=s===null?NaN:s;const l=r&&i._stacks[e.axis];r&&l&&(r.values=l,a=Zg(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,l=this._getOtherScale(t),u=Mk(e,i,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:b}=Ak(l);let _,x;function S(){x=r[_];const C=x[l.axis];return!Xt(x[t.axis])||d>C||b<C}for(_=0;_<a&&!(!S()&&(this.updateRangeFromParsed(h,t,x,u),s));++_);if(s){for(_=a-1;_>=0;--_)if(!S()){this.updateRangeFromParsed(h,t,x,u);break}}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=e.length;r<s;++r)a=e[r][t.axis],Xt(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Tk(dt(this.options.clip,Sk(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],s=e.chartArea,a=[],l=this._drawStart||0,u=this._drawCount||r.length-l,h=this.options.drawActiveElementsOnTop;let d;for(i.dataset&&i.dataset.draw(t,s,l,u),d=l;d<l+u;++d){const b=r[d];b.hidden||(b.active&&h?a.push(b):b.draw(t,s))}for(d=0;d<a.length;++d)a[d].draw(t,s)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];s=a.$context||(a.$context=Pk(this.getContext(),t,a)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=Ek(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const r=e==="active",s=this._cachedDataOpts,a=t+"-"+e,l=s[a],u=this.enableOptionSharing&&Po(i);if(l)return em(l,u);const h=this.chart.config,d=h.datasetElementScopeKeys(this._type,t),b=r?[`${t}Hover`,"hover",t,""]:[t,""],_=h.getOptionScopes(this.getDataset(),d),x=Object.keys(Ut.elements[t]),S=()=>this.getContext(i,r,e),C=h.resolveNamedOptions(_,x,S,b);return C.$shared&&(C.$shared=u,s[a]=Object.freeze(em(C,u))),C}_resolveAnimations(t,e,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${e}`,l=s[a];if(l)return l;let u;if(r.options.animation!==!1){const d=this.chart.config,b=d.datasetAnimationScopeKeys(this._type,e),_=d.getOptionScopes(this.getDataset(),b);u=d.createResolver(_,this.getContext(t,i,e))}const h=new yb(r,u&&u.animations);return u&&u._cacheable&&(s[a]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Mh(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(e,s)||s!==r;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:a}}updateElement(t,e,i,r){Mh(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!Mh(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const s=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[l,u,h]of this._syncList)this[l](u,h);this._syncList=[];const r=i.length,s=e.length,a=Math.min(s,r);a&&this.parse(0,a),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,e,i=!0){const r=this._cachedMeta,s=r.data,a=t+e;let l;const u=h=>{for(h.length+=e,l=h.length-1;l>=a;l--)h[l]=h[l-e]};for(u(s),l=t;l<a;++l)s[l]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&no(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](i,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Z(vn,"defaults",{}),Z(vn,"datasetElementType",null),Z(vn,"dataElementType",null);function Rk(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=e.length;r<s;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=Qv(i.sort((r,s)=>r-s))}return n._cache.$bar}function Dk(n){const t=n.iScale,e=Rk(t,n.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(Po(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(r=0,s=e.length;r<s;++r)a=t.getPixelForValue(e[r]),u();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),u();return i}function Lk(n,t,e,i){const r=e.barThickness;let s,a;return _t(r)?(s=t.min*e.categoryPercentage,a=e.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[n]-s/2}}function Ik(n,t,e,i){const r=t.pixels,s=r[n];let a=n>0?r[n-1]:null,l=n<r.length-1?r[n+1]:null;const u=e.categoryPercentage;a===null&&(a=s-(l===null?t.end-t.start:l-s)),l===null&&(l=s+s-a);const h=s-(s-Math.min(a,l))/2*u;return{chunk:Math.abs(l-a)/2*u/i,ratio:e.barPercentage,start:h}}function Nk(n,t,e,i){const r=e.parse(n[0],i),s=e.parse(n[1],i),a=Math.min(r,s),l=Math.max(r,s);let u=a,h=l;Math.abs(a)>Math.abs(l)&&(u=l,h=a),t[e.axis]=h,t._custom={barStart:u,barEnd:h,start:r,end:s,min:a,max:l}}function wb(n,t,e,i){return jt(n)?Nk(n,t,e,i):t[e.axis]=e.parse(n,i),t}function nm(n,t,e,i){const r=n.iScale,s=n.vScale,a=r.getLabels(),l=r===s,u=[];let h,d,b,_;for(h=e,d=e+i;h<d;++h)_=t[h],b={},b[r.axis]=l||r.parse(a[h],h),u.push(wb(_,b,s,h));return u}function Rh(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Fk(n,t,e){return n!==0?Ln(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Bk(n){let t,e,i,r,s;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:e,end:i,reverse:t,top:r,bottom:s}}function Hk(n,t,e,i){let r=t.borderSkipped;const s={};if(!r){n.borderSkipped=s;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:u,top:h,bottom:d}=Bk(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=h:(e._bottom||0)===i?r=d:(s[im(d,a,l,u)]=!0,r=h)),s[im(r,a,l,u)]=!0,n.borderSkipped=s}function im(n,t,e,i){return i?(n=zk(n,t,e),n=rm(n,e,t)):n=rm(n,t,e),n}function zk(n,t,e){return n===t?e:n===e?t:n}function rm(n,t,e){return n==="start"?t:n==="end"?e:n}function Wk(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Hc extends vn{parsePrimitiveData(t,e,i,r){return nm(t,e,i,r)}parseArrayData(t,e,i,r){return nm(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:s,vScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,h=s.axis==="x"?l:u,d=a.axis==="x"?l:u,b=[];let _,x,S,C;for(_=i,x=i+r;_<x;++_)C=e[_],S={},S[s.axis]=s.parse(Ai(C,h),_),b.push(wb(Ai(C,d),S,a,_));return b}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const s=i._custom;s&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,s=this.getParsed(t),a=s._custom,l=Rh(a)?"["+a.start+", "+a.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:l}}=this,u=l.getBasePixel(),h=l.isHorizontal(),d=this._getRuler(),{sharedOptions:b,includeOptions:_}=this._getSharedOptions(e,r);for(let x=e;x<e+i;x++){const S=this.getParsed(x),C=s||_t(S[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(x),T=this._calculateBarIndexPixels(x,d),P=(S._stacks||{})[l.axis],R={horizontal:h,base:C.base,enableBorderRadius:!P||Rh(S._custom)||a===P._top||a===P._bottom,x:h?C.head:T.center,y:h?T.center:C.head,height:h?T.size:Math.abs(C.size),width:h?Math.abs(C.size):T.size};_&&(R.options=b||this.resolveDataElementOptions(x,t[x].active?"active":r));const B=R.options||t[x].options;Hk(R,B,P,a),Wk(R,B,d.ratio),this.updateElement(t[x],x,R,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),s=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(e),u=l&&l[i.axis],h=d=>{const b=d._parsed.find(x=>x[i.axis]===u),_=b&&b[d.vScale.axis];if(_t(_)||isNaN(_))return!0};for(const d of r)if(!(e!==void 0&&h(d))&&((s===!1||a.indexOf(d.stack)===-1||s===void 0&&d.stack===void 0)&&a.push(d.stack),d.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[dt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const r=this._getStacks(t,i),s=e!==void 0?r.indexOf(e):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let s,a;for(s=0,a=e.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const l=t.barThickness;return{min:l||Dk(e),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,l=s||0,u=this.getParsed(t),h=u._custom,d=Rh(h);let b=u[e.axis],_=0,x=i?this.applyStack(e,u,i):b,S,C;x!==b&&(_=x-b,x=b),d&&(b=h.barStart,x=h.barEnd-h.barStart,b!==0&&Ln(b)!==Ln(h.barEnd)&&(_=0),_+=b);const T=!_t(s)&&!d?s:_;let P=e.getPixelForValue(T);if(this.chart.getDataVisibility(t)?S=e.getPixelForValue(_+x):S=P,C=S-P,Math.abs(C)<a){C=Fk(C,e,l)*a,b===l&&(P-=C/2);const R=e.getPixelForDecimal(0),B=e.getPixelForDecimal(1),H=Math.min(R,B),D=Math.max(R,B);P=Math.max(Math.min(P,D),H),S=P+C,i&&!d&&(u._stacks[e.axis]._visualValues[r]=e.getValueForPixel(S)-e.getValueForPixel(P))}if(P===e.getPixelForValue(l)){const R=Ln(C)*e.getLineWidthForValue(l)/2;P+=R,C-=R}return{size:C,base:P,head:S,center:S+C/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,s=r.skipNull,a=dt(r.maxBarThickness,1/0);let l,u;const h=this._getAxisCount();if(e.grouped){const d=s?this._getStackCount(t):e.stackCount,b=r.barThickness==="flex"?Ik(t,e,r,d*h):Lk(t,e,r,d*h),_=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,x=this._getAxis().indexOf(dt(_,this.getFirstScaleIdForIndexAxis())),S=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+x;l=b.start+b.chunk*S+b.chunk/2,u=Math.min(a,b.chunk*b.ratio)}else l=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(a,e.min*e.ratio);return{base:l-u/2,head:l+u/2,center:l,size:u}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[e.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}Z(Hc,"id","bar"),Z(Hc,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Z(Hc,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class zc extends vn{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,r){const s=super.parsePrimitiveData(t,e,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,e,i,r){const s=super.parseArrayData(t,e,i,r);for(let a=0;a<s.length;a++){const l=e[i+a];s[a]._custom=dt(l[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,e,i,r){const s=super.parseObjectData(t,e,i,r);for(let a=0;a<s.length;a++){const l=e[i+a];s[a]._custom=dt(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y),h=a._custom;return{label:i[t]||"",value:"("+l+", "+u+(h?", "+h:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(e,r),d=a.axis,b=l.axis;for(let _=e;_<e+i;_++){const x=t[_],S=!s&&this.getParsed(_),C={},T=C[d]=s?a.getPixelForDecimal(.5):a.getPixelForValue(S[d]),P=C[b]=s?l.getBasePixel():l.getPixelForValue(S[b]);C.skip=isNaN(T)||isNaN(P),h&&(C.options=u||this.resolveDataElementOptions(_,x.active?"active":r),s&&(C.options.radius=0)),this.updateElement(x,_,C,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return e!=="active"&&(r.radius=0),r.radius+=dt(i&&i._custom,s),r}}Z(zc,"id","bubble"),Z(zc,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Z(zc,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function jk(n,t,e){let i=1,r=1,s=0,a=0;if(t<Bt){const l=n,u=l+t,h=Math.cos(l),d=Math.sin(l),b=Math.cos(u),_=Math.sin(u),x=(B,H,D)=>Mo(B,l,u,!0)?1:Math.max(H,H*e,D,D*e),S=(B,H,D)=>Mo(B,l,u,!0)?-1:Math.min(H,H*e,D,D*e),C=x(0,h,b),T=x(Gt,d,_),P=S(At,h,b),R=S(At+Gt,d,_);i=(C-P)/2,r=(T-R)/2,s=-(C+P)/2,a=-(T+R)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class rr extends vn{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(xt(i[t])){const{key:u="value"}=this._parsing;s=h=>+Ai(i[h],u)}let a,l;for(a=t,l=t+e;a<l;++a)r._parsed[a]=s(a)}}_getRotation(){return mn(this.options.rotation-90)}_getCircumference(){return mn(this.options.circumference)}_getRotationExtents(){let t=Bt,e=-Bt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,s=r._getRotation(),a=r._getCircumference();t=Math.min(t,s),e=Math.max(e,s+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,s=r.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(i.width,i.height)-a)/2,0),u=Math.min(tA(this.options.cutout,l),1),h=this._getRingWeight(this.index),{circumference:d,rotation:b}=this._getRotationExtents(),{ratioX:_,ratioY:x,offsetX:S,offsetY:C}=jk(b,d,u),T=(i.width-a)/_,P=(i.height-a)/x,R=Math.max(Math.min(T,P)/2,0),B=Yv(this.options.radius,R),H=Math.max(B*u,0),D=(B-H)/this._getVisibleDatasetWeightTotal();this.offsetX=S*B,this.offsetY=C*B,r.total=this.calculateTotal(),this.outerRadius=B-D*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-D*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/Bt)}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,l=a.chartArea,h=a.options.animation,d=(l.left+l.right)/2,b=(l.top+l.bottom)/2,_=s&&h.animateScale,x=_?0:this.innerRadius,S=_?0:this.outerRadius,{sharedOptions:C,includeOptions:T}=this._getSharedOptions(e,r);let P=this._getRotation(),R;for(R=0;R<e;++R)P+=this._circumference(R,s);for(R=e;R<e+i;++R){const B=this._circumference(R,s),H=t[R],D={x:d+this.offsetX,y:b+this.offsetY,startAngle:P,endAngle:P+B,circumference:B,outerRadius:S,innerRadius:x};T&&(D.options=C||this.resolveDataElementOptions(R,H.active?"active":r)),P+=B,this.updateElement(H,R,D,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Bt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Vo(e._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,s,a,l,u;if(!t){for(r=0,s=i.data.datasets.length;r<s;++r)if(i.isDatasetVisible(r)){a=i.getDatasetMeta(r),t=a.data,l=a.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)u=l.resolveDataElementOptions(r),u.borderAlign!=="inner"&&(e=Math.max(e,u.borderWidth||0,u.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);e=Math.max(e,s.offset||0,s.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(dt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Z(rr,"id","doughnut"),Z(rr,"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"}),Z(rr,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Z(rr,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((s,a)=>{const u=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class Wc extends vn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=e,a=this.chart._animationsDisabled;let{start:l,count:u}=nb(e,r,a);this._drawStart=l,this._drawCount=u,ib(e)&&(l=0,u=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=r;const h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:h},t),this.updateElements(r,l,u,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:h}=this._cachedMeta,{sharedOptions:d,includeOptions:b}=this._getSharedOptions(e,r),_=a.axis,x=l.axis,{spanGaps:S,segment:C}=this.options,T=Xr(S)?S:Number.POSITIVE_INFINITY,P=this.chart._animationsDisabled||s||r==="none",R=e+i,B=t.length;let H=e>0&&this.getParsed(e-1);for(let D=0;D<B;++D){const L=t[D],N=P?L:{};if(D<e||D>=R){N.skip=!0;continue}const W=this.getParsed(D),V=_t(W[x]),X=N[_]=a.getPixelForValue(W[_],D),K=N[x]=s||V?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,W,u):W[x],D);N.skip=isNaN(X)||isNaN(K)||V,N.stop=D>0&&Math.abs(W[_]-H[_])>T,C&&(N.parsed=W,N.raw=h.data[D]),b&&(N.options=d||this.resolveDataElementOptions(D,L.active?"active":r)),P||this.updateElement(L,D,N,r),H=W}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Z(Wc,"id","line"),Z(Wc,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Z(Wc,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class To extends vn{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Vo(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,e,i,r){return hb.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(r/2,0),a=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),l=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,u=a.options.animation,h=this._cachedMeta.rScale,d=h.xCenter,b=h.yCenter,_=h.getIndexAngle(0)-.5*At;let x=_,S;const C=360/this.countVisibleElements();for(S=0;S<e;++S)x+=this._computeAngle(S,r,C);for(S=e;S<e+i;S++){const T=t[S];let P=x,R=x+this._computeAngle(S,r,C),B=a.getDataVisibility(S)?h.getDistanceFromCenterForValue(this.getParsed(S).r):0;x=R,s&&(u.animateScale&&(B=0),u.animateRotate&&(P=R=_));const H={x:d,y:b,innerRadius:0,outerRadius:B,startAngle:P,endAngle:R,options:this.resolveDataElementOptions(S,T.active?"active":r)};this.updateElement(T,S,H,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?mn(this.resolveDataElementOptions(t,e).angle||i):0}}Z(To,"id","polarArea"),Z(To,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Z(To,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((s,a)=>{const u=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class ef extends rr{}Z(ef,"id","pie"),Z(ef,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class jc extends vn{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return hb.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],s=e.iScale.getLabels();if(i.points=r,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:s.length===r.length,options:a};this.updateElement(i,void 0,l,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let l=e;l<e+i;l++){const u=t[l],h=this.resolveDataElementOptions(l,u.active?"active":r),d=s.getPointPositionForValue(l,this.getParsed(l).r),b=a?s.xCenter:d.x,_=a?s.yCenter:d.y,x={x:b,y:_,angle:d.angle,skip:isNaN(b)||isNaN(_),options:h};this.updateElement(u,l,x,r)}}}Z(jc,"id","radar"),Z(jc,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Z(jc,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Uc extends vn{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+l+", "+u+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:s,count:a}=nb(e,i,r);if(this._drawStart=s,this._drawCount=a,ib(e)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:u}=e;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!u._decimated,l.points=i;const h=this.resolveDatasetElementOptions(t);h.segment=this.options.segment,this.updateElement(l,void 0,{animated:!r,options:h},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,s,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:h}=this._cachedMeta,d=this.resolveDataElementOptions(e,r),b=this.getSharedOptions(d),_=this.includeOptions(r,b),x=a.axis,S=l.axis,{spanGaps:C,segment:T}=this.options,P=Xr(C)?C:Number.POSITIVE_INFINITY,R=this.chart._animationsDisabled||s||r==="none";let B=e>0&&this.getParsed(e-1);for(let H=e;H<e+i;++H){const D=t[H],L=this.getParsed(H),N=R?D:{},W=_t(L[S]),V=N[x]=a.getPixelForValue(L[x],H),X=N[S]=s||W?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,L,u):L[S],H);N.skip=isNaN(V)||isNaN(X)||W,N.stop=H>0&&Math.abs(L[x]-B[x])>P,T&&(N.parsed=L,N.raw=h.data[H]),_&&(N.options=b||this.resolveDataElementOptions(H,D.active?"active":r)),R||this.updateElement(D,H,N,r),B=L}this.updateSharedOptions(b,r,d)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let u=e.length-1;u>=0;--u)l=Math.max(l,e[u].size(this.resolveDataElementOptions(u))/2);return l>0&&l}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const s=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,s,a)/2}}Z(Uc,"id","scatter"),Z(Uc,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Z(Uc,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Uk=Object.freeze({__proto__:null,BarController:Hc,BubbleController:zc,DoughnutController:rr,LineController:Wc,PieController:ef,PolarAreaController:To,RadarController:jc,ScatterController:Uc});function Ji(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Uf{constructor(t){Z(this,"options");this.options=t||{}}static override(t){Object.assign(Uf.prototype,t)}init(){}formats(){return Ji()}parse(){return Ji()}format(){return Ji()}add(){return Ji()}diff(){return Ji()}startOf(){return Ji()}endOf(){return Ji()}}var Vk={_date:Uf};function qk(n,t,e,i){const{controller:r,data:s,_sorted:a}=n,l=r._cachedMeta.iScale,u=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&a&&s.length){const h=l._reversePixels?dA:ii;if(i){if(r._sharedOptions){const d=s[0],b=typeof d.getRange=="function"&&d.getRange(t);if(b){const _=h(s,t,e-b),x=h(s,t,e+b);return{lo:_.lo,hi:x.hi}}}}else{const d=h(s,t,e);if(u){const{vScale:b}=r._cachedMeta,{_parsed:_}=n,x=_.slice(0,d.lo+1).reverse().findIndex(C=>!_t(C[b.axis]));d.lo-=Math.max(0,x);const S=_.slice(d.hi).findIndex(C=>!_t(C[b.axis]));d.hi+=Math.max(0,S)}return d}}return{lo:0,hi:s.length-1}}function bl(n,t,e,i,r){const s=n.getSortedVisibleDatasetMetas(),a=e[t];for(let l=0,u=s.length;l<u;++l){const{index:h,data:d}=s[l],{lo:b,hi:_}=qk(s[l],t,a,r);for(let x=b;x<=_;++x){const S=d[x];S.skip||i(S,h,x)}}}function $k(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function Dh(n,t,e,i,r){const s=[];return!r&&!n.isPointInArea(t)||bl(n,e,t,function(l,u,h){!r&&!ri(l,n.chartArea,0)||l.inRange(t.x,t.y,i)&&s.push({element:l,datasetIndex:u,index:h})},!0),s}function Xk(n,t,e,i){let r=[];function s(a,l,u){const{startAngle:h,endAngle:d}=a.getProps(["startAngle","endAngle"],i),{angle:b}=Jv(a,{x:t.x,y:t.y});Mo(b,h,d)&&r.push({element:a,datasetIndex:l,index:u})}return bl(n,e,t,s),r}function Yk(n,t,e,i,r,s){let a=[];const l=$k(e);let u=Number.POSITIVE_INFINITY;function h(d,b,_){const x=d.inRange(t.x,t.y,r);if(i&&!x)return;const S=d.getCenterPoint(r);if(!(!!s||n.isPointInArea(S))&&!x)return;const T=l(t,S);T<u?(a=[{element:d,datasetIndex:b,index:_}],u=T):T===u&&a.push({element:d,datasetIndex:b,index:_})}return bl(n,e,t,h),a}function Lh(n,t,e,i,r,s){return!s&&!n.isPointInArea(t)?[]:e==="r"&&!i?Xk(n,t,e,r):Yk(n,t,e,i,r,s)}function sm(n,t,e,i,r){const s=[],a=e==="x"?"inXRange":"inYRange";let l=!1;return bl(n,e,t,(u,h,d)=>{u[a]&&u[a](t[e],r)&&(s.push({element:u,datasetIndex:h,index:d}),l=l||u.inRange(t.x,t.y,r))}),i&&!l?[]:s}var Kk={modes:{index(n,t,e,i){const r=tr(t,n),s=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?Dh(n,r,s,i,a):Lh(n,r,s,!1,i,a),u=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(h=>{const d=l[0].index,b=h.data[d];b&&!b.skip&&u.push({element:b,datasetIndex:h.index,index:d})}),u):[]},dataset(n,t,e,i){const r=tr(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?Dh(n,r,s,i,a):Lh(n,r,s,!1,i,a);if(l.length>0){const u=l[0].datasetIndex,h=n.getDatasetMeta(u).data;l=[];for(let d=0;d<h.length;++d)l.push({element:h[d],datasetIndex:u,index:d})}return l},point(n,t,e,i){const r=tr(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return Dh(n,r,s,i,a)},nearest(n,t,e,i){const r=tr(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return Lh(n,r,s,e.intersect,i,a)},x(n,t,e,i){const r=tr(t,n);return sm(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=tr(t,n);return sm(n,r,"y",e.intersect,i)}}};const xb=["left","top","right","bottom"];function ro(n,t){return n.filter(e=>e.pos===t)}function om(n,t){return n.filter(e=>xb.indexOf(e.pos)===-1&&e.box.axis===t)}function so(n,t){return n.sort((e,i)=>{const r=t?i:e,s=t?e:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function Gk(n){const t=[];let e,i,r,s,a,l;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:s,options:{stack:a,stackWeight:l=1}}=r,t.push({index:e,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:l});return t}function Jk(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:s}=e;if(!i||!xb.includes(r))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=s}return t}function Zk(n,t){const e=Jk(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,l;for(s=0,a=n.length;s<a;++s){l=n[s];const{fullSize:u}=l.box,h=e[l.stack],d=h&&l.stackWeight/h.weight;l.horizontal?(l.width=d?d*i:u&&t.availableWidth,l.height=r):(l.width=i,l.height=d?d*r:u&&t.availableHeight)}return e}function Qk(n){const t=Gk(n),e=so(t.filter(h=>h.box.fullSize),!0),i=so(ro(t,"left"),!0),r=so(ro(t,"right")),s=so(ro(t,"top"),!0),a=so(ro(t,"bottom")),l=om(t,"x"),u=om(t,"y");return{fullSize:e,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(l),chartArea:ro(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(l)}}function am(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Sb(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function tE(n,t,e,i){const{pos:r,box:s}=e,a=n.maxPadding;if(!xt(r)){e.size&&(n[r]-=e.size);const b=i[e.stack]||{size:0,count:1};b.size=Math.max(b.size,e.horizontal?s.height:s.width),e.size=b.size/b.count,n[r]+=e.size}s.getPadding&&Sb(a,s.getPadding());const l=Math.max(0,t.outerWidth-am(a,n,"left","right")),u=Math.max(0,t.outerHeight-am(a,n,"top","bottom")),h=l!==n.w,d=u!==n.h;return n.w=l,n.h=u,e.horizontal?{same:h,other:d}:{same:d,other:h}}function eE(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function nE(n,t){const e=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(a=>{s[a]=Math.max(t[a],e[a])}),s}return i(n?["left","right"]:["top","bottom"])}function fo(n,t,e,i){const r=[];let s,a,l,u,h,d;for(s=0,a=n.length,h=0;s<a;++s){l=n[s],u=l.box,u.update(l.width||t.w,l.height||t.h,nE(l.horizontal,t));const{same:b,other:_}=tE(t,e,l,i);h|=b&&r.length,d=d||_,u.fullSize||r.push(l)}return h&&fo(r,t,e,i)||d}function Oc(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function cm(n,t,e,i){const r=e.padding;let{x:s,y:a}=t;for(const l of n){const u=l.box,h=i[l.stack]||{placed:0,weight:1},d=l.stackWeight/h.weight||1;if(l.horizontal){const b=t.w*d,_=h.size||u.height;Po(h.start)&&(a=h.start),u.fullSize?Oc(u,r.left,a,e.outerWidth-r.right-r.left,_):Oc(u,t.left+h.placed,a,b,_),h.start=a,h.placed+=b,a=u.bottom}else{const b=t.h*d,_=h.size||u.width;Po(h.start)&&(s=h.start),u.fullSize?Oc(u,s,r.top,_,e.outerHeight-r.bottom-r.top):Oc(u,s,t.top+h.placed,_,b),h.start=s,h.placed+=b,s=u.right}}t.x=s,t.y=a}var ve={addBox(n,t){n.boxes||(n.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)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=be(n.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(e-r.height,0),l=Qk(n.boxes),u=l.vertical,h=l.horizontal;Dt(n.boxes,C=>{typeof C.beforeLayout=="function"&&C.beforeLayout()});const d=u.reduce((C,T)=>T.box.options&&T.box.options.display===!1?C:C+1,0)||1,b=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/d,hBoxMaxHeight:a/2}),_=Object.assign({},r);Sb(_,be(i));const x=Object.assign({maxPadding:_,w:s,h:a,x:r.left,y:r.top},r),S=Zk(u.concat(h),b);fo(l.fullSize,x,b,S),fo(u,x,b,S),fo(h,x,b,S)&&fo(u,x,b,S),eE(x),cm(l.leftAndTop,x,b,S),x.x+=x.w,x.y+=x.h,cm(l.rightAndBottom,x,b,S),n.chartArea={left:x.left,top:x.top,right:x.left+x.w,bottom:x.top+x.h,height:x.h,width:x.w},Dt(l.chartArea,C=>{const T=C.box;Object.assign(T,n.chartArea),T.update(x.w,x.h,{left:0,top:0,right:0,bottom:0})})}};class Tb{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class iE extends Tb{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Vc="$chartjs",rE={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},lm=n=>n===null||n==="";function sE(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Vc]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",lm(r)){const s=$g(n,"width");s!==void 0&&(n.width=s)}if(lm(i))if(n.style.height==="")n.height=n.width/(t||2);else{const s=$g(n,"height");s!==void 0&&(n.height=s)}return n}const Ob=ok?{passive:!0}:!1;function oE(n,t,e){n&&n.addEventListener(t,e,Ob)}function aE(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Ob)}function cE(n,t){const e=rE[n.type]||n.type,{x:i,y:r}=tr(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function sl(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function lE(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||sl(l.addedNodes,i),a=a&&!sl(l.removedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function uE(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||sl(l.removedNodes,i),a=a&&!sl(l.addedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const Do=new Map;let um=0;function Cb(){const n=window.devicePixelRatio;n!==um&&(um=n,Do.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function hE(n,t){Do.size||window.addEventListener("resize",Cb),Do.set(n,t)}function fE(n){Do.delete(n),Do.size||window.removeEventListener("resize",Cb)}function dE(n,t,e){const i=n.canvas,r=i&&jf(i);if(!r)return;const s=eb((l,u)=>{const h=r.clientWidth;e(l,u),h<r.clientWidth&&e()},window),a=new ResizeObserver(l=>{const u=l[0],h=u.contentRect.width,d=u.contentRect.height;h===0&&d===0||s(h,d)});return a.observe(r),hE(n,s),a}function Ih(n,t,e){e&&e.disconnect(),t==="resize"&&fE(n)}function pE(n,t,e){const i=n.canvas,r=eb(s=>{n.ctx!==null&&e(cE(s,n))},n);return oE(i,t,r),r}class gE extends Tb{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(sE(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Vc])return!1;const i=e[Vc].initial;["height","width"].forEach(s=>{const a=i[s];_t(a)?e.removeAttribute(s):e.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{e.style[s]=r[s]}),e.width=e.width,delete e[Vc],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),a={attach:lE,detach:uE,resize:dE}[e]||pE;r[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:Ih,detach:Ih,resize:Ih}[e]||aE)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return sk(t,e,i,r)}isAttached(t){const e=t&&jf(t);return!!(e&&e.isConnected)}}function mE(n){return!Wf()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?iE:gE}var Rc;let oi=(Rc=class{constructor(){Z(this,"x");Z(this,"y");Z(this,"active",!1);Z(this,"options");Z(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Xr(this.x)&&Xr(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}},Z(Rc,"defaults",{}),Z(Rc,"defaultRoutes"),Rc);function vE(n,t){const e=n.options.ticks,i=bE(n),r=Math.min(e.maxTicksLimit||i,i),s=e.major.enabled?_E(t):[],a=s.length,l=s[0],u=s[a-1],h=[];if(a>r)return wE(t,h,s,a/r),h;const d=yE(s,t,r);if(a>0){let b,_;const x=a>1?Math.round((u-l)/(a-1)):null;for(Cc(t,h,d,_t(x)?0:l-x,l),b=0,_=a-1;b<_;b++)Cc(t,h,d,s[b],s[b+1]);return Cc(t,h,d,u,_t(x)?t.length:u+x),h}return Cc(t,h,d),h}function bE(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function yE(n,t,e){const i=xE(n),r=t.length/e;if(!i)return Math.max(r,1);const s=cA(i);for(let a=0,l=s.length-1;a<l;a++){const u=s[a];if(u>r)return u}return Math.max(r,1)}function _E(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function wE(n,t,e,i){let r=0,s=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===s&&(t.push(n[a]),r++,s=e[r*i])}function Cc(n,t,e,i,r){const s=dt(i,0),a=Math.min(dt(r,n.length),n.length);let l=0,u,h,d;for(e=Math.ceil(e),r&&(u=r-i,e=u/Math.floor(u/e)),d=s;d<0;)l++,d=Math.round(s+l*e);for(h=Math.max(s,0);h<a;h++)h===d&&(t.push(n[h]),l++,d=Math.round(s+l*e))}function xE(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const SE=n=>n==="left"?"right":n==="right"?"left":n,hm=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,fm=(n,t)=>Math.min(t||n,n);function dm(n,t){const e=[],i=n.length/t,r=n.length;let s=0;for(;s<r;s+=i)e.push(n[Math.floor(s)]);return e}function TE(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),s=n._startPixel,a=n._endPixel,l=1e-6;let u=n.getPixelForTick(r),h;if(!(e&&(i===1?h=Math.max(u-s,a-u):t===0?h=(n.getPixelForTick(1)-u)/2:h=(u-n.getPixelForTick(r-1))/2,u+=r<t?h:-h,u<s-l||u>a+l)))return u}function OE(n,t){Dt(n,e=>{const i=e.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete e.data[i[s]];i.splice(0,r)}})}function oo(n){return n.drawTicks?n.tickLength:0}function pm(n,t){if(!n.display)return 0;const e=re(n.font,t),i=be(n.padding);return(jt(n.text)?n.text.length:1)*e.lineHeight+i.height}function CE(n,t){return Pi(n,{scale:t,type:"scale"})}function AE(n,t,e){return Pi(n,{tick:e,index:t,type:"tick"})}function kE(n,t,e){let i=If(n);return(e&&t!=="right"||!e&&t==="right")&&(i=SE(i)),i}function EE(n,t,e,i){const{top:r,left:s,bottom:a,right:l,chart:u}=n,{chartArea:h,scales:d}=u;let b=0,_,x,S;const C=a-r,T=l-s;if(n.isHorizontal()){if(x=pe(i,s,l),xt(e)){const P=Object.keys(e)[0],R=e[P];S=d[P].getPixelForValue(R)+C-t}else e==="center"?S=(h.bottom+h.top)/2+C-t:S=hm(n,e,t);_=l-s}else{if(xt(e)){const P=Object.keys(e)[0],R=e[P];x=d[P].getPixelForValue(R)-T+t}else e==="center"?x=(h.left+h.right)/2-T+t:x=hm(n,e,t);S=pe(i,a,r),b=e==="left"?-Gt:Gt}return{titleX:x,titleY:S,maxWidth:_,rotation:b}}class pr extends oi{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.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(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:r}=this;return t=Ke(t,Number.POSITIVE_INFINITY),e=Ke(e,Number.NEGATIVE_INFINITY),i=Ke(i,Number.POSITIVE_INFINITY),r=Ke(r,Number.NEGATIVE_INFINITY),{min:Ke(t,i),max:Ke(e,r),minDefined:Xt(t),maxDefined:Xt(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:e,max:i};const l=this.getMatchingVisibleMetas();for(let u=0,h=l.length;u<h;++u)a=l[u].controller.getMinMax(this,t),r||(e=Math.min(e,a.min)),s||(i=Math.max(i,a.max));return e=s&&e>i?i:e,i=r&&e>i?e:i,{min:Ke(e,Ke(i,e)),max:Ke(i,Ke(e,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 t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Nt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=FA(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?dm(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=vE(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),u&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Nt(this.options.afterUpdate,[this])}beforeSetDimensions(){Nt(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(){Nt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Nt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Nt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=Nt(e.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Nt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Nt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=fm(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,s=e.maxRotation;let a=r,l,u,h;if(!this._isVisible()||!e.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const d=this._getLabelSizes(),b=d.widest.width,_=d.highest.height,x=ae(this.chart.width-b,0,this.maxWidth);l=t.offset?this.maxWidth/i:x/(i-1),b+6>l&&(l=x/(i-(t.offset?.5:1)),u=this.maxHeight-oo(t.grid)-e.padding-pm(t.title,this.chart.options.font),h=Math.sqrt(b*b+_*_),a=Df(Math.min(Math.asin(ae((d.highest.height+6)/l,-1,1)),Math.asin(ae(u/h,-1,1))-Math.asin(ae(_/h,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Nt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Nt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const u=pm(r,e.options.font);if(l?(t.width=this.maxWidth,t.height=oo(s)+u):(t.height=this.maxHeight,t.width=oo(s)+u),i.display&&this.ticks.length){const{first:h,last:d,widest:b,highest:_}=this._getLabelSizes(),x=i.padding*2,S=mn(this.labelRotation),C=Math.cos(S),T=Math.sin(S);if(l){const P=i.mirror?0:T*b.width+C*_.height;t.height=Math.min(this.maxHeight,t.height+P+x)}else{const P=i.mirror?0:C*b.width+T*_.height;t.width=Math.min(this.maxWidth,t.width+P+x)}this._calculatePadding(h,d,T,C)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,r){const{ticks:{align:s,padding:a},position:l}=this.options,u=this.labelRotation!==0,h=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,b=this.right-this.getPixelForTick(this.ticks.length-1);let _=0,x=0;u?h?(_=r*t.width,x=i*e.height):(_=i*t.height,x=r*e.width):s==="start"?x=e.width:s==="end"?_=t.width:s!=="inner"&&(_=t.width/2,x=e.width/2),this.paddingLeft=Math.max((_-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((x-b+a)*this.width/(this.width-b),0)}else{let d=e.height/2,b=t.height/2;s==="start"?(d=0,b=t.height):s==="end"&&(d=e.height,b=0),this.paddingTop=d+a,this.paddingBottom=b+a}}_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(){Nt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)_t(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=dm(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:s}=this,a=[],l=[],u=Math.floor(e/fm(e,i));let h=0,d=0,b,_,x,S,C,T,P,R,B,H,D;for(b=0;b<e;b+=u){if(S=t[b].label,C=this._resolveTickFontOptions(b),r.font=T=C.string,P=s[T]=s[T]||{data:{},gc:[]},R=C.lineHeight,B=H=0,!_t(S)&&!jt(S))B=il(r,P.data,P.gc,B,S),H=R;else if(jt(S))for(_=0,x=S.length;_<x;++_)D=S[_],!_t(D)&&!jt(D)&&(B=il(r,P.data,P.gc,B,D),H+=R);a.push(B),l.push(H),h=Math.max(B,h),d=Math.max(H,d)}OE(s,e);const L=a.indexOf(h),N=l.indexOf(d),W=V=>({width:a[V]||0,height:l[V]||0});return{first:W(0),last:W(e-1),widest:W(L),highest:W(N),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return fA(this._alignToPixels?Gi(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=AE(this.getContext(),t,i))}return this.$context||(this.$context=CE(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=mn(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),s=this._getLabelSizes(),a=t.autoSkipPadding||0,l=s?s.widest.width+a:0,u=s?s.highest.height+a:0;return this.isHorizontal()?u*i>l*r?l/i:u/r:u*r<l*i?u/i:l/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:l}=r,u=s.offset,h=this.isHorizontal(),b=this.ticks.length+(u?1:0),_=oo(s),x=[],S=l.setContext(this.getContext()),C=S.display?S.width:0,T=C/2,P=function(it){return Gi(i,it,C)};let R,B,H,D,L,N,W,V,X,K,Q,rt;if(a==="top")R=P(this.bottom),N=this.bottom-_,V=R-T,K=P(t.top)+T,rt=t.bottom;else if(a==="bottom")R=P(this.top),K=t.top,rt=P(t.bottom)-T,N=R+T,V=this.top+_;else if(a==="left")R=P(this.right),L=this.right-_,W=R-T,X=P(t.left)+T,Q=t.right;else if(a==="right")R=P(this.left),X=t.left,Q=P(t.right)-T,L=R+T,W=this.left+_;else if(e==="x"){if(a==="center")R=P((t.top+t.bottom)/2+.5);else if(xt(a)){const it=Object.keys(a)[0],ot=a[it];R=P(this.chart.scales[it].getPixelForValue(ot))}K=t.top,rt=t.bottom,N=R+T,V=N+_}else if(e==="y"){if(a==="center")R=P((t.left+t.right)/2);else if(xt(a)){const it=Object.keys(a)[0],ot=a[it];R=P(this.chart.scales[it].getPixelForValue(ot))}L=R-T,W=L-_,X=t.left,Q=t.right}const lt=dt(r.ticks.maxTicksLimit,b),ut=Math.max(1,Math.ceil(b/lt));for(B=0;B<b;B+=ut){const it=this.getContext(B),ot=s.setContext(it),mt=l.setContext(it),kt=ot.lineWidth,Zt=ot.color,Et=mt.dash||[],Ht=mt.dashOffset,se=ot.tickWidth,Vt=ot.tickColor,Ot=ot.tickBorderDash||[],Qt=ot.tickBorderDashOffset;H=TE(this,B,u),H!==void 0&&(D=Gi(i,H,kt),h?L=W=X=Q=D:N=V=K=rt=D,x.push({tx1:L,ty1:N,tx2:W,ty2:V,x1:X,y1:K,x2:Q,y2:rt,width:kt,color:Zt,borderDash:Et,borderDashOffset:Ht,tickWidth:se,tickColor:Vt,tickBorderDash:Ot,tickBorderDashOffset:Qt}))}return this._ticksLength=b,this._borderValue=R,x}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),l=this.ticks,{align:u,crossAlign:h,padding:d,mirror:b}=s,_=oo(i.grid),x=_+d,S=b?-d:x,C=-mn(this.labelRotation),T=[];let P,R,B,H,D,L,N,W,V,X,K,Q,rt="middle";if(r==="top")L=this.bottom-S,N=this._getXAxisLabelAlignment();else if(r==="bottom")L=this.top+S,N=this._getXAxisLabelAlignment();else if(r==="left"){const ut=this._getYAxisLabelAlignment(_);N=ut.textAlign,D=ut.x}else if(r==="right"){const ut=this._getYAxisLabelAlignment(_);N=ut.textAlign,D=ut.x}else if(e==="x"){if(r==="center")L=(t.top+t.bottom)/2+x;else if(xt(r)){const ut=Object.keys(r)[0],it=r[ut];L=this.chart.scales[ut].getPixelForValue(it)+x}N=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")D=(t.left+t.right)/2-x;else if(xt(r)){const ut=Object.keys(r)[0],it=r[ut];D=this.chart.scales[ut].getPixelForValue(it)}N=this._getYAxisLabelAlignment(_).textAlign}e==="y"&&(u==="start"?rt="top":u==="end"&&(rt="bottom"));const lt=this._getLabelSizes();for(P=0,R=l.length;P<R;++P){B=l[P],H=B.label;const ut=s.setContext(this.getContext(P));W=this.getPixelForTick(P)+s.labelOffset,V=this._resolveTickFontOptions(P),X=V.lineHeight,K=jt(H)?H.length:1;const it=K/2,ot=ut.color,mt=ut.textStrokeColor,kt=ut.textStrokeWidth;let Zt=N;a?(D=W,N==="inner"&&(P===R-1?Zt=this.options.reverse?"left":"right":P===0?Zt=this.options.reverse?"right":"left":Zt="center"),r==="top"?h==="near"||C!==0?Q=-K*X+X/2:h==="center"?Q=-lt.highest.height/2-it*X+X:Q=-lt.highest.height+X/2:h==="near"||C!==0?Q=X/2:h==="center"?Q=lt.highest.height/2-it*X:Q=lt.highest.height-K*X,b&&(Q*=-1),C!==0&&!ut.showLabelBackdrop&&(D+=X/2*Math.sin(C))):(L=W,Q=(1-K)*X/2);let Et;if(ut.showLabelBackdrop){const Ht=be(ut.backdropPadding),se=lt.heights[P],Vt=lt.widths[P];let Ot=Q-Ht.top,Qt=0-Ht.left;switch(rt){case"middle":Ot-=se/2;break;case"bottom":Ot-=se;break}switch(N){case"center":Qt-=Vt/2;break;case"right":Qt-=Vt;break;case"inner":P===R-1?Qt-=Vt:P>0&&(Qt-=Vt/2);break}Et={left:Qt,top:Ot,width:Vt+Ht.width,height:se+Ht.height,color:ut.backdropColor}}T.push({label:H,font:V,textOffset:Q,options:{rotation:C,color:ot,strokeColor:mt,strokeWidth:kt,textAlign:Zt,textBaseline:rt,translation:[D,L],backdrop:Et}})}return T}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-mn(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),l=t+s,u=a.widest.width;let h,d;return e==="left"?r?(d=this.right+s,i==="near"?h="left":i==="center"?(h="center",d+=u/2):(h="right",d+=u)):(d=this.right-l,i==="near"?h="right":i==="center"?(h="center",d-=u/2):(h="left",d=this.left)):e==="right"?r?(d=this.left+s,i==="near"?h="right":i==="center"?(h="center",d-=u/2):(h="left",d-=u)):(d=this.left+l,i==="near"?h="left":i==="center"?(h="center",d+=u/2):(h="right",d=this.right)):h="right",{textAlign:h,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:r,width:s,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,a;const l=(u,h,d)=>{!d.width||!d.color||(i.save(),i.lineWidth=d.width,i.strokeStyle=d.color,i.setLineDash(d.borderDash||[]),i.lineDashOffset=d.borderDashOffset,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(h.x,h.y),i.stroke(),i.restore())};if(e.display)for(s=0,a=r.length;s<a;++s){const u=r[s];e.drawOnChartArea&&l({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),e.drawTicks&&l({x:u.tx1,y:u.ty1},{x:u.tx2,y:u.ty2},{color:u.tickColor,width:u.tickWidth,borderDash:u.tickBorderDash,borderDashOffset:u.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:r}}=this,s=i.setContext(this.getContext()),a=i.display?s.width:0;if(!a)return;const l=r.setContext(this.getContext(0)).lineWidth,u=this._borderValue;let h,d,b,_;this.isHorizontal()?(h=Gi(t,this.left,a)-a/2,d=Gi(t,this.right,l)+l/2,b=_=u):(b=Gi(t,this.top,a)-a/2,_=Gi(t,this.bottom,l)+l/2,h=d=u),e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.beginPath(),e.moveTo(h,b),e.lineTo(d,_),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&gl(i,r);const s=this.getLabelItems(t);for(const a of s){const l=a.options,u=a.font,h=a.label,d=a.textOffset;dr(i,h,0,d,u,l)}r&&ml(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const s=re(i.font),a=be(i.padding),l=i.align;let u=s.lineHeight/2;e==="bottom"||e==="center"||xt(e)?(u+=a.bottom,jt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:h,titleY:d,maxWidth:b,rotation:_}=EE(this,u,e,l);dr(t,i.text,0,0,s,{color:i.color,maxWidth:b,rotation:_,textAlign:kE(l,e,r),textBaseline:"middle",translation:[h,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=dt(t.grid&&t.grid.z,-1),r=dt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==pr.prototype.draw?[{z:e,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=e.length;s<a;++s){const l=e[s];l[i]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return re(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ac{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;RE(e)&&(i=this.register(e));const r=this.items,s=t.id,a=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,PE(t,a,i),this.override&&Ut.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in Ut[r]&&(delete Ut[r][i],this.override&&delete fr[i])}}function PE(n,t,e){const i=Eo(Object.create(null),[e?Ut.get(e):{},Ut.get(t),n.defaults]);Ut.set(t,i),n.defaultRoutes&&ME(t,n.defaultRoutes),n.descriptors&&Ut.describe(t,n.descriptors)}function ME(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),s=[n].concat(i).join("."),a=t[e].split("."),l=a.pop(),u=a.join(".");Ut.route(s,r,u,l)})}function RE(n){return"id"in n&&"defaults"in n}class DE{constructor(){this.controllers=new Ac(vn,"datasets",!0),this.elements=new Ac(oi,"elements"),this.plugins=new Ac(Object,"plugins"),this.scales=new Ac(pr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Dt(r,a=>{const l=i||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,e,i){const r=Rf(t);Nt(i["before"+r],[],i),e[t](i),Nt(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var Rn=new DE;class LE{constructor(){this._init=[]}notify(t,e,i,r){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=r?this._descriptors(t).filter(r):this._descriptors(t),a=this._notify(s,t,e,i);return e==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,i,r){r=r||{};for(const s of t){const a=s.plugin,l=a[i],u=[e,r,s.options];if(Nt(l,u,a)===!1&&r.cancelable)return!1}return!0}invalidate(){_t(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=dt(i.options&&i.options.plugins,{}),s=IE(i);return r===!1&&!e?[]:FE(t,s,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(l=>!a.some(u=>l.plugin.id===u.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function IE(n){const t={},e=[],i=Object.keys(Rn.plugins.items);for(let s=0;s<i.length;s++)e.push(Rn.getPlugin(i[s]));const r=n.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function NE(n,t){return!t&&n===!1?null:n===!0?{}:n}function FE(n,{plugins:t,localIds:e},i,r){const s=[],a=n.getContext();for(const l of t){const u=l.id,h=NE(i[u],r);h!==null&&s.push({plugin:l,options:BE(n.config,{plugin:l,local:e[u]},h,a)})}return s}function BE(n,{plugin:t,local:e},i,r){const s=n.pluginScopeKeys(t),a=n.getOptionScopes(i,s);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function nf(n,t){const e=Ut.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function HE(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function zE(n,t){return n===t?"_index_":"_value_"}function gm(n){if(n==="x"||n==="y"||n==="r")return n}function WE(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function rf(n,...t){if(gm(n))return n;for(const e of t){const i=e.axis||WE(e.position)||n.length>1&&gm(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function mm(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function jE(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return mm(n,"x",e[0])||mm(n,"y",e[0])}return{}}function UE(n,t){const e=fr[n.type]||{scales:{}},i=t.scales||{},r=nf(n.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!xt(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const u=rf(a,l,jE(a,n),Ut.scales[l.type]),h=zE(u,r),d=e.scales||{};s[a]=_o(Object.create(null),[{axis:u},l,d[u],d[h]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,u=a.indexAxis||nf(l,t),d=(fr[l]||{}).scales||{};Object.keys(d).forEach(b=>{const _=HE(b,u),x=a[_+"AxisID"]||_;s[x]=s[x]||Object.create(null),_o(s[x],[{axis:_},i[x],d[b]])})}),Object.keys(s).forEach(a=>{const l=s[a];_o(l,[Ut.scales[l.type],Ut.scale])}),s}function Ab(n){const t=n.options||(n.options={});t.plugins=dt(t.plugins,{}),t.scales=UE(n,t)}function kb(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function VE(n){return n=n||{},n.data=kb(n.data),Ab(n),n}const vm=new Map,Eb=new Set;function kc(n,t){let e=vm.get(n);return e||(e=t(),vm.set(n,e),Eb.add(e)),e}const ao=(n,t,e)=>{const i=Ai(t,e);i!==void 0&&n.add(i)};class qE{constructor(t){this._config=VE(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=kb(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Ab(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return kc(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return kc(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return kc(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return kc(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),l=a.get(e);if(l)return l;const u=new Set;e.forEach(d=>{t&&(u.add(t),d.forEach(b=>ao(u,t,b))),d.forEach(b=>ao(u,r,b)),d.forEach(b=>ao(u,fr[s]||{},b)),d.forEach(b=>ao(u,Ut,b)),d.forEach(b=>ao(u,Qh,b))});const h=Array.from(u);return h.length===0&&h.push(Object.create(null)),Eb.has(e)&&a.set(e,h),h}chartOptionScopes(){const{options:t,type:e}=this;return[t,fr[e]||{},Ut.datasets[e]||{},{type:e},Ut,Qh]}resolveNamedOptions(t,e,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=bm(this._resolverCache,t,r);let u=a;if(XE(a,e)){s.$shared=!1,i=ki(i)?i():i;const h=this.createResolver(t,i,l);u=Yr(a,i,h)}for(const h of e)s[h]=u[h];return s}createResolver(t,e,i=[""],r){const{resolver:s}=bm(this._resolverCache,t,i);return xt(e)?Yr(s,e,void 0,r):s}}function bm(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let s=i.get(r);return s||(s={resolver:Bf(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const $E=n=>xt(n)&&Object.getOwnPropertyNames(n).some(t=>ki(n[t]));function XE(n,t){const{isScriptable:e,isIndexable:i}=ab(n);for(const r of t){const s=e(r),a=i(r),l=(a||s)&&n[r];if(s&&(ki(l)||$E(l))||a&&jt(l))return!0}return!1}var YE="4.5.0";const KE=["top","bottom","left","right","chartArea"];function ym(n,t){return n==="top"||n==="bottom"||KE.indexOf(n)===-1&&t==="x"}function _m(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function wm(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Nt(e&&e.onComplete,[n],t)}function GE(n){const t=n.chart,e=t.options.animation;Nt(e&&e.onProgress,[n],t)}function Pb(n){return Wf()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const qc={},xm=n=>{const t=Pb(n);return Object.values(qc).filter(e=>e.canvas===t).pop()};function JE(n,t,e){const i=Object.keys(n);for(const r of i){const s=+r;if(s>=t){const a=n[r];delete n[r],(e>0||s>t)&&(n[s+e]=a)}}}function ZE(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}class Ae{static register(...t){Rn.add(...t),Sm()}static unregister(...t){Rn.remove(...t),Sm()}constructor(t,e){const i=this.config=new qE(e),r=Pb(t),s=xm(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||mE(r)),this.platform.updateConfig(i);const l=this.platform.acquireContext(r,a.aspectRatio),u=l&&l.canvas,h=u&&u.height,d=u&&u.width;if(this.id=QC(),this.ctx=l,this.canvas=u,this.width=d,this.height=h,this._options=a,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 LE,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=mA(b=>this.update(b),a.resizeDelay||0),this._dataChanges=[],qc[this.id]=this,!l||!u){console.error("Failed to create chart: can't acquire context from the given item");return}Qn.listen(this,"complete",wm),Qn.listen(this,"progress",GE),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:s}=this;return _t(t)?e&&s?s:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Rn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():qg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return jg(this.canvas,this.ctx),this}stop(){return Qn.stop(this),this}resize(t,e){Qn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,e,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,qg(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Nt(i.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Dt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let s=[];e&&(s=s.concat(Object.keys(e).map(a=>{const l=e[a],u=rf(a,l),h=u==="r",d=u==="x";return{options:l,dposition:h?"chartArea":d?"bottom":"left",dtype:h?"radialLinear":d?"category":"linear"}}))),Dt(s,a=>{const l=a.options,u=l.id,h=rf(u,l),d=dt(l.type,a.dtype);(l.position===void 0||ym(l.position,h)!==ym(a.dposition))&&(l.position=a.dposition),r[u]=!0;let b=null;if(u in i&&i[u].type===d)b=i[u];else{const _=Rn.getScale(d);b=new _({id:u,type:d,ctx:this.ctx,chart:this}),i[b.id]=b}b.init(l,t)}),Dt(r,(a,l)=>{a||delete i[l]}),Dt(i,a=>{ve.configure(this,a,a.options),ve.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(_m("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const s=e[i];let a=this.getDatasetMeta(i);const l=s.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=l,a.indexAxis=s.indexAxis||nf(l,this.options),a.order=s.order||0,a.index=i,a.label=""+s.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const u=Rn.getController(l),{datasetElementType:h,dataElementType:d}=Ut.datasets[l];Object.assign(u,{dataElementType:Rn.getElement(d),datasetElementType:h&&Rn.getElement(h)}),a.controller=new u(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Dt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let h=0,d=this.data.datasets.length;h<d;h++){const{controller:b}=this.getDatasetMeta(h),_=!r&&s.indexOf(b)===-1;b.buildOrUpdateElements(_),a=Math.max(+b.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||Dt(s,h=>{h.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(_m("z","_idx"));const{_active:l,_lastEvent:u}=this;u?this._eventHandler(u,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Dt(this.scales,t=>{ve.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Dg(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of e){const a=i==="_removeElements"?-s:s;JE(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=s=>new Set(t.filter(a=>a[0]===s).map((a,l)=>l+","+a.splice(1).join(","))),r=i(0);for(let s=1;s<e;s++)if(!Dg(r,i(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ve.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Dt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,ki(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Qn.has(this)?this.attached&&!Qn.running(this)&&Qn.start(this):(this.draw(),wm({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let r,s;for(r=0,s=e.length;r<s;++r){const a=e[r];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=bb(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&gl(e,r),t.controller.draw(),r&&ml(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ri(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const s=Kk.modes[e];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===e).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Pi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);Po(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Qn.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),jg(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete qc[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(s,a)=>{e.addEventListener(this,s,a),t[s]=a},r=(s,a,l)=>{s.offsetX=a,s.offsetY=l,this._eventHandler(s)};Dt(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(u,h)=>{e.addEventListener(this,u,h),t[u]=h},r=(u,h)=>{t[u]&&(e.removeEventListener(this,u,h),delete t[u])},s=(u,h)=>{this.canvas&&this.resize(u,h)};let a;const l=()=>{r("attach",l),this.attached=!0,this.resize(),i("resize",s),i("detach",a)};a=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",l)},e.isAttached(this.canvas)?l():a()}unbindEvents(){Dt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Dt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let s,a,l,u;for(e==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,u=t.length;l<u;++l){a=t[l];const h=a&&this.getDatasetMeta(a.datasetIndex).controller;h&&h[r+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:s,index:a})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[a],index:a}});!tl(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,s=(u,h)=>u.filter(d=>!h.some(b=>d.datasetIndex===b.datasetIndex&&d.index===b.index)),a=s(e,t),l=i?t:s(t,e);a.length&&this.updateHoverStyle(a,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:s}=this,a=e,l=this._getActiveElements(t,r,i,a),u=sA(t),h=ZE(t,this._lastEvent,i,u);i&&(this._lastEvent=null,Nt(s.onHover,[t,l,this],this),u&&Nt(s.onClick,[t,l,this],this));const d=!tl(l,r);return(d||e)&&(this._active=l,this._updateHoverStyles(l,r,e)),this._lastEvent=h,d}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}}Z(Ae,"defaults",Ut),Z(Ae,"instances",qc),Z(Ae,"overrides",fr),Z(Ae,"registry",Rn),Z(Ae,"version",YE),Z(Ae,"getChart",xm);function Sm(){return Dt(Ae.instances,n=>n._plugins.invalidate())}function QE(n,t,e){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:l,options:u}=t,{borderWidth:h,borderJoinStyle:d}=u,b=Math.min(h/a,ge(i-e));if(n.beginPath(),n.arc(r,s,a-h/2,i+b/2,e-b/2),l>0){const _=Math.min(h/l,ge(i-e));n.arc(r,s,l+h/2,e-_/2,i+_/2,!0)}else{const _=Math.min(h/2,a*ge(i-e));if(d==="round")n.arc(r,s,_,e-At/2,i+At/2,!0);else if(d==="bevel"){const x=2*_*_,S=-x*Math.cos(e+At/2)+r,C=-x*Math.sin(e+At/2)+s,T=x*Math.cos(i+At/2)+r,P=x*Math.sin(i+At/2)+s;n.lineTo(S,C),n.lineTo(T,P)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function tP(n,t,e){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:l,innerRadius:u}=t;let h=r/l;n.beginPath(),n.arc(s,a,l,i-h,e+h),u>r?(h=r/u,n.arc(s,a,u,e+h,i-h,!0)):n.arc(s,a,r,e+Gt,i-Gt),n.closePath(),n.clip()}function eP(n){return Ff(n,["outerStart","outerEnd","innerStart","innerEnd"])}function nP(n,t,e,i){const r=eP(n.options.borderRadius),s=(e-t)/2,a=Math.min(s,i*t/2),l=u=>{const h=(e-Math.min(s,u))*i/2;return ae(u,0,Math.min(s,h))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:ae(r.innerStart,0,a),innerEnd:ae(r.innerEnd,0,a)}}function zr(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function ol(n,t,e,i,r,s){const{x:a,y:l,startAngle:u,pixelMargin:h,innerRadius:d}=t,b=Math.max(t.outerRadius+i+e-h,0),_=d>0?d+i+e+h:0;let x=0;const S=r-u;if(i){const ut=d>0?d-i:0,it=b>0?b-i:0,ot=(ut+it)/2,mt=ot!==0?S*ot/(ot+i):S;x=(S-mt)/2}const C=Math.max(.001,S*b-e/At)/b,T=(S-C)/2,P=u+T+x,R=r-T-x,{outerStart:B,outerEnd:H,innerStart:D,innerEnd:L}=nP(t,_,b,R-P),N=b-B,W=b-H,V=P+B/N,X=R-H/W,K=_+D,Q=_+L,rt=P+D/K,lt=R-L/Q;if(n.beginPath(),s){const ut=(V+X)/2;if(n.arc(a,l,b,V,ut),n.arc(a,l,b,ut,X),H>0){const kt=zr(W,X,a,l);n.arc(kt.x,kt.y,H,X,R+Gt)}const it=zr(Q,R,a,l);if(n.lineTo(it.x,it.y),L>0){const kt=zr(Q,lt,a,l);n.arc(kt.x,kt.y,L,R+Gt,lt+Math.PI)}const ot=(R-L/_+(P+D/_))/2;if(n.arc(a,l,_,R-L/_,ot,!0),n.arc(a,l,_,ot,P+D/_,!0),D>0){const kt=zr(K,rt,a,l);n.arc(kt.x,kt.y,D,rt+Math.PI,P-Gt)}const mt=zr(N,P,a,l);if(n.lineTo(mt.x,mt.y),B>0){const kt=zr(N,V,a,l);n.arc(kt.x,kt.y,B,P-Gt,V)}}else{n.moveTo(a,l);const ut=Math.cos(V)*b+a,it=Math.sin(V)*b+l;n.lineTo(ut,it);const ot=Math.cos(X)*b+a,mt=Math.sin(X)*b+l;n.lineTo(ot,mt)}n.closePath()}function iP(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l}=t;let u=t.endAngle;if(s){ol(n,t,e,i,u,r);for(let h=0;h<s;++h)n.fill();isNaN(l)||(u=a+(l%Bt||Bt))}return ol(n,t,e,i,u,r),n.fill(),u}function rP(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:h,borderJoinStyle:d,borderDash:b,borderDashOffset:_,borderRadius:x}=u,S=u.borderAlign==="inner";if(!h)return;n.setLineDash(b||[]),n.lineDashOffset=_,S?(n.lineWidth=h*2,n.lineJoin=d||"round"):(n.lineWidth=h,n.lineJoin=d||"bevel");let C=t.endAngle;if(s){ol(n,t,e,i,C,r);for(let T=0;T<s;++T)n.stroke();isNaN(l)||(C=a+(l%Bt||Bt))}S&&tP(n,t,C),u.selfJoin&&C-a>=At&&x===0&&d!=="miter"&&QE(n,t,C),s||(ol(n,t,e,i,C,r),n.stroke())}class po extends oi{constructor(e){super();Z(this,"circumference");Z(this,"endAngle");Z(this,"fullCircles");Z(this,"innerRadius");Z(this,"outerRadius");Z(this,"pixelMargin");Z(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,i,r){const s=this.getProps(["x","y"],r),{angle:a,distance:l}=Jv(s,{x:e,y:i}),{startAngle:u,endAngle:h,innerRadius:d,outerRadius:b,circumference:_}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),x=(this.options.spacing+this.options.borderWidth)/2,S=dt(_,h-u),C=Mo(a,u,h)&&u!==h,T=S>=Bt||C,P=ni(l,d+x,b+x);return T&&P}getCenterPoint(e){const{x:i,y:r,startAngle:s,endAngle:a,innerRadius:l,outerRadius:u}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:h,spacing:d}=this.options,b=(s+a)/2,_=(l+u+d+h)/2;return{x:i+Math.cos(b)*_,y:r+Math.sin(b)*_}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:r}=this,s=(i.offset||0)/4,a=(i.spacing||0)/2,l=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=r>Bt?Math.floor(r/Bt):0,r===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const u=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(u)*s,Math.sin(u)*s);const h=1-Math.sin(Math.min(At,r||0)),d=s*h;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,iP(e,this,d,a,l),rP(e,this,d,a,l),e.restore()}}Z(po,"id","arc"),Z(po,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),Z(po,"defaultRoutes",{backgroundColor:"backgroundColor"}),Z(po,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Mb(n,t,e=t){n.lineCap=dt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(dt(e.borderDash,t.borderDash)),n.lineDashOffset=dt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=dt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=dt(e.borderWidth,t.borderWidth),n.strokeStyle=dt(e.borderColor,t.borderColor)}function sP(n,t,e){n.lineTo(e.x,e.y)}function oP(n){return n.stepped?kA:n.tension||n.cubicInterpolationMode==="monotone"?EA:sP}function Rb(n,t,e={}){const i=n.length,{start:r=0,end:s=i-1}=e,{start:a,end:l}=t,u=Math.max(r,a),h=Math.min(s,l),d=r<a&&s<a||r>l&&s>l;return{count:i,start:u,loop:t.loop,ilen:h<u&&!d?i+h-u:h-u}}function aP(n,t,e,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:h}=Rb(r,e,i),d=oP(s);let{move:b=!0,reverse:_}=i||{},x,S,C;for(x=0;x<=h;++x)S=r[(l+(_?h-x:x))%a],!S.skip&&(b?(n.moveTo(S.x,S.y),b=!1):d(n,C,S,_,s.stepped),C=S);return u&&(S=r[(l+(_?h:0))%a],d(n,C,S,_,s.stepped)),!!u}function cP(n,t,e,i){const r=t.points,{count:s,start:a,ilen:l}=Rb(r,e,i),{move:u=!0,reverse:h}=i||{};let d=0,b=0,_,x,S,C,T,P;const R=H=>(a+(h?l-H:H))%s,B=()=>{C!==T&&(n.lineTo(d,T),n.lineTo(d,C),n.lineTo(d,P))};for(u&&(x=r[R(0)],n.moveTo(x.x,x.y)),_=0;_<=l;++_){if(x=r[R(_)],x.skip)continue;const H=x.x,D=x.y,L=H|0;L===S?(D<C?C=D:D>T&&(T=D),d=(b*d+H)/++b):(B(),n.lineTo(H,D),S=L,b=0,C=T=D),P=D}B()}function sf(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?cP:aP}function lP(n){return n.stepped?ak:n.tension||n.cubicInterpolationMode==="monotone"?ck:er}function uP(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),Mb(n,t.options),n.stroke(r)}function hP(n,t,e,i){const{segments:r,options:s}=t,a=sf(t);for(const l of r)Mb(n,s,l.style),n.beginPath(),a(n,t,l,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const fP=typeof Path2D=="function";function dP(n,t,e,i){fP&&!t.options.segment?uP(n,t,e,i):hP(n,t,e,i)}class Si extends oi{constructor(t){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,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;QA(this._points,i,t,r,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=pk(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,r=t[e],s=this.points,a=vb(this,{property:e,start:r,end:r});if(!a.length)return;const l=[],u=lP(i);let h,d;for(h=0,d=a.length;h<d;++h){const{start:b,end:_}=a[h],x=s[b],S=s[_];if(x===S){l.push(x);continue}const C=Math.abs((r-x[e])/(S[e]-x[e])),T=u(x,S,C,i.stepped);T[e]=t[e],l.push(T)}return l.length===1?l[0]:l}pathSegment(t,e,i){return sf(this)(t,this,e,i)}path(t,e,i){const r=this.segments,s=sf(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const l of r)a&=s(t,this,l,{start:e,end:e+i-1});return!!a}draw(t,e,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),dP(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Z(Si,"id","line"),Z(Si,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Z(Si,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Z(Si,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Tm(n,t,e,i){const r=n.options,{[e]:s}=n.getProps([e],i);return Math.abs(t-s)<r.radius+r.hitRadius}class $c extends oi{constructor(e){super();Z(this,"parsed");Z(this,"skip");Z(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,i,r){const s=this.options,{x:a,y:l}=this.getProps(["x","y"],r);return Math.pow(e-a,2)+Math.pow(i-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(e,i){return Tm(this,e,"x",i)}inYRange(e,i){return Tm(this,e,"y",i)}getCenterPoint(e){const{x:i,y:r}=this.getProps(["x","y"],e);return{x:i,y:r}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const r=i&&e.borderWidth||0;return(i+r)*2}draw(e,i){const r=this.options;this.skip||r.radius<.1||!ri(this,i,this.size(r)/2)||(e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.fillStyle=r.backgroundColor,tf(e,r,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}Z($c,"id","point"),Z($c,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Z($c,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Db(n,t){const{x:e,y:i,base:r,width:s,height:a}=n.getProps(["x","y","base","width","height"],t);let l,u,h,d,b;return n.horizontal?(b=a/2,l=Math.min(e,r),u=Math.max(e,r),h=i-b,d=i+b):(b=s/2,l=e-b,u=e+b,h=Math.min(i,r),d=Math.max(i,r)),{left:l,top:h,right:u,bottom:d}}function Ti(n,t,e,i){return n?0:ae(t,e,i)}function pP(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,s=ob(i);return{t:Ti(r.top,s.top,0,e),r:Ti(r.right,s.right,0,t),b:Ti(r.bottom,s.bottom,0,e),l:Ti(r.left,s.left,0,t)}}function gP(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,s=ar(r),a=Math.min(t,e),l=n.borderSkipped,u=i||xt(r);return{topLeft:Ti(!u||l.top||l.left,s.topLeft,0,a),topRight:Ti(!u||l.top||l.right,s.topRight,0,a),bottomLeft:Ti(!u||l.bottom||l.left,s.bottomLeft,0,a),bottomRight:Ti(!u||l.bottom||l.right,s.bottomRight,0,a)}}function mP(n){const t=Db(n),e=t.right-t.left,i=t.bottom-t.top,r=pP(n,e/2,i/2),s=gP(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:e-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function Nh(n,t,e,i){const r=t===null,s=e===null,l=n&&!(r&&s)&&Db(n,i);return l&&(r||ni(t,l.left,l.right))&&(s||ni(e,l.top,l.bottom))}function vP(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function bP(n,t){n.rect(t.x,t.y,t.w,t.h)}function Fh(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,s=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+s,h:n.h+a,radius:n.radius}}class Xc extends oi{constructor(t){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,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:a}=mP(this),l=vP(a.radius)?Ro:bP;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,Fh(a,e,s)),t.clip(),l(t,Fh(s,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,Fh(s,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return Nh(this,t,e,i)}inXRange(t,e){return Nh(this,t,null,e)}inYRange(t,e){return Nh(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(e+r)/2:e,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Z(Xc,"id","bar"),Z(Xc,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Z(Xc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var yP=Object.freeze({__proto__:null,ArcElement:po,BarElement:Xc,LineElement:Si,PointElement:$c});const of=["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)"],Om=of.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Lb(n){return of[n%of.length]}function Ib(n){return Om[n%Om.length]}function _P(n,t){return n.borderColor=Lb(t),n.backgroundColor=Ib(t),++t}function wP(n,t){return n.backgroundColor=n.data.map(()=>Lb(t++)),t}function xP(n,t){return n.backgroundColor=n.data.map(()=>Ib(t++)),t}function SP(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof rr?t=wP(e,t):r instanceof To?t=xP(e,t):r&&(t=_P(e,t))}}function Cm(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function TP(n){return n&&(n.borderColor||n.backgroundColor)}function OP(){return Ut.borderColor!=="rgba(0,0,0,0.1)"||Ut.backgroundColor!=="rgba(0,0,0,0.1)"}var CP={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:s}=r,a=Cm(i)||TP(r)||s&&Cm(s)||OP();if(!e.forceOverride&&a)return;const l=SP(n);i.forEach(l)}};function AP(n,t,e,i,r){const s=r.samples||i;if(s>=e)return n.slice(t,t+e);const a=[],l=(e-2)/(s-2);let u=0;const h=t+e-1;let d=t,b,_,x,S,C;for(a[u++]=n[d],b=0;b<s-2;b++){let T=0,P=0,R;const B=Math.floor((b+1)*l)+1+t,H=Math.min(Math.floor((b+2)*l)+1,e)+t,D=H-B;for(R=B;R<H;R++)T+=n[R].x,P+=n[R].y;T/=D,P/=D;const L=Math.floor(b*l)+1+t,N=Math.min(Math.floor((b+1)*l)+1,e)+t,{x:W,y:V}=n[d];for(x=S=-1,R=L;R<N;R++)S=.5*Math.abs((W-T)*(n[R].y-V)-(W-n[R].x)*(P-V)),S>x&&(x=S,_=n[R],C=R);a[u++]=_,d=C}return a[u++]=n[h],a}function kP(n,t,e,i){let r=0,s=0,a,l,u,h,d,b,_,x,S,C;const T=[],P=t+e-1,R=n[t].x,H=n[P].x-R;for(a=t;a<t+e;++a){l=n[a],u=(l.x-R)/H*i,h=l.y;const D=u|0;if(D===d)h<S?(S=h,b=a):h>C&&(C=h,_=a),r=(s*r+l.x)/++s;else{const L=a-1;if(!_t(b)&&!_t(_)){const N=Math.min(b,_),W=Math.max(b,_);N!==x&&N!==L&&T.push({...n[N],x:r}),W!==x&&W!==L&&T.push({...n[W],x:r})}a>0&&L!==x&&T.push(n[L]),T.push(l),d=D,s=0,S=C=h,b=_=x=a}}return T}function Nb(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Am(n){n.data.datasets.forEach(t=>{Nb(t)})}function EP(n,t){const e=t.length;let i=0,r;const{iScale:s}=n,{min:a,max:l,minDefined:u,maxDefined:h}=s.getUserBounds();return u&&(i=ae(ii(t,s.axis,a).lo,0,e-1)),h?r=ae(ii(t,s.axis,l).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var PP={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Am(n);return}const i=n.width;n.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:l}=r,u=n.getDatasetMeta(s),h=a||r.data;if(ho([l,n.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const d=n.scales[u.xAxisID];if(d.type!=="linear"&&d.type!=="time"||n.options.parsing)return;let{start:b,count:_}=EP(u,h);const x=e.threshold||4*i;if(_<=x){Nb(r);return}_t(a)&&(r._data=h,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(C){this._data=C}}));let S;switch(e.algorithm){case"lttb":S=AP(h,b,_,i,e);break;case"min-max":S=kP(h,b,_,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=S})},destroy(n){Am(n)}};function MP(n,t,e){const i=n.segments,r=n.points,s=t.points,a=[];for(const l of i){let{start:u,end:h}=l;h=yl(u,h,r);const d=af(e,r[u],r[h],l.loop);if(!t.segments){a.push({source:l,target:d,start:r[u],end:r[h]});continue}const b=vb(t,d);for(const _ of b){const x=af(e,s[_.start],s[_.end],_.loop),S=mb(l,r,x);for(const C of S)a.push({source:C,target:_,start:{[e]:km(d,x,"start",Math.max)},end:{[e]:km(d,x,"end",Math.min)}})}}return a}function af(n,t,e,i){if(i)return;let r=t[n],s=e[n];return n==="angle"&&(r=ge(r),s=ge(s)),{property:n,start:r,end:s}}function RP(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:l})=>{l=yl(a,l,r);const u=r[a],h=r[l];i!==null?(s.push({x:u.x,y:i}),s.push({x:h.x,y:i})):e!==null&&(s.push({x:e,y:u.y}),s.push({x:e,y:h.y}))}),s}function yl(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function km(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Fb(n,t){let e=[],i=!1;return jt(n)?(i=!0,e=n):e=RP(n,t),e.length?new Si({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Em(n){return n&&n.fill!==!1}function DP(n,t,e){let r=n[t].fill;const s=[t];let a;if(!e)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!Xt(r))return r;if(a=n[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function LP(n,t,e){const i=BP(n);if(xt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return Xt(r)&&Math.floor(r)===r?IP(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function IP(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function NP(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:xt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function FP(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:xt(n)?i=n.value:i=t.getBaseValue(),i}function BP(n){const t=n.options,e=t.fill;let i=dt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function HP(n){const{scale:t,index:e,line:i}=n,r=[],s=i.segments,a=i.points,l=zP(t,e);l.push(Fb({x:null,y:t.bottom},i));for(let u=0;u<s.length;u++){const h=s[u];for(let d=h.start;d<=h.end;d++)WP(r,a[d],l)}return new Si({points:r,options:{}})}function zP(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||e.unshift(s.dataset)}return e}function WP(n,t,e){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{first:a,last:l,point:u}=jP(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(n.push(u),!l)break}}n.push(...i)}function jP(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],s=n.segments,a=n.points;let l=!1,u=!1;for(let h=0;h<s.length;h++){const d=s[h],b=a[d.start][e],_=a[d.end][e];if(ni(r,b,_)){l=r===b,u=r===_;break}}return{first:l,last:u,point:i}}class Bb{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:s,radius:a}=this;return e=e||{start:0,end:Bt},t.arc(r,s,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,s=t.angle;return{x:e+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function UP(n){const{chart:t,fill:e,line:i}=n;if(Xt(e))return VP(t,e);if(e==="stack")return HP(n);if(e==="shape")return!0;const r=qP(n);return r instanceof Bb?r:Fb(r,i)}function VP(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function qP(n){return(n.scale||{}).getPointPositionForValue?XP(n):$P(n)}function $P(n){const{scale:t={},fill:e}=n,i=NP(e,t);if(Xt(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function XP(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=FP(e,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new Bb({x:u.x,y:u.y,radius:t.getDistanceFromCenterForValue(a)})}for(let u=0;u<r;++u)l.push(t.getPointPositionForValue(u,a));return l}function Bh(n,t,e){const i=UP(t),{chart:r,index:s,line:a,scale:l,axis:u}=t,h=a.options,d=h.fill,b=h.backgroundColor,{above:_=b,below:x=b}=d||{},S=r.getDatasetMeta(s),C=bb(r,S);i&&a.points.length&&(gl(n,e),YP(n,{line:a,target:i,above:_,below:x,area:e,scale:l,axis:u,clip:C}),ml(n))}function YP(n,t){const{line:e,target:i,above:r,below:s,area:a,scale:l,clip:u}=t,h=e._loop?"angle":t.axis;n.save();let d=s;s!==r&&(h==="x"?(Pm(n,i,a.top),Hh(n,{line:e,target:i,color:r,scale:l,property:h,clip:u}),n.restore(),n.save(),Pm(n,i,a.bottom)):h==="y"&&(Mm(n,i,a.left),Hh(n,{line:e,target:i,color:s,scale:l,property:h,clip:u}),n.restore(),n.save(),Mm(n,i,a.right),d=r)),Hh(n,{line:e,target:i,color:d,scale:l,property:h,clip:u}),n.restore()}function Pm(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const l of i){const{start:u,end:h}=l,d=r[u],b=r[yl(u,h,r)];s?(n.moveTo(d.x,d.y),s=!1):(n.lineTo(d.x,e),n.lineTo(d.x,d.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(b.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Mm(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const l of i){const{start:u,end:h}=l,d=r[u],b=r[yl(u,h,r)];s?(n.moveTo(d.x,d.y),s=!1):(n.lineTo(e,d.y),n.lineTo(d.x,d.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(e,b.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function Hh(n,t){const{line:e,target:i,property:r,color:s,scale:a,clip:l}=t,u=MP(e,i,r);for(const{source:h,target:d,start:b,end:_}of u){const{style:{backgroundColor:x=s}={}}=h,S=i!==!0;n.save(),n.fillStyle=x,KP(n,a,l,S&&af(r,b,_)),n.beginPath();const C=!!e.pathSegment(n,h);let T;if(S){C?n.closePath():Rm(n,i,_,r);const P=!!i.pathSegment(n,d,{move:C,reverse:!0});T=C&&P,T||Rm(n,i,b,r)}n.closePath(),n.fill(T?"evenodd":"nonzero"),n.restore()}}function KP(n,t,e,i){const r=t.chart.chartArea,{property:s,start:a,end:l}=i||{};if(s==="x"||s==="y"){let u,h,d,b;s==="x"?(u=a,h=r.top,d=l,b=r.bottom):(u=r.left,h=a,d=r.right,b=l),n.beginPath(),e&&(u=Math.max(u,e.left),d=Math.min(d,e.right),h=Math.max(h,e.top),b=Math.min(b,e.bottom)),n.rect(u,h,d-u,b-h),n.clip()}}function Rm(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var GP={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let s,a,l,u;for(a=0;a<i;++a)s=n.getDatasetMeta(a),l=s.dataset,u=null,l&&l.options&&l instanceof Si&&(u={visible:n.isDatasetVisible(a),index:a,fill:LP(l,a,i),chart:n,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=u,r.push(u);for(a=0;a<i;++a)u=r[a],!(!u||u.fill===!1)&&(u.fill=DP(r,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),s=n.chartArea;for(let a=r.length-1;a>=0;--a){const l=r[a].$filler;l&&(l.line.updateControlPoints(s,l.axis),i&&l.fill&&Bh(n.ctx,l,s))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;Em(s)&&Bh(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Em(i)||e.drawTime!=="beforeDatasetDraw"||Bh(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Dm=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},JP=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Lm extends oi{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,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 t=this.options.labels||{};let e=Nt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=re(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:u}=Dm(i,s);let h,d;e.font=r.string,this.isHorizontal()?(h=this.maxWidth,d=this._fitRows(a,s,l,u)+10):(d=this.maxHeight,h=this._fitCols(a,r,l,u)+10),this.width=Math.min(h,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],h=this.lineWidths=[0],d=r+l;let b=t;s.textAlign="left",s.textBaseline="middle";let _=-1,x=-d;return this.legendItems.forEach((S,C)=>{const T=i+e/2+s.measureText(S.text).width;(C===0||h[h.length-1]+T+2*l>a)&&(b+=d,h[h.length-(C>0?0:1)]=0,x+=d,_++),u[C]={left:0,top:x,row:_,width:T,height:r},h[h.length-1]+=T+l}),b}_fitCols(t,e,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],h=this.columnSizes=[],d=a-t;let b=l,_=0,x=0,S=0,C=0;return this.legendItems.forEach((T,P)=>{const{itemWidth:R,itemHeight:B}=ZP(i,e,s,T,r);P>0&&x+B+2*l>d&&(b+=_+l,h.push({width:_,height:x}),S+=_+l,C++,_=x=0),u[P]={left:S,top:x,col:C,width:R,height:B},_=Math.max(_,R),x+=B+l}),b+=_,h.push({width:_,height:x}),b}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:s}}=this,a=Wr(s,this.left,this.width);if(this.isHorizontal()){let l=0,u=pe(i,this.left+r,this.right-this.lineWidths[l]);for(const h of e)l!==h.row&&(l=h.row,u=pe(i,this.left+r,this.right-this.lineWidths[l])),h.top+=this.top+t+r,h.left=a.leftForLtr(a.x(u),h.width),u+=h.width+r}else{let l=0,u=pe(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const h of e)h.col!==l&&(l=h.col,u=pe(i,this.top+t+r,this.bottom-this.columnSizes[l].height)),h.top=u,h.left+=this.left+r,h.left=a.leftForLtr(a.x(h.left),h.width),u+=h.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;gl(t,this),this._draw(),ml(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,l=Ut.color,u=Wr(t.rtl,this.left,this.width),h=re(a.font),{padding:d}=a,b=h.size,_=b/2;let x;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=h.string;const{boxWidth:S,boxHeight:C,itemHeight:T}=Dm(a,b),P=function(L,N,W){if(isNaN(S)||S<=0||isNaN(C)||C<0)return;r.save();const V=dt(W.lineWidth,1);if(r.fillStyle=dt(W.fillStyle,l),r.lineCap=dt(W.lineCap,"butt"),r.lineDashOffset=dt(W.lineDashOffset,0),r.lineJoin=dt(W.lineJoin,"miter"),r.lineWidth=V,r.strokeStyle=dt(W.strokeStyle,l),r.setLineDash(dt(W.lineDash,[])),a.usePointStyle){const X={radius:C*Math.SQRT2/2,pointStyle:W.pointStyle,rotation:W.rotation,borderWidth:V},K=u.xPlus(L,S/2),Q=N+_;sb(r,X,K,Q,a.pointStyleWidth&&S)}else{const X=N+Math.max((b-C)/2,0),K=u.leftForLtr(L,S),Q=ar(W.borderRadius);r.beginPath(),Object.values(Q).some(rt=>rt!==0)?Ro(r,{x:K,y:X,w:S,h:C,radius:Q}):r.rect(K,X,S,C),r.fill(),V!==0&&r.stroke()}r.restore()},R=function(L,N,W){dr(r,W.text,L,N+T/2,h,{strikethrough:W.hidden,textAlign:u.textAlign(W.textAlign)})},B=this.isHorizontal(),H=this._computeTitleHeight();B?x={x:pe(s,this.left+d,this.right-i[0]),y:this.top+d+H,line:0}:x={x:this.left+d,y:pe(s,this.top+H+d,this.bottom-e[0].height),line:0},db(this.ctx,t.textDirection);const D=T+d;this.legendItems.forEach((L,N)=>{r.strokeStyle=L.fontColor,r.fillStyle=L.fontColor;const W=r.measureText(L.text).width,V=u.textAlign(L.textAlign||(L.textAlign=a.textAlign)),X=S+_+W;let K=x.x,Q=x.y;u.setWidth(this.width),B?N>0&&K+X+d>this.right&&(Q=x.y+=D,x.line++,K=x.x=pe(s,this.left+d,this.right-i[x.line])):N>0&&Q+D>this.bottom&&(K=x.x=K+e[x.line].width+d,x.line++,Q=x.y=pe(s,this.top+H+d,this.bottom-e[x.line].height));const rt=u.x(K);if(P(rt,Q,L),K=vA(V,K+S+_,B?K+X:this.right,t.rtl),R(u.x(K),Q,L),B)x.x+=X+d;else if(typeof L.text!="string"){const lt=h.lineHeight;x.y+=Hb(L,lt)+d}else x.y+=D}),pb(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=re(e.font),r=be(e.padding);if(!e.display)return;const s=Wr(t.rtl,this.left,this.width),a=this.ctx,l=e.position,u=i.size/2,h=r.top+u;let d,b=this.left,_=this.width;if(this.isHorizontal())_=Math.max(...this.lineWidths),d=this.top+h,b=pe(t.align,b,this.right-_);else{const S=this.columnSizes.reduce((C,T)=>Math.max(C,T.height),0);d=h+pe(t.align,this.top,this.bottom-S-t.labels.padding-this._computeTitleHeight())}const x=pe(l,b,b+_);a.textAlign=s.textAlign(If(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,dr(a,e.text,x,d,i)}_computeTitleHeight(){const t=this.options.title,e=re(t.font),i=be(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,s;if(ni(t,this.left,this.right)&&ni(e,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],ni(t,r.left,r.left+r.width)&&ni(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!eM(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=JP(r,i);r&&!s&&Nt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Nt(e.onHover,[t,i,this],this)}else i&&Nt(e.onClick,[t,i,this],this)}}function ZP(n,t,e,i,r){const s=QP(i,n,t,e),a=tM(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function QP(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+e.size/2+i.measureText(r).width}function tM(n,t,e){let i=n;return typeof t.text!="string"&&(i=Hb(t,e)),i}function Hb(n,t){const e=n.text?n.text.length:0;return t*e}function eM(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var nM={id:"legend",_element:Lm,start(n,t,e){const i=n.legend=new Lm({ctx:n.ctx,options:e,chart:n});ve.configure(n,i,e),ve.addBox(n,i)},stop(n){ve.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;ve.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=n.legend.options;return n._getSortedDatasetMetas().map(u=>{const h=u.controller.getStyle(e?0:void 0),d=be(h.borderWidth);return{text:t[u.index].label,fillStyle:h.backgroundColor,fontColor:s,hidden:!u.visible,lineCap:h.borderCapStyle,lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:h.borderColor,pointStyle:i||h.pointStyle,rotation:h.rotation,textAlign:r||h.textAlign,borderRadius:a&&(l||h.borderRadius),datasetIndex:u.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class Vf extends oi{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=jt(i.text)?i.text.length:1;this._padding=be(i.padding);const s=r*re(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:s,options:a}=this,l=a.align;let u=0,h,d,b;return this.isHorizontal()?(d=pe(l,i,s),b=e+t,h=s-i):(a.position==="left"?(d=i+t,b=pe(l,r,e),u=At*-.5):(d=s-t,b=pe(l,e,r),u=At*.5),h=r-e),{titleX:d,titleY:b,maxWidth:h,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=re(e.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:u,rotation:h}=this._drawArgs(s);dr(t,e.text,0,0,i,{color:e.color,maxWidth:u,rotation:h,textAlign:If(e.align),textBaseline:"middle",translation:[a,l]})}}function iM(n,t){const e=new Vf({ctx:n.ctx,options:t,chart:n});ve.configure(n,e,t),ve.addBox(n,e),n.titleBlock=e}var rM={id:"title",_element:Vf,start(n,t,e){iM(n,e)},stop(n){const t=n.titleBlock;ve.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;ve.configure(n,i,e),i.options=e},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 Ec=new WeakMap;var sM={id:"subtitle",start(n,t,e){const i=new Vf({ctx:n.ctx,options:e,chart:n});ve.configure(n,i,e),ve.addBox(n,i),Ec.set(n,i)},stop(n){ve.removeBox(n,Ec.get(n)),Ec.delete(n)},beforeUpdate(n,t,e){const i=Ec.get(n);ve.configure(n,i,e),i.options=e},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 go={average(n){if(!n.length)return!1;let t,e,i=new Set,r=0,s=0;for(t=0,e=n.length;t<e;++t){const l=n[t].element;if(l&&l.hasValue()){const u=l.tooltipPosition();i.add(u.x),r+=u.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((l,u)=>l+u)/i.size,y:r/s}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,l;for(s=0,a=n.length;s<a;++s){const u=n[s].element;if(u&&u.hasValue()){const h=u.getCenterPoint(),d=Zh(t,h);d<r&&(r=d,l=u)}}if(l){const u=l.tooltipPosition();e=u.x,i=u.y}return{x:e,y:i}}};function Mn(n,t){return t&&(jt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function ti(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
||
`)>-1?n.split(`
|
||
`):n}function oM(n,t){const{element:e,datasetIndex:i,index:r}=t,s=n.getDatasetMeta(i).controller,{label:a,value:l}=s.getLabelAndValue(r);return{chart:n,label:a,parsed:s.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function Im(n,t){const e=n.chart.ctx,{body:i,footer:r,title:s}=n,{boxWidth:a,boxHeight:l}=t,u=re(t.bodyFont),h=re(t.titleFont),d=re(t.footerFont),b=s.length,_=r.length,x=i.length,S=be(t.padding);let C=S.height,T=0,P=i.reduce((H,D)=>H+D.before.length+D.lines.length+D.after.length,0);if(P+=n.beforeBody.length+n.afterBody.length,b&&(C+=b*h.lineHeight+(b-1)*t.titleSpacing+t.titleMarginBottom),P){const H=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;C+=x*H+(P-x)*u.lineHeight+(P-1)*t.bodySpacing}_&&(C+=t.footerMarginTop+_*d.lineHeight+(_-1)*t.footerSpacing);let R=0;const B=function(H){T=Math.max(T,e.measureText(H).width+R)};return e.save(),e.font=h.string,Dt(n.title,B),e.font=u.string,Dt(n.beforeBody.concat(n.afterBody),B),R=t.displayColors?a+2+t.boxPadding:0,Dt(i,H=>{Dt(H.before,B),Dt(H.lines,B),Dt(H.after,B)}),R=0,e.font=d.string,Dt(n.footer,B),e.restore(),T+=S.width,{width:T,height:C}}function aM(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function cM(n,t,e,i){const{x:r,width:s}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&r+s+a>t.width||n==="right"&&r-s-a<0)return!0}function lM(n,t,e,i){const{x:r,width:s}=e,{width:a,chartArea:{left:l,right:u}}=n;let h="center";return i==="center"?h=r<=(l+u)/2?"left":"right":r<=s/2?h="left":r>=a-s/2&&(h="right"),cM(h,n,t,e)&&(h="center"),h}function Nm(n,t,e){const i=e.yAlign||t.yAlign||aM(n,e);return{xAlign:e.xAlign||t.xAlign||lM(n,t,e,i),yAlign:i}}function uM(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function hM(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Fm(n,t,e,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=n,{xAlign:l,yAlign:u}=e,h=r+s,{topLeft:d,topRight:b,bottomLeft:_,bottomRight:x}=ar(a);let S=uM(t,l);const C=hM(t,u,h);return u==="center"?l==="left"?S+=h:l==="right"&&(S-=h):l==="left"?S-=Math.max(d,_)+r:l==="right"&&(S+=Math.max(b,x)+r),{x:ae(S,0,i.width-t.width),y:ae(C,0,i.height-t.height)}}function Pc(n,t,e){const i=be(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Bm(n){return Mn([],ti(n))}function fM(n,t,e){return Pi(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Hm(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const zb={beforeTitle:Zn,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Zn,beforeBody:Zn,beforeLabel:Zn,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return _t(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Zn,afterBody:Zn,beforeFooter:Zn,footer:Zn,afterFooter:Zn};function Ie(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?zb[t].call(e,i):r}class cf extends oi{constructor(t){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=t.chart,this.options=t.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(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,s=new yb(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=fM(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=Ie(i,"beforeTitle",this,t),s=Ie(i,"title",this,t),a=Ie(i,"afterTitle",this,t);let l=[];return l=Mn(l,ti(r)),l=Mn(l,ti(s)),l=Mn(l,ti(a)),l}getBeforeBody(t,e){return Bm(Ie(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return Dt(t,s=>{const a={before:[],lines:[],after:[]},l=Hm(i,s);Mn(a.before,ti(Ie(l,"beforeLabel",this,s))),Mn(a.lines,Ie(l,"label",this,s)),Mn(a.after,ti(Ie(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,e){return Bm(Ie(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=Ie(i,"beforeFooter",this,t),s=Ie(i,"footer",this,t),a=Ie(i,"afterFooter",this,t);let l=[];return l=Mn(l,ti(r)),l=Mn(l,ti(s)),l=Mn(l,ti(a)),l}_createItems(t){const e=this._active,i=this.chart.data,r=[],s=[],a=[];let l=[],u,h;for(u=0,h=e.length;u<h;++u)l.push(oM(this.chart,e[u]));return t.filter&&(l=l.filter((d,b,_)=>t.filter(d,b,_,i))),t.itemSort&&(l=l.sort((d,b)=>t.itemSort(d,b,i))),Dt(l,d=>{const b=Hm(t.callbacks,d);r.push(Ie(b,"labelColor",this,d)),s.push(Ie(b,"labelPointStyle",this,d)),a.push(Ie(b,"labelTextColor",this,d))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let s,a=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=go[i.position].call(this,r,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const u=this._size=Im(this,i),h=Object.assign({},l,u),d=Nm(this.chart,i,h),b=Fm(i,h,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,s={opacity:1,x:b.x,y:b.y,width:u.width,height:u.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const s=this.getCaretPosition(t,i,r);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:u,topRight:h,bottomLeft:d,bottomRight:b}=ar(l),{x:_,y:x}=t,{width:S,height:C}=e;let T,P,R,B,H,D;return s==="center"?(H=x+C/2,r==="left"?(T=_,P=T-a,B=H+a,D=H-a):(T=_+S,P=T+a,B=H-a,D=H+a),R=T):(r==="left"?P=_+Math.max(u,d)+a:r==="right"?P=_+S-Math.max(h,b)-a:P=this.caretX,s==="top"?(B=x,H=B-a,T=P-a,R=P+a):(B=x+C,H=B+a,T=P+a,R=P-a),D=B),{x1:T,x2:P,x3:R,y1:B,y2:H,y3:D}}drawTitle(t,e,i){const r=this.title,s=r.length;let a,l,u;if(s){const h=Wr(i.rtl,this.x,this.width);for(t.x=Pc(this,i.titleAlign,i),e.textAlign=h.textAlign(i.titleAlign),e.textBaseline="middle",a=re(i.titleFont),l=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,u=0;u<s;++u)e.fillText(r[u],h.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,u+1===s&&(t.y+=i.titleMarginBottom-l)}}_drawColorBox(t,e,i,r,s){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:u,boxWidth:h}=s,d=re(s.bodyFont),b=Pc(this,"left",s),_=r.x(b),x=u<d.lineHeight?(d.lineHeight-u)/2:0,S=e.y+x;if(s.usePointStyle){const C={radius:Math.min(h,u)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},T=r.leftForLtr(_,h)+h/2,P=S+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,tf(t,C,T,P),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,tf(t,C,T,P)}else{t.lineWidth=xt(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const C=r.leftForLtr(_,h),T=r.leftForLtr(r.xPlus(_,1),h-2),P=ar(a.borderRadius);Object.values(P).some(R=>R!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Ro(t,{x:C,y:S,w:h,h:u,radius:P}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Ro(t,{x:T,y:S+1,w:h-2,h:u-2,radius:P}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(C,S,h,u),t.strokeRect(C,S,h,u),t.fillStyle=a.backgroundColor,t.fillRect(T,S+1,h-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:l,boxHeight:u,boxWidth:h,boxPadding:d}=i,b=re(i.bodyFont);let _=b.lineHeight,x=0;const S=Wr(i.rtl,this.x,this.width),C=function(W){e.fillText(W,S.x(t.x+x),t.y+_/2),t.y+=_+s},T=S.textAlign(a);let P,R,B,H,D,L,N;for(e.textAlign=a,e.textBaseline="middle",e.font=b.string,t.x=Pc(this,T,i),e.fillStyle=i.bodyColor,Dt(this.beforeBody,C),x=l&&T!=="right"?a==="center"?h/2+d:h+2+d:0,H=0,L=r.length;H<L;++H){for(P=r[H],R=this.labelTextColors[H],e.fillStyle=R,Dt(P.before,C),B=P.lines,l&&B.length&&(this._drawColorBox(e,t,H,S,i),_=Math.max(b.lineHeight,u)),D=0,N=B.length;D<N;++D)C(B[D]),_=b.lineHeight;Dt(P.after,C)}x=0,_=b.lineHeight,Dt(this.afterBody,C),t.y-=s}drawFooter(t,e,i){const r=this.footer,s=r.length;let a,l;if(s){const u=Wr(i.rtl,this.x,this.width);for(t.x=Pc(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=u.textAlign(i.footerAlign),e.textBaseline="middle",a=re(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,l=0;l<s;++l)e.fillText(r[l],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:s,yAlign:a}=this,{x:l,y:u}=t,{width:h,height:d}=i,{topLeft:b,topRight:_,bottomLeft:x,bottomRight:S}=ar(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(l+b,u),a==="top"&&this.drawCaret(t,e,i,r),e.lineTo(l+h-_,u),e.quadraticCurveTo(l+h,u,l+h,u+_),a==="center"&&s==="right"&&this.drawCaret(t,e,i,r),e.lineTo(l+h,u+d-S),e.quadraticCurveTo(l+h,u+d,l+h-S,u+d),a==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(l+x,u+d),e.quadraticCurveTo(l,u+d,l,u+d-x),a==="center"&&s==="left"&&this.drawCaret(t,e,i,r),e.lineTo(l,u+b),e.quadraticCurveTo(l,u,l+b,u),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=go[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Im(this,t),u=Object.assign({},a,this._size),h=Nm(e,t,u),d=Fm(t,u,h,e);(r._to!==d.x||s._to!==d.y)&&(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=be(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,e),db(t,e.textDirection),s.y+=a.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),pb(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:l,index:u})=>{const h=this.chart.getDatasetMeta(l);if(!h)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:h.data[u],index:u}}),s=!tl(i,r),a=this._positionChanged(r,e);(s||a)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,e,i),l=this._positionChanged(a,t),u=e||!tl(a,s)||l;return u&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),u}_getActiveElements(t,e,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return e.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:r,options:s}=this,a=go[s.position].call(this,t,e);return a!==!1&&(i!==a.x||r!==a.y)}}Z(cf,"positioners",go);var dM={id:"tooltip",_element:cf,positioners:go,afterInit(n,t,e){e&&(n.tooltip=new cf({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,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:(n,t)=>t.bodyFont.size,boxWidth:(n,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:zb},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},pM=Object.freeze({__proto__:null,Colors:CP,Decimation:PP,Filler:GP,Legend:nM,SubTitle:sM,Title:rM,Tooltip:dM});const gM=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function mM(n,t,e,i){const r=n.indexOf(t);if(r===-1)return gM(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const vM=(n,t)=>n===null?null:ae(Math.round(n),0,t);function zm(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class lf extends pr{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:s}of e)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(_t(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:mM(i,t,dt(e,t),this._addedLabels),vM(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)r.push({value:a});return r}getLabelForValue(t){return zm.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Z(lf,"id","category"),Z(lf,"defaults",{ticks:{callback:zm}});function bM(n,t){const e=[],{bounds:r,step:s,min:a,max:l,precision:u,count:h,maxTicks:d,maxDigits:b,includeBounds:_}=n,x=s||1,S=d-1,{min:C,max:T}=t,P=!_t(a),R=!_t(l),B=!_t(h),H=(T-C)/(b+1);let D=Ig((T-C)/S/x)*x,L,N,W,V;if(D<1e-14&&!P&&!R)return[{value:C},{value:T}];V=Math.ceil(T/D)-Math.floor(C/D),V>S&&(D=Ig(V*D/S/x)*x),_t(u)||(L=Math.pow(10,u),D=Math.ceil(D*L)/L),r==="ticks"?(N=Math.floor(C/D)*D,W=Math.ceil(T/D)*D):(N=C,W=T),P&&R&&s&&uA((l-a)/s,D/1e3)?(V=Math.round(Math.min((l-a)/D,d)),D=(l-a)/V,N=a,W=l):B?(N=P?a:N,W=R?l:W,V=h-1,D=(W-N)/V):(V=(W-N)/D,wo(V,Math.round(V),D/1e3)?V=Math.round(V):V=Math.ceil(V));const X=Math.max(Ng(D),Ng(N));L=Math.pow(10,_t(u)?X:u),N=Math.round(N*L)/L,W=Math.round(W*L)/L;let K=0;for(P&&(_&&N!==a?(e.push({value:a}),N<a&&K++,wo(Math.round((N+K*D)*L)/L,a,Wm(a,H,n))&&K++):N<a&&K++);K<V;++K){const Q=Math.round((N+K*D)*L)/L;if(R&&Q>l)break;e.push({value:Q})}return R&&_&&W!==l?e.length&&wo(e[e.length-1].value,l,Wm(l,H,n))?e[e.length-1].value=l:e.push({value:l}):(!R||W===l)&&e.push({value:W}),e}function Wm(n,t,{horizontal:e,minRotation:i}){const r=mn(i),s=(e?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+n).length;return Math.min(t/s,a)}class al extends pr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return _t(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=e?r:u,l=u=>s=i?s:u;if(t){const u=Ln(r),h=Ln(s);u<0&&h<0?l(0):u>0&&h>0&&a(0)}if(r===s){let u=s===0?1:Math.abs(s*.05);l(s+u),t||a(r-u)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},s=this._range||this,a=bM(r,s);return t.bounds==="ticks"&&Gv(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Vo(t,this.chart.options.locale,this.options.ticks.format)}}class uf extends al{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Xt(t)?t:0,this.max=Xt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=mn(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Z(uf,"id","linear"),Z(uf,"defaults",{ticks:{callback:pl.formatters.numeric}});const Lo=n=>Math.floor(xi(n)),Zi=(n,t)=>Math.pow(10,Lo(n)+t);function jm(n){return n/Math.pow(10,Lo(n))===1}function Um(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function yM(n,t){const e=t-n;let i=Lo(e);for(;Um(n,t,i)>10;)i++;for(;Um(n,t,i)<10;)i--;return Math.min(i,Lo(n))}function _M(n,{min:t,max:e}){t=Ke(n.min,t);const i=[],r=Lo(t);let s=yM(t,e),a=s<0?Math.pow(10,Math.abs(s)):1;const l=Math.pow(10,s),u=r>s?Math.pow(10,r):0,h=Math.round((t-u)*a)/a,d=Math.floor((t-u)/l/10)*l*10;let b=Math.floor((h-d)/Math.pow(10,s)),_=Ke(n.min,Math.round((u+d+b*Math.pow(10,s))*a)/a);for(;_<e;)i.push({value:_,major:jm(_),significand:b}),b>=10?b=b<15?15:20:b++,b>=20&&(s++,b=2,a=s>=0?1:a),_=Math.round((u+d+b*Math.pow(10,s))*a)/a;const x=Ke(n.max,_);return i.push({value:x,major:jm(x),significand:b}),i}class hf extends pr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=al.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Xt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Xt(t)?Math.max(0,t):null,this.max=Xt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Xt(this._userMin)&&(this.min=t===Zi(this.min,0)?Zi(this.min,-1):Zi(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,a=l=>r=e?r:l;i===r&&(i<=0?(s(1),a(10)):(s(Zi(i,-1)),a(Zi(r,1)))),i<=0&&s(Zi(r,-1)),r<=0&&a(Zi(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=_M(e,this);return t.bounds==="ticks"&&Gv(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Vo(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=xi(t),this._valueRange=xi(this.max)-xi(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(xi(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}Z(hf,"id","logarithmic"),Z(hf,"defaults",{ticks:{callback:pl.formatters.logarithmic,major:{enabled:!0}}});function ff(n){const t=n.ticks;if(t.display&&n.display){const e=be(t.backdropPadding);return dt(t.font&&t.font.size,Ut.font.size)+e.height}return 0}function wM(n,t,e){return e=jt(e)?e:[e],{w:AA(n,t.string,e),h:e.length*t.lineHeight}}function Vm(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function xM(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],s=n._pointLabels.length,a=n.options.pointLabels,l=a.centerPointLabels?At/s:0;for(let u=0;u<s;u++){const h=a.setContext(n.getPointLabelContext(u));r[u]=h.padding;const d=n.getPointPosition(u,n.drawingArea+r[u],l),b=re(h.font),_=wM(n.ctx,b,n._pointLabels[u]);i[u]=_;const x=ge(n.getIndexAngle(u)+l),S=Math.round(Df(x)),C=Vm(S,d.x,_.w,0,180),T=Vm(S,d.y,_.h,90,270);SM(e,t,x,C,T)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=CM(n,i,r)}function SM(n,t,e,i,r){const s=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let l=0,u=0;i.start<t.l?(l=(t.l-i.start)/s,n.l=Math.min(n.l,t.l-l)):i.end>t.r&&(l=(i.end-t.r)/s,n.r=Math.max(n.r,t.r+l)),r.start<t.t?(u=(t.t-r.start)/a,n.t=Math.min(n.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/a,n.b=Math.max(n.b,t.b+u))}function TM(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:s,padding:a,size:l}=e,u=n.getPointPosition(t,i+r+a,s),h=Math.round(Df(ge(u.angle+Gt))),d=EM(u.y,l.h,h),b=AM(h),_=kM(u.x,l.w,b);return{visible:!0,x:u.x,y:d,textAlign:b,left:_,top:d,right:_+l.w,bottom:d+l.h}}function OM(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:s}=n;return!(ri({x:e,y:i},t)||ri({x:e,y:s},t)||ri({x:r,y:i},t)||ri({x:r,y:s},t))}function CM(n,t,e){const i=[],r=n._pointLabels.length,s=n.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:ff(s)/2,additionalAngle:a?At/r:0};let h;for(let d=0;d<r;d++){u.padding=e[d],u.size=t[d];const b=TM(n,d,u);i.push(b),l==="auto"&&(b.visible=OM(b,h),b.visible&&(h=b))}return i}function AM(n){return n===0||n===180?"center":n<180?"left":"right"}function kM(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function EM(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function PM(n,t,e){const{left:i,top:r,right:s,bottom:a}=e,{backdropColor:l}=t;if(!_t(l)){const u=ar(t.borderRadius),h=be(t.backdropPadding);n.fillStyle=l;const d=i-h.left,b=r-h.top,_=s-i+h.width,x=a-r+h.height;Object.values(u).some(S=>S!==0)?(n.beginPath(),Ro(n,{x:d,y:b,w:_,h:x,radius:u}),n.fill()):n.fillRect(d,b,_,x)}}function MM(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const s=n._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(n.getPointLabelContext(r));PM(e,a,s);const l=re(a.font),{x:u,y:h,textAlign:d}=s;dr(e,n._pointLabels[r],u,h+l.lineHeight/2,l,{color:a.color,textAlign:d,textBaseline:"middle"})}}function Wb(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,Bt);else{let s=n.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=n.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function RM(n,t,e,i,r){const s=n.ctx,a=t.circular,{color:l,lineWidth:u}=t;!a&&!i||!l||!u||e<0||(s.save(),s.strokeStyle=l,s.lineWidth=u,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),Wb(n,e,a,i),s.closePath(),s.stroke(),s.restore())}function DM(n,t,e){return Pi(n,{label:e,index:t,type:"pointLabel"})}class mo extends al{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=be(ff(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Xt(t)&&!isNaN(t)?t:0,this.max=Xt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ff(this.options))}generateTickLabels(t){al.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=Nt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?xM(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=Bt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ge(t*e+mn(i))}getDistanceFromCenterForValue(t){if(_t(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(_t(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return DM(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-Gt+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Wb(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:r,border:s}=e,a=this._pointLabels.length;let l,u,h;if(e.pointLabels.display&&MM(this,a),r.display&&this.ticks.forEach((d,b)=>{if(b!==0||b===0&&this.min<0){u=this.getDistanceFromCenterForValue(d.value);const _=this.getContext(b),x=r.setContext(_),S=s.setContext(_);RM(this,x,u,a,S)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const d=i.setContext(this.getPointLabelContext(l)),{color:b,lineWidth:_}=d;!_||!b||(t.lineWidth=_,t.strokeStyle=b,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,u=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),h=this.getPointPosition(l,u),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(h.x,h.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,u)=>{if(u===0&&this.min>=0&&!e.reverse)return;const h=i.setContext(this.getContext(u)),d=re(h.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),h.showLabelBackdrop){t.font=d.string,a=t.measureText(l.label).width,t.fillStyle=h.backdropColor;const b=be(h.backdropPadding);t.fillRect(-a/2-b.left,-s-d.size/2-b.top,a+b.width,d.size+b.height)}dr(t,l.label,0,-s,d,{color:h.color,strokeColor:h.textStrokeColor,strokeWidth:h.textStrokeWidth})}),t.restore()}drawTitle(){}}Z(mo,"id","radialLinear"),Z(mo,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:pl.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Z(mo,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Z(mo,"descriptors",{angleLines:{_fallback:"grid"}});const _l={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}},Ne=Object.keys(_l);function qm(n,t){return n-t}function $m(n,t){if(_t(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:s}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),Xt(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(r&&(a=r==="week"&&(Xr(s)||s===!0)?e.startOf(a,"isoWeek",s):e.startOf(a,r)),+a)}function Xm(n,t,e,i){const r=Ne.length;for(let s=Ne.indexOf(n);s<r-1;++s){const a=_l[Ne[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(l*a.size))<=i)return Ne[s]}return Ne[r-1]}function LM(n,t,e,i,r){for(let s=Ne.length-1;s>=Ne.indexOf(e);s--){const a=Ne[s];if(_l[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return Ne[e?Ne.indexOf(e):0]}function IM(n){for(let t=Ne.indexOf(n)+1,e=Ne.length;t<e;++t)if(_l[Ne[t]].common)return Ne[t]}function Ym(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=Lf(e,t),s=e[i]>=t?e[i]:e[r];n[s]=!0}}function NM(n,t,e,i){const r=n._adapter,s=+r.startOf(t[0].value,i),a=t[t.length-1].value;let l,u;for(l=s;l<=a;l=+r.add(l,1,i))u=e[l],u>=0&&(t[u].major=!0);return t}function Km(n,t,e){const i=[],r={},s=t.length;let a,l;for(a=0;a<s;++a)l=t[a],r[l]=a,i.push({value:l,major:!1});return s===0||!e?i:NM(n,i,r,e)}class Io extends pr{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),r=this._adapter=new Vk._date(t.adapters.date);r.init(e),_o(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:$m(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:r,max:s,minDefined:a,maxDefined:l}=this.getUserBounds();function u(h){!a&&!isNaN(h.min)&&(r=Math.min(r,h.min)),!l&&!isNaN(h.max)&&(s=Math.max(s,h.max))}(!a||!l)&&(u(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&u(this.getMinMax(!1))),r=Xt(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),s=Xt(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,a=this.max,l=pA(r,s,a);return this._unit=e.unit||(i.autoSkip?Xm(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):LM(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:IM(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),Km(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=ae(e,0,a),i=ae(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||Xm(s.minUnit,e,i,this._getLabelCapacity(e)),l=dt(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,h=Xr(u)||u===!0,d={};let b=e,_,x;if(h&&(b=+t.startOf(b,"isoWeek",u)),b=+t.startOf(b,h?"day":a),t.diff(i,e,a)>1e5*l)throw new Error(e+" and "+i+" are too far apart with stepSize of "+l+" "+a);const S=r.ticks.source==="data"&&this.getDataTimestamps();for(_=b,x=0;_<i;_=+t.add(_,l,a),x++)Ym(d,_,S);return(_===i||r.bounds==="ticks"||x===1)&&Ym(d,_,S),Object.keys(d).sort(qm).map(C=>+C)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const r=this.options.time.displayFormats,s=this._unit,a=e||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,r){const s=this.options,a=s.ticks.callback;if(a)return Nt(a,[t,e,i],this);const l=s.time.displayFormats,u=this._unit,h=this._majorUnit,d=u&&l[u],b=h&&l[h],_=i[e],x=h&&b&&_&&_.major;return this._adapter.format(t,r||(x?b:d))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=mn(this.isHorizontal()?e.maxRotation:e.minRotation),s=Math.cos(r),a=Math.sin(r),l=this._resolveTickFontOptions(0).size;return{w:i*s+l*a,h:i*a+l*s}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,Km(this,[t],this._majorUnit),r),a=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push($m(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Qv(t.sort(qm))}}Z(Io,"id","time"),Z(Io,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Mc(n,t,e){let i=0,r=n.length-1,s,a,l,u;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=ii(n,"pos",t)),{pos:s,time:l}=n[i],{pos:a,time:u}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=ii(n,"time",t)),{time:s,pos:l}=n[i],{time:a,pos:u}=n[r]);const h=a-s;return h?l+(u-l)*(t-s)/h:l}class df extends Io{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Mc(e,this.min),this._tableRange=Mc(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],s=[];let a,l,u,h,d;for(a=0,l=t.length;a<l;++a)h=t[a],h>=e&&h<=i&&r.push(h);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,l=r.length;a<l;++a)d=r[a+1],u=r[a-1],h=r[a],Math.round((d+u)/2)!==h&&s.push({time:h,pos:a/(l-1)});return s}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Mc(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Mc(this._table,i*this._tableRange+this._minPos,!0)}}Z(df,"id","timeseries"),Z(df,"defaults",Io.defaults);var FM=Object.freeze({__proto__:null,CategoryScale:lf,LinearScale:uf,LogarithmicScale:hf,RadialLinearScale:mo,TimeScale:Io,TimeSeriesScale:df});const qf=[Uk,yP,pM,FM];class BM{constructor(){this.heartbeatInterval=null,this.offlineTimeout=null,this.lastActivity=Date.now(),this.isOnline=!0,this.init()}init(){this.setupActivityTracking(),this.setupVisibilityHandling(),this.setupBeforeUnload(),this.startHeartbeat()}setupActivityTracking(){["mousedown","mousemove","keypress","scroll","touchstart"].forEach(e=>{document.addEventListener(e,()=>{this.updateActivity()},{passive:!0})})}setupVisibilityHandling(){document.addEventListener("visibilitychange",()=>{document.hidden?this.handleUserAway():this.handleUserBack()})}setupBeforeUnload(){window.addEventListener("beforeunload",()=>{this.setOffline()}),window.addEventListener("pagehide",()=>{this.setOffline()})}updateActivity(){const t=Date.now();t-this.lastActivity>15e3&&(this.lastActivity=t,this.offlineTimeout&&clearTimeout(this.offlineTimeout),this.offlineTimeout=setTimeout(()=>{this.setOffline()},3e5),this.notifyLivewireComponents("handleUserActivity"))}handleUserAway(){this.offlineTimeout&&clearTimeout(this.offlineTimeout),this.offlineTimeout=setTimeout(()=>{this.setOffline()},3e4)}handleUserBack(){this.lastActivity=Date.now(),this.heartbeat(),this.offlineTimeout&&clearTimeout(this.offlineTimeout),this.offlineTimeout=setTimeout(()=>{this.setOffline()},3e5)}startHeartbeat(){this.heartbeatInterval=setInterval(()=>{!document.hidden&&this.isOnline&&this.heartbeat()},3e4)}heartbeat(){this.getActiveGuards().forEach(e=>{var i;fetch("/presence/heartbeat",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":(i=document.querySelector('meta[name="csrf-token"]'))==null?void 0:i.content},body:JSON.stringify({guard:e})}).then(r=>{r.ok&&(this.isOnline=!0,this.notifyLivewireComponents("handleUserActivity"))}).catch(()=>{})})}setOffline(){if(!this.isOnline)return;this.getActiveGuards().forEach(e=>{var r;const i=JSON.stringify({guard:e});navigator.sendBeacon?navigator.sendBeacon("/presence/offline",i):fetch("/presence/offline",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":(r=document.querySelector('meta[name="csrf-token"]'))==null?void 0:r.content},body:i}).catch(()=>{})}),this.isOnline=!1,this.notifyLivewireComponents("handleUserOffline")}getActiveGuards(){const t=new Set;return document.querySelectorAll(".user-presence-container").forEach(e=>{const i=e.getAttribute("data-guard")||"web";t.add(i)}),Array.from(t)}notifyLivewireComponents(t){document.querySelectorAll("[wire\\:id]").forEach(e=>{const i=e.getAttribute("wire:id");if(i&&e.classList.contains("user-presence-container"))try{Livewire.find(i).call(t)}catch{}})}destroy(){this.heartbeatInterval&&clearInterval(this.heartbeatInterval),this.offlineTimeout&&clearTimeout(this.offlineTimeout),this.setOffline()}}document.addEventListener("DOMContentLoaded",()=>{window.presenceTracker=new BM});window.addEventListener("beforeunload",()=>{window.presenceTracker&&window.presenceTracker.destroy()});Ae.register(...qf);window.initReturnRatioChart=function(n,t=[]){var s;const e=document.getElementById("returnRatioChart");if(!e||!n||n.length===0)return;const i=n.map(a=>a.return_ratio);Math.min(...i),Math.max(...i);const r=e.getContext("2d");if(r){e.chart&&e.chart.destroy();try{const a=[];t&&t.length>0&&a.push({label:"Trend Line",data:t.map(d=>d.trend_value),borderColor:"#DC2626",backgroundColor:"transparent",borderWidth:3,borderDash:[8,4],tension:0,fill:!1,pointRadius:0,pointHoverRadius:0,order:1}),a.push({label:"Reciprocity Rate %",data:n.map(d=>d.return_ratio),borderColor:"#000",backgroundColor:"rgba(107, 114, 128, 0.1)",borderWidth:3,fill:!0,tension:.4,pointBackgroundColor:"#000",pointBorderColor:"#fff",pointBorderWidth:2,pointRadius:6,pointHoverRadius:8,order:0});const l=((s=n[0])==null?void 0:s.translations)||{period:"Period",return_ratio:"Reciprocity Rate"},u=new Ae(r,{type:"line",data:{labels:n.map(d=>d.label),datasets:a},options:{responsive:!0,maintainAspectRatio:!1,interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:!0,position:"top",align:"end",labels:{usePointStyle:!0,color:"#1F2937"}},tooltip:{enabled:!1,external:function(d){const b=d.tooltip;let _=document.getElementById("custom-tooltip");if(_||(_=document.createElement("div"),_.id="custom-tooltip",_.style.position="absolute",_.style.background="rgba(0, 0, 0, 0.8)",_.style.color="white",_.style.border="2px solid white",_.style.borderRadius="8px",_.style.pointerEvents="none",_.style.transform="translate(-50%, 0)",_.style.transition="all .1s ease",_.style.padding="10px",_.style.fontSize="12px",_.style.fontFamily="Arial, sans-serif",_.style.zIndex="9999",_.style.boxShadow="none",_.style.outline="none",document.body.appendChild(_)),b.opacity===0){_.style.opacity="0";return}if(b.body){const S=b.title||[],C=b.body.map(P=>P.lines);let T="";S.forEach(function(P){T+='<div style="font-weight: bold; margin-bottom: 5px;">'+P+"</div>"}),C.forEach(function(P,R){const B=b.labelColors[R],H='<span style="display: inline-block; width: 12px; height: 12px; background-color: '+B.backgroundColor+"; border: 1px solid "+B.borderColor+'; margin-right: 5px; vertical-align: middle;"></span>';let D=P[0];R===0?D="Trend: "+D.split(": ")[1]:D="Reciprocity Rate: "+D.split(": ")[1],T+='<div style="margin: 2px 0;">'+H+D+"</div>"}),_.innerHTML=T}const x=d.chart.canvas.getBoundingClientRect();_.style.opacity="1",_.style.left=x.left+window.pageXOffset+b.caretX+"px",_.style.top=x.top+window.pageYOffset+b.caretY+"px"}}},scales:{x:{display:!0,title:{display:!0,text:l.period,color:"#6B7280"},grid:{color:"rgba(0, 0, 0, 0.1)"},ticks:{color:"#6B7280"}},y:{display:!0,title:{display:!0,text:l.return_ratio,color:"#6B7280"},beginAtZero:!0,grid:{color:"rgba(0, 0, 0, 0.1)"},ticks:{color:"#6B7280",callback:function(d){return Math.round(d)+"%"}}}}}});e.chart=u,window.returnRatioChart=u,e.style.height="300px";const h=document.getElementById("chartLoadingIndicator");return h&&(h.style.display="none"),u}catch{return null}}};document.addEventListener("livewire:init",()=>{Livewire.on("openPdf",e=>{e&&window.open(e,"_blank")});function n(){const e=document.querySelector("[data-chart-data]");if(!e)return;const i=e.getAttribute("data-chart-data"),r=e.getAttribute("data-trend-data");if(i)try{const s=JSON.parse(i),a=r?JSON.parse(r):[];typeof window.initReturnRatioChart=="function"&&window.initReturnRatioChart(s,a)}catch{}}document.addEventListener("DOMContentLoaded",()=>{setTimeout(n,100)});let t=null;Livewire.hook("morph.updated",()=>{clearTimeout(t),t=setTimeout(()=>{n()},300)})});window.exportReturnRatioChartForPdf=async function(){if(!window.returnRatioChart)return null;try{const n=window.returnRatioChart,t=900,e=400,i=document.createElement("canvas");i.width=t,i.height=e;const r=i.getContext("2d"),s=new Ae(r,{type:n.config.type,data:JSON.parse(JSON.stringify(n.config.data)),options:{...JSON.parse(JSON.stringify(n.config.options||{})),responsive:!1,maintainAspectRatio:!1,animation:!1}});await new Promise(l=>setTimeout(l,300));const a=i.toDataURL("image/png",1);return s.destroy(),a}catch{return null}};window.findSingleReportComponent=function(){if(!window.Livewire)return null;const n=document.getElementById("single-report-component");if(n){const e=n.closest("[wire\\:id]");if(e)return window.Livewire.find(e.getAttribute("wire:id"))}const t=document.querySelectorAll("[wire\\:id]");for(let e of t)if(e.querySelector("[data-chart-data]")||e.querySelector("[data-balance-chart-data]")||e.querySelector("#returnRatioChart")||e.querySelector("#accountBalancesChart")||e.querySelector("#account-balances")||e.querySelector("#transaction-types"))return window.Livewire.find(e.getAttribute("wire:id"));return null};window.exportPdfWithChart=async function(){const n=await window.exportReturnRatioChartForPdf();let t=null;if(window.accountBalancesChart&&(t=await window.exportAccountBalancesChartForPdf()),!n&&!t){if(window.Livewire){const a=window.findSingleReportComponent();a&&a.call("exportPdf")}return}const e=document.querySelector("[data-balance-chart-data]")||document.querySelector("[data-chart-data]");let i=null,r=null,s=!1;if(e){const a=e.getAttribute("data-date-range");if(a){const l=a.split(" to ");l.length===2&&(i=l[0].trim(),r=l[1].trim())}s=e.getAttribute("data-decimal-format")==="1"}if(window.Livewire)try{const a=window.findSingleReportComponent();if(!a)throw new Error("SingleReport Livewire component not found");await a.call("exportPdfWithCharts",n,t,i,r,s)}catch{try{const l=window.findSingleReportComponent();l&&await l.call("exportPdf")}catch{}}};Ae.register(...qf);window.initAccountBalancesChart=function(n,t){var s;const e=document.getElementById("accountBalancesChart");if(!e||!n||n.length===0)return;const i=e.getContext("2d");if(!i)return;e.chart&&e.chart.destroy();function r(a){if(t){const b=a<0,x=(Math.abs(a)/60).toFixed(2).replace(".",",");return(b?"-":"")+x+" h."}const l=a<0,u=Math.abs(a),h=Math.floor(u/60),d=String(u%60).padStart(2,"0");return"H "+(l?"-":"")+h+":"+d}try{const a=[],l=new Map;n.forEach(S=>{S.accounts&&Array.isArray(S.accounts)&&S.accounts.forEach(C=>{l.has(C.account_id)||l.set(C.account_id,{name:C.account_name,id:C.account_id})})});const u=["#3B82F6","#10B981","#F59E0B","#EF4444"];let h=0;if(l.forEach((S,C)=>{const T=n.map(P=>{var H;const R=(H=P.accounts)==null?void 0:H.find(D=>D.account_id===C);return(R?parseInt(R.balance):0)/60});a.push({label:S.name,data:T,borderColor:u[h%u.length],backgroundColor:u[h%u.length]+"33",borderWidth:3,tension:.4,fill:!0,pointRadius:6,pointHoverRadius:8,pointBackgroundColor:u[h%u.length],pointBorderColor:"#ffffff",pointBorderWidth:2}),h++}),a.length===0)return;const d=n.map(S=>S.label),b=d.length===1?"bar":"line",_=((s=n[0])==null?void 0:s.translations)||{period:"Period",balance:"Balance"},x={type:b,data:{labels:d,datasets:a},options:{responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!0,position:"top",align:"end",labels:{usePointStyle:!0,color:"#1F2937"}},tooltip:{callbacks:{label:function(S){const C=Math.round(S.parsed.y*60);return S.dataset.label+": "+r(C)}}}},scales:{x:{display:!0,title:{display:!0,text:_.period,color:"#6B7280"},grid:{color:"rgba(0, 0, 0, 0.1)"},ticks:{color:"#6B7280"}},y:{display:!0,title:{display:!0,text:_.balance,color:"#6B7280"},grid:{color:"rgba(0, 0, 0, 0.1)"},ticks:{color:"#6B7280",callback:function(S){const C=Math.round(S*60);return r(C)}}}}}};e.chart=new Ae(i,x),window.accountBalancesChart=e.chart}catch{}};function jb(){const n=document.querySelector("[data-balance-chart-data]");if(!n)return;const t=n.getAttribute("data-balance-chart-data");if(t)try{const e=JSON.parse(t),i=n.getAttribute("data-decimal-format")==="1";typeof window.initAccountBalancesChart=="function"&&window.initAccountBalancesChart(e,i)}catch{}}document.addEventListener("DOMContentLoaded",()=>{setTimeout(jb,100)});document.addEventListener("livewire:init",()=>{let n=null;Livewire.hook("morph.updated",()=>{clearTimeout(n),n=setTimeout(()=>{jb()},300)})});window.exportAccountBalancesChartForPdf=async function(){if(!window.accountBalancesChart)return null;try{const n=window.accountBalancesChart,t=900,e=400,i=document.createElement("canvas");i.width=t,i.height=e;const r=i.getContext("2d"),s=new Ae(r,{type:n.config.type,data:JSON.parse(JSON.stringify(n.config.data)),options:{...JSON.parse(JSON.stringify(n.config.options||{})),responsive:!1,maintainAspectRatio:!1,animation:!1}});await new Promise(l=>setTimeout(l,300));const a=i.toDataURL("image/png",1);return s.destroy(),a}catch{return null}};Alpine.plugin(iC);Ae.register(...qf);window.Chart=Ae;window.createPopper=N1;window.Tagify=Bc;window.loadJSZip=()=>YS(()=>import("./jszip.min-KAUKf24L.js").then(n=>n.j),__vite__mapDeps([0,1])).then(n=>n.default);document.addEventListener("alpine:init",()=>{Alpine.data("callTagPicker",()=>({callTagify:null,init(){const n=this.$refs.callTagsInput,t=JSON.parse(n.dataset.suggestions||"[]");this.callTagify=new Tagify(n,{maxTags:1,whitelist:t,enforceWhiteList:!1,backspace:!1,editTags:!1,addTagOn:["enter","tab"],addTagOnBlur:!1,dropdown:{maxItems:10,enabled:2,closeOnSelect:!0,highlightFirst:!0}});const e=this.$wire.get("tagsArray");e&&e!=="[]"&&this.callTagify.loadOriginalValues(e),this.callTagify.on("change",()=>{const i=this.$refs.callTagsInput.value,r=JSON.parse(i||"[]");if(r.length===0){this.$wire.set("tagsArray","[]",!1),this.$wire.call("notifyTagCleared");return}const s=r[0];s.tag_id?(this.$wire.set("tagsArray",i,!1),this.$wire.call("notifyTagSelected",s.tag_id)):this.$wire.call("openNewTagModal",s.value)}),window.addEventListener("removeLastCallTag",()=>{this.callTagify&&this.callTagify.value.length>0&&this.callTagify.removeTag(this.callTagify.value[this.callTagify.value.length-1].value)}),Livewire.on("callTagifyReload",i=>{this.callTagify.loadOriginalValues(i.tagsArray)})}}))});window.Pusher=PC;const HM=()=>{const n=window.location.pathname.split("/").filter(Boolean),t=["en","nl","de","es","fr"];return n.length>0&&t.includes(n[0])?`/${n[0]}`:"/en"};var Gm;window.Echo=new AC({broadcaster:"reverb",key:"aj7hptmqiercfnc5cpwu",wsHost:"localhost",wsPort:"8080",wssPort:"8080",wsPath:"/",forceTLS:!1,enabledTransports:["ws","wss"],authEndpoint:`${HM()}/broadcasting/auth`,auth:{headers:{"X-CSRF-TOKEN":(Gm=document.querySelector('meta[name="csrf-token"]'))==null?void 0:Gm.getAttribute("content")}}});
|