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 * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * 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-1}function Ss(v,w,O){for(var F=-1,U=v==null?0:v.length;++F-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-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=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(;++AA?0:A+f),y=y===e||y>A?A:gt(y),y<0&&(y+=A),y=f>y?0:yp(y);f0&&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&&fc}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=120&&$.length>=120)?new ji(M&&$):e}$=o[0];var Y=-1,tt=I[0];t:for(;++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&&++AA?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>>1,M=o[E];M!==null&&!$e(M)&&(f?M<=c:M=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=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=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;++I1?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-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;++y1&&St.reverse(),$&&zI))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);++Y1?"& ":"")+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&&o0){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;++f1?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=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);++f1),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);++yc){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>>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;++Amt)return[];var f=Et,y=fe(o,Et);c=st(c),o-=Et;for(var A=Ps(y,c);++f0||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;i0;)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(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=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{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{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`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=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;esummary: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;isummary: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=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;t0){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;r1?W-1:0),X=1;X=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/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;tn.length)&&(t=n.length);for(var e=0,i=new Array(t);e0&&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[\r\n ]+\<").split(/>\s+<").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 `).concat(this.settings.templates.input.call(this),` `).concat(dg,` `)},input:function(){var n=this.settings,t=n.placeholder||dg;return"')},tag:function(n,t){var e=t.settings;return'
').concat(n[e.tagTextProp]||n.value,`
`)},dropdown:function(n){var t=n.dropdown,e=t.position=="manual";return'
`)},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"
`).concat(n.mappedValue||n.value,"
")},dropdownHeader:function(n){return`
')},dropdownFooter:function(n){var t=n.length-this.settings.dropdown.maxItems;return t>0?`
`).concat(t,` more items. Refine your search.
`):""},dropdownItemNoMatch:null};function wg(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);en.length)&&(t=n.length);for(var e=0,i=new Array(t);e0&&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||i500||!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=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=="

")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");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=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"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>>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>>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>>4,L|=N&a,L|=W&a),D>>2,L|=V&a),D>>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>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-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)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=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>>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;g0)for(var w=0;w=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]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),O0&&(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;w0&&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.priorityMath.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.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>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;rn,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)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;iu&&h=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Lf(n,t,e){e=e||(a=>n[a]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 sn[r][t]Lf(n,e,i=>n[i][t]>=e);function pA(n,t,e){let i=0,r=n.length;for(;ii&&n[r-1]>e;)r--;return i>0||r{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;ii.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;ue.length){for(u=0;u0&&n.stroke()}}function ri(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.xt.top-e&&n.y0&&s.strokeColor!=="";let u,h;for(n.save(),n.font=r.string,PA(n,s),u=0;u+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;re&&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;ltn==="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!h.skip)),t.cubicInterpolationMode==="monotone")JA(n,r);else{let h=i?n[n.length-1]:n[0];for(s=0,a=n.length;sn.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;_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;rr&&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=ll({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||e1?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{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;r0||!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;xe[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]C||b=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=0&&tthis.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{for(h.length+=e,l=h.length-1;l>=a;l--)h[l]=h[l-e]};for(u(s),l=t;lr-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;r0?r[n-1]:null,l=nMath.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=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.based.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=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;_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;a0&&!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;rt!=="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=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)&&(se.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{!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;l0&&this.getParsed(e-1);for(let H=e;H0&&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[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;de.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;eh.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{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{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;ar)return u}return Math.max(r,1)}function _E(n){const t=[];let e,i;for(e=0,i=n.length;en==="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(;sa+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;si?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=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({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&&tl*r?l/i:u/r:u*r0}_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;B0&&(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{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{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;es.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;s1&&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;re.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{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{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;ss.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=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.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{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=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=rl&&s>l;return{count:i,start:u,loop:t.loop,ilen: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?(DT&&(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;ht!=="borderDash"&&t!=="fill"});function Tm(n,t,e,i){const r=n.options,{[e]:s}=n.getProps([e],i);return Math.abs(t-s)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;bx&&(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;aC&&(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=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;is.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;tl+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-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 en.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"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;ut.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;uR!==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;H0&&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&&ne.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}),Nl)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(;_=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}:nr?{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;ut.r&&(l=(i.end-t.r)/s,n.r=Math.max(n.r,t.r+l)),r.startt.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;d270||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{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{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=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=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+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;_+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;e0?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=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=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;ar-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+='
'+P+"
"}),C.forEach(function(P,R){const B=b.labelColors[R],H='';let D=P[0];R===0?D="Trend: "+D.split(": ")[1]:D="Reciprocity Rate: "+D.split(": ")[1],T+='
'+H+D+"
"}),_.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")}}});