@banou/ripple 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1404 @@
1
+ import{r as k,R as np,l as ip,d as mw,a as ae,g as vw,b as yi,t as Na,c as yw,p as mm,e as vm,u as iC,f as rC,h as sC,_ as Yo,i as Ko,j as by,k as xy,__tla as __tla_0}from"./settings-bc96f65e.js";import{C as oC,D as aC,b as lC,R as cC}from"./index-9a320571.js";import{b as uC,E as dC,u as _w,v as fC}from"./index-8227e1be.js";let tf;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{var bw={exports:{}},Bd={};var hC=k,pC=Symbol.for("react.element"),gC=Symbol.for("react.fragment"),mC=Object.prototype.hasOwnProperty,vC=hC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,yC={key:!0,ref:!0,__self:!0,__source:!0};function xw(t,e,n){var i,r={},s=null,l=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(l=e.ref);for(i in e)mC.call(e,i)&&!yC.hasOwnProperty(i)&&(r[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps,e)r[i]===void 0&&(r[i]=e[i]);return{$$typeof:pC,type:t,key:s,ref:l,props:r,_owner:vC.current}}Bd.Fragment=gC;Bd.jsx=xw;Bd.jsxs=xw;bw.exports=Bd;var ul=bw.exports;function _C(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function bC(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var xC=function(){function t(n){var i=this;this._insertTag=function(r){var s;i.tags.length===0?i.insertionPoint?s=i.insertionPoint.nextSibling:i.prepend?s=i.container.firstChild:s=i.before:s=i.tags[i.tags.length-1].nextSibling,i.container.insertBefore(r,s),i.tags.push(r)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(i){i.forEach(this._insertTag)},e.insert=function(i){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(bC(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var s=_C(r);try{s.insertRule(i,s.cssRules.length)}catch{}}else r.appendChild(document.createTextNode(i));this.ctr++},e.flush=function(){this.tags.forEach(function(i){return i.parentNode&&i.parentNode.removeChild(i)}),this.tags=[],this.ctr=0},t}(),Jt="-ms-",Lu="-moz-",$e="-webkit-",ww="comm",ym="rule",_m="decl",wC="@import",Sw="@keyframes",SC="@layer",kC=Math.abs,jd=String.fromCharCode,EC=Object.assign;function CC(t,e){return Gt(t,0)^45?(((e<<2^Gt(t,0))<<2^Gt(t,1))<<2^Gt(t,2))<<2^Gt(t,3):0}function kw(t){return t.trim()}function TC(t,e){return(t=e.exec(t))?t[0]:t}function He(t,e,n){return t.replace(e,n)}function rp(t,e){return t.indexOf(e)}function Gt(t,e){return t.charCodeAt(e)|0}function dl(t,e,n){return t.slice(e,n)}function Pi(t){return t.length}function bm(t){return t.length}function dc(t,e){return e.push(t),t}function PC(t,e){return t.map(e).join("")}var $d=1,Ao=1,Ew=0,kn=0,Ot=0,Qo="";function Vd(t,e,n,i,r,s,l){return{value:t,root:e,parent:n,type:i,props:r,children:s,line:$d,column:Ao,length:l,return:""}}function ra(t,e){return EC(Vd("",null,null,"",null,null,0),t,{length:-t.length},e)}function AC(){return Ot}function OC(){return Ot=kn>0?Gt(Qo,--kn):0,Ao--,Ot===10&&(Ao=1,$d--),Ot}function Fn(){return Ot=kn<Ew?Gt(Qo,kn++):0,Ao++,Ot===10&&(Ao=1,$d++),Ot}function Ri(){return Gt(Qo,kn)}function Xc(){return kn}function Kl(t,e){return dl(Qo,t,e)}function fl(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Cw(t){return $d=Ao=1,Ew=Pi(Qo=t),kn=0,[]}function Tw(t){return Qo="",t}function qc(t){return kw(Kl(kn-1,sp(t===91?t+2:t===40?t+1:t)))}function LC(t){for(;(Ot=Ri())&&Ot<33;)Fn();return fl(t)>2||fl(Ot)>3?"":" "}function MC(t,e){for(;--e&&Fn()&&!(Ot<48||Ot>102||Ot>57&&Ot<65||Ot>70&&Ot<97););return Kl(t,Xc()+(e<6&&Ri()==32&&Fn()==32))}function sp(t){for(;Fn();)switch(Ot){case t:return kn;case 34:case 39:t!==34&&t!==39&&sp(Ot);break;case 40:t===41&&sp(t);break;case 92:Fn();break}return kn}function DC(t,e){for(;Fn()&&t+Ot!==47+10;)if(t+Ot===42+42&&Ri()===47)break;return"/*"+Kl(e,kn-1)+"*"+jd(t===47?t:Fn())}function RC(t){for(;!fl(Ri());)Fn();return Kl(t,kn)}function IC(t){return Tw(Jc("",null,null,null,[""],t=Cw(t),0,[0],t))}function Jc(t,e,n,i,r,s,l,a,u){for(var f=0,p=0,m=l,o=0,c=0,d=0,h=1,g=1,y=1,v=0,_="",b=r,x=s,w=i,S=_;g;)switch(d=v,v=Fn()){case 40:if(d!=108&&Gt(S,m-1)==58){rp(S+=He(qc(v),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:S+=qc(v);break;case 9:case 10:case 13:case 32:S+=LC(d);break;case 92:S+=MC(Xc()-1,7);continue;case 47:switch(Ri()){case 42:case 47:dc(UC(DC(Fn(),Xc()),e,n),u);break;default:S+="/"}break;case 123*h:a[f++]=Pi(S)*y;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+p:y==-1&&(S=He(S,/\f/g,"")),c>0&&Pi(S)-m&&dc(c>32?Sy(S+";",i,n,m-1):Sy(He(S," ","")+";",i,n,m-2),u);break;case 59:S+=";";default:if(dc(w=wy(S,e,n,f,p,r,a,_,b=[],x=[],m),s),v===123)if(p===0)Jc(S,e,w,w,b,s,m,a,x);else switch(o===99&&Gt(S,3)===110?100:o){case 100:case 108:case 109:case 115:Jc(t,w,w,i&&dc(wy(t,w,w,0,0,r,a,_,r,b=[],m),x),r,x,m,a,i?b:x);break;default:Jc(S,w,w,w,[""],x,0,a,x)}}f=p=c=0,h=y=1,_=S="",m=l;break;case 58:m=1+Pi(S),c=d;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&OC()==125)continue}switch(S+=jd(v),v*h){case 38:y=p>0?1:(S+="\f",-1);break;case 44:a[f++]=(Pi(S)-1)*y,y=1;break;case 64:Ri()===45&&(S+=qc(Fn())),o=Ri(),p=m=Pi(_=S+=RC(Xc())),v++;break;case 45:d===45&&Pi(S)==2&&(h=0)}}return s}function wy(t,e,n,i,r,s,l,a,u,f,p){for(var m=r-1,o=r===0?s:[""],c=bm(o),d=0,h=0,g=0;d<i;++d)for(var y=0,v=dl(t,m+1,m=kC(h=l[d])),_=t;y<c;++y)(_=kw(h>0?o[y]+" "+v:He(v,/&\f/g,o[y])))&&(u[g++]=_);return Vd(t,e,n,r===0?ym:a,u,f,p)}function UC(t,e,n){return Vd(t,e,n,ww,jd(AC()),dl(t,2,-2),0)}function Sy(t,e,n,i){return Vd(t,e,n,_m,dl(t,0,i),dl(t,i+1,-1),i)}function vo(t,e){for(var n="",i=bm(t),r=0;r<i;r++)n+=e(t[r],r,t,e)||"";return n}function FC(t,e,n,i){switch(t.type){case SC:if(t.children.length)break;case wC:case _m:return t.return=t.return||t.value;case ww:return"";case Sw:return t.return=t.value+"{"+vo(t.children,i)+"}";case ym:t.value=t.props.join(",")}return Pi(n=vo(t.children,i))?t.return=t.value+"{"+n+"}":""}function zC(t){var e=bm(t);return function(n,i,r,s){for(var l="",a=0;a<e;a++)l+=t[a](n,i,r,s)||"";return l}}function NC(t){return function(e){e.root||(e=e.return)&&t(e)}}function BC(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var jC=function(e,n,i){for(var r=0,s=0;r=s,s=Ri(),r===38&&s===12&&(n[i]=1),!fl(s);)Fn();return Kl(e,kn)},$C=function(e,n){var i=-1,r=44;do switch(fl(r)){case 0:r===38&&Ri()===12&&(n[i]=1),e[i]+=jC(kn-1,n,i);break;case 2:e[i]+=qc(r);break;case 4:if(r===44){e[++i]=Ri()===58?"&\f":"",n[i]=e[i].length;break}default:e[i]+=jd(r)}while(r=Fn());return e},VC=function(e,n){return Tw($C(Cw(e),n))},ky=new WeakMap,HC=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,i=e.parent,r=e.column===i.column&&e.line===i.line;i.type!=="rule";)if(i=i.parent,!i)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!ky.get(i))&&!r){ky.set(e,!0);for(var s=[],l=VC(n,s),a=i.props,u=0,f=0;u<l.length;u++)for(var p=0;p<a.length;p++,f++)e.props[f]=s[u]?l[u].replace(/&\f/g,a[p]):a[p]+" "+l[u]}}},WC=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function Pw(t,e){switch(CC(t,e)){case 5103:return $e+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return $e+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return $e+t+Lu+t+Jt+t+t;case 6828:case 4268:return $e+t+Jt+t+t;case 6165:return $e+t+Jt+"flex-"+t+t;case 5187:return $e+t+He(t,/(\w+).+(:[^]+)/,$e+"box-$1$2"+Jt+"flex-$1$2")+t;case 5443:return $e+t+Jt+"flex-item-"+He(t,/flex-|-self/,"")+t;case 4675:return $e+t+Jt+"flex-line-pack"+He(t,/align-content|flex-|-self/,"")+t;case 5548:return $e+t+Jt+He(t,"shrink","negative")+t;case 5292:return $e+t+Jt+He(t,"basis","preferred-size")+t;case 6060:return $e+"box-"+He(t,"-grow","")+$e+t+Jt+He(t,"grow","positive")+t;case 4554:return $e+He(t,/([^-])(transform)/g,"$1"+$e+"$2")+t;case 6187:return He(He(He(t,/(zoom-|grab)/,$e+"$1"),/(image-set)/,$e+"$1"),t,"")+t;case 5495:case 3959:return He(t,/(image-set\([^]*)/,$e+"$1$`$1");case 4968:return He(He(t,/(.+:)(flex-)?(.*)/,$e+"box-pack:$3"+Jt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+$e+t+t;case 4095:case 3583:case 4068:case 2532:return He(t,/(.+)-inline(.+)/,$e+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Pi(t)-1-e>6)switch(Gt(t,e+1)){case 109:if(Gt(t,e+4)!==45)break;case 102:return He(t,/(.+:)(.+)-([^]+)/,"$1"+$e+"$2-$3$1"+Lu+(Gt(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~rp(t,"stretch")?Pw(He(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Gt(t,e+1)!==115)break;case 6444:switch(Gt(t,Pi(t)-3-(~rp(t,"!important")&&10))){case 107:return He(t,":",":"+$e)+t;case 101:return He(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+$e+(Gt(t,14)===45?"inline-":"")+"box$3$1"+$e+"$2$3$1"+Jt+"$2box$3")+t}break;case 5936:switch(Gt(t,e+11)){case 114:return $e+t+Jt+He(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return $e+t+Jt+He(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return $e+t+Jt+He(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return $e+t+Jt+t+t}return t}var GC=function(e,n,i,r){if(e.length>-1&&!e.return)switch(e.type){case _m:e.return=Pw(e.value,e.length);break;case Sw:return vo([ra(e,{value:He(e.value,"@","@"+$e)})],r);case ym:if(e.length)return PC(e.props,function(s){switch(TC(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return vo([ra(e,{props:[He(s,/:(read-\w+)/,":"+Lu+"$1")]})],r);case"::placeholder":return vo([ra(e,{props:[He(s,/:(plac\w+)/,":"+$e+"input-$1")]}),ra(e,{props:[He(s,/:(plac\w+)/,":"+Lu+"$1")]}),ra(e,{props:[He(s,/:(plac\w+)/,Jt+"input-$1")]})],r)}return""})}},YC=[GC],KC=function(e){var n=e.key;if(n==="css"){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(h){var g=h.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(h),h.setAttribute("data-s",""))})}var r=e.stylisPlugins||YC,s={},l,a=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(h){for(var g=h.getAttribute("data-emotion").split(" "),y=1;y<g.length;y++)s[g[y]]=!0;a.push(h)});var u,f=[HC,WC];{var p,m=[FC,NC(function(h){p.insert(h)})],o=zC(f.concat(r,m)),c=function(g){return vo(IC(g),o)};u=function(g,y,v,_){p=v,c(g?g+"{"+y.styles+"}":y.styles),_&&(d.inserted[y.name]=!0)}}var d={key:n,sheet:new xC({key:n,container:l,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:u};return d.sheet.hydrate(a),d},Aw={exports:{}},Xe={};var jt=typeof Symbol=="function"&&Symbol.for,xm=jt?Symbol.for("react.element"):60103,wm=jt?Symbol.for("react.portal"):60106,Hd=jt?Symbol.for("react.fragment"):60107,Wd=jt?Symbol.for("react.strict_mode"):60108,Gd=jt?Symbol.for("react.profiler"):60114,Yd=jt?Symbol.for("react.provider"):60109,Kd=jt?Symbol.for("react.context"):60110,Sm=jt?Symbol.for("react.async_mode"):60111,Qd=jt?Symbol.for("react.concurrent_mode"):60111,Zd=jt?Symbol.for("react.forward_ref"):60112,Xd=jt?Symbol.for("react.suspense"):60113,QC=jt?Symbol.for("react.suspense_list"):60120,qd=jt?Symbol.for("react.memo"):60115,Jd=jt?Symbol.for("react.lazy"):60116,ZC=jt?Symbol.for("react.block"):60121,XC=jt?Symbol.for("react.fundamental"):60117,qC=jt?Symbol.for("react.responder"):60118,JC=jt?Symbol.for("react.scope"):60119;function jn(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case xm:switch(t=t.type,t){case Sm:case Qd:case Hd:case Gd:case Wd:case Xd:return t;default:switch(t=t&&t.$$typeof,t){case Kd:case Zd:case Jd:case qd:case Yd:return t;default:return e}}case wm:return e}}}function Ow(t){return jn(t)===Qd}Xe.AsyncMode=Sm;Xe.ConcurrentMode=Qd;Xe.ContextConsumer=Kd;Xe.ContextProvider=Yd;Xe.Element=xm;Xe.ForwardRef=Zd;Xe.Fragment=Hd;Xe.Lazy=Jd;Xe.Memo=qd;Xe.Portal=wm;Xe.Profiler=Gd;Xe.StrictMode=Wd;Xe.Suspense=Xd;Xe.isAsyncMode=function(t){return Ow(t)||jn(t)===Sm};Xe.isConcurrentMode=Ow;Xe.isContextConsumer=function(t){return jn(t)===Kd};Xe.isContextProvider=function(t){return jn(t)===Yd};Xe.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===xm};Xe.isForwardRef=function(t){return jn(t)===Zd};Xe.isFragment=function(t){return jn(t)===Hd};Xe.isLazy=function(t){return jn(t)===Jd};Xe.isMemo=function(t){return jn(t)===qd};Xe.isPortal=function(t){return jn(t)===wm};Xe.isProfiler=function(t){return jn(t)===Gd};Xe.isStrictMode=function(t){return jn(t)===Wd};Xe.isSuspense=function(t){return jn(t)===Xd};Xe.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Hd||t===Qd||t===Gd||t===Wd||t===Xd||t===QC||typeof t=="object"&&t!==null&&(t.$$typeof===Jd||t.$$typeof===qd||t.$$typeof===Yd||t.$$typeof===Kd||t.$$typeof===Zd||t.$$typeof===XC||t.$$typeof===qC||t.$$typeof===JC||t.$$typeof===ZC)};Xe.typeOf=jn;Aw.exports=Xe;var eT=Aw.exports,Lw=eT,tT={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},nT={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Mw={};Mw[Lw.ForwardRef]=tT;Mw[Lw.Memo]=nT;var iT=!0;function rT(t,e,n){var i="";return n.split(" ").forEach(function(r){t[r]!==void 0?e.push(t[r]+";"):i+=r+" "}),i}var Dw=function(e,n,i){var r=e.key+"-"+n.name;(i===!1||iT===!1)&&e.registered[r]===void 0&&(e.registered[r]=n.styles)},Rw=function(e,n,i){Dw(e,n,i);var r=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var s=n;do e.insert(n===s?"."+r:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function sT(t){for(var e=0,n,i=0,r=t.length;r>=4;++i,r-=4)n=t.charCodeAt(i)&255|(t.charCodeAt(++i)&255)<<8|(t.charCodeAt(++i)&255)<<16|(t.charCodeAt(++i)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(t.charCodeAt(i+2)&255)<<16;case 2:e^=(t.charCodeAt(i+1)&255)<<8;case 1:e^=t.charCodeAt(i)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var oT={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},aT=/[A-Z]|^ms/g,lT=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Iw=function(e){return e.charCodeAt(1)===45},Ey=function(e){return e!=null&&typeof e!="boolean"},zf=BC(function(t){return Iw(t)?t:t.replace(aT,"-$&").toLowerCase()}),Cy=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(lT,function(i,r,s){return Ai={name:r,styles:s,next:Ai},r})}return oT[e]!==1&&!Iw(e)&&typeof n=="number"&&n!==0?n+"px":n};function hl(t,e,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Ai={name:n.name,styles:n.styles,next:Ai},n.name;if(n.styles!==void 0){var i=n.next;if(i!==void 0)for(;i!==void 0;)Ai={name:i.name,styles:i.styles,next:Ai},i=i.next;var r=n.styles+";";return r}return cT(t,e,n)}case"function":{if(t!==void 0){var s=Ai,l=n(t);return Ai=s,hl(t,e,l)}break}}if(e==null)return n;var a=e[n];return a!==void 0?a:n}function cT(t,e,n){var i="";if(Array.isArray(n))for(var r=0;r<n.length;r++)i+=hl(t,e,n[r])+";";else for(var s in n){var l=n[s];if(typeof l!="object")e!=null&&e[l]!==void 0?i+=s+"{"+e[l]+"}":Ey(l)&&(i+=zf(s)+":"+Cy(s,l)+";");else if(Array.isArray(l)&&typeof l[0]=="string"&&(e==null||e[l[0]]===void 0))for(var a=0;a<l.length;a++)Ey(l[a])&&(i+=zf(s)+":"+Cy(s,l[a])+";");else{var u=hl(t,e,l);switch(s){case"animation":case"animationName":{i+=zf(s)+":"+u+";";break}default:i+=s+"{"+u+"}"}}}return i}var Ty=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Ai,km=function(e,n,i){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,s="";Ai=void 0;var l=e[0];l==null||l.raw===void 0?(r=!1,s+=hl(i,n,l)):s+=l[0];for(var a=1;a<e.length;a++)s+=hl(i,n,e[a]),r&&(s+=l[a]);Ty.lastIndex=0;for(var u="",f;(f=Ty.exec(s))!==null;)u+="-"+f[1];var p=sT(s)+u;return{name:p,styles:s,next:Ai}},uT=function(e){return e()},Uw=np["useInsertionEffect"]?np["useInsertionEffect"]:!1,dT=Uw||uT,Py=Uw||k.useLayoutEffect,ef={}.hasOwnProperty,Fw=k.createContext(typeof HTMLElement<"u"?KC({key:"css"}):null);Fw.Provider;var zw=function(e){return k.forwardRef(function(n,i){var r=k.useContext(Fw);return e(n,r,i)})},Nw=k.createContext({}),op="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Bw=function(e,n){var i={};for(var r in n)ef.call(n,r)&&(i[r]=n[r]);return i[op]=e,i},fT=function(e){var n=e.cache,i=e.serialized,r=e.isStringTag;return Dw(n,i,r),dT(function(){return Rw(n,i,r)}),null},hT=zw(function(t,e,n){var i=t.css;typeof i=="string"&&e.registered[i]!==void 0&&(i=e.registered[i]);var r=t[op],s=[i],l="";typeof t.className=="string"?l=rT(e.registered,s,t.className):t.className!=null&&(l=t.className+" ");var a=km(s,void 0,k.useContext(Nw));l+=e.key+"-"+a.name;var u={};for(var f in t)ef.call(t,f)&&f!=="css"&&f!==op&&(u[f]=t[f]);return u.ref=n,u.className=l,k.createElement(k.Fragment,null,k.createElement(fT,{cache:e,serialized:a,isStringTag:typeof r=="string"}),k.createElement(r,u))}),jw=hT,Ay=ul.Fragment;function V(t,e,n){return ef.call(e,"css")?ul.jsx(jw,Bw(t,e),n):ul.jsx(t,e,n)}function pe(t,e,n){return ef.call(e,"css")?ul.jsxs(jw,Bw(t,e),n):ul.jsxs(t,e,n)}ip.awaitLeadership().then(()=>ip.isLeader);mw.waitForLeadership().then(()=>{Promise.resolve(!0)});tf=new SharedWorker("/shared-worker.js",{type:"module"});await uC();oC({resolvers:{getApiTargetPort:aC(()=>dC())},target:tf.port,key:"shared-worker-fkn-port"});tf.port.addEventListener("error",t=>{console.error(t)});tf.port.start();ip.awaitLeadership().then(()=>{const t=new Worker("/worker.js",{type:"module"}),e=new MessageChannel,{port1:n,port2:i}=e;n.addEventListener("message",r=>{const{type:s,data:l,port:a}=r.data,u=lC(l);t.postMessage({source:"io-worker",type:s,data:l,port:a},{targetOrigin:"*",transfer:[a,...u??[]]})}),n.start(),cC(tf.port,{key:"shared-worker-fkn-api"})("newLeader",{workerPort:i})});function Ql(t){return t+.5|0}const Dr=(t,e,n)=>Math.max(Math.min(t,n),e);function Pa(t){return Dr(Ql(t*2.55),0,255)}function Nr(t){return Dr(Ql(t*255),0,255)}function qi(t){return Dr(Ql(t/2.55)/100,0,1)}function Oy(t){return Dr(Ql(t*100),0,100)}const Wn={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},ap=[..."0123456789ABCDEF"],pT=t=>ap[t&15],gT=t=>ap[(t&240)>>4]+ap[t&15],fc=t=>(t&240)>>4===(t&15),mT=t=>fc(t.r)&&fc(t.g)&&fc(t.b)&&fc(t.a);function vT(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&Wn[t[1]]*17,g:255&Wn[t[2]]*17,b:255&Wn[t[3]]*17,a:e===5?Wn[t[4]]*17:255}:(e===7||e===9)&&(n={r:Wn[t[1]]<<4|Wn[t[2]],g:Wn[t[3]]<<4|Wn[t[4]],b:Wn[t[5]]<<4|Wn[t[6]],a:e===9?Wn[t[7]]<<4|Wn[t[8]]:255})),n}const yT=(t,e)=>t<255?e(t):"";function _T(t){var e=mT(t)?pT:gT;return t?"#"+e(t.r)+e(t.g)+e(t.b)+yT(t.a,e):void 0}const bT=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function $w(t,e,n){const i=e*Math.min(n,1-n),r=(s,l=(s+t/30)%12)=>n-i*Math.max(Math.min(l-3,9-l,1),-1);return[r(0),r(8),r(4)]}function xT(t,e,n){const i=(r,s=(r+t/60)%6)=>n-n*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function wT(t,e,n){const i=$w(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)i[r]*=1-e-n,i[r]+=e;return i}function ST(t,e,n,i,r){return t===r?(e-n)/i+(e<n?6:0):e===r?(n-t)/i+2:(t-e)/i+4}function Em(t){const n=t.r/255,i=t.g/255,r=t.b/255,s=Math.max(n,i,r),l=Math.min(n,i,r),a=(s+l)/2;let u,f,p;return s!==l&&(p=s-l,f=a>.5?p/(2-s-l):p/(s+l),u=ST(n,i,r,p,s),u=u*60+.5),[u|0,f||0,a]}function Cm(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(Nr)}function Tm(t,e,n){return Cm($w,t,e,n)}function kT(t,e,n){return Cm(wT,t,e,n)}function ET(t,e,n){return Cm(xT,t,e,n)}function Vw(t){return(t%360+360)%360}function CT(t){const e=bT.exec(t);let n=255,i;if(!e)return;e[5]!==i&&(n=e[6]?Pa(+e[5]):Nr(+e[5]));const r=Vw(+e[2]),s=+e[3]/100,l=+e[4]/100;return e[1]==="hwb"?i=kT(r,s,l):e[1]==="hsv"?i=ET(r,s,l):i=Tm(r,s,l),{r:i[0],g:i[1],b:i[2],a:n}}function TT(t,e){var n=Em(t);n[0]=Vw(n[0]+e),n=Tm(n),t.r=n[0],t.g=n[1],t.b=n[2]}function PT(t){if(!t)return;const e=Em(t),n=e[0],i=Oy(e[1]),r=Oy(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${r}%, ${qi(t.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const Ly={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"},My={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 AT(){const t={},e=Object.keys(My),n=Object.keys(Ly);let i,r,s,l,a;for(i=0;i<e.length;i++){for(l=a=e[i],r=0;r<n.length;r++)s=n[r],a=a.replace(s,Ly[s]);s=parseInt(My[l],16),t[a]=[s>>16&255,s>>8&255,s&255]}return t}let hc;function OT(t){hc||(hc=AT(),hc.transparent=[0,0,0,0]);const e=hc[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const LT=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function MT(t){const e=LT.exec(t);let n=255,i,r,s;if(e){if(e[7]!==i){const l=+e[7];n=e[8]?Pa(l):Dr(l*255,0,255)}return i=+e[1],r=+e[3],s=+e[5],i=255&(e[2]?Pa(i):Dr(i,0,255)),r=255&(e[4]?Pa(r):Dr(r,0,255)),s=255&(e[6]?Pa(s):Dr(s,0,255)),{r:i,g:r,b:s,a:n}}}function DT(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${qi(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Nf=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Hs=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function RT(t,e,n){const i=Hs(qi(t.r)),r=Hs(qi(t.g)),s=Hs(qi(t.b));return{r:Nr(Nf(i+n*(Hs(qi(e.r))-i))),g:Nr(Nf(r+n*(Hs(qi(e.g))-r))),b:Nr(Nf(s+n*(Hs(qi(e.b))-s))),a:t.a+n*(e.a-t.a)}}function pc(t,e,n){if(t){let i=Em(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,e===0?360:1)),i=Tm(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function Hw(t,e){return t&&Object.assign(e||{},t)}function Dy(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Nr(t[3]))):(e=Hw(t,{r:0,g:0,b:0,a:1}),e.a=Nr(e.a)),e}function IT(t){return t.charAt(0)==="r"?MT(t):CT(t)}class pl{constructor(e){if(e instanceof pl)return e;const n=typeof e;let i;n==="object"?i=Dy(e):n==="string"&&(i=vT(e)||OT(e)||IT(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Hw(this._rgb);return e&&(e.a=qi(e.a)),e}set rgb(e){this._rgb=Dy(e)}rgbString(){return this._valid?DT(this._rgb):void 0}hexString(){return this._valid?_T(this._rgb):void 0}hslString(){return this._valid?PT(this._rgb):void 0}mix(e,n){if(e){const i=this.rgb,r=e.rgb;let s;const l=n===s?.5:n,a=2*l-1,u=i.a-r.a,f=((a*u===-1?a:(a+u)/(1+a*u))+1)/2;s=1-f,i.r=255&f*i.r+s*r.r+.5,i.g=255&f*i.g+s*r.g+.5,i.b=255&f*i.b+s*r.b+.5,i.a=l*i.a+(1-l)*r.a,this.rgb=i}return this}interpolate(e,n){return e&&(this._rgb=RT(this._rgb,e._rgb,n)),this}clone(){return new pl(this.rgb)}alpha(e){return this._rgb.a=Nr(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=Ql(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return pc(this._rgb,2,e),this}darken(e){return pc(this._rgb,2,-e),this}saturate(e){return pc(this._rgb,1,e),this}desaturate(e){return pc(this._rgb,1,-e),this}rotate(e){return TT(this._rgb,e),this}}function Hi(){}const UT=(()=>{let t=0;return()=>t++})();function ze(t){return t===null||typeof t>"u"}function rt(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Ie(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function xt(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function An(t,e){return xt(t)?t:e}function Pe(t,e){return typeof t>"u"?e:t}const FT=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,Ww=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function et(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function Qe(t,e,n,i){let r,s,l;if(rt(t))if(s=t.length,i)for(r=s-1;r>=0;r--)e.call(n,t[r],r);else for(r=0;r<s;r++)e.call(n,t[r],r);else if(Ie(t))for(l=Object.keys(t),s=l.length,r=0;r<s;r++)e.call(n,t[l[r]],l[r])}function Mu(t,e){let n,i,r,s;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(r=t[n],s=e[n],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function Du(t){if(rt(t))return t.map(Du);if(Ie(t)){const e=Object.create(null),n=Object.keys(t),i=n.length;let r=0;for(;r<i;++r)e[n[r]]=Du(t[n[r]]);return e}return t}function Gw(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function zT(t,e,n,i){if(!Gw(t))return;const r=e[t],s=n[t];Ie(r)&&Ie(s)?gl(r,s,i):e[t]=Du(s)}function gl(t,e,n){const i=rt(e)?e:[e],r=i.length;if(!Ie(t))return t;n=n||{};const s=n.merger||zT;let l;for(let a=0;a<r;++a){if(l=i[a],!Ie(l))continue;const u=Object.keys(l);for(let f=0,p=u.length;f<p;++f)s(u[f],t,l,n)}return t}function Ba(t,e){return gl(t,e,{merger:NT})}function NT(t,e,n){if(!Gw(t))return;const i=e[t],r=n[t];Ie(i)&&Ie(r)?Ba(i,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Du(r))}const Ry={"":t=>t,x:t=>t.x,y:t=>t.y};function BT(t){const e=t.split("."),n=[];let i="";for(const r of e)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function jT(t){const e=BT(t);return n=>{for(const i of e){if(i==="")break;n=n&&n[i]}return n}}function Qr(t,e){return(Ry[e]||(Ry[e]=jT(e)))(t)}function Pm(t){return t.charAt(0).toUpperCase()+t.slice(1)}const ml=t=>typeof t<"u",Zr=t=>typeof t=="function",Iy=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function $T(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const at=Math.PI,st=2*at,VT=st+at,Ru=Number.POSITIVE_INFINITY,HT=at/180,Pt=at/2,cs=at/4,Uy=at*2/3,Rr=Math.log10,Ii=Math.sign;function ja(t,e,n){return Math.abs(t-e)<n}function Fy(t){const e=Math.round(t);t=ja(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Rr(t))),i=t/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function WT(t){const e=[],n=Math.sqrt(t);let i;for(i=1;i<n;i++)t%i===0&&(e.push(i),e.push(t/i));return n===(n|0)&&e.push(n),e.sort((r,s)=>r-s).pop(),e}function Oo(t){return!isNaN(parseFloat(t))&&isFinite(t)}function GT(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function Yw(t,e,n){let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i][n],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function gi(t){return t*(at/180)}function Am(t){return t*(180/at)}function zy(t){if(!xt(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Kw(t,e){const n=e.x-t.x,i=e.y-t.y,r=Math.sqrt(n*n+i*i);let s=Math.atan2(i,n);return s<-.5*at&&(s+=st),{angle:s,distance:r}}function lp(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function YT(t,e){return(t-e+VT)%st-at}function In(t){return(t%st+st)%st}function vl(t,e,n,i){const r=In(t),s=In(e),l=In(n),a=In(s-r),u=In(l-r),f=In(r-s),p=In(r-l);return r===s||r===l||i&&s===l||a>u&&f<p}function Nt(t,e,n){return Math.max(e,Math.min(n,t))}function KT(t){return Nt(t,-32768,32767)}function er(t,e,n,i=1e-6){return t>=Math.min(e,n)-i&&t<=Math.max(e,n)+i}function Om(t,e,n){n=n||(l=>t[l]<e);let i=t.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,n(s)?r=s:i=s;return{lo:r,hi:i}}const tr=(t,e,n,i)=>Om(t,n,i?r=>{const s=t[r][e];return s<n||s===n&&t[r+1][e]===n}:r=>t[r][e]<n),QT=(t,e,n)=>Om(t,n,i=>t[i][e]>=n);function ZT(t,e,n){let i=0,r=t.length;for(;i<r&&t[i]<e;)i++;for(;r>i&&t[r-1]>n;)r--;return i>0||r<t.length?t.slice(i,r):t}const Qw=["push","pop","shift","splice","unshift"];function XT(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Qw.forEach(n=>{const i="_onData"+Pm(n),r=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...s){const l=r.apply(this,s);return t._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...s)}),l}})})}function Ny(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(e);r!==-1&&i.splice(r,1),!(i.length>0)&&(Qw.forEach(s=>{delete t[s]}),delete t._chartjs)}function Zw(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Xw=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function qw(t,e){let n=[],i=!1;return function(...r){n=r,i||(i=!0,Xw.call(window,()=>{i=!1,t.apply(e,n)}))}}function qT(t,e){let n;return function(...i){return e?(clearTimeout(n),n=setTimeout(t,e,i)):t.apply(this,i),e}}const Lm=t=>t==="start"?"left":t==="end"?"right":"center",tn=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,JT=(t,e,n,i)=>t===(i?"left":"right")?n:t==="center"?(e+n)/2:e;function Jw(t,e,n){const i=e.length;let r=0,s=i;if(t._sorted){const{iScale:l,_parsed:a}=t,u=l.axis,{min:f,max:p,minDefined:m,maxDefined:o}=l.getUserBounds();m&&(r=Nt(Math.min(tr(a,u,f).lo,n?i:tr(e,u,l.getPixelForValue(f)).lo),0,i-1)),o?s=Nt(Math.max(tr(a,l.axis,p,!0).hi+1,n?0:tr(e,u,l.getPixelForValue(p),!0).hi+1),r,i)-r:s=i-r}return{start:r,count:s}}function e1(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,r={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=r,!0;const s=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),s}const gc=t=>t===0||t===1,By=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*st/n)),jy=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*st/n)+1,$a={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*Pt)+1,easeOutSine:t=>Math.sin(t*Pt),easeInOutSine:t=>-.5*(Math.cos(at*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>gc(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>gc(t)?t:By(t,.075,.3),easeOutElastic:t=>gc(t)?t:jy(t,.075,.3),easeInOutElastic(t){return gc(t)?t:t<.5?.5*By(t*2,.1125,.45):.5+.5*jy(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-$a.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?$a.easeInBounce(t*2)*.5:$a.easeOutBounce(t*2-1)*.5+.5};function Mm(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function $y(t){return Mm(t)?t:new pl(t)}function Bf(t){return Mm(t)?t:new pl(t).saturate(.5).darken(.1).hexString()}const eP=["x","y","borderWidth","radius","tension"],tP=["color","borderColor","backgroundColor"];function nP(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:tP},numbers:{type:"number",properties:eP}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function iP(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Vy=new Map;function rP(t,e){e=e||{};const n=t+JSON.stringify(e);let i=Vy.get(n);return i||(i=new Intl.NumberFormat(t,e),Vy.set(n,i)),i}function Zl(t,e,n){return rP(e,n).format(t)}const t1={values(t){return rt(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const i=this.chart.options.locale;let r,s=t;if(n.length>1){const f=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(f<1e-4||f>1e15)&&(r="scientific"),s=sP(t,n)}const l=Rr(Math.abs(s)),a=isNaN(l)?1:Math.max(Math.min(-1*Math.floor(l),20),0),u={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(u,this.options.ticks.format),Zl(t,i,u)},logarithmic(t,e,n){if(t===0)return"0";const i=n[e].significand||t/Math.pow(10,Math.floor(Rr(t)));return[1,2,3,5,10,15].includes(i)||e>.8*n.length?t1.numeric.call(this,t,e,n):""}};function sP(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var nf={formatters:t1};function oP(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.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:nf.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Ls=Object.create(null),cp=Object.create(null);function Va(t,e){if(!e)return t;const n=e.split(".");for(let i=0,r=n.length;i<r;++i){const s=n[i];t=t[s]||(t[s]=Object.create(null))}return t}function jf(t,e,n){return typeof e=="string"?gl(Va(t,e),n):gl(Va(t,""),e)}class aP{constructor(e,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Bf(r.backgroundColor),this.hoverBorderColor=(i,r)=>Bf(r.borderColor),this.hoverColor=(i,r)=>Bf(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(e),this.apply(n)}set(e,n){return jf(this,e,n)}get(e){return Va(this,e)}describe(e,n){return jf(cp,e,n)}override(e,n){return jf(Ls,e,n)}route(e,n,i,r){const s=Va(this,e),l=Va(this,i),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const u=this[a],f=l[r];return Ie(u)?Object.assign({},f,u):Pe(u,f)},set(u){this[a]=u}}})}apply(e){e.forEach(n=>n(this))}}var wt=new aP({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[nP,iP,oP]);function lP(t){return!t||ze(t.size)||ze(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Iu(t,e,n,i,r){let s=e[r];return s||(s=e[r]=t.measureText(r).width,n.push(r)),s>i&&(i=s),i}function cP(t,e,n,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(r=i.data={},s=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let l=0;const a=n.length;let u,f,p,m,o;for(u=0;u<a;u++)if(m=n[u],m!=null&&!rt(m))l=Iu(t,r,s,l,m);else if(rt(m))for(f=0,p=m.length;f<p;f++)o=m[f],o!=null&&!rt(o)&&(l=Iu(t,r,s,l,o));t.restore();const c=s.length/2;if(c>n.length){for(u=0;u<c;u++)delete r[s[u]];s.splice(0,c)}return l}function us(t,e,n){const i=t.currentDevicePixelRatio,r=n!==0?Math.max(n/2,.5):0;return Math.round((e-r)*i)/i+r}function Hy(t,e){e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function up(t,e,n,i){n1(t,e,n,i,null)}function n1(t,e,n,i,r){let s,l,a,u,f,p,m,o;const c=e.pointStyle,d=e.rotation,h=e.radius;let g=(d||0)*HT;if(c&&typeof c=="object"&&(s=c.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(n,i),t.rotate(g),t.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),t.restore();return}if(!(isNaN(h)||h<=0)){switch(t.beginPath(),c){default:r?t.ellipse(n,i,r/2,h,0,0,st):t.arc(n,i,h,0,st),t.closePath();break;case"triangle":p=r?r/2:h,t.moveTo(n+Math.sin(g)*p,i-Math.cos(g)*h),g+=Uy,t.lineTo(n+Math.sin(g)*p,i-Math.cos(g)*h),g+=Uy,t.lineTo(n+Math.sin(g)*p,i-Math.cos(g)*h),t.closePath();break;case"rectRounded":f=h*.516,u=h-f,l=Math.cos(g+cs)*u,m=Math.cos(g+cs)*(r?r/2-f:u),a=Math.sin(g+cs)*u,o=Math.sin(g+cs)*(r?r/2-f:u),t.arc(n-m,i-a,f,g-at,g-Pt),t.arc(n+o,i-l,f,g-Pt,g),t.arc(n+m,i+a,f,g,g+Pt),t.arc(n-o,i+l,f,g+Pt,g+at),t.closePath();break;case"rect":if(!d){u=Math.SQRT1_2*h,p=r?r/2:u,t.rect(n-p,i-u,2*p,2*u);break}g+=cs;case"rectRot":m=Math.cos(g)*(r?r/2:h),l=Math.cos(g)*h,a=Math.sin(g)*h,o=Math.sin(g)*(r?r/2:h),t.moveTo(n-m,i-a),t.lineTo(n+o,i-l),t.lineTo(n+m,i+a),t.lineTo(n-o,i+l),t.closePath();break;case"crossRot":g+=cs;case"cross":m=Math.cos(g)*(r?r/2:h),l=Math.cos(g)*h,a=Math.sin(g)*h,o=Math.sin(g)*(r?r/2:h),t.moveTo(n-m,i-a),t.lineTo(n+m,i+a),t.moveTo(n+o,i-l),t.lineTo(n-o,i+l);break;case"star":m=Math.cos(g)*(r?r/2:h),l=Math.cos(g)*h,a=Math.sin(g)*h,o=Math.sin(g)*(r?r/2:h),t.moveTo(n-m,i-a),t.lineTo(n+m,i+a),t.moveTo(n+o,i-l),t.lineTo(n-o,i+l),g+=cs,m=Math.cos(g)*(r?r/2:h),l=Math.cos(g)*h,a=Math.sin(g)*h,o=Math.sin(g)*(r?r/2:h),t.moveTo(n-m,i-a),t.lineTo(n+m,i+a),t.moveTo(n+o,i-l),t.lineTo(n-o,i+l);break;case"line":l=r?r/2:Math.cos(g)*h,a=Math.sin(g)*h,t.moveTo(n-l,i-a),t.lineTo(n+l,i+a);break;case"dash":t.moveTo(n,i),t.lineTo(n+Math.cos(g)*(r?r/2:h),i+Math.sin(g)*h);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function nr(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function rf(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function sf(t){t.restore()}function uP(t,e,n,i,r){if(!e)return t.lineTo(n.x,n.y);if(r==="middle"){const s=(e.x+n.x)/2;t.lineTo(s,e.y),t.lineTo(s,n.y)}else r==="after"!=!!i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function dP(t,e,n,i){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function fP(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),ze(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function hP(t,e,n,i,r){if(r.strikethrough||r.underline){const s=t.measureText(i),l=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,u=n-s.actualBoundingBoxAscent,f=n+s.actualBoundingBoxDescent,p=r.strikethrough?(u+f)/2:f;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(l,p),t.lineTo(a,p),t.stroke()}}function pP(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function Ms(t,e,n,i,r,s={}){const l=rt(e)?e:[e],a=s.strokeWidth>0&&s.strokeColor!=="";let u,f;for(t.save(),t.font=r.string,fP(t,s),u=0;u<l.length;++u)f=l[u],s.backdrop&&pP(t,s.backdrop),a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),ze(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(f,n,i,s.maxWidth)),t.fillText(f,n,i,s.maxWidth),hP(t,n,i,f,s),i+=Number(r.lineHeight);t.restore()}function yl(t,e){const{x:n,y:i,w:r,h:s,radius:l}=e;t.arc(n+l.topLeft,i+l.topLeft,l.topLeft,1.5*at,at,!0),t.lineTo(n,i+s-l.bottomLeft),t.arc(n+l.bottomLeft,i+s-l.bottomLeft,l.bottomLeft,at,Pt,!0),t.lineTo(n+r-l.bottomRight,i+s),t.arc(n+r-l.bottomRight,i+s-l.bottomRight,l.bottomRight,Pt,0,!0),t.lineTo(n+r,i+l.topRight),t.arc(n+r-l.topRight,i+l.topRight,l.topRight,0,-Pt,!0),t.lineTo(n+l.topLeft,i)}const gP=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,mP=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function vP(t,e){const n=(""+t).match(gP);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const yP=t=>+t||0;function Dm(t,e){const n={},i=Ie(e),r=i?Object.keys(e):e,s=Ie(t)?i?l=>Pe(t[l],t[e[l]]):l=>t[l]:()=>t;for(const l of r)n[l]=yP(s(l));return n}function i1(t){return Dm(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Cs(t){return Dm(t,["topLeft","topRight","bottomLeft","bottomRight"])}function sn(t){const e=i1(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function It(t,e){t=t||{},e=e||wt.font;let n=Pe(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let i=Pe(t.style,e.style);i&&!(""+i).match(mP)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Pe(t.family,e.family),lineHeight:vP(Pe(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:Pe(t.weight,e.weight),string:""};return r.string=lP(r),r}function Aa(t,e,n,i){let r=!0,s,l,a;for(s=0,l=t.length;s<l;++s)if(a=t[s],a!==void 0&&(e!==void 0&&typeof a=="function"&&(a=a(e),r=!1),n!==void 0&&rt(a)&&(a=a[n%a.length],r=!1),a!==void 0))return i&&!r&&(i.cacheable=!1),a}function _P(t,e,n){const{min:i,max:r}=t,s=Ww(e,(r-i)/2),l=(a,u)=>n&&a===0?0:a+u;return{min:l(i,-Math.abs(s)),max:l(r,s)}}function es(t,e){return Object.assign(Object.create(t),e)}function Rm(t,e=[""],n,i,r=()=>t[0]){const s=n||t;typeof i>"u"&&(i=a1("_fallback",t));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:i,_getTarget:r,override:a=>Rm([a,...t],e,s,i)};return new Proxy(l,{deleteProperty(a,u){return delete a[u],delete a._keys,delete t[0][u],!0},get(a,u){return s1(a,u,()=>TP(u,e,t,a))},getOwnPropertyDescriptor(a,u){return Reflect.getOwnPropertyDescriptor(a._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,u){return Gy(a).includes(u)},ownKeys(a){return Gy(a)},set(a,u,f){const p=a._storage||(a._storage=r());return a[u]=p[u]=f,delete a._keys,!0}})}function Lo(t,e,n,i){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:r1(t,i),setContext:s=>Lo(t,s,n,i),override:s=>Lo(t.override(s),e,n,i)};return new Proxy(r,{deleteProperty(s,l){return delete s[l],delete t[l],!0},get(s,l,a){return s1(s,l,()=>xP(s,l,a))},getOwnPropertyDescriptor(s,l){return s._descriptors.allKeys?Reflect.has(t,l)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,l)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(s,l){return Reflect.has(t,l)},ownKeys(){return Reflect.ownKeys(t)},set(s,l,a){return t[l]=a,delete s[l],!0}})}function r1(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:i,isScriptable:Zr(n)?n:()=>n,isIndexable:Zr(i)?i:()=>i}}const bP=(t,e)=>t?t+Pm(e):e,Im=(t,e)=>Ie(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function s1(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const i=n();return t[e]=i,i}function xP(t,e,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:l}=t;let a=i[e];return Zr(a)&&l.isScriptable(e)&&(a=wP(e,a,t,n)),rt(a)&&a.length&&(a=SP(e,a,t,l.isIndexable)),Im(e,a)&&(a=Lo(a,r,s&&s[e],l)),a}function wP(t,e,n,i){const{_proxy:r,_context:s,_subProxy:l,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let u=e(s,l||i);return a.delete(t),Im(t,u)&&(u=Um(r._scopes,r,t,u)),u}function SP(t,e,n,i){const{_proxy:r,_context:s,_subProxy:l,_descriptors:a}=n;if(typeof s.index<"u"&&i(t))return e[s.index%e.length];if(Ie(e[0])){const u=e,f=r._scopes.filter(p=>p!==u);e=[];for(const p of u){const m=Um(f,r,t,p);e.push(Lo(m,s,l&&l[t],a))}}return e}function o1(t,e,n){return Zr(t)?t(e,n):t}const kP=(t,e)=>t===!0?e:typeof t=="string"?Qr(e,t):void 0;function EP(t,e,n,i,r){for(const s of e){const l=kP(n,s);if(l){t.add(l);const a=o1(l._fallback,n,r);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(l===!1&&typeof i<"u"&&n!==i)return null}return!1}function Um(t,e,n,i){const r=e._rootScopes,s=o1(e._fallback,n,i),l=[...t,...r],a=new Set;a.add(i);let u=Wy(a,l,n,s||n,i);return u===null||typeof s<"u"&&s!==n&&(u=Wy(a,l,s,u,i),u===null)?!1:Rm(Array.from(a),[""],r,s,()=>CP(e,n,i))}function Wy(t,e,n,i,r){for(;n;)n=EP(t,e,n,i,r);return n}function CP(t,e,n){const i=t._getTarget();e in i||(i[e]={});const r=i[e];return rt(r)&&Ie(n)?n:r||{}}function TP(t,e,n,i){let r;for(const s of e)if(r=a1(bP(s,t),n),typeof r<"u")return Im(t,r)?Um(n,i,t,r):r}function a1(t,e){for(const n of e){if(!n)continue;const i=n[t];if(typeof i<"u")return i}}function Gy(t){let e=t._keys;return e||(e=t._keys=PP(t._scopes)),e}function PP(t){const e=new Set;for(const n of t)for(const i of Object.keys(n).filter(r=>!r.startsWith("_")))e.add(i);return Array.from(e)}function l1(t,e,n,i){const{iScale:r}=t,{key:s="r"}=this._parsing,l=new Array(i);let a,u,f,p;for(a=0,u=i;a<u;++a)f=a+n,p=e[f],l[a]={r:r.parse(Qr(p,s),f)};return l}const AP=Number.EPSILON||1e-14,Mo=(t,e)=>e<t.length&&!t[e].skip&&t[e],c1=t=>t==="x"?"y":"x";function OP(t,e,n,i){const r=t.skip?e:t,s=e,l=n.skip?e:n,a=lp(s,r),u=lp(l,s);let f=a/(a+u),p=u/(a+u);f=isNaN(f)?0:f,p=isNaN(p)?0:p;const m=i*f,o=i*p;return{previous:{x:s.x-m*(l.x-r.x),y:s.y-m*(l.y-r.y)},next:{x:s.x+o*(l.x-r.x),y:s.y+o*(l.y-r.y)}}}function LP(t,e,n){const i=t.length;let r,s,l,a,u,f=Mo(t,0);for(let p=0;p<i-1;++p)if(u=f,f=Mo(t,p+1),!(!u||!f)){if(ja(e[p],0,AP)){n[p]=n[p+1]=0;continue}r=n[p]/e[p],s=n[p+1]/e[p],a=Math.pow(r,2)+Math.pow(s,2),!(a<=9)&&(l=3/Math.sqrt(a),n[p]=r*l*e[p],n[p+1]=s*l*e[p])}}function MP(t,e,n="x"){const i=c1(n),r=t.length;let s,l,a,u=Mo(t,0);for(let f=0;f<r;++f){if(l=a,a=u,u=Mo(t,f+1),!a)continue;const p=a[n],m=a[i];l&&(s=(p-l[n])/3,a[`cp1${n}`]=p-s,a[`cp1${i}`]=m-s*e[f]),u&&(s=(u[n]-p)/3,a[`cp2${n}`]=p+s,a[`cp2${i}`]=m+s*e[f])}}function DP(t,e="x"){const n=c1(e),i=t.length,r=Array(i).fill(0),s=Array(i);let l,a,u,f=Mo(t,0);for(l=0;l<i;++l)if(a=u,u=f,f=Mo(t,l+1),!!u){if(f){const p=f[e]-u[e];r[l]=p!==0?(f[n]-u[n])/p:0}s[l]=a?f?Ii(r[l-1])!==Ii(r[l])?0:(r[l-1]+r[l])/2:r[l-1]:r[l]}LP(t,r,s),MP(t,s,e)}function mc(t,e,n){return Math.max(Math.min(t,n),e)}function RP(t,e){let n,i,r,s,l,a=nr(t[0],e);for(n=0,i=t.length;n<i;++n)l=s,s=a,a=n<i-1&&nr(t[n+1],e),s&&(r=t[n],l&&(r.cp1x=mc(r.cp1x,e.left,e.right),r.cp1y=mc(r.cp1y,e.top,e.bottom)),a&&(r.cp2x=mc(r.cp2x,e.left,e.right),r.cp2y=mc(r.cp2y,e.top,e.bottom)))}function IP(t,e,n,i,r){let s,l,a,u;if(e.spanGaps&&(t=t.filter(f=>!f.skip)),e.cubicInterpolationMode==="monotone")DP(t,r);else{let f=i?t[t.length-1]:t[0];for(s=0,l=t.length;s<l;++s)a=t[s],u=OP(f,a,t[Math.min(s+1,l-(i?0:1))%l],e.tension),a.cp1x=u.previous.x,a.cp1y=u.previous.y,a.cp2x=u.next.x,a.cp2y=u.next.y,f=a}e.capBezierPoints&&RP(t,n)}function u1(){return typeof window<"u"&&typeof document<"u"}function Fm(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Uu(t,e,n){let i;return typeof t=="string"?(i=parseInt(t,10),t.indexOf("%")!==-1&&(i=i/100*e.parentNode[n])):i=t,i}const of=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function UP(t,e){return of(t).getPropertyValue(e)}const FP=["top","right","bottom","left"];function Ts(t,e,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=FP[r];i[s]=parseFloat(t[e+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const zP=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function NP(t,e){const n=t.touches,i=n&&n.length?n[0]:t,{offsetX:r,offsetY:s}=i;let l=!1,a,u;if(zP(r,s,t.target))a=r,u=s;else{const f=e.getBoundingClientRect();a=i.clientX-f.left,u=i.clientY-f.top,l=!0}return{x:a,y:u,box:l}}function gs(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:i}=e,r=of(n),s=r.boxSizing==="border-box",l=Ts(r,"padding"),a=Ts(r,"border","width"),{x:u,y:f,box:p}=NP(t,n),m=l.left+(p&&a.left),o=l.top+(p&&a.top);let{width:c,height:d}=e;return s&&(c-=l.width+a.width,d-=l.height+a.height),{x:Math.round((u-m)/c*n.width/i),y:Math.round((f-o)/d*n.height/i)}}function BP(t,e,n){let i,r;if(e===void 0||n===void 0){const s=Fm(t);if(!s)e=t.clientWidth,n=t.clientHeight;else{const l=s.getBoundingClientRect(),a=of(s),u=Ts(a,"border","width"),f=Ts(a,"padding");e=l.width-f.width-u.width,n=l.height-f.height-u.height,i=Uu(a.maxWidth,s,"clientWidth"),r=Uu(a.maxHeight,s,"clientHeight")}}return{width:e,height:n,maxWidth:i||Ru,maxHeight:r||Ru}}const vc=t=>Math.round(t*10)/10;function jP(t,e,n,i){const r=of(t),s=Ts(r,"margin"),l=Uu(r.maxWidth,t,"clientWidth")||Ru,a=Uu(r.maxHeight,t,"clientHeight")||Ru,u=BP(t,e,n);let{width:f,height:p}=u;if(r.boxSizing==="content-box"){const o=Ts(r,"border","width"),c=Ts(r,"padding");f-=c.width+o.width,p-=c.height+o.height}return f=Math.max(0,f-s.width),p=Math.max(0,i?f/i:p-s.height),f=vc(Math.min(f,l,u.maxWidth)),p=vc(Math.min(p,a,u.maxHeight)),f&&!p&&(p=vc(f/2)),(e!==void 0||n!==void 0)&&i&&u.height&&p>u.height&&(p=u.height,f=vc(Math.floor(p*i))),{width:f,height:p}}function Yy(t,e,n){const i=e||1,r=Math.floor(t.height*i),s=Math.floor(t.width*i);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const l=t.canvas;return l.style&&(n||!l.style.height&&!l.style.width)&&(l.style.height=`${t.height}px`,l.style.width=`${t.width}px`),t.currentDevicePixelRatio!==i||l.height!==r||l.width!==s?(t.currentDevicePixelRatio=i,l.height=r,l.width=s,t.ctx.setTransform(i,0,0,i,0,0),!0):!1}const $P=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return t}();function Ky(t,e){const n=UP(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function ms(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function VP(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:i==="middle"?n<.5?t.y:e.y:i==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function HP(t,e,n,i){const r={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},l=ms(t,r,n),a=ms(r,s,n),u=ms(s,e,n),f=ms(l,a,n),p=ms(a,u,n);return ms(f,p,n)}const WP=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},GP=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function yo(t,e,n){return t?WP(e,n):GP()}function d1(t,e){let n,i;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function f1(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function h1(t){return t==="angle"?{between:vl,compare:YT,normalize:In}:{between:er,compare:(e,n)=>e-n,normalize:e=>e}}function Qy({start:t,end:e,count:n,loop:i,style:r}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n===0,style:r}}function YP(t,e,n){const{property:i,start:r,end:s}=n,{between:l,normalize:a}=h1(i),u=e.length;let{start:f,end:p,loop:m}=t,o,c;if(m){for(f+=u,p+=u,o=0,c=u;o<c&&l(a(e[f%u][i]),r,s);++o)f--,p--;f%=u,p%=u}return p<f&&(p+=u),{start:f,end:p,loop:m,style:t.style}}function p1(t,e,n){if(!n)return[t];const{property:i,start:r,end:s}=n,l=e.length,{compare:a,between:u,normalize:f}=h1(i),{start:p,end:m,loop:o,style:c}=YP(t,e,n),d=[];let h=!1,g=null,y,v,_;const b=()=>u(r,_,y)&&a(r,_)!==0,x=()=>a(s,y)===0||u(s,_,y),w=()=>h||b(),S=()=>!h||x();for(let C=p,T=p;C<=m;++C)v=e[C%l],!v.skip&&(y=f(v[i]),y!==_&&(h=u(y,r,s),g===null&&w()&&(g=a(y,r)===0?C:T),g!==null&&S()&&(d.push(Qy({start:g,end:C,loop:o,count:l,style:c})),g=null),T=C,_=y));return g!==null&&d.push(Qy({start:g,end:m,loop:o,count:l,style:c})),d}function g1(t,e){const n=[],i=t.segments;for(let r=0;r<i.length;r++){const s=p1(i[r],t.points,e);s.length&&n.push(...s)}return n}function KP(t,e,n,i){let r=0,s=e-1;if(n&&!i)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,n&&(s+=r);s>r&&t[s%e].skip;)s--;return s%=e,{start:r,end:s}}function QP(t,e,n,i){const r=t.length,s=[];let l=e,a=t[e],u;for(u=e+1;u<=n;++u){const f=t[u%r];f.skip||f.stop?a.skip||(i=!1,s.push({start:e%r,end:(u-1)%r,loop:i}),e=l=f.stop?u:null):(l=u,a.skip&&(e=u)),a=f}return l!==null&&s.push({start:e%r,end:l%r,loop:i}),s}function ZP(t,e){const n=t.points,i=t.options.spanGaps,r=n.length;if(!r)return[];const s=!!t._loop,{start:l,end:a}=KP(n,r,s,i);if(i===!0)return Zy(t,[{start:l,end:a,loop:s}],n,e);const u=a<l?a+r:a,f=!!t._fullLoop&&l===0&&a===r-1;return Zy(t,QP(n,l,u,f),n,e)}function Zy(t,e,n,i){return!i||!i.setContext||!n?e:XP(t,e,n,i)}function XP(t,e,n,i){const r=t._chart.getContext(),s=Xy(t.options),{_datasetIndex:l,options:{spanGaps:a}}=t,u=n.length,f=[];let p=s,m=e[0].start,o=m;function c(d,h,g,y){const v=a?-1:1;if(d!==h){for(d+=u;n[d%u].skip;)d-=v;for(;n[h%u].skip;)h+=v;d%u!==h%u&&(f.push({start:d%u,end:h%u,loop:g,style:y}),p=y,m=h%u)}}for(const d of e){m=a?m:d.start;let h=n[m%u],g;for(o=m+1;o<=d.end;o++){const y=n[o%u];g=Xy(i.setContext(es(r,{type:"segment",p0:h,p1:y,p0DataIndex:(o-1)%u,p1DataIndex:o%u,datasetIndex:l}))),qP(g,p)&&c(m,o-1,d.loop,p),h=y,p=g}m<o-1&&c(m,o-1,d.loop,p)}return f}function Xy(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function qP(t,e){if(!e)return!1;const n=[],i=function(r,s){return Mm(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(t,i)!==JSON.stringify(e,i)}class JP{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,i,r){const s=n.listeners[r],l=n.duration;s.forEach(a=>a({chart:e,initial:n.initial,numSteps:l,currentStep:Math.min(i-n.start,l)}))}_refresh(){this._request||(this._running=!0,this._request=Xw.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let l=s.length-1,a=!1,u;for(;l>=0;--l)u=s[l],u._active?(u._total>i.duration&&(i.duration=u._total),u.tick(e),a=!0):(s[l]=s[s.length-1],s.pop());a&&(r.draw(),this._notify(r,i,e,"progress")),s.length||(i.running=!1,this._notify(r,i,e,"complete"),i.initial=!1),n+=s.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let i=n.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,i)),i}listen(e,n,i){this._getAnims(e).listeners[n].push(i)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const i=n.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Gi=new JP;const qy="transparent",eA={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const i=$y(t||qy),r=i.valid&&$y(e||qy);return r&&r.valid?r.mix(i,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class tA{constructor(e,n,i,r){const s=n[i];r=Aa([e.to,r,s,e.from]);const l=Aa([e.from,s,r]);this._active=!0,this._fn=e.fn||eA[e.type||typeof l],this._easing=$a[e.easing]||$a.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=i,this._from=l,this._to=r,this._promises=void 0}active(){return this._active}update(e,n,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,l=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(l,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Aa([e.to,n,r,e.from]),this._from=Aa([e.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,i=this._duration,r=this._prop,s=this._from,l=this._loop,a=this._to;let u;if(this._active=s!==a&&(l||n<i),!this._active){this._target[r]=a,this._notify(!0);return}if(n<0){this._target[r]=s;return}u=n/i%2,u=l&&u>1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[r]=this._fn(s,a,u)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,i)=>{e.push({res:n,rej:i})})}_notify(e){const n=e?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][n]()}}class m1{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!Ie(e))return;const n=Object.keys(wt.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{const s=e[r];if(!Ie(s))return;const l={};for(const a of n)l[a]=s[a];(rt(s.properties)&&s.properties||[r]).forEach(a=>{(a===r||!i.has(a))&&i.set(a,l)})})}_animateOptions(e,n){const i=n.options,r=iA(e,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&nA(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,n){const i=this._properties,r=[],s=e.$animations||(e.$animations={}),l=Object.keys(n),a=Date.now();let u;for(u=l.length-1;u>=0;--u){const f=l[u];if(f.charAt(0)==="$")continue;if(f==="options"){r.push(...this._animateOptions(e,n));continue}const p=n[f];let m=s[f];const o=i.get(f);if(m)if(o&&m.active()){m.update(o,p,a);continue}else m.cancel();if(!o||!o.duration){e[f]=p;continue}s[f]=m=new tA(o,e,f,p),r.push(m)}return r}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const i=this._createAnimations(e,n);if(i.length)return Gi.add(this._chart,i),!0}}function nA(t,e){const n=[],i=Object.keys(e);for(let r=0;r<i.length;r++){const s=t[i[r]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function iA(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Jy(t,e){const n=t&&t.options||{},i=n.reverse,r=n.min===void 0?e:0,s=n.max===void 0?e:0;return{start:i?s:r,end:i?r:s}}function rA(t,e,n){if(n===!1)return!1;const i=Jy(t,n),r=Jy(e,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function sA(t){let e,n,i,r;return Ie(t)?(e=t.top,n=t.right,i=t.bottom,r=t.left):e=n=i=r=t,{top:e,right:n,bottom:i,left:r,disabled:t===!1}}function v1(t,e){const n=[],i=t._getSortedDatasetMetas(e);let r,s;for(r=0,s=i.length;r<s;++r)n.push(i[r].index);return n}function e0(t,e,n,i={}){const r=t.keys,s=i.mode==="single";let l,a,u,f;if(e!==null){for(l=0,a=r.length;l<a;++l){if(u=+r[l],u===n){if(i.all)continue;break}f=t.values[u],xt(f)&&(s||e===0||Ii(e)===Ii(f))&&(e+=f)}return e}}function oA(t){const e=Object.keys(t),n=new Array(e.length);let i,r,s;for(i=0,r=e.length;i<r;++i)s=e[i],n[i]={x:s,y:t[s]};return n}function t0(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function aA(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function lA(t){const{min:e,max:n,minDefined:i,maxDefined:r}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}function cA(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function n0(t,e,n,i){for(const r of e.getMatchingVisibleMetas(i).reverse()){const s=t[r.index];if(n&&s>0||!n&&s<0)return r.index}return null}function i0(t,e){const{chart:n,_cachedMeta:i}=t,r=n._stacks||(n._stacks={}),{iScale:s,vScale:l,index:a}=i,u=s.axis,f=l.axis,p=aA(s,l,i),m=e.length;let o;for(let c=0;c<m;++c){const d=e[c],{[u]:h,[f]:g}=d,y=d._stacks||(d._stacks={});o=y[f]=cA(r,p,h),o[a]=g,o._top=n0(o,l,!0,i.type),o._bottom=n0(o,l,!1,i.type);const v=o._visualValues||(o._visualValues={});v[a]=g}}function $f(t,e){const n=t.scales;return Object.keys(n).filter(i=>n[i].axis===e).shift()}function uA(t,e){return es(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function dA(t,e,n){return es(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function sa(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const r of e){const s=r._stacks;if(!s||s[i]===void 0||s[i][n]===void 0)return;delete s[i][n],s[i]._visualValues!==void 0&&s[i]._visualValues[n]!==void 0&&delete s[i]._visualValues[n]}}}const Vf=t=>t==="reset"||t==="none",r0=(t,e)=>e?t:Object.assign({},t),fA=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:v1(n,!0),values:null};class ts{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=t0(e.vScale,e),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(e){this.index!==e&&sa(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,i=this.getDataset(),r=(m,o,c,d)=>m==="x"?o:m==="r"?d:c,s=n.xAxisID=Pe(i.xAxisID,$f(e,"x")),l=n.yAxisID=Pe(i.yAxisID,$f(e,"y")),a=n.rAxisID=Pe(i.rAxisID,$f(e,"r")),u=n.indexAxis,f=n.iAxisID=r(u,s,l,a),p=n.vAxisID=r(u,l,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(l),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(f),n.vScale=this.getScaleForId(p)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Ny(this._data,this),e._stacked&&sa(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),i=this._data;if(Ie(n))this._data=oA(n);else if(i!==n){if(i){Ny(i,this);const r=this._cachedMeta;sa(r),r._parsed=[]}n&&Object.isExtensible(n)&&XT(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=n._stacked;n._stacked=t0(n.vScale,n),n.stack!==i.stack&&(r=!0,sa(n),n.stack=i.stack),this._resyncElements(e),(r||s!==n._stacked)&&i0(this,n._parsed)}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:l}=i,a=s.axis;let u=e===0&&n===r.length?!0:i._sorted,f=e>0&&i._parsed[e-1],p,m,o;if(this._parsing===!1)i._parsed=r,i._sorted=!0,o=r;else{rt(r[e])?o=this.parseArrayData(i,r,e,n):Ie(r[e])?o=this.parseObjectData(i,r,e,n):o=this.parsePrimitiveData(i,r,e,n);const c=()=>m[a]===null||f&&m[a]<f[a];for(p=0;p<n;++p)i._parsed[p+e]=m=o[p],u&&(c()&&(u=!1),f=m);i._sorted=u}l&&i0(this,o)}parsePrimitiveData(e,n,i,r){const{iScale:s,vScale:l}=e,a=s.axis,u=l.axis,f=s.getLabels(),p=s===l,m=new Array(r);let o,c,d;for(o=0,c=r;o<c;++o)d=o+i,m[o]={[a]:p||s.parse(f[d],d),[u]:l.parse(n[d],d)};return m}parseArrayData(e,n,i,r){const{xScale:s,yScale:l}=e,a=new Array(r);let u,f,p,m;for(u=0,f=r;u<f;++u)p=u+i,m=n[p],a[u]={x:s.parse(m[0],p),y:l.parse(m[1],p)};return a}parseObjectData(e,n,i,r){const{xScale:s,yScale:l}=e,{xAxisKey:a="x",yAxisKey:u="y"}=this._parsing,f=new Array(r);let p,m,o,c;for(p=0,m=r;p<m;++p)o=p+i,c=n[o],f[p]={x:s.parse(Qr(c,a),o),y:l.parse(Qr(c,u),o)};return f}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,i){const r=this.chart,s=this._cachedMeta,l=n[e.axis],a={keys:v1(r,!0),values:n._stacks[e.axis]._visualValues};return e0(a,l,s.index,{mode:i})}updateRangeFromParsed(e,n,i,r){const s=i[n.axis];let l=s===null?NaN:s;const a=r&&i._stacks[n.axis];r&&a&&(r.values=a,l=e0(r,s,this._cachedMeta.index)),e.min=Math.min(e.min,l),e.max=Math.max(e.max,l)}getMinMax(e,n){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&e===i.iScale,l=r.length,a=this._getOtherScale(e),u=fA(n,i,this.chart),f={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:p,max:m}=lA(a);let o,c;function d(){c=r[o];const h=c[a.axis];return!xt(c[e.axis])||p>h||m<h}for(o=0;o<l&&!(!d()&&(this.updateRangeFromParsed(f,e,c,u),s));++o);if(s){for(o=l-1;o>=0;--o)if(!d()){this.updateRangeFromParsed(f,e,c,u);break}}return f}getAllParsedValues(e){const n=this._cachedMeta._parsed,i=[];let r,s,l;for(r=0,s=n.length;r<s;++r)l=n[r][e.axis],xt(l)&&i.push(l);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,i=n.iScale,r=n.vScale,s=this.getParsed(e);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=sA(Pe(this.options.clip,rA(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,i=this._cachedMeta,r=i.data||[],s=n.chartArea,l=[],a=this._drawStart||0,u=this._drawCount||r.length-a,f=this.options.drawActiveElementsOnTop;let p;for(i.dataset&&i.dataset.draw(e,s,a,u),p=a;p<a+u;++p){const m=r[p];m.hidden||(m.active&&f?l.push(m):m.draw(e,s))}for(p=0;p<l.length;++p)l[p].draw(e,s)}getStyle(e,n){const i=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,n,i){const r=this.getDataset();let s;if(e>=0&&e<this._cachedMeta.data.length){const l=this._cachedMeta.data[e];s=l.$context||(l.$context=dA(this.getContext(),e,l)),s.parsed=this.getParsed(e),s.raw=r.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=uA(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=i,s}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",i){const r=n==="active",s=this._cachedDataOpts,l=e+"-"+n,a=s[l],u=this.enableOptionSharing&&ml(i);if(a)return r0(a,u);const f=this.chart.config,p=f.datasetElementScopeKeys(this._type,e),m=r?[`${e}Hover`,"hover",e,""]:[e,""],o=f.getOptionScopes(this.getDataset(),p),c=Object.keys(wt.elements[e]),d=()=>this.getContext(i,r,n),h=f.resolveNamedOptions(o,c,d,m);return h.$shared&&(h.$shared=u,s[l]=Object.freeze(r0(h,u))),h}_resolveAnimations(e,n,i){const r=this.chart,s=this._cachedDataOpts,l=`animation-${n}`,a=s[l];if(a)return a;let u;if(r.options.animation!==!1){const p=this.chart.config,m=p.datasetAnimationScopeKeys(this._type,n),o=p.getOptionScopes(this.getDataset(),m);u=p.createResolver(o,this.getContext(e,i,n))}const f=new m1(r,u&&u.animations);return u&&u._cacheable&&(s[l]=Object.freeze(f)),f}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||Vf(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const i=this.resolveDataElementOptions(e,n),r=this._sharedOptions,s=this.getSharedOptions(i),l=this.includeOptions(n,s)||s!==r;return this.updateSharedOptions(s,n,i),{sharedOptions:s,includeOptions:l}}updateElement(e,n,i,r){Vf(r)?Object.assign(e,i):this._resolveAnimations(n,r).update(e,i)}updateSharedOptions(e,n,i){e&&!Vf(n)&&this._resolveAnimations(void 0,n).update(e,i)}_setStyle(e,n,i,r){e.active=r;const s=this.getStyle(n,r);this._resolveAnimations(n,i,r).update(e,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(e,n,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,n,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,i=this._cachedMeta.data;for(const[a,u,f]of this._syncList)this[a](u,f);this._syncList=[];const r=i.length,s=n.length,l=Math.min(s,r);l&&this.parse(0,l),s>r?this._insertElements(r,s-r,e):s<r&&this._removeElements(s,r-s)}_insertElements(e,n,i=!0){const r=this._cachedMeta,s=r.data,l=e+n;let a;const u=f=>{for(f.length+=n,a=f.length-1;a>=l;a--)f[a]=f[a-n]};for(u(s),a=e;a<l;++a)s[a]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(e,n),i&&this.updateElements(s,e,n,"reset")}updateElements(e,n,i,r){}_removeElements(e,n){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(e,n);i._stacked&&sa(i,r)}i.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,i,r]=e;this[n](i,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function hA(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let i=[];for(let r=0,s=n.length;r<s;r++)i=i.concat(n[r].controller.getAllParsedValues(t));t._cache.$bar=Zw(i.sort((r,s)=>r-s))}return t._cache.$bar}function pA(t){const e=t.iScale,n=hA(e,t.type);let i=e._length,r,s,l,a;const u=()=>{l===32767||l===-32768||(ml(a)&&(i=Math.min(i,Math.abs(l-a)||i)),a=l)};for(r=0,s=n.length;r<s;++r)l=e.getPixelForValue(n[r]),u();for(a=void 0,r=0,s=e.ticks.length;r<s;++r)l=e.getPixelForTick(r),u();return i}function gA(t,e,n,i){const r=n.barThickness;let s,l;return ze(r)?(s=e.min*n.categoryPercentage,l=n.barPercentage):(s=r*i,l=1),{chunk:s/i,ratio:l,start:e.pixels[t]-s/2}}function mA(t,e,n,i){const r=e.pixels,s=r[t];let l=t>0?r[t-1]:null,a=t<r.length-1?r[t+1]:null;const u=n.categoryPercentage;l===null&&(l=s-(a===null?e.end-e.start:a-s)),a===null&&(a=s+s-l);const f=s-(s-Math.min(l,a))/2*u;return{chunk:Math.abs(a-l)/2*u/i,ratio:n.barPercentage,start:f}}function vA(t,e,n,i){const r=n.parse(t[0],i),s=n.parse(t[1],i),l=Math.min(r,s),a=Math.max(r,s);let u=l,f=a;Math.abs(l)>Math.abs(a)&&(u=a,f=l),e[n.axis]=f,e._custom={barStart:u,barEnd:f,start:r,end:s,min:l,max:a}}function y1(t,e,n,i){return rt(t)?vA(t,e,n,i):e[n.axis]=n.parse(t,i),e}function s0(t,e,n,i){const r=t.iScale,s=t.vScale,l=r.getLabels(),a=r===s,u=[];let f,p,m,o;for(f=n,p=n+i;f<p;++f)o=e[f],m={},m[r.axis]=a||r.parse(l[f],f),u.push(y1(o,m,s,f));return u}function Hf(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function yA(t,e,n){return t!==0?Ii(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function _A(t){let e,n,i,r,s;return t.horizontal?(e=t.base>t.x,n="left",i="right"):(e=t.base<t.y,n="bottom",i="top"),e?(r="end",s="start"):(r="start",s="end"),{start:n,end:i,reverse:e,top:r,bottom:s}}function bA(t,e,n,i){let r=e.borderSkipped;const s={};if(!r){t.borderSkipped=s;return}if(r===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:l,end:a,reverse:u,top:f,bottom:p}=_A(t);r==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===i?r=f:(n._bottom||0)===i?r=p:(s[o0(p,l,a,u)]=!0,r=f)),s[o0(r,l,a,u)]=!0,t.borderSkipped=s}function o0(t,e,n,i){return i?(t=xA(t,e,n),t=a0(t,n,e)):t=a0(t,e,n),t}function xA(t,e,n){return t===e?n:t===n?e:t}function a0(t,e,n){return t==="start"?e:t==="end"?n:t}function wA(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class SA extends ts{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(e,n,i,r){return s0(e,n,i,r)}parseArrayData(e,n,i,r){return s0(e,n,i,r)}parseObjectData(e,n,i,r){const{iScale:s,vScale:l}=e,{xAxisKey:a="x",yAxisKey:u="y"}=this._parsing,f=s.axis==="x"?a:u,p=l.axis==="x"?a:u,m=[];let o,c,d,h;for(o=i,c=i+r;o<c;++o)h=n[o],d={},d[s.axis]=s.parse(Qr(h,f),o),m.push(y1(Qr(h,p),d,l,o));return m}updateRangeFromParsed(e,n,i,r){super.updateRangeFromParsed(e,n,i,r);const s=i._custom;s&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,s.min),e.max=Math.max(e.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:i,vScale:r}=n,s=this.getParsed(e),l=s._custom,a=Hf(l)?"["+l.start+", "+l.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,i,r){const s=r==="reset",{index:l,_cachedMeta:{vScale:a}}=this,u=a.getBasePixel(),f=a.isHorizontal(),p=this._getRuler(),{sharedOptions:m,includeOptions:o}=this._getSharedOptions(n,r);for(let c=n;c<n+i;c++){const d=this.getParsed(c),h=s||ze(d[a.axis])?{base:u,head:u}:this._calculateBarValuePixels(c),g=this._calculateBarIndexPixels(c,p),y=(d._stacks||{})[a.axis],v={horizontal:f,base:h.base,enableBorderRadius:!y||Hf(d._custom)||l===y._top||l===y._bottom,x:f?h.head:g.center,y:f?g.center:h.head,height:f?g.size:Math.abs(h.size),width:f?Math.abs(h.size):g.size};o&&(v.options=m||this.resolveDataElementOptions(c,e[c].active?"active":r));const _=v.options||e[c].options;bA(v,_,y,l),wA(v,_,p.ratio),this.updateElement(e[c],c,v,r)}}_getStacks(e,n){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=i.options.stacked,l=[],a=u=>{const f=u.controller.getParsed(n),p=f&&f[u.vScale.axis];if(ze(p)||isNaN(p))return!0};for(const u of r)if(!(n!==void 0&&a(u))&&((s===!1||l.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&l.push(u.stack),u.index===e))break;return l.length||l.push(void 0),l}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,n,i){const r=this._getStacks(e,i),s=n!==void 0?r.indexOf(n):-1;return s===-1?r.length-1:s}_getRuler(){const e=this.options,n=this._cachedMeta,i=n.iScale,r=[];let s,l;for(s=0,l=n.data.length;s<l;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const a=e.barThickness;return{min:a||pA(n),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:i,index:r},options:{base:s,minBarLength:l}}=this,a=s||0,u=this.getParsed(e),f=u._custom,p=Hf(f);let m=u[n.axis],o=0,c=i?this.applyStack(n,u,i):m,d,h;c!==m&&(o=c-m,c=m),p&&(m=f.barStart,c=f.barEnd-f.barStart,m!==0&&Ii(m)!==Ii(f.barEnd)&&(o=0),o+=m);const g=!ze(s)&&!p?s:o;let y=n.getPixelForValue(g);if(this.chart.getDataVisibility(e)?d=n.getPixelForValue(o+c):d=y,h=d-y,Math.abs(h)<l){h=yA(h,n,a)*l,m===a&&(y-=h/2);const v=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),b=Math.min(v,_),x=Math.max(v,_);y=Math.max(Math.min(y,x),b),d=y+h,i&&!p&&(u._stacks[n.axis]._visualValues[r]=n.getValueForPixel(d)-n.getValueForPixel(y))}if(y===n.getPixelForValue(a)){const v=Ii(h)*n.getLineWidthForValue(a)/2;y+=v,h-=v}return{size:h,base:y,head:d,center:d+h/2}}_calculateBarIndexPixels(e,n){const i=n.scale,r=this.options,s=r.skipNull,l=Pe(r.maxBarThickness,1/0);let a,u;if(n.grouped){const f=s?this._getStackCount(e):n.stackCount,p=r.barThickness==="flex"?mA(e,n,r,f):gA(e,n,r,f),m=this._getStackIndex(this.index,this._cachedMeta.stack,s?e:void 0);a=p.start+p.chunk*m+p.chunk/2,u=Math.min(l,p.chunk*p.ratio)}else a=i.getPixelForValue(this.getParsed(e)[i.axis],e),u=Math.min(l,n.min*n.ratio);return{base:a-u/2,head:a+u/2,center:a,size:u}}draw(){const e=this._cachedMeta,n=e.vScale,i=e.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[n.axis]!==null&&i[s].draw(this._ctx)}}class kA extends ts{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,n,i,r){const s=super.parsePrimitiveData(e,n,i,r);for(let l=0;l<s.length;l++)s[l]._custom=this.resolveDataElementOptions(l+i).radius;return s}parseArrayData(e,n,i,r){const s=super.parseArrayData(e,n,i,r);for(let l=0;l<s.length;l++){const a=n[i+l];s[l]._custom=Pe(a[2],this.resolveDataElementOptions(l+i).radius)}return s}parseObjectData(e,n,i,r){const s=super.parseObjectData(e,n,i,r);for(let l=0;l<s.length;l++){const a=n[i+l];s[l]._custom=Pe(a&&a.r&&+a.r,this.resolveDataElementOptions(l+i).radius)}return s}getMaxOverflow(){const e=this._cachedMeta.data;let n=0;for(let i=e.length-1;i>=0;--i)n=Math.max(n,e[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,l=this.getParsed(e),a=r.getLabelForValue(l.x),u=s.getLabelForValue(l.y),f=l._custom;return{label:i[e]||"",value:"("+a+", "+u+(f?", "+f:"")+")"}}update(e){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,e)}updateElements(e,n,i,r){const s=r==="reset",{iScale:l,vScale:a}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,r),p=l.axis,m=a.axis;for(let o=n;o<n+i;o++){const c=e[o],d=!s&&this.getParsed(o),h={},g=h[p]=s?l.getPixelForDecimal(.5):l.getPixelForValue(d[p]),y=h[m]=s?a.getBasePixel():a.getPixelForValue(d[m]);h.skip=isNaN(g)||isNaN(y),f&&(h.options=u||this.resolveDataElementOptions(o,c.active?"active":r),s&&(h.options.radius=0)),this.updateElement(c,o,h,r)}}resolveDataElementOptions(e,n){const i=this.getParsed(e);let r=super.resolveDataElementOptions(e,n);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return n!=="active"&&(r.radius=0),r.radius+=Pe(i&&i._custom,s),r}}function EA(t,e,n){let i=1,r=1,s=0,l=0;if(e<st){const a=t,u=a+e,f=Math.cos(a),p=Math.sin(a),m=Math.cos(u),o=Math.sin(u),c=(_,b,x)=>vl(_,a,u,!0)?1:Math.max(b,b*n,x,x*n),d=(_,b,x)=>vl(_,a,u,!0)?-1:Math.min(b,b*n,x,x*n),h=c(0,f,m),g=c(Pt,p,o),y=d(at,f,m),v=d(at+Pt,p,o);i=(h-y)/2,r=(g-v)/2,s=-(h+y)/2,l=-(g+v)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:l}}class zm extends ts{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=e.legend.options;return n.labels.map((s,l)=>{const u=e.getDatasetMeta(0).controller.getStyle(l);return{text:s,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(l),index:l}})}return[]}},onClick(e,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}};constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(Ie(i[e])){const{key:u="value"}=this._parsing;s=f=>+Qr(i[f],u)}let l,a;for(l=e,a=e+n;l<a;++l)r._parsed[l]=s(l)}}_getRotation(){return gi(this.options.rotation-90)}_getCircumference(){return gi(this.options.circumference)}_getRotationExtents(){let e=st,n=-st;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,s=r._getRotation(),l=r._getCircumference();e=Math.min(e,s),n=Math.max(n,s+l)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:i}=n,r=this._cachedMeta,s=r.data,l=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-l)/2,0),u=Math.min(FT(this.options.cutout,a),1),f=this._getRingWeight(this.index),{circumference:p,rotation:m}=this._getRotationExtents(),{ratioX:o,ratioY:c,offsetX:d,offsetY:h}=EA(m,p,u),g=(i.width-l)/o,y=(i.height-l)/c,v=Math.max(Math.min(g,y)/2,0),_=Ww(this.options.radius,v),b=Math.max(_*u,0),x=(_-b)/this._getVisibleDatasetWeightTotal();this.offsetX=d*_,this.offsetY=h*_,r.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*f,0),this.updateElements(s,0,s.length,e)}_circumference(e,n){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||r._parsed[e]===null||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*s/st)}updateElements(e,n,i,r){const s=r==="reset",l=this.chart,a=l.chartArea,f=l.options.animation,p=(a.left+a.right)/2,m=(a.top+a.bottom)/2,o=s&&f.animateScale,c=o?0:this.innerRadius,d=o?0:this.outerRadius,{sharedOptions:h,includeOptions:g}=this._getSharedOptions(n,r);let y=this._getRotation(),v;for(v=0;v<n;++v)y+=this._circumference(v,s);for(v=n;v<n+i;++v){const _=this._circumference(v,s),b=e[v],x={x:p+this.offsetX,y:m+this.offsetY,startAngle:y,endAngle:y+_,circumference:_,outerRadius:d,innerRadius:c};g&&(x.options=h||this.resolveDataElementOptions(v,b.active?"active":r)),y+=_,this.updateElement(b,v,x,r)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let i=0,r;for(r=0;r<n.length;r++){const s=e._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!n[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?st*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Zl(n._parsed[e],i.options.locale);return{label:r[e]||"",value:s}}getMaxBorderWidth(e){let n=0;const i=this.chart;let r,s,l,a,u;if(!e){for(r=0,s=i.data.datasets.length;r<s;++r)if(i.isDatasetVisible(r)){l=i.getDatasetMeta(r),e=l.data,a=l.controller;break}}if(!e)return 0;for(r=0,s=e.length;r<s;++r)u=a.resolveDataElementOptions(r),u.borderAlign!=="inner"&&(n=Math.max(n,u.borderWidth||0,u.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let i=0,r=e.length;i<r;++i){const s=this.resolveDataElementOptions(i);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(e){return Math.max(Pe(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class _1 extends ts{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=n,l=this.chart._animationsDisabled;let{start:a,count:u}=Jw(n,r,l);this._drawStart=a,this._drawCount=u,e1(n)&&(a=0,u=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=r;const f=this.resolveDatasetElementOptions(e);this.options.showLine||(f.borderWidth=0),f.segment=this.options.segment,this.updateElement(i,void 0,{animated:!l,options:f},e),this.updateElements(r,a,u,e)}updateElements(e,n,i,r){const s=r==="reset",{iScale:l,vScale:a,_stacked:u,_dataset:f}=this._cachedMeta,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(n,r),o=l.axis,c=a.axis,{spanGaps:d,segment:h}=this.options,g=Oo(d)?d:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||r==="none",v=n+i,_=e.length;let b=n>0&&this.getParsed(n-1);for(let x=0;x<_;++x){const w=e[x],S=y?w:{};if(x<n||x>=v){S.skip=!0;continue}const C=this.getParsed(x),T=ze(C[c]),M=S[o]=l.getPixelForValue(C[o],x),B=S[c]=s||T?a.getBasePixel():a.getPixelForValue(u?this.applyStack(a,C,u):C[c],x);S.skip=isNaN(M)||isNaN(B)||T,S.stop=x>0&&Math.abs(C[o]-b[o])>g,h&&(S.parsed=C,S.raw=f.data[x]),m&&(S.options=p||this.resolveDataElementOptions(x,w.active?"active":r)),y||this.updateElement(w,x,S,r),b=C}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,i=n.options&&n.options.borderWidth||0,r=e.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),l=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,l)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}class b1 extends ts{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=e.legend.options;return n.labels.map((s,l)=>{const u=e.getDatasetMeta(0).controller.getStyle(l);return{text:s,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(l),index:l}})}return[]}},onClick(e,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,n){super(e,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Zl(n._parsed[e].r,i.options.locale);return{label:r[e]||"",value:s}}parseObjectData(e,n,i,r){return l1.bind(this)(e,n,i,r)}update(e){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,e)}getMinMax(){const e=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(s<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const e=this.chart,n=e.chartArea,i=e.options,r=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(r/2,0),l=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),a=(s-l)/e.getVisibleDatasetCount();this.outerRadius=s-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,n,i,r){const s=r==="reset",l=this.chart,u=l.options.animation,f=this._cachedMeta.rScale,p=f.xCenter,m=f.yCenter,o=f.getIndexAngle(0)-.5*at;let c=o,d;const h=360/this.countVisibleElements();for(d=0;d<n;++d)c+=this._computeAngle(d,r,h);for(d=n;d<n+i;d++){const g=e[d];let y=c,v=c+this._computeAngle(d,r,h),_=l.getDataVisibility(d)?f.getDistanceFromCenterForValue(this.getParsed(d).r):0;c=v,s&&(u.animateScale&&(_=0),u.animateRotate&&(y=v=o));const b={x:p,y:m,innerRadius:0,outerRadius:_,startAngle:y,endAngle:v,options:this.resolveDataElementOptions(d,g.active?"active":r)};this.updateElement(g,d,b,r)}}countVisibleElements(){const e=this._cachedMeta;let n=0;return e.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&n++}),n}_computeAngle(e,n,i){return this.chart.getDataVisibility(e)?gi(this.resolveDataElementOptions(e,n).angle||i):0}}class CA extends zm{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class TA extends ts{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(e){const n=this._cachedMeta.vScale,i=this.getParsed(e);return{label:n.getLabels()[e],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(e,n,i,r){return l1.bind(this)(e,n,i,r)}update(e){const n=this._cachedMeta,i=n.dataset,r=n.data||[],s=n.iScale.getLabels();if(i.points=r,e!=="resize"){const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===r.length,options:l};this.updateElement(i,void 0,a,e)}this.updateElements(r,0,r.length,e)}updateElements(e,n,i,r){const s=this._cachedMeta.rScale,l=r==="reset";for(let a=n;a<n+i;a++){const u=e[a],f=this.resolveDataElementOptions(a,u.active?"active":r),p=s.getPointPositionForValue(a,this.getParsed(a).r),m=l?s.xCenter:p.x,o=l?s.yCenter:p.y,c={x:m,y:o,angle:p.angle,skip:isNaN(m)||isNaN(o),options:f};this.updateElement(u,a,c,r)}}}class PA extends ts{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(e){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,l=this.getParsed(e),a=r.getLabelForValue(l.x),u=s.getLabelForValue(l.y);return{label:i[e]||"",value:"("+a+", "+u+")"}}update(e){const n=this._cachedMeta,{data:i=[]}=n,r=this.chart._animationsDisabled;let{start:s,count:l}=Jw(n,i,r);if(this._drawStart=s,this._drawCount=l,e1(n)&&(s=0,l=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:u}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!u._decimated,a.points=i;const f=this.resolveDatasetElementOptions(e);f.segment=this.options.segment,this.updateElement(a,void 0,{animated:!r,options:f},e)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,s,l,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,n,i,r){const s=r==="reset",{iScale:l,vScale:a,_stacked:u,_dataset:f}=this._cachedMeta,p=this.resolveDataElementOptions(n,r),m=this.getSharedOptions(p),o=this.includeOptions(r,m),c=l.axis,d=a.axis,{spanGaps:h,segment:g}=this.options,y=Oo(h)?h:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||r==="none";let _=n>0&&this.getParsed(n-1);for(let b=n;b<n+i;++b){const x=e[b],w=this.getParsed(b),S=v?x:{},C=ze(w[d]),T=S[c]=l.getPixelForValue(w[c],b),M=S[d]=s||C?a.getBasePixel():a.getPixelForValue(u?this.applyStack(a,w,u):w[d],b);S.skip=isNaN(T)||isNaN(M)||C,S.stop=b>0&&Math.abs(w[c]-_[c])>y,g&&(S.parsed=w,S.raw=f.data[b]),o&&(S.options=m||this.resolveDataElementOptions(b,x.active?"active":r)),v||this.updateElement(x,b,S,r),_=w}this.updateSharedOptions(m,r,p)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let a=0;for(let u=n.length-1;u>=0;--u)a=Math.max(a,n[u].size(this.resolveDataElementOptions(u))/2);return a>0&&a}const i=e.dataset,r=i.options&&i.options.borderWidth||0;if(!n.length)return r;const s=n[0].size(this.resolveDataElementOptions(0)),l=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(r,s,l)/2}}var AA=Object.freeze({__proto__:null,BarController:SA,BubbleController:kA,DoughnutController:zm,LineController:_1,PieController:CA,PolarAreaController:b1,RadarController:TA,ScatterController:PA});function ds(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Nm{static override(e){Object.assign(Nm.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return ds()}parse(){return ds()}format(){return ds()}add(){return ds()}diff(){return ds()}startOf(){return ds()}endOf(){return ds()}}var OA={_date:Nm};function LA(t,e,n,i){const{controller:r,data:s,_sorted:l}=t,a=r._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&l&&s.length){const u=a._reversePixels?QT:tr;if(i){if(r._sharedOptions){const f=s[0],p=typeof f.getRange=="function"&&f.getRange(e);if(p){const m=u(s,e,n-p),o=u(s,e,n+p);return{lo:m.lo,hi:o.hi}}}}else return u(s,e,n)}return{lo:0,hi:s.length-1}}function Xl(t,e,n,i,r){const s=t.getSortedVisibleDatasetMetas(),l=n[e];for(let a=0,u=s.length;a<u;++a){const{index:f,data:p}=s[a],{lo:m,hi:o}=LA(s[a],e,l,r);for(let c=m;c<=o;++c){const d=p[c];d.skip||i(d,f,c)}}}function MA(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(i,r){const s=e?Math.abs(i.x-r.x):0,l=n?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(l,2))}}function Wf(t,e,n,i,r){const s=[];return!r&&!t.isPointInArea(e)||Xl(t,n,e,function(a,u,f){!r&&!nr(a,t.chartArea,0)||a.inRange(e.x,e.y,i)&&s.push({element:a,datasetIndex:u,index:f})},!0),s}function DA(t,e,n,i){let r=[];function s(l,a,u){const{startAngle:f,endAngle:p}=l.getProps(["startAngle","endAngle"],i),{angle:m}=Kw(l,{x:e.x,y:e.y});vl(m,f,p)&&r.push({element:l,datasetIndex:a,index:u})}return Xl(t,n,e,s),r}function RA(t,e,n,i,r,s){let l=[];const a=MA(n);let u=Number.POSITIVE_INFINITY;function f(p,m,o){const c=p.inRange(e.x,e.y,r);if(i&&!c)return;const d=p.getCenterPoint(r);if(!(!!s||t.isPointInArea(d))&&!c)return;const g=a(e,d);g<u?(l=[{element:p,datasetIndex:m,index:o}],u=g):g===u&&l.push({element:p,datasetIndex:m,index:o})}return Xl(t,n,e,f),l}function Gf(t,e,n,i,r,s){return!s&&!t.isPointInArea(e)?[]:n==="r"&&!i?DA(t,e,n,r):RA(t,e,n,i,r,s)}function l0(t,e,n,i,r){const s=[],l=n==="x"?"inXRange":"inYRange";let a=!1;return Xl(t,n,e,(u,f,p)=>{u[l](e[n],r)&&(s.push({element:u,datasetIndex:f,index:p}),a=a||u.inRange(e.x,e.y,r))}),i&&!a?[]:s}var IA={evaluateInteractionItems:Xl,modes:{index(t,e,n,i){const r=gs(e,t),s=n.axis||"x",l=n.includeInvisible||!1,a=n.intersect?Wf(t,r,s,i,l):Gf(t,r,s,!1,i,l),u=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(f=>{const p=a[0].index,m=f.data[p];m&&!m.skip&&u.push({element:m,datasetIndex:f.index,index:p})}),u):[]},dataset(t,e,n,i){const r=gs(e,t),s=n.axis||"xy",l=n.includeInvisible||!1;let a=n.intersect?Wf(t,r,s,i,l):Gf(t,r,s,!1,i,l);if(a.length>0){const u=a[0].datasetIndex,f=t.getDatasetMeta(u).data;a=[];for(let p=0;p<f.length;++p)a.push({element:f[p],datasetIndex:u,index:p})}return a},point(t,e,n,i){const r=gs(e,t),s=n.axis||"xy",l=n.includeInvisible||!1;return Wf(t,r,s,i,l)},nearest(t,e,n,i){const r=gs(e,t),s=n.axis||"xy",l=n.includeInvisible||!1;return Gf(t,r,s,n.intersect,i,l)},x(t,e,n,i){const r=gs(e,t);return l0(t,r,"x",n.intersect,i)},y(t,e,n,i){const r=gs(e,t);return l0(t,r,"y",n.intersect,i)}}};const x1=["left","top","right","bottom"];function oa(t,e){return t.filter(n=>n.pos===e)}function c0(t,e){return t.filter(n=>x1.indexOf(n.pos)===-1&&n.box.axis===e)}function aa(t,e){return t.sort((n,i)=>{const r=e?i:n,s=e?n:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function UA(t){const e=[];let n,i,r,s,l,a;for(n=0,i=(t||[]).length;n<i;++n)r=t[n],{position:s,options:{stack:l,stackWeight:a=1}}=r,e.push({index:n,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:l&&s+l,stackWeight:a});return e}function FA(t){const e={};for(const n of t){const{stack:i,pos:r,stackWeight:s}=n;if(!i||!x1.includes(r))continue;const l=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});l.count++,l.weight+=s}return e}function zA(t,e){const n=FA(t),{vBoxMaxWidth:i,hBoxMaxHeight:r}=e;let s,l,a;for(s=0,l=t.length;s<l;++s){a=t[s];const{fullSize:u}=a.box,f=n[a.stack],p=f&&a.stackWeight/f.weight;a.horizontal?(a.width=p?p*i:u&&e.availableWidth,a.height=r):(a.width=i,a.height=p?p*r:u&&e.availableHeight)}return n}function NA(t){const e=UA(t),n=aa(e.filter(f=>f.box.fullSize),!0),i=aa(oa(e,"left"),!0),r=aa(oa(e,"right")),s=aa(oa(e,"top"),!0),l=aa(oa(e,"bottom")),a=c0(e,"x"),u=c0(e,"y");return{fullSize:n,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(l).concat(a),chartArea:oa(e,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(l).concat(a)}}function u0(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function w1(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function BA(t,e,n,i){const{pos:r,box:s}=n,l=t.maxPadding;if(!Ie(r)){n.size&&(t[r]-=n.size);const m=i[n.stack]||{size:0,count:1};m.size=Math.max(m.size,n.horizontal?s.height:s.width),n.size=m.size/m.count,t[r]+=n.size}s.getPadding&&w1(l,s.getPadding());const a=Math.max(0,e.outerWidth-u0(l,t,"left","right")),u=Math.max(0,e.outerHeight-u0(l,t,"top","bottom")),f=a!==t.w,p=u!==t.h;return t.w=a,t.h=u,n.horizontal?{same:f,other:p}:{same:p,other:f}}function jA(t){const e=t.maxPadding;function n(i){const r=Math.max(e[i]-t[i],0);return t[i]+=r,r}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function $A(t,e){const n=e.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(l=>{s[l]=Math.max(e[l],n[l])}),s}return i(t?["left","right"]:["top","bottom"])}function Oa(t,e,n,i){const r=[];let s,l,a,u,f,p;for(s=0,l=t.length,f=0;s<l;++s){a=t[s],u=a.box,u.update(a.width||e.w,a.height||e.h,$A(a.horizontal,e));const{same:m,other:o}=BA(e,n,a,i);f|=m&&r.length,p=p||o,u.fullSize||r.push(a)}return f&&Oa(r,e,n,i)||p}function yc(t,e,n,i,r){t.top=n,t.left=e,t.right=e+i,t.bottom=n+r,t.width=i,t.height=r}function d0(t,e,n,i){const r=n.padding;let{x:s,y:l}=e;for(const a of t){const u=a.box,f=i[a.stack]||{count:1,placed:0,weight:1},p=a.stackWeight/f.weight||1;if(a.horizontal){const m=e.w*p,o=f.size||u.height;ml(f.start)&&(l=f.start),u.fullSize?yc(u,r.left,l,n.outerWidth-r.right-r.left,o):yc(u,e.left+f.placed,l,m,o),f.start=l,f.placed+=m,l=u.bottom}else{const m=e.h*p,o=f.size||u.width;ml(f.start)&&(s=f.start),u.fullSize?yc(u,s,r.top,o,n.outerHeight-r.bottom-r.top):yc(u,s,e.top+f.placed,o,m),f.start=s,f.placed+=m,s=u.right}}e.x=s,e.y=l}var rn={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,i){if(!t)return;const r=sn(t.options.layout.padding),s=Math.max(e-r.width,0),l=Math.max(n-r.height,0),a=NA(t.boxes),u=a.vertical,f=a.horizontal;Qe(t.boxes,h=>{typeof h.beforeLayout=="function"&&h.beforeLayout()});const p=u.reduce((h,g)=>g.box.options&&g.box.options.display===!1?h:h+1,0)||1,m=Object.freeze({outerWidth:e,outerHeight:n,padding:r,availableWidth:s,availableHeight:l,vBoxMaxWidth:s/2/p,hBoxMaxHeight:l/2}),o=Object.assign({},r);w1(o,sn(i));const c=Object.assign({maxPadding:o,w:s,h:l,x:r.left,y:r.top},r),d=zA(u.concat(f),m);Oa(a.fullSize,c,m,d),Oa(u,c,m,d),Oa(f,c,m,d)&&Oa(u,c,m,d),jA(c),d0(a.leftAndTop,c,m,d),c.x+=c.w,c.y+=c.h,d0(a.rightAndBottom,c,m,d),t.chartArea={left:c.left,top:c.top,right:c.left+c.w,bottom:c.top+c.h,height:c.h,width:c.w},Qe(a.chartArea,h=>{const g=h.box;Object.assign(g,t.chartArea),g.update(c.w,c.h,{left:0,top:0,right:0,bottom:0})})}};class S1{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,i){}removeEventListener(e,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,i,r){return n=Math.max(0,n||e.width),i=i||e.height,{width:n,height:Math.max(0,r?Math.floor(n/r):i)}}isAttached(e){return!0}updateConfig(e){}}class VA extends S1{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const eu="$chartjs",HA={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},f0=t=>t===null||t==="";function WA(t,e){const n=t.style,i=t.getAttribute("height"),r=t.getAttribute("width");if(t[eu]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",f0(r)){const s=Ky(t,"width");s!==void 0&&(t.width=s)}if(f0(i))if(t.style.height==="")t.height=t.width/(e||2);else{const s=Ky(t,"height");s!==void 0&&(t.height=s)}return t}const k1=$P?{passive:!0}:!1;function GA(t,e,n){t.addEventListener(e,n,k1)}function YA(t,e,n){t.canvas.removeEventListener(e,n,k1)}function KA(t,e){const n=HA[t.type]||t.type,{x:i,y:r}=gs(t,e);return{type:n,chart:e,native:t,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Fu(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function QA(t,e,n){const i=t.canvas,r=new MutationObserver(s=>{let l=!1;for(const a of s)l=l||Fu(a.addedNodes,i),l=l&&!Fu(a.removedNodes,i);l&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function ZA(t,e,n){const i=t.canvas,r=new MutationObserver(s=>{let l=!1;for(const a of s)l=l||Fu(a.removedNodes,i),l=l&&!Fu(a.addedNodes,i);l&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const _l=new Map;let h0=0;function E1(){const t=window.devicePixelRatio;t!==h0&&(h0=t,_l.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function XA(t,e){_l.size||window.addEventListener("resize",E1),_l.set(t,e)}function qA(t){_l.delete(t),_l.size||window.removeEventListener("resize",E1)}function JA(t,e,n){const i=t.canvas,r=i&&Fm(i);if(!r)return;const s=qw((a,u)=>{const f=r.clientWidth;n(a,u),f<r.clientWidth&&n()},window),l=new ResizeObserver(a=>{const u=a[0],f=u.contentRect.width,p=u.contentRect.height;f===0&&p===0||s(f,p)});return l.observe(r),XA(t,s),l}function Yf(t,e,n){n&&n.disconnect(),e==="resize"&&qA(t)}function eO(t,e,n){const i=t.canvas,r=qw(s=>{t.ctx!==null&&n(KA(s,t))},t);return GA(i,e,r),r}class tO extends S1{acquireContext(e,n){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(WA(e,n),i):null}releaseContext(e){const n=e.canvas;if(!n[eu])return!1;const i=n[eu].initial;["height","width"].forEach(s=>{const l=i[s];ze(l)?n.removeAttribute(s):n.setAttribute(s,l)});const r=i.style||{};return Object.keys(r).forEach(s=>{n.style[s]=r[s]}),n.width=n.width,delete n[eu],!0}addEventListener(e,n,i){this.removeEventListener(e,n);const r=e.$proxies||(e.$proxies={}),l={attach:QA,detach:ZA,resize:JA}[n]||eO;r[n]=l(e,n,i)}removeEventListener(e,n){const i=e.$proxies||(e.$proxies={}),r=i[n];if(!r)return;({attach:Yf,detach:Yf,resize:Yf}[n]||YA)(e,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,i,r){return jP(e,n,i,r)}isAttached(e){const n=Fm(e);return!!(n&&n.isConnected)}}function nO(t){return!u1()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?VA:tO}class pr{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:n,y:i}=this.getProps(["x","y"],e);return{x:n,y:i}}hasValue(){return Oo(this.x)&&Oo(this.y)}getProps(e,n){const i=this.$animations;if(!n||!i)return this;const r={};return e.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}function iO(t,e){const n=t.options.ticks,i=rO(t),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?oO(e):[],l=s.length,a=s[0],u=s[l-1],f=[];if(l>r)return aO(e,f,s,l/r),f;const p=sO(s,e,r);if(l>0){let m,o;const c=l>1?Math.round((u-a)/(l-1)):null;for(_c(e,f,p,ze(c)?0:a-c,a),m=0,o=l-1;m<o;m++)_c(e,f,p,s[m],s[m+1]);return _c(e,f,p,u,ze(c)?e.length:u+c),f}return _c(e,f,p),f}function rO(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),r=t._maxLength/n;return Math.floor(Math.min(i,r))}function sO(t,e,n){const i=lO(t),r=e.length/n;if(!i)return Math.max(r,1);const s=WT(i);for(let l=0,a=s.length-1;l<a;l++){const u=s[l];if(u>r)return u}return Math.max(r,1)}function oO(t){const e=[];let n,i;for(n=0,i=t.length;n<i;n++)t[n].major&&e.push(n);return e}function aO(t,e,n,i){let r=0,s=n[0],l;for(i=Math.ceil(i),l=0;l<t.length;l++)l===s&&(e.push(t[l]),r++,s=n[r*i])}function _c(t,e,n,i,r){const s=Pe(i,0),l=Math.min(Pe(r,t.length),t.length);let a=0,u,f,p;for(n=Math.ceil(n),r&&(u=r-i,n=u/Math.floor(u/n)),p=s;p<0;)a++,p=Math.round(s+a*n);for(f=Math.max(s,0);f<l;f++)f===p&&(e.push(t[f]),a++,p=Math.round(s+a*n))}function lO(t){const e=t.length;let n,i;if(e<2)return!1;for(i=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==i)return!1;return i}const cO=t=>t==="left"?"right":t==="right"?"left":t,p0=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,g0=(t,e)=>Math.min(e||t,t);function m0(t,e){const n=[],i=t.length/e,r=t.length;let s=0;for(;s<r;s+=i)n.push(t[Math.floor(s)]);return n}function uO(t,e,n){const i=t.ticks.length,r=Math.min(e,i-1),s=t._startPixel,l=t._endPixel,a=1e-6;let u=t.getPixelForTick(r),f;if(!(n&&(i===1?f=Math.max(u-s,l-u):e===0?f=(t.getPixelForTick(1)-u)/2:f=(u-t.getPixelForTick(r-1))/2,u+=r<e?f:-f,u<s-a||u>l+a)))return u}function dO(t,e){Qe(t,n=>{const i=n.gc,r=i.length/2;let s;if(r>e){for(s=0;s<r;++s)delete n.data[i[s]];i.splice(0,r)}})}function la(t){return t.drawTicks?t.tickLength:0}function v0(t,e){if(!t.display)return 0;const n=It(t.font,e),i=sn(t.padding);return(rt(t.text)?t.text.length:1)*n.lineHeight+i.height}function fO(t,e){return es(t,{scale:e,type:"scale"})}function hO(t,e,n){return es(t,{tick:n,index:e,type:"tick"})}function pO(t,e,n){let i=Lm(t);return(n&&e!=="right"||!n&&e==="right")&&(i=cO(i)),i}function gO(t,e,n,i){const{top:r,left:s,bottom:l,right:a,chart:u}=t,{chartArea:f,scales:p}=u;let m=0,o,c,d;const h=l-r,g=a-s;if(t.isHorizontal()){if(c=tn(i,s,a),Ie(n)){const y=Object.keys(n)[0],v=n[y];d=p[y].getPixelForValue(v)+h-e}else n==="center"?d=(f.bottom+f.top)/2+h-e:d=p0(t,n,e);o=a-s}else{if(Ie(n)){const y=Object.keys(n)[0],v=n[y];c=p[y].getPixelForValue(v)-g+e}else n==="center"?c=(f.left+f.right)/2-g+e:c=p0(t,n,e);d=tn(i,l,r),m=n==="left"?-Pt:Pt}return{titleX:c,titleY:d,maxWidth:o,rotation:m}}class Bs extends pr{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:i,_suggestedMax:r}=this;return e=An(e,Number.POSITIVE_INFINITY),n=An(n,Number.NEGATIVE_INFINITY),i=An(i,Number.POSITIVE_INFINITY),r=An(r,Number.NEGATIVE_INFINITY),{min:An(e,i),max:An(n,r),minDefined:xt(e),maxDefined:xt(n)}}getMinMax(e){let{min:n,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),l;if(r&&s)return{min:n,max:i};const a=this.getMatchingVisibleMetas();for(let u=0,f=a.length;u<f;++u)l=a[u].controller.getMinMax(this,e),r||(n=Math.min(n,l.min)),s||(i=Math.max(i,l.max));return n=s&&n>i?i:n,i=r&&n>i?n:i,{min:An(n,An(i,n)),max:An(i,An(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){et(this.options.beforeUpdate,[this])}update(e,n,i){const{beginAtZero:r,grace:s,ticks:l}=this.options,a=l.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,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=_P(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=a<this.ticks.length;this._convertTicksToLabels(u?m0(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),l.display&&(l.autoSkip||l.source==="auto")&&(this.ticks=iO(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),u&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,e=!e),this._startPixel=n,this._endPixel=i,this._reversePixels=e,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){et(this.options.afterUpdate,[this])}beforeSetDimensions(){et(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){et(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),et(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){et(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let i,r,s;for(i=0,r=e.length;i<r;i++)s=e[i],s.label=et(n.callback,[s.value,i,e],this)}afterTickToLabelConversion(){et(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){et(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,i=g0(this.ticks.length,e.ticks.maxTicksLimit),r=n.minRotation||0,s=n.maxRotation;let l=r,a,u,f;if(!this._isVisible()||!n.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const p=this._getLabelSizes(),m=p.widest.width,o=p.highest.height,c=Nt(this.chart.width-m,0,this.maxWidth);a=e.offset?this.maxWidth/i:c/(i-1),m+6>a&&(a=c/(i-(e.offset?.5:1)),u=this.maxHeight-la(e.grid)-n.padding-v0(e.title,this.chart.options.font),f=Math.sqrt(m*m+o*o),l=Am(Math.min(Math.asin(Nt((p.highest.height+6)/a,-1,1)),Math.asin(Nt(u/f,-1,1))-Math.asin(Nt(o/f,-1,1)))),l=Math.max(r,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){et(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){et(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:i,title:r,grid:s}}=this,l=this._isVisible(),a=this.isHorizontal();if(l){const u=v0(r,n.options.font);if(a?(e.width=this.maxWidth,e.height=la(s)+u):(e.height=this.maxHeight,e.width=la(s)+u),i.display&&this.ticks.length){const{first:f,last:p,widest:m,highest:o}=this._getLabelSizes(),c=i.padding*2,d=gi(this.labelRotation),h=Math.cos(d),g=Math.sin(d);if(a){const y=i.mirror?0:g*m.width+h*o.height;e.height=Math.min(this.maxHeight,e.height+y+c)}else{const y=i.mirror?0:h*m.width+g*o.height;e.width=Math.min(this.maxWidth,e.width+y+c)}this._calculatePadding(f,p,g,h)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,i,r){const{ticks:{align:s,padding:l},position:a}=this.options,u=this.labelRotation!==0,f=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const p=this.getPixelForTick(0)-this.left,m=this.right-this.getPixelForTick(this.ticks.length-1);let o=0,c=0;u?f?(o=r*e.width,c=i*n.height):(o=i*e.height,c=r*n.width):s==="start"?c=n.width:s==="end"?o=e.width:s!=="inner"&&(o=e.width/2,c=n.width/2),this.paddingLeft=Math.max((o-p+l)*this.width/(this.width-p),0),this.paddingRight=Math.max((c-m+l)*this.width/(this.width-m),0)}else{let p=n.height/2,m=e.height/2;s==="start"?(p=0,m=e.height):s==="end"&&(p=n.height,m=0),this.paddingTop=p+l,this.paddingBottom=m+l}}_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(){et(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,i;for(n=0,i=e.length;n<i;n++)ze(e[n].label)&&(e.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=m0(i,n)),this._labelSizes=e=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,i){const{ctx:r,_longestTextCache:s}=this,l=[],a=[],u=Math.floor(n/g0(n,i));let f=0,p=0,m,o,c,d,h,g,y,v,_,b,x;for(m=0;m<n;m+=u){if(d=e[m].label,h=this._resolveTickFontOptions(m),r.font=g=h.string,y=s[g]=s[g]||{data:{},gc:[]},v=h.lineHeight,_=b=0,!ze(d)&&!rt(d))_=Iu(r,y.data,y.gc,_,d),b=v;else if(rt(d))for(o=0,c=d.length;o<c;++o)x=d[o],!ze(x)&&!rt(x)&&(_=Iu(r,y.data,y.gc,_,x),b+=v);l.push(_),a.push(b),f=Math.max(_,f),p=Math.max(b,p)}dO(s,n);const w=l.indexOf(f),S=a.indexOf(p),C=T=>({width:l[T]||0,height:a[T]||0});return{first:C(0),last:C(n-1),widest:C(w),highest:C(S),widths:l,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return KT(this._alignToPixels?us(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const i=n[e];return i.$context||(i.$context=hO(this.getContext(),e,i))}return this.$context||(this.$context=fO(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=gi(this.labelRotation),i=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=this._getLabelSizes(),l=e.autoSkipPadding||0,a=s?s.widest.width+l:0,u=s?s.highest.height+l:0;return this.isHorizontal()?u*i>a*r?a/i:u/r:u*r<a*i?u/i:a/r}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,i=this.chart,r=this.options,{grid:s,position:l,border:a}=r,u=s.offset,f=this.isHorizontal(),m=this.ticks.length+(u?1:0),o=la(s),c=[],d=a.setContext(this.getContext()),h=d.display?d.width:0,g=h/2,y=function(Y){return us(i,Y,h)};let v,_,b,x,w,S,C,T,M,B,F,N;if(l==="top")v=y(this.bottom),S=this.bottom-o,T=v-g,B=y(e.top)+g,N=e.bottom;else if(l==="bottom")v=y(this.top),B=e.top,N=y(e.bottom)-g,S=v+g,T=this.top+o;else if(l==="left")v=y(this.right),w=this.right-o,C=v-g,M=y(e.left)+g,F=e.right;else if(l==="right")v=y(this.left),M=e.left,F=y(e.right)-g,w=v+g,C=this.left+o;else if(n==="x"){if(l==="center")v=y((e.top+e.bottom)/2+.5);else if(Ie(l)){const Y=Object.keys(l)[0],ee=l[Y];v=y(this.chart.scales[Y].getPixelForValue(ee))}B=e.top,N=e.bottom,S=v+g,T=S+o}else if(n==="y"){if(l==="center")v=y((e.left+e.right)/2);else if(Ie(l)){const Y=Object.keys(l)[0],ee=l[Y];v=y(this.chart.scales[Y].getPixelForValue(ee))}w=v-g,C=w-o,M=e.left,F=e.right}const W=Pe(r.ticks.maxTicksLimit,m),H=Math.max(1,Math.ceil(m/W));for(_=0;_<m;_+=H){const Y=this.getContext(_),ee=s.setContext(Y),I=a.setContext(Y),z=ee.lineWidth,X=ee.color,K=I.dash||[],be=I.dashOffset,Ke=ee.tickWidth,ue=ee.tickColor,fe=ee.tickBorderDash||[],ke=ee.tickBorderDashOffset;b=uO(this,_,u),b!==void 0&&(x=us(i,b,z),f?w=C=M=F=x:S=T=B=N=x,c.push({tx1:w,ty1:S,tx2:C,ty2:T,x1:M,y1:B,x2:F,y2:N,width:z,color:X,borderDash:K,borderDashOffset:be,tickWidth:Ke,tickColor:ue,tickBorderDash:fe,tickBorderDashOffset:ke}))}return this._ticksLength=m,this._borderValue=v,c}_computeLabelItems(e){const n=this.axis,i=this.options,{position:r,ticks:s}=i,l=this.isHorizontal(),a=this.ticks,{align:u,crossAlign:f,padding:p,mirror:m}=s,o=la(i.grid),c=o+p,d=m?-p:c,h=-gi(this.labelRotation),g=[];let y,v,_,b,x,w,S,C,T,M,B,F,N="middle";if(r==="top")w=this.bottom-d,S=this._getXAxisLabelAlignment();else if(r==="bottom")w=this.top+d,S=this._getXAxisLabelAlignment();else if(r==="left"){const H=this._getYAxisLabelAlignment(o);S=H.textAlign,x=H.x}else if(r==="right"){const H=this._getYAxisLabelAlignment(o);S=H.textAlign,x=H.x}else if(n==="x"){if(r==="center")w=(e.top+e.bottom)/2+c;else if(Ie(r)){const H=Object.keys(r)[0],Y=r[H];w=this.chart.scales[H].getPixelForValue(Y)+c}S=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")x=(e.left+e.right)/2-c;else if(Ie(r)){const H=Object.keys(r)[0],Y=r[H];x=this.chart.scales[H].getPixelForValue(Y)}S=this._getYAxisLabelAlignment(o).textAlign}n==="y"&&(u==="start"?N="top":u==="end"&&(N="bottom"));const W=this._getLabelSizes();for(y=0,v=a.length;y<v;++y){_=a[y],b=_.label;const H=s.setContext(this.getContext(y));C=this.getPixelForTick(y)+s.labelOffset,T=this._resolveTickFontOptions(y),M=T.lineHeight,B=rt(b)?b.length:1;const Y=B/2,ee=H.color,I=H.textStrokeColor,z=H.textStrokeWidth;let X=S;l?(x=C,S==="inner"&&(y===v-1?X=this.options.reverse?"left":"right":y===0?X=this.options.reverse?"right":"left":X="center"),r==="top"?f==="near"||h!==0?F=-B*M+M/2:f==="center"?F=-W.highest.height/2-Y*M+M:F=-W.highest.height+M/2:f==="near"||h!==0?F=M/2:f==="center"?F=W.highest.height/2-Y*M:F=W.highest.height-B*M,m&&(F*=-1),h!==0&&!H.showLabelBackdrop&&(x+=M/2*Math.sin(h))):(w=C,F=(1-B)*M/2);let K;if(H.showLabelBackdrop){const be=sn(H.backdropPadding),Ke=W.heights[y],ue=W.widths[y];let fe=F-be.top,ke=0-be.left;switch(N){case"middle":fe-=Ke/2;break;case"bottom":fe-=Ke;break}switch(S){case"center":ke-=ue/2;break;case"right":ke-=ue;break}K={left:ke,top:fe,width:ue+be.width,height:Ke+be.height,color:H.backdropColor}}g.push({label:b,font:T,textOffset:F,options:{rotation:h,color:ee,strokeColor:I,strokeWidth:z,textAlign:X,textBaseline:N,translation:[x,w],backdrop:K}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-gi(this.labelRotation))return e==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,l=this._getLabelSizes(),a=e+s,u=l.widest.width;let f,p;return n==="left"?r?(p=this.right+s,i==="near"?f="left":i==="center"?(f="center",p+=u/2):(f="right",p+=u)):(p=this.right-a,i==="near"?f="right":i==="center"?(f="center",p-=u/2):(f="left",p=this.left)):n==="right"?r?(p=this.left+s,i==="near"?f="right":i==="center"?(f="center",p-=u/2):(f="left",p-=u)):(p=this.left+a,i==="near"?f="left":i==="center"?(f="center",p+=u/2):(f="right",p=this.right)):f="right",{textAlign:f,x:p}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:i,top:r,width:s,height:l}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(i,r,s,l),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(s=>s.value===e);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(e){const n=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,l;const a=(u,f,p)=>{!p.width||!p.color||(i.save(),i.lineWidth=p.width,i.strokeStyle=p.color,i.setLineDash(p.borderDash||[]),i.lineDashOffset=p.borderDashOffset,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(f.x,f.y),i.stroke(),i.restore())};if(n.display)for(s=0,l=r.length;s<l;++s){const u=r[s];n.drawOnChartArea&&a({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),n.drawTicks&&a({x:u.tx1,y:u.ty1},{x:u.tx2,y:u.ty2},{color:u.tickColor,width:u.tickWidth,borderDash:u.tickBorderDash,borderDashOffset:u.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:i,grid:r}}=this,s=i.setContext(this.getContext()),l=i.display?s.width:0;if(!l)return;const a=r.setContext(this.getContext(0)).lineWidth,u=this._borderValue;let f,p,m,o;this.isHorizontal()?(f=us(e,this.left,l)-l/2,p=us(e,this.right,a)+a/2,m=o=u):(m=us(e,this.top,l)-l/2,o=us(e,this.bottom,a)+a/2,f=p=u),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(f,m),n.lineTo(p,o),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&rf(i,r);const s=this.getLabelItems(e);for(const l of s){const a=l.options,u=l.font,f=l.label,p=l.textOffset;Ms(i,f,0,p,u,a)}r&&sf(i)}drawTitle(){const{ctx:e,options:{position:n,title:i,reverse:r}}=this;if(!i.display)return;const s=It(i.font),l=sn(i.padding),a=i.align;let u=s.lineHeight/2;n==="bottom"||n==="center"||Ie(n)?(u+=l.bottom,rt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=l.top;const{titleX:f,titleY:p,maxWidth:m,rotation:o}=gO(this,u,n,a);Ms(e,i.text,0,0,s,{color:i.color,maxWidth:m,rotation:o,textAlign:pO(a,n,r),textBaseline:"middle",translation:[f,p]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,i=Pe(e.grid&&e.grid.z,-1),r=Pe(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Bs.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,l;for(s=0,l=n.length;s<l;++s){const a=n[s];a[i]===this.id&&(!e||a.type===e)&&r.push(a)}return r}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return It(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class bc{constructor(e,n,i){this.type=e,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let i;yO(n)&&(i=this.register(n));const r=this.items,s=e.id,l=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in r||(r[s]=e,mO(e,l,i),this.override&&wt.override(e.id,e.overrides)),l}get(e){return this.items[e]}unregister(e){const n=this.items,i=e.id,r=this.scope;i in n&&delete n[i],r&&i in wt[r]&&(delete wt[r][i],this.override&&delete Ls[i])}}function mO(t,e,n){const i=gl(Object.create(null),[n?wt.get(n):{},wt.get(e),t.defaults]);wt.set(e,i),t.defaultRoutes&&vO(e,t.defaultRoutes),t.descriptors&&wt.describe(e,t.descriptors)}function vO(t,e){Object.keys(e).forEach(n=>{const i=n.split("."),r=i.pop(),s=[t].concat(i).join("."),l=e[n].split("."),a=l.pop(),u=l.join(".");wt.route(s,r,u,a)})}function yO(t){return"id"in t&&"defaults"in t}class _O{constructor(){this.controllers=new bc(ts,"datasets",!0),this.elements=new bc(pr,"elements"),this.plugins=new bc(Object,"plugins"),this.scales=new bc(Bs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,i){[...n].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(e,s,r):Qe(r,l=>{const a=i||this._getRegistryForType(l);this._exec(e,a,l)})})}_exec(e,n,i){const r=Pm(e);et(i["before"+r],[],i),n[e](i),et(i["after"+r],[],i)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(e))return i}return this.plugins}_get(e,n,i){const r=n.get(e);if(r===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return r}}var Ci=new _O;class bO{constructor(){this._init=[]}notify(e,n,i,r){n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const s=r?this._descriptors(e).filter(r):this._descriptors(e),l=this._notify(s,e,n,i);return n==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall")),l}_notify(e,n,i,r){r=r||{};for(const s of e){const l=s.plugin,a=l[i],u=[n,r,s.options];if(et(a,u,l)===!1&&r.cancelable)return!1}return!0}invalidate(){ze(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const i=e&&e.config,r=Pe(i.options&&i.options.plugins,{}),s=xO(i);return r===!1&&!n?[]:SO(e,s,r,n)}_notifyStateChanges(e){const n=this._oldCache||[],i=this._cache,r=(s,l)=>s.filter(a=>!l.some(u=>a.plugin.id===u.plugin.id));this._notify(r(n,i),e,"stop"),this._notify(r(i,n),e,"start")}}function xO(t){const e={},n=[],i=Object.keys(Ci.plugins.items);for(let s=0;s<i.length;s++)n.push(Ci.getPlugin(i[s]));const r=t.plugins||[];for(let s=0;s<r.length;s++){const l=r[s];n.indexOf(l)===-1&&(n.push(l),e[l.id]=!0)}return{plugins:n,localIds:e}}function wO(t,e){return!e&&t===!1?null:t===!0?{}:t}function SO(t,{plugins:e,localIds:n},i,r){const s=[],l=t.getContext();for(const a of e){const u=a.id,f=wO(i[u],r);f!==null&&s.push({plugin:a,options:kO(t.config,{plugin:a,local:n[u]},f,l)})}return s}function kO(t,{plugin:e,local:n},i,r){const s=t.pluginScopeKeys(e),l=t.getOptionScopes(i,s);return n&&e.defaults&&l.push(e.defaults),t.createResolver(l,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function dp(t,e){const n=wt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function EO(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function CO(t,e){return t===e?"_index_":"_value_"}function y0(t){if(t==="x"||t==="y"||t==="r")return t}function TO(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function fp(t,...e){if(y0(t))return t;for(const n of e){const i=n.axis||TO(n.position)||t.length>1&&y0(t[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function _0(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function PO(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(i=>i.xAxisID===t||i.yAxisID===t);if(n.length)return _0(t,"x",n[0])||_0(t,"y",n[0])}return{}}function AO(t,e){const n=Ls[t.type]||{scales:{}},i=e.scales||{},r=dp(t.type,e),s=Object.create(null);return Object.keys(i).forEach(l=>{const a=i[l];if(!Ie(a))return console.error(`Invalid scale configuration for scale: ${l}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${l}`);const u=fp(l,a,PO(l,t),wt.scales[a.type]),f=CO(u,r),p=n.scales||{};s[l]=Ba(Object.create(null),[{axis:u},a,p[u],p[f]])}),t.data.datasets.forEach(l=>{const a=l.type||t.type,u=l.indexAxis||dp(a,e),p=(Ls[a]||{}).scales||{};Object.keys(p).forEach(m=>{const o=EO(m,u),c=l[o+"AxisID"]||o;s[c]=s[c]||Object.create(null),Ba(s[c],[{axis:o},i[c],p[m]])})}),Object.keys(s).forEach(l=>{const a=s[l];Ba(a,[wt.scales[a.type],wt.scale])}),s}function C1(t){const e=t.options||(t.options={});e.plugins=Pe(e.plugins,{}),e.scales=AO(t,e)}function T1(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function OO(t){return t=t||{},t.data=T1(t.data),C1(t),t}const b0=new Map,P1=new Set;function xc(t,e){let n=b0.get(t);return n||(n=e(),b0.set(t,n),P1.add(n)),n}const ca=(t,e,n)=>{const i=Qr(e,n);i!==void 0&&t.add(i)};class LO{constructor(e){this._config=OO(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=T1(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),C1(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return xc(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return xc(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return xc(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,i=this.type;return xc(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const i=this._scopeCache;let r=i.get(e);return(!r||n)&&(r=new Map,i.set(e,r)),r}getOptionScopes(e,n,i){const{options:r,type:s}=this,l=this._cachedScopes(e,i),a=l.get(n);if(a)return a;const u=new Set;n.forEach(p=>{e&&(u.add(e),p.forEach(m=>ca(u,e,m))),p.forEach(m=>ca(u,r,m)),p.forEach(m=>ca(u,Ls[s]||{},m)),p.forEach(m=>ca(u,wt,m)),p.forEach(m=>ca(u,cp,m))});const f=Array.from(u);return f.length===0&&f.push(Object.create(null)),P1.has(n)&&l.set(n,f),f}chartOptionScopes(){const{options:e,type:n}=this;return[e,Ls[n]||{},wt.datasets[n]||{},{type:n},wt,cp]}resolveNamedOptions(e,n,i,r=[""]){const s={$shared:!0},{resolver:l,subPrefixes:a}=x0(this._resolverCache,e,r);let u=l;if(DO(l,n)){s.$shared=!1,i=Zr(i)?i():i;const f=this.createResolver(e,i,a);u=Lo(l,i,f)}for(const f of n)s[f]=u[f];return s}createResolver(e,n,i=[""],r){const{resolver:s}=x0(this._resolverCache,e,i);return Ie(n)?Lo(s,n,void 0,r):s}}function x0(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const r=n.join();let s=i.get(r);return s||(s={resolver:Rm(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(r,s)),s}const MO=t=>Ie(t)&&Object.getOwnPropertyNames(t).reduce((e,n)=>e||Zr(t[n]),!1);function DO(t,e){const{isScriptable:n,isIndexable:i}=r1(t);for(const r of e){const s=n(r),l=i(r),a=(l||s)&&t[r];if(s&&(Zr(a)||MO(a))||l&&rt(a))return!0}return!1}var RO="4.4.0";const IO=["top","bottom","left","right","chartArea"];function w0(t,e){return t==="top"||t==="bottom"||IO.indexOf(t)===-1&&e==="x"}function S0(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function k0(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),et(n&&n.onComplete,[t],e)}function UO(t){const e=t.chart,n=e.options.animation;et(n&&n.onProgress,[t],e)}function A1(t){return u1()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const tu={},E0=t=>{const e=A1(t);return Object.values(tu).filter(n=>n.canvas===e).pop()};function FO(t,e,n){const i=Object.keys(t);for(const r of i){const s=+r;if(s>=e){const l=t[r];delete t[r],(n>0||s>e)&&(t[s+n]=l)}}}function zO(t,e,n,i){return!n||t.type==="mouseout"?null:i?e:t}function wc(t,e,n){return t.options.clip?t[n]:e[n]}function NO(t,e){const{xScale:n,yScale:i}=t;return n&&i?{left:wc(n,e,"left"),right:wc(n,e,"right"),top:wc(i,e,"top"),bottom:wc(i,e,"bottom")}:e}let af=class{static defaults=wt;static instances=tu;static overrides=Ls;static registry=Ci;static version=RO;static getChart=E0;static register(...e){Ci.add(...e),C0()}static unregister(...e){Ci.remove(...e),C0()}constructor(e,n){const i=this.config=new LO(n),r=A1(e),s=E0(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 l=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||nO(r)),this.platform.updateConfig(i);const a=this.platform.acquireContext(r,l.aspectRatio),u=a&&a.canvas,f=u&&u.height,p=u&&u.width;if(this.id=UT(),this.ctx=a,this.canvas=u,this.width=p,this.height=f,this._options=l,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 bO,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=qT(m=>this.update(m),l.resizeDelay||0),this._dataChanges=[],tu[this.id]=this,!a||!u){console.error("Failed to create chart: can't acquire context from the given item");return}Gi.listen(this,"complete",k0),Gi.listen(this,"progress",UO),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return ze(e)?n&&s?s:r?i/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Ci}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Yy(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Hy(this.canvas,this.ctx),this}stop(){return Gi.stop(this),this}resize(e,n){Gi.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,l=this.platform.getMaximumSize(r,e,n,s),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=l.width,this.height=l.height,this._aspectRatio=this.aspectRatio,Yy(this,a,!0)&&(this.notifyPlugins("resize",{size:l}),et(i.onResize,[this,l],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Qe(n,(i,r)=>{i.id=r})}buildOrUpdateScales(){const e=this.options,n=e.scales,i=this.scales,r=Object.keys(i).reduce((l,a)=>(l[a]=!1,l),{});let s=[];n&&(s=s.concat(Object.keys(n).map(l=>{const a=n[l],u=fp(l,a),f=u==="r",p=u==="x";return{options:a,dposition:f?"chartArea":p?"bottom":"left",dtype:f?"radialLinear":p?"category":"linear"}}))),Qe(s,l=>{const a=l.options,u=a.id,f=fp(u,a),p=Pe(a.type,l.dtype);(a.position===void 0||w0(a.position,f)!==w0(l.dposition))&&(a.position=l.dposition),r[u]=!0;let m=null;if(u in i&&i[u].type===p)m=i[u];else{const o=Ci.getScale(p);m=new o({id:u,type:p,ctx:this.ctx,chart:this}),i[m.id]=m}m.init(a,e)}),Qe(r,(l,a)=>{l||delete i[a]}),Qe(i,l=>{rn.configure(this,l,l.options),rn.addBox(this,l)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,i=e.length;if(e.sort((r,s)=>r.index-s.index),i>n){for(let r=n;r<i;++r)this._destroyDatasetMeta(r);e.splice(n,i-n)}this._sortedMetasets=e.slice(0).sort(S0("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((i,r)=>{n.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=n.length;i<r;i++){const s=n[i];let l=this.getDatasetMeta(i);const a=s.type||this.config.type;if(l.type&&l.type!==a&&(this._destroyDatasetMeta(i),l=this.getDatasetMeta(i)),l.type=a,l.indexAxis=s.indexAxis||dp(a,this.options),l.order=s.order||0,l.index=i,l.label=""+s.label,l.visible=this.isDatasetVisible(i),l.controller)l.controller.updateIndex(i),l.controller.linkScales();else{const u=Ci.getController(a),{datasetElementType:f,dataElementType:p}=wt.datasets[a];Object.assign(u,{dataElementType:Ci.getElement(p),datasetElementType:f&&Ci.getElement(f)}),l.controller=new u(this,i),e.push(l.controller)}}return this._updateMetasets(),e}_resetElements(){Qe(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let l=0;for(let f=0,p=this.data.datasets.length;f<p;f++){const{controller:m}=this.getDatasetMeta(f),o=!r&&s.indexOf(m)===-1;m.buildOrUpdateElements(o),l=Math.max(+m.getMaxOverflow(),l)}l=this._minPadding=i.layout.autoPadding?l:0,this._updateLayout(l),r||Qe(s,f=>{f.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(S0("z","_idx"));const{_active:a,_lastEvent:u}=this;u?this._eventHandler(u,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Qe(this.scales,e=>{rn.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!Iy(n,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of n){const l=i==="_removeElements"?-s:s;FO(e,r,l)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=s=>new Set(e.filter(l=>l[0]===s).map((l,a)=>a+","+l.splice(1).join(","))),r=i(0);for(let s=1;s<n;s++)if(!Iy(r,i(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;rn.update(this,this.width,this.height,e);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Qe(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(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,Zr(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const i=this.getDatasetMeta(e),r={meta:i,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(n),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Gi.has(this)?this.attached&&!Gi.running(this)&&Gi.start(this):(this.draw(),k0({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resize(i,r),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,i=[];let r,s;for(r=0,s=n.length;r<s;++r){const l=n[r];(!e||l.visible)&&i.push(l)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,i=e._clip,r=!i.disabled,s=NO(e,this.chartArea),l={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",l)!==!1&&(r&&rf(n,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),e.controller.draw(),r&&sf(n),l.cancelable=!1,this.notifyPlugins("afterDatasetDraw",l))}isPointInArea(e){return nr(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,i,r){const s=IA.modes[n];return typeof s=="function"?s(this,e,i,r):[]}getDatasetMeta(e){const n=this.data.datasets[e],i=this._metasets;let r=i.filter(s=>s&&s._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=es(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(e,n){const i=this.getDatasetMeta(e);i.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,i){const r=i?"show":"hide",s=this.getDatasetMeta(e),l=s.controller._resolveAnimations(void 0,r);ml(n)?(s.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),l.update(s,{visible:i}),this.update(a=>a.datasetIndex===e?r:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Gi.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Hy(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete tu[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,i=(s,l)=>{n.addEventListener(this,s,l),e[s]=l},r=(s,l,a)=>{s.offsetX=l,s.offsetY=a,this._eventHandler(s)};Qe(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,i=(u,f)=>{n.addEventListener(this,u,f),e[u]=f},r=(u,f)=>{e[u]&&(n.removeEventListener(this,u,f),delete e[u])},s=(u,f)=>{this.canvas&&this.resize(u,f)};let l;const a=()=>{r("attach",a),this.attached=!0,this.resize(),i("resize",s),i("detach",l)};l=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():l()}unbindEvents(){Qe(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},Qe(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,i){const r=i?"set":"remove";let s,l,a,u;for(n==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),a=0,u=e.length;a<u;++a){l=e[a];const f=l&&this.getDatasetMeta(l.datasetIndex).controller;f&&f[r+"HoverStyle"](l.element,l.datasetIndex,l.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],i=e.map(({datasetIndex:s,index:l})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[l],index:l}});!Mu(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(e,n,i){return this._plugins.notify(this,e,n,i)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,i){const r=this.options.hover,s=(u,f)=>u.filter(p=>!f.some(m=>p.datasetIndex===m.datasetIndex&&p.index===m.index)),l=s(n,e),a=i?e:s(e,n);l.length&&this.updateHoverStyle(l,r.mode,!1),a.length&&r.mode&&this.updateHoverStyle(a,r.mode,!0)}_eventHandler(e,n){const i={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},r=l=>(l.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(e,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(e,n,i){const{_active:r=[],options:s}=this,l=n,a=this._getActiveElements(e,r,i,l),u=$T(e),f=zO(e,this._lastEvent,i,u);i&&(this._lastEvent=null,et(s.onHover,[e,a,this],this),u&&et(s.onClick,[e,a,this],this));const p=!Mu(a,r);return(p||n)&&(this._active=a,this._updateHoverStyles(a,r,n)),this._lastEvent=f,p}_getActiveElements(e,n,i,r){if(e.type==="mouseout")return[];if(!i)return n;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,r)}};function C0(){return Qe(af.instances,t=>t._plugins.invalidate())}function BO(t,e,n){const{startAngle:i,pixelMargin:r,x:s,y:l,outerRadius:a,innerRadius:u}=e;let f=r/a;t.beginPath(),t.arc(s,l,a,i-f,n+f),u>r?(f=r/u,t.arc(s,l,u,n+f,i-f,!0)):t.arc(s,l,r,n+Pt,i-Pt),t.closePath(),t.clip()}function jO(t){return Dm(t,["outerStart","outerEnd","innerStart","innerEnd"])}function $O(t,e,n,i){const r=jO(t.options.borderRadius),s=(n-e)/2,l=Math.min(s,i*e/2),a=u=>{const f=(n-Math.min(s,u))*i/2;return Nt(u,0,Math.min(s,f))};return{outerStart:a(r.outerStart),outerEnd:a(r.outerEnd),innerStart:Nt(r.innerStart,0,l),innerEnd:Nt(r.innerEnd,0,l)}}function Ws(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function zu(t,e,n,i,r,s){const{x:l,y:a,startAngle:u,pixelMargin:f,innerRadius:p}=e,m=Math.max(e.outerRadius+i+n-f,0),o=p>0?p+i+n+f:0;let c=0;const d=r-u;if(i){const H=p>0?p-i:0,Y=m>0?m-i:0,ee=(H+Y)/2,I=ee!==0?d*ee/(ee+i):d;c=(d-I)/2}const h=Math.max(.001,d*m-n/at)/m,g=(d-h)/2,y=u+g+c,v=r-g-c,{outerStart:_,outerEnd:b,innerStart:x,innerEnd:w}=$O(e,o,m,v-y),S=m-_,C=m-b,T=y+_/S,M=v-b/C,B=o+x,F=o+w,N=y+x/B,W=v-w/F;if(t.beginPath(),s){const H=(T+M)/2;if(t.arc(l,a,m,T,H),t.arc(l,a,m,H,M),b>0){const z=Ws(C,M,l,a);t.arc(z.x,z.y,b,M,v+Pt)}const Y=Ws(F,v,l,a);if(t.lineTo(Y.x,Y.y),w>0){const z=Ws(F,W,l,a);t.arc(z.x,z.y,w,v+Pt,W+Math.PI)}const ee=(v-w/o+(y+x/o))/2;if(t.arc(l,a,o,v-w/o,ee,!0),t.arc(l,a,o,ee,y+x/o,!0),x>0){const z=Ws(B,N,l,a);t.arc(z.x,z.y,x,N+Math.PI,y-Pt)}const I=Ws(S,y,l,a);if(t.lineTo(I.x,I.y),_>0){const z=Ws(S,T,l,a);t.arc(z.x,z.y,_,y-Pt,T)}}else{t.moveTo(l,a);const H=Math.cos(T)*m+l,Y=Math.sin(T)*m+a;t.lineTo(H,Y);const ee=Math.cos(M)*m+l,I=Math.sin(M)*m+a;t.lineTo(ee,I)}t.closePath()}function VO(t,e,n,i,r){const{fullCircles:s,startAngle:l,circumference:a}=e;let u=e.endAngle;if(s){zu(t,e,n,i,u,r);for(let f=0;f<s;++f)t.fill();isNaN(a)||(u=l+(a%st||st))}return zu(t,e,n,i,u,r),t.fill(),u}function HO(t,e,n,i,r){const{fullCircles:s,startAngle:l,circumference:a,options:u}=e,{borderWidth:f,borderJoinStyle:p,borderDash:m,borderDashOffset:o}=u,c=u.borderAlign==="inner";if(!f)return;t.setLineDash(m||[]),t.lineDashOffset=o,c?(t.lineWidth=f*2,t.lineJoin=p||"round"):(t.lineWidth=f,t.lineJoin=p||"bevel");let d=e.endAngle;if(s){zu(t,e,n,i,d,r);for(let h=0;h<s;++h)t.stroke();isNaN(a)||(d=l+(a%st||st))}c&&BO(t,e,d),s||(zu(t,e,n,i,d,r),t.stroke())}class WO extends pr{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),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,n,i){const r=this.getProps(["x","y"],i),{angle:s,distance:l}=Kw(r,{x:e,y:n}),{startAngle:a,endAngle:u,innerRadius:f,outerRadius:p,circumference:m}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),o=(this.options.spacing+this.options.borderWidth)/2,d=Pe(m,u-a)>=st||vl(s,a,u),h=er(l,f+o,p+o);return d&&h}getCenterPoint(e){const{x:n,y:i,startAngle:r,endAngle:s,innerRadius:l,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:u,spacing:f}=this.options,p=(r+s)/2,m=(l+a+f+u)/2;return{x:n+Math.cos(p)*m,y:i+Math.sin(p)*m}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:i}=this,r=(n.offset||0)/4,s=(n.spacing||0)/2,l=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>st?Math.floor(i/st):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*r,Math.sin(a)*r);const u=1-Math.sin(Math.min(at,i||0)),f=r*u;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,VO(e,this,f,s,l),HO(e,this,f,s,l),e.restore()}}function O1(t,e,n=e){t.lineCap=Pe(n.borderCapStyle,e.borderCapStyle),t.setLineDash(Pe(n.borderDash,e.borderDash)),t.lineDashOffset=Pe(n.borderDashOffset,e.borderDashOffset),t.lineJoin=Pe(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Pe(n.borderWidth,e.borderWidth),t.strokeStyle=Pe(n.borderColor,e.borderColor)}function GO(t,e,n){t.lineTo(n.x,n.y)}function YO(t){return t.stepped?uP:t.tension||t.cubicInterpolationMode==="monotone"?dP:GO}function L1(t,e,n={}){const i=t.length,{start:r=0,end:s=i-1}=n,{start:l,end:a}=e,u=Math.max(r,l),f=Math.min(s,a),p=r<l&&s<l||r>a&&s>a;return{count:i,start:u,loop:e.loop,ilen:f<u&&!p?i+f-u:f-u}}function KO(t,e,n,i){const{points:r,options:s}=e,{count:l,start:a,loop:u,ilen:f}=L1(r,n,i),p=YO(s);let{move:m=!0,reverse:o}=i||{},c,d,h;for(c=0;c<=f;++c)d=r[(a+(o?f-c:c))%l],!d.skip&&(m?(t.moveTo(d.x,d.y),m=!1):p(t,h,d,o,s.stepped),h=d);return u&&(d=r[(a+(o?f:0))%l],p(t,h,d,o,s.stepped)),!!u}function QO(t,e,n,i){const r=e.points,{count:s,start:l,ilen:a}=L1(r,n,i),{move:u=!0,reverse:f}=i||{};let p=0,m=0,o,c,d,h,g,y;const v=b=>(l+(f?a-b:b))%s,_=()=>{h!==g&&(t.lineTo(p,g),t.lineTo(p,h),t.lineTo(p,y))};for(u&&(c=r[v(0)],t.moveTo(c.x,c.y)),o=0;o<=a;++o){if(c=r[v(o)],c.skip)continue;const b=c.x,x=c.y,w=b|0;w===d?(x<h?h=x:x>g&&(g=x),p=(m*p+b)/++m):(_(),t.lineTo(b,x),d=w,m=0,h=g=x),y=x}_()}function hp(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?QO:KO}function ZO(t){return t.stepped?VP:t.tension||t.cubicInterpolationMode==="monotone"?HP:ms}function XO(t,e,n,i){let r=e._path;r||(r=e._path=new Path2D,e.path(r,n,i)&&r.closePath()),O1(t,e.options),t.stroke(r)}function qO(t,e,n,i){const{segments:r,options:s}=e,l=hp(e);for(const a of r)O1(t,s,a.style),t.beginPath(),l(t,e,a,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}const JO=typeof Path2D=="function";function eL(t,e,n,i){JO&&!e.options.segment?XO(t,e,n,i):qO(t,e,n,i)}class lf extends pr{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;IP(this._points,i,e,r,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=ZP(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,i=e.length;return i&&n[e[i-1].end]}interpolate(e,n){const i=this.options,r=e[n],s=this.points,l=g1(this,{property:n,start:r,end:r});if(!l.length)return;const a=[],u=ZO(i);let f,p;for(f=0,p=l.length;f<p;++f){const{start:m,end:o}=l[f],c=s[m],d=s[o];if(c===d){a.push(c);continue}const h=Math.abs((r-c[n])/(d[n]-c[n])),g=u(c,d,h,i.stepped);g[n]=e[n],a.push(g)}return a.length===1?a[0]:a}pathSegment(e,n,i){return hp(this)(e,this,n,i)}path(e,n,i){const r=this.segments,s=hp(this);let l=this._loop;n=n||0,i=i||this.points.length-n;for(const a of r)l&=s(e,this,a,{start:n,end:n+i-1});return!!l}draw(e,n,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(e.save(),eL(e,this,i,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function T0(t,e,n,i){const r=t.options,{[n]:s}=t.getProps([n],i);return Math.abs(e-s)<r.radius+r.hitRadius}class tL extends pr{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,n,i){const r=this.options,{x:s,y:l}=this.getProps(["x","y"],i);return Math.pow(e-s,2)+Math.pow(n-l,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,n){return T0(this,e,"x",n)}inYRange(e,n){return T0(this,e,"y",n)}getCenterPoint(e){const{x:n,y:i}=this.getProps(["x","y"],e);return{x:n,y:i}}size(e){e=e||this.options||{};let n=e.radius||0;n=Math.max(n,n&&e.hoverRadius||0);const i=n&&e.borderWidth||0;return(n+i)*2}draw(e,n){const i=this.options;this.skip||i.radius<.1||!nr(this,n,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,up(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}function M1(t,e){const{x:n,y:i,base:r,width:s,height:l}=t.getProps(["x","y","base","width","height"],e);let a,u,f,p,m;return t.horizontal?(m=l/2,a=Math.min(n,r),u=Math.max(n,r),f=i-m,p=i+m):(m=s/2,a=n-m,u=n+m,f=Math.min(i,r),p=Math.max(i,r)),{left:a,top:f,right:u,bottom:p}}function Ir(t,e,n,i){return t?0:Nt(e,n,i)}function nL(t,e,n){const i=t.options.borderWidth,r=t.borderSkipped,s=i1(i);return{t:Ir(r.top,s.top,0,n),r:Ir(r.right,s.right,0,e),b:Ir(r.bottom,s.bottom,0,n),l:Ir(r.left,s.left,0,e)}}function iL(t,e,n){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,s=Cs(r),l=Math.min(e,n),a=t.borderSkipped,u=i||Ie(r);return{topLeft:Ir(!u||a.top||a.left,s.topLeft,0,l),topRight:Ir(!u||a.top||a.right,s.topRight,0,l),bottomLeft:Ir(!u||a.bottom||a.left,s.bottomLeft,0,l),bottomRight:Ir(!u||a.bottom||a.right,s.bottomRight,0,l)}}function rL(t){const e=M1(t),n=e.right-e.left,i=e.bottom-e.top,r=nL(t,n/2,i/2),s=iL(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i,radius:s},inner:{x:e.left+r.l,y:e.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function Kf(t,e,n,i){const r=e===null,s=n===null,a=t&&!(r&&s)&&M1(t,i);return a&&(r||er(e,a.left,a.right))&&(s||er(n,a.top,a.bottom))}function sL(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function oL(t,e){t.rect(e.x,e.y,e.w,e.h)}function Qf(t,e,n={}){const i=t.x!==n.x?-e:0,r=t.y!==n.y?-e:0,s=(t.x+t.w!==n.x+n.w?e:0)-i,l=(t.y+t.h!==n.y+n.h?e:0)-r;return{x:t.x+i,y:t.y+r,w:t.w+s,h:t.h+l,radius:t.radius}}class aL extends pr{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:l}=rL(this),a=sL(l.radius)?yl:oL;e.save(),(l.w!==s.w||l.h!==s.h)&&(e.beginPath(),a(e,Qf(l,n,s)),e.clip(),a(e,Qf(s,-n,l)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),a(e,Qf(s,n)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,n,i){return Kf(this,e,n,i)}inXRange(e,n){return Kf(this,e,null,n)}inYRange(e,n){return Kf(this,null,e,n)}getCenterPoint(e){const{x:n,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(n+r)/2:n,y:s?i:(i+r)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}var lL=Object.freeze({__proto__:null,ArcElement:WO,BarElement:aL,LineElement:lf,PointElement:tL});const pp=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],P0=pp.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function D1(t){return pp[t%pp.length]}function R1(t){return P0[t%P0.length]}function cL(t,e){return t.borderColor=D1(e),t.backgroundColor=R1(e),++e}function uL(t,e){return t.backgroundColor=t.data.map(()=>D1(e++)),e}function dL(t,e){return t.backgroundColor=t.data.map(()=>R1(e++)),e}function fL(t){let e=0;return(n,i)=>{const r=t.getDatasetMeta(i).controller;r instanceof zm?e=uL(n,e):r instanceof b1?e=dL(n,e):r&&(e=cL(n,e))}}function A0(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function hL(t){return t&&(t.borderColor||t.backgroundColor)}var pL={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,n){if(!n.enabled)return;const{data:{datasets:i},options:r}=t.config,{elements:s}=r;if(!n.forceOverride&&(A0(i)||hL(r)||s&&A0(s)))return;const l=fL(t);i.forEach(l)}};function gL(t,e,n,i,r){const s=r.samples||i;if(s>=n)return t.slice(e,e+n);const l=[],a=(n-2)/(s-2);let u=0;const f=e+n-1;let p=e,m,o,c,d,h;for(l[u++]=t[p],m=0;m<s-2;m++){let g=0,y=0,v;const _=Math.floor((m+1)*a)+1+e,b=Math.min(Math.floor((m+2)*a)+1,n)+e,x=b-_;for(v=_;v<b;v++)g+=t[v].x,y+=t[v].y;g/=x,y/=x;const w=Math.floor(m*a)+1+e,S=Math.min(Math.floor((m+1)*a)+1,n)+e,{x:C,y:T}=t[p];for(c=d=-1,v=w;v<S;v++)d=.5*Math.abs((C-g)*(t[v].y-T)-(C-t[v].x)*(y-T)),d>c&&(c=d,o=t[v],h=v);l[u++]=o,p=h}return l[u++]=t[f],l}function mL(t,e,n,i){let r=0,s=0,l,a,u,f,p,m,o,c,d,h;const g=[],y=e+n-1,v=t[e].x,b=t[y].x-v;for(l=e;l<e+n;++l){a=t[l],u=(a.x-v)/b*i,f=a.y;const x=u|0;if(x===p)f<d?(d=f,m=l):f>h&&(h=f,o=l),r=(s*r+a.x)/++s;else{const w=l-1;if(!ze(m)&&!ze(o)){const S=Math.min(m,o),C=Math.max(m,o);S!==c&&S!==w&&g.push({...t[S],x:r}),C!==c&&C!==w&&g.push({...t[C],x:r})}l>0&&w!==c&&g.push(t[w]),g.push(a),p=x,s=0,d=h=f,m=o=c=l}}return g}function I1(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function O0(t){t.data.datasets.forEach(e=>{I1(e)})}function vL(t,e){const n=e.length;let i=0,r;const{iScale:s}=t,{min:l,max:a,minDefined:u,maxDefined:f}=s.getUserBounds();return u&&(i=Nt(tr(e,s.axis,l).lo,0,n-1)),f?r=Nt(tr(e,s.axis,a).hi+1,i,n)-i:r=n-i,{start:i,count:r}}var yL={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled){O0(t);return}const i=t.width;t.data.datasets.forEach((r,s)=>{const{_data:l,indexAxis:a}=r,u=t.getDatasetMeta(s),f=l||r.data;if(Aa([a,t.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const p=t.scales[u.xAxisID];if(p.type!=="linear"&&p.type!=="time"||t.options.parsing)return;let{start:m,count:o}=vL(u,f);const c=n.threshold||4*i;if(o<=c){I1(r);return}ze(l)&&(r._data=f,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(h){this._data=h}}));let d;switch(n.algorithm){case"lttb":d=gL(f,m,o,i,n);break;case"min-max":d=mL(f,m,o,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}r._decimated=d})},destroy(t){O0(t)}};function _L(t,e,n){const i=t.segments,r=t.points,s=e.points,l=[];for(const a of i){let{start:u,end:f}=a;f=Bm(u,f,r);const p=gp(n,r[u],r[f],a.loop);if(!e.segments){l.push({source:a,target:p,start:r[u],end:r[f]});continue}const m=g1(e,p);for(const o of m){const c=gp(n,s[o.start],s[o.end],o.loop),d=p1(a,r,c);for(const h of d)l.push({source:h,target:o,start:{[n]:L0(p,c,"start",Math.max)},end:{[n]:L0(p,c,"end",Math.min)}})}}return l}function gp(t,e,n,i){if(i)return;let r=e[t],s=n[t];return t==="angle"&&(r=In(r),s=In(s)),{property:t,start:r,end:s}}function bL(t,e){const{x:n=null,y:i=null}=t||{},r=e.points,s=[];return e.segments.forEach(({start:l,end:a})=>{a=Bm(l,a,r);const u=r[l],f=r[a];i!==null?(s.push({x:u.x,y:i}),s.push({x:f.x,y:i})):n!==null&&(s.push({x:n,y:u.y}),s.push({x:n,y:f.y}))}),s}function Bm(t,e,n){for(;e>t;e--){const i=n[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function L0(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function U1(t,e){let n=[],i=!1;return rt(t)?(i=!0,n=t):n=bL(t,e),n.length?new lf({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function M0(t){return t&&t.fill!==!1}function xL(t,e,n){let r=t[e].fill;const s=[e];let l;if(!n)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!xt(r))return r;if(l=t[r],!l)return!1;if(l.visible)return r;s.push(r),r=l.fill}return!1}function wL(t,e,n){const i=CL(t);if(Ie(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return xt(r)&&Math.floor(r)===r?SL(i[0],e,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function SL(t,e,n,i){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=i?!1:n}function kL(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:Ie(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}function EL(t,e,n){let i;return t==="start"?i=n:t==="end"?i=e.options.reverse?e.min:e.max:Ie(t)?i=t.value:i=e.getBaseValue(),i}function CL(t){const e=t.options,n=e.fill;let i=Pe(n&&n.target,n);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function TL(t){const{scale:e,index:n,line:i}=t,r=[],s=i.segments,l=i.points,a=PL(e,n);a.push(U1({x:null,y:e.bottom},i));for(let u=0;u<s.length;u++){const f=s[u];for(let p=f.start;p<=f.end;p++)AL(r,l[p],a)}return new lf({points:r,options:{}})}function PL(t,e){const n=[],i=t.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===e)break;s.hidden||n.unshift(s.dataset)}return n}function AL(t,e,n){const i=[];for(let r=0;r<n.length;r++){const s=n[r],{first:l,last:a,point:u}=OL(s,e,"x");if(!(!u||l&&a)){if(l)i.unshift(u);else if(t.push(u),!a)break}}t.push(...i)}function OL(t,e,n){const i=t.interpolate(e,n);if(!i)return{};const r=i[n],s=t.segments,l=t.points;let a=!1,u=!1;for(let f=0;f<s.length;f++){const p=s[f],m=l[p.start][n],o=l[p.end][n];if(er(r,m,o)){a=r===m,u=r===o;break}}return{first:a,last:u,point:i}}class F1{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,i){const{x:r,y:s,radius:l}=this;return n=n||{start:0,end:st},e.arc(r,s,l,n.end,n.start,!0),!i.bounds}interpolate(e){const{x:n,y:i,radius:r}=this,s=e.angle;return{x:n+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function LL(t){const{chart:e,fill:n,line:i}=t;if(xt(n))return ML(e,n);if(n==="stack")return TL(t);if(n==="shape")return!0;const r=DL(t);return r instanceof F1?r:U1(r,i)}function ML(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function DL(t){return(t.scale||{}).getPointPositionForValue?IL(t):RL(t)}function RL(t){const{scale:e={},fill:n}=t,i=kL(n,e);if(xt(i)){const r=e.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function IL(t){const{scale:e,fill:n}=t,i=e.options,r=e.getLabels().length,s=i.reverse?e.max:e.min,l=EL(n,e,s),a=[];if(i.grid.circular){const u=e.getPointPositionForValue(0,s);return new F1({x:u.x,y:u.y,radius:e.getDistanceFromCenterForValue(l)})}for(let u=0;u<r;++u)a.push(e.getPointPositionForValue(u,l));return a}function Zf(t,e,n){const i=LL(e),{line:r,scale:s,axis:l}=e,a=r.options,u=a.fill,f=a.backgroundColor,{above:p=f,below:m=f}=u||{};i&&r.points.length&&(rf(t,n),UL(t,{line:r,target:i,above:p,below:m,area:n,scale:s,axis:l}),sf(t))}function UL(t,e){const{line:n,target:i,above:r,below:s,area:l,scale:a}=e,u=n._loop?"angle":e.axis;t.save(),u==="x"&&s!==r&&(D0(t,i,l.top),R0(t,{line:n,target:i,color:r,scale:a,property:u}),t.restore(),t.save(),D0(t,i,l.bottom)),R0(t,{line:n,target:i,color:s,scale:a,property:u}),t.restore()}function D0(t,e,n){const{segments:i,points:r}=e;let s=!0,l=!1;t.beginPath();for(const a of i){const{start:u,end:f}=a,p=r[u],m=r[Bm(u,f,r)];s?(t.moveTo(p.x,p.y),s=!1):(t.lineTo(p.x,n),t.lineTo(p.x,p.y)),l=!!e.pathSegment(t,a,{move:l}),l?t.closePath():t.lineTo(m.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function R0(t,e){const{line:n,target:i,property:r,color:s,scale:l}=e,a=_L(n,i,r);for(const{source:u,target:f,start:p,end:m}of a){const{style:{backgroundColor:o=s}={}}=u,c=i!==!0;t.save(),t.fillStyle=o,FL(t,l,c&&gp(r,p,m)),t.beginPath();const d=!!n.pathSegment(t,u);let h;if(c){d?t.closePath():I0(t,i,m,r);const g=!!i.pathSegment(t,f,{move:d,reverse:!0});h=d&&g,h||I0(t,i,p,r)}t.closePath(),t.fill(h?"evenodd":"nonzero"),t.restore()}}function FL(t,e,n){const{top:i,bottom:r}=e.chart.chartArea,{property:s,start:l,end:a}=n||{};s==="x"&&(t.beginPath(),t.rect(l,i,a-l,r-i),t.clip())}function I0(t,e,n,i){const r=e.interpolate(n,i);r&&t.lineTo(r.x,r.y)}var zL={id:"filler",afterDatasetsUpdate(t,e,n){const i=(t.data.datasets||[]).length,r=[];let s,l,a,u;for(l=0;l<i;++l)s=t.getDatasetMeta(l),a=s.dataset,u=null,a&&a.options&&a instanceof lf&&(u={visible:t.isDatasetVisible(l),index:l,fill:wL(a,l,i),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=u,r.push(u);for(l=0;l<i;++l)u=r[l],!(!u||u.fill===!1)&&(u.fill=xL(r,l,n.propagate))},beforeDraw(t,e,n){const i=n.drawTime==="beforeDraw",r=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let l=r.length-1;l>=0;--l){const a=r[l].$filler;a&&(a.line.updateControlPoints(s,a.axis),i&&a.fill&&Zf(t.ctx,a,s))}},beforeDatasetsDraw(t,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=t.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;M0(s)&&Zf(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;!M0(i)||n.drawTime!=="beforeDatasetDraw"||Zf(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const U0=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=t.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}},NL=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class F0 extends pr{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n,i){this.maxWidth=e,this.maxHeight=n,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 e=this.options.labels||{};let n=et(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(i=>e.filter(i,this.chart.data))),e.sort&&(n=n.sort((i,r)=>e.sort(i,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const i=e.labels,r=It(i.font),s=r.size,l=this._computeTitleHeight(),{boxWidth:a,itemHeight:u}=U0(i,s);let f,p;n.font=r.string,this.isHorizontal()?(f=this.maxWidth,p=this._fitRows(l,s,a,u)+10):(p=this.maxHeight,f=this._fitCols(l,r,a,u)+10),this.width=Math.min(f,e.maxWidth||this.maxWidth),this.height=Math.min(p,e.maxHeight||this.maxHeight)}_fitRows(e,n,i,r){const{ctx:s,maxWidth:l,options:{labels:{padding:a}}}=this,u=this.legendHitBoxes=[],f=this.lineWidths=[0],p=r+a;let m=e;s.textAlign="left",s.textBaseline="middle";let o=-1,c=-p;return this.legendItems.forEach((d,h)=>{const g=i+n/2+s.measureText(d.text).width;(h===0||f[f.length-1]+g+2*a>l)&&(m+=p,f[f.length-(h>0?0:1)]=0,c+=p,o++),u[h]={left:0,top:c,row:o,width:g,height:r},f[f.length-1]+=g+a}),m}_fitCols(e,n,i,r){const{ctx:s,maxHeight:l,options:{labels:{padding:a}}}=this,u=this.legendHitBoxes=[],f=this.columnSizes=[],p=l-e;let m=a,o=0,c=0,d=0,h=0;return this.legendItems.forEach((g,y)=>{const{itemWidth:v,itemHeight:_}=BL(i,n,s,g,r);y>0&&c+_+2*a>p&&(m+=o+a,f.push({width:o,height:c}),d+=o+a,h++,o=c=0),u[y]={left:d,top:c,col:h,width:v,height:_},o=Math.max(o,v),c+=_+a}),m+=o,f.push({width:o,height:c}),m}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:r},rtl:s}}=this,l=yo(s,this.left,this.width);if(this.isHorizontal()){let a=0,u=tn(i,this.left+r,this.right-this.lineWidths[a]);for(const f of n)a!==f.row&&(a=f.row,u=tn(i,this.left+r,this.right-this.lineWidths[a])),f.top+=this.top+e+r,f.left=l.leftForLtr(l.x(u),f.width),u+=f.width+r}else{let a=0,u=tn(i,this.top+e+r,this.bottom-this.columnSizes[a].height);for(const f of n)f.col!==a&&(a=f.col,u=tn(i,this.top+e+r,this.bottom-this.columnSizes[a].height)),f.top=u,f.left+=this.left+r,f.left=l.leftForLtr(l.x(f.left),f.width),u+=f.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;rf(e,this),this._draw(),sf(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:i,ctx:r}=this,{align:s,labels:l}=e,a=wt.color,u=yo(e.rtl,this.left,this.width),f=It(l.font),{padding:p}=l,m=f.size,o=m/2;let c;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=f.string;const{boxWidth:d,boxHeight:h,itemHeight:g}=U0(l,m),y=function(w,S,C){if(isNaN(d)||d<=0||isNaN(h)||h<0)return;r.save();const T=Pe(C.lineWidth,1);if(r.fillStyle=Pe(C.fillStyle,a),r.lineCap=Pe(C.lineCap,"butt"),r.lineDashOffset=Pe(C.lineDashOffset,0),r.lineJoin=Pe(C.lineJoin,"miter"),r.lineWidth=T,r.strokeStyle=Pe(C.strokeStyle,a),r.setLineDash(Pe(C.lineDash,[])),l.usePointStyle){const M={radius:h*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:T},B=u.xPlus(w,d/2),F=S+o;n1(r,M,B,F,l.pointStyleWidth&&d)}else{const M=S+Math.max((m-h)/2,0),B=u.leftForLtr(w,d),F=Cs(C.borderRadius);r.beginPath(),Object.values(F).some(N=>N!==0)?yl(r,{x:B,y:M,w:d,h,radius:F}):r.rect(B,M,d,h),r.fill(),T!==0&&r.stroke()}r.restore()},v=function(w,S,C){Ms(r,C.text,w,S+g/2,f,{strikethrough:C.hidden,textAlign:u.textAlign(C.textAlign)})},_=this.isHorizontal(),b=this._computeTitleHeight();_?c={x:tn(s,this.left+p,this.right-i[0]),y:this.top+p+b,line:0}:c={x:this.left+p,y:tn(s,this.top+b+p,this.bottom-n[0].height),line:0},d1(this.ctx,e.textDirection);const x=g+p;this.legendItems.forEach((w,S)=>{r.strokeStyle=w.fontColor,r.fillStyle=w.fontColor;const C=r.measureText(w.text).width,T=u.textAlign(w.textAlign||(w.textAlign=l.textAlign)),M=d+o+C;let B=c.x,F=c.y;u.setWidth(this.width),_?S>0&&B+M+p>this.right&&(F=c.y+=x,c.line++,B=c.x=tn(s,this.left+p,this.right-i[c.line])):S>0&&F+x>this.bottom&&(B=c.x=B+n[c.line].width+p,c.line++,F=c.y=tn(s,this.top+b+p,this.bottom-n[c.line].height));const N=u.x(B);if(y(N,F,w),B=JT(T,B+d+o,_?B+M:this.right,e.rtl),v(u.x(B),F,w),_)c.x+=M+p;else if(typeof w.text!="string"){const W=f.lineHeight;c.y+=z1(w,W)+p}else c.y+=x}),f1(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,i=It(n.font),r=sn(n.padding);if(!n.display)return;const s=yo(e.rtl,this.left,this.width),l=this.ctx,a=n.position,u=i.size/2,f=r.top+u;let p,m=this.left,o=this.width;if(this.isHorizontal())o=Math.max(...this.lineWidths),p=this.top+f,m=tn(e.align,m,this.right-o);else{const d=this.columnSizes.reduce((h,g)=>Math.max(h,g.height),0);p=f+tn(e.align,this.top,this.bottom-d-e.labels.padding-this._computeTitleHeight())}const c=tn(a,m,m+o);l.textAlign=s.textAlign(Lm(a)),l.textBaseline="middle",l.strokeStyle=n.color,l.fillStyle=n.color,l.font=i.string,Ms(l,n.text,c,p,i)}_computeTitleHeight(){const e=this.options.title,n=It(e.font),i=sn(e.padding);return e.display?n.lineHeight+i.height:0}_getLegendItemAt(e,n){let i,r,s;if(er(e,this.left,this.right)&&er(n,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],er(e,r.left,r.left+r.width)&&er(n,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(e){const n=this.options;if(!VL(e.type,n))return;const i=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const r=this._hoveredItem,s=NL(r,i);r&&!s&&et(n.onLeave,[e,r,this],this),this._hoveredItem=i,i&&!s&&et(n.onHover,[e,i,this],this)}else i&&et(n.onClick,[e,i,this],this)}}function BL(t,e,n,i,r){const s=jL(i,t,e,n),l=$L(r,i,e.lineHeight);return{itemWidth:s,itemHeight:l}}function jL(t,e,n,i){let r=t.text;return r&&typeof r!="string"&&(r=r.reduce((s,l)=>s.length>l.length?s:l)),e+n.size/2+i.measureText(r).width}function $L(t,e,n){let i=t;return typeof e.text!="string"&&(i=z1(e,n)),i}function z1(t,e){const n=t.text?t.text.length:0;return e*n}function VL(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var HL={id:"legend",_element:F0,start(t,e,n){const i=t.legend=new F0({ctx:t.ctx,options:n,chart:t});rn.configure(t,i,n),rn.addBox(t,i)},stop(t){rn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;rn.configure(t,i,n),i.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const i=e.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),e.hidden=!0):(r.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:s,useBorderRadius:l,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(u=>{const f=u.controller.getStyle(n?0:void 0),p=sn(f.borderWidth);return{text:e[u.index].label,fillStyle:f.backgroundColor,fontColor:s,hidden:!u.visible,lineCap:f.borderCapStyle,lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:(p.width+p.height)/4,strokeStyle:f.borderColor,pointStyle:i||f.pointStyle,rotation:f.rotation,textAlign:r||f.textAlign,borderRadius:l&&(a||f.borderRadius),datasetIndex:u.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class jm extends pr{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n){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=e,this.height=this.bottom=n;const r=rt(i.text)?i.text.length:1;this._padding=sn(i.padding);const s=r*It(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:i,bottom:r,right:s,options:l}=this,a=l.align;let u=0,f,p,m;return this.isHorizontal()?(p=tn(a,i,s),m=n+e,f=s-i):(l.position==="left"?(p=i+e,m=tn(a,r,n),u=at*-.5):(p=s-e,m=tn(a,n,r),u=at*.5),f=r-n),{titleX:p,titleY:m,maxWidth:f,rotation:u}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const i=It(n.font),s=i.lineHeight/2+this._padding.top,{titleX:l,titleY:a,maxWidth:u,rotation:f}=this._drawArgs(s);Ms(e,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:f,textAlign:Lm(n.align),textBaseline:"middle",translation:[l,a]})}}function WL(t,e){const n=new jm({ctx:t.ctx,options:e,chart:t});rn.configure(t,n,e),rn.addBox(t,n),t.titleBlock=n}var GL={id:"title",_element:jm,start(t,e,n){WL(t,n)},stop(t){const e=t.titleBlock;rn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const i=t.titleBlock;rn.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Sc=new WeakMap;var YL={id:"subtitle",start(t,e,n){const i=new jm({ctx:t.ctx,options:n,chart:t});rn.configure(t,i,n),rn.addBox(t,i),Sc.set(t,i)},stop(t){rn.removeBox(t,Sc.get(t)),Sc.delete(t)},beforeUpdate(t,e,n){const i=Sc.get(t);rn.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const La={average(t){if(!t.length)return!1;let e,n,i=0,r=0,s=0;for(e=0,n=t.length;e<n;++e){const l=t[e].element;if(l&&l.hasValue()){const a=l.tooltipPosition();i+=a.x,r+=a.y,++s}}return{x:i/s,y:r/s}},nearest(t,e){if(!t.length)return!1;let n=e.x,i=e.y,r=Number.POSITIVE_INFINITY,s,l,a;for(s=0,l=t.length;s<l;++s){const u=t[s].element;if(u&&u.hasValue()){const f=u.getCenterPoint(),p=lp(e,f);p<r&&(r=p,a=u)}}if(a){const u=a.tooltipPosition();n=u.x,i=u.y}return{x:n,y:i}}};function Ei(t,e){return e&&(rt(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Yi(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
2
+ `)>-1?t.split(`
3
+ `):t}function KL(t,e){const{element:n,datasetIndex:i,index:r}=e,s=t.getDatasetMeta(i).controller,{label:l,value:a}=s.getLabelAndValue(r);return{chart:t,label:l,parsed:s.getParsed(r),raw:t.data.datasets[i].data[r],formattedValue:a,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function z0(t,e){const n=t.chart.ctx,{body:i,footer:r,title:s}=t,{boxWidth:l,boxHeight:a}=e,u=It(e.bodyFont),f=It(e.titleFont),p=It(e.footerFont),m=s.length,o=r.length,c=i.length,d=sn(e.padding);let h=d.height,g=0,y=i.reduce((b,x)=>b+x.before.length+x.lines.length+x.after.length,0);if(y+=t.beforeBody.length+t.afterBody.length,m&&(h+=m*f.lineHeight+(m-1)*e.titleSpacing+e.titleMarginBottom),y){const b=e.displayColors?Math.max(a,u.lineHeight):u.lineHeight;h+=c*b+(y-c)*u.lineHeight+(y-1)*e.bodySpacing}o&&(h+=e.footerMarginTop+o*p.lineHeight+(o-1)*e.footerSpacing);let v=0;const _=function(b){g=Math.max(g,n.measureText(b).width+v)};return n.save(),n.font=f.string,Qe(t.title,_),n.font=u.string,Qe(t.beforeBody.concat(t.afterBody),_),v=e.displayColors?l+2+e.boxPadding:0,Qe(i,b=>{Qe(b.before,_),Qe(b.lines,_),Qe(b.after,_)}),v=0,n.font=p.string,Qe(t.footer,_),n.restore(),g+=d.width,{width:g,height:h}}function QL(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}function ZL(t,e,n,i){const{x:r,width:s}=i,l=n.caretSize+n.caretPadding;if(t==="left"&&r+s+l>e.width||t==="right"&&r-s-l<0)return!0}function XL(t,e,n,i){const{x:r,width:s}=n,{width:l,chartArea:{left:a,right:u}}=t;let f="center";return i==="center"?f=r<=(a+u)/2?"left":"right":r<=s/2?f="left":r>=l-s/2&&(f="right"),ZL(f,t,e,n)&&(f="center"),f}function N0(t,e,n){const i=n.yAlign||e.yAlign||QL(t,n);return{xAlign:n.xAlign||e.xAlign||XL(t,e,n,i),yAlign:i}}function qL(t,e){let{x:n,width:i}=t;return e==="right"?n-=i:e==="center"&&(n-=i/2),n}function JL(t,e,n){let{y:i,height:r}=t;return e==="top"?i+=n:e==="bottom"?i-=r+n:i-=r/2,i}function B0(t,e,n,i){const{caretSize:r,caretPadding:s,cornerRadius:l}=t,{xAlign:a,yAlign:u}=n,f=r+s,{topLeft:p,topRight:m,bottomLeft:o,bottomRight:c}=Cs(l);let d=qL(e,a);const h=JL(e,u,f);return u==="center"?a==="left"?d+=f:a==="right"&&(d-=f):a==="left"?d-=Math.max(p,o)+r:a==="right"&&(d+=Math.max(m,c)+r),{x:Nt(d,0,i.width-e.width),y:Nt(h,0,i.height-e.height)}}function kc(t,e,n){const i=sn(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-i.right:t.x+i.left}function j0(t){return Ei([],Yi(t))}function eM(t,e,n){return es(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function $0(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const N1={beforeTitle:Hi,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:Hi,beforeBody:Hi,beforeLabel:Hi,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return ze(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Hi,afterBody:Hi,beforeFooter:Hi,footer:Hi,afterFooter:Hi};function pn(t,e,n,i){const r=t[e].call(n,i);return typeof r>"u"?N1[e].call(n,i):r}class V0 extends pr{static positioners=La;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&n.options.animation&&i.animations,s=new m1(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=eM(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:i}=n,r=pn(i,"beforeTitle",this,e),s=pn(i,"title",this,e),l=pn(i,"afterTitle",this,e);let a=[];return a=Ei(a,Yi(r)),a=Ei(a,Yi(s)),a=Ei(a,Yi(l)),a}getBeforeBody(e,n){return j0(pn(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:i}=n,r=[];return Qe(e,s=>{const l={before:[],lines:[],after:[]},a=$0(i,s);Ei(l.before,Yi(pn(a,"beforeLabel",this,s))),Ei(l.lines,pn(a,"label",this,s)),Ei(l.after,Yi(pn(a,"afterLabel",this,s))),r.push(l)}),r}getAfterBody(e,n){return j0(pn(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:i}=n,r=pn(i,"beforeFooter",this,e),s=pn(i,"footer",this,e),l=pn(i,"afterFooter",this,e);let a=[];return a=Ei(a,Yi(r)),a=Ei(a,Yi(s)),a=Ei(a,Yi(l)),a}_createItems(e){const n=this._active,i=this.chart.data,r=[],s=[],l=[];let a=[],u,f;for(u=0,f=n.length;u<f;++u)a.push(KL(this.chart,n[u]));return e.filter&&(a=a.filter((p,m,o)=>e.filter(p,m,o,i))),e.itemSort&&(a=a.sort((p,m)=>e.itemSort(p,m,i))),Qe(a,p=>{const m=$0(e.callbacks,p);r.push(pn(m,"labelColor",this,p)),s.push(pn(m,"labelPointStyle",this,p)),l.push(pn(m,"labelTextColor",this,p))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=l,this.dataPoints=a,a}update(e,n){const i=this.options.setContext(this.getContext()),r=this._active;let s,l=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const a=La[i.position].call(this,r,this._eventPosition);l=this._createItems(i),this.title=this.getTitle(l,i),this.beforeBody=this.getBeforeBody(l,i),this.body=this.getBody(l,i),this.afterBody=this.getAfterBody(l,i),this.footer=this.getFooter(l,i);const u=this._size=z0(this,i),f=Object.assign({},a,u),p=N0(this.chart,i,f),m=B0(i,f,p,this.chart);this.xAlign=p.xAlign,this.yAlign=p.yAlign,s={opacity:1,x:m.x,y:m.y,width:u.width,height:u.height,caretX:a.x,caretY:a.y}}this._tooltipItems=l,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,i,r){const s=this.getCaretPosition(e,i,r);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(e,n,i){const{xAlign:r,yAlign:s}=this,{caretSize:l,cornerRadius:a}=i,{topLeft:u,topRight:f,bottomLeft:p,bottomRight:m}=Cs(a),{x:o,y:c}=e,{width:d,height:h}=n;let g,y,v,_,b,x;return s==="center"?(b=c+h/2,r==="left"?(g=o,y=g-l,_=b+l,x=b-l):(g=o+d,y=g+l,_=b-l,x=b+l),v=g):(r==="left"?y=o+Math.max(u,p)+l:r==="right"?y=o+d-Math.max(f,m)-l:y=this.caretX,s==="top"?(_=c,b=_-l,g=y-l,v=y+l):(_=c+h,b=_+l,g=y+l,v=y-l),x=_),{x1:g,x2:y,x3:v,y1:_,y2:b,y3:x}}drawTitle(e,n,i){const r=this.title,s=r.length;let l,a,u;if(s){const f=yo(i.rtl,this.x,this.width);for(e.x=kc(this,i.titleAlign,i),n.textAlign=f.textAlign(i.titleAlign),n.textBaseline="middle",l=It(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=l.string,u=0;u<s;++u)n.fillText(r[u],f.x(e.x),e.y+l.lineHeight/2),e.y+=l.lineHeight+a,u+1===s&&(e.y+=i.titleMarginBottom-a)}}_drawColorBox(e,n,i,r,s){const l=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:u,boxWidth:f}=s,p=It(s.bodyFont),m=kc(this,"left",s),o=r.x(m),c=u<p.lineHeight?(p.lineHeight-u)/2:0,d=n.y+c;if(s.usePointStyle){const h={radius:Math.min(f,u)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},g=r.leftForLtr(o,f)+f/2,y=d+u/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,up(e,h,g,y),e.strokeStyle=l.borderColor,e.fillStyle=l.backgroundColor,up(e,h,g,y)}else{e.lineWidth=Ie(l.borderWidth)?Math.max(...Object.values(l.borderWidth)):l.borderWidth||1,e.strokeStyle=l.borderColor,e.setLineDash(l.borderDash||[]),e.lineDashOffset=l.borderDashOffset||0;const h=r.leftForLtr(o,f),g=r.leftForLtr(r.xPlus(o,1),f-2),y=Cs(l.borderRadius);Object.values(y).some(v=>v!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,yl(e,{x:h,y:d,w:f,h:u,radius:y}),e.fill(),e.stroke(),e.fillStyle=l.backgroundColor,e.beginPath(),yl(e,{x:g,y:d+1,w:f-2,h:u-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(h,d,f,u),e.strokeRect(h,d,f,u),e.fillStyle=l.backgroundColor,e.fillRect(g,d+1,f-2,u-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,n,i){const{body:r}=this,{bodySpacing:s,bodyAlign:l,displayColors:a,boxHeight:u,boxWidth:f,boxPadding:p}=i,m=It(i.bodyFont);let o=m.lineHeight,c=0;const d=yo(i.rtl,this.x,this.width),h=function(C){n.fillText(C,d.x(e.x+c),e.y+o/2),e.y+=o+s},g=d.textAlign(l);let y,v,_,b,x,w,S;for(n.textAlign=l,n.textBaseline="middle",n.font=m.string,e.x=kc(this,g,i),n.fillStyle=i.bodyColor,Qe(this.beforeBody,h),c=a&&g!=="right"?l==="center"?f/2+p:f+2+p:0,b=0,w=r.length;b<w;++b){for(y=r[b],v=this.labelTextColors[b],n.fillStyle=v,Qe(y.before,h),_=y.lines,a&&_.length&&(this._drawColorBox(n,e,b,d,i),o=Math.max(m.lineHeight,u)),x=0,S=_.length;x<S;++x)h(_[x]),o=m.lineHeight;Qe(y.after,h)}c=0,o=m.lineHeight,Qe(this.afterBody,h),e.y-=s}drawFooter(e,n,i){const r=this.footer,s=r.length;let l,a;if(s){const u=yo(i.rtl,this.x,this.width);for(e.x=kc(this,i.footerAlign,i),e.y+=i.footerMarginTop,n.textAlign=u.textAlign(i.footerAlign),n.textBaseline="middle",l=It(i.footerFont),n.fillStyle=i.footerColor,n.font=l.string,a=0;a<s;++a)n.fillText(r[a],u.x(e.x),e.y+l.lineHeight/2),e.y+=l.lineHeight+i.footerSpacing}}drawBackground(e,n,i,r){const{xAlign:s,yAlign:l}=this,{x:a,y:u}=e,{width:f,height:p}=i,{topLeft:m,topRight:o,bottomLeft:c,bottomRight:d}=Cs(r.cornerRadius);n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.beginPath(),n.moveTo(a+m,u),l==="top"&&this.drawCaret(e,n,i,r),n.lineTo(a+f-o,u),n.quadraticCurveTo(a+f,u,a+f,u+o),l==="center"&&s==="right"&&this.drawCaret(e,n,i,r),n.lineTo(a+f,u+p-d),n.quadraticCurveTo(a+f,u+p,a+f-d,u+p),l==="bottom"&&this.drawCaret(e,n,i,r),n.lineTo(a+c,u+p),n.quadraticCurveTo(a,u+p,a,u+p-c),l==="center"&&s==="left"&&this.drawCaret(e,n,i,r),n.lineTo(a,u+m),n.quadraticCurveTo(a,u,a+m,u),n.closePath(),n.fill(),r.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const l=La[e.position].call(this,this._active,this._eventPosition);if(!l)return;const a=this._size=z0(this,e),u=Object.assign({},l,this._size),f=N0(n,e,u),p=B0(e,u,f,n);(r._to!==p.x||s._to!==p.y)&&(this.xAlign=f.xAlign,this.yAlign=f.yAlign,this.width=a.width,this.height=a.height,this.caretX=l.x,this.caretY=l.y,this._resolveAnimations().update(this,p))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const l=sn(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=i,this.drawBackground(s,e,r,n),d1(e,n.textDirection),s.y+=l.top,this.drawTitle(s,e,n),this.drawBody(s,e,n),this.drawFooter(s,e,n),f1(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const i=this._active,r=e.map(({datasetIndex:a,index:u})=>{const f=this.chart.getDatasetMeta(a);if(!f)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:f.data[u],index:u}}),s=!Mu(i,r),l=this._positionChanged(r,n);(s||l)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],l=this._getActiveElements(e,s,n,i),a=this._positionChanged(l,e),u=n||!Mu(l,s)||a;return u&&(this._active=l,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),u}_getActiveElements(e,n,i,r){const s=this.options;if(e.type==="mouseout")return[];if(!r)return n;const l=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&l.reverse(),l}_positionChanged(e,n){const{caretX:i,caretY:r,options:s}=this,l=La[s.position].call(this,e,n);return l!==!1&&(i!==l.x||r!==l.y)}}var tM={id:"tooltip",_element:V0,positioners:La,afterInit(t,e,n){n&&(t.tooltip=new V0({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:N1},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},nM=Object.freeze({__proto__:null,Colors:pL,Decimation:yL,Filler:zL,Legend:HL,SubTitle:YL,Title:GL,Tooltip:tM});const iM=(t,e,n,i)=>(typeof e=="string"?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function rM(t,e,n,i){const r=t.indexOf(e);if(r===-1)return iM(t,e,n,i);const s=t.lastIndexOf(e);return r!==s?n:r}const sM=(t,e)=>t===null?null:Nt(Math.round(t),0,e);function H0(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class oM extends Bs{static id="category";static defaults={ticks:{callback:H0}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:r,label:s}of n)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(ze(e))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===e?n:rM(i,e,Pe(n,e),this._addedLabels),sM(n,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),n||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const e=this.min,n=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=e===0&&n===s.length-1?s:s.slice(e,n+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let l=e;l<=n;l++)r.push({value:l});return r}getLabelForValue(e){return H0.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function aM(t,e){const n=[],{bounds:r,step:s,min:l,max:a,precision:u,count:f,maxTicks:p,maxDigits:m,includeBounds:o}=t,c=s||1,d=p-1,{min:h,max:g}=e,y=!ze(l),v=!ze(a),_=!ze(f),b=(g-h)/(m+1);let x=Fy((g-h)/d/c)*c,w,S,C,T;if(x<1e-14&&!y&&!v)return[{value:h},{value:g}];T=Math.ceil(g/x)-Math.floor(h/x),T>d&&(x=Fy(T*x/d/c)*c),ze(u)||(w=Math.pow(10,u),x=Math.ceil(x*w)/w),r==="ticks"?(S=Math.floor(h/x)*x,C=Math.ceil(g/x)*x):(S=h,C=g),y&&v&&s&&GT((a-l)/s,x/1e3)?(T=Math.round(Math.min((a-l)/x,p)),x=(a-l)/T,S=l,C=a):_?(S=y?l:S,C=v?a:C,T=f-1,x=(C-S)/T):(T=(C-S)/x,ja(T,Math.round(T),x/1e3)?T=Math.round(T):T=Math.ceil(T));const M=Math.max(zy(x),zy(S));w=Math.pow(10,ze(u)?M:u),S=Math.round(S*w)/w,C=Math.round(C*w)/w;let B=0;for(y&&(o&&S!==l?(n.push({value:l}),S<l&&B++,ja(Math.round((S+B*x)*w)/w,l,W0(l,b,t))&&B++):S<l&&B++);B<T;++B){const F=Math.round((S+B*x)*w)/w;if(v&&F>a)break;n.push({value:F})}return v&&o&&C!==a?n.length&&ja(n[n.length-1].value,a,W0(a,b,t))?n[n.length-1].value=a:n.push({value:a}):(!v||C===a)&&n.push({value:C}),n}function W0(t,e,{horizontal:n,minRotation:i}){const r=gi(i),s=(n?Math.sin(r):Math.cos(r))||.001,l=.75*e*(""+t).length;return Math.min(e/s,l)}class Nu extends Bs{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return ze(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const l=u=>r=n?r:u,a=u=>s=i?s:u;if(e){const u=Ii(r),f=Ii(s);u<0&&f<0?a(0):u>0&&f>0&&l(0)}if(r===s){let u=s===0?1:Math.abs(s*.05);a(s+u),e||l(r-u)}this.min=r,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=e,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(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,l=aM(r,s);return e.bounds==="ticks"&&Yw(l,this,"value"),e.reverse?(l.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),l}configure(){const e=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const r=(i-n)/Math.max(e.length-1,1)/2;n-=r,i+=r}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(e){return Zl(e,this.chart.options.locale,this.options.ticks.format)}}class lM extends Nu{static id="linear";static defaults={ticks:{callback:nf.formatters.numeric}};determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=xt(e)?e:0,this.max=xt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,i=gi(this.options.ticks.minRotation),r=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const bl=t=>Math.floor(Rr(t)),fs=(t,e)=>Math.pow(10,bl(t)+e);function G0(t){return t/Math.pow(10,bl(t))===1}function Y0(t,e,n){const i=Math.pow(10,n),r=Math.floor(t/i);return Math.ceil(e/i)-r}function cM(t,e){const n=e-t;let i=bl(n);for(;Y0(t,e,i)>10;)i++;for(;Y0(t,e,i)<10;)i--;return Math.min(i,bl(t))}function uM(t,{min:e,max:n}){e=An(t.min,e);const i=[],r=bl(e);let s=cM(e,n),l=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),u=r>s?Math.pow(10,r):0,f=Math.round((e-u)*l)/l,p=Math.floor((e-u)/a/10)*a*10;let m=Math.floor((f-p)/Math.pow(10,s)),o=An(t.min,Math.round((u+p+m*Math.pow(10,s))*l)/l);for(;o<n;)i.push({value:o,major:G0(o),significand:m}),m>=10?m=m<15?15:20:m++,m>=20&&(s++,m=2,l=s>=0?1:l),o=Math.round((u+p+m*Math.pow(10,s))*l)/l;const c=An(t.max,o);return i.push({value:c,major:G0(c),significand:m}),i}class dM extends Bs{static id="logarithmic";static defaults={ticks:{callback:nf.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const i=Nu.prototype.parse.apply(this,[e,n]);if(i===0){this._zero=!0;return}return xt(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=xt(e)?Math.max(0,e):null,this.max=xt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!xt(this._userMin)&&(this.min=e===fs(this.min,0)?fs(this.min,-1):fs(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let i=this.min,r=this.max;const s=a=>i=e?i:a,l=a=>r=n?r:a;i===r&&(i<=0?(s(1),l(10)):(s(fs(i,-1)),l(fs(r,1)))),i<=0&&s(fs(r,-1)),r<=0&&l(fs(i,1)),this.min=i,this.max=r}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},i=uM(n,this);return e.bounds==="ticks"&&Yw(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Zl(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Rr(e),this._valueRange=Rr(this.max)-Rr(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Rr(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}function mp(t){const e=t.ticks;if(e.display&&t.display){const n=sn(e.backdropPadding);return Pe(e.font&&e.font.size,wt.font.size)+n.height}return 0}function fM(t,e,n){return n=rt(n)?n:[n],{w:cP(t,e.string,n),h:n.length*e.lineHeight}}function K0(t,e,n,i,r){return t===i||t===r?{start:e-n/2,end:e+n/2}:t<i||t>r?{start:e-n,end:e}:{start:e,end:e+n}}function hM(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),i=[],r=[],s=t._pointLabels.length,l=t.options.pointLabels,a=l.centerPointLabels?at/s:0;for(let u=0;u<s;u++){const f=l.setContext(t.getPointLabelContext(u));r[u]=f.padding;const p=t.getPointPosition(u,t.drawingArea+r[u],a),m=It(f.font),o=fM(t.ctx,m,t._pointLabels[u]);i[u]=o;const c=In(t.getIndexAngle(u)+a),d=Math.round(Am(c)),h=K0(d,p.x,o.w,0,180),g=K0(d,p.y,o.h,90,270);pM(n,e,c,h,g)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=vM(t,i,r)}function pM(t,e,n,i,r){const s=Math.abs(Math.sin(n)),l=Math.abs(Math.cos(n));let a=0,u=0;i.start<e.l?(a=(e.l-i.start)/s,t.l=Math.min(t.l,e.l-a)):i.end>e.r&&(a=(i.end-e.r)/s,t.r=Math.max(t.r,e.r+a)),r.start<e.t?(u=(e.t-r.start)/l,t.t=Math.min(t.t,e.t-u)):r.end>e.b&&(u=(r.end-e.b)/l,t.b=Math.max(t.b,e.b+u))}function gM(t,e,n){const i=t.drawingArea,{extra:r,additionalAngle:s,padding:l,size:a}=n,u=t.getPointPosition(e,i+r+l,s),f=Math.round(Am(In(u.angle+Pt))),p=bM(u.y,a.h,f),m=yM(f),o=_M(u.x,a.w,m);return{visible:!0,x:u.x,y:p,textAlign:m,left:o,top:p,right:o+a.w,bottom:p+a.h}}function mM(t,e){if(!e)return!0;const{left:n,top:i,right:r,bottom:s}=t;return!(nr({x:n,y:i},e)||nr({x:n,y:s},e)||nr({x:r,y:i},e)||nr({x:r,y:s},e))}function vM(t,e,n){const i=[],r=t._pointLabels.length,s=t.options,{centerPointLabels:l,display:a}=s.pointLabels,u={extra:mp(s)/2,additionalAngle:l?at/r:0};let f;for(let p=0;p<r;p++){u.padding=n[p],u.size=e[p];const m=gM(t,p,u);i.push(m),a==="auto"&&(m.visible=mM(m,f),m.visible&&(f=m))}return i}function yM(t){return t===0||t===180?"center":t<180?"left":"right"}function _M(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function bM(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function xM(t,e,n){const{left:i,top:r,right:s,bottom:l}=n,{backdropColor:a}=e;if(!ze(a)){const u=Cs(e.borderRadius),f=sn(e.backdropPadding);t.fillStyle=a;const p=i-f.left,m=r-f.top,o=s-i+f.width,c=l-r+f.height;Object.values(u).some(d=>d!==0)?(t.beginPath(),yl(t,{x:p,y:m,w:o,h:c,radius:u}),t.fill()):t.fillRect(p,m,o,c)}}function wM(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let r=e-1;r>=0;r--){const s=t._pointLabelItems[r];if(!s.visible)continue;const l=i.setContext(t.getPointLabelContext(r));xM(n,l,s);const a=It(l.font),{x:u,y:f,textAlign:p}=s;Ms(n,t._pointLabels[r],u,f+a.lineHeight/2,a,{color:l.color,textAlign:p,textBaseline:"middle"})}}function B1(t,e,n,i){const{ctx:r}=t;if(n)r.arc(t.xCenter,t.yCenter,e,0,st);else{let s=t.getPointPosition(0,e);r.moveTo(s.x,s.y);for(let l=1;l<i;l++)s=t.getPointPosition(l,e),r.lineTo(s.x,s.y)}}function SM(t,e,n,i,r){const s=t.ctx,l=e.circular,{color:a,lineWidth:u}=e;!l&&!i||!a||!u||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=u,s.setLineDash(r.dash),s.lineDashOffset=r.dashOffset,s.beginPath(),B1(t,n,l,i),s.closePath(),s.stroke(),s.restore())}function kM(t,e,n){return es(t,{label:n,index:e,type:"pointLabel"})}class EM extends Nu{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:nf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=sn(mp(this.options)/2),n=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=xt(e)&&!isNaN(e)?e:0,this.max=xt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/mp(this.options))}generateTickLabels(e){Nu.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,i)=>{const r=et(this.options.pointLabels.callback,[n,i],this);return r||r===0?r:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?hM(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,i,r){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,i,r))}getIndexAngle(e){const n=st/(this._pointLabels.length||1),i=this.options.startAngle||0;return In(e*n+gi(i))}getDistanceFromCenterForValue(e){if(ze(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(ze(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const i=n[e];return kM(this.getContext(),e,i)}}getPointPosition(e,n,i=0){const r=this.getIndexAngle(e)-Pt+i;return{x:Math.cos(r)*n+this.xCenter,y:Math.sin(r)*n+this.yCenter,angle:r}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:i,right:r,bottom:s}=this._pointLabelItems[e];return{left:n,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),B1(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:i,grid:r,border:s}=n,l=this._pointLabels.length;let a,u,f;if(n.pointLabels.display&&wM(this,l),r.display&&this.ticks.forEach((p,m)=>{if(m!==0){u=this.getDistanceFromCenterForValue(p.value);const o=this.getContext(m),c=r.setContext(o),d=s.setContext(o);SM(this,c,u,l,d)}}),i.display){for(e.save(),a=l-1;a>=0;a--){const p=i.setContext(this.getPointLabelContext(a)),{color:m,lineWidth:o}=p;!o||!m||(e.lineWidth=o,e.strokeStyle=m,e.setLineDash(p.borderDash),e.lineDashOffset=p.borderDashOffset,u=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),f=this.getPointPosition(a,u),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(f.x,f.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,l;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,u)=>{if(u===0&&!n.reverse)return;const f=i.setContext(this.getContext(u)),p=It(f.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),f.showLabelBackdrop){e.font=p.string,l=e.measureText(a.label).width,e.fillStyle=f.backdropColor;const m=sn(f.backdropPadding);e.fillRect(-l/2-m.left,-s-p.size/2-m.top,l+m.width,p.size+m.height)}Ms(e,a.label,0,-s,p,{color:f.color,strokeColor:f.textStrokeColor,strokeWidth:f.textStrokeWidth})}),e.restore()}drawTitle(){}}const cf={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}},_n=Object.keys(cf);function Q0(t,e){return t-e}function Z0(t,e){if(ze(e))return null;const n=t._adapter,{parser:i,round:r,isoWeekday:s}=t._parseOpts;let l=e;return typeof i=="function"&&(l=i(l)),xt(l)||(l=typeof i=="string"?n.parse(l,i):n.parse(l)),l===null?null:(r&&(l=r==="week"&&(Oo(s)||s===!0)?n.startOf(l,"isoWeek",s):n.startOf(l,r)),+l)}function X0(t,e,n,i){const r=_n.length;for(let s=_n.indexOf(t);s<r-1;++s){const l=cf[_n[s]],a=l.steps?l.steps:Number.MAX_SAFE_INTEGER;if(l.common&&Math.ceil((n-e)/(a*l.size))<=i)return _n[s]}return _n[r-1]}function CM(t,e,n,i,r){for(let s=_n.length-1;s>=_n.indexOf(n);s--){const l=_n[s];if(cf[l].common&&t._adapter.diff(r,i,l)>=e-1)return l}return _n[n?_n.indexOf(n):0]}function TM(t){for(let e=_n.indexOf(t)+1,n=_n.length;e<n;++e)if(cf[_n[e]].common)return _n[e]}function q0(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:i,hi:r}=Om(n,e),s=n[i]>=e?n[i]:n[r];t[s]=!0}}function PM(t,e,n,i){const r=t._adapter,s=+r.startOf(e[0].value,i),l=e[e.length-1].value;let a,u;for(a=s;a<=l;a=+r.add(a,1,i))u=n[a],u>=0&&(e[u].major=!0);return e}function J0(t,e,n){const i=[],r={},s=e.length;let l,a;for(l=0;l<s;++l)a=e[l],r[a]=l,i.push({value:a,major:!1});return s===0||!n?i:PM(t,i,r,n)}class vp extends Bs{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const i=e.time||(e.time={}),r=this._adapter=new OA._date(e.adapters.date);r.init(n),Ba(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:Z0(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,i=e.time.unit||"day";let{min:r,max:s,minDefined:l,maxDefined:a}=this.getUserBounds();function u(f){!l&&!isNaN(f.min)&&(r=Math.min(r,f.min)),!a&&!isNaN(f.max)&&(s=Math.max(s,f.max))}(!l||!a)&&(u(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&u(this.getMinMax(!1))),r=xt(r)&&!isNaN(r)?r:+n.startOf(Date.now(),i),s=xt(s)&&!isNaN(s)?s:+n.endOf(Date.now(),i)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],i=e[e.length-1]),{min:n,max:i}}buildTicks(){const e=this.options,n=e.time,i=e.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,l=this.max,a=ZT(r,s,l);return this._unit=n.unit||(i.autoSkip?X0(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):CM(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:TM(this._unit),this.initOffsets(r),e.reverse&&a.reverse(),J0(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,i=0,r,s;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),e.length===1?n=1-r:n=(this.getDecimalForValue(e[1])-r)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?i=s:i=(s-this.getDecimalForValue(e[e.length-2]))/2);const l=e.length<3?.5:.25;n=Nt(n,0,l),i=Nt(i,0,l),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const e=this._adapter,n=this.min,i=this.max,r=this.options,s=r.time,l=s.unit||X0(s.minUnit,n,i,this._getLabelCapacity(n)),a=Pe(r.ticks.stepSize,1),u=l==="week"?s.isoWeekday:!1,f=Oo(u)||u===!0,p={};let m=n,o,c;if(f&&(m=+e.startOf(m,"isoWeek",u)),m=+e.startOf(m,f?"day":l),e.diff(i,n,l)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+l);const d=r.ticks.source==="data"&&this.getDataTimestamps();for(o=m,c=0;o<i;o=+e.add(o,a,l),c++)q0(p,o,d);return(o===i||r.bounds==="ticks"||c===1)&&q0(p,o,d),Object.keys(p).sort(Q0).map(h=>+h)}getLabelForValue(e){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(e,i.tooltipFormat):n.format(e,i.displayFormats.datetime)}format(e,n){const r=this.options.time.displayFormats,s=this._unit,l=n||r[s];return this._adapter.format(e,l)}_tickFormatFunction(e,n,i,r){const s=this.options,l=s.ticks.callback;if(l)return et(l,[e,n,i],this);const a=s.time.displayFormats,u=this._unit,f=this._majorUnit,p=u&&a[u],m=f&&a[f],o=i[n],c=f&&m&&o&&o.major;return this._adapter.format(e,r||(c?m:p))}generateTickLabels(e){let n,i,r;for(n=0,i=e.length;n<i;++n)r=e[n],r.label=this._tickFormatFunction(r.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(e){const n=this._offsets,i=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,i=this.ctx.measureText(e).width,r=gi(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(r),l=Math.sin(r),a=this._resolveTickFontOptions(0).size;return{w:i*s+a*l,h:i*l+a*s}}_getLabelCapacity(e){const n=this.options.time,i=n.displayFormats,r=i[n.unit]||i.millisecond,s=this._tickFormatFunction(e,0,J0(this,[e],this._majorUnit),r),l=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/l.w:this.height/l.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,i;if(e.length)return e;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,i=r.length;n<i;++n)e=e.concat(r[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,i;if(e.length)return e;const r=this.getLabels();for(n=0,i=r.length;n<i;++n)e.push(Z0(this,r[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Zw(e.sort(Q0))}}function Ec(t,e,n){let i=0,r=t.length-1,s,l,a,u;n?(e>=t[i].pos&&e<=t[r].pos&&({lo:i,hi:r}=tr(t,"pos",e)),{pos:s,time:a}=t[i],{pos:l,time:u}=t[r]):(e>=t[i].time&&e<=t[r].time&&({lo:i,hi:r}=tr(t,"time",e)),{time:s,pos:a}=t[i],{time:l,pos:u}=t[r]);const f=l-s;return f?a+(u-a)*(e-s)/f:a}class AM extends vp{static id="timeseries";static defaults=vp.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=Ec(n,this.min),this._tableRange=Ec(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:i}=this,r=[],s=[];let l,a,u,f,p;for(l=0,a=e.length;l<a;++l)f=e[l],f>=n&&f<=i&&r.push(f);if(r.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(l=0,a=r.length;l<a;++l)p=r[l+1],u=r[l-1],f=r[l],Math.round((p+u)/2)!==f&&s.push({time:f,pos:l/(a-1)});return s}_generate(){const e=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(e)||!i.length)&&i.splice(0,0,e),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?e=this.normalize(n.concat(i)):e=n.length?n:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Ec(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,i=this.getDecimalForPixel(e)/n.factor-n.end;return Ec(this._table,i*this._tableRange+this._minPos,!0)}}var OM=Object.freeze({__proto__:null,CategoryScale:oM,LinearScale:lM,LogarithmicScale:dM,RadialLinearScale:EM,TimeScale:vp,TimeSeriesScale:AM});const LM=[AA,lL,nM,OM];af.register(...LM);var MM=zw(function(t,e){var n=t.styles,i=km([n],void 0,k.useContext(Nw)),r=k.useRef();return Py(function(){var s=e.key+"-global",l=new e.sheet.constructor({key:s,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy}),a=!1,u=document.querySelector('style[data-emotion="'+s+" "+i.name+'"]');return e.sheet.tags.length&&(l.before=e.sheet.tags[0]),u!==null&&(a=!0,u.setAttribute("data-emotion",s),l.hydrate([u])),r.current=[l,a],function(){l.flush()}},[e]),Py(function(){var s=r.current,l=s[0],a=s[1];if(a){s[1]=!1;return}if(i.next!==void 0&&Rw(e,i.next,!0),l.tags.length){var u=l.tags[l.tags.length-1].nextElementSibling;l.before=u,l.flush()}e.insert("",i,l,!1)},[e,i.name]),null});function an(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return km(e)}var j1={exports:{}},$n={},$1={exports:{}},V1={};(function(t){function e(I,z){var X=I.length;I.push(z);e:for(;0<X;){var K=X-1>>>1,be=I[K];if(0<r(be,z))I[K]=z,I[X]=be,X=K;else break e}}function n(I){return I.length===0?null:I[0]}function i(I){if(I.length===0)return null;var z=I[0],X=I.pop();if(X!==z){I[0]=X;e:for(var K=0,be=I.length,Ke=be>>>1;K<Ke;){var ue=2*(K+1)-1,fe=I[ue],ke=ue+1,Be=I[ke];if(0>r(fe,X))ke<be&&0>r(Be,fe)?(I[K]=Be,I[ke]=X,K=ke):(I[K]=fe,I[ue]=X,K=ue);else if(ke<be&&0>r(Be,X))I[K]=Be,I[ke]=X,K=ke;else break e}}return z}function r(I,z){var X=I.sortIndex-z.sortIndex;return X!==0?X:I.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,a=l.now();t.unstable_now=function(){return l.now()-a}}var u=[],f=[],p=1,m=null,o=3,c=!1,d=!1,h=!1,g=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(I){for(var z=n(f);z!==null;){if(z.callback===null)i(f);else if(z.startTime<=I)i(f),z.sortIndex=z.expirationTime,e(u,z);else break;z=n(f)}}function b(I){if(h=!1,_(I),!d)if(n(u)!==null)d=!0,Y(x);else{var z=n(f);z!==null&&ee(b,z.startTime-I)}}function x(I,z){d=!1,h&&(h=!1,y(C),C=-1),c=!0;var X=o;try{for(_(z),m=n(u);m!==null&&(!(m.expirationTime>z)||I&&!B());){var K=m.callback;if(typeof K=="function"){m.callback=null,o=m.priorityLevel;var be=K(m.expirationTime<=z);z=t.unstable_now(),typeof be=="function"?m.callback=be:m===n(u)&&i(u),_(z)}else i(u);m=n(u)}if(m!==null)var Ke=!0;else{var ue=n(f);ue!==null&&ee(b,ue.startTime-z),Ke=!1}return Ke}finally{m=null,o=X,c=!1}}var w=!1,S=null,C=-1,T=5,M=-1;function B(){return!(t.unstable_now()-M<T)}function F(){if(S!==null){var I=t.unstable_now();M=I;var z=!0;try{z=S(!0,I)}finally{z?N():(w=!1,S=null)}}else w=!1}var N;if(typeof v=="function")N=function(){v(F)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,H=W.port2;W.port1.onmessage=F,N=function(){H.postMessage(null)}}else N=function(){g(F,0)};function Y(I){S=I,w||(w=!0,N())}function ee(I,z){C=g(function(){I(t.unstable_now())},z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(I){I.callback=null},t.unstable_continueExecution=function(){d||c||(d=!0,Y(x))},t.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<I?Math.floor(1e3/I):5},t.unstable_getCurrentPriorityLevel=function(){return o},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(I){switch(o){case 1:case 2:case 3:var z=3;break;default:z=o}var X=o;o=z;try{return I()}finally{o=X}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(I,z){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var X=o;o=I;try{return z()}finally{o=X}},t.unstable_scheduleCallback=function(I,z,X){var K=t.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?K+X:K):X=K,I){case 1:var be=-1;break;case 2:be=250;break;case 5:be=1073741823;break;case 4:be=1e4;break;default:be=5e3}return be=X+be,I={id:p++,callback:z,priorityLevel:I,startTime:X,expirationTime:be,sortIndex:-1},X>K?(I.sortIndex=X,e(f,I),n(u)===null&&I===n(f)&&(h?(y(C),C=-1):h=!0,ee(b,X-K))):(I.sortIndex=be,e(u,I),d||c||(d=!0,Y(x))),I},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(I){var z=o;return function(){var X=o;o=z;try{return I.apply(this,arguments)}finally{o=X}}}})(V1);$1.exports=V1;var DM=$1.exports;var H1=k,Bn=DM;function G(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var W1=new Set,xl={};function js(t,e){Do(t,e),Do(t+"Capture",e)}function Do(t,e){for(xl[t]=e,t=0;t<e.length;t++)W1.add(e[t])}var lr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yp=Object.prototype.hasOwnProperty,RM=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,e_={},t_={};function IM(t){return yp.call(t_,t)?!0:yp.call(e_,t)?!1:RM.test(t)?t_[t]=!0:(e_[t]=!0,!1)}function UM(t,e,n,i){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function FM(t,e,n,i){if(e===null||typeof e>"u"||UM(t,e,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function fn(t,e,n,i,r,s,l){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=l}var Qt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Qt[t]=new fn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Qt[e]=new fn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Qt[t]=new fn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Qt[t]=new fn(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Qt[t]=new fn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Qt[t]=new fn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Qt[t]=new fn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Qt[t]=new fn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Qt[t]=new fn(t,5,!1,t.toLowerCase(),null,!1,!1)});var $m=/[\-:]([a-z])/g;function Vm(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace($m,Vm);Qt[e]=new fn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace($m,Vm);Qt[e]=new fn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace($m,Vm);Qt[e]=new fn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Qt[t]=new fn(t,1,!1,t.toLowerCase(),null,!1,!1)});Qt.xlinkHref=new fn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Qt[t]=new fn(t,1,!1,t.toLowerCase(),null,!0,!0)});function Hm(t,e,n,i){var r=Qt.hasOwnProperty(e)?Qt[e]:null;(r!==null?r.type!==0:i||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(FM(e,n,r,i)&&(n=null),i||r===null?IM(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):r.mustUseProperty?t[r.propertyName]=n===null?r.type===3?!1:"":n:(e=r.attributeName,i=r.attributeNamespace,n===null?t.removeAttribute(e):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,i?t.setAttributeNS(i,e,n):t.setAttribute(e,n))))}var gr=H1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Cc=Symbol.for("react.element"),to=Symbol.for("react.portal"),no=Symbol.for("react.fragment"),Wm=Symbol.for("react.strict_mode"),_p=Symbol.for("react.profiler"),G1=Symbol.for("react.provider"),Y1=Symbol.for("react.context"),Gm=Symbol.for("react.forward_ref"),bp=Symbol.for("react.suspense"),xp=Symbol.for("react.suspense_list"),Ym=Symbol.for("react.memo"),Sr=Symbol.for("react.lazy"),K1=Symbol.for("react.offscreen"),n_=Symbol.iterator;function ua(t){return t===null||typeof t!="object"?null:(t=n_&&t[n_]||t["@@iterator"],typeof t=="function"?t:null)}var mt=Object.assign,Xf;function Ma(t){if(Xf===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Xf=e&&e[1]||""}return`
4
+ `+Xf+t}var qf=!1;function Jf(t,e){if(!t||qf)return"";qf=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(f){var i=f}Reflect.construct(t,[],e)}else{try{e.call()}catch(f){i=f}t.call(e.prototype)}else{try{throw Error()}catch(f){i=f}t()}}catch(f){if(f&&i&&typeof f.stack=="string"){for(var r=f.stack.split(`
5
+ `),s=i.stack.split(`
6
+ `),l=r.length-1,a=s.length-1;1<=l&&0<=a&&r[l]!==s[a];)a--;for(;1<=l&&0<=a;l--,a--)if(r[l]!==s[a]){if(l!==1||a!==1)do if(l--,a--,0>a||r[l]!==s[a]){var u=`
7
+ `+r[l].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=l&&0<=a);break}}}finally{qf=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Ma(t):""}function zM(t){switch(t.tag){case 5:return Ma(t.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return t=Jf(t.type,!1),t;case 11:return t=Jf(t.type.render,!1),t;case 1:return t=Jf(t.type,!0),t;default:return""}}function wp(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case no:return"Fragment";case to:return"Portal";case _p:return"Profiler";case Wm:return"StrictMode";case bp:return"Suspense";case xp:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Y1:return(t.displayName||"Context")+".Consumer";case G1:return(t._context.displayName||"Context")+".Provider";case Gm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Ym:return e=t.displayName||null,e!==null?e:wp(t.type)||"Memo";case Sr:e=t._payload,t=t._init;try{return wp(t(e))}catch{}}return null}function NM(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return wp(e);case 8:return e===Wm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Xr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Q1(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function BM(t){var e=Q1(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(l){i=""+l,s.call(this,l)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(l){i=""+l},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Tc(t){t._valueTracker||(t._valueTracker=BM(t))}function Z1(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=Q1(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function Bu(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Sp(t,e){var n=e.checked;return mt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function i_(t,e){var n=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;n=Xr(e.value!=null?e.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function X1(t,e){e=e.checked,e!=null&&Hm(t,"checked",e,!1)}function kp(t,e){X1(t,e);var n=Xr(e.value),i=e.type;if(n!=null)i==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Ep(t,e.type,n):e.hasOwnProperty("defaultValue")&&Ep(t,e.type,Xr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function r_(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Ep(t,e,n){(e!=="number"||Bu(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Da=Array.isArray;function _o(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+Xr(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function Cp(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(G(91));return mt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function s_(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(G(92));if(Da(n)){if(1<n.length)throw Error(G(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Xr(n)}}function q1(t,e){var n=Xr(e.value),i=Xr(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),i!=null&&(t.defaultValue=""+i)}function o_(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function J1(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Tp(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?J1(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Pc,eS=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,i,r){MSApp.execUnsafeLocalFunction(function(){return t(e,n,i,r)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Pc=Pc||document.createElement("div"),Pc.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Pc.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function wl(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Ha={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},jM=["Webkit","ms","Moz","O"];Object.keys(Ha).forEach(function(t){jM.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Ha[e]=Ha[t]})});function tS(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Ha.hasOwnProperty(t)&&Ha[t]?(""+e).trim():e+"px"}function nS(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var i=n.indexOf("--")===0,r=tS(n,e[n],i);n==="float"&&(n="cssFloat"),i?t.setProperty(n,r):t[n]=r}}var $M=mt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Pp(t,e){if(e){if($M[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(G(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(G(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(G(61))}if(e.style!=null&&typeof e.style!="object")throw Error(G(62))}}function Ap(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Op=null;function Km(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Lp=null,bo=null,xo=null;function a_(t){if(t=ec(t)){if(typeof Lp!="function")throw Error(G(280));var e=t.stateNode;e&&(e=pf(e),Lp(t.stateNode,t.type,e))}}function iS(t){bo?xo?xo.push(t):xo=[t]:bo=t}function rS(){if(bo){var t=bo,e=xo;if(xo=bo=null,a_(t),e)for(t=0;t<e.length;t++)a_(e[t])}}function sS(t,e){return t(e)}function oS(){}var eh=!1;function aS(t,e,n){if(eh)return t(e,n);eh=!0;try{return sS(t,e,n)}finally{eh=!1,(bo!==null||xo!==null)&&(oS(),rS())}}function Sl(t,e){var n=t.stateNode;if(n===null)return null;var i=pf(n);if(i===null)return null;n=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(G(231,e,typeof n));return n}var Mp=!1;if(lr)try{var da={};Object.defineProperty(da,"passive",{get:function(){Mp=!0}}),window.addEventListener("test",da,da),window.removeEventListener("test",da,da)}catch{Mp=!1}function VM(t,e,n,i,r,s,l,a,u){var f=Array.prototype.slice.call(arguments,3);try{e.apply(n,f)}catch(p){this.onError(p)}}var Wa=!1,ju=null,$u=!1,Dp=null,HM={onError:function(t){Wa=!0,ju=t}};function WM(t,e,n,i,r,s,l,a,u){Wa=!1,ju=null,VM.apply(HM,arguments)}function GM(t,e,n,i,r,s,l,a,u){if(WM.apply(this,arguments),Wa){if(Wa){var f=ju;Wa=!1,ju=null}else throw Error(G(198));$u||($u=!0,Dp=f)}}function $s(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function lS(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function l_(t){if($s(t)!==t)throw Error(G(188))}function YM(t){var e=t.alternate;if(!e){if(e=$s(t),e===null)throw Error(G(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var s=r.alternate;if(s===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return l_(r),t;if(s===i)return l_(r),e;s=s.sibling}throw Error(G(188))}if(n.return!==i.return)n=r,i=s;else{for(var l=!1,a=r.child;a;){if(a===n){l=!0,n=r,i=s;break}if(a===i){l=!0,i=r,n=s;break}a=a.sibling}if(!l){for(a=s.child;a;){if(a===n){l=!0,n=s,i=r;break}if(a===i){l=!0,i=s,n=r;break}a=a.sibling}if(!l)throw Error(G(189))}}if(n.alternate!==i)throw Error(G(190))}if(n.tag!==3)throw Error(G(188));return n.stateNode.current===n?t:e}function cS(t){return t=YM(t),t!==null?uS(t):null}function uS(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=uS(t);if(e!==null)return e;t=t.sibling}return null}var dS=Bn.unstable_scheduleCallback,c_=Bn.unstable_cancelCallback,KM=Bn.unstable_shouldYield,QM=Bn.unstable_requestPaint,Tt=Bn.unstable_now,ZM=Bn.unstable_getCurrentPriorityLevel,Qm=Bn.unstable_ImmediatePriority,fS=Bn.unstable_UserBlockingPriority,Vu=Bn.unstable_NormalPriority,XM=Bn.unstable_LowPriority,hS=Bn.unstable_IdlePriority,uf=null,Ui=null;function qM(t){if(Ui&&typeof Ui.onCommitFiberRoot=="function")try{Ui.onCommitFiberRoot(uf,t,void 0,(t.current.flags&128)===128)}catch{}}var mi=Math.clz32?Math.clz32:tD,JM=Math.log,eD=Math.LN2;function tD(t){return t>>>=0,t===0?32:31-(JM(t)/eD|0)|0}var Ac=64,Oc=4194304;function Ra(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Hu(t,e){var n=t.pendingLanes;if(n===0)return 0;var i=0,r=t.suspendedLanes,s=t.pingedLanes,l=n&268435455;if(l!==0){var a=l&~r;a!==0?i=Ra(a):(s&=l,s!==0&&(i=Ra(s)))}else l=n&~r,l!==0?i=Ra(l):s!==0&&(i=Ra(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=i;0<e;)n=31-mi(e),r=1<<n,i|=t[n],e&=~r;return i}function nD(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function iD(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,s=t.pendingLanes;0<s;){var l=31-mi(s),a=1<<l,u=r[l];u===-1?(!(a&n)||a&i)&&(r[l]=nD(a,e)):u<=e&&(t.expiredLanes|=a),s&=~a}}function Rp(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function pS(){var t=Ac;return Ac<<=1,!(Ac&4194240)&&(Ac=64),t}function th(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function ql(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-mi(e),t[e]=n}function rD(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0<n;){var r=31-mi(n),s=1<<r;e[r]=0,i[r]=-1,t[r]=-1,n&=~s}}function Zm(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-mi(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}var Ze=0;function gS(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var mS,Xm,vS,yS,_S,Ip=!1,Lc=[],Br=null,jr=null,$r=null,kl=new Map,El=new Map,Tr=[],sD="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function u_(t,e){switch(t){case"focusin":case"focusout":Br=null;break;case"dragenter":case"dragleave":jr=null;break;case"mouseover":case"mouseout":$r=null;break;case"pointerover":case"pointerout":kl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":El.delete(e.pointerId)}}function fa(t,e,n,i,r,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:s,targetContainers:[r]},e!==null&&(e=ec(e),e!==null&&Xm(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function oD(t,e,n,i,r){switch(e){case"focusin":return Br=fa(Br,t,e,n,i,r),!0;case"dragenter":return jr=fa(jr,t,e,n,i,r),!0;case"mouseover":return $r=fa($r,t,e,n,i,r),!0;case"pointerover":var s=r.pointerId;return kl.set(s,fa(kl.get(s)||null,t,e,n,i,r)),!0;case"gotpointercapture":return s=r.pointerId,El.set(s,fa(El.get(s)||null,t,e,n,i,r)),!0}return!1}function bS(t){var e=xs(t.target);if(e!==null){var n=$s(e);if(n!==null){if(e=n.tag,e===13){if(e=lS(n),e!==null){t.blockedOn=e,_S(t.priority,function(){vS(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function nu(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Up(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);Op=i,n.target.dispatchEvent(i),Op=null}else return e=ec(n),e!==null&&Xm(e),t.blockedOn=n,!1;e.shift()}return!0}function d_(t,e,n){nu(t)&&n.delete(e)}function aD(){Ip=!1,Br!==null&&nu(Br)&&(Br=null),jr!==null&&nu(jr)&&(jr=null),$r!==null&&nu($r)&&($r=null),kl.forEach(d_),El.forEach(d_)}function ha(t,e){t.blockedOn===e&&(t.blockedOn=null,Ip||(Ip=!0,Bn.unstable_scheduleCallback(Bn.unstable_NormalPriority,aD)))}function Cl(t){function e(r){return ha(r,t)}if(0<Lc.length){ha(Lc[0],t);for(var n=1;n<Lc.length;n++){var i=Lc[n];i.blockedOn===t&&(i.blockedOn=null)}}for(Br!==null&&ha(Br,t),jr!==null&&ha(jr,t),$r!==null&&ha($r,t),kl.forEach(e),El.forEach(e),n=0;n<Tr.length;n++)i=Tr[n],i.blockedOn===t&&(i.blockedOn=null);for(;0<Tr.length&&(n=Tr[0],n.blockedOn===null);)bS(n),n.blockedOn===null&&Tr.shift()}var wo=gr.ReactCurrentBatchConfig,Wu=!0;function lD(t,e,n,i){var r=Ze,s=wo.transition;wo.transition=null;try{Ze=1,qm(t,e,n,i)}finally{Ze=r,wo.transition=s}}function cD(t,e,n,i){var r=Ze,s=wo.transition;wo.transition=null;try{Ze=4,qm(t,e,n,i)}finally{Ze=r,wo.transition=s}}function qm(t,e,n,i){if(Wu){var r=Up(t,e,n,i);if(r===null)dh(t,e,i,Gu,n),u_(t,i);else if(oD(r,t,e,n,i))i.stopPropagation();else if(u_(t,i),e&4&&-1<sD.indexOf(t)){for(;r!==null;){var s=ec(r);if(s!==null&&mS(s),s=Up(t,e,n,i),s===null&&dh(t,e,i,Gu,n),s===r)break;r=s}r!==null&&i.stopPropagation()}else dh(t,e,i,null,n)}}var Gu=null;function Up(t,e,n,i){if(Gu=null,t=Km(i),t=xs(t),t!==null)if(e=$s(t),e===null)t=null;else if(n=e.tag,n===13){if(t=lS(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Gu=t,null}function xS(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ZM()){case Qm:return 1;case fS:return 4;case Vu:case XM:return 16;case hS:return 536870912;default:return 16}default:return 16}}var Ur=null,Jm=null,iu=null;function wS(){if(iu)return iu;var t,e=Jm,n=e.length,i,r="value"in Ur?Ur.value:Ur.textContent,s=r.length;for(t=0;t<n&&e[t]===r[t];t++);var l=n-t;for(i=1;i<=l&&e[n-i]===r[s-i];i++);return iu=r.slice(t,1<i?1-i:void 0)}function ru(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Mc(){return!0}function f_(){return!1}function Vn(t){function e(n,i,r,s,l){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=s,this.target=l,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Mc:f_,this.isPropagationStopped=f_,this}return mt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Mc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Mc)},persist:function(){},isPersistent:Mc}),e}var Zo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ev=Vn(Zo),Jl=mt({},Zo,{view:0,detail:0}),uD=Vn(Jl),nh,ih,pa,df=mt({},Jl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tv,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==pa&&(pa&&t.type==="mousemove"?(nh=t.screenX-pa.screenX,ih=t.screenY-pa.screenY):ih=nh=0,pa=t),nh)},movementY:function(t){return"movementY"in t?t.movementY:ih}}),h_=Vn(df),dD=mt({},df,{dataTransfer:0}),fD=Vn(dD),hD=mt({},Jl,{relatedTarget:0}),rh=Vn(hD),pD=mt({},Zo,{animationName:0,elapsedTime:0,pseudoElement:0}),gD=Vn(pD),mD=mt({},Zo,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),vD=Vn(mD),yD=mt({},Zo,{data:0}),p_=Vn(yD),_D={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bD={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wD(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=xD[t])?!!e[t]:!1}function tv(){return wD}var SD=mt({},Jl,{key:function(t){if(t.key){var e=_D[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=ru(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?bD[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tv,charCode:function(t){return t.type==="keypress"?ru(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ru(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),kD=Vn(SD),ED=mt({},df,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),g_=Vn(ED),CD=mt({},Jl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tv}),TD=Vn(CD),PD=mt({},Zo,{propertyName:0,elapsedTime:0,pseudoElement:0}),AD=Vn(PD),OD=mt({},df,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),LD=Vn(OD),MD=[9,13,27,32],nv=lr&&"CompositionEvent"in window,Ga=null;lr&&"documentMode"in document&&(Ga=document.documentMode);var DD=lr&&"TextEvent"in window&&!Ga,SS=lr&&(!nv||Ga&&8<Ga&&11>=Ga),m_=String.fromCharCode(32),v_=!1;function kS(t,e){switch(t){case"keyup":return MD.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ES(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var io=!1;function RD(t,e){switch(t){case"compositionend":return ES(e);case"keypress":return e.which!==32?null:(v_=!0,m_);case"textInput":return t=e.data,t===m_&&v_?null:t;default:return null}}function ID(t,e){if(io)return t==="compositionend"||!nv&&kS(t,e)?(t=wS(),iu=Jm=Ur=null,io=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return SS&&e.locale!=="ko"?null:e.data;default:return null}}var UD={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function y_(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!UD[t.type]:e==="textarea"}function CS(t,e,n,i){iS(i),e=Yu(e,"onChange"),0<e.length&&(n=new ev("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var Ya=null,Tl=null;function FD(t){FS(t,0)}function ff(t){var e=oo(t);if(Z1(e))return t}function zD(t,e){if(t==="change")return e}var TS=!1;if(lr){var sh;if(lr){var oh="oninput"in document;if(!oh){var __=document.createElement("div");__.setAttribute("oninput","return;"),oh=typeof __.oninput=="function"}sh=oh}else sh=!1;TS=sh&&(!document.documentMode||9<document.documentMode)}function b_(){Ya&&(Ya.detachEvent("onpropertychange",PS),Tl=Ya=null)}function PS(t){if(t.propertyName==="value"&&ff(Tl)){var e=[];CS(e,Tl,t,Km(t)),aS(FD,e)}}function ND(t,e,n){t==="focusin"?(b_(),Ya=e,Tl=n,Ya.attachEvent("onpropertychange",PS)):t==="focusout"&&b_()}function BD(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ff(Tl)}function jD(t,e){if(t==="click")return ff(e)}function $D(t,e){if(t==="input"||t==="change")return ff(e)}function VD(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var _i=typeof Object.is=="function"?Object.is:VD;function Pl(t,e){if(_i(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!yp.call(e,r)||!_i(t[r],e[r]))return!1}return!0}function x_(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function w_(t,e){var n=x_(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=x_(n)}}function AS(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?AS(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function OS(){for(var t=window,e=Bu();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Bu(t.document)}return e}function iv(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function HD(t){var e=OS(),n=t.focusedElem,i=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&AS(n.ownerDocument.documentElement,n)){if(i!==null&&iv(n)){if(e=i.start,t=i.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var r=n.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!t.extend&&s>i&&(r=i,i=s,s=r),r=w_(n,s);var l=w_(n,i);r&&l&&(t.rangeCount!==1||t.anchorNode!==r.node||t.anchorOffset!==r.offset||t.focusNode!==l.node||t.focusOffset!==l.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),t.removeAllRanges(),s>i?(t.addRange(e),t.extend(l.node,l.offset)):(e.setEnd(l.node,l.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var WD=lr&&"documentMode"in document&&11>=document.documentMode,ro=null,Fp=null,Ka=null,zp=!1;function S_(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zp||ro==null||ro!==Bu(i)||(i=ro,"selectionStart"in i&&iv(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Ka&&Pl(Ka,i)||(Ka=i,i=Yu(Fp,"onSelect"),0<i.length&&(e=new ev("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=ro)))}function Dc(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var so={animationend:Dc("Animation","AnimationEnd"),animationiteration:Dc("Animation","AnimationIteration"),animationstart:Dc("Animation","AnimationStart"),transitionend:Dc("Transition","TransitionEnd")},ah={},LS={};lr&&(LS=document.createElement("div").style,"AnimationEvent"in window||(delete so.animationend.animation,delete so.animationiteration.animation,delete so.animationstart.animation),"TransitionEvent"in window||delete so.transitionend.transition);function hf(t){if(ah[t])return ah[t];if(!so[t])return t;var e=so[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in LS)return ah[t]=e[n];return t}var MS=hf("animationend"),DS=hf("animationiteration"),RS=hf("animationstart"),IS=hf("transitionend"),US=new Map,k_="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ns(t,e){US.set(t,e),js(e,[t])}for(var lh=0;lh<k_.length;lh++){var ch=k_[lh],GD=ch.toLowerCase(),YD=ch[0].toUpperCase()+ch.slice(1);ns(GD,"on"+YD)}ns(MS,"onAnimationEnd");ns(DS,"onAnimationIteration");ns(RS,"onAnimationStart");ns("dblclick","onDoubleClick");ns("focusin","onFocus");ns("focusout","onBlur");ns(IS,"onTransitionEnd");Do("onMouseEnter",["mouseout","mouseover"]);Do("onMouseLeave",["mouseout","mouseover"]);Do("onPointerEnter",["pointerout","pointerover"]);Do("onPointerLeave",["pointerout","pointerover"]);js("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));js("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));js("onBeforeInput",["compositionend","keypress","textInput","paste"]);js("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));js("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));js("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ia="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),KD=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ia));function E_(t,e,n){var i=t.type||"unknown-event";t.currentTarget=n,GM(i,e,void 0,t),t.currentTarget=null}function FS(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var s=void 0;if(e)for(var l=i.length-1;0<=l;l--){var a=i[l],u=a.instance,f=a.currentTarget;if(a=a.listener,u!==s&&r.isPropagationStopped())break e;E_(r,a,f),s=u}else for(l=0;l<i.length;l++){if(a=i[l],u=a.instance,f=a.currentTarget,a=a.listener,u!==s&&r.isPropagationStopped())break e;E_(r,a,f),s=u}}}if($u)throw t=Dp,$u=!1,Dp=null,t}function it(t,e){var n=e[Vp];n===void 0&&(n=e[Vp]=new Set);var i=t+"__bubble";n.has(i)||(zS(e,t,2,!1),n.add(i))}function uh(t,e,n){var i=0;e&&(i|=4),zS(n,t,i,e)}var Rc="_reactListening"+Math.random().toString(36).slice(2);function Al(t){if(!t[Rc]){t[Rc]=!0,W1.forEach(function(n){n!=="selectionchange"&&(KD.has(n)||uh(n,!1,t),uh(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Rc]||(e[Rc]=!0,uh("selectionchange",!1,e))}}function zS(t,e,n,i){switch(xS(e)){case 1:var r=lD;break;case 4:r=cD;break;default:r=qm}n=r.bind(null,e,n,t),r=void 0,!Mp||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function dh(t,e,n,i,r){var s=i;if(!(e&1)&&!(e&2)&&i!==null)e:for(;;){if(i===null)return;var l=i.tag;if(l===3||l===4){var a=i.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(l===4)for(l=i.return;l!==null;){var u=l.tag;if((u===3||u===4)&&(u=l.stateNode.containerInfo,u===r||u.nodeType===8&&u.parentNode===r))return;l=l.return}for(;a!==null;){if(l=xs(a),l===null)return;if(u=l.tag,u===5||u===6){i=s=l;continue e}a=a.parentNode}}i=i.return}aS(function(){var f=s,p=Km(n),m=[];e:{var o=US.get(t);if(o!==void 0){var c=ev,d=t;switch(t){case"keypress":if(ru(n)===0)break e;case"keydown":case"keyup":c=kD;break;case"focusin":d="focus",c=rh;break;case"focusout":d="blur",c=rh;break;case"beforeblur":case"afterblur":c=rh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=h_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=fD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=TD;break;case MS:case DS:case RS:c=gD;break;case IS:c=AD;break;case"scroll":c=uD;break;case"wheel":c=LD;break;case"copy":case"cut":case"paste":c=vD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=g_}var h=(e&4)!==0,g=!h&&t==="scroll",y=h?o!==null?o+"Capture":null:o;h=[];for(var v=f,_;v!==null;){_=v;var b=_.stateNode;if(_.tag===5&&b!==null&&(_=b,y!==null&&(b=Sl(v,y),b!=null&&h.push(Ol(v,b,_)))),g)break;v=v.return}0<h.length&&(o=new c(o,d,null,n,p),m.push({event:o,listeners:h}))}}if(!(e&7)){e:{if(o=t==="mouseover"||t==="pointerover",c=t==="mouseout"||t==="pointerout",o&&n!==Op&&(d=n.relatedTarget||n.fromElement)&&(xs(d)||d[cr]))break e;if((c||o)&&(o=p.window===p?p:(o=p.ownerDocument)?o.defaultView||o.parentWindow:window,c?(d=n.relatedTarget||n.toElement,c=f,d=d?xs(d):null,d!==null&&(g=$s(d),d!==g||d.tag!==5&&d.tag!==6)&&(d=null)):(c=null,d=f),c!==d)){if(h=h_,b="onMouseLeave",y="onMouseEnter",v="mouse",(t==="pointerout"||t==="pointerover")&&(h=g_,b="onPointerLeave",y="onPointerEnter",v="pointer"),g=c==null?o:oo(c),_=d==null?o:oo(d),o=new h(b,v+"leave",c,n,p),o.target=g,o.relatedTarget=_,b=null,xs(p)===f&&(h=new h(y,v+"enter",d,n,p),h.target=_,h.relatedTarget=g,b=h),g=b,c&&d)t:{for(h=c,y=d,v=0,_=h;_;_=Gs(_))v++;for(_=0,b=y;b;b=Gs(b))_++;for(;0<v-_;)h=Gs(h),v--;for(;0<_-v;)y=Gs(y),_--;for(;v--;){if(h===y||y!==null&&h===y.alternate)break t;h=Gs(h),y=Gs(y)}h=null}else h=null;c!==null&&C_(m,o,c,h,!1),d!==null&&g!==null&&C_(m,g,d,h,!0)}}e:{if(o=f?oo(f):window,c=o.nodeName&&o.nodeName.toLowerCase(),c==="select"||c==="input"&&o.type==="file")var x=zD;else if(y_(o))if(TS)x=$D;else{x=BD;var w=ND}else(c=o.nodeName)&&c.toLowerCase()==="input"&&(o.type==="checkbox"||o.type==="radio")&&(x=jD);if(x&&(x=x(t,f))){CS(m,x,n,p);break e}w&&w(t,o,f),t==="focusout"&&(w=o._wrapperState)&&w.controlled&&o.type==="number"&&Ep(o,"number",o.value)}switch(w=f?oo(f):window,t){case"focusin":(y_(w)||w.contentEditable==="true")&&(ro=w,Fp=f,Ka=null);break;case"focusout":Ka=Fp=ro=null;break;case"mousedown":zp=!0;break;case"contextmenu":case"mouseup":case"dragend":zp=!1,S_(m,n,p);break;case"selectionchange":if(WD)break;case"keydown":case"keyup":S_(m,n,p)}var S;if(nv)e:{switch(t){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else io?kS(t,n)&&(C="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(SS&&n.locale!=="ko"&&(io||C!=="onCompositionStart"?C==="onCompositionEnd"&&io&&(S=wS()):(Ur=p,Jm="value"in Ur?Ur.value:Ur.textContent,io=!0)),w=Yu(f,C),0<w.length&&(C=new p_(C,t,null,n,p),m.push({event:C,listeners:w}),S?C.data=S:(S=ES(n),S!==null&&(C.data=S)))),(S=DD?RD(t,n):ID(t,n))&&(f=Yu(f,"onBeforeInput"),0<f.length&&(p=new p_("onBeforeInput","beforeinput",null,n,p),m.push({event:p,listeners:f}),p.data=S))}FS(m,e)})}function Ol(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Yu(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,s=r.stateNode;r.tag===5&&s!==null&&(r=s,s=Sl(t,n),s!=null&&i.unshift(Ol(t,s,r)),s=Sl(t,e),s!=null&&i.push(Ol(t,s,r))),t=t.return}return i}function Gs(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function C_(t,e,n,i,r){for(var s=e._reactName,l=[];n!==null&&n!==i;){var a=n,u=a.alternate,f=a.stateNode;if(u!==null&&u===i)break;a.tag===5&&f!==null&&(a=f,r?(u=Sl(n,s),u!=null&&l.unshift(Ol(n,u,a))):r||(u=Sl(n,s),u!=null&&l.push(Ol(n,u,a)))),n=n.return}l.length!==0&&t.push({event:e,listeners:l})}var QD=/\r\n?/g,ZD=/\u0000|\uFFFD/g;function T_(t){return(typeof t=="string"?t:""+t).replace(QD,`
8
+ `).replace(ZD,"")}function Ic(t,e,n){if(e=T_(e),T_(t)!==e&&n)throw Error(G(425))}function Ku(){}var Np=null,Bp=null;function jp(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var $p=typeof setTimeout=="function"?setTimeout:void 0,XD=typeof clearTimeout=="function"?clearTimeout:void 0,P_=typeof Promise=="function"?Promise:void 0,qD=typeof queueMicrotask=="function"?queueMicrotask:typeof P_<"u"?function(t){return P_.resolve(null).then(t).catch(JD)}:$p;function JD(t){setTimeout(function(){throw t})}function fh(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(i===0){t.removeChild(r),Cl(e);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=r}while(n);Cl(e)}function Vr(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function A_(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Xo=Math.random().toString(36).slice(2),Mi="__reactFiber$"+Xo,Ll="__reactProps$"+Xo,cr="__reactContainer$"+Xo,Vp="__reactEvents$"+Xo,eR="__reactListeners$"+Xo,tR="__reactHandles$"+Xo;function xs(t){var e=t[Mi];if(e)return e;for(var n=t.parentNode;n;){if(e=n[cr]||n[Mi]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=A_(t);t!==null;){if(n=t[Mi])return n;t=A_(t)}return e}t=n,n=t.parentNode}return null}function ec(t){return t=t[Mi]||t[cr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function oo(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(G(33))}function pf(t){return t[Ll]||null}var Hp=[],ao=-1;function is(t){return{current:t}}function ot(t){0>ao||(t.current=Hp[ao],Hp[ao]=null,ao--)}function tt(t,e){ao++,Hp[ao]=t.current,t.current=e}var qr={},on=is(qr),xn=is(!1),Ds=qr;function Ro(t,e){var n=t.type.contextTypes;if(!n)return qr;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in n)r[s]=e[s];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=r),r}function wn(t){return t=t.childContextTypes,t!=null}function Qu(){ot(xn),ot(on)}function O_(t,e,n){if(on.current!==qr)throw Error(G(168));tt(on,e),tt(xn,n)}function NS(t,e,n){var i=t.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(G(108,NM(t)||"Unknown",r));return mt({},n,i)}function Zu(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||qr,Ds=on.current,tt(on,t),tt(xn,xn.current),!0}function L_(t,e,n){var i=t.stateNode;if(!i)throw Error(G(169));n?(t=NS(t,e,Ds),i.__reactInternalMemoizedMergedChildContext=t,ot(xn),ot(on),tt(on,t)):ot(xn),tt(xn,n)}var Ji=null,gf=!1,hh=!1;function BS(t){Ji===null?Ji=[t]:Ji.push(t)}function nR(t){gf=!0,BS(t)}function rs(){if(!hh&&Ji!==null){hh=!0;var t=0,e=Ze;try{var n=Ji;for(Ze=1;t<n.length;t++){var i=n[t];do i=i(!0);while(i!==null)}Ji=null,gf=!1}catch(r){throw Ji!==null&&(Ji=Ji.slice(t+1)),dS(Qm,rs),r}finally{Ze=e,hh=!1}}return null}var lo=[],co=0,Xu=null,qu=0,Qn=[],Zn=0,Rs=null,ir=1,rr="";function vs(t,e){lo[co++]=qu,lo[co++]=Xu,Xu=t,qu=e}function jS(t,e,n){Qn[Zn++]=ir,Qn[Zn++]=rr,Qn[Zn++]=Rs,Rs=t;var i=ir;t=rr;var r=32-mi(i)-1;i&=~(1<<r),n+=1;var s=32-mi(e)+r;if(30<s){var l=r-r%5;s=(i&(1<<l)-1).toString(32),i>>=l,r-=l,ir=1<<32-mi(e)+r|n<<r|i,rr=s+t}else ir=1<<s|n<<r|i,rr=t}function rv(t){t.return!==null&&(vs(t,1),jS(t,1,0))}function sv(t){for(;t===Xu;)Xu=lo[--co],lo[co]=null,qu=lo[--co],lo[co]=null;for(;t===Rs;)Rs=Qn[--Zn],Qn[Zn]=null,rr=Qn[--Zn],Qn[Zn]=null,ir=Qn[--Zn],Qn[Zn]=null}var zn=null,Un=null,ct=!1,fi=null;function $S(t,e){var n=Xn(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function M_(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,zn=t,Un=Vr(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,zn=t,Un=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Rs!==null?{id:ir,overflow:rr}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Xn(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,zn=t,Un=null,!0):!1;default:return!1}}function Wp(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Gp(t){if(ct){var e=Un;if(e){var n=e;if(!M_(t,e)){if(Wp(t))throw Error(G(418));e=Vr(n.nextSibling);var i=zn;e&&M_(t,e)?$S(i,n):(t.flags=t.flags&-4097|2,ct=!1,zn=t)}}else{if(Wp(t))throw Error(G(418));t.flags=t.flags&-4097|2,ct=!1,zn=t}}}function D_(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;zn=t}function Uc(t){if(t!==zn)return!1;if(!ct)return D_(t),ct=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!jp(t.type,t.memoizedProps)),e&&(e=Un)){if(Wp(t))throw VS(),Error(G(418));for(;e;)$S(t,e),e=Vr(e.nextSibling)}if(D_(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(G(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Un=Vr(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Un=null}}else Un=zn?Vr(t.stateNode.nextSibling):null;return!0}function VS(){for(var t=Un;t;)t=Vr(t.nextSibling)}function Io(){Un=zn=null,ct=!1}function ov(t){fi===null?fi=[t]:fi.push(t)}var iR=gr.ReactCurrentBatchConfig;function ci(t,e){if(t&&t.defaultProps){e=mt({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}var Ju=is(null),ed=null,uo=null,av=null;function lv(){av=uo=ed=null}function cv(t){var e=Ju.current;ot(Ju),t._currentValue=e}function Yp(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function So(t,e){ed=t,av=uo=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(bn=!0),t.firstContext=null)}function Jn(t){var e=t._currentValue;if(av!==t)if(t={context:t,memoizedValue:e,next:null},uo===null){if(ed===null)throw Error(G(308));uo=t,ed.dependencies={lanes:0,firstContext:t}}else uo=uo.next=t;return e}var ws=null;function uv(t){ws===null?ws=[t]:ws.push(t)}function HS(t,e,n,i){var r=e.interleaved;return r===null?(n.next=n,uv(e)):(n.next=r.next,r.next=n),e.interleaved=n,ur(t,i)}function ur(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var kr=!1;function dv(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function WS(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function or(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Hr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,Ne&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,ur(t,n)}return r=i.interleaved,r===null?(e.next=e,uv(i)):(e.next=r.next,r.next=e),i.interleaved=e,ur(t,n)}function su(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,Zm(t,n)}}function R_(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?r=s=l:s=s.next=l,n=n.next}while(n!==null);s===null?r=s=e:s=s.next=e}else r=s=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function td(t,e,n,i){var r=t.updateQueue;kr=!1;var s=r.firstBaseUpdate,l=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var u=a,f=u.next;u.next=null,l===null?s=f:l.next=f,l=u;var p=t.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==l&&(a===null?p.firstBaseUpdate=f:a.next=f,p.lastBaseUpdate=u))}if(s!==null){var m=r.baseState;l=0,p=f=u=null,a=s;do{var o=a.lane,c=a.eventTime;if((i&o)===o){p!==null&&(p=p.next={eventTime:c,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var d=t,h=a;switch(o=e,c=n,h.tag){case 1:if(d=h.payload,typeof d=="function"){m=d.call(c,m,o);break e}m=d;break e;case 3:d.flags=d.flags&-65537|128;case 0:if(d=h.payload,o=typeof d=="function"?d.call(c,m,o):d,o==null)break e;m=mt({},m,o);break e;case 2:kr=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,o=r.effects,o===null?r.effects=[a]:o.push(a))}else c={eventTime:c,lane:o,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(f=p=c,u=m):p=p.next=c,l|=o;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;o=a,a=o.next,o.next=null,r.lastBaseUpdate=o,r.shared.pending=null}}while(1);if(p===null&&(u=m),r.baseState=u,r.firstBaseUpdate=f,r.lastBaseUpdate=p,e=r.shared.interleaved,e!==null){r=e;do l|=r.lane,r=r.next;while(r!==e)}else s===null&&(r.shared.lanes=0);Us|=l,t.lanes=l,t.memoizedState=m}}function I_(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var i=t[e],r=i.callback;if(r!==null){if(i.callback=null,i=n,typeof r!="function")throw Error(G(191,r));r.call(i)}}}var GS=new H1.Component().refs;function Kp(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:mt({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var mf={isMounted:function(t){return(t=t._reactInternals)?$s(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var i=un(),r=Gr(t),s=or(i,r);s.payload=e,n!=null&&(s.callback=n),e=Hr(t,s,r),e!==null&&(vi(e,t,r,i),su(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=un(),r=Gr(t),s=or(i,r);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=Hr(t,s,r),e!==null&&(vi(e,t,r,i),su(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=un(),i=Gr(t),r=or(n,i);r.tag=2,e!=null&&(r.callback=e),e=Hr(t,r,i),e!==null&&(vi(e,t,i,n),su(e,t,i))}};function U_(t,e,n,i,r,s,l){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,s,l):e.prototype&&e.prototype.isPureReactComponent?!Pl(n,i)||!Pl(r,s):!0}function YS(t,e,n){var i=!1,r=qr,s=e.contextType;return typeof s=="object"&&s!==null?s=Jn(s):(r=wn(e)?Ds:on.current,i=e.contextTypes,s=(i=i!=null)?Ro(t,r):qr),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=mf,t.stateNode=e,e._reactInternals=t,i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=s),e}function F_(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&mf.enqueueReplaceState(e,e.state,null)}function Qp(t,e,n,i){var r=t.stateNode;r.props=n,r.state=t.memoizedState,r.refs=GS,dv(t);var s=e.contextType;typeof s=="object"&&s!==null?r.context=Jn(s):(s=wn(e)?Ds:on.current,r.context=Ro(t,s)),r.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(Kp(t,e,s,n),r.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(e=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),e!==r.state&&mf.enqueueReplaceState(r,r.state,null),td(t,n,r,i),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308)}function ga(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(G(309));var i=n.stateNode}if(!i)throw Error(G(147,t));var r=i,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(l){var a=r.refs;a===GS&&(a=r.refs={}),l===null?delete a[s]:a[s]=l},e._stringRef=s,e)}if(typeof t!="string")throw Error(G(284));if(!n._owner)throw Error(G(290,t))}return t}function Fc(t,e){throw t=Object.prototype.toString.call(e),Error(G(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function z_(t){var e=t._init;return e(t._payload)}function KS(t){function e(y,v){if(t){var _=y.deletions;_===null?(y.deletions=[v],y.flags|=16):_.push(v)}}function n(y,v){if(!t)return null;for(;v!==null;)e(y,v),v=v.sibling;return null}function i(y,v){for(y=new Map;v!==null;)v.key!==null?y.set(v.key,v):y.set(v.index,v),v=v.sibling;return y}function r(y,v){return y=Yr(y,v),y.index=0,y.sibling=null,y}function s(y,v,_){return y.index=_,t?(_=y.alternate,_!==null?(_=_.index,_<v?(y.flags|=2,v):_):(y.flags|=2,v)):(y.flags|=1048576,v)}function l(y){return t&&y.alternate===null&&(y.flags|=2),y}function a(y,v,_,b){return v===null||v.tag!==6?(v=bh(_,y.mode,b),v.return=y,v):(v=r(v,_),v.return=y,v)}function u(y,v,_,b){var x=_.type;return x===no?p(y,v,_.props.children,b,_.key):v!==null&&(v.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Sr&&z_(x)===v.type)?(b=r(v,_.props),b.ref=ga(y,v,_),b.return=y,b):(b=du(_.type,_.key,_.props,null,y.mode,b),b.ref=ga(y,v,_),b.return=y,b)}function f(y,v,_,b){return v===null||v.tag!==4||v.stateNode.containerInfo!==_.containerInfo||v.stateNode.implementation!==_.implementation?(v=xh(_,y.mode,b),v.return=y,v):(v=r(v,_.children||[]),v.return=y,v)}function p(y,v,_,b,x){return v===null||v.tag!==7?(v=As(_,y.mode,b,x),v.return=y,v):(v=r(v,_),v.return=y,v)}function m(y,v,_){if(typeof v=="string"&&v!==""||typeof v=="number")return v=bh(""+v,y.mode,_),v.return=y,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Cc:return _=du(v.type,v.key,v.props,null,y.mode,_),_.ref=ga(y,null,v),_.return=y,_;case to:return v=xh(v,y.mode,_),v.return=y,v;case Sr:var b=v._init;return m(y,b(v._payload),_)}if(Da(v)||ua(v))return v=As(v,y.mode,_,null),v.return=y,v;Fc(y,v)}return null}function o(y,v,_,b){var x=v!==null?v.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return x!==null?null:a(y,v,""+_,b);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Cc:return _.key===x?u(y,v,_,b):null;case to:return _.key===x?f(y,v,_,b):null;case Sr:return x=_._init,o(y,v,x(_._payload),b)}if(Da(_)||ua(_))return x!==null?null:p(y,v,_,b,null);Fc(y,_)}return null}function c(y,v,_,b,x){if(typeof b=="string"&&b!==""||typeof b=="number")return y=y.get(_)||null,a(v,y,""+b,x);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Cc:return y=y.get(b.key===null?_:b.key)||null,u(v,y,b,x);case to:return y=y.get(b.key===null?_:b.key)||null,f(v,y,b,x);case Sr:var w=b._init;return c(y,v,_,w(b._payload),x)}if(Da(b)||ua(b))return y=y.get(_)||null,p(v,y,b,x,null);Fc(v,b)}return null}function d(y,v,_,b){for(var x=null,w=null,S=v,C=v=0,T=null;S!==null&&C<_.length;C++){S.index>C?(T=S,S=null):T=S.sibling;var M=o(y,S,_[C],b);if(M===null){S===null&&(S=T);break}t&&S&&M.alternate===null&&e(y,S),v=s(M,v,C),w===null?x=M:w.sibling=M,w=M,S=T}if(C===_.length)return n(y,S),ct&&vs(y,C),x;if(S===null){for(;C<_.length;C++)S=m(y,_[C],b),S!==null&&(v=s(S,v,C),w===null?x=S:w.sibling=S,w=S);return ct&&vs(y,C),x}for(S=i(y,S);C<_.length;C++)T=c(S,y,C,_[C],b),T!==null&&(t&&T.alternate!==null&&S.delete(T.key===null?C:T.key),v=s(T,v,C),w===null?x=T:w.sibling=T,w=T);return t&&S.forEach(function(B){return e(y,B)}),ct&&vs(y,C),x}function h(y,v,_,b){var x=ua(_);if(typeof x!="function")throw Error(G(150));if(_=x.call(_),_==null)throw Error(G(151));for(var w=x=null,S=v,C=v=0,T=null,M=_.next();S!==null&&!M.done;C++,M=_.next()){S.index>C?(T=S,S=null):T=S.sibling;var B=o(y,S,M.value,b);if(B===null){S===null&&(S=T);break}t&&S&&B.alternate===null&&e(y,S),v=s(B,v,C),w===null?x=B:w.sibling=B,w=B,S=T}if(M.done)return n(y,S),ct&&vs(y,C),x;if(S===null){for(;!M.done;C++,M=_.next())M=m(y,M.value,b),M!==null&&(v=s(M,v,C),w===null?x=M:w.sibling=M,w=M);return ct&&vs(y,C),x}for(S=i(y,S);!M.done;C++,M=_.next())M=c(S,y,C,M.value,b),M!==null&&(t&&M.alternate!==null&&S.delete(M.key===null?C:M.key),v=s(M,v,C),w===null?x=M:w.sibling=M,w=M);return t&&S.forEach(function(F){return e(y,F)}),ct&&vs(y,C),x}function g(y,v,_,b){if(typeof _=="object"&&_!==null&&_.type===no&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Cc:e:{for(var x=_.key,w=v;w!==null;){if(w.key===x){if(x=_.type,x===no){if(w.tag===7){n(y,w.sibling),v=r(w,_.props.children),v.return=y,y=v;break e}}else if(w.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Sr&&z_(x)===w.type){n(y,w.sibling),v=r(w,_.props),v.ref=ga(y,w,_),v.return=y,y=v;break e}n(y,w);break}else e(y,w);w=w.sibling}_.type===no?(v=As(_.props.children,y.mode,b,_.key),v.return=y,y=v):(b=du(_.type,_.key,_.props,null,y.mode,b),b.ref=ga(y,v,_),b.return=y,y=b)}return l(y);case to:e:{for(w=_.key;v!==null;){if(v.key===w)if(v.tag===4&&v.stateNode.containerInfo===_.containerInfo&&v.stateNode.implementation===_.implementation){n(y,v.sibling),v=r(v,_.children||[]),v.return=y,y=v;break e}else{n(y,v);break}else e(y,v);v=v.sibling}v=xh(_,y.mode,b),v.return=y,y=v}return l(y);case Sr:return w=_._init,g(y,v,w(_._payload),b)}if(Da(_))return d(y,v,_,b);if(ua(_))return h(y,v,_,b);Fc(y,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,v!==null&&v.tag===6?(n(y,v.sibling),v=r(v,_),v.return=y,y=v):(n(y,v),v=bh(_,y.mode,b),v.return=y,y=v),l(y)):n(y,v)}return g}var Uo=KS(!0),QS=KS(!1),tc={},Fi=is(tc),Ml=is(tc),Dl=is(tc);function Ss(t){if(t===tc)throw Error(G(174));return t}function fv(t,e){switch(tt(Dl,e),tt(Ml,t),tt(Fi,tc),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Tp(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Tp(e,t)}ot(Fi),tt(Fi,e)}function Fo(){ot(Fi),ot(Ml),ot(Dl)}function ZS(t){Ss(Dl.current);var e=Ss(Fi.current),n=Tp(e,t.type);e!==n&&(tt(Ml,t),tt(Fi,n))}function hv(t){Ml.current===t&&(ot(Fi),ot(Ml))}var pt=is(0);function nd(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var ph=[];function pv(){for(var t=0;t<ph.length;t++)ph[t]._workInProgressVersionPrimary=null;ph.length=0}var ou=gr.ReactCurrentDispatcher,gh=gr.ReactCurrentBatchConfig,Is=0,gt=null,Rt=null,zt=null,id=!1,Qa=!1,Rl=0,rR=0;function Xt(){throw Error(G(321))}function gv(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!_i(t[n],e[n]))return!1;return!0}function mv(t,e,n,i,r,s){if(Is=s,gt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ou.current=t===null||t.memoizedState===null?lR:cR,t=n(i,r),Qa){s=0;do{if(Qa=!1,Rl=0,25<=s)throw Error(G(301));s+=1,zt=Rt=null,e.updateQueue=null,ou.current=uR,t=n(i,r)}while(Qa)}if(ou.current=rd,e=Rt!==null&&Rt.next!==null,Is=0,zt=Rt=gt=null,id=!1,e)throw Error(G(300));return t}function vv(){var t=Rl!==0;return Rl=0,t}function Ti(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?gt.memoizedState=zt=t:zt=zt.next=t,zt}function ei(){if(Rt===null){var t=gt.alternate;t=t!==null?t.memoizedState:null}else t=Rt.next;var e=zt===null?gt.memoizedState:zt.next;if(e!==null)zt=e,Rt=t;else{if(t===null)throw Error(G(310));Rt=t,t={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},zt===null?gt.memoizedState=zt=t:zt=zt.next=t}return zt}function Il(t,e){return typeof e=="function"?e(t):e}function mh(t){var e=ei(),n=e.queue;if(n===null)throw Error(G(311));n.lastRenderedReducer=t;var i=Rt,r=i.baseQueue,s=n.pending;if(s!==null){if(r!==null){var l=r.next;r.next=s.next,s.next=l}i.baseQueue=r=s,n.pending=null}if(r!==null){s=r.next,i=i.baseState;var a=l=null,u=null,f=s;do{var p=f.lane;if((Is&p)===p)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),i=f.hasEagerState?f.eagerState:t(i,f.action);else{var m={lane:p,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(a=u=m,l=i):u=u.next=m,gt.lanes|=p,Us|=p}f=f.next}while(f!==null&&f!==s);u===null?l=i:u.next=a,_i(i,e.memoizedState)||(bn=!0),e.memoizedState=i,e.baseState=l,e.baseQueue=u,n.lastRenderedState=i}if(t=n.interleaved,t!==null){r=t;do s=r.lane,gt.lanes|=s,Us|=s,r=r.next;while(r!==t)}else r===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function vh(t){var e=ei(),n=e.queue;if(n===null)throw Error(G(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,s=e.memoizedState;if(r!==null){n.pending=null;var l=r=r.next;do s=t(s,l.action),l=l.next;while(l!==r);_i(s,e.memoizedState)||(bn=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,i]}function XS(){}function qS(t,e){var n=gt,i=ei(),r=e(),s=!_i(i.memoizedState,r);if(s&&(i.memoizedState=r,bn=!0),i=i.queue,yv(tk.bind(null,n,i,t),[t]),i.getSnapshot!==e||s||zt!==null&&zt.memoizedState.tag&1){if(n.flags|=2048,Ul(9,ek.bind(null,n,i,r,e),void 0,null),Bt===null)throw Error(G(349));Is&30||JS(n,e,r)}return r}function JS(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=gt.updateQueue,e===null?(e={lastEffect:null,stores:null},gt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function ek(t,e,n,i){e.value=n,e.getSnapshot=i,nk(e)&&ik(t)}function tk(t,e,n){return n(function(){nk(e)&&ik(t)})}function nk(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!_i(t,n)}catch{return!0}}function ik(t){var e=ur(t,1);e!==null&&vi(e,t,1,-1)}function N_(t){var e=Ti();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Il,lastRenderedState:t},e.queue=t,t=t.dispatch=aR.bind(null,gt,t),[e.memoizedState,t]}function Ul(t,e,n,i){return t={tag:t,create:e,destroy:n,deps:i,next:null},e=gt.updateQueue,e===null?(e={lastEffect:null,stores:null},gt.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t)),t}function rk(){return ei().memoizedState}function au(t,e,n,i){var r=Ti();gt.flags|=t,r.memoizedState=Ul(1|e,n,void 0,i===void 0?null:i)}function vf(t,e,n,i){var r=ei();i=i===void 0?null:i;var s=void 0;if(Rt!==null){var l=Rt.memoizedState;if(s=l.destroy,i!==null&&gv(i,l.deps)){r.memoizedState=Ul(e,n,s,i);return}}gt.flags|=t,r.memoizedState=Ul(1|e,n,s,i)}function B_(t,e){return au(8390656,8,t,e)}function yv(t,e){return vf(2048,8,t,e)}function sk(t,e){return vf(4,2,t,e)}function ok(t,e){return vf(4,4,t,e)}function ak(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function lk(t,e,n){return n=n!=null?n.concat([t]):null,vf(4,4,ak.bind(null,e,t),n)}function _v(){}function ck(t,e){var n=ei();e=e===void 0?null:e;var i=n.memoizedState;return i!==null&&e!==null&&gv(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function uk(t,e){var n=ei();e=e===void 0?null:e;var i=n.memoizedState;return i!==null&&e!==null&&gv(e,i[1])?i[0]:(t=t(),n.memoizedState=[t,e],t)}function dk(t,e,n){return Is&21?(_i(n,e)||(n=pS(),gt.lanes|=n,Us|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,bn=!0),t.memoizedState=n)}function sR(t,e){var n=Ze;Ze=n!==0&&4>n?n:4,t(!0);var i=gh.transition;gh.transition={};try{t(!1),e()}finally{Ze=n,gh.transition=i}}function fk(){return ei().memoizedState}function oR(t,e,n){var i=Gr(t);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},hk(t))pk(e,n);else if(n=HS(t,e,n,i),n!==null){var r=un();vi(n,t,i,r),gk(n,e,i)}}function aR(t,e,n){var i=Gr(t),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(hk(t))pk(e,r);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var l=e.lastRenderedState,a=s(l,n);if(r.hasEagerState=!0,r.eagerState=a,_i(a,l)){var u=e.interleaved;u===null?(r.next=r,uv(e)):(r.next=u.next,u.next=r),e.interleaved=r;return}}catch{}finally{}n=HS(t,e,r,i),n!==null&&(r=un(),vi(n,t,i,r),gk(n,e,i))}}function hk(t){var e=t.alternate;return t===gt||e!==null&&e===gt}function pk(t,e){Qa=id=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function gk(t,e,n){if(n&4194240){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,Zm(t,n)}}var rd={readContext:Jn,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useInsertionEffect:Xt,useLayoutEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useMutableSource:Xt,useSyncExternalStore:Xt,useId:Xt,unstable_isNewReconciler:!1},lR={readContext:Jn,useCallback:function(t,e){return Ti().memoizedState=[t,e===void 0?null:e],t},useContext:Jn,useEffect:B_,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,au(4194308,4,ak.bind(null,e,t),n)},useLayoutEffect:function(t,e){return au(4194308,4,t,e)},useInsertionEffect:function(t,e){return au(4,2,t,e)},useMemo:function(t,e){var n=Ti();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var i=Ti();return e=n!==void 0?n(e):e,i.memoizedState=i.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},i.queue=t,t=t.dispatch=oR.bind(null,gt,t),[i.memoizedState,t]},useRef:function(t){var e=Ti();return t={current:t},e.memoizedState=t},useState:N_,useDebugValue:_v,useDeferredValue:function(t){return Ti().memoizedState=t},useTransition:function(){var t=N_(!1),e=t[0];return t=sR.bind(null,t[1]),Ti().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var i=gt,r=Ti();if(ct){if(n===void 0)throw Error(G(407));n=n()}else{if(n=e(),Bt===null)throw Error(G(349));Is&30||JS(i,e,n)}r.memoizedState=n;var s={value:n,getSnapshot:e};return r.queue=s,B_(tk.bind(null,i,s,t),[t]),i.flags|=2048,Ul(9,ek.bind(null,i,s,n,e),void 0,null),n},useId:function(){var t=Ti(),e=Bt.identifierPrefix;if(ct){var n=rr,i=ir;n=(i&~(1<<32-mi(i)-1)).toString(32)+n,e=":"+e+"R"+n,n=Rl++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=rR++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},cR={readContext:Jn,useCallback:ck,useContext:Jn,useEffect:yv,useImperativeHandle:lk,useInsertionEffect:sk,useLayoutEffect:ok,useMemo:uk,useReducer:mh,useRef:rk,useState:function(){return mh(Il)},useDebugValue:_v,useDeferredValue:function(t){var e=ei();return dk(e,Rt.memoizedState,t)},useTransition:function(){var t=mh(Il)[0],e=ei().memoizedState;return[t,e]},useMutableSource:XS,useSyncExternalStore:qS,useId:fk,unstable_isNewReconciler:!1},uR={readContext:Jn,useCallback:ck,useContext:Jn,useEffect:yv,useImperativeHandle:lk,useInsertionEffect:sk,useLayoutEffect:ok,useMemo:uk,useReducer:vh,useRef:rk,useState:function(){return vh(Il)},useDebugValue:_v,useDeferredValue:function(t){var e=ei();return Rt===null?e.memoizedState=t:dk(e,Rt.memoizedState,t)},useTransition:function(){var t=vh(Il)[0],e=ei().memoizedState;return[t,e]},useMutableSource:XS,useSyncExternalStore:qS,useId:fk,unstable_isNewReconciler:!1};function zo(t,e){try{var n="",i=e;do n+=zM(i),i=i.return;while(i);var r=n}catch(s){r=`
9
+ Error generating stack: `+s.message+`
10
+ `+s.stack}return{value:t,source:e,stack:r,digest:null}}function yh(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Zp(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var dR=typeof WeakMap=="function"?WeakMap:Map;function mk(t,e,n){n=or(-1,n),n.tag=3,n.payload={element:null};var i=e.value;return n.callback=function(){od||(od=!0,og=i),Zp(t,e)},n}function vk(t,e,n){n=or(-1,n),n.tag=3;var i=t.type.getDerivedStateFromError;if(typeof i=="function"){var r=e.value;n.payload=function(){return i(r)},n.callback=function(){Zp(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Zp(t,e),typeof i!="function"&&(Wr===null?Wr=new Set([this]):Wr.add(this));var l=e.stack;this.componentDidCatch(e.value,{componentStack:l!==null?l:""})}),n}function j_(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new dR;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(r.add(n),t=ER.bind(null,t,e,n),e.then(t,t))}function $_(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function V_(t,e,n,i,r){return t.mode&1?(t.flags|=65536,t.lanes=r,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=or(-1,1),e.tag=2,Hr(n,e,1))),n.lanes|=1),t)}var fR=gr.ReactCurrentOwner,bn=!1;function ln(t,e,n,i){e.child=t===null?QS(e,null,n,i):Uo(e,t.child,n,i)}function H_(t,e,n,i,r){n=n.render;var s=e.ref;return So(e,r),i=mv(t,e,n,i,s,r),n=vv(),t!==null&&!bn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,dr(t,e,r)):(ct&&n&&rv(e),e.flags|=1,ln(t,e,i,r),e.child)}function W_(t,e,n,i,r){if(t===null){var s=n.type;return typeof s=="function"&&!Tv(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,yk(t,e,s,i,r)):(t=du(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&r)){var l=s.memoizedProps;if(n=n.compare,n=n!==null?n:Pl,n(l,i)&&t.ref===e.ref)return dr(t,e,r)}return e.flags|=1,t=Yr(s,i),t.ref=e.ref,t.return=e,e.child=t}function yk(t,e,n,i,r){if(t!==null){var s=t.memoizedProps;if(Pl(s,i)&&t.ref===e.ref)if(bn=!1,e.pendingProps=i=s,(t.lanes&r)!==0)t.flags&131072&&(bn=!0);else return e.lanes=t.lanes,dr(t,e,r)}return Xp(t,e,n,i,r)}function _k(t,e,n){var i=e.pendingProps,r=i.children,s=t!==null?t.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},tt(ho,Mn),Mn|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,tt(ho,Mn),Mn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:n,tt(ho,Mn),Mn|=i}else s!==null?(i=s.baseLanes|n,e.memoizedState=null):i=n,tt(ho,Mn),Mn|=i;return ln(t,e,r,n),e.child}function bk(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Xp(t,e,n,i,r){var s=wn(n)?Ds:on.current;return s=Ro(e,s),So(e,r),n=mv(t,e,n,i,s,r),i=vv(),t!==null&&!bn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,dr(t,e,r)):(ct&&i&&rv(e),e.flags|=1,ln(t,e,n,r),e.child)}function G_(t,e,n,i,r){if(wn(n)){var s=!0;Zu(e)}else s=!1;if(So(e,r),e.stateNode===null)lu(t,e),YS(e,n,i),Qp(e,n,i,r),i=!0;else if(t===null){var l=e.stateNode,a=e.memoizedProps;l.props=a;var u=l.context,f=n.contextType;typeof f=="object"&&f!==null?f=Jn(f):(f=wn(n)?Ds:on.current,f=Ro(e,f));var p=n.getDerivedStateFromProps,m=typeof p=="function"||typeof l.getSnapshotBeforeUpdate=="function";m||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==i||u!==f)&&F_(e,l,i,f),kr=!1;var o=e.memoizedState;l.state=o,td(e,i,l,r),u=e.memoizedState,a!==i||o!==u||xn.current||kr?(typeof p=="function"&&(Kp(e,n,p,i),u=e.memoizedState),(a=kr||U_(e,n,a,i,o,u,f))?(m||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(e.flags|=4194308)):(typeof l.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=u),l.props=i,l.state=u,l.context=f,i=a):(typeof l.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{l=e.stateNode,WS(t,e),a=e.memoizedProps,f=e.type===e.elementType?a:ci(e.type,a),l.props=f,m=e.pendingProps,o=l.context,u=n.contextType,typeof u=="object"&&u!==null?u=Jn(u):(u=wn(n)?Ds:on.current,u=Ro(e,u));var c=n.getDerivedStateFromProps;(p=typeof c=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==m||o!==u)&&F_(e,l,i,u),kr=!1,o=e.memoizedState,l.state=o,td(e,i,l,r);var d=e.memoizedState;a!==m||o!==d||xn.current||kr?(typeof c=="function"&&(Kp(e,n,c,i),d=e.memoizedState),(f=kr||U_(e,n,f,i,o,d,u)||!1)?(p||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(i,d,u),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(i,d,u)),typeof l.componentDidUpdate=="function"&&(e.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof l.componentDidUpdate!="function"||a===t.memoizedProps&&o===t.memoizedState||(e.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&o===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=d),l.props=i,l.state=d,l.context=u,i=f):(typeof l.componentDidUpdate!="function"||a===t.memoizedProps&&o===t.memoizedState||(e.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&o===t.memoizedState||(e.flags|=1024),i=!1)}return qp(t,e,n,i,s,r)}function qp(t,e,n,i,r,s){bk(t,e);var l=(e.flags&128)!==0;if(!i&&!l)return r&&L_(e,n,!1),dr(t,e,s);i=e.stateNode,fR.current=e;var a=l&&typeof n.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,t!==null&&l?(e.child=Uo(e,t.child,null,s),e.child=Uo(e,null,a,s)):ln(t,e,a,s),e.memoizedState=i.state,r&&L_(e,n,!0),e.child}function xk(t){var e=t.stateNode;e.pendingContext?O_(t,e.pendingContext,e.pendingContext!==e.context):e.context&&O_(t,e.context,!1),fv(t,e.containerInfo)}function Y_(t,e,n,i,r){return Io(),ov(r),e.flags|=256,ln(t,e,n,i),e.child}var Jp={dehydrated:null,treeContext:null,retryLane:0};function eg(t){return{baseLanes:t,cachePool:null,transitions:null}}function wk(t,e,n){var i=e.pendingProps,r=pt.current,s=!1,l=(e.flags&128)!==0,a;if((a=l)||(a=t!==null&&t.memoizedState===null?!1:(r&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(r|=1),tt(pt,r&1),t===null)return Gp(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(l=i.children,t=i.fallback,s?(i=e.mode,s=e.child,l={mode:"hidden",children:l},!(i&1)&&s!==null?(s.childLanes=0,s.pendingProps=l):s=bf(l,i,0,null),t=As(t,i,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=eg(n),e.memoizedState=Jp,t):bv(e,l));if(r=t.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return hR(t,e,l,i,a,r,n);if(s){s=i.fallback,l=e.mode,r=t.child,a=r.sibling;var u={mode:"hidden",children:i.children};return!(l&1)&&e.child!==r?(i=e.child,i.childLanes=0,i.pendingProps=u,e.deletions=null):(i=Yr(r,u),i.subtreeFlags=r.subtreeFlags&14680064),a!==null?s=Yr(a,s):(s=As(s,l,n,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,i=s,s=e.child,l=t.child.memoizedState,l=l===null?eg(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=t.childLanes&~n,e.memoizedState=Jp,i}return s=t.child,t=s.sibling,i=Yr(s,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=n),i.return=e,i.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=i,e.memoizedState=null,i}function bv(t,e){return e=bf({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function zc(t,e,n,i){return i!==null&&ov(i),Uo(e,t.child,null,n),t=bv(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function hR(t,e,n,i,r,s,l){if(n)return e.flags&256?(e.flags&=-257,i=yh(Error(G(422))),zc(t,e,l,i)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=i.fallback,r=e.mode,i=bf({mode:"visible",children:i.children},r,0,null),s=As(s,r,l,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,e.mode&1&&Uo(e,t.child,null,l),e.child.memoizedState=eg(l),e.memoizedState=Jp,s);if(!(e.mode&1))return zc(t,e,l,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var a=i.dgst;return i=a,s=Error(G(419)),i=yh(s,i,void 0),zc(t,e,l,i)}if(a=(l&t.childLanes)!==0,bn||a){if(i=Bt,i!==null){switch(l&-l){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(i.suspendedLanes|l)?0:r,r!==0&&r!==s.retryLane&&(s.retryLane=r,ur(t,r),vi(i,t,r,-1))}return Cv(),i=yh(Error(G(421))),zc(t,e,l,i)}return r.data==="$?"?(e.flags|=128,e.child=t.child,e=CR.bind(null,t),r._reactRetry=e,null):(t=s.treeContext,Un=Vr(r.nextSibling),zn=e,ct=!0,fi=null,t!==null&&(Qn[Zn++]=ir,Qn[Zn++]=rr,Qn[Zn++]=Rs,ir=t.id,rr=t.overflow,Rs=e),e=bv(e,i.children),e.flags|=4096,e)}function K_(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),Yp(t.return,e,n)}function _h(t,e,n,i,r){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r)}function Sk(t,e,n){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(ln(t,e,i.children,n),i=pt.current,i&2)i=i&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&K_(t,n,e);else if(t.tag===19)K_(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}if(tt(pt,i),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&nd(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),_h(e,!1,r,n,s);break;case"backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&nd(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}_h(e,!0,n,null,s);break;case"together":_h(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function lu(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function dr(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Us|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(G(153));if(e.child!==null){for(t=e.child,n=Yr(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Yr(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function pR(t,e,n){switch(e.tag){case 3:xk(e),Io();break;case 5:ZS(e);break;case 1:wn(e.type)&&Zu(e);break;case 4:fv(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,r=e.memoizedProps.value;tt(Ju,i._currentValue),i._currentValue=r;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(tt(pt,pt.current&1),e.flags|=128,null):n&e.child.childLanes?wk(t,e,n):(tt(pt,pt.current&1),t=dr(t,e,n),t!==null?t.sibling:null);tt(pt,pt.current&1);break;case 19:if(i=(n&e.childLanes)!==0,t.flags&128){if(i)return Sk(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),tt(pt,pt.current),i)break;return null;case 22:case 23:return e.lanes=0,_k(t,e,n)}return dr(t,e,n)}var kk,tg,Ek,Ck;kk=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};tg=function(){};Ek=function(t,e,n,i){var r=t.memoizedProps;if(r!==i){t=e.stateNode,Ss(Fi.current);var s=null;switch(n){case"input":r=Sp(t,r),i=Sp(t,i),s=[];break;case"select":r=mt({},r,{value:void 0}),i=mt({},i,{value:void 0}),s=[];break;case"textarea":r=Cp(t,r),i=Cp(t,i),s=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(t.onclick=Ku)}Pp(n,i);var l;n=null;for(f in r)if(!i.hasOwnProperty(f)&&r.hasOwnProperty(f)&&r[f]!=null)if(f==="style"){var a=r[f];for(l in a)a.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(xl.hasOwnProperty(f)?s||(s=[]):(s=s||[]).push(f,null));for(f in i){var u=i[f];if(a=r?.[f],i.hasOwnProperty(f)&&u!==a&&(u!=null||a!=null))if(f==="style")if(a){for(l in a)!a.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in u)u.hasOwnProperty(l)&&a[l]!==u[l]&&(n||(n={}),n[l]=u[l])}else n||(s||(s=[]),s.push(f,n)),n=u;else f==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(s=s||[]).push(f,u)):f==="children"?typeof u!="string"&&typeof u!="number"||(s=s||[]).push(f,""+u):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(xl.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&it("scroll",t),s||a===u||(s=[])):(s=s||[]).push(f,u))}n&&(s=s||[]).push("style",n);var f=s;(e.updateQueue=f)&&(e.flags|=4)}};Ck=function(t,e,n,i){n!==i&&(e.flags|=4)};function ma(t,e){if(!ct)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function qt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&14680064,i|=r.flags&14680064,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function gR(t,e,n){var i=e.pendingProps;switch(sv(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qt(e),null;case 1:return wn(e.type)&&Qu(),qt(e),null;case 3:return i=e.stateNode,Fo(),ot(xn),ot(on),pv(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(Uc(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,fi!==null&&(cg(fi),fi=null))),tg(t,e),qt(e),null;case 5:hv(e);var r=Ss(Dl.current);if(n=e.type,t!==null&&e.stateNode!=null)Ek(t,e,n,i,r),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(G(166));return qt(e),null}if(t=Ss(Fi.current),Uc(e)){i=e.stateNode,n=e.type;var s=e.memoizedProps;switch(i[Mi]=e,i[Ll]=s,t=(e.mode&1)!==0,n){case"dialog":it("cancel",i),it("close",i);break;case"iframe":case"object":case"embed":it("load",i);break;case"video":case"audio":for(r=0;r<Ia.length;r++)it(Ia[r],i);break;case"source":it("error",i);break;case"img":case"image":case"link":it("error",i),it("load",i);break;case"details":it("toggle",i);break;case"input":i_(i,s),it("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!s.multiple},it("invalid",i);break;case"textarea":s_(i,s),it("invalid",i)}Pp(n,s),r=null;for(var l in s)if(s.hasOwnProperty(l)){var a=s[l];l==="children"?typeof a=="string"?i.textContent!==a&&(s.suppressHydrationWarning!==!0&&Ic(i.textContent,a,t),r=["children",a]):typeof a=="number"&&i.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Ic(i.textContent,a,t),r=["children",""+a]):xl.hasOwnProperty(l)&&a!=null&&l==="onScroll"&&it("scroll",i)}switch(n){case"input":Tc(i),r_(i,s,!0);break;case"textarea":Tc(i),o_(i);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(i.onclick=Ku)}i=r,e.updateQueue=i,i!==null&&(e.flags|=4)}else{l=r.nodeType===9?r:r.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=J1(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=l.createElement("div"),t.innerHTML="<script></script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=l.createElement(n,{is:i.is}):(t=l.createElement(n),n==="select"&&(l=t,i.multiple?l.multiple=!0:i.size&&(l.size=i.size))):t=l.createElementNS(t,n),t[Mi]=e,t[Ll]=i,kk(t,e,!1,!1),e.stateNode=t;e:{switch(l=Ap(n,i),n){case"dialog":it("cancel",t),it("close",t),r=i;break;case"iframe":case"object":case"embed":it("load",t),r=i;break;case"video":case"audio":for(r=0;r<Ia.length;r++)it(Ia[r],t);r=i;break;case"source":it("error",t),r=i;break;case"img":case"image":case"link":it("error",t),it("load",t),r=i;break;case"details":it("toggle",t),r=i;break;case"input":i_(t,i),r=Sp(t,i),it("invalid",t);break;case"option":r=i;break;case"select":t._wrapperState={wasMultiple:!!i.multiple},r=mt({},i,{value:void 0}),it("invalid",t);break;case"textarea":s_(t,i),r=Cp(t,i),it("invalid",t);break;default:r=i}Pp(n,r),a=r;for(s in a)if(a.hasOwnProperty(s)){var u=a[s];s==="style"?nS(t,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&eS(t,u)):s==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&wl(t,u):typeof u=="number"&&wl(t,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(xl.hasOwnProperty(s)?u!=null&&s==="onScroll"&&it("scroll",t):u!=null&&Hm(t,s,u,l))}switch(n){case"input":Tc(t),r_(t,i,!1);break;case"textarea":Tc(t),o_(t);break;case"option":i.value!=null&&t.setAttribute("value",""+Xr(i.value));break;case"select":t.multiple=!!i.multiple,s=i.value,s!=null?_o(t,!!i.multiple,s,!1):i.defaultValue!=null&&_o(t,!!i.multiple,i.defaultValue,!0);break;default:typeof r.onClick=="function"&&(t.onclick=Ku)}switch(n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return qt(e),null;case 6:if(t&&e.stateNode!=null)Ck(t,e,t.memoizedProps,i);else{if(typeof i!="string"&&e.stateNode===null)throw Error(G(166));if(n=Ss(Dl.current),Ss(Fi.current),Uc(e)){if(i=e.stateNode,n=e.memoizedProps,i[Mi]=e,(s=i.nodeValue!==n)&&(t=zn,t!==null))switch(t.tag){case 3:Ic(i.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Ic(i.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Mi]=e,e.stateNode=i}return qt(e),null;case 13:if(ot(pt),i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ct&&Un!==null&&e.mode&1&&!(e.flags&128))VS(),Io(),e.flags|=98560,s=!1;else if(s=Uc(e),i!==null&&i.dehydrated!==null){if(t===null){if(!s)throw Error(G(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(G(317));s[Mi]=e}else Io(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;qt(e),s=!1}else fi!==null&&(cg(fi),fi=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(i=i!==null,i!==(t!==null&&t.memoizedState!==null)&&i&&(e.child.flags|=8192,e.mode&1&&(t===null||pt.current&1?Ut===0&&(Ut=3):Cv())),e.updateQueue!==null&&(e.flags|=4),qt(e),null);case 4:return Fo(),tg(t,e),t===null&&Al(e.stateNode.containerInfo),qt(e),null;case 10:return cv(e.type._context),qt(e),null;case 17:return wn(e.type)&&Qu(),qt(e),null;case 19:if(ot(pt),s=e.memoizedState,s===null)return qt(e),null;if(i=(e.flags&128)!==0,l=s.rendering,l===null)if(i)ma(s,!1);else{if(Ut!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(l=nd(t),l!==null){for(e.flags|=128,ma(s,!1),i=l.updateQueue,i!==null&&(e.updateQueue=i,e.flags|=4),e.subtreeFlags=0,i=n,n=e.child;n!==null;)s=n,t=i,s.flags&=14680066,l=s.alternate,l===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,t=l.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return tt(pt,pt.current&1|2),e.child}t=t.sibling}s.tail!==null&&Tt()>No&&(e.flags|=128,i=!0,ma(s,!1),e.lanes=4194304)}else{if(!i)if(t=nd(l),t!==null){if(e.flags|=128,i=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),ma(s,!0),s.tail===null&&s.tailMode==="hidden"&&!l.alternate&&!ct)return qt(e),null}else 2*Tt()-s.renderingStartTime>No&&n!==1073741824&&(e.flags|=128,i=!0,ma(s,!1),e.lanes=4194304);s.isBackwards?(l.sibling=e.child,e.child=l):(n=s.last,n!==null?n.sibling=l:e.child=l,s.last=l)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Tt(),e.sibling=null,n=pt.current,tt(pt,i?n&1|2:n&1),e):(qt(e),null);case 22:case 23:return Ev(),i=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Mn&1073741824&&(qt(e),e.subtreeFlags&6&&(e.flags|=8192)):qt(e),null;case 24:return null;case 25:return null}throw Error(G(156,e.tag))}function mR(t,e){switch(sv(e),e.tag){case 1:return wn(e.type)&&Qu(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Fo(),ot(xn),ot(on),pv(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return hv(e),null;case 13:if(ot(pt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(G(340));Io()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ot(pt),null;case 4:return Fo(),null;case 10:return cv(e.type._context),null;case 22:case 23:return Ev(),null;case 24:return null;default:return null}}var Nc=!1,nn=!1,vR=typeof WeakSet=="function"?WeakSet:Set,ne=null;function fo(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){bt(t,e,i)}else n.current=null}function ng(t,e,n){try{n()}catch(i){bt(t,e,i)}}var Q_=!1;function yR(t,e){if(Np=Wu,t=OS(),iv(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var l=0,a=-1,u=-1,f=0,p=0,m=t,o=null;t:for(;;){for(var c;m!==n||r!==0&&m.nodeType!==3||(a=l+r),m!==s||i!==0&&m.nodeType!==3||(u=l+i),m.nodeType===3&&(l+=m.nodeValue.length),(c=m.firstChild)!==null;)o=m,m=c;for(;;){if(m===t)break t;if(o===n&&++f===r&&(a=l),o===s&&++p===i&&(u=l),(c=m.nextSibling)!==null)break;m=o,o=m.parentNode}m=c}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bp={focusedElem:t,selectionRange:n},Wu=!1,ne=e;ne!==null;)if(e=ne,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ne=t;else for(;ne!==null;){e=ne;try{var d=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(d!==null){var h=d.memoizedProps,g=d.memoizedState,y=e.stateNode,v=y.getSnapshotBeforeUpdate(e.elementType===e.type?h:ci(e.type,h),g);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var _=e.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(b){bt(e,e.return,b)}if(t=e.sibling,t!==null){t.return=e.return,ne=t;break}ne=e.return}return d=Q_,Q_=!1,d}function Za(t,e,n){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&t)===t){var s=r.destroy;r.destroy=void 0,s!==void 0&&ng(e,n,s)}r=r.next}while(r!==i)}}function yf(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==e)}}function ig(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function Tk(t){var e=t.alternate;e!==null&&(t.alternate=null,Tk(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Mi],delete e[Ll],delete e[Vp],delete e[eR],delete e[tR])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Pk(t){return t.tag===5||t.tag===3||t.tag===4}function Z_(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Pk(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function rg(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Ku));else if(i!==4&&(t=t.child,t!==null))for(rg(t,e,n),t=t.sibling;t!==null;)rg(t,e,n),t=t.sibling}function sg(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(sg(t,e,n),t=t.sibling;t!==null;)sg(t,e,n),t=t.sibling}var Wt=null,ui=!1;function xr(t,e,n){for(n=n.child;n!==null;)Ak(t,e,n),n=n.sibling}function Ak(t,e,n){if(Ui&&typeof Ui.onCommitFiberUnmount=="function")try{Ui.onCommitFiberUnmount(uf,n)}catch{}switch(n.tag){case 5:nn||fo(n,e);case 6:var i=Wt,r=ui;Wt=null,xr(t,e,n),Wt=i,ui=r,Wt!==null&&(ui?(t=Wt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Wt.removeChild(n.stateNode));break;case 18:Wt!==null&&(ui?(t=Wt,n=n.stateNode,t.nodeType===8?fh(t.parentNode,n):t.nodeType===1&&fh(t,n),Cl(t)):fh(Wt,n.stateNode));break;case 4:i=Wt,r=ui,Wt=n.stateNode.containerInfo,ui=!0,xr(t,e,n),Wt=i,ui=r;break;case 0:case 11:case 14:case 15:if(!nn&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,l=s.destroy;s=s.tag,l!==void 0&&(s&2||s&4)&&ng(n,e,l),r=r.next}while(r!==i)}xr(t,e,n);break;case 1:if(!nn&&(fo(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(a){bt(n,e,a)}xr(t,e,n);break;case 21:xr(t,e,n);break;case 22:n.mode&1?(nn=(i=nn)||n.memoizedState!==null,xr(t,e,n),nn=i):xr(t,e,n);break;default:xr(t,e,n)}}function X_(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new vR),e.forEach(function(i){var r=TR.bind(null,t,i);n.has(i)||(n.add(i),i.then(r,r))})}}function oi(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i];try{var s=t,l=e,a=l;e:for(;a!==null;){switch(a.tag){case 5:Wt=a.stateNode,ui=!1;break e;case 3:Wt=a.stateNode.containerInfo,ui=!0;break e;case 4:Wt=a.stateNode.containerInfo,ui=!0;break e}a=a.return}if(Wt===null)throw Error(G(160));Ak(s,l,r),Wt=null,ui=!1;var u=r.alternate;u!==null&&(u.return=null),r.return=null}catch(f){bt(r,e,f)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)Ok(e,t),e=e.sibling}function Ok(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(oi(e,t),wi(t),i&4){try{Za(3,t,t.return),yf(3,t)}catch(h){bt(t,t.return,h)}try{Za(5,t,t.return)}catch(h){bt(t,t.return,h)}}break;case 1:oi(e,t),wi(t),i&512&&n!==null&&fo(n,n.return);break;case 5:if(oi(e,t),wi(t),i&512&&n!==null&&fo(n,n.return),t.flags&32){var r=t.stateNode;try{wl(r,"")}catch(h){bt(t,t.return,h)}}if(i&4&&(r=t.stateNode,r!=null)){var s=t.memoizedProps,l=n!==null?n.memoizedProps:s,a=t.type,u=t.updateQueue;if(t.updateQueue=null,u!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&X1(r,s),Ap(a,l);var f=Ap(a,s);for(l=0;l<u.length;l+=2){var p=u[l],m=u[l+1];p==="style"?nS(r,m):p==="dangerouslySetInnerHTML"?eS(r,m):p==="children"?wl(r,m):Hm(r,p,m,f)}switch(a){case"input":kp(r,s);break;case"textarea":q1(r,s);break;case"select":var o=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!s.multiple;var c=s.value;c!=null?_o(r,!!s.multiple,c,!1):o!==!!s.multiple&&(s.defaultValue!=null?_o(r,!!s.multiple,s.defaultValue,!0):_o(r,!!s.multiple,s.multiple?[]:"",!1))}r[Ll]=s}catch(h){bt(t,t.return,h)}}break;case 6:if(oi(e,t),wi(t),i&4){if(t.stateNode===null)throw Error(G(162));r=t.stateNode,s=t.memoizedProps;try{r.nodeValue=s}catch(h){bt(t,t.return,h)}}break;case 3:if(oi(e,t),wi(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Cl(e.containerInfo)}catch(h){bt(t,t.return,h)}break;case 4:oi(e,t),wi(t);break;case 13:oi(e,t),wi(t),r=t.child,r.flags&8192&&(s=r.memoizedState!==null,r.stateNode.isHidden=s,!s||r.alternate!==null&&r.alternate.memoizedState!==null||(Sv=Tt())),i&4&&X_(t);break;case 22:if(p=n!==null&&n.memoizedState!==null,t.mode&1?(nn=(f=nn)||p,oi(e,t),nn=f):oi(e,t),wi(t),i&8192){if(f=t.memoizedState!==null,(t.stateNode.isHidden=f)&&!p&&t.mode&1)for(ne=t,p=t.child;p!==null;){for(m=ne=p;ne!==null;){switch(o=ne,c=o.child,o.tag){case 0:case 11:case 14:case 15:Za(4,o,o.return);break;case 1:fo(o,o.return);var d=o.stateNode;if(typeof d.componentWillUnmount=="function"){i=o,n=o.return;try{e=i,d.props=e.memoizedProps,d.state=e.memoizedState,d.componentWillUnmount()}catch(h){bt(i,n,h)}}break;case 5:fo(o,o.return);break;case 22:if(o.memoizedState!==null){J_(m);continue}}c!==null?(c.return=o,ne=c):J_(m)}p=p.sibling}e:for(p=null,m=t;;){if(m.tag===5){if(p===null){p=m;try{r=m.stateNode,f?(s=r.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=m.stateNode,u=m.memoizedProps.style,l=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=tS("display",l))}catch(h){bt(t,t.return,h)}}}else if(m.tag===6){if(p===null)try{m.stateNode.nodeValue=f?"":m.memoizedProps}catch(h){bt(t,t.return,h)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===t)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;p===m&&(p=null),m=m.return}p===m&&(p=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:oi(e,t),wi(t),i&4&&X_(t);break;case 21:break;default:oi(e,t),wi(t)}}function wi(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(Pk(n)){var i=n;break e}n=n.return}throw Error(G(160))}switch(i.tag){case 5:var r=i.stateNode;i.flags&32&&(wl(r,""),i.flags&=-33);var s=Z_(t);sg(t,s,r);break;case 3:case 4:var l=i.stateNode.containerInfo,a=Z_(t);rg(t,a,l);break;default:throw Error(G(161))}}catch(u){bt(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function _R(t,e,n){ne=t,Lk(t)}function Lk(t,e,n){for(var i=(t.mode&1)!==0;ne!==null;){var r=ne,s=r.child;if(r.tag===22&&i){var l=r.memoizedState!==null||Nc;if(!l){var a=r.alternate,u=a!==null&&a.memoizedState!==null||nn;a=Nc;var f=nn;if(Nc=l,(nn=u)&&!f)for(ne=r;ne!==null;)l=ne,u=l.child,l.tag===22&&l.memoizedState!==null?eb(r):u!==null?(u.return=l,ne=u):eb(r);for(;s!==null;)ne=s,Lk(s),s=s.sibling;ne=r,Nc=a,nn=f}q_(t)}else r.subtreeFlags&8772&&s!==null?(s.return=r,ne=s):q_(t)}}function q_(t){for(;ne!==null;){var e=ne;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:nn||yf(5,e);break;case 1:var i=e.stateNode;if(e.flags&4&&!nn)if(n===null)i.componentDidMount();else{var r=e.elementType===e.type?n.memoizedProps:ci(e.type,n.memoizedProps);i.componentDidUpdate(r,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&I_(e,s,i);break;case 3:var l=e.updateQueue;if(l!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}I_(e,l,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var u=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var f=e.alternate;if(f!==null){var p=f.memoizedState;if(p!==null){var m=p.dehydrated;m!==null&&Cl(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}nn||e.flags&512&&ig(e)}catch(o){bt(e,e.return,o)}}if(e===t){ne=null;break}if(n=e.sibling,n!==null){n.return=e.return,ne=n;break}ne=e.return}}function J_(t){for(;ne!==null;){var e=ne;if(e===t){ne=null;break}var n=e.sibling;if(n!==null){n.return=e.return,ne=n;break}ne=e.return}}function eb(t){for(;ne!==null;){var e=ne;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{yf(4,e)}catch(u){bt(e,n,u)}break;case 1:var i=e.stateNode;if(typeof i.componentDidMount=="function"){var r=e.return;try{i.componentDidMount()}catch(u){bt(e,r,u)}}var s=e.return;try{ig(e)}catch(u){bt(e,s,u)}break;case 5:var l=e.return;try{ig(e)}catch(u){bt(e,l,u)}}}catch(u){bt(e,e.return,u)}if(e===t){ne=null;break}var a=e.sibling;if(a!==null){a.return=e.return,ne=a;break}ne=e.return}}var bR=Math.ceil,sd=gr.ReactCurrentDispatcher,xv=gr.ReactCurrentOwner,qn=gr.ReactCurrentBatchConfig,Ne=0,Bt=null,Mt=null,Kt=0,Mn=0,ho=is(0),Ut=0,Fl=null,Us=0,_f=0,wv=0,Xa=null,yn=null,Sv=0,No=1/0,Xi=null,od=!1,og=null,Wr=null,Bc=!1,Fr=null,ad=0,qa=0,ag=null,cu=-1,uu=0;function un(){return Ne&6?Tt():cu!==-1?cu:cu=Tt()}function Gr(t){return t.mode&1?Ne&2&&Kt!==0?Kt&-Kt:iR.transition!==null?(uu===0&&(uu=pS()),uu):(t=Ze,t!==0||(t=window.event,t=t===void 0?16:xS(t.type)),t):1}function vi(t,e,n,i){if(50<qa)throw qa=0,ag=null,Error(G(185));ql(t,n,i),(!(Ne&2)||t!==Bt)&&(t===Bt&&(!(Ne&2)&&(_f|=n),Ut===4&&Pr(t,Kt)),Sn(t,i),n===1&&Ne===0&&!(e.mode&1)&&(No=Tt()+500,gf&&rs()))}function Sn(t,e){var n=t.callbackNode;iD(t,e);var i=Hu(t,t===Bt?Kt:0);if(i===0)n!==null&&c_(n),t.callbackNode=null,t.callbackPriority=0;else if(e=i&-i,t.callbackPriority!==e){if(n!=null&&c_(n),e===1)t.tag===0?nR(tb.bind(null,t)):BS(tb.bind(null,t)),qD(function(){!(Ne&6)&&rs()}),n=null;else{switch(gS(i)){case 1:n=Qm;break;case 4:n=fS;break;case 16:n=Vu;break;case 536870912:n=hS;break;default:n=Vu}n=Nk(n,Mk.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function Mk(t,e){if(cu=-1,uu=0,Ne&6)throw Error(G(327));var n=t.callbackNode;if(ko()&&t.callbackNode!==n)return null;var i=Hu(t,t===Bt?Kt:0);if(i===0)return null;if(i&30||i&t.expiredLanes||e)e=ld(t,i);else{e=i;var r=Ne;Ne|=2;var s=Rk();(Bt!==t||Kt!==e)&&(Xi=null,No=Tt()+500,Ps(t,e));do try{SR();break}catch(a){Dk(t,a)}while(1);lv(),sd.current=s,Ne=r,Mt!==null?e=0:(Bt=null,Kt=0,e=Ut)}if(e!==0){if(e===2&&(r=Rp(t),r!==0&&(i=r,e=lg(t,r))),e===1)throw n=Fl,Ps(t,0),Pr(t,i),Sn(t,Tt()),n;if(e===6)Pr(t,i);else{if(r=t.current.alternate,!(i&30)&&!xR(r)&&(e=ld(t,i),e===2&&(s=Rp(t),s!==0&&(i=s,e=lg(t,s))),e===1))throw n=Fl,Ps(t,0),Pr(t,i),Sn(t,Tt()),n;switch(t.finishedWork=r,t.finishedLanes=i,e){case 0:case 1:throw Error(G(345));case 2:ys(t,yn,Xi);break;case 3:if(Pr(t,i),(i&130023424)===i&&(e=Sv+500-Tt(),10<e)){if(Hu(t,0)!==0)break;if(r=t.suspendedLanes,(r&i)!==i){un(),t.pingedLanes|=t.suspendedLanes&r;break}t.timeoutHandle=$p(ys.bind(null,t,yn,Xi),e);break}ys(t,yn,Xi);break;case 4:if(Pr(t,i),(i&4194240)===i)break;for(e=t.eventTimes,r=-1;0<i;){var l=31-mi(i);s=1<<l,l=e[l],l>r&&(r=l),i&=~s}if(i=r,i=Tt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*bR(i/1960))-i,10<i){t.timeoutHandle=$p(ys.bind(null,t,yn,Xi),i);break}ys(t,yn,Xi);break;case 5:ys(t,yn,Xi);break;default:throw Error(G(329))}}}return Sn(t,Tt()),t.callbackNode===n?Mk.bind(null,t):null}function lg(t,e){var n=Xa;return t.current.memoizedState.isDehydrated&&(Ps(t,e).flags|=256),t=ld(t,e),t!==2&&(e=yn,yn=n,e!==null&&cg(e)),t}function cg(t){yn===null?yn=t:yn.push.apply(yn,t)}function xR(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var i=0;i<n.length;i++){var r=n[i],s=r.getSnapshot;r=r.value;try{if(!_i(s(),r))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Pr(t,e){for(e&=~wv,e&=~_f,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-mi(e),i=1<<n;t[n]=-1,e&=~i}}function tb(t){if(Ne&6)throw Error(G(327));ko();var e=Hu(t,0);if(!(e&1))return Sn(t,Tt()),null;var n=ld(t,e);if(t.tag!==0&&n===2){var i=Rp(t);i!==0&&(e=i,n=lg(t,i))}if(n===1)throw n=Fl,Ps(t,0),Pr(t,e),Sn(t,Tt()),n;if(n===6)throw Error(G(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ys(t,yn,Xi),Sn(t,Tt()),null}function kv(t,e){var n=Ne;Ne|=1;try{return t(e)}finally{Ne=n,Ne===0&&(No=Tt()+500,gf&&rs())}}function Fs(t){Fr!==null&&Fr.tag===0&&!(Ne&6)&&ko();var e=Ne;Ne|=1;var n=qn.transition,i=Ze;try{if(qn.transition=null,Ze=1,t)return t()}finally{Ze=i,qn.transition=n,Ne=e,!(Ne&6)&&rs()}}function Ev(){Mn=ho.current,ot(ho)}function Ps(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,XD(n)),Mt!==null)for(n=Mt.return;n!==null;){var i=n;switch(sv(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Qu();break;case 3:Fo(),ot(xn),ot(on),pv();break;case 5:hv(i);break;case 4:Fo();break;case 13:ot(pt);break;case 19:ot(pt);break;case 10:cv(i.type._context);break;case 22:case 23:Ev()}n=n.return}if(Bt=t,Mt=t=Yr(t.current,null),Kt=Mn=e,Ut=0,Fl=null,wv=_f=Us=0,yn=Xa=null,ws!==null){for(e=0;e<ws.length;e++)if(n=ws[e],i=n.interleaved,i!==null){n.interleaved=null;var r=i.next,s=n.pending;if(s!==null){var l=s.next;s.next=r,i.next=l}n.pending=i}ws=null}return t}function Dk(t,e){do{var n=Mt;try{if(lv(),ou.current=rd,id){for(var i=gt.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}id=!1}if(Is=0,zt=Rt=gt=null,Qa=!1,Rl=0,xv.current=null,n===null||n.return===null){Ut=1,Fl=e,Mt=null;break}e:{var s=t,l=n.return,a=n,u=e;if(e=Kt,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,p=a,m=p.tag;if(!(p.mode&1)&&(m===0||m===11||m===15)){var o=p.alternate;o?(p.updateQueue=o.updateQueue,p.memoizedState=o.memoizedState,p.lanes=o.lanes):(p.updateQueue=null,p.memoizedState=null)}var c=$_(l);if(c!==null){c.flags&=-257,V_(c,l,a,s,e),c.mode&1&&j_(s,f,e),e=c,u=f;var d=e.updateQueue;if(d===null){var h=new Set;h.add(u),e.updateQueue=h}else d.add(u);break e}else{if(!(e&1)){j_(s,f,e),Cv();break e}u=Error(G(426))}}else if(ct&&a.mode&1){var g=$_(l);if(g!==null){!(g.flags&65536)&&(g.flags|=256),V_(g,l,a,s,e),ov(zo(u,a));break e}}s=u=zo(u,a),Ut!==4&&(Ut=2),Xa===null?Xa=[s]:Xa.push(s),s=l;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var y=mk(s,u,e);R_(s,y);break e;case 1:a=u;var v=s.type,_=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Wr===null||!Wr.has(_)))){s.flags|=65536,e&=-e,s.lanes|=e;var b=vk(s,a,e);R_(s,b);break e}}s=s.return}while(s!==null)}Uk(n)}catch(x){e=x,Mt===n&&n!==null&&(Mt=n=n.return);continue}break}while(1)}function Rk(){var t=sd.current;return sd.current=rd,t===null?rd:t}function Cv(){(Ut===0||Ut===3||Ut===2)&&(Ut=4),Bt===null||!(Us&268435455)&&!(_f&268435455)||Pr(Bt,Kt)}function ld(t,e){var n=Ne;Ne|=2;var i=Rk();(Bt!==t||Kt!==e)&&(Xi=null,Ps(t,e));do try{wR();break}catch(r){Dk(t,r)}while(1);if(lv(),Ne=n,sd.current=i,Mt!==null)throw Error(G(261));return Bt=null,Kt=0,Ut}function wR(){for(;Mt!==null;)Ik(Mt)}function SR(){for(;Mt!==null&&!KM();)Ik(Mt)}function Ik(t){var e=zk(t.alternate,t,Mn);t.memoizedProps=t.pendingProps,e===null?Uk(t):Mt=e,xv.current=null}function Uk(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=mR(n,e),n!==null){n.flags&=32767,Mt=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Ut=6,Mt=null;return}}else if(n=gR(n,e,Mn),n!==null){Mt=n;return}if(e=e.sibling,e!==null){Mt=e;return}Mt=e=t}while(e!==null);Ut===0&&(Ut=5)}function ys(t,e,n){var i=Ze,r=qn.transition;try{qn.transition=null,Ze=1,kR(t,e,n,i)}finally{qn.transition=r,Ze=i}return null}function kR(t,e,n,i){do ko();while(Fr!==null);if(Ne&6)throw Error(G(327));n=t.finishedWork;var r=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(G(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(rD(t,s),t===Bt&&(Mt=Bt=null,Kt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Bc||(Bc=!0,Nk(Vu,function(){return ko(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=qn.transition,qn.transition=null;var l=Ze;Ze=1;var a=Ne;Ne|=4,xv.current=null,yR(t,n),Ok(n,t),HD(Bp),Wu=!!Np,Bp=Np=null,t.current=n,_R(n),QM(),Ne=a,Ze=l,qn.transition=s}else t.current=n;if(Bc&&(Bc=!1,Fr=t,ad=r),s=t.pendingLanes,s===0&&(Wr=null),qM(n.stateNode),Sn(t,Tt()),e!==null)for(i=t.onRecoverableError,n=0;n<e.length;n++)r=e[n],i(r.value,{componentStack:r.stack,digest:r.digest});if(od)throw od=!1,t=og,og=null,t;return ad&1&&t.tag!==0&&ko(),s=t.pendingLanes,s&1?t===ag?qa++:(qa=0,ag=t):qa=0,rs(),null}function ko(){if(Fr!==null){var t=gS(ad),e=qn.transition,n=Ze;try{if(qn.transition=null,Ze=16>t?16:t,Fr===null)var i=!1;else{if(t=Fr,Fr=null,ad=0,Ne&6)throw Error(G(331));var r=Ne;for(Ne|=4,ne=t.current;ne!==null;){var s=ne,l=s.child;if(ne.flags&16){var a=s.deletions;if(a!==null){for(var u=0;u<a.length;u++){var f=a[u];for(ne=f;ne!==null;){var p=ne;switch(p.tag){case 0:case 11:case 15:Za(8,p,s)}var m=p.child;if(m!==null)m.return=p,ne=m;else for(;ne!==null;){p=ne;var o=p.sibling,c=p.return;if(Tk(p),p===f){ne=null;break}if(o!==null){o.return=c,ne=o;break}ne=c}}}var d=s.alternate;if(d!==null){var h=d.child;if(h!==null){d.child=null;do{var g=h.sibling;h.sibling=null,h=g}while(h!==null)}}ne=s}}if(s.subtreeFlags&2064&&l!==null)l.return=s,ne=l;else e:for(;ne!==null;){if(s=ne,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Za(9,s,s.return)}var y=s.sibling;if(y!==null){y.return=s.return,ne=y;break e}ne=s.return}}var v=t.current;for(ne=v;ne!==null;){l=ne;var _=l.child;if(l.subtreeFlags&2064&&_!==null)_.return=l,ne=_;else e:for(l=v;ne!==null;){if(a=ne,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:yf(9,a)}}catch(x){bt(a,a.return,x)}if(a===l){ne=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,ne=b;break e}ne=a.return}}if(Ne=r,rs(),Ui&&typeof Ui.onPostCommitFiberRoot=="function")try{Ui.onPostCommitFiberRoot(uf,t)}catch{}i=!0}return i}finally{Ze=n,qn.transition=e}}return!1}function nb(t,e,n){e=zo(n,e),e=mk(t,e,1),t=Hr(t,e,1),e=un(),t!==null&&(ql(t,1,e),Sn(t,e))}function bt(t,e,n){if(t.tag===3)nb(t,t,n);else for(;e!==null;){if(e.tag===3){nb(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Wr===null||!Wr.has(i))){t=zo(n,t),t=vk(e,t,1),e=Hr(e,t,1),t=un(),e!==null&&(ql(e,1,t),Sn(e,t));break}}e=e.return}}function ER(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),e=un(),t.pingedLanes|=t.suspendedLanes&n,Bt===t&&(Kt&n)===n&&(Ut===4||Ut===3&&(Kt&130023424)===Kt&&500>Tt()-Sv?Ps(t,0):wv|=n),Sn(t,e)}function Fk(t,e){e===0&&(t.mode&1?(e=Oc,Oc<<=1,!(Oc&130023424)&&(Oc=4194304)):e=1);var n=un();t=ur(t,e),t!==null&&(ql(t,e,n),Sn(t,n))}function CR(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Fk(t,n)}function TR(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(G(314))}i!==null&&i.delete(e),Fk(t,n)}var zk;zk=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||xn.current)bn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return bn=!1,pR(t,e,n);bn=!!(t.flags&131072)}else bn=!1,ct&&e.flags&1048576&&jS(e,qu,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;lu(t,e),t=e.pendingProps;var r=Ro(e,on.current);So(e,n),r=mv(null,e,i,t,r,n);var s=vv();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,wn(i)?(s=!0,Zu(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,dv(e),r.updater=mf,e.stateNode=r,r._reactInternals=e,Qp(e,i,t,n),e=qp(null,e,i,!0,s,n)):(e.tag=0,ct&&s&&rv(e),ln(null,e,r,n),e=e.child),e;case 16:i=e.elementType;e:{switch(lu(t,e),t=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=AR(i),t=ci(i,t),r){case 0:e=Xp(null,e,i,t,n);break e;case 1:e=G_(null,e,i,t,n);break e;case 11:e=H_(null,e,i,t,n);break e;case 14:e=W_(null,e,i,ci(i.type,t),n);break e}throw Error(G(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:ci(i,r),Xp(t,e,i,r,n);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:ci(i,r),G_(t,e,i,r,n);case 3:e:{if(xk(e),t===null)throw Error(G(387));i=e.pendingProps,s=e.memoizedState,r=s.element,WS(t,e),td(e,i,null,n);var l=e.memoizedState;if(i=l.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=zo(Error(G(423)),e),e=Y_(t,e,i,n,r);break e}else if(i!==r){r=zo(Error(G(424)),e),e=Y_(t,e,i,n,r);break e}else for(Un=Vr(e.stateNode.containerInfo.firstChild),zn=e,ct=!0,fi=null,n=QS(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Io(),i===r){e=dr(t,e,n);break e}ln(t,e,i,n)}e=e.child}return e;case 5:return ZS(e),t===null&&Gp(e),i=e.type,r=e.pendingProps,s=t!==null?t.memoizedProps:null,l=r.children,jp(i,r)?l=null:s!==null&&jp(i,s)&&(e.flags|=32),bk(t,e),ln(t,e,l,n),e.child;case 6:return t===null&&Gp(e),null;case 13:return wk(t,e,n);case 4:return fv(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=Uo(e,null,i,n):ln(t,e,i,n),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:ci(i,r),H_(t,e,i,r,n);case 7:return ln(t,e,e.pendingProps,n),e.child;case 8:return ln(t,e,e.pendingProps.children,n),e.child;case 12:return ln(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,l=r.value,tt(Ju,i._currentValue),i._currentValue=l,s!==null)if(_i(s.value,l)){if(s.children===r.children&&!xn.current){e=dr(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){l=s.child;for(var u=a.firstContext;u!==null;){if(u.context===i){if(s.tag===1){u=or(-1,n&-n),u.tag=2;var f=s.updateQueue;if(f!==null){f=f.shared;var p=f.pending;p===null?u.next=u:(u.next=p.next,p.next=u),f.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),Yp(s.return,n,e),a.lanes|=n;break}u=u.next}}else if(s.tag===10)l=s.type===e.type?null:s.child;else if(s.tag===18){if(l=s.return,l===null)throw Error(G(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),Yp(l,n,e),l=s.sibling}else l=s.child;if(l!==null)l.return=s;else for(l=s;l!==null;){if(l===e){l=null;break}if(s=l.sibling,s!==null){s.return=l.return,l=s;break}l=l.return}s=l}ln(t,e,r.children,n),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,So(e,n),r=Jn(r),i=i(r),e.flags|=1,ln(t,e,i,n),e.child;case 14:return i=e.type,r=ci(i,e.pendingProps),r=ci(i.type,r),W_(t,e,i,r,n);case 15:return yk(t,e,e.type,e.pendingProps,n);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:ci(i,r),lu(t,e),e.tag=1,wn(i)?(t=!0,Zu(e)):t=!1,So(e,n),YS(e,i,r),Qp(e,i,r,n),qp(null,e,i,!0,t,n);case 19:return Sk(t,e,n);case 22:return _k(t,e,n)}throw Error(G(156,e.tag))};function Nk(t,e){return dS(t,e)}function PR(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(t,e,n,i){return new PR(t,e,n,i)}function Tv(t){return t=t.prototype,!(!t||!t.isReactComponent)}function AR(t){if(typeof t=="function")return Tv(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Gm)return 11;if(t===Ym)return 14}return 2}function Yr(t,e){var n=t.alternate;return n===null?(n=Xn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function du(t,e,n,i,r,s){var l=2;if(i=t,typeof t=="function")Tv(t)&&(l=1);else if(typeof t=="string")l=5;else e:switch(t){case no:return As(n.children,r,s,e);case Wm:l=8,r|=8;break;case _p:return t=Xn(12,n,e,r|2),t.elementType=_p,t.lanes=s,t;case bp:return t=Xn(13,n,e,r),t.elementType=bp,t.lanes=s,t;case xp:return t=Xn(19,n,e,r),t.elementType=xp,t.lanes=s,t;case K1:return bf(n,r,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case G1:l=10;break e;case Y1:l=9;break e;case Gm:l=11;break e;case Ym:l=14;break e;case Sr:l=16,i=null;break e}throw Error(G(130,t==null?t:typeof t,""))}return e=Xn(l,n,e,r),e.elementType=t,e.type=i,e.lanes=s,e}function As(t,e,n,i){return t=Xn(7,t,i,e),t.lanes=n,t}function bf(t,e,n,i){return t=Xn(22,t,i,e),t.elementType=K1,t.lanes=n,t.stateNode={isHidden:!1},t}function bh(t,e,n){return t=Xn(6,t,null,e),t.lanes=n,t}function xh(t,e,n){return e=Xn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function OR(t,e,n,i,r){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=th(0),this.expirationTimes=th(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=th(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Pv(t,e,n,i,r,s,l,a,u){return t=new OR(t,e,n,a,u),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Xn(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},dv(s),t}function LR(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:to,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}function Bk(t){if(!t)return qr;t=t._reactInternals;e:{if($s(t)!==t||t.tag!==1)throw Error(G(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(wn(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(G(171))}if(t.tag===1){var n=t.type;if(wn(n))return NS(t,n,e)}return e}function jk(t,e,n,i,r,s,l,a,u){return t=Pv(n,i,!0,t,r,s,l,a,u),t.context=Bk(null),n=t.current,i=un(),r=Gr(n),s=or(i,r),s.callback=e??null,Hr(n,s,r),t.current.lanes=r,ql(t,r,i),Sn(t,i),t}function xf(t,e,n,i){var r=e.current,s=un(),l=Gr(r);return n=Bk(n),e.context===null?e.context=n:e.pendingContext=n,e=or(s,l),e.payload={element:t},i=i===void 0?null:i,i!==null&&(e.callback=i),t=Hr(r,e,l),t!==null&&(vi(t,r,l,s),su(t,r,l)),l}function cd(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function ib(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Av(t,e){ib(t,e),(t=t.alternate)&&ib(t,e)}function MR(){return null}var $k=typeof reportError=="function"?reportError:function(t){console.error(t)};function Ov(t){this._internalRoot=t}wf.prototype.render=Ov.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(G(409));xf(t,e,null,null)};wf.prototype.unmount=Ov.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Fs(function(){xf(null,t,null,null)}),e[cr]=null}};function wf(t){this._internalRoot=t}wf.prototype.unstable_scheduleHydration=function(t){if(t){var e=yS();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Tr.length&&e!==0&&e<Tr[n].priority;n++);Tr.splice(n,0,t),n===0&&bS(t)}};function Lv(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Sf(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function rb(){}function DR(t,e,n,i,r){if(r){if(typeof i=="function"){var s=i;i=function(){var f=cd(l);s.call(f)}}var l=jk(e,i,t,0,null,!1,!1,"",rb);return t._reactRootContainer=l,t[cr]=l.current,Al(t.nodeType===8?t.parentNode:t),Fs(),l}for(;r=t.lastChild;)t.removeChild(r);if(typeof i=="function"){var a=i;i=function(){var f=cd(u);a.call(f)}}var u=Pv(t,0,!1,null,null,!1,!1,"",rb);return t._reactRootContainer=u,t[cr]=u.current,Al(t.nodeType===8?t.parentNode:t),Fs(function(){xf(e,u,n,i)}),u}function kf(t,e,n,i,r){var s=n._reactRootContainer;if(s){var l=s;if(typeof r=="function"){var a=r;r=function(){var u=cd(l);a.call(u)}}xf(e,l,t,r)}else l=DR(n,e,t,r,i);return cd(l)}mS=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Ra(e.pendingLanes);n!==0&&(Zm(e,n|1),Sn(e,Tt()),!(Ne&6)&&(No=Tt()+500,rs()))}break;case 13:Fs(function(){var i=ur(t,1);if(i!==null){var r=un();vi(i,t,1,r)}}),Av(t,1)}};Xm=function(t){if(t.tag===13){var e=ur(t,134217728);if(e!==null){var n=un();vi(e,t,134217728,n)}Av(t,134217728)}};vS=function(t){if(t.tag===13){var e=Gr(t),n=ur(t,e);if(n!==null){var i=un();vi(n,t,e,i)}Av(t,e)}};yS=function(){return Ze};_S=function(t,e){var n=Ze;try{return Ze=t,e()}finally{Ze=n}};Lp=function(t,e,n){switch(e){case"input":if(kp(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=pf(i);if(!r)throw Error(G(90));Z1(i),kp(i,r)}}}break;case"textarea":q1(t,n);break;case"select":e=n.value,e!=null&&_o(t,!!n.multiple,e,!1)}};sS=kv;oS=Fs;var RR={usingClientEntryPoint:!1,Events:[ec,oo,pf,iS,rS,kv]},va={findFiberByHostInstance:xs,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},IR={bundleType:va.bundleType,version:va.version,rendererPackageName:va.rendererPackageName,rendererConfig:va.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:gr.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=cS(t),t===null?null:t.stateNode},findFiberByHostInstance:va.findFiberByHostInstance||MR,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jc.isDisabled&&jc.supportsFiber)try{uf=jc.inject(IR),Ui=jc}catch{}}$n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=RR;$n.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Lv(e))throw Error(G(200));return LR(t,e,null,n)};$n.createRoot=function(t,e){if(!Lv(t))throw Error(G(299));var n=!1,i="",r=$k;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onRecoverableError!==void 0&&(r=e.onRecoverableError)),e=Pv(t,1,!1,null,null,n,!1,i,r),t[cr]=e.current,Al(t.nodeType===8?t.parentNode:t),new Ov(e)};$n.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(G(188)):(t=Object.keys(t).join(","),Error(G(268,t)));return t=cS(e),t=t===null?null:t.stateNode,t};$n.flushSync=function(t){return Fs(t)};$n.hydrate=function(t,e,n){if(!Sf(e))throw Error(G(200));return kf(null,t,e,!0,n)};$n.hydrateRoot=function(t,e,n){if(!Lv(t))throw Error(G(405));var i=n!=null&&n.hydratedSources||null,r=!1,s="",l=$k;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),e=jk(e,null,t,1,n??null,r,!1,s,l),t[cr]=e.current,Al(t),i)for(t=0;t<i.length;t++)n=i[t],r=n._getVersion,r=r(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,r]:e.mutableSourceEagerHydrationData.push(n,r);return new wf(e)};$n.render=function(t,e,n){if(!Sf(e))throw Error(G(200));return kf(null,t,e,!1,n)};$n.unmountComponentAtNode=function(t){if(!Sf(t))throw Error(G(40));return t._reactRootContainer?(Fs(function(){kf(null,null,t,!1,function(){t._reactRootContainer=null,t[cr]=null})}),!0):!1};$n.unstable_batchedUpdates=kv;$n.unstable_renderSubtreeIntoContainer=function(t,e,n,i){if(!Sf(n))throw Error(G(200));if(t==null||t._reactInternals===void 0)throw Error(G(38));return kf(t,e,n,!1,i)};$n.version="18.2.0-next-9e3b772b8-20220608";function Vk(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vk)}catch(t){console.error(t)}}Vk(),j1.exports=$n;var Hk=j1.exports,Wk,sb=Hk;Wk=sb.createRoot,sb.hydrateRoot;function ht(){return ht=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ht.apply(this,arguments)}var At;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(At||(At={}));const ob="popstate";function UR(t){t===void 0&&(t={});function e(i,r){let{pathname:s,search:l,hash:a}=i.location;return zl("",{pathname:s,search:l,hash:a},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(i,r){return typeof r=="string"?r:zs(r)}return zR(e,n,null,t)}function De(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Bo(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function FR(){return Math.random().toString(36).substr(2,8)}function ab(t,e){return{usr:t.state,key:t.key,idx:e}}function zl(t,e,n,i){return n===void 0&&(n=null),ht({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?mr(e):e,{state:n,key:e&&e.key||i||FR()})}function zs(t){let{pathname:e="/",search:n="",hash:i=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function mr(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substr(i),t=t.substr(0,i)),t&&(e.pathname=t)}return e}function zR(t,e,n,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:s=!1}=i,l=r.history,a=At.Pop,u=null,f=p();f==null&&(f=0,l.replaceState(ht({},l.state,{idx:f}),""));function p(){return(l.state||{idx:null}).idx}function m(){a=At.Pop;let g=p(),y=g==null?null:g-f;f=g,u&&u({action:a,location:h.location,delta:y})}function o(g,y){a=At.Push;let v=zl(h.location,g,y);n&&n(v,g),f=p()+1;let _=ab(v,f),b=h.createHref(v);try{l.pushState(_,"",b)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;r.location.assign(b)}s&&u&&u({action:a,location:h.location,delta:1})}function c(g,y){a=At.Replace;let v=zl(h.location,g,y);n&&n(v,g),f=p();let _=ab(v,f),b=h.createHref(v);l.replaceState(_,"",b),s&&u&&u({action:a,location:h.location,delta:0})}function d(g){let y=r.location.origin!=="null"?r.location.origin:r.location.href,v=typeof g=="string"?g:zs(g);return De(y,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,y)}let h={get action(){return a},get location(){return t(r,l)},listen(g){if(u)throw new Error("A history only accepts one active listener");return r.addEventListener(ob,m),u=g,()=>{r.removeEventListener(ob,m),u=null}},createHref(g){return e(r,g)},createURL:d,encodeLocation(g){let y=d(g);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:o,replace:c,go(g){return l.go(g)}};return h}var Et;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Et||(Et={}));const NR=new Set(["lazy","caseSensitive","path","id","index","children"]);function BR(t){return t.index===!0}function ug(t,e,n,i){return n===void 0&&(n=[]),i===void 0&&(i={}),t.map((r,s)=>{let l=[...n,s],a=typeof r.id=="string"?r.id:l.join("-");if(De(r.index!==!0||!r.children,"Cannot specify children on an index route"),De(!i[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),BR(r)){let u=ht({},r,e(r),{id:a});return i[a]=u,u}else{let u=ht({},r,e(r),{id:a,children:void 0});return i[a]=u,r.children&&(u.children=ug(r.children,e,l,i)),u}})}function po(t,e,n){n===void 0&&(n="/");let i=typeof e=="string"?mr(e):e,r=qo(i.pathname||"/",n);if(r==null)return null;let s=Gk(t);$R(s);let l=null;for(let a=0;l==null&&a<s.length;++a)l=XR(s[a],eI(r));return l}function jR(t,e){let{route:n,pathname:i,params:r}=t;return{id:n.id,pathname:i,params:r,data:e[n.id],handle:n.handle}}function Gk(t,e,n,i){e===void 0&&(e=[]),n===void 0&&(n=[]),i===void 0&&(i="");let r=(s,l,a)=>{let u={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:l,route:s};u.relativePath.startsWith("/")&&(De(u.relativePath.startsWith(i),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(i.length));let f=ar([i,u.relativePath]),p=n.concat(u);s.children&&s.children.length>0&&(De(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),Gk(s.children,e,p,f)),!(s.path==null&&!s.index)&&e.push({path:f,score:QR(f,s.index),routesMeta:p})};return t.forEach((s,l)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))r(s,l);else for(let u of Yk(s.path))r(s,l,u)}),e}function Yk(t){let e=t.split("/");if(e.length===0)return[];let[n,...i]=e,r=n.endsWith("?"),s=n.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let l=Yk(i.join("/")),a=[];return a.push(...l.map(u=>u===""?s:[s,u].join("/"))),r&&a.push(...l),a.map(u=>t.startsWith("/")&&u===""?"/":u)}function $R(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:ZR(e.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}const VR=/^:\w+$/,HR=3,WR=2,GR=1,YR=10,KR=-2,lb=t=>t==="*";function QR(t,e){let n=t.split("/"),i=n.length;return n.some(lb)&&(i+=KR),e&&(i+=WR),n.filter(r=>!lb(r)).reduce((r,s)=>r+(VR.test(s)?HR:s===""?GR:YR),i)}function ZR(t,e){return t.length===e.length&&t.slice(0,-1).every((i,r)=>i===e[r])?(t[t.length-1]-e[e.length-1]):(0)}function XR(t,e){let{routesMeta:n}=t,i={},r="/",s=[];for(let l=0;l<n.length;++l){let a=n[l],u=l===n.length-1,f=r==="/"?e:e.slice(r.length)||"/",p=qR({path:a.relativePath,caseSensitive:a.caseSensitive,end:u},f);if(!p)return null;Object.assign(i,p.params);let m=a.route;s.push({params:i,pathname:ar([r,p.pathname]),pathnameBase:rI(ar([r,p.pathnameBase])),route:m}),p.pathnameBase!=="/"&&(r=ar([r,p.pathnameBase]))}return s}function qR(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,i]=JR(t.path,t.caseSensitive,t.end),r=e.match(n);if(!r)return null;let s=r[0],l=s.replace(/(.)\/+$/,"$1"),a=r.slice(1);return{params:i.reduce((f,p,m)=>{if(p==="*"){let o=a[m]||"";l=s.slice(0,s.length-o.length).replace(/(.)\/+$/,"$1")}return f[p]=tI(a[m]||"",p),f},{}),pathname:s,pathnameBase:l,pattern:t}}function JR(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),Bo(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let i=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(l,a)=>(i.push(a),"/([^\\/]+)"));return t.endsWith("*")?(i.push("*"),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function eI(t){try{return decodeURI(t)}catch(e){return Bo(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function tI(t,e){try{return decodeURIComponent(t)}catch(n){return Bo(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),t}}function qo(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,i=t.charAt(n);return i&&i!=="/"?null:t.slice(n)||"/"}function nI(t,e){e===void 0&&(e="/");let{pathname:n,search:i="",hash:r=""}=typeof t=="string"?mr(t):t;return{pathname:n?n.startsWith("/")?n:iI(n,e):e,search:sI(i),hash:oI(r)}}function iI(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function wh(t,e,n,i){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ef(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Mv(t,e,n,i){i===void 0&&(i=!1);let r;typeof t=="string"?r=mr(t):(r=ht({},t),De(!r.pathname||!r.pathname.includes("?"),wh("?","pathname","search",r)),De(!r.pathname||!r.pathname.includes("#"),wh("#","pathname","hash",r)),De(!r.search||!r.search.includes("#"),wh("#","search","hash",r)));let s=t===""||r.pathname==="",l=s?"/":r.pathname,a;if(i||l==null)a=n;else{let m=e.length-1;if(l.startsWith("..")){let o=l.split("/");for(;o[0]==="..";)o.shift(),m-=1;r.pathname=o.join("/")}a=m>=0?e[m]:"/"}let u=nI(r,a),f=l&&l!=="/"&&l.endsWith("/"),p=(s||l===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(f||p)&&(u.pathname+="/"),u}const ar=t=>t.join("/").replace(/\/\/+/g,"/"),rI=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),sI=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,oI=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class Dv{constructor(e,n,i,r){r===void 0&&(r=!1),this.status=e,this.statusText=n||"",this.internal=r,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}}function Kk(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const Qk=["post","put","patch","delete"],aI=new Set(Qk),lI=["get",...Qk],cI=new Set(lI),uI=new Set([301,302,303,307,308]),dI=new Set([307,308]),Sh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fI={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ya={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Zk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hI=t=>({hasErrorBoundary:!!t.hasErrorBoundary});function pI(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",i=!n;De(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let r;if(t.mapRouteProperties)r=t.mapRouteProperties;else if(t.detectErrorBoundary){let O=t.detectErrorBoundary;r=L=>({hasErrorBoundary:O(L)})}else r=hI;let s={},l=ug(t.routes,r,void 0,s),a,u=t.basename||"/",f=ht({v7_normalizeFormMethod:!1,v7_prependBasename:!1},t.future),p=null,m=new Set,o=null,c=null,d=null,h=t.hydrationData!=null,g=po(l,t.history.location,u),y=null;if(g==null){let O=Yn(404,{pathname:t.history.location.pathname}),{matches:L,route:j}=mb(l);g=L,y={[j.id]:O}}let v=(!g.some(O=>O.route.lazy)&&(!g.some(O=>O.route.loader)||t.hydrationData!=null)),_,b={historyAction:t.history.action,location:t.history.location,matches:g,initialized:v,navigation:Sh,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||y,fetchers:new Map,blockers:new Map},x=At.Pop,w=!1,S,C=!1,T=!1,M=[],B=[],F=new Map,N=0,W=-1,H=new Map,Y=new Set,ee=new Map,I=new Map,z=new Map,X=!1;function K(){return p=t.history.listen(O=>{let{action:L,location:j,delta:q}=O;if(X){X=!1;return}Bo(z.size===0||q!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let xe=Ee({currentLocation:b.location,nextLocation:j,historyAction:L});if(xe&&q!=null){X=!0,t.history.go(q*-1),se(xe,{state:"blocked",location:j,proceed(){se(xe,{state:"proceeding",proceed:void 0,reset:void 0,location:j}),t.history.go(q)},reset(){let we=new Map(b.blockers);we.set(xe,ya),ue({blockers:we})}});return}return Le(L,j)}),b.initialized||Le(At.Pop,b.location),_}function be(){p&&p(),m.clear(),S&&S.abort(),b.fetchers.forEach((O,L)=>E(L)),b.blockers.forEach((O,L)=>$(L))}function Ke(O){return m.add(O),()=>m.delete(O)}function ue(O){b=ht({},b,O),m.forEach(L=>L(b))}function fe(O,L){var j,q;let xe=b.actionData!=null&&b.navigation.formMethod!=null&&di(b.navigation.formMethod)&&b.navigation.state==="loading"&&((j=O.state)==null?void 0:j._isRedirect)!==!0,we;L.actionData?Object.keys(L.actionData).length>0?we=L.actionData:we=null:xe?we=b.actionData:we=null;let Te=L.loaderData?gb(b.loaderData,L.loaderData,L.matches||[],L.errors):b.loaderData,ye=b.blockers;ye.size>0&&(ye=new Map(ye),ye.forEach((oe,_e)=>ye.set(_e,ya)));let U=w===!0||b.navigation.formMethod!=null&&di(b.navigation.formMethod)&&((q=O.state)==null?void 0:q._isRedirect)!==!0;a&&(l=a,a=void 0),C||x===At.Pop||(x===At.Push?t.history.push(O,O.state):x===At.Replace&&t.history.replace(O,O.state)),ue(ht({},L,{actionData:we,loaderData:Te,historyAction:x,location:O,initialized:!0,navigation:Sh,revalidation:"idle",restoreScrollPosition:Pn(O,L.matches||b.matches),preventScrollReset:U,blockers:ye})),x=At.Pop,w=!1,C=!1,T=!1,M=[],B=[]}async function ke(O,L){if(typeof O=="number"){t.history.go(O);return}let j=dg(b.location,b.matches,u,f.v7_prependBasename,O,L?.fromRouteId,L?.relative),{path:q,submission:xe,error:we}=cb(f.v7_normalizeFormMethod,!1,j,L),Te=b.location,ye=zl(b.location,q,L&&L.state);ye=ht({},ye,t.history.encodeLocation(ye));let U=L&&L.replace!=null?L.replace:void 0,oe=At.Push;U===!0?oe=At.Replace:U===!1||xe!=null&&di(xe.formMethod)&&xe.formAction===b.location.pathname+b.location.search&&(oe=At.Replace);let _e=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,he=Ee({currentLocation:Te,nextLocation:ye,historyAction:oe});if(he){se(he,{state:"blocked",location:ye,proceed(){se(he,{state:"proceeding",proceed:void 0,reset:void 0,location:ye}),ke(O,L)},reset(){let Ce=new Map(b.blockers);Ce.set(he,ya),ue({blockers:Ce})}});return}return await Le(oe,ye,{submission:xe,pendingError:we,preventScrollReset:_e,replace:L&&L.replace})}function Be(){if(Tn(),ue({revalidation:"loading"}),b.navigation.state!=="submitting"){if(b.navigation.state==="idle"){Le(b.historyAction,b.location,{startUninterruptedRevalidation:!0});return}Le(x||b.historyAction,b.navigation.location,{overrideNavigation:b.navigation})}}async function Le(O,L,j){S&&S.abort(),S=null,x=O,C=(j&&j.startUninterruptedRevalidation)===!0,Hn(b.location,b.matches),w=(j&&j.preventScrollReset)===!0;let q=a||l,xe=j&&j.overrideNavigation,we=po(q,L,u);if(!we){let Ce=Yn(404,{pathname:L.pathname}),{matches:me,route:je}=mb(q);Ue(),fe(L,{matches:me,loaderData:{},errors:{[je.id]:Ce}});return}if(b.initialized&&!T&&_I(b.location,L)&&!(j&&j.submission&&di(j.submission.formMethod))){fe(L,{matches:we});return}S=new AbortController;let Te=ba(t.history,L,S.signal,j&&j.submission),ye,U;if(j&&j.pendingError)U={[go(we).route.id]:j.pendingError};else if(j&&j.submission&&di(j.submission.formMethod)){let Ce=await vt(Te,L,j.submission,we,{replace:j.replace});if(Ce.shortCircuited)return;ye=Ce.pendingActionData,U=Ce.pendingActionError,xe=kh(L,j.submission),Te=new Request(Te.url,{signal:Te.signal})}let{shortCircuited:oe,loaderData:_e,errors:he}=await ge(Te,L,we,xe,j&&j.submission,j&&j.fetcherSubmission,j&&j.replace,ye,U);oe||(S=null,fe(L,ht({matches:we},ye?{actionData:ye}:{},{loaderData:_e,errors:he})))}async function vt(O,L,j,q,xe){xe===void 0&&(xe={}),Tn();let we=SI(L,j);ue({navigation:we});let Te,ye=hg(q,L);if(!ye.route.action&&!ye.route.lazy)Te={type:Et.error,error:Yn(405,{method:O.method,pathname:L.pathname,routeId:ye.route.id})};else if(Te=await _a("action",O,ye,q,s,r,u),O.signal.aborted)return{shortCircuited:!0};if(Eo(Te)){let U;return xe&&xe.replace!=null?U=xe.replace:U=Te.location===b.location.pathname+b.location.search,await $t(b,Te,{submission:j,replace:U}),{shortCircuited:!0}}if(Ja(Te)){let U=go(q,ye.route.id);return(xe&&xe.replace)!==!0&&(x=At.Push),{pendingActionData:{},pendingActionError:{[U.route.id]:Te.error}}}if(ks(Te))throw Yn(400,{type:"defer-action"});return{pendingActionData:{[ye.route.id]:Te.data}}}async function ge(O,L,j,q,xe,we,Te,ye,U){let oe=q||kh(L,xe),_e=xe||we||_b(oe),he=a||l,[Ce,me]=ub(t.history,b,j,_e,L,T,M,B,ee,Y,he,u,ye,U);if(Ue(qe=>!(j&&j.some(si=>si.route.id===qe))||Ce&&Ce.some(si=>si.route.id===qe)),W=++N,Ce.length===0&&me.length===0){let qe=J();return fe(L,ht({matches:j,loaderData:{},errors:U||null},ye?{actionData:ye}:{},qe?{fetchers:new Map(b.fetchers)}:{})),{shortCircuited:!0}}if(!C){me.forEach(si=>{let br=b.fetchers.get(si.key),Ff=xa(void 0,br?br.data:void 0);b.fetchers.set(si.key,Ff)});let qe=ye||b.actionData;ue(ht({navigation:oe},qe?Object.keys(qe).length===0?{actionData:null}:{actionData:qe}:{},me.length>0?{fetchers:new Map(b.fetchers)}:{}))}me.forEach(qe=>{F.has(qe.key)&&A(qe.key),qe.controller&&F.set(qe.key,qe.controller)});let je=()=>me.forEach(qe=>A(qe.key));S&&S.signal.addEventListener("abort",je);let{results:ii,loaderResults:xi,fetcherResults:_r}=await Vi(b.matches,j,Ce,me,O);if(O.signal.aborted)return{shortCircuited:!0};S&&S.signal.removeEventListener("abort",je),me.forEach(qe=>F.delete(qe.key));let ri=vb(ii);if(ri){if(ri.idx>=Ce.length){let qe=me[ri.idx-Ce.length].key;Y.add(qe)}return await $t(b,ri.result,{replace:Te}),{shortCircuited:!0}}let{loaderData:Fe,errors:yt}=pb(b,j,Ce,xi,U,me,_r,I);I.forEach((qe,si)=>{qe.subscribe(br=>{(br||qe.done)&&I.delete(si)})});let as=J(),ls=Z(W),Uf=as||ls||me.length>0;return ht({loaderData:Fe,errors:yt},Uf?{fetchers:new Map(b.fetchers)}:{})}function Me(O){return b.fetchers.get(O)||fI}function nt(O,L,j,q){if(i)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");F.has(O)&&A(O);let xe=a||l,we=dg(b.location,b.matches,u,f.v7_prependBasename,j,L,q?.relative),Te=po(xe,we,u);if(!Te){hn(O,L,Yn(404,{pathname:we}));return}let{path:ye,submission:U,error:oe}=cb(f.v7_normalizeFormMethod,!0,we,q);if(oe){hn(O,L,oe);return}let _e=hg(Te,ye);if(w=(q&&q.preventScrollReset)===!0,U&&di(U.formMethod)){lt(O,L,ye,_e,Te,U);return}ee.set(O,{routeId:L,path:ye}),ni(O,L,ye,_e,Te,U)}async function lt(O,L,j,q,xe,we){if(Tn(),ee.delete(O),!q.route.action&&!q.route.lazy){let Dt=Yn(405,{method:we.formMethod,pathname:j,routeId:L});hn(O,L,Dt);return}let Te=b.fetchers.get(O),ye=kI(we,Te);b.fetchers.set(O,ye),ue({fetchers:new Map(b.fetchers)});let U=new AbortController,oe=ba(t.history,j,U.signal,we);F.set(O,U);let _e=N,he=await _a("action",oe,q,xe,s,r,u);if(oe.signal.aborted){F.get(O)===U&&F.delete(O);return}if(Eo(he))if(F.delete(O),W>_e){let Dt=Js(void 0);b.fetchers.set(O,Dt),ue({fetchers:new Map(b.fetchers)});return}else{Y.add(O);let Dt=xa(we);return b.fetchers.set(O,Dt),ue({fetchers:new Map(b.fetchers)}),$t(b,he,{fetcherSubmission:we})}if(Ja(he)){hn(O,L,he.error);return}if(ks(he))throw Yn(400,{type:"defer-action"});let Ce=b.navigation.location||b.location,me=ba(t.history,Ce,U.signal),je=a||l,ii=b.navigation.state!=="idle"?po(je,b.navigation.location,u):b.matches;De(ii,"Didn't find any matches after fetcher action");let xi=++N;H.set(O,xi);let _r=xa(we,he.data);b.fetchers.set(O,_r);let[ri,Fe]=ub(t.history,b,ii,we,Ce,T,M,B,ee,Y,je,u,{[q.route.id]:he.data},void 0);Fe.filter(Dt=>Dt.key!==O).forEach(Dt=>{let ia=Dt.key,_y=b.fetchers.get(ia),nC=xa(void 0,_y?_y.data:void 0);b.fetchers.set(ia,nC),F.has(ia)&&A(ia),Dt.controller&&F.set(ia,Dt.controller)}),ue({fetchers:new Map(b.fetchers)});let yt=()=>Fe.forEach(Dt=>A(Dt.key));U.signal.addEventListener("abort",yt);let{results:as,loaderResults:ls,fetcherResults:Uf}=await Vi(b.matches,ii,ri,Fe,me);if(U.signal.aborted)return;U.signal.removeEventListener("abort",yt),H.delete(O),F.delete(O),Fe.forEach(Dt=>F.delete(Dt.key));let qe=vb(as);if(qe){if(qe.idx>=ri.length){let Dt=Fe[qe.idx-ri.length].key;Y.add(Dt)}return $t(b,qe.result)}let{loaderData:si,errors:br}=pb(b,b.matches,ri,ls,void 0,Fe,Uf,I);if(b.fetchers.has(O)){let Dt=Js(he.data);b.fetchers.set(O,Dt)}let Ff=Z(xi);b.navigation.state==="loading"&&xi>W?(De(x,"Expected pending action"),S&&S.abort(),fe(b.navigation.location,{matches:ii,loaderData:si,errors:br,fetchers:new Map(b.fetchers)})):(ue(ht({errors:br,loaderData:gb(b.loaderData,si,ii,br)},Ff||Fe.length>0?{fetchers:new Map(b.fetchers)}:{})),T=!1)}async function ni(O,L,j,q,xe,we){let Te=b.fetchers.get(O),ye=xa(we,Te?Te.data:void 0);b.fetchers.set(O,ye),ue({fetchers:new Map(b.fetchers)});let U=new AbortController,oe=ba(t.history,j,U.signal);F.set(O,U);let _e=N,he=await _a("loader",oe,q,xe,s,r,u);if(ks(he)&&(he=await Jk(he,oe.signal,!0)||he),F.get(O)===U&&F.delete(O),oe.signal.aborted)return;if(Eo(he))if(W>_e){let me=Js(void 0);b.fetchers.set(O,me),ue({fetchers:new Map(b.fetchers)});return}else{Y.add(O),await $t(b,he);return}if(Ja(he)){let me=go(b.matches,L);b.fetchers.delete(O),ue({fetchers:new Map(b.fetchers),errors:{[me.route.id]:he.error}});return}De(!ks(he),"Unhandled fetcher deferred data");let Ce=Js(he.data);b.fetchers.set(O,Ce),ue({fetchers:new Map(b.fetchers)})}async function $t(O,L,j){let{submission:q,fetcherSubmission:xe,replace:we}=j===void 0?{}:j;L.revalidate&&(T=!0);let Te=zl(O.location,L.location,{_isRedirect:!0});if(De(Te,"Expected a location on the redirect navigation"),n){let Ce=!1;if(L.reloadDocument)Ce=!0;else if(Zk.test(L.location)){const me=t.history.createURL(L.location);Ce=me.origin!==e.location.origin||qo(me.pathname,u)==null}if(Ce){we?e.location.replace(L.location):e.location.assign(L.location);return}}S=null;let ye=we===!0?At.Replace:At.Push,{formMethod:U,formAction:oe,formEncType:_e}=O.navigation;!q&&!xe&&U&&oe&&_e&&(q=_b(O.navigation));let he=q||xe;if(dI.has(L.status)&&he&&di(he.formMethod))await Le(ye,Te,{submission:ht({},he,{formAction:L.location}),preventScrollReset:w});else{let Ce=kh(Te,q);await Le(ye,Te,{overrideNavigation:Ce,fetcherSubmission:xe,preventScrollReset:w})}}async function Vi(O,L,j,q,xe){let we=await Promise.all([...j.map(U=>_a("loader",xe,U,L,s,r,u)),...q.map(U=>U.matches&&U.match&&U.controller?_a("loader",ba(t.history,U.path,U.controller.signal),U.match,U.matches,s,r,u):{type:Et.error,error:Yn(404,{pathname:U.path})})]),Te=we.slice(0,j.length),ye=we.slice(j.length);return await Promise.all([yb(O,j,Te,Te.map(()=>xe.signal),!1,b.loaderData),yb(O,q.map(U=>U.match),ye,q.map(U=>U.controller?U.controller.signal:null),!0)]),{results:we,loaderResults:Te,fetcherResults:ye}}function Tn(){T=!0,M.push(...Ue()),ee.forEach((O,L)=>{F.has(L)&&(B.push(L),A(L))})}function hn(O,L,j){let q=go(b.matches,L);E(O),ue({errors:{[q.route.id]:j},fetchers:new Map(b.fetchers)})}function E(O){let L=b.fetchers.get(O);F.has(O)&&!(L&&L.state==="loading"&&H.has(O))&&A(O),ee.delete(O),H.delete(O),Y.delete(O),b.fetchers.delete(O)}function A(O){let L=F.get(O);De(L,"Expected fetch controller: "+O),L.abort(),F.delete(O)}function D(O){for(let L of O){let j=Me(L),q=Js(j.data);b.fetchers.set(L,q)}}function J(){let O=[],L=!1;for(let j of Y){let q=b.fetchers.get(j);De(q,"Expected fetcher: "+j),q.state==="loading"&&(Y.delete(j),O.push(j),L=!0)}return D(O),L}function Z(O){let L=[];for(let[j,q]of H)if(q<O){let xe=b.fetchers.get(j);De(xe,"Expected fetcher: "+j),xe.state==="loading"&&(A(j),H.delete(j),L.push(j))}return D(L),L.length>0}function P(O,L){let j=b.blockers.get(O)||ya;return z.get(O)!==L&&z.set(O,L),j}function $(O){b.blockers.delete(O),z.delete(O)}function se(O,L){let j=b.blockers.get(O)||ya;De(j.state==="unblocked"&&L.state==="blocked"||j.state==="blocked"&&L.state==="blocked"||j.state==="blocked"&&L.state==="proceeding"||j.state==="blocked"&&L.state==="unblocked"||j.state==="proceeding"&&L.state==="unblocked","Invalid blocker state transition: "+j.state+" -> "+L.state);let q=new Map(b.blockers);q.set(O,L),ue({blockers:q})}function Ee(O){let{currentLocation:L,nextLocation:j,historyAction:q}=O;if(z.size===0)return;z.size>1&&Bo(!1,"A router only supports one blocker at a time");let xe=Array.from(z.entries()),[we,Te]=xe[xe.length-1],ye=b.blockers.get(we);if(!(ye&&ye.state==="proceeding")&&Te({currentLocation:L,nextLocation:j,historyAction:q}))return we}function Ue(O){let L=[];return I.forEach((j,q)=>{(!O||O(q))&&(j.cancel(),L.push(q),I.delete(q))}),L}function Vt(O,L,j){if(o=O,d=L,c=j||null,!h&&b.navigation===Sh){h=!0;let q=Pn(b.location,b.matches);q!=null&&ue({restoreScrollPosition:q})}return()=>{o=null,d=null,c=null}}function Zt(O,L){return c&&c(O,L.map(q=>jR(q,b.loaderData)))||O.key}function Hn(O,L){if(o&&d){let j=Zt(O,L);o[j]=d()}}function Pn(O,L){if(o){let j=Zt(O,L),q=o[j];if(typeof q=="number")return q}return null}function bi(O){s={},a=ug(O,r,void 0,s)}return _={get basename(){return u},get state(){return b},get routes(){return l},initialize:K,subscribe:Ke,enableScrollRestoration:Vt,navigate:ke,fetch:nt,revalidate:Be,createHref:O=>t.history.createHref(O),encodeLocation:O=>t.history.encodeLocation(O),getFetcher:Me,deleteFetcher:E,dispose:be,getBlocker:P,deleteBlocker:$,_internalFetchControllers:F,_internalActiveDeferreds:I,_internalSetRoutes:bi},_}function gI(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function dg(t,e,n,i,r,s,l){let a,u;if(s!=null&&l!=="path"){a=[];for(let p of e)if(a.push(p),p.route.id===s){u=p;break}}else a=e,u=e[e.length-1];let f=Mv(r||".",Ef(a).map(p=>p.pathnameBase),qo(t.pathname,n)||t.pathname,l==="path");return r==null&&(f.search=t.search,f.hash=t.hash),(r==null||r===""||r===".")&&u&&u.route.index&&!Rv(f.search)&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),i&&n!=="/"&&(f.pathname=f.pathname==="/"?n:ar([n,f.pathname])),zs(f)}function cb(t,e,n,i){if(!i||!gI(i))return{path:n};if(i.formMethod&&!wI(i.formMethod))return{path:n,error:Yn(405,{method:i.formMethod})};let r=()=>({path:n,error:Yn(400,{type:"invalid-body"})}),s=i.formMethod||"get",l=t?s.toUpperCase():s.toLowerCase(),a=qk(n);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!di(l))return r();let o=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?(Array.from(i.body.entries()).reduce((c,d)=>{let[h,g]=d;return""+c+h+"="+g+`
11
+ `},"")):String(i.body);return{path:n,submission:{formMethod:l,formAction:a,formEncType:i.formEncType,formData:void 0,json:void 0,text:o}}}else if(i.formEncType==="application/json"){if(!di(l))return r();try{let o=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:n,submission:{formMethod:l,formAction:a,formEncType:i.formEncType,formData:void 0,json:o,text:void 0}}}catch{return r()}}}De(typeof FormData=="function","FormData is not available in this environment");let u,f;if(i.formData)u=fg(i.formData),f=i.formData;else if(i.body instanceof FormData)u=fg(i.body),f=i.body;else if(i.body instanceof URLSearchParams)u=i.body,f=hb(u);else if(i.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(i.body),f=hb(u)}catch{return r()}let p={formMethod:l,formAction:a,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(di(p.formMethod))return{path:n,submission:p};let m=mr(n);return e&&m.search&&Rv(m.search)&&u.append("index",""),m.search="?"+u,{path:zs(m),submission:p}}function mI(t,e){let n=t;if(e){let i=t.findIndex(r=>r.route.id===e);i>=0&&(n=t.slice(0,i))}return n}function ub(t,e,n,i,r,s,l,a,u,f,p,m,o,c){let d=c?Object.values(c)[0]:o?Object.values(o)[0]:void 0,h=t.createURL(e.location),g=t.createURL(r),y=c?Object.keys(c)[0]:void 0,_=mI(n,y).filter((x,w)=>{if(x.route.lazy)return!0;if(x.route.loader==null)return!1;if(vI(e.loaderData,e.matches[w],x)||l.some(T=>T===x.route.id))return!0;let S=e.matches[w],C=x;return db(x,ht({currentUrl:h,currentParams:S.params,nextUrl:g,nextParams:C.params},i,{actionResult:d,defaultShouldRevalidate:(s||h.pathname+h.search===g.pathname+g.search||h.search!==g.search||Xk(S,C))}))}),b=[];return u.forEach((x,w)=>{if(!n.some(B=>B.route.id===x.routeId))return;let S=po(p,x.path,m);if(!S){b.push({key:w,routeId:x.routeId,path:x.path,matches:null,match:null,controller:null});return}let C=e.fetchers.get(w),T=hg(S,x.path),M=!1;f.has(w)?M=!1:a.includes(w)?M=!0:C&&C.state!=="idle"&&C.data===void 0?M=s:M=db(T,ht({currentUrl:h,currentParams:e.matches[e.matches.length-1].params,nextUrl:g,nextParams:n[n.length-1].params},i,{actionResult:d,defaultShouldRevalidate:s})),M&&b.push({key:w,routeId:x.routeId,path:x.path,matches:S,match:T,controller:new AbortController})}),[_,b]}function vI(t,e,n){let i=(!e||n.route.id!==e.route.id),r=t[n.route.id]===void 0;return i||r}function Xk(t,e){let n=t.route.path;return(t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"])}function db(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}async function fb(t,e,n){if(!t.lazy)return;let i=await t.lazy();if(!t.lazy)return;let r=n[t.id];De(r,"No route found in manifest");let s={};for(let l in i){let u=r[l]!==void 0&&l!=="hasErrorBoundary";Bo(!u,'Route "'+r.id+'" has a static property "'+l+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+l+'" will be ignored.')),!u&&!NR.has(l)&&(s[l]=i[l])}Object.assign(r,s),Object.assign(r,ht({},e(r),{lazy:void 0}))}async function _a(t,e,n,i,r,s,l,a){a===void 0&&(a={});let u,f,p,m=d=>{let h,g=new Promise((y,v)=>h=v);return p=()=>h(),e.signal.addEventListener("abort",p),Promise.race([d({request:e,params:n.params,context:a.requestContext}),g])};try{let d=n.route[t];if(n.route.lazy)if(d){let h,g=await Promise.all([m(d).catch(y=>{h=y}),fb(n.route,s,r)]);if(h)throw h;f=g[0]}else if(await fb(n.route,s,r),d=n.route[t],d)f=await m(d);else if(t==="action"){let h=new URL(e.url),g=h.pathname+h.search;throw Yn(405,{method:e.method,pathname:g,routeId:n.route.id})}else return{type:Et.data,data:void 0};else if(d)f=await m(d);else{let h=new URL(e.url),g=h.pathname+h.search;throw Yn(404,{pathname:g})}De(f!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(d){u=Et.error,f=d}finally{p&&e.signal.removeEventListener("abort",p)}if(xI(f)){let d=f.status;if(uI.has(d)){let y=f.headers.get("Location");if(De(y,"Redirects returned/thrown from loaders/actions must have a Location header"),!Zk.test(y))y=dg(new URL(e.url),i.slice(0,i.indexOf(n)+1),l,!0,y);else if(!a.isStaticRequest){let v=new URL(e.url),_=y.startsWith("//")?new URL(v.protocol+y):new URL(y),b=qo(_.pathname,l)!=null;_.origin===v.origin&&b&&(y=_.pathname+_.search+_.hash)}if(a.isStaticRequest)throw f.headers.set("Location",y),f;return{type:Et.redirect,status:d,location:y,revalidate:f.headers.get("X-Remix-Revalidate")!==null,reloadDocument:f.headers.get("X-Remix-Reload-Document")!==null}}if(a.isRouteRequest)throw{type:u===Et.error?Et.error:Et.data,response:f};let h,g=f.headers.get("Content-Type");return g&&/\bapplication\/json\b/.test(g)?h=await f.json():h=await f.text(),u===Et.error?{type:u,error:new Dv(d,f.statusText,h),headers:f.headers}:{type:Et.data,data:h,statusCode:f.status,headers:f.headers}}if(u===Et.error)return{type:u,error:f};if(bI(f)){var o,c;return{type:Et.deferred,deferredData:f,statusCode:(o=f.init)==null?void 0:o.status,headers:((c=f.init)==null?void 0:c.headers)&&new Headers(f.init.headers)}}return{type:Et.data,data:f}}function ba(t,e,n,i){let r=t.createURL(qk(e)).toString(),s={signal:n};if(i&&di(i.formMethod)){let{formMethod:l,formEncType:a}=i;s.method=l.toUpperCase(),a==="application/json"?(s.headers=new Headers({"Content-Type":a}),s.body=JSON.stringify(i.json)):a==="text/plain"?s.body=i.text:a==="application/x-www-form-urlencoded"&&i.formData?s.body=fg(i.formData):s.body=i.formData}return new Request(r,s)}function fg(t){let e=new URLSearchParams;for(let[n,i]of t.entries())e.append(n,typeof i=="string"?i:i.name);return e}function hb(t){let e=new FormData;for(let[n,i]of t.entries())e.append(n,i);return e}function yI(t,e,n,i,r){let s={},l=null,a,u=!1,f={};return n.forEach((p,m)=>{let o=e[m].route.id;if(De(!Eo(p),"Cannot handle redirect results in processLoaderData"),Ja(p)){let c=go(t,o),d=p.error;i&&(d=Object.values(i)[0],i=void 0),l=l||{},l[c.route.id]==null&&(l[c.route.id]=d),s[o]=void 0,u||(u=!0,a=Kk(p.error)?p.error.status:500),p.headers&&(f[o]=p.headers)}else ks(p)?(r.set(o,p.deferredData),s[o]=p.deferredData.data):s[o]=p.data,p.statusCode!=null&&p.statusCode!==200&&!u&&(a=p.statusCode),p.headers&&(f[o]=p.headers)}),i&&(l=i,s[Object.keys(i)[0]]=void 0),{loaderData:s,errors:l,statusCode:a||200,loaderHeaders:f}}function pb(t,e,n,i,r,s,l,a){let{loaderData:u,errors:f}=yI(e,n,i,r,a);for(let p=0;p<s.length;p++){let{key:m,match:o,controller:c}=s[p];De(l!==void 0&&l[p]!==void 0,"Did not find corresponding fetcher result");let d=l[p];if(!(c&&c.signal.aborted))if(Ja(d)){let h=go(t.matches,o?.route.id);f&&f[h.route.id]||(f=ht({},f,{[h.route.id]:d.error})),t.fetchers.delete(m)}else if(Eo(d))De(!1,"Unhandled fetcher revalidation redirect");else if(ks(d))De(!1,"Unhandled fetcher deferred data");else{let h=Js(d.data);t.fetchers.set(m,h)}}return{loaderData:u,errors:f}}function gb(t,e,n,i){let r=ht({},e);for(let s of n){let l=s.route.id;if(e.hasOwnProperty(l)?e[l]!==void 0&&(r[l]=e[l]):t[l]!==void 0&&s.route.loader&&(r[l]=t[l]),i&&i.hasOwnProperty(l))break}return r}function go(t,e){return(e?t.slice(0,t.findIndex(i=>i.route.id===e)+1):[...t]).reverse().find(i=>i.route.hasErrorBoundary===!0)||t[0]}function mb(t){let e=t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Yn(t,e){let{pathname:n,routeId:i,method:r,type:s}=e===void 0?{}:e,l="Unknown Server Error",a="Unknown @remix-run/router error";return t===400?(l="Bad Request",r&&n&&i?a="You made a "+r+' request to "'+n+'" but '+('did not provide a `loader` for route "'+i+'", ')+"so there is no way to handle the request.":s==="defer-action"?a="defer() is not supported in actions":s==="invalid-body"&&(a="Unable to encode submission body")):t===403?(l="Forbidden",a='Route "'+i+'" does not match URL "'+n+'"'):t===404?(l="Not Found",a='No route matches URL "'+n+'"'):t===405&&(l="Method Not Allowed",r&&n&&i?a="You made a "+r.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+i+'", ')+"so there is no way to handle the request.":r&&(a='Invalid request method "'+r.toUpperCase()+'"')),new Dv(t||500,l,new Error(a),!0)}function vb(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(Eo(n))return{result:n,idx:e}}}function qk(t){let e=typeof t=="string"?mr(t):t;return zs(ht({},e,{hash:""}))}function _I(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function ks(t){return t.type===Et.deferred}function Ja(t){return t.type===Et.error}function Eo(t){return(t&&t.type)===Et.redirect}function bI(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function xI(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function wI(t){return cI.has(t.toLowerCase())}function di(t){return aI.has(t.toLowerCase())}async function yb(t,e,n,i,r,s){for(let l=0;l<n.length;l++){let a=n[l],u=e[l];if(!u)continue;let f=t.find(m=>m.route.id===u.route.id),p=f!=null&&!Xk(f,u)&&(s&&s[u.route.id])!==void 0;if(ks(a)&&(r||p)){let m=i[l];De(m,"Expected an AbortSignal for revalidating fetcher deferred result"),await Jk(a,m,r).then(o=>{o&&(n[l]=o||n[l])})}}}async function Jk(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:Et.data,data:t.deferredData.unwrappedData}}catch(r){return{type:Et.error,error:r}}return{type:Et.data,data:t.deferredData.data}}}function Rv(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function hg(t,e){let n=typeof e=="string"?mr(e).search:e.search;if(t[t.length-1].route.index&&Rv(n||""))return t[t.length-1];let i=Ef(t);return i[i.length-1]}function _b(t){let{formMethod:e,formAction:n,formEncType:i,text:r,formData:s,json:l}=t;if(!(!e||!n||!i)){if(r!=null)return{formMethod:e,formAction:n,formEncType:i,formData:void 0,json:void 0,text:r};if(s!=null)return{formMethod:e,formAction:n,formEncType:i,formData:s,json:void 0,text:void 0};if(l!==void 0)return{formMethod:e,formAction:n,formEncType:i,formData:void 0,json:l,text:void 0}}}function kh(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function SI(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function xa(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function kI(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Js(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function ud(){return ud=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ud.apply(this,arguments)}const Cf=k.createContext(null),eE=k.createContext(null),Jo=k.createContext(null),Tf=k.createContext(null),ss=k.createContext({outlet:null,matches:[],isDataRoute:!1}),tE=k.createContext(null);function EI(t,e){let{relative:n}=e===void 0?{}:e;nc()||De(!1);let{basename:i,navigator:r}=k.useContext(Jo),{hash:s,pathname:l,search:a}=iE(t,{relative:n}),u=l;return i!=="/"&&(u=l==="/"?i:ar([i,l])),r.createHref({pathname:u,search:a,hash:s})}function nc(){return k.useContext(Tf)!=null}function ic(){return nc()||De(!1),k.useContext(Tf).location}function nE(t){k.useContext(Jo).static||k.useLayoutEffect(t)}function Iv(){let{isDataRoute:t}=k.useContext(ss);return t?zI():CI()}function CI(){nc()||De(!1);let t=k.useContext(Cf),{basename:e,navigator:n}=k.useContext(Jo),{matches:i}=k.useContext(ss),{pathname:r}=ic(),s=JSON.stringify(Ef(i).map(u=>u.pathnameBase)),l=k.useRef(!1);return nE(()=>{l.current=!0}),k.useCallback(function(u,f){if(f===void 0&&(f={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let p=Mv(u,JSON.parse(s),r,f.relative==="path");t==null&&e!=="/"&&(p.pathname=p.pathname==="/"?e:ar([e,p.pathname])),(f.replace?n.replace:n.push)(p,f.state,f)},[e,n,s,r,t])}function TI(){let{matches:t}=k.useContext(ss),e=t[t.length-1];return e?e.params:{}}function iE(t,e){let{relative:n}=e===void 0?{}:e,{matches:i}=k.useContext(ss),{pathname:r}=ic(),s=JSON.stringify(Ef(i).map(l=>l.pathnameBase));return k.useMemo(()=>Mv(t,JSON.parse(s),r,n==="path"),[t,s,r,n])}function PI(t,e,n){nc()||De(!1);let{navigator:i}=k.useContext(Jo),{matches:r}=k.useContext(ss),s=r[r.length-1],l=s?s.params:{};s&&s.pathname;let a=s?s.pathnameBase:"/";s&&s.route;let u=ic(),f;if(e){var p;let h=typeof e=="string"?mr(e):e;a==="/"||(p=h.pathname)!=null&&p.startsWith(a)||De(!1),f=h}else f=u;let m=f.pathname||"/",o=a==="/"?m:m.slice(a.length)||"/",c=po(t,{pathname:o}),d=DI(c&&c.map(h=>Object.assign({},h,{params:Object.assign({},l,h.params),pathname:ar([a,i.encodeLocation?i.encodeLocation(h.pathname).pathname:h.pathname]),pathnameBase:h.pathnameBase==="/"?a:ar([a,i.encodeLocation?i.encodeLocation(h.pathnameBase).pathname:h.pathnameBase])})),r,n);return e&&d?k.createElement(Tf.Provider,{value:{location:ud({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:At.Pop}},d):d}function AI(){let t=FI(),e=Kk(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},e),n?k.createElement("pre",{style:r},n):null,s)}const OI=k.createElement(AI,null);class LI extends k.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error?k.createElement(ss.Provider,{value:this.props.routeContext},k.createElement(tE.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function MI(t){let{routeContext:e,match:n,children:i}=t,r=k.useContext(Cf);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),k.createElement(ss.Provider,{value:e},i)}function DI(t,e,n){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),t==null){var r;if((r=n)!=null&&r.errors)t=n.matches;else return null}let s=t,l=(i=n)==null?void 0:i.errors;if(l!=null){let a=s.findIndex(u=>u.route.id&&l?.[u.route.id]);a>=0||De(!1),s=s.slice(0,Math.min(s.length,a+1))}return s.reduceRight((a,u,f)=>{let p=u.route.id?l?.[u.route.id]:null,m=null;n&&(m=u.route.errorElement||OI);let o=e.concat(s.slice(0,f+1)),c=()=>{let d;return p?d=m:u.route.Component?d=k.createElement(u.route.Component,null):u.route.element?d=u.route.element:d=a,k.createElement(MI,{match:u,routeContext:{outlet:a,matches:o,isDataRoute:n!=null},children:d})};return n&&(u.route.ErrorBoundary||u.route.errorElement||f===0)?k.createElement(LI,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:c(),routeContext:{outlet:null,matches:o,isDataRoute:!0}}):c()},null)}var rE=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(rE||{}),dd=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(dd||{});function RI(t){let e=k.useContext(Cf);return e||De(!1),e}function II(t){let e=k.useContext(eE);return e||De(!1),e}function UI(t){let e=k.useContext(ss);return e||De(!1),e}function sE(t){let e=UI(),n=e.matches[e.matches.length-1];return n.route.id||De(!1),n.route.id}function FI(){var t;let e=k.useContext(tE),n=II(dd.UseRouteError),i=sE(dd.UseRouteError);return e||((t=n.errors)==null?void 0:t[i])}function zI(){let{router:t}=RI(rE.UseNavigateStable),e=sE(dd.UseNavigateStable),n=k.useRef(!1);return nE(()=>{n.current=!0}),k.useCallback(function(r,s){s===void 0&&(s={}),n.current&&(typeof r=="number"?t.navigate(r):t.navigate(r,ud({fromRouteId:e},s)))},[t,e])}const NI="startTransition",bb=np[NI];function BI(t){let{fallbackElement:e,router:n,future:i}=t,[r,s]=k.useState(n.state),{v7_startTransition:l}=i||{},a=k.useCallback(m=>{l&&bb?bb(()=>s(m)):s(m)},[s,l]);k.useLayoutEffect(()=>n.subscribe(a),[n,a]);let u=k.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:m=>n.navigate(m),push:(m,o,c)=>n.navigate(m,{state:o,preventScrollReset:c?.preventScrollReset}),replace:(m,o,c)=>n.navigate(m,{replace:!0,state:o,preventScrollReset:c?.preventScrollReset})}),[n]),f=n.basename||"/",p=k.useMemo(()=>({router:n,navigator:u,static:!1,basename:f}),[n,u,f]);return k.createElement(k.Fragment,null,k.createElement(Cf.Provider,{value:p},k.createElement(eE.Provider,{value:r},k.createElement($I,{basename:f,location:r.location,navigationType:r.historyAction,navigator:u},r.initialized?k.createElement(jI,{routes:n.routes,state:r}):e))),null)}function jI(t){let{routes:e,state:n}=t;return PI(e,void 0,n)}function $I(t){let{basename:e="/",children:n=null,location:i,navigationType:r=At.Pop,navigator:s,static:l=!1}=t;nc()&&De(!1);let a=e.replace(/^\/*/,"/"),u=k.useMemo(()=>({basename:a,navigator:s,static:l}),[a,s,l]);typeof i=="string"&&(i=mr(i));let{pathname:f="/",search:p="",hash:m="",state:o=null,key:c="default"}=i,d=k.useMemo(()=>{let h=qo(f,a);return h==null?null:{location:{pathname:h,search:p,hash:m,state:o,key:c},navigationType:r}},[a,f,p,m,o,c,r]);return d==null?null:k.createElement(Jo.Provider,{value:u},k.createElement(Tf.Provider,{children:n,value:d}))}new Promise(()=>{});function VI(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:k.createElement(t.Component),Component:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:k.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}function Nl(){return Nl=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Nl.apply(this,arguments)}function HI(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}function WI(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function GI(t,e){return t.button===0&&(!e||e==="_self")&&!WI(t)}function pg(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let i=t[n];return e.concat(Array.isArray(i)?i.map(r=>[n,r]):[[n,i]])},[]))}function YI(t,e){let n=pg(t);return e&&e.forEach((i,r)=>{n.has(r)||e.getAll(r).forEach(s=>{n.append(r,s)})}),n}const KI=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function QI(t,e){return pI({basename:e?.basename,future:Nl({},e?.future,{v7_prependBasename:!0}),history:UR({window:e?.window}),hydrationData:e?.hydrationData||ZI(),routes:t,mapRouteProperties:VI}).initialize()}function ZI(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=Nl({},e,{errors:XI(e.errors)})),e}function XI(t){if(!t)return null;let e=Object.entries(t),n={};for(let[i,r]of e)if(r&&r.__type==="RouteErrorResponse")n[i]=new Dv(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type==="Error"){if(r.__subType){let s=window[r.__subType];if(typeof s=="function")try{let l=new s(r.message);l.stack="",n[i]=l}catch{}}if(n[i]==null){let s=new Error(r.message);s.stack="",n[i]=s}}else n[i]=r;return n}const qI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",JI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gg=k.forwardRef(function(e,n){let{onClick:i,relative:r,reloadDocument:s,replace:l,state:a,target:u,to:f,preventScrollReset:p}=e,m=HI(e,KI),{basename:o}=k.useContext(Jo),c,d=!1;if(typeof f=="string"&&JI.test(f)&&(c=f,qI))try{let v=new URL(window.location.href),_=f.startsWith("//")?new URL(v.protocol+f):new URL(f),b=qo(_.pathname,o);_.origin===v.origin&&b!=null?f=b+_.search+_.hash:d=!0}catch{}let h=EI(f,{relative:r}),g=eU(f,{replace:l,state:a,target:u,preventScrollReset:p,relative:r});function y(v){i&&i(v),v.defaultPrevented||g(v)}return(k.createElement("a",Nl({},m,{href:c||h,onClick:d||s?i:y,ref:n,target:u})))});var xb;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher"})(xb||(xb={}));var wb;(function(t){t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(wb||(wb={}));function eU(t,e){let{target:n,replace:i,state:r,preventScrollReset:s,relative:l}=e===void 0?{}:e,a=Iv(),u=ic(),f=iE(t,{relative:l});return k.useCallback(p=>{if(GI(p,n)){p.preventDefault();let m=i!==void 0?i:zs(u)===zs(f);a(t,{replace:m,state:r,preventScrollReset:s,relative:l})}},[u,a,f,i,r,n,t,s,l])}function tU(t){let e=k.useRef(pg(t)),n=k.useRef(!1),i=ic(),r=k.useMemo(()=>(YI(i.search,n.current?null:e.current)),[i.search]),s=Iv(),l=k.useCallback((a,u)=>{const f=pg(typeof a=="function"?a(r):a);n.current=!0,s("?"+f,u)},[s,r]);return[r,l]}const oE="label";function Sb(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function nU(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function aE(t,e){t.labels=e}function lE(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:oE;const i=[];t.datasets=e.map(r=>{const s=t.datasets.find(l=>l[n]===r[n]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function iU(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:oE;const n={labels:[],datasets:[]};return aE(n,t.labels),lE(n,t.datasets,e),n}function rU(t,e){const{height:n=150,width:i=300,redraw:r=!1,datasetIdKey:s,type:l,data:a,options:u,plugins:f=[],fallbackContent:p,updateMode:m,...o}=t,c=k.useRef(null),d=k.useRef(),h=()=>{c.current&&(d.current=new af(c.current,{type:l,data:iU(a,s),options:u&&{...u},plugins:f}),Sb(e,d.current))},g=()=>{Sb(e,null),d.current&&(d.current.destroy(),d.current=null)};return k.useEffect(()=>{!r&&d.current&&u&&nU(d.current,u)},[r,u]),k.useEffect(()=>{!r&&d.current&&aE(d.current.config.data,a.labels)},[r,a.labels]),k.useEffect(()=>{!r&&d.current&&a.datasets&&lE(d.current.config.data,a.datasets,s)},[r,a.datasets]),k.useEffect(()=>{d.current&&(r?(g(),setTimeout(h)):d.current.update(m))},[r,u,a.labels,a.datasets,m]),k.useEffect(()=>{d.current&&(g(),setTimeout(h))},[l]),k.useEffect(()=>(h(),()=>g()),[]),ae.createElement("canvas",Object.assign({ref:c,role:"img",height:n,width:i},o),p)}const sU=k.forwardRef(rU);function oU(t,e){return af.register(e),k.forwardRef((n,i)=>ae.createElement(sU,Object.assign({},n,{ref:i,type:t})))}const aU=oU("line",_1);var We;(function(t){t.assertEqual=r=>r;function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{const s={};for(const l of r)s[l]=l;return s},t.getValidEnumValues=r=>{const s=t.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),l={};for(const a of s)l[a]=r[a];return t.objectValues(l)},t.objectValues=r=>t.objectKeys(r).map(function(s){return r[s]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&s.push(l);return s},t.find=(r,s)=>{for(const l of r)if(s(l))return l},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(l=>typeof l=="string"?`'${l}'`:l).join(s)}t.joinValues=i,t.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(We||(We={}));var kb;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(kb||(kb={}));const te=We.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_s=t=>{switch(typeof t){case"undefined":return te.undefined;case"string":return te.string;case"number":return isNaN(t)?te.nan:te.number;case"boolean":return te.boolean;case"function":return te.function;case"bigint":return te.bigint;case"symbol":return te.symbol;case"object":return Array.isArray(t)?te.array:t===null?te.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?te.promise:typeof Map<"u"&&t instanceof Map?te.map:typeof Set<"u"&&t instanceof Set?te.set:typeof Date<"u"&&t instanceof Date?te.date:te.object;default:return te.unknown}},Q=We.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class zi extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(s){return s.message},i={_errors:[]},r=s=>{for(const l of s.issues)if(l.code==="invalid_union")l.unionErrors.map(r);else if(l.code==="invalid_return_type")r(l.returnTypeError);else if(l.code==="invalid_arguments")r(l.argumentsError);else if(l.path.length===0)i._errors.push(n(l));else{let a=i,u=0;for(;u<l.path.length;){const f=l.path[u];u===l.path.length-1?(a[f]=a[f]||{_errors:[]},a[f]._errors.push(n(l))):a[f]=a[f]||{_errors:[]},a=a[f],u++}}};return r(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,We.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];for(const r of this.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(e(r))):i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}zi.create=t=>new zi(t);const fd=(t,e)=>{let n;switch(t.code){case Q.invalid_type:t.received===te.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,We.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:n=`Unrecognized key(s) in object: ${We.joinValues(t.keys,", ")}`;break;case Q.invalid_union:n="Invalid input";break;case Q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${We.joinValues(t.options)}`;break;case Q.invalid_enum_value:n=`Invalid enum value. Expected ${We.joinValues(t.options)}, received '${t.received}'`;break;case Q.invalid_arguments:n="Invalid function arguments";break;case Q.invalid_return_type:n="Invalid function return type";break;case Q.invalid_date:n="Invalid date";break;case Q.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:We.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Q.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Q.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Q.custom:n="Invalid input";break;case Q.invalid_intersection_types:n="Intersection results could not be merged";break;case Q.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Q.not_finite:n="Number must be finite";break;default:n=e.defaultError,We.assertNever(t)}return{message:n}};let lU=fd;function mg(){return lU}const vg=t=>{const{data:e,path:n,errorMaps:i,issueData:r}=t,s=[...n,...r.path||[]],l={...r,path:s};let a="";const u=i.filter(f=>!!f).slice().reverse();for(const f of u)a=f(l,{data:e,defaultError:a}).message;return{...r,path:s,message:r.message||a}};function ie(t,e){const n=vg({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,mg(),fd].filter(i=>!!i)});t.common.issues.push(n)}class dn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const r of n){if(r.status==="aborted")return Oe;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const r of n)i.push({key:await r.key,value:await r.value});return dn.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const r of n){const{key:s,value:l}=r;if(s.status==="aborted"||l.status==="aborted")return Oe;s.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||r.alwaysSet)&&(i[s.value]=l.value)}return{status:e.value,value:i}}}const Oe=Object.freeze({status:"aborted"}),cU=t=>({status:"dirty",value:t}),En=t=>({status:"valid",value:t}),Eb=t=>t.status==="aborted",Cb=t=>t.status==="dirty",hd=t=>t.status==="valid",yg=t=>typeof Promise<"u"&&t instanceof Promise;var ve;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ve||(ve={}));class ji{constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Tb=(t,e)=>{if(hd(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new zi(t.common.issues);return this._error=n,this._error}}};function Ae(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(l,a)=>l.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:i??a.defaultError}:{message:n??a.defaultError},description:r}}class Re{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return _s(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:_s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new dn,ctx:{common:e.parent.common,data:e.data,parsedType:_s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(yg(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const r={common:{issues:[],async:(i=n?.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_s(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Tb(r,s)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_s(e)},r=this._parse({data:e,path:i.path,parent:i}),s=await (yg(r)?r:Promise.resolve(r));return Tb(i,s)}refine(e,n){const i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,s)=>{const l=e(r),a=()=>s.addIssue({code:Q.custom,...i(r)});return typeof Promise<"u"&&l instanceof Promise?l.then(u=>u?!0:(a(),!1)):l?!0:(a(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new hr({schema:this,typeName:Se.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Kr.create(this,this._def)}nullable(){return Ho.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ni.create(this,this._def)}promise(){return jl.create(this,this._def)}or(e){return md.create([this,e],this._def)}and(e){return vd.create(this,e,this._def)}transform(e){return new hr({...Ae(this._def),schema:this,typeName:Se.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new wd({...Ae(this._def),innerType:this,defaultValue:n,typeName:Se.ZodDefault})}brand(){return new xU({typeName:Se.ZodBranded,type:this,...Ae(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Eg({...Ae(this._def),innerType:this,catchValue:n,typeName:Se.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Pf.create(this,e)}readonly(){return Tg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const uU=/^c[^\s-]{8,}$/i,dU=/^[a-z][a-z0-9]*$/,fU=/^[0-9A-HJKMNP-TV-Z]{26}$/,hU=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,pU=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,gU="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Eh;const mU=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,vU=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,yU=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function _U(t,e){return!!((e==="v4"||!e)&&mU.test(t)||(e==="v6"||!e)&&vU.test(t))}class sr extends Re{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==te.string){const s=this._getOrReturnCtx(e);return ie(s,{code:Q.invalid_type,expected:te.string,received:s.parsedType}),Oe}const i=new dn;let r;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),ie(r,{code:Q.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),ie(r,{code:Q.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const l=e.data.length>s.value,a=e.data.length<s.value;(l||a)&&(r=this._getOrReturnCtx(e,r),l?ie(r,{code:Q.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ie(r,{code:Q.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")pU.test(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{validation:"email",code:Q.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")Eh||(Eh=new RegExp(gU,"u")),Eh.test(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{validation:"emoji",code:Q.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")hU.test(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{validation:"uuid",code:Q.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")uU.test(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{validation:"cuid",code:Q.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")dU.test(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{validation:"cuid2",code:Q.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")fU.test(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{validation:"ulid",code:Q.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),ie(r,{validation:"url",code:Q.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{validation:"regex",code:Q.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),ie(r,{code:Q.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),ie(r,{code:Q.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),ie(r,{code:Q.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?yU(s).test(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{code:Q.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="ip"?_U(e.data,s.version)||(r=this._getOrReturnCtx(e,r),ie(r,{validation:"ip",code:Q.invalid_string,message:s.message}),i.dirty()):We.assertNever(s);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:Q.invalid_string,...ve.errToObj(i)})}_addCheck(e){return new sr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ve.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ve.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ve.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ve.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ve.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ve.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ve.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ve.errToObj(e)})}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(n=e?.offset)!==null&&n!==void 0?n:!1,...ve.errToObj(e?.message)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ve.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...ve.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ve.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ve.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ve.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ve.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ve.errToObj(n)})}nonempty(e){return this.min(1,ve.errToObj(e))}trim(){return new sr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new sr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new sr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}sr.create=t=>{var e;return new sr({checks:[],typeName:Se.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};function bU(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,s=parseInt(t.toFixed(r).replace(".","")),l=parseInt(e.toFixed(r).replace(".",""));return s%l/Math.pow(10,r)}class jo extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==te.number){const s=this._getOrReturnCtx(e);return ie(s,{code:Q.invalid_type,expected:te.number,received:s.parsedType}),Oe}let i;const r=new dn;for(const s of this._def.checks)s.kind==="int"?We.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:Q.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),ie(i,{code:Q.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),ie(i,{code:Q.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?bU(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),ie(i,{code:Q.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:Q.not_finite,message:s.message}),r.dirty()):We.assertNever(s);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ve.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ve.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ve.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ve.toString(n))}setLimit(e,n,i,r){return new jo({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ve.toString(r)}]})}_addCheck(e){return new jo({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ve.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ve.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ve.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ve.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ve.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ve.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ve.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ve.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ve.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&We.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}jo.create=t=>new jo({checks:[],typeName:Se.ZodNumber,coerce:t?.coerce||!1,...Ae(t)});class $o extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==te.bigint){const s=this._getOrReturnCtx(e);return ie(s,{code:Q.invalid_type,expected:te.bigint,received:s.parsedType}),Oe}let i;const r=new dn;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),ie(i,{code:Q.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),ie(i,{code:Q.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),ie(i,{code:Q.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):We.assertNever(s);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ve.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ve.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ve.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ve.toString(n))}setLimit(e,n,i,r){return new $o({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ve.toString(r)}]})}_addCheck(e){return new $o({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ve.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ve.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ve.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ve.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ve.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}$o.create=t=>{var e;return new $o({checks:[],typeName:Se.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};class _g extends Re{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==te.boolean){const i=this._getOrReturnCtx(e);return ie(i,{code:Q.invalid_type,expected:te.boolean,received:i.parsedType}),Oe}return En(e.data)}}_g.create=t=>new _g({typeName:Se.ZodBoolean,coerce:t?.coerce||!1,...Ae(t)});class Bl extends Re{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==te.date){const s=this._getOrReturnCtx(e);return ie(s,{code:Q.invalid_type,expected:te.date,received:s.parsedType}),Oe}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ie(s,{code:Q.invalid_date}),Oe}const i=new dn;let r;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(r=this._getOrReturnCtx(e,r),ie(r,{code:Q.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(r=this._getOrReturnCtx(e,r),ie(r,{code:Q.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):We.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Bl({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ve.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ve.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Bl.create=t=>new Bl({checks:[],coerce:t?.coerce||!1,typeName:Se.ZodDate,...Ae(t)});class bg extends Re{_parse(e){if(this._getType(e)!==te.symbol){const i=this._getOrReturnCtx(e);return ie(i,{code:Q.invalid_type,expected:te.symbol,received:i.parsedType}),Oe}return En(e.data)}}bg.create=t=>new bg({typeName:Se.ZodSymbol,...Ae(t)});class pd extends Re{_parse(e){if(this._getType(e)!==te.undefined){const i=this._getOrReturnCtx(e);return ie(i,{code:Q.invalid_type,expected:te.undefined,received:i.parsedType}),Oe}return En(e.data)}}pd.create=t=>new pd({typeName:Se.ZodUndefined,...Ae(t)});class gd extends Re{_parse(e){if(this._getType(e)!==te.null){const i=this._getOrReturnCtx(e);return ie(i,{code:Q.invalid_type,expected:te.null,received:i.parsedType}),Oe}return En(e.data)}}gd.create=t=>new gd({typeName:Se.ZodNull,...Ae(t)});class xg extends Re{constructor(){super(...arguments),this._any=!0}_parse(e){return En(e.data)}}xg.create=t=>new xg({typeName:Se.ZodAny,...Ae(t)});class Co extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return En(e.data)}}Co.create=t=>new Co({typeName:Se.ZodUnknown,...Ae(t)});class Jr extends Re{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:Q.invalid_type,expected:te.never,received:n.parsedType}),Oe}}Jr.create=t=>new Jr({typeName:Se.ZodNever,...Ae(t)});class wg extends Re{_parse(e){if(this._getType(e)!==te.undefined){const i=this._getOrReturnCtx(e);return ie(i,{code:Q.invalid_type,expected:te.void,received:i.parsedType}),Oe}return En(e.data)}}wg.create=t=>new wg({typeName:Se.ZodVoid,...Ae(t)});class Ni extends Re{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==te.array)return ie(n,{code:Q.invalid_type,expected:te.array,received:n.parsedType}),Oe;if(r.exactLength!==null){const l=n.data.length>r.exactLength.value,a=n.data.length<r.exactLength.value;(l||a)&&(ie(n,{code:l?Q.too_big:Q.too_small,minimum:a?r.exactLength.value:void 0,maximum:l?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(ie(n,{code:Q.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(ie(n,{code:Q.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((l,a)=>r.type._parseAsync(new ji(n,l,n.path,a)))).then(l=>dn.mergeArray(i,l));const s=[...n.data].map((l,a)=>r.type._parseSync(new ji(n,l,n.path,a)));return dn.mergeArray(i,s)}get element(){return this._def.type}min(e,n){return new Ni({...this._def,minLength:{value:e,message:ve.toString(n)}})}max(e,n){return new Ni({...this._def,maxLength:{value:e,message:ve.toString(n)}})}length(e,n){return new Ni({...this._def,exactLength:{value:e,message:ve.toString(n)}})}nonempty(e){return this.min(1,e)}}Ni.create=(t,e)=>new Ni({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Se.ZodArray,...Ae(e)});function eo(t){if(t instanceof _t){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=Kr.create(eo(i))}return new _t({...t._def,shape:()=>e})}else return t instanceof Ni?new Ni({...t._def,type:eo(t.element)}):t instanceof Kr?Kr.create(eo(t.unwrap())):t instanceof Ho?Ho.create(eo(t.unwrap())):t instanceof fr?fr.create(t.items.map(e=>eo(e))):t}class _t extends Re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=We.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==te.object){const f=this._getOrReturnCtx(e);return ie(f,{code:Q.invalid_type,expected:te.object,received:f.parsedType}),Oe}const{status:i,ctx:r}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),a=[];if(!(this._def.catchall instanceof Jr&&this._def.unknownKeys==="strip"))for(const f in r.data)l.includes(f)||a.push(f);const u=[];for(const f of l){const p=s[f],m=r.data[f];u.push({key:{status:"valid",value:f},value:p._parse(new ji(r,m,r.path,f)),alwaysSet:f in r.data})}if(this._def.catchall instanceof Jr){const f=this._def.unknownKeys;if(f==="passthrough")for(const p of a)u.push({key:{status:"valid",value:p},value:{status:"valid",value:r.data[p]}});else if(f==="strict")a.length>0&&(ie(r,{code:Q.unrecognized_keys,keys:a}),i.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const p of a){const m=r.data[p];u.push({key:{status:"valid",value:p},value:f._parse(new ji(r,m,r.path,p)),alwaysSet:p in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const f=[];for(const p of u){const m=await p.key;f.push({key:m,value:await p.value,alwaysSet:p.alwaysSet})}return f}).then(f=>dn.mergeObjectSync(i,f)):dn.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(e){return ve.errToObj,new _t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var r,s,l,a;const u=(l=(s=(r=this._def).errorMap)===null||s===void 0?void 0:s.call(r,n,i).message)!==null&&l!==void 0?l:i.defaultError;return n.code==="unrecognized_keys"?{message:(a=ve.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new _t({...this._def,unknownKeys:"strip"})}passthrough(){return new _t({...this._def,unknownKeys:"passthrough"})}extend(e){return new _t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new _t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Se.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new _t({...this._def,catchall:e})}pick(e){const n={};return We.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new _t({...this._def,shape:()=>n})}omit(e){const n={};return We.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new _t({...this._def,shape:()=>n})}deepPartial(){return eo(this)}partial(e){const n={};return We.objectKeys(this.shape).forEach(i=>{const r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}),new _t({...this._def,shape:()=>n})}required(e){const n={};return We.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Kr;)s=s._def.innerType;n[i]=s}}),new _t({...this._def,shape:()=>n})}keyof(){return cE(We.objectKeys(this.shape))}}_t.create=(t,e)=>new _t({shape:()=>t,unknownKeys:"strip",catchall:Jr.create(),typeName:Se.ZodObject,...Ae(e)});_t.strictCreate=(t,e)=>new _t({shape:()=>t,unknownKeys:"strict",catchall:Jr.create(),typeName:Se.ZodObject,...Ae(e)});_t.lazycreate=(t,e)=>new _t({shape:t,unknownKeys:"strip",catchall:Jr.create(),typeName:Se.ZodObject,...Ae(e)});class md extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function r(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const l=s.map(a=>new zi(a.ctx.common.issues));return ie(n,{code:Q.invalid_union,unionErrors:l}),Oe}if(n.common.async)return Promise.all(i.map(async s=>{const l={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(r);{let s;const l=[];for(const u of i){const f={...n,common:{...n.common,issues:[]},parent:null},p=u._parseSync({data:n.data,path:n.path,parent:f});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=l.map(u=>new zi(u));return ie(n,{code:Q.invalid_union,unionErrors:a}),Oe}}get options(){return this._def.options}}md.create=(t,e)=>new md({options:t,typeName:Se.ZodUnion,...Ae(e)});const fu=t=>t instanceof _d?fu(t.schema):t instanceof hr?fu(t.innerType()):t instanceof bd?[t.value]:t instanceof Ns?t.options:t instanceof xd?Object.keys(t.enum):t instanceof wd?fu(t._def.innerType):t instanceof pd?[void 0]:t instanceof gd?[null]:null;class Uv extends Re{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==te.object)return ie(n,{code:Q.invalid_type,expected:te.object,received:n.parsedType}),Oe;const i=this.discriminator,r=n.data[i],s=this.optionsMap.get(r);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const r=new Map;for(const s of n){const l=fu(s.shape[e]);if(!l)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of l){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,s)}}return new Uv({typeName:Se.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...Ae(i)})}}function Sg(t,e){const n=_s(t),i=_s(e);if(t===e)return{valid:!0,data:t};if(n===te.object&&i===te.object){const r=We.objectKeys(e),s=We.objectKeys(t).filter(a=>r.indexOf(a)!==-1),l={...t,...e};for(const a of s){const u=Sg(t[a],e[a]);if(!u.valid)return{valid:!1};l[a]=u.data}return{valid:!0,data:l}}else if(n===te.array&&i===te.array){if(t.length!==e.length)return{valid:!1};const r=[];for(let s=0;s<t.length;s++){const l=t[s],a=e[s],u=Sg(l,a);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return n===te.date&&i===te.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class vd extends Re{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),r=(s,l)=>{if(Eb(s)||Eb(l))return Oe;const a=Sg(s.value,l.value);return a.valid?((Cb(s)||Cb(l))&&n.dirty(),{status:n.value,value:a.data}):(ie(i,{code:Q.invalid_intersection_types}),Oe)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,l])=>r(s,l)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}vd.create=(t,e,n)=>new vd({left:t,right:e,typeName:Se.ZodIntersection,...Ae(n)});class fr extends Re{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==te.array)return ie(i,{code:Q.invalid_type,expected:te.array,received:i.parsedType}),Oe;if(i.data.length<this._def.items.length)return ie(i,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Oe;!this._def.rest&&i.data.length>this._def.items.length&&(ie(i,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...i.data].map((l,a)=>{const u=this._def.items[a]||this._def.rest;return u?u._parse(new ji(i,l,i.path,a)):null}).filter(l=>!!l);return i.common.async?Promise.all(s).then(l=>dn.mergeArray(n,l)):dn.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new fr({...this._def,rest:e})}}fr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fr({items:t,typeName:Se.ZodTuple,rest:null,...Ae(e)})};class yd extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==te.object)return ie(i,{code:Q.invalid_type,expected:te.object,received:i.parsedType}),Oe;const r=[],s=this._def.keyType,l=this._def.valueType;for(const a in i.data)r.push({key:s._parse(new ji(i,a,i.path,a)),value:l._parse(new ji(i,i.data[a],i.path,a))});return i.common.async?dn.mergeObjectAsync(n,r):dn.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Re?new yd({keyType:e,valueType:n,typeName:Se.ZodRecord,...Ae(i)}):new yd({keyType:sr.create(),valueType:e,typeName:Se.ZodRecord,...Ae(n)})}}class kg extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==te.map)return ie(i,{code:Q.invalid_type,expected:te.map,received:i.parsedType}),Oe;const r=this._def.keyType,s=this._def.valueType,l=[...i.data.entries()].map(([a,u],f)=>({key:r._parse(new ji(i,a,i.path,[f,"key"])),value:s._parse(new ji(i,u,i.path,[f,"value"]))}));if(i.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const u of l){const f=await u.key,p=await u.value;if(f.status==="aborted"||p.status==="aborted")return Oe;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),a.set(f.value,p.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const u of l){const f=u.key,p=u.value;if(f.status==="aborted"||p.status==="aborted")return Oe;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),a.set(f.value,p.value)}return{status:n.value,value:a}}}}kg.create=(t,e,n)=>new kg({valueType:e,keyType:t,typeName:Se.ZodMap,...Ae(n)});class Vo extends Re{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==te.set)return ie(i,{code:Q.invalid_type,expected:te.set,received:i.parsedType}),Oe;const r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(ie(i,{code:Q.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(ie(i,{code:Q.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());const s=this._def.valueType;function l(u){const f=new Set;for(const p of u){if(p.status==="aborted")return Oe;p.status==="dirty"&&n.dirty(),f.add(p.value)}return{status:n.value,value:f}}const a=[...i.data.values()].map((u,f)=>s._parse(new ji(i,u,i.path,f)));return i.common.async?Promise.all(a).then(u=>l(u)):l(a)}min(e,n){return new Vo({...this._def,minSize:{value:e,message:ve.toString(n)}})}max(e,n){return new Vo({...this._def,maxSize:{value:e,message:ve.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Vo.create=(t,e)=>new Vo({valueType:t,minSize:null,maxSize:null,typeName:Se.ZodSet,...Ae(e)});class el extends Re{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==te.function)return ie(n,{code:Q.invalid_type,expected:te.function,received:n.parsedType}),Oe;function i(a,u){return vg({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,mg(),fd].filter(f=>!!f),issueData:{code:Q.invalid_arguments,argumentsError:u}})}function r(a,u){return vg({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,mg(),fd].filter(f=>!!f),issueData:{code:Q.invalid_return_type,returnTypeError:u}})}const s={errorMap:n.common.contextualErrorMap},l=n.data;if(this._def.returns instanceof jl){const a=this;return En(async function(...u){const f=new zi([]),p=await a._def.args.parseAsync(u,s).catch(c=>{throw f.addIssue(i(u,c)),f}),m=await Reflect.apply(l,this,p);return await a._def.returns._def.type.parseAsync(m,s).catch(c=>{throw f.addIssue(r(m,c)),f})})}else{const a=this;return En(function(...u){const f=a._def.args.safeParse(u,s);if(!f.success)throw new zi([i(u,f.error)]);const p=Reflect.apply(l,this,f.data),m=a._def.returns.safeParse(p,s);if(!m.success)throw new zi([r(p,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new el({...this._def,args:fr.create(e).rest(Co.create())})}returns(e){return new el({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new el({args:e||fr.create([]).rest(Co.create()),returns:n||Co.create(),typeName:Se.ZodFunction,...Ae(i)})}}class _d extends Re{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}_d.create=(t,e)=>new _d({getter:t,typeName:Se.ZodLazy,...Ae(e)});class bd extends Re{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:Q.invalid_literal,expected:this._def.value}),Oe}return{status:"valid",value:e.data}}get value(){return this._def.value}}bd.create=(t,e)=>new bd({value:t,typeName:Se.ZodLiteral,...Ae(e)});function cE(t,e){return new Ns({values:t,typeName:Se.ZodEnum,...Ae(e)})}class Ns extends Re{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return ie(n,{expected:We.joinValues(i),received:n.parsedType,code:Q.invalid_type}),Oe}if(this._def.values.indexOf(e.data)===-1){const n=this._getOrReturnCtx(e),i=this._def.values;return ie(n,{received:n.data,code:Q.invalid_enum_value,options:i}),Oe}return En(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e){return Ns.create(e)}exclude(e){return Ns.create(this.options.filter(n=>!e.includes(n)))}}Ns.create=cE;class xd extends Re{_parse(e){const n=We.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==te.string&&i.parsedType!==te.number){const r=We.objectValues(n);return ie(i,{expected:We.joinValues(r),received:i.parsedType,code:Q.invalid_type}),Oe}if(n.indexOf(e.data)===-1){const r=We.objectValues(n);return ie(i,{received:i.data,code:Q.invalid_enum_value,options:r}),Oe}return En(e.data)}get enum(){return this._def.values}}xd.create=(t,e)=>new xd({values:t,typeName:Se.ZodNativeEnum,...Ae(e)});class jl extends Re{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==te.promise&&n.common.async===!1)return ie(n,{code:Q.invalid_type,expected:te.promise,received:n.parsedType}),Oe;const i=n.parsedType===te.promise?n.data:Promise.resolve(n.data);return En(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}}jl.create=(t,e)=>new jl({type:t,typeName:Se.ZodPromise,...Ae(e)});class hr extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:l=>{ie(i,l),l.fatal?n.abort():n.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const l=r.transform(i.data,s);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(l).then(a=>this._def.schema._parseAsync({data:a,path:i.path,parent:i})):this._def.schema._parseSync({data:l,path:i.path,parent:i})}if(r.type==="refinement"){const l=a=>{const u=r.refinement(a,s);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(i.common.async===!1){const a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?Oe:(a.status==="dirty"&&n.dirty(),l(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?Oe:(a.status==="dirty"&&n.dirty(),l(a.value).then(()=>({status:n.value,value:a.value}))))}if(r.type==="transform")if(i.common.async===!1){const l=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!hd(l))return l;const a=r.transform(l.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(l=>hd(l)?Promise.resolve(r.transform(l.value,s)).then(a=>({status:n.value,value:a})):l);We.assertNever(r)}}hr.create=(t,e,n)=>new hr({schema:t,typeName:Se.ZodEffects,effect:e,...Ae(n)});hr.createWithPreprocess=(t,e,n)=>new hr({schema:e,effect:{type:"preprocess",transform:t},typeName:Se.ZodEffects,...Ae(n)});class Kr extends Re{_parse(e){return this._getType(e)===te.undefined?En(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Kr.create=(t,e)=>new Kr({innerType:t,typeName:Se.ZodOptional,...Ae(e)});class Ho extends Re{_parse(e){return this._getType(e)===te.null?En(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ho.create=(t,e)=>new Ho({innerType:t,typeName:Se.ZodNullable,...Ae(e)});class wd extends Re{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===te.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}wd.create=(t,e)=>new wd({innerType:t,typeName:Se.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ae(e)});class Eg extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return yg(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new zi(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new zi(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Eg.create=(t,e)=>new Eg({innerType:t,typeName:Se.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ae(e)});class Cg extends Re{_parse(e){if(this._getType(e)!==te.nan){const i=this._getOrReturnCtx(e);return ie(i,{code:Q.invalid_type,expected:te.nan,received:i.parsedType}),Oe}return{status:"valid",value:e.data}}}Cg.create=t=>new Cg({typeName:Se.ZodNaN,...Ae(t)});class xU extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class Pf extends Re{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Oe:s.status==="dirty"?(n.dirty(),cU(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?Oe:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new Pf({in:e,out:n,typeName:Se.ZodPipeline})}}class Tg extends Re{_parse(e){const n=this._def.innerType._parse(e);return hd(n)&&(n.value=Object.freeze(n.value)),n}}Tg.create=(t,e)=>new Tg({innerType:t,typeName:Se.ZodReadonly,...Ae(e)});_t.lazycreate;var Se;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Se||(Se={}));sr.create;const wU=jo.create;Cg.create;$o.create;const SU=_g.create;Bl.create;bg.create;pd.create;gd.create;xg.create;Co.create;Jr.create;wg.create;Ni.create;const kU=_t.create;_t.strictCreate;md.create;Uv.create;vd.create;fr.create;yd.create;kg.create;Vo.create;el.create;_d.create;bd.create;Ns.create;xd.create;jl.create;hr.create;Kr.create;Ho.create;hr.createWithPreprocess;Pf.create;var rc=t=>t.type==="checkbox",mo=t=>t instanceof Date,cn=t=>t==null;const uE=t=>typeof t=="object";var Ft=t=>!cn(t)&&!Array.isArray(t)&&uE(t)&&!mo(t),EU=t=>Ft(t)&&t.target?rc(t.target)?t.target.checked:t.target.value:t,CU=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,TU=(t,e)=>t.has(CU(e)),PU=t=>{const e=t.constructor&&t.constructor.prototype;return Ft(e)&&e.hasOwnProperty("isPrototypeOf")},Fv=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ki(t){let e;const n=Array.isArray(t);if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(Fv&&(t instanceof Blob||t instanceof FileList))&&(n||Ft(t)))if(e=n?[]:{},!n&&!PU(t))e=t;else for(const i in t)t.hasOwnProperty(i)&&(e[i]=Ki(t[i]));else return t;return e}var sc=t=>Array.isArray(t)?t.filter(Boolean):[],Ct=t=>t===void 0,de=(t,e,n)=>{if(!e||!Ft(t))return n;const i=sc(e.split(/[,[\].]+?/)).reduce((r,s)=>cn(r)?r:r[s],t);return Ct(i)||i===t?Ct(t[e])?n:t[e]:i},Ar=t=>typeof t=="boolean";const Pb={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},pi={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Wi={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};ae.createContext(null);var AU=(t,e,n,i=!0)=>{const r={defaultValues:e._defaultValues};for(const s in t)Object.defineProperty(r,s,{get:()=>{const l=s;return e._proxyFormState[l]!==pi.all&&(e._proxyFormState[l]=!i||pi.all),n&&(n[l]=!0),t[l]}});return r},Kn=t=>Ft(t)&&!Object.keys(t).length,OU=(t,e,n,i)=>{n(t);const{name:r,...s}=t;return Kn(s)||Object.keys(s).length>=Object.keys(e).length||Object.keys(s).find(l=>e[l]===(!i||pi.all))},Ch=t=>Array.isArray(t)?t:[t];function LU(t){const e=ae.useRef(t);e.current=t,ae.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}var Di=t=>typeof t=="string",MU=(t,e,n,i,r)=>Di(t)?(i&&e.watch.add(t),de(n,t,r)):Array.isArray(t)?t.map(s=>(i&&e.watch.add(s),de(n,s))):(i&&(e.watchAll=!0),n),zv=t=>/^\w*$/.test(t),dE=t=>sc(t.replace(/["|']|\]/g,"").split(/\.|\[/));function Je(t,e,n){let i=-1;const r=zv(e)?[e]:dE(e),s=r.length,l=s-1;for(;++i<s;){const a=r[i];let u=n;if(i!==l){const f=t[a];u=Ft(f)||Array.isArray(f)?f:isNaN(+r[i+1])?{}:[]}t[a]=u,t=t[a]}return t}var fE=(t,e,n,i,r)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[i]:r||!0}}:{},Ab=t=>({isOnSubmit:!t||t===pi.onSubmit,isOnBlur:t===pi.onBlur,isOnChange:t===pi.onChange,isOnAll:t===pi.all,isOnTouch:t===pi.onTouched}),Ob=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(i=>t.startsWith(i)&&/^\.\w+/.test(t.slice(i.length))));const hu=(t,e,n,i)=>{for(const r of n||Object.keys(t)){const s=de(t,r);if(s){const{_f:l,...a}=s;if(l){if(l.refs&&l.refs[0]&&e(l.refs[0],r)&&!i)break;if(l.ref&&e(l.ref,l.name)&&!i)break}else Ft(a)&&hu(a,e)}}};var DU=(t,e,n)=>{const i=sc(de(t,n));return Je(i,"root",e[n]),Je(t,n,i),t},Nv=t=>t.type==="file",zr=t=>typeof t=="function",Sd=t=>{if(!Fv)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},pu=t=>Di(t),Bv=t=>t.type==="radio",kd=t=>t instanceof RegExp;const Lb={value:!1,isValid:!1},Mb={value:!0,isValid:!0};var hE=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?(t[0].attributes&&!Ct(t[0].attributes.value)?Ct(t[0].value)||t[0].value===""?Mb:{value:t[0].value,isValid:!0}:Mb):Lb}return Lb};const Db={isValid:!1,value:null};var pE=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,Db):Db;function Rb(t,e,n="validate"){if(pu(t)||Array.isArray(t)&&t.every(pu)||Ar(t)&&!t)return{type:n,message:pu(t)?t:"",ref:e}}var Ys=t=>Ft(t)&&!kd(t)?t:{value:t,message:""},Ib=async(t,e,n,i,r)=>{const{ref:s,refs:l,required:a,maxLength:u,minLength:f,min:p,max:m,pattern:o,validate:c,name:d,valueAsNumber:h,mount:g,disabled:y}=t._f,v=de(e,d);if(!g||y)return{};const _=l?l[0]:s,b=F=>{i&&_.reportValidity&&(_.setCustomValidity(Ar(F)?"":F||""),_.reportValidity())},x={},w=Bv(s),S=rc(s),C=w||S,T=(h||Nv(s))&&Ct(s.value)&&Ct(v)||Sd(s)&&s.value===""||v===""||Array.isArray(v)&&!v.length,M=fE.bind(null,d,n,x),B=(F,N,W,H=Wi.maxLength,Y=Wi.minLength)=>{const ee=F?N:W;x[d]={type:F?H:Y,message:ee,ref:s,...M(F?H:Y,ee)}};if(r?!Array.isArray(v)||!v.length:a&&(!C&&(T||cn(v))||Ar(v)&&!v||S&&!hE(l).isValid||w&&!pE(l).isValid)){const{value:F,message:N}=pu(a)?{value:!!a,message:a}:Ys(a);if(F&&(x[d]={type:Wi.required,message:N,ref:_,...M(Wi.required,N)},!n))return b(N),x}if(!T&&(!cn(p)||!cn(m))){let F,N;const W=Ys(m),H=Ys(p);if(!cn(v)&&!isNaN(v)){const Y=s.valueAsNumber||v&&+v;cn(W.value)||(F=Y>W.value),cn(H.value)||(N=Y<H.value)}else{const Y=s.valueAsDate||new Date(v),ee=X=>new Date((new Date).toDateString()+" "+X),I=s.type=="time",z=s.type=="week";Di(W.value)&&v&&(F=I?ee(v)>ee(W.value):z?v>W.value:Y>new Date(W.value)),Di(H.value)&&v&&(N=I?ee(v)<ee(H.value):z?v<H.value:Y<new Date(H.value))}if((F||N)&&(B(!!F,W.message,H.message,Wi.max,Wi.min),!n))return b(x[d].message),x}if((u||f)&&!T&&(Di(v)||r&&Array.isArray(v))){const F=Ys(u),N=Ys(f),W=!cn(F.value)&&v.length>+F.value,H=!cn(N.value)&&v.length<+N.value;if((W||H)&&(B(W,F.message,N.message),!n))return b(x[d].message),x}if(o&&!T&&Di(v)){const{value:F,message:N}=Ys(o);if(kd(F)&&!v.match(F)&&(x[d]={type:Wi.pattern,message:N,ref:s,...M(Wi.pattern,N)},!n))return b(N),x}if(c){if(zr(c)){const F=await c(v,e),N=Rb(F,_);if(N&&(x[d]={...N,...M(Wi.validate,N.message)},!n))return b(N.message),x}else if(Ft(c)){let F={};for(const N in c){if(!Kn(F)&&!n)break;const W=Rb(await c[N](v,e),_,N);W&&(F={...W,...M(N,W.message)},b(W.message),n&&(x[d]=F))}if(!Kn(F)&&(x[d]={ref:_,...F},!n))return x}}return b(!0),x};function RU(t,e){const n=e.slice(0,-1).length;let i=0;for(;i<n;)t=Ct(t)?i++:t[e[i++]];return t}function IU(t){for(const e in t)if(t.hasOwnProperty(e)&&!Ct(t[e]))return!1;return!0}function Ht(t,e){const n=Array.isArray(e)?e:zv(e)?[e]:dE(e),i=n.length===1?t:RU(t,n),r=n.length-1,s=n[r];return i&&delete i[s],r!==0&&(Ft(i)&&Kn(i)||Array.isArray(i)&&IU(i))&&Ht(t,n.slice(0,-1)),t}function Th(){let t=[];return{get observers(){return t},next:r=>{for(const s of t)s.next&&s.next(r)},subscribe:r=>(t.push(r),{unsubscribe:()=>{t=t.filter(s=>s!==r)}}),unsubscribe:()=>{t=[]}}}var Ed=t=>cn(t)||!uE(t);function Es(t,e){if(Ed(t)||Ed(e))return t===e;if(mo(t)&&mo(e))return t.getTime()===e.getTime();const n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(const r of n){const s=t[r];if(!i.includes(r))return!1;if(r!=="ref"){const l=e[r];if(mo(s)&&mo(l)||Ft(s)&&Ft(l)||Array.isArray(s)&&Array.isArray(l)?!Es(s,l):s!==l)return!1}}return!0}var gE=t=>t.type==="select-multiple",UU=t=>Bv(t)||rc(t),Ph=t=>Sd(t)&&t.isConnected,mE=t=>{for(const e in t)if(zr(t[e]))return!0;return!1};function Cd(t,e={}){const n=Array.isArray(t);if(Ft(t)||n)for(const i in t)Array.isArray(t[i])||Ft(t[i])&&!mE(t[i])?(e[i]=Array.isArray(t[i])?[]:{},Cd(t[i],e[i])):cn(t[i])||(e[i]=!0);return e}function vE(t,e,n){const i=Array.isArray(t);if(Ft(t)||i)for(const r in t)Array.isArray(t[r])||Ft(t[r])&&!mE(t[r])?Ct(e)||Ed(n[r])?n[r]=Array.isArray(t[r])?Cd(t[r],[]):{...Cd(t[r])}:vE(t[r],cn(e)?{}:e[r],n[r]):n[r]=!Es(t[r],e[r]);return n}var Ah=(t,e)=>vE(t,e,Cd(e)),yE=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:i})=>Ct(t)?t:e?t===""?NaN:t&&+t:n&&Di(t)?new Date(t):i?i(t):t;function Oh(t){const e=t.ref;if(!(t.refs?t.refs.every(n=>n.disabled):e.disabled))return Nv(e)?e.files:Bv(e)?pE(t.refs).value:gE(e)?[...e.selectedOptions].map(({value:n})=>n):rc(e)?hE(t.refs).value:yE(Ct(e.value)?t.ref.value:e.value,t)}var FU=(t,e,n,i)=>{const r={};for(const s of t){const l=de(e,s);l&&Je(r,s,l._f)}return{criteriaMode:n,names:[...t],fields:r,shouldUseNativeValidation:i}},wa=t=>Ct(t)?t:kd(t)?t.source:Ft(t)?kd(t.value)?t.value.source:t.value:t,zU=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function Ub(t,e,n){const i=de(t,n);if(i||zv(n))return{error:i,name:n};const r=n.split(".");for(;r.length;){const s=r.join("."),l=de(e,s),a=de(t,s);if(l&&!Array.isArray(l)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};r.pop()}return{name:n}}var NU=(t,e,n,i,r)=>r.isOnAll?!1:!n&&r.isOnTouch?!(e||t):(n?i.isOnBlur:r.isOnBlur)?!t:(n?i.isOnChange:r.isOnChange)?t:!0,BU=(t,e)=>!sc(de(t,e)).length&&Ht(t,e);const jU={mode:pi.onSubmit,reValidateMode:pi.onChange,shouldFocusError:!0};function $U(t={},e){let n={...jU,...t},i={submitCount:0,isDirty:!1,isLoading:zr(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},r={},s=Ft(n.defaultValues)||Ft(n.values)?Ki(n.defaultValues||n.values)||{}:{},l=n.shouldUnregister?{}:Ki(s),a={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},f,p=0;const m={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},o={values:Th(),array:Th(),state:Th()},c=t.resetOptions&&t.resetOptions.keepDirtyValues,d=Ab(n.mode),h=Ab(n.reValidateMode),g=n.criteriaMode===pi.all,y=E=>A=>{clearTimeout(p),p=setTimeout(E,A)},v=async E=>{if(m.isValid||E){const A=n.resolver?Kn((await T()).errors):await B(r,!0);A!==i.isValid&&o.state.next({isValid:A})}},_=E=>m.isValidating&&o.state.next({isValidating:E}),b=(E,A=[],D,J,Z=!0,P=!0)=>{if(J&&D){if(a.action=!0,P&&Array.isArray(de(r,E))){const $=D(de(r,E),J.argA,J.argB);Z&&Je(r,E,$)}if(P&&Array.isArray(de(i.errors,E))){const $=D(de(i.errors,E),J.argA,J.argB);Z&&Je(i.errors,E,$),BU(i.errors,E)}if(m.touchedFields&&P&&Array.isArray(de(i.touchedFields,E))){const $=D(de(i.touchedFields,E),J.argA,J.argB);Z&&Je(i.touchedFields,E,$)}m.dirtyFields&&(i.dirtyFields=Ah(s,l)),o.state.next({name:E,isDirty:N(E,A),dirtyFields:i.dirtyFields,errors:i.errors,isValid:i.isValid})}else Je(l,E,A)},x=(E,A)=>{Je(i.errors,E,A),o.state.next({errors:i.errors})},w=(E,A,D,J)=>{const Z=de(r,E);if(Z){const P=de(l,E,Ct(D)?de(s,E):D);Ct(P)||J&&J.defaultChecked||A?Je(l,E,A?P:Oh(Z._f)):Y(E,P),a.mount&&v()}},S=(E,A,D,J,Z)=>{let P=!1,$=!1;const se={name:E};if(!D||J){m.isDirty&&($=i.isDirty,i.isDirty=se.isDirty=N(),P=$!==se.isDirty);const Ee=Es(de(s,E),A);$=de(i.dirtyFields,E),Ee?Ht(i.dirtyFields,E):Je(i.dirtyFields,E,!0),se.dirtyFields=i.dirtyFields,P=P||m.dirtyFields&&$!==!Ee}if(D){const Ee=de(i.touchedFields,E);Ee||(Je(i.touchedFields,E,D),se.touchedFields=i.touchedFields,P=P||m.touchedFields&&Ee!==D)}return P&&Z&&o.state.next(se),P?se:{}},C=(E,A,D,J)=>{const Z=de(i.errors,E),P=m.isValid&&Ar(A)&&i.isValid!==A;if(t.delayError&&D?(f=y(()=>x(E,D)),f(t.delayError)):(clearTimeout(p),f=null,D?Je(i.errors,E,D):Ht(i.errors,E)),(D?!Es(Z,D):Z)||!Kn(J)||P){const $={...J,...P&&Ar(A)?{isValid:A}:{},errors:i.errors,name:E};i={...i,...$},o.state.next($)}_(!1)},T=async E=>n.resolver(l,n.context,FU(E||u.mount,r,n.criteriaMode,n.shouldUseNativeValidation)),M=async E=>{const{errors:A}=await T(E);if(E)for(const D of E){const J=de(A,D);J?Je(i.errors,D,J):Ht(i.errors,D)}else i.errors=A;return A},B=async(E,A,D={valid:!0})=>{for(const J in E){const Z=E[J];if(Z){const{_f:P,...$}=Z;if(P){const se=u.array.has(P.name),Ee=await Ib(Z,l,g,n.shouldUseNativeValidation&&!A,se);if(Ee[P.name]&&(D.valid=!1,A))break;!A&&(de(Ee,P.name)?se?DU(i.errors,Ee,P.name):Je(i.errors,P.name,Ee[P.name]):Ht(i.errors,P.name))}$&&await B($,A,D)}}return D.valid},F=()=>{for(const E of u.unMount){const A=de(r,E);A&&(A._f.refs?A._f.refs.every(D=>!Ph(D)):!Ph(A._f.ref))&&Be(E)}u.unMount=new Set},N=(E,A)=>(E&&A&&Je(l,E,A),!Es(be(),s)),W=(E,A,D)=>MU(E,u,{...a.mount?l:Ct(A)?s:Di(E)?{[E]:A}:A},D,A),H=E=>sc(de(a.mount?l:s,E,t.shouldUnregister?de(s,E,[]):[])),Y=(E,A,D={})=>{const J=de(r,E);let Z=A;if(J){const P=J._f;P&&(!P.disabled&&Je(l,E,yE(A,P)),Z=Sd(P.ref)&&cn(A)?"":A,gE(P.ref)?[...P.ref.options].forEach($=>$.selected=Z.includes($.value)):P.refs?rc(P.ref)?P.refs.length>1?P.refs.forEach($=>(!$.defaultChecked||!$.disabled)&&($.checked=Array.isArray(Z)?!!Z.find(se=>se===$.value):Z===$.value)):P.refs[0]&&(P.refs[0].checked=!!Z):P.refs.forEach($=>$.checked=$.value===Z):Nv(P.ref)?P.ref.value="":(P.ref.value=Z,P.ref.type||o.values.next({name:E,values:{...l}})))}(D.shouldDirty||D.shouldTouch)&&S(E,Z,D.shouldTouch,D.shouldDirty,!0),D.shouldValidate&&K(E)},ee=(E,A,D)=>{for(const J in A){const Z=A[J],P=`${E}.${J}`,$=de(r,P);(u.array.has(E)||!Ed(Z)||$&&!$._f)&&!mo(Z)?ee(P,Z,D):Y(P,Z,D)}},I=(E,A,D={})=>{const J=de(r,E),Z=u.array.has(E),P=Ki(A);Je(l,E,P),Z?(o.array.next({name:E,values:{...l}}),(m.isDirty||m.dirtyFields)&&D.shouldDirty&&o.state.next({name:E,dirtyFields:Ah(s,l),isDirty:N(E,P)})):J&&!J._f&&!cn(P)?ee(E,P,D):Y(E,P,D),Ob(E,u)&&o.state.next({...i}),o.values.next({name:E,values:{...l}}),!a.mount&&e()},z=async E=>{const A=E.target;let D=A.name,J=!0;const Z=de(r,D),P=()=>A.type?Oh(Z._f):EU(E),$=se=>{J=Number.isNaN(se)||se===de(l,D,se)};if(Z){let se,Ee;const Ue=P(),Vt=E.type===Pb.BLUR||E.type===Pb.FOCUS_OUT,Zt=!zU(Z._f)&&!n.resolver&&!de(i.errors,D)&&!Z._f.deps||NU(Vt,de(i.touchedFields,D),i.isSubmitted,h,d),Hn=Ob(D,u,Vt);Je(l,D,Ue),Vt?(Z._f.onBlur&&Z._f.onBlur(E),f&&f(0)):Z._f.onChange&&Z._f.onChange(E);const Pn=S(D,Ue,Vt,!1),bi=!Kn(Pn)||Hn;if(!Vt&&o.values.next({name:D,type:E.type,values:{...l}}),Zt)return m.isValid&&v(),bi&&o.state.next({name:D,...Hn?{}:Pn});if(!Vt&&Hn&&o.state.next({...i}),_(!0),n.resolver){const{errors:O}=await T([D]);if($(Ue),J){const L=Ub(i.errors,r,D),j=Ub(O,r,L.name||D);se=j.error,D=j.name,Ee=Kn(O)}}else se=(await Ib(Z,l,g,n.shouldUseNativeValidation))[D],$(Ue),J&&(se?Ee=!1:m.isValid&&(Ee=await B(r,!0)));J&&(Z._f.deps&&K(Z._f.deps),C(D,Ee,se,Pn))}},X=(E,A)=>{if(de(i.errors,A)&&E.focus)return E.focus(),1},K=async(E,A={})=>{let D,J;const Z=Ch(E);if(_(!0),n.resolver){const P=await M(Ct(E)?E:Z);D=Kn(P),J=E?!Z.some($=>de(P,$)):D}else E?(J=(await Promise.all(Z.map(async P=>{const $=de(r,P);return await B($&&$._f?{[P]:$}:$)}))).every(Boolean),!(!J&&!i.isValid)&&v()):J=D=await B(r);return o.state.next({...!Di(E)||m.isValid&&D!==i.isValid?{}:{name:E},...n.resolver||!E?{isValid:D}:{},errors:i.errors,isValidating:!1}),A.shouldFocus&&!J&&hu(r,X,E?Z:u.mount),J},be=E=>{const A={...s,...a.mount?l:{}};return Ct(E)?A:Di(E)?de(A,E):E.map(D=>de(A,D))},Ke=(E,A)=>({invalid:!!de((A||i).errors,E),isDirty:!!de((A||i).dirtyFields,E),isTouched:!!de((A||i).touchedFields,E),error:de((A||i).errors,E)}),ue=E=>{E&&Ch(E).forEach(A=>Ht(i.errors,A)),o.state.next({errors:E?i.errors:{}})},fe=(E,A,D)=>{const J=(de(r,E,{_f:{}})._f||{}).ref;Je(i.errors,E,{...A,ref:J}),o.state.next({name:E,errors:i.errors,isValid:!1}),D&&D.shouldFocus&&J&&J.focus&&J.focus()},ke=(E,A)=>zr(E)?o.values.subscribe({next:D=>E(W(void 0,A),D)}):W(E,A,!0),Be=(E,A={})=>{for(const D of E?Ch(E):u.mount)u.mount.delete(D),u.array.delete(D),A.keepValue||(Ht(r,D),Ht(l,D)),!A.keepError&&Ht(i.errors,D),!A.keepDirty&&Ht(i.dirtyFields,D),!A.keepTouched&&Ht(i.touchedFields,D),!n.shouldUnregister&&!A.keepDefaultValue&&Ht(s,D);o.values.next({values:{...l}}),o.state.next({...i,...A.keepDirty?{isDirty:N()}:{}}),!A.keepIsValid&&v()},Le=({disabled:E,name:A,field:D,fields:J,value:Z})=>{if(Ar(E)){const P=E?void 0:Ct(Z)?Oh(D?D._f:de(J,A)._f):Z;Je(l,A,P),S(A,P,!1,!1,!0)}},vt=(E,A={})=>{let D=de(r,E);const J=Ar(A.disabled);return Je(r,E,{...D||{},_f:{...D&&D._f?D._f:{ref:{name:E}},name:E,mount:!0,...A}}),u.mount.add(E),D?Le({field:D,disabled:A.disabled,name:E}):w(E,!0,A.value),{...J?{disabled:A.disabled}:{},...n.progressive?{required:!!A.required,min:wa(A.min),max:wa(A.max),minLength:wa(A.minLength),maxLength:wa(A.maxLength),pattern:wa(A.pattern)}:{},name:E,onChange:z,onBlur:z,ref:Z=>{if(Z){vt(E,A),D=de(r,E);const P=Ct(Z.value)&&Z.querySelectorAll&&Z.querySelectorAll("input,select,textarea")[0]||Z,$=UU(P),se=D._f.refs||[];if($?se.find(Ee=>Ee===P):P===D._f.ref)return;Je(r,E,{_f:{...D._f,...$?{refs:[...se.filter(Ph),P,...Array.isArray(de(s,E))?[{}]:[]],ref:{type:P.type,name:E}}:{ref:P}}}),w(E,!1,void 0,P)}else D=de(r,E,{}),D._f&&(D._f.mount=!1),(n.shouldUnregister||A.shouldUnregister)&&!(TU(u.array,E)&&a.action)&&u.unMount.add(E)}}},ge=()=>n.shouldFocusError&&hu(r,X,u.mount),Me=E=>{Ar(E)&&(o.state.next({disabled:E}),hu(r,A=>{A.disabled=E},0,!1))},nt=(E,A)=>async D=>{D&&(D.preventDefault&&D.preventDefault(),D.persist&&D.persist());let J=Ki(l);if(o.state.next({isSubmitting:!0}),n.resolver){const{errors:Z,values:P}=await T();i.errors=Z,J=P}else await B(r);Ht(i.errors,"root"),Kn(i.errors)?(o.state.next({errors:{}}),await E(J,D)):(A&&await A({...i.errors},D),ge(),setTimeout(ge)),o.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Kn(i.errors),submitCount:i.submitCount+1,errors:i.errors})},lt=(E,A={})=>{de(r,E)&&(Ct(A.defaultValue)?I(E,de(s,E)):(I(E,A.defaultValue),Je(s,E,A.defaultValue)),A.keepTouched||Ht(i.touchedFields,E),A.keepDirty||(Ht(i.dirtyFields,E),i.isDirty=A.defaultValue?N(E,de(s,E)):N()),A.keepError||(Ht(i.errors,E),m.isValid&&v()),o.state.next({...i}))},ni=(E,A={})=>{const D=E?Ki(E):s,J=Ki(D),Z=E&&!Kn(E)?J:s;if(A.keepDefaultValues||(s=D),!A.keepValues){if(A.keepDirtyValues||c)for(const P of u.mount)de(i.dirtyFields,P)?Je(Z,P,de(l,P)):I(P,de(Z,P));else{if(Fv&&Ct(E))for(const P of u.mount){const $=de(r,P);if($&&$._f){const se=Array.isArray($._f.refs)?$._f.refs[0]:$._f.ref;if(Sd(se)){const Ee=se.closest("form");if(Ee){Ee.reset();break}}}}r={}}l=t.shouldUnregister?A.keepDefaultValues?Ki(s):{}:Ki(Z),o.array.next({values:{...Z}}),o.values.next({values:{...Z}})}u={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!a.mount&&e(),a.mount=!m.isValid||!!A.keepIsValid,a.watch=!!t.shouldUnregister,o.state.next({submitCount:A.keepSubmitCount?i.submitCount:0,isDirty:A.keepDirty?i.isDirty:!!(A.keepDefaultValues&&!Es(E,s)),isSubmitted:A.keepIsSubmitted?i.isSubmitted:!1,dirtyFields:A.keepDirtyValues?i.dirtyFields:A.keepDefaultValues&&E?Ah(s,E):{},touchedFields:A.keepTouched?i.touchedFields:{},errors:A.keepErrors?i.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?i.isSubmitSuccessful:!1,isSubmitting:!1})},$t=(E,A)=>ni(zr(E)?E(l):E,A);return{control:{register:vt,unregister:Be,getFieldState:Ke,handleSubmit:nt,setError:fe,_executeSchema:T,_getWatch:W,_getDirty:N,_updateValid:v,_removeUnmounted:F,_updateFieldArray:b,_updateDisabledField:Le,_getFieldArray:H,_reset:ni,_resetDefaultValues:()=>zr(n.defaultValues)&&n.defaultValues().then(E=>{$t(E,n.resetOptions),o.state.next({isLoading:!1})}),_updateFormState:E=>{i={...i,...E}},_disableForm:Me,_subjects:o,_proxyFormState:m,get _fields(){return r},get _formValues(){return l},get _state(){return a},set _state(E){a=E},get _defaultValues(){return s},get _names(){return u},set _names(E){u=E},get _formState(){return i},set _formState(E){i=E},get _options(){return n},set _options(E){n={...n,...E}}},trigger:K,register:vt,handleSubmit:nt,watch:ke,setValue:I,getValues:be,reset:$t,resetField:lt,clearErrors:ue,unregister:Be,setError:fe,setFocus:(E,A={})=>{const D=de(r,E),J=D&&D._f;if(J){const Z=J.refs?J.refs[0]:J.ref;Z.focus&&(Z.focus(),A.shouldSelect&&Z.select())}},getFieldState:Ke}}function VU(t={}){const e=ae.useRef(),n=ae.useRef(),[i,r]=ae.useState({isDirty:!1,isValidating:!1,isLoading:zr(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:zr(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...$U(t,()=>r(l=>({...l}))),formState:i});const s=e.current.control;return s._options=t,LU({subject:s._subjects.state,next:l=>{OU(l,s._proxyFormState,s._updateFormState,!0)&&r({...s._formState})}}),ae.useEffect(()=>s._disableForm(t.disabled),[s,t.disabled]),ae.useEffect(()=>{if(s._proxyFormState.isDirty){const l=s._getDirty();l!==i.isDirty&&s._subjects.state.next({isDirty:l})}},[s,i.isDirty]),ae.useEffect(()=>{t.values&&!Es(t.values,n.current)?(s._reset(t.values,s._options.resetOptions),n.current=t.values):s._resetDefaultValues()},[t.values,s]),ae.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),e.current.formState=AU(i,s),e.current}var Fb=function(t,e,n){if(t&&"reportValidity"in t){var i=de(n,e);t.setCustomValidity(i&&i.message||""),t.reportValidity()}},_E=function(t,e){var n=function(r){var s=e.fields[r];s&&s.ref&&"reportValidity"in s.ref?Fb(s.ref,r,t):s.refs&&s.refs.forEach(function(l){return Fb(l,r,t)})};for(var i in e.fields)n(i)},HU=function(t,e){e.shouldUseNativeValidation&&_E(t,e);var n={};for(var i in t){var r=de(e.fields,i),s=Object.assign(t[i]||{},{ref:r&&r.ref});if(GU(e.names||Object.keys(t),i)){var l=Object.assign({},WU(de(n,i)));Je(l,"root",s),Je(n,i,l)}else Je(n,i,s)}return n},WU=function(t){return Array.isArray(t)?t.filter(Boolean):[]},GU=function(t,e){return t.some(function(n){return n.startsWith(e+".")})},YU=function(t,e){for(var n={};t.length;){var i=t[0],r=i.code,s=i.message,l=i.path.join(".");if(!n[l])if("unionErrors"in i){var a=i.unionErrors[0].errors[0];n[l]={message:a.message,type:a.code}}else n[l]={message:s,type:r};if("unionErrors"in i&&i.unionErrors.forEach(function(p){return p.errors.forEach(function(m){return t.push(m)})}),e){var u=n[l].types,f=u&&u[i.code];n[l]=fE(l,e,n,r,f?[].concat(f,i.message):i.message)}t.shift()}return n},KU=function(t,e,n){return n===void 0&&(n={}),function(i,r,s){try{return Promise.resolve(function(l,a){try{var u=Promise.resolve(t[n.mode==="sync"?"parse":"parseAsync"](i,e)).then(function(f){return s.shouldUseNativeValidation&&_E({},s),{errors:{},values:n.raw?i:f}})}catch(f){return a(f)}return u&&u.then?u.then(void 0,a):u}(0,function(l){if(function(a){return a.errors!=null}(l))return{values:{},errors:HU(YU(l.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw l}))}catch(l){return Promise.reject(l)}}};const Or=(t,e)=>{if(isNaN(t))return"NaN";if(t===0||t<1)return`0 ${e?"B":"bytes"}`;const n=1e3,i=Math.floor(Math.log(t)/Math.log(n)),r=new Intl.NumberFormat("en-US",{unit:["byte","kilobyte","megabyte","gigabyte","terabyte","petabyte"][i],notation:"standard",style:"unit",unitDisplay:"short",maximumFractionDigits:i>=3?2:1}).format(t/Math.pow(n,i));return e&&i>1e3?`${Number(r.replaceAll("byte",""))/1e3}kB`:r};var bE={exports:{}},QU="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ZU=QU,XU=ZU;function xE(){}function wE(){}wE.resetWarningCache=xE;var qU=function(){function t(i,r,s,l,a,u){if(u!==XU){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:wE,resetWarningCache:xE};return n.PropTypes=n,n};bE.exports=qU();var JU=bE.exports;const R=vw(JU);function Pg(){return Pg=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Pg.apply(this,arguments)}function eF(t,e){if(t==null)return{};var n=tF(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function tF(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var jv=k.forwardRef(function(t,e){var n=t.color,i=n===void 0?"currentColor":n,r=t.size,s=r===void 0?24:r,l=eF(t,["color","size"]);return ae.createElement("svg",Pg({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),ae.createElement("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),ae.createElement("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),ae.createElement("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"}))});jv.propTypes={color:R.string,size:R.oneOfType([R.string,R.number])};jv.displayName="AlertTriangle";const nF=jv;function Ag(){return Ag=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ag.apply(this,arguments)}function iF(t,e){if(t==null)return{};var n=rF(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function rF(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var $v=k.forwardRef(function(t,e){var n=t.color,i=n===void 0?"currentColor":n,r=t.size,s=r===void 0?24:r,l=iF(t,["color","size"]);return ae.createElement("svg",Ag({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),ae.createElement("circle",{cx:"12",cy:"12",r:"10"}),ae.createElement("polyline",{points:"8 12 12 16 16 12"}),ae.createElement("line",{x1:"12",y1:"8",x2:"12",y2:"16"}))});$v.propTypes={color:R.string,size:R.oneOfType([R.string,R.number])};$v.displayName="ArrowDownCircle";const sF=$v;function Og(){return Og=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Og.apply(this,arguments)}function oF(t,e){if(t==null)return{};var n=aF(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function aF(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var Vv=k.forwardRef(function(t,e){var n=t.color,i=n===void 0?"currentColor":n,r=t.size,s=r===void 0?24:r,l=oF(t,["color","size"]);return ae.createElement("svg",Og({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),ae.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),ae.createElement("polyline",{points:"19 12 12 19 5 12"}))});Vv.propTypes={color:R.string,size:R.oneOfType([R.string,R.number])};Vv.displayName="ArrowDown";const lF=Vv;function Lg(){return Lg=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Lg.apply(this,arguments)}function cF(t,e){if(t==null)return{};var n=uF(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function uF(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var Hv=k.forwardRef(function(t,e){var n=t.color,i=n===void 0?"currentColor":n,r=t.size,s=r===void 0?24:r,l=cF(t,["color","size"]);return ae.createElement("svg",Lg({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),ae.createElement("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),ae.createElement("polyline",{points:"5 12 12 5 19 12"}))});Hv.propTypes={color:R.string,size:R.oneOfType([R.string,R.number])};Hv.displayName="ArrowUp";const dF=Hv;function Mg(){return Mg=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Mg.apply(this,arguments)}function fF(t,e){if(t==null)return{};var n=hF(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function hF(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var Wv=k.forwardRef(function(t,e){var n=t.color,i=n===void 0?"currentColor":n,r=t.size,s=r===void 0?24:r,l=fF(t,["color","size"]);return ae.createElement("svg",Mg({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),ae.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),ae.createElement("polyline",{points:"7 10 12 15 17 10"}),ae.createElement("line",{x1:"12",y1:"15",x2:"12",y2:"3"}))});Wv.propTypes={color:R.string,size:R.oneOfType([R.string,R.number])};Wv.displayName="Download";const pF=Wv;function Dg(){return Dg=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Dg.apply(this,arguments)}function gF(t,e){if(t==null)return{};var n=mF(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function mF(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var Gv=k.forwardRef(function(t,e){var n=t.color,i=n===void 0?"currentColor":n,r=t.size,s=r===void 0?24:r,l=gF(t,["color","size"]);return ae.createElement("svg",Dg({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),ae.createElement("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),ae.createElement("polyline",{points:"9 22 9 12 15 12 15 22"}))});Gv.propTypes={color:R.string,size:R.oneOfType([R.string,R.number])};Gv.displayName="Home";const vF=Gv;function Rg(){return Rg=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Rg.apply(this,arguments)}function yF(t,e){if(t==null)return{};var n=_F(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function _F(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var Yv=k.forwardRef(function(t,e){var n=t.color,i=n===void 0?"currentColor":n,r=t.size,s=r===void 0?24:r,l=yF(t,["color","size"]);return ae.createElement("svg",Rg({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),ae.createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),ae.createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))});Yv.propTypes={color:R.string,size:R.oneOfType([R.string,R.number])};Yv.displayName="Pause";const bF=Yv;function Ig(){return Ig=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ig.apply(this,arguments)}function xF(t,e){if(t==null)return{};var n=wF(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function wF(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var Kv=k.forwardRef(function(t,e){var n=t.color,i=n===void 0?"currentColor":n,r=t.size,s=r===void 0?24:r,l=xF(t,["color","size"]);return ae.createElement("svg",Ig({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),ae.createElement("polygon",{points:"5 3 19 12 5 21 5 3"}))});Kv.propTypes={color:R.string,size:R.oneOfType([R.string,R.number])};Kv.displayName="Play";const Ug=Kv;function Fg(){return Fg=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Fg.apply(this,arguments)}function SF(t,e){if(t==null)return{};var n=kF(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function kF(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var Qv=k.forwardRef(function(t,e){var n=t.color,i=n===void 0?"currentColor":n,r=t.size,s=r===void 0?24:r,l=SF(t,["color","size"]);return ae.createElement("svg",Fg({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),ae.createElement("circle",{cx:"12",cy:"12",r:"3"}),ae.createElement("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}))});Qv.propTypes={color:R.string,size:R.oneOfType([R.string,R.number])};Qv.displayName="Settings";const EF=Qv;function zg(){return zg=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},zg.apply(this,arguments)}function CF(t,e){if(t==null)return{};var n=TF(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function TF(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var Zv=k.forwardRef(function(t,e){var n=t.color,i=n===void 0?"currentColor":n,r=t.size,s=r===void 0?24:r,l=CF(t,["color","size"]);return ae.createElement("svg",zg({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),ae.createElement("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),ae.createElement("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07"}))});Zv.propTypes={color:R.string,size:R.oneOfType([R.string,R.number])};Zv.displayName="Volume1";const PF=Zv;function Ng(){return Ng=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ng.apply(this,arguments)}function AF(t,e){if(t==null)return{};var n=OF(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function OF(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var Xv=k.forwardRef(function(t,e){var n=t.color,i=n===void 0?"currentColor":n,r=t.size,s=r===void 0?24:r,l=AF(t,["color","size"]);return ae.createElement("svg",Ng({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),ae.createElement("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),ae.createElement("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"}))});Xv.propTypes={color:R.string,size:R.oneOfType([R.string,R.number])};Xv.displayName="Volume2";const LF=Xv;function Bg(){return Bg=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Bg.apply(this,arguments)}function MF(t,e){if(t==null)return{};var n=DF(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function DF(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var qv=k.forwardRef(function(t,e){var n=t.color,i=n===void 0?"currentColor":n,r=t.size,s=r===void 0?24:r,l=MF(t,["color","size"]);return ae.createElement("svg",Bg({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),ae.createElement("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),ae.createElement("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),ae.createElement("line",{x1:"17",y1:"9",x2:"23",y2:"15"}))});qv.propTypes={color:R.string,size:R.oneOfType([R.string,R.number])};qv.displayName="VolumeX";const zb=qv;function jg(){return jg=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},jg.apply(this,arguments)}function RF(t,e){if(t==null)return{};var n=IF(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function IF(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var Jv=k.forwardRef(function(t,e){var n=t.color,i=n===void 0?"currentColor":n,r=t.size,s=r===void 0?24:r,l=RF(t,["color","size"]);return ae.createElement("svg",jg({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),ae.createElement("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}))});Jv.propTypes={color:R.string,size:R.oneOfType([R.string,R.number])};Jv.displayName="Volume";const UF=Jv;function $g(){return $g=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},$g.apply(this,arguments)}function FF(t,e){if(t==null)return{};var n=zF(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function zF(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var ey=k.forwardRef(function(t,e){var n=t.color,i=n===void 0?"currentColor":n,r=t.size,s=r===void 0?24:r,l=FF(t,["color","size"]);return ae.createElement("svg",$g({ref:e,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),ae.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ae.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))});ey.propTypes={color:R.string,size:R.oneOfType([R.string,R.number])};ey.displayName="X";const SE=ey,NF=t=>an`
12
+ position: fixed;
13
+ inset: 0;
14
+ display: flex;
15
+ justify-content: center;
16
+ z-index: 1300;
17
+ overflow-y: auto;
18
+ .backdrop {
19
+ position: fixed;
20
+ top: 0;
21
+ left: 0;
22
+ z-index: 1040;
23
+ width: 100%;
24
+ height: 100%;
25
+ background-color: #000;
26
+ opacity: 0.5;
27
+ }
28
+
29
+ .modal {
30
+ position: absolute;
31
+ top: 0;
32
+ min-width: 42.5rem;
33
+ z-index: 1060;
34
+ @media (min-height: ${t}px) {
35
+ top: 50%;
36
+ left: 50%;
37
+ transform: translate(-50%, -50%);
38
+ }
39
+ border: 2px solid #000;
40
+ border-radius: 4px;
41
+ @media (max-width: 425px) {
42
+ min-width: initial;
43
+ width: 100%;
44
+ }
45
+ background-color: #1f1f1f;
46
+ background-clip: padding-box;
47
+ border: none;
48
+ border-radius: .5rem;
49
+
50
+ & > .header {
51
+ display: flex;
52
+ padding: 1.6rem;
53
+ border-bottom: .1rem solid rgba(255, 255, 255, 0.1);
54
+ gap: 1rem;
55
+ img {
56
+ height: 2.4rem;
57
+ }
58
+ }
59
+
60
+ & > .close {
61
+ cursor: pointer;
62
+ position: absolute;
63
+ top: 2rem;
64
+ right: 1.6rem;
65
+ background: none;
66
+ border: none;
67
+ color: #fff;
68
+ display: grid;
69
+ justify-content: center;
70
+ align-items: center;
71
+
72
+ &:hover {
73
+ color: gray;
74
+ }
75
+ }
76
+ }
77
+ `;an`
78
+ position: relative;
79
+ max-width: 42.5rem;
80
+ color: #D1D1D1;
81
+
82
+ @media (min-width: 640px) {
83
+ display: grid;
84
+ }
85
+
86
+ .header {
87
+ padding: 1.6rem;
88
+ border-bottom: .1rem solid rgba(255, 255, 255, 0.1);
89
+
90
+ img {
91
+ height: 2.2rem;
92
+ width: 2.2rem;
93
+ object-fit: cover;
94
+ }
95
+
96
+ .title {
97
+ display: flex;
98
+ align-items: center;
99
+ justify-content: flex-start;
100
+ gap: 0.4rem;
101
+ width: 100%;
102
+ line-height: 2.3rem;
103
+ font-size: 1.8rem;
104
+ color: #fff;
105
+ font-weight: 500;
106
+
107
+ &__asset {
108
+ display: flex;
109
+ gap: 0.2rem;
110
+ }
111
+ }
112
+ }
113
+ `;const BF=({header:t,onClose:e,preventBackdropClose:n,children:i,...r})=>{const[s,l]=k.useState(),[a,u]=k.useState(960);k.useEffect(()=>{if(!s)return;const p=new ResizeObserver(m=>{if(m&&m.length>0){const{height:o}=m[0].contentRect;u(o)}});return p.observe(s),()=>p.disconnect()},[s]);const f=()=>{n||e()};return pe("div",{css:NF(a),...r,children:[V("div",{className:"backdrop",onClick:f}),pe("div",{className:"modal",role:"dialog",tabIndex:-1,ref:l,children:[t!==void 0?V("div",{className:"header",children:t}):t,i,V("button",{onClick:e,className:"close",children:V(SE,{width:16,height:16})})]})]})},kE=({open:t,children:e,...n})=>{const[i,r]=k.useState(null);return k.useEffect(()=>{const s=document.body.appendChild(document.createElement("div"));return r(s),()=>{setTimeout(()=>{s.remove()},0)}},[]),k.useEffect(()=>{if(t)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[t]),i?Hk.createPortal(t?V(BF,{...n,children:e}):null,i):null},jF=an`
114
+ display: grid;
115
+ grid-template-columns: minmax(0, 2fr) 1fr;
116
+ height: 100%;
117
+ width: 100%;
118
+ overflow: hidden;
119
+ gap: 2.5rem;
120
+
121
+ .chart-wrapper {
122
+ height: 100%;
123
+ width: 100%;
124
+ }
125
+
126
+ .side {
127
+ display: grid;
128
+ grid-template-columns: auto 5rem;
129
+ gap: 1rem;
130
+
131
+ .stats {
132
+ display: grid;
133
+ grid-template-columns: 1fr 1fr 1fr 1fr;
134
+ gap: 1rem;
135
+ padding: 1.5rem;
136
+
137
+ div {
138
+ display: flex;
139
+ flex-direction: column;
140
+ justify-content: center;
141
+ text-align: center;
142
+ font-size: 1.25rem;
143
+ color: #fff;
144
+ text-align: left;
145
+
146
+ .value {
147
+ font-size: 1.5rem;
148
+ font-weight: 600;
149
+ }
150
+
151
+ .label {
152
+ font-size: 1.25rem;
153
+ color: #aaa;
154
+ font-weight: 600;
155
+ text-transform: uppercase;
156
+ white-space: nowrap;
157
+ }
158
+ }
159
+ }
160
+ }
161
+
162
+ button {
163
+ display: flex;
164
+ height: 4.5rem;
165
+ padding: 1.5rem 1.5rem;
166
+ border-radius: 0.5rem;
167
+ border: none;
168
+ background-color: rgb(24, 26, 27);
169
+ cursor: pointer;
170
+
171
+ display: flex;
172
+ align-items: center;
173
+ justify-content: center;
174
+ gap: .25rem;
175
+
176
+ font-weight: bold;
177
+ color: #aaa;
178
+
179
+ svg {
180
+ width: 1.5rem;
181
+ height: 1.5rem;
182
+ stroke-width: 3;
183
+ }
184
+
185
+ &.active {
186
+ background-color: #2f2f2f;
187
+ color: #fff;
188
+ }
189
+ }
190
+
191
+ .settings-button {
192
+ margin: 0 auto;
193
+ }
194
+
195
+ `,$F=an`
196
+
197
+ .title {
198
+ font-size: 2.2rem;
199
+ font-weight: bold;
200
+ }
201
+
202
+ .body {
203
+ display: grid;
204
+ grid-template-columns: 1fr;
205
+ gap: 2.5rem;
206
+ padding: 1.5rem;
207
+
208
+ .section {
209
+ display: grid;
210
+ grid-template-columns: 1fr;
211
+ gap: 1rem;
212
+
213
+ .title {
214
+ font-size: 2rem;
215
+ font-weight: bold;
216
+ }
217
+
218
+ & > .row {
219
+ display: grid;
220
+ grid-template-columns: 1fr 1fr;
221
+ gap: 1rem;
222
+ align-items: center;
223
+
224
+ &.multi {
225
+ grid-template-columns: 1fr;
226
+ }
227
+
228
+ .label {
229
+ display: flex;
230
+ justify-content: space-between;
231
+ }
232
+
233
+ input[type="text"] {
234
+ height: 3rem;
235
+ padding: 1rem;
236
+ border-radius: 0.5rem;
237
+ border: none;
238
+ background-color: rgb(24, 26, 27);
239
+ color: #aaa;
240
+ }
241
+
242
+ input[type="checkbox"] {
243
+ height: 1.5rem;
244
+ width: 1.5rem;
245
+ border-radius: 0.25rem;
246
+ border: none;
247
+ background-color: rgb(24, 26, 27);
248
+ }
249
+
250
+ button {
251
+ display: flex;
252
+ align-items: center;
253
+ justify-content: center;
254
+ gap: .25rem;
255
+ font-weight: bold;
256
+ color: #aaa;
257
+ background-color: rgb(24, 26, 27);
258
+ border: none;
259
+ border-radius: 0.5rem;
260
+ padding: 1rem 1.5rem;
261
+ cursor: pointer;
262
+ margin-left: auto;
263
+
264
+ svg {
265
+ width: 1.5rem;
266
+ height: 1.5rem;
267
+ stroke-width: 3;
268
+ }
269
+
270
+ &.active {
271
+ background-color: #2f2f2f;
272
+ color: #fff;
273
+ }
274
+ }
275
+ }
276
+
277
+ .label {
278
+ font-weight: 500;
279
+ }
280
+
281
+ .value {
282
+ text-align: right;
283
+ font-weight: 300;
284
+ }
285
+ }
286
+ }
287
+
288
+ `,Nb={type:"line",options:{maintainAspectRatio:!1,responsive:!0,animation:{duration:0},plugins:{title:{display:!1,text:"Download statistics"},legend:{display:!1}},interaction:{intersect:!1},scales:{x:{display:!1,title:{display:!1}},y:{display:!1,title:{display:!1,text:"Value"},suggestedMin:0,suggestedMax:200}}}},VF=({allTorrents:t,isModalOpen:e,onClose:n})=>{const r=yi.useRxCollection("settings")?.findOne({}),{result:[s]}=yi.useRxQuery(r),[l,a]=k.useState(!1),u=kU({speedLimitEnabled:SU(),speedLimit:wU().min(0)}),{register:f,watch:p,reset:m}=VU({mode:"onChange",resolver:KU(u),defaultValues:{speedLimitEnabled:s?.downloadSpeedLimitEnabled??!1,speedLimit:Math.floor(s?.downloadSpeedLimit/1e3)??0}});k.useEffect(()=>{!s||l||(m({speedLimitEnabled:s?.downloadSpeedLimitEnabled??!1,speedLimit:Math.floor(s?.downloadSpeedLimit/1e3)??0}),a(!0))},[l,m,s]);const o=async()=>{t&&await Na.bulkRemove(t.map(v=>v.infoHash)),indexedDB.deleteDatabase("rxdb-dexie-ripple--0--_rxdb_internal"),indexedDB.deleteDatabase("rxdb-dexie-ripple--0--settings"),indexedDB.deleteDatabase("rxdb-dexie-ripple--0--torrents"),await d(),location.reload()},c=async()=>{t&&await Na.bulkRemove(t.map(v=>v.infoHash)),await d()},d=async()=>{const v=await (await navigator.storage.getDirectory()).getDirectoryHandle("torrents"),_=v.entries(),b=async()=>{const{done:x,value:w}=await _.next();if(!w)return;const[S]=w;await v.removeEntry(S,{recursive:!0}),!x&&b()};b()},h=k.useCallback(v=>{s?.incrementalModify(_=>(_.downloadSpeedLimitEnabled=v.speedLimitEnabled,_.downloadSpeedLimit=v.speedLimit*1e3,_))},[s]),g=p(),y=JSON.stringify(g);return k.useEffect(()=>h(g),[y]),pe(kE,{open:e,css:$F,onClose:n,children:[V("div",{className:"header",children:V("div",{className:"title",children:"Settings"})}),V("div",{className:"main",children:V("div",{className:"content",children:V("form",{onSubmit:h,children:pe("div",{className:"body",children:[pe("div",{className:"section",children:[V("div",{className:"title",children:"Bandwidth"}),pe("div",{className:"row multi",children:[pe("label",{className:"label",children:[V("span",{children:"Limit download speed (per torrent for now)"}),V("input",{type:"checkbox",className:"value",...f("speedLimitEnabled")})]}),g.speedLimitEnabled&&pe("label",{className:"label",children:[V("span",{children:"Enter download speed limit in KB/s"}),V("input",{type:"text",className:"value",...f("speedLimit")})]})]})]}),pe("div",{className:"section",children:[V("div",{className:"title",children:"Queuing"}),pe("div",{className:"row",children:[V("div",{className:"label",children:"Maximum active downloads"}),V("div",{className:"value",children:"Unlimited"})]}),pe("div",{className:"row",children:[V("div",{className:"label",children:"Download other when watching"}),V("div",{className:"value",children:"Unlimited"})]})]}),pe("div",{className:"section",children:[V("div",{className:"title",children:"Data"}),pe("div",{className:"row",children:[V("div",{className:"label",children:"Clear all data"}),V("div",{className:"value",children:V("button",{onClick:o,children:"RESET APP"})})]}),pe("div",{className:"row",children:[V("div",{className:"label",children:"Clear torrents"}),V("div",{className:"value",children:V("button",{onClick:c,children:"DELETE ALL TORRENTS"})})]})]})]})})})})]})},HF=({...t})=>{const n=yi.useRxCollection("torrents")?.find({}),{result:i}=yi.useRxQuery(n),[r,s]=k.useState(0),l=i?.map(h=>h.state.streamBandwithLogs).flat().map(h=>({x:Math.floor(h.timestamp/1e3),y:h.byteLength})).reduce((h,g)=>{const y=h.findIndex(v=>v.x===g.x);return y===-1?h.push(g):h[y].y+=g.y,h},[]).sort((h,g)=>h.x-g.x)??[],a=l.filter(h=>h.x>l.at(-1).x-120).slice(-20).slice(0,-1),u=[...new Array(20-a.length).fill(void 0),...a],f=i?.map(h=>h.state.downloadSpeed??0).reduce((h,g)=>h+g,0);k.useEffect(()=>{f>r&&s(f)},[f]);const p={labels:u.map(h=>h&&new Date(h.x).toLocaleTimeString()),datasets:[{label:"Network",data:u.map(h=>h?.y),borderColor:"#4034eb",fill:!1}]},[m,o]=k.useState(!1),c=()=>{o(!0)};return pe("div",{css:jF,...t,children:[V(VF,{isModalOpen:m,onClose:()=>{o(!1)}}),V("div",{className:"chart-wrapper",children:V(aU,{data:p,options:{...Nb.options,plugins:{...Nb.options.plugins,tooltip:{backgroundColor:"#4f4f4f",displayColors:!1,animation:{duration:0},callbacks:{label:h=>`${h.dataset.label} ${Or(h.parsed.y,!0)}/s`}}},interaction:{mode:"index",axis:"x",intersect:!1}}})}),pe("div",{className:"side",children:[pe("div",{className:"stats",children:[pe("div",{className:"stat",children:[pe("div",{className:"value",children:[Or(f,!0),"/s"]}),V("div",{className:"label",children:"Current"})]}),pe("div",{className:"stat",children:[pe("div",{className:"value",children:[Or(r,!0),"/s"]}),V("div",{className:"label",children:"Peak"})]}),pe("div",{className:"stat",children:[V("div",{className:"value",children:"0 MB"}),V("div",{className:"label",children:"Total"})]}),pe("div",{className:"stat",children:[V("div",{className:"value",children:"0 MB/s"}),V("div",{className:"label",children:"Disk usage"})]})]}),V("button",{className:"settings-button",onClick:c,children:V(EF,{})})]})]})},WF=async t=>{(await Promise.all([...await Promise.all(t.map(n=>{const i=new FileReader;return new Promise((r,s)=>{i.onload=()=>{!i.result||!(i.result instanceof ArrayBuffer)||r(yw.Buffer.from(i.result))},i.onerror=s,i.readAsArrayBuffer(n)})}))].map(mm))).forEach(async n=>{vm({torrentFile:n})})},Vg=["mkv"],GF=an`
289
+ display: flex;
290
+ flex-direction: column;
291
+ align-items: center;
292
+ justify-content: center;
293
+
294
+ width: 100%;
295
+
296
+ .category {
297
+ width: 100%;
298
+ height: 100%;
299
+
300
+ & > .title {
301
+ display: flex;
302
+ align-items: center;
303
+
304
+ gap: 1rem;
305
+ font-size: 2rem;
306
+ font-weight: bold;
307
+ width: 100%;
308
+ height: 4rem;
309
+ padding: 1rem;
310
+ border-bottom-color: rgb(48, 52, 54);
311
+ background-color: rgb(35, 38, 40);
312
+ /* border-bottom: 1px solid #fff;
313
+ background-color: #2f2f2f; */
314
+
315
+ span {
316
+ display: flex;
317
+ align-items: center;
318
+ gap: .5rem;
319
+ }
320
+ }
321
+
322
+ .items {
323
+ display: flex;
324
+ flex-direction: column;
325
+ gap: .25rem;
326
+ padding: .5rem .1rem;
327
+ padding-bottom: 1rem;
328
+ }
329
+
330
+ .select-file {
331
+ max-width: 40rem;
332
+ margin: auto;
333
+ padding: 1rem;
334
+ overflow: hidden;
335
+
336
+ border-bottom-color: rgb(48, 52, 54);
337
+ background-color: rgb(35, 38, 40);
338
+ /* border-bottom: 1px solid #fff;
339
+ background-color: #2f2f2f; */
340
+ border-radius: .5rem;
341
+ border: .25rem solid rgb(48, 52, 54);
342
+ border-style: dashed;
343
+ margin-top: 2rem;
344
+
345
+ display: flex;
346
+ font-size: 1.5rem;
347
+ font-weight: bold;
348
+ color: #aaa;
349
+ text-align: center;
350
+
351
+ cursor: pointer;
352
+ }
353
+
354
+ .item {
355
+ /* display: grid;
356
+ grid-template-columns: minmax(100rem, 4fr) minmax(min-content, 35rem) minmax(max-content, 10rem);
357
+ grid-template-areas: "main info actions"; */
358
+
359
+
360
+ width: 100%;
361
+ border-bottom-color: rgb(48, 52, 54);
362
+ background-color: rgb(35, 38, 40);
363
+ /* border-bottom: 1px solid #fff;
364
+ background-color: #2f2f2f; */
365
+ border: 1px solid rgb(48, 52, 54);
366
+ padding: 1rem;
367
+
368
+ .highlight {
369
+ color: #fff;
370
+ }
371
+
372
+
373
+ /* &:nth-of-type(-n+2) {
374
+ border-top: 1px solid rgb(48, 52, 54);
375
+ } */
376
+
377
+ /* :last-child {
378
+ border-bottom: none;
379
+ } */
380
+
381
+ /* &:hover {
382
+ background-color: rgb(48, 52, 54);
383
+ } */
384
+
385
+ .files {
386
+ display: flex;
387
+ flex-direction: column;
388
+ gap: .25rem;
389
+ padding: .5rem .1rem;
390
+ padding-bottom: 1rem;
391
+
392
+ .file {
393
+ display: flex;
394
+ align-items: center;
395
+ gap: 1rem;
396
+ padding: .5rem 0;
397
+ border-bottom: 1px solid rgb(48, 52, 54);
398
+
399
+ .name {
400
+ font-size: 1.5rem;
401
+ font-weight: bold;
402
+ white-space: nowrap;
403
+ overflow: hidden;
404
+ text-overflow: ellipsis;
405
+ }
406
+
407
+ .size {
408
+ color: #aaa;
409
+ font-weight: bold;
410
+ }
411
+
412
+ .play {
413
+ margin-left: auto;
414
+ display: flex;
415
+ align-items: center;
416
+ gap: .5rem;
417
+
418
+ button {
419
+ padding: 1rem;
420
+ border-radius: 0.5rem;
421
+ border: none;
422
+ background-color: rgb(24, 26, 27);
423
+ cursor: pointer;
424
+
425
+ display: flex;
426
+ align-items: center;
427
+ justify-content: center;
428
+ gap: .25rem;
429
+
430
+ font-weight: bold;
431
+ color: #aaa;
432
+
433
+ svg {
434
+ width: 1.5rem;
435
+ height: 1.5rem;
436
+ stroke-width: 3;
437
+ }
438
+
439
+ &.active {
440
+ background-color: #2f2f2f;
441
+ color: #fff;
442
+ }
443
+ }
444
+ }
445
+ }
446
+ }
447
+
448
+ .main {
449
+ display: grid;
450
+ grid-template-columns: minmax(100rem, 4fr) minmax(min-content, 35rem) minmax(max-content, 10rem);
451
+ grid-template-areas: "main info actions";
452
+ height: 12rem;
453
+
454
+ /* display: flex;
455
+ gap: 2rem; */
456
+ }
457
+
458
+ &.finished .main {
459
+ grid-template-columns: minmax(100rem, 4fr) minmax(min-content, 0rem) minmax(max-content, 10rem);
460
+ }
461
+
462
+ .info {
463
+ display: flex;
464
+ /* padding: 1rem; */
465
+ gap: 2rem;
466
+
467
+ .preview {
468
+ height: 10rem;
469
+ width: calc(10rem * calc(16 / 9));
470
+ background-color: #0f0f0f;
471
+ object-fit: contain;
472
+ }
473
+
474
+ .content {
475
+ display: flex;
476
+ flex-direction: column;
477
+ max-width: 75%;
478
+
479
+ .toggle-show-files {
480
+ display: flex;
481
+ align-items: center;
482
+ gap: .5rem;
483
+ font-size: 1.5rem;
484
+ font-weight: bold;
485
+ color: #aaa;
486
+ background-color: transparent;
487
+ border: none;
488
+ cursor: pointer;
489
+
490
+ svg {
491
+ stroke-width: 3;
492
+ }
493
+
494
+ &:hover {
495
+ color: #fff;
496
+ }
497
+ }
498
+
499
+ .name {
500
+ font-size: 2rem;
501
+ font-weight: bold;
502
+ white-space: nowrap;
503
+ overflow: hidden;
504
+ text-overflow: ellipsis;
505
+ }
506
+
507
+ .size {
508
+ margin-top: 1rem;
509
+ color: #aaa;
510
+ font-weight: bold;
511
+ }
512
+
513
+ .sources {
514
+ display: flex;
515
+
516
+ margin-top: auto;
517
+
518
+ button {
519
+ padding: .25rem .5rem;
520
+ margin-right: 0.5rem;
521
+ border-radius: 0.5rem;
522
+ border: none;
523
+ background-color: rgb(24, 26, 27);
524
+ cursor: pointer;
525
+
526
+ display: flex;
527
+ align-items: center;
528
+ justify-content: center;
529
+ gap: .25rem;
530
+
531
+ font-weight: bold;
532
+ color: #aaa;
533
+
534
+ svg {
535
+ width: 1.5rem;
536
+ height: 1.5rem;
537
+ stroke-width: 3;
538
+ }
539
+
540
+ &.active {
541
+ background-color: #2f2f2f;
542
+ color: #fff;
543
+ }
544
+ }
545
+ }
546
+ }
547
+ }
548
+
549
+ .download-info {
550
+ display: flex;
551
+ margin-left: auto;
552
+ justify-content: center;
553
+ flex-direction: column;
554
+ padding: 2rem;
555
+ gap: .5rem;
556
+
557
+ width: 100%;
558
+
559
+ font-weight: bold;
560
+ color: #aaa;
561
+
562
+ /* svg {
563
+ stroke-width: 3;
564
+ } */
565
+
566
+
567
+ .progress-title {
568
+ display: flex;
569
+ align-items: center;
570
+ justify-content: space-between;
571
+
572
+ .status {
573
+ font-size: 1.5rem;
574
+ font-weight: bold;
575
+ margin-right: 1rem;
576
+ color: #aaa;
577
+ }
578
+
579
+ .remaining {
580
+ font-size: 1.5rem;
581
+ font-weight: bold;
582
+ color: #aaa;
583
+ }
584
+ }
585
+
586
+ .progress-bar {
587
+ width: 100%;
588
+ height: .25rem;
589
+ margin-bottom: 0.5rem;
590
+ background-color: #3d3d3d;
591
+
592
+ .inner {
593
+ height: 100%;
594
+ background-color: #fff;
595
+ }
596
+ }
597
+
598
+ .torrent-info {
599
+ display: flex;
600
+ justify-content: space-between;
601
+
602
+ .peers {
603
+ display: flex;
604
+ align-items: center;
605
+ gap: 1rem;
606
+
607
+ span {
608
+ display: flex;
609
+ align-items: center;
610
+ gap: .5rem;
611
+ }
612
+ }
613
+
614
+ .stats {
615
+ display: flex;
616
+ align-items: center;
617
+ gap: 2rem;
618
+
619
+ span {
620
+ display: flex;
621
+ align-items: center;
622
+ gap: .5rem;
623
+ }
624
+ }
625
+ }
626
+ }
627
+ .actions {
628
+ display: flex;
629
+ justify-content: center;
630
+ align-items: center;
631
+ gap: 1rem;
632
+ padding: 1rem;
633
+
634
+ button {
635
+ padding: 1.5rem 1.5rem;
636
+ border-radius: 0.5rem;
637
+ border: none;
638
+ background-color: rgb(24, 26, 27);
639
+ cursor: pointer;
640
+
641
+ display: flex;
642
+ align-items: center;
643
+ justify-content: center;
644
+ gap: .25rem;
645
+
646
+ font-weight: bold;
647
+ color: #aaa;
648
+
649
+ svg {
650
+ width: 1.5rem;
651
+ height: 1.5rem;
652
+ stroke-width: 3;
653
+ }
654
+
655
+ &.active {
656
+ background-color: #2f2f2f;
657
+ color: #fff;
658
+ }
659
+ }
660
+ }
661
+ }
662
+ }
663
+ `,YF=an`
664
+ .header {
665
+ display: flex;
666
+ align-items: center;
667
+ justify-content: space-between;
668
+ gap: 1rem;
669
+ padding: 1rem;
670
+ border-bottom: 1px solid rgb(48, 52, 54);
671
+ background-color: rgb(35, 38, 40);
672
+
673
+ .title {
674
+ font-size: 2rem;
675
+ font-weight: bold;
676
+ }
677
+ }
678
+
679
+ .main {
680
+ display: flex;
681
+ flex-direction: column;
682
+ gap: 1rem;
683
+ padding: 1rem;
684
+ padding-top: 0;
685
+ padding-bottom: 1rem;
686
+ background-color: rgb(35, 38, 40);
687
+
688
+ .content {
689
+ display: flex;
690
+ flex-direction: column;
691
+ gap: 1rem;
692
+
693
+ .body {
694
+ display: flex;
695
+ flex-direction: column;
696
+ gap: 1rem;
697
+ padding-top: 1rem;
698
+
699
+ .message {
700
+ display: flex;
701
+ flex-direction: column;
702
+ align-items: center;
703
+ justify-content: center;
704
+ text-align: center;
705
+ gap: .5rem;
706
+ font-size: 1.7rem;
707
+ font-weight: bold;
708
+ color: #aaa;
709
+ }
710
+
711
+ .actions {
712
+ display: flex;
713
+ align-items: center;
714
+ justify-content: space-around;
715
+ gap: 1rem;
716
+
717
+ button {
718
+ padding: 1.5rem 1.5rem;
719
+ border-radius: 0.5rem;
720
+ border: none;
721
+ background-color: rgb(24, 26, 27);
722
+ cursor: pointer;
723
+
724
+ display: flex;
725
+ align-items: center;
726
+ justify-content: center;
727
+ gap: .25rem;
728
+
729
+ width: 100%;
730
+
731
+ font-weight: bold;
732
+ color: #aaa;
733
+
734
+ svg {
735
+ width: 1.5rem;
736
+ height: 1.5rem;
737
+ stroke-width: 3;
738
+ }
739
+
740
+ &.active {
741
+ background-color: #2f2f2f;
742
+ color: #fff;
743
+ }
744
+ }
745
+ }
746
+ }
747
+ }
748
+ }
749
+ `,KF=async t=>{const e=`https://duckduckgo.com/?q=${encodeURIComponent(t)}&iax=images&ia=images`;return(await _w(e,{}).then(r=>r.text())).match(/,vqd="(.*?)"/)[1]},QF=async t=>{const e=await KF(t),n=await _w(`https://duckduckgo.com/i.js?l=wt-wt&o=json&q=${encodeURIComponent(t).replaceAll("-","%2D")}&vqd=${e}&f=,,,,,&p=1`,{}).then(s=>s.text()),i=new DOMParser().parseFromString(n,"text/html");return JSON.parse(i.body.textContent||"{results:[]}").results[0].image},ZF=new Intl.RelativeTimeFormat("en",{style:"short"}),Bb=({torrent:t})=>{const[e,n]=k.useState(void 0),[i,r]=k.useState(!1),[s,l]=k.useState(!1);k.useEffect(()=>{QF(t.state.name).then(n)},[]);const a=isNaN(t.state.remainingTime)||!isFinite(t.state.remainingTime)?"":ZF.format(t.state.remainingTime??0,"seconds"),u=()=>rC({infoHash:t.infoHash,removeFiles:!0}),f=t.state.files?.filter(d=>Vg.includes(d.name.split(".").pop()??"")),p=()=>{r(!0)},m=()=>{r(!1)},o=()=>{l(!0)},c=()=>{l(!1)};return pe("div",{className:`item ${t.state.status}`,children:[pe(kE,{open:s,css:YF,onClose:c,children:[V("div",{className:"header",children:V("div",{className:"title",children:"Delete torrent ?"})}),V("div",{className:"main",children:V("div",{className:"content",children:pe("div",{className:"body",children:[pe("div",{className:"message",children:[V("span",{children:"Are you sure you want to delete "}),pe("span",{children:[t.state.name,"?"]})]}),pe("div",{className:"actions",children:[V("button",{onClick:c,children:"Cancel"}),V("button",{onClick:u,children:"Delete torrent"})]})]})})})]}),pe("div",{className:"main",children:[pe("div",{className:"info",children:[V("img",{className:"preview",src:e,referrerPolicy:"no-referrer"}),pe("div",{className:"content",children:[V("div",{className:"name",title:t.state.name,children:t.state.name}),V("span",{className:"size",children:Or(t.state.torrentFile.length)}),pe("span",{className:"files",children:[(t.state.files?.length??0)>1?`${t.state.files?.length} files`:"",(t.state.files?.length??0)>1&&(i?pe("button",{onClick:m,className:"toggle-show-files",children:[V("span",{children:"Show less"}),V(dF,{size:20})]}):pe("button",{onClick:p,className:"toggle-show-files",children:[V("span",{children:"Show more"}),V(lF,{size:20})]}))]})]})]}),V("div",{className:"download-info",children:t.state.status==="downloading"&&pe(Ay,{children:[pe("div",{className:"progress-title",children:[pe("span",{className:"status",children:[t.state.status==="downloading"&&`Downloading ${(t.state.progress*100).toFixed(2)}%`,t.state.status==="finished"&&"Finished",t.state.status==="seeding"&&"Seeding",t.state.status==="paused"&&"Paused"]}),V("span",{className:"remaining",children:t.state.status==="downloading"&&pe(Ay,{children:[V("span",{className:"highlight",children:a}),"\xa0",V("span",{children:"remaining"})]})})]}),V("div",{className:"progress-bar",children:V("div",{className:"inner",style:{width:`${t.state.progress*100}%`,height:"100%",backgroundColor:"#fff"}})}),V("div",{className:"torrent-info",children:pe("div",{className:"stats",children:[pe("span",{children:[V(sF,{size:20}),pe("span",{className:"highlight",children:[Or(t.state.downloadSpeed??0),"/s"]})]}),pe("span",{children:[V(pF,{size:22}),V("span",{className:"highlight",children:Or(t.state.downloaded??0)}),pe("span",{children:["/ ",Or(t.state.torrentFile.length)]})]})]})})]})}),pe("div",{className:"actions",children:[f?.length?V(gg,{to:`/watch/${t.infoHash}/${f.at(0)?.index}`,className:"play",children:V("button",{children:V(Ug,{size:20})})}):void 0,V("div",{children:V("button",{onClick:o,children:V(SE,{size:20})})})]})]}),V("div",{children:i&&V("div",{className:"files",children:t.state.files?.map(d=>pe("div",{className:"file",children:[V("span",{className:"name",children:d.name}),V("span",{className:"size",children:Or(d.length)}),Vg.includes(d.name.split(".").pop()??"")&&V(gg,{to:`/watch/${t.infoHash}/${d.index}`,className:"play",children:V("button",{children:V(Ug,{size:20})})})]},d.name))})})]},t.infoHash)},XF=({...t})=>{const e=iC(),i=yi.useRxCollection("torrents")?.find({}),{result:r}=yi.useRxQuery(i),s=r?.filter(f=>f.state.status==="init"||f.state.status==="checkingFiles"||f.state.status==="downloadingMetadata"||f.state.status==="downloading"||f.state.status==="paused"),l=r?.filter(f=>f.state.status==="finished"),a=async()=>{await e?.incrementalModify(f=>(f.paused=!f.paused,f))},u=()=>{const f=document.createElement("input");f.type="file",f.multiple=!0,f.onchange=()=>WF([...f.files??[]]),f.click()};return pe("div",{css:GF,...t,children:[pe("div",{className:"category",children:[pe("div",{className:"title",children:[V("span",{children:"Downloading"}),V("span",{onClick:a,children:e?.paused?V(Ug,{size:20}):V(bF,{size:20})})]}),pe("div",{className:"items",children:[s?.map(f=>V(Bb,{torrent:f},f.infoHash)),V("div",{className:"select-file",onClick:u,children:"Click here, drop or paste torrent files or magnets to start downloading"})]})]}),pe("div",{className:"category",children:[V("div",{className:"title",children:"Completed"}),V("div",{className:"items",children:l?.map(f=>V(Bb,{torrent:f},f.infoHash))})]})]})},qF=an`
750
+ --header-height: 20rem;
751
+ .header {
752
+ height: var(--header-height);
753
+ background-color: #0f0f0f;
754
+ padding: 2rem;
755
+ }
756
+
757
+ .torrent-list {
758
+ height: calc(100vh - var(--header-height));
759
+ background-color: #1f1f1f;
760
+ }
761
+ `,JF=()=>pe("div",{css:qF,children:[V(HF,{className:"header"}),V(XF,{className:"torrent-list"})]});var EE={};(function(t){var e=function(){var o=new Date,c=4,d=3,h=2,g=1,y=c,v={setLogLevel:function(_){_==this.debug?y=g:_==this.info?y=h:_==this.warn?y=d:(_==this.error,y=c)},debug:function(_,b){console.debug===void 0&&(console.debug=console.log),g>=y&&console.debug("["+e.getDurationString(new Date-o,1e3)+"]","["+_+"]",b)},log:function(_,b){this.debug(_.msg)},info:function(_,b){h>=y&&console.info("["+e.getDurationString(new Date-o,1e3)+"]","["+_+"]",b)},warn:function(_,b){d>=y&&console.warn("["+e.getDurationString(new Date-o,1e3)+"]","["+_+"]",b)},error:function(_,b){c>=y&&console.error("["+e.getDurationString(new Date-o,1e3)+"]","["+_+"]",b)}};return v}();e.getDurationString=function(o,c){var d;function h(x,w){for(var S=""+x,C=S.split(".");C[0].length<w;)C[0]="0"+C[0];return C.join(".")}o<0?(d=!0,o=-o):d=!1;var g=c||1,y=o/g,v=Math.floor(y/3600);y-=v*3600;var _=Math.floor(y/60);y-=_*60;var b=y*1e3;return y=Math.floor(y),b-=y*1e3,b=Math.floor(b),(d?"-":"")+v+":"+h(_,2)+":"+h(y,2)+"."+h(b,3)},e.printRanges=function(o){var c=o.length;if(c>0){for(var d="",h=0;h<c;h++)h>0&&(d+=","),d+="["+e.getDurationString(o.start(h))+","+e.getDurationString(o.end(h))+"]";return d}else return"(empty)"},t.Log=e;var n=function(o){if(o instanceof ArrayBuffer)this.buffer=o,this.dataview=new DataView(o);else throw"Needs an array buffer";this.position=0};n.prototype.getPosition=function(){return this.position},n.prototype.getEndPosition=function(){return this.buffer.byteLength},n.prototype.getLength=function(){return this.buffer.byteLength},n.prototype.seek=function(o){var c=Math.max(0,Math.min(this.buffer.byteLength,o));return this.position=isNaN(c)||!isFinite(c)?0:c,!0},n.prototype.isEos=function(){return this.getPosition()>=this.getEndPosition()},n.prototype.readAnyInt=function(o,c){var d=0;if(this.position+o<=this.buffer.byteLength){switch(o){case 1:c?d=this.dataview.getInt8(this.position):d=this.dataview.getUint8(this.position);break;case 2:c?d=this.dataview.getInt16(this.position):d=this.dataview.getUint16(this.position);break;case 3:if(c)throw"No method for reading signed 24 bits values";d=this.dataview.getUint8(this.position)<<16,d|=this.dataview.getUint8(this.position+1)<<8,d|=this.dataview.getUint8(this.position+2);break;case 4:c?d=this.dataview.getInt32(this.position):d=this.dataview.getUint32(this.position);break;case 8:if(c)throw"No method for reading signed 64 bits values";d=this.dataview.getUint32(this.position)<<32,d|=this.dataview.getUint32(this.position+4);break;default:throw"readInt method not implemented for size: "+o}return this.position+=o,d}else throw"Not enough bytes in buffer"},n.prototype.readUint8=function(){return this.readAnyInt(1,!1)},n.prototype.readUint16=function(){return this.readAnyInt(2,!1)},n.prototype.readUint24=function(){return this.readAnyInt(3,!1)},n.prototype.readUint32=function(){return this.readAnyInt(4,!1)},n.prototype.readUint64=function(){return this.readAnyInt(8,!1)},n.prototype.readString=function(o){if(this.position+o<=this.buffer.byteLength){for(var c="",d=0;d<o;d++)c+=String.fromCharCode(this.readUint8());return c}else throw"Not enough bytes in buffer"},n.prototype.readCString=function(){for(var o=[];;){var c=this.readUint8();if(c!==0)o.push(c);else break}return String.fromCharCode.apply(null,o)},n.prototype.readInt8=function(){return this.readAnyInt(1,!0)},n.prototype.readInt16=function(){return this.readAnyInt(2,!0)},n.prototype.readInt32=function(){return this.readAnyInt(4,!0)},n.prototype.readInt64=function(){return this.readAnyInt(8,!1)},n.prototype.readUint8Array=function(o){for(var c=new Uint8Array(o),d=0;d<o;d++)c[d]=this.readUint8();return c},n.prototype.readInt16Array=function(o){for(var c=new Int16Array(o),d=0;d<o;d++)c[d]=this.readInt16();return c},n.prototype.readUint16Array=function(o){for(var c=new Int16Array(o),d=0;d<o;d++)c[d]=this.readUint16();return c},n.prototype.readUint32Array=function(o){for(var c=new Uint32Array(o),d=0;d<o;d++)c[d]=this.readUint32();return c},n.prototype.readInt32Array=function(o){for(var c=new Int32Array(o),d=0;d<o;d++)c[d]=this.readInt32();return c},t.MP4BoxStream=n;var i=function(o,c,d){this._byteOffset=c||0,o instanceof ArrayBuffer?this.buffer=o:typeof o=="object"?(this.dataView=o,c&&(this._byteOffset+=c)):this.buffer=new ArrayBuffer(o||0),this.position=0,this.endianness=d??i.LITTLE_ENDIAN};i.prototype={},i.prototype.getPosition=function(){return this.position},i.prototype._realloc=function(o){if(this._dynamicSize){var c=this._byteOffset+this.position+o,d=this._buffer.byteLength;if(c<=d){c>this._byteLength&&(this._byteLength=c);return}for(d<1&&(d=1);c>d;)d*=2;var h=new ArrayBuffer(d),g=new Uint8Array(this._buffer),y=new Uint8Array(h,0,g.length);y.set(g),this.buffer=h,this._byteLength=c}},i.prototype._trimAlloc=function(){if(this._byteLength!=this._buffer.byteLength){var o=new ArrayBuffer(this._byteLength),c=new Uint8Array(o),d=new Uint8Array(this._buffer,0,c.length);c.set(d),this.buffer=o}},i.BIG_ENDIAN=!1,i.LITTLE_ENDIAN=!0,i.prototype._byteLength=0,Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}}),Object.defineProperty(i.prototype,"buffer",{get:function(){return this._trimAlloc(),this._buffer},set:function(o){this._buffer=o,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(o){this._byteOffset=o,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(o){this._byteOffset=o.byteOffset,this._buffer=o.buffer,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._byteOffset+o.byteLength}}),i.prototype.seek=function(o){var c=Math.max(0,Math.min(this.byteLength,o));this.position=isNaN(c)||!isFinite(c)?0:c},i.prototype.isEof=function(){return this.position>=this._byteLength},i.prototype.mapUint8Array=function(o){this._realloc(o*1);var c=new Uint8Array(this._buffer,this.byteOffset+this.position,o);return this.position+=o*1,c},i.prototype.readInt32Array=function(o,c){o=o??this.byteLength-this.position/4;var d=new Int32Array(o);return i.memcpy(d.buffer,0,this.buffer,this.byteOffset+this.position,o*d.BYTES_PER_ELEMENT),i.arrayToNative(d,c??this.endianness),this.position+=d.byteLength,d},i.prototype.readInt16Array=function(o,c){o=o??this.byteLength-this.position/2;var d=new Int16Array(o);return i.memcpy(d.buffer,0,this.buffer,this.byteOffset+this.position,o*d.BYTES_PER_ELEMENT),i.arrayToNative(d,c??this.endianness),this.position+=d.byteLength,d},i.prototype.readInt8Array=function(o){o=o??this.byteLength-this.position;var c=new Int8Array(o);return i.memcpy(c.buffer,0,this.buffer,this.byteOffset+this.position,o*c.BYTES_PER_ELEMENT),this.position+=c.byteLength,c},i.prototype.readUint32Array=function(o,c){o=o??this.byteLength-this.position/4;var d=new Uint32Array(o);return i.memcpy(d.buffer,0,this.buffer,this.byteOffset+this.position,o*d.BYTES_PER_ELEMENT),i.arrayToNative(d,c??this.endianness),this.position+=d.byteLength,d},i.prototype.readUint16Array=function(o,c){o=o??this.byteLength-this.position/2;var d=new Uint16Array(o);return i.memcpy(d.buffer,0,this.buffer,this.byteOffset+this.position,o*d.BYTES_PER_ELEMENT),i.arrayToNative(d,c??this.endianness),this.position+=d.byteLength,d},i.prototype.readUint8Array=function(o){o=o??this.byteLength-this.position;var c=new Uint8Array(o);return i.memcpy(c.buffer,0,this.buffer,this.byteOffset+this.position,o*c.BYTES_PER_ELEMENT),this.position+=c.byteLength,c},i.prototype.readFloat64Array=function(o,c){o=o??this.byteLength-this.position/8;var d=new Float64Array(o);return i.memcpy(d.buffer,0,this.buffer,this.byteOffset+this.position,o*d.BYTES_PER_ELEMENT),i.arrayToNative(d,c??this.endianness),this.position+=d.byteLength,d},i.prototype.readFloat32Array=function(o,c){o=o??this.byteLength-this.position/4;var d=new Float32Array(o);return i.memcpy(d.buffer,0,this.buffer,this.byteOffset+this.position,o*d.BYTES_PER_ELEMENT),i.arrayToNative(d,c??this.endianness),this.position+=d.byteLength,d},i.prototype.readInt32=function(o){var c=this._dataView.getInt32(this.position,o??this.endianness);return this.position+=4,c},i.prototype.readInt16=function(o){var c=this._dataView.getInt16(this.position,o??this.endianness);return this.position+=2,c},i.prototype.readInt8=function(){var o=this._dataView.getInt8(this.position);return this.position+=1,o},i.prototype.readUint32=function(o){var c=this._dataView.getUint32(this.position,o??this.endianness);return this.position+=4,c},i.prototype.readUint16=function(o){var c=this._dataView.getUint16(this.position,o??this.endianness);return this.position+=2,c},i.prototype.readUint8=function(){var o=this._dataView.getUint8(this.position);return this.position+=1,o},i.prototype.readFloat32=function(o){var c=this._dataView.getFloat32(this.position,o??this.endianness);return this.position+=4,c},i.prototype.readFloat64=function(o){var c=this._dataView.getFloat64(this.position,o??this.endianness);return this.position+=8,c},i.endianness=new Int8Array(new Int16Array([1]).buffer)[0]>0,i.memcpy=function(o,c,d,h,g){var y=new Uint8Array(o,c,g),v=new Uint8Array(d,h,g);y.set(v)},i.arrayToNative=function(o,c){return c==this.endianness?o:this.flipArrayEndianness(o)},i.nativeToEndian=function(o,c){return this.endianness==c?o:this.flipArrayEndianness(o)},i.flipArrayEndianness=function(o){for(var c=new Uint8Array(o.buffer,o.byteOffset,o.byteLength),d=0;d<o.byteLength;d+=o.BYTES_PER_ELEMENT)for(var h=d+o.BYTES_PER_ELEMENT-1,g=d;h>g;h--,g++){var y=c[g];c[g]=c[h],c[h]=y}return o},i.prototype.failurePosition=0,String.fromCharCodeUint8=function(o){for(var c=[],d=0;d<o.length;d++)c[d]=o[d];return String.fromCharCode.apply(null,c)},i.prototype.readString=function(o,c){return c==null||c=="ASCII"?String.fromCharCodeUint8.apply(null,[this.mapUint8Array(o??this.byteLength-this.position)]):new TextDecoder(c).decode(this.mapUint8Array(o))},i.prototype.readCString=function(o){var c=this.byteLength-this.position,d=new Uint8Array(this._buffer,this._byteOffset+this.position),h=c;o!=null&&(h=Math.min(o,c));for(var g=0;g<h&&d[g]!==0;g++);var y=String.fromCharCodeUint8.apply(null,[this.mapUint8Array(g)]);return o!=null?this.position+=h-g:g!=c&&(this.position+=1),y};var r=Math.pow(2,32);i.prototype.readInt64=function(){return this.readInt32()*r+this.readUint32()},i.prototype.readUint64=function(){return this.readUint32()*r+this.readUint32()},i.prototype.readInt64=function(){return this.readUint32()*r+this.readUint32()},i.prototype.readUint24=function(){return(this.readUint8()<<16)+(this.readUint8()<<8)+this.readUint8()},t.DataStream=i,i.prototype.save=function(o){var c=new Blob([this.buffer]);if(window.URL&&URL.createObjectURL){var d=window.URL.createObjectURL(c),h=document.createElement("a");document.body.appendChild(h),h.setAttribute("href",d),h.setAttribute("download",o),h.setAttribute("target","_self"),h.click(),window.URL.revokeObjectURL(d)}else throw"DataStream.save: Can't create object URL."},i.prototype._dynamicSize=!0,Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(o){o||this._trimAlloc(),this._dynamicSize=o}}),i.prototype.shift=function(o){var c=new ArrayBuffer(this._byteLength-o),d=new Uint8Array(c),h=new Uint8Array(this._buffer,o,d.length);d.set(h),this.buffer=c,this.position-=o},i.prototype.writeInt32Array=function(o,c){if(this._realloc(o.length*4),o instanceof Int32Array&&this.byteOffset+this.position%o.BYTES_PER_ELEMENT===0)i.memcpy(this._buffer,this.byteOffset+this.position,o.buffer,0,o.byteLength),this.mapInt32Array(o.length,c);else for(var d=0;d<o.length;d++)this.writeInt32(o[d],c)},i.prototype.writeInt16Array=function(o,c){if(this._realloc(o.length*2),o instanceof Int16Array&&this.byteOffset+this.position%o.BYTES_PER_ELEMENT===0)i.memcpy(this._buffer,this.byteOffset+this.position,o.buffer,0,o.byteLength),this.mapInt16Array(o.length,c);else for(var d=0;d<o.length;d++)this.writeInt16(o[d],c)},i.prototype.writeInt8Array=function(o){if(this._realloc(o.length*1),o instanceof Int8Array&&this.byteOffset+this.position%o.BYTES_PER_ELEMENT===0)i.memcpy(this._buffer,this.byteOffset+this.position,o.buffer,0,o.byteLength),this.mapInt8Array(o.length);else for(var c=0;c<o.length;c++)this.writeInt8(o[c])},i.prototype.writeUint32Array=function(o,c){if(this._realloc(o.length*4),o instanceof Uint32Array&&this.byteOffset+this.position%o.BYTES_PER_ELEMENT===0)i.memcpy(this._buffer,this.byteOffset+this.position,o.buffer,0,o.byteLength),this.mapUint32Array(o.length,c);else for(var d=0;d<o.length;d++)this.writeUint32(o[d],c)},i.prototype.writeUint16Array=function(o,c){if(this._realloc(o.length*2),o instanceof Uint16Array&&this.byteOffset+this.position%o.BYTES_PER_ELEMENT===0)i.memcpy(this._buffer,this.byteOffset+this.position,o.buffer,0,o.byteLength),this.mapUint16Array(o.length,c);else for(var d=0;d<o.length;d++)this.writeUint16(o[d],c)},i.prototype.writeUint8Array=function(o){if(this._realloc(o.length*1),o instanceof Uint8Array&&this.byteOffset+this.position%o.BYTES_PER_ELEMENT===0)i.memcpy(this._buffer,this.byteOffset+this.position,o.buffer,0,o.byteLength),this.mapUint8Array(o.length);else for(var c=0;c<o.length;c++)this.writeUint8(o[c])},i.prototype.writeFloat64Array=function(o,c){if(this._realloc(o.length*8),o instanceof Float64Array&&this.byteOffset+this.position%o.BYTES_PER_ELEMENT===0)i.memcpy(this._buffer,this.byteOffset+this.position,o.buffer,0,o.byteLength),this.mapFloat64Array(o.length,c);else for(var d=0;d<o.length;d++)this.writeFloat64(o[d],c)},i.prototype.writeFloat32Array=function(o,c){if(this._realloc(o.length*4),o instanceof Float32Array&&this.byteOffset+this.position%o.BYTES_PER_ELEMENT===0)i.memcpy(this._buffer,this.byteOffset+this.position,o.buffer,0,o.byteLength),this.mapFloat32Array(o.length,c);else for(var d=0;d<o.length;d++)this.writeFloat32(o[d],c)},i.prototype.writeInt32=function(o,c){this._realloc(4),this._dataView.setInt32(this.position,o,c??this.endianness),this.position+=4},i.prototype.writeInt16=function(o,c){this._realloc(2),this._dataView.setInt16(this.position,o,c??this.endianness),this.position+=2},i.prototype.writeInt8=function(o){this._realloc(1),this._dataView.setInt8(this.position,o),this.position+=1},i.prototype.writeUint32=function(o,c){this._realloc(4),this._dataView.setUint32(this.position,o,c??this.endianness),this.position+=4},i.prototype.writeUint16=function(o,c){this._realloc(2),this._dataView.setUint16(this.position,o,c??this.endianness),this.position+=2},i.prototype.writeUint8=function(o){this._realloc(1),this._dataView.setUint8(this.position,o),this.position+=1},i.prototype.writeFloat32=function(o,c){this._realloc(4),this._dataView.setFloat32(this.position,o,c??this.endianness),this.position+=4},i.prototype.writeFloat64=function(o,c){this._realloc(8),this._dataView.setFloat64(this.position,o,c??this.endianness),this.position+=8},i.prototype.writeUCS2String=function(o,c,d){d==null&&(d=o.length);for(var h=0;h<o.length&&h<d;h++)this.writeUint16(o.charCodeAt(h),c);for(;h<d;h++)this.writeUint16(0)},i.prototype.writeString=function(o,c,d){var h=0;if(c==null||c=="ASCII")if(d!=null){var g=Math.min(o.length,d);for(h=0;h<g;h++)this.writeUint8(o.charCodeAt(h));for(;h<d;h++)this.writeUint8(0)}else for(h=0;h<o.length;h++)this.writeUint8(o.charCodeAt(h));else this.writeUint8Array(new TextEncoder(c).encode(o.substring(0,d)))},i.prototype.writeCString=function(o,c){var d=0;if(c!=null){var h=Math.min(o.length,c);for(d=0;d<h;d++)this.writeUint8(o.charCodeAt(d));for(;d<c;d++)this.writeUint8(0)}else{for(d=0;d<o.length;d++)this.writeUint8(o.charCodeAt(d));this.writeUint8(0)}},i.prototype.writeStruct=function(o,c){for(var d=0;d<o.length;d+=2){var h=o[d+1];this.writeType(h,c[o[d]],c)}},i.prototype.writeType=function(o,c,d){var h;if(typeof o=="function")return o(this,c);if(typeof o=="object"&&!(o instanceof Array))return o.set(this,c,d);var g=null,y="ASCII",v=this.position;switch(typeof o=="string"&&/:/.test(o)&&(h=o.split(":"),o=h[0],g=parseInt(h[1])),typeof o=="string"&&/,/.test(o)&&(h=o.split(","),o=h[0],y=parseInt(h[1])),o){case"uint8":this.writeUint8(c);break;case"int8":this.writeInt8(c);break;case"uint16":this.writeUint16(c,this.endianness);break;case"int16":this.writeInt16(c,this.endianness);break;case"uint32":this.writeUint32(c,this.endianness);break;case"int32":this.writeInt32(c,this.endianness);break;case"float32":this.writeFloat32(c,this.endianness);break;case"float64":this.writeFloat64(c,this.endianness);break;case"uint16be":this.writeUint16(c,i.BIG_ENDIAN);break;case"int16be":this.writeInt16(c,i.BIG_ENDIAN);break;case"uint32be":this.writeUint32(c,i.BIG_ENDIAN);break;case"int32be":this.writeInt32(c,i.BIG_ENDIAN);break;case"float32be":this.writeFloat32(c,i.BIG_ENDIAN);break;case"float64be":this.writeFloat64(c,i.BIG_ENDIAN);break;case"uint16le":this.writeUint16(c,i.LITTLE_ENDIAN);break;case"int16le":this.writeInt16(c,i.LITTLE_ENDIAN);break;case"uint32le":this.writeUint32(c,i.LITTLE_ENDIAN);break;case"int32le":this.writeInt32(c,i.LITTLE_ENDIAN);break;case"float32le":this.writeFloat32(c,i.LITTLE_ENDIAN);break;case"float64le":this.writeFloat64(c,i.LITTLE_ENDIAN);break;case"cstring":this.writeCString(c,g);break;case"string":this.writeString(c,y,g);break;case"u16string":this.writeUCS2String(c,this.endianness,g);break;case"u16stringle":this.writeUCS2String(c,i.LITTLE_ENDIAN,g);break;case"u16stringbe":this.writeUCS2String(c,i.BIG_ENDIAN,g);break;default:if(o.length==3){for(var _=o[1],b=0;b<c.length;b++)this.writeType(_,c[b]);break}else{this.writeStruct(o,c);break}}g!=null&&(this.position=v,this._realloc(g),this.position=v+g)},i.prototype.writeUint64=function(o){var c=Math.floor(o/r);this.writeUint32(c),this.writeUint32(o&4294967295)},i.prototype.writeUint24=function(o){this.writeUint8((o&16711680)>>16),this.writeUint8((o&65280)>>8),this.writeUint8(o&255)},i.prototype.adjustUint32=function(o,c){var d=this.position;this.seek(o),this.writeUint32(c),this.seek(d)},i.prototype.mapInt32Array=function(o,c){this._realloc(o*4);var d=new Int32Array(this._buffer,this.byteOffset+this.position,o);return i.arrayToNative(d,c??this.endianness),this.position+=o*4,d},i.prototype.mapInt16Array=function(o,c){this._realloc(o*2);var d=new Int16Array(this._buffer,this.byteOffset+this.position,o);return i.arrayToNative(d,c??this.endianness),this.position+=o*2,d},i.prototype.mapInt8Array=function(o){this._realloc(o*1);var c=new Int8Array(this._buffer,this.byteOffset+this.position,o);return this.position+=o*1,c},i.prototype.mapUint32Array=function(o,c){this._realloc(o*4);var d=new Uint32Array(this._buffer,this.byteOffset+this.position,o);return i.arrayToNative(d,c??this.endianness),this.position+=o*4,d},i.prototype.mapUint16Array=function(o,c){this._realloc(o*2);var d=new Uint16Array(this._buffer,this.byteOffset+this.position,o);return i.arrayToNative(d,c??this.endianness),this.position+=o*2,d},i.prototype.mapFloat64Array=function(o,c){this._realloc(o*8);var d=new Float64Array(this._buffer,this.byteOffset+this.position,o);return i.arrayToNative(d,c??this.endianness),this.position+=o*8,d},i.prototype.mapFloat32Array=function(o,c){this._realloc(o*4);var d=new Float32Array(this._buffer,this.byteOffset+this.position,o);return i.arrayToNative(d,c??this.endianness),this.position+=o*4,d};var s=function(o){this.buffers=[],this.bufferIndex=-1,o&&(this.insertBuffer(o),this.bufferIndex=0)};s.prototype=new i(new ArrayBuffer,0,i.BIG_ENDIAN),s.prototype.initialized=function(){var o;return this.bufferIndex>-1?!0:this.buffers.length>0?(o=this.buffers[0],o.fileStart===0?(this.buffer=o,this.bufferIndex=0,e.debug("MultiBufferStream","Stream ready for parsing"),!0):(e.warn("MultiBufferStream","The first buffer should have a fileStart of 0"),this.logBufferLevel(),!1)):(e.warn("MultiBufferStream","No buffer to start parsing from"),this.logBufferLevel(),!1)},ArrayBuffer.concat=function(o,c){e.debug("ArrayBuffer","Trying to create a new buffer of size: "+(o.byteLength+c.byteLength));var d=new Uint8Array(o.byteLength+c.byteLength);return d.set(new Uint8Array(o),0),d.set(new Uint8Array(c),o.byteLength),d.buffer},s.prototype.reduceBuffer=function(o,c,d){var h;return h=new Uint8Array(d),h.set(new Uint8Array(o,c,d)),h.buffer.fileStart=o.fileStart+c,h.buffer.usedBytes=0,h.buffer},s.prototype.insertBuffer=function(o){for(var c=!0,d=0;d<this.buffers.length;d++){var h=this.buffers[d];if(o.fileStart<=h.fileStart){if(o.fileStart===h.fileStart)if(o.byteLength>h.byteLength){this.buffers.splice(d,1),d--;continue}else e.warn("MultiBufferStream","Buffer (fileStart: "+o.fileStart+" - Length: "+o.byteLength+") already appended, ignoring");else o.fileStart+o.byteLength<=h.fileStart||(o=this.reduceBuffer(o,0,h.fileStart-o.fileStart)),e.debug("MultiBufferStream","Appending new buffer (fileStart: "+o.fileStart+" - Length: "+o.byteLength+")"),this.buffers.splice(d,0,o),d===0&&(this.buffer=o);c=!1;break}else if(o.fileStart<h.fileStart+h.byteLength){var g=h.fileStart+h.byteLength-o.fileStart,y=o.byteLength-g;if(y>0)o=this.reduceBuffer(o,g,y);else{c=!1;break}}}c&&(e.debug("MultiBufferStream","Appending new buffer (fileStart: "+o.fileStart+" - Length: "+o.byteLength+")"),this.buffers.push(o),d===0&&(this.buffer=o))},s.prototype.logBufferLevel=function(o){var c,d,h,g,y=[],v,_="";for(h=0,g=0,c=0;c<this.buffers.length;c++)d=this.buffers[c],c===0?(v={},y.push(v),v.start=d.fileStart,v.end=d.fileStart+d.byteLength,_+="["+v.start+"-"):v.end===d.fileStart?v.end=d.fileStart+d.byteLength:(v={},v.start=d.fileStart,_+=y[y.length-1].end-1+"], ["+v.start+"-",v.end=d.fileStart+d.byteLength,y.push(v)),h+=d.usedBytes,g+=d.byteLength;y.length>0&&(_+=v.end-1+"]");var b=o?e.info:e.debug;this.buffers.length===0?b("MultiBufferStream","No more buffer in memory"):b("MultiBufferStream",""+this.buffers.length+" stored buffer(s) ("+h+"/"+g+" bytes), continuous ranges: "+_)},s.prototype.cleanBuffers=function(){var o,c;for(o=0;o<this.buffers.length;o++)c=this.buffers[o],c.usedBytes===c.byteLength&&(e.debug("MultiBufferStream","Removing buffer #"+o),this.buffers.splice(o,1),o--)},s.prototype.mergeNextBuffer=function(){var o;if(this.bufferIndex+1<this.buffers.length)if(o=this.buffers[this.bufferIndex+1],o.fileStart===this.buffer.fileStart+this.buffer.byteLength){var c=this.buffer.byteLength,d=this.buffer.usedBytes,h=this.buffer.fileStart;return this.buffers[this.bufferIndex]=ArrayBuffer.concat(this.buffer,o),this.buffer=this.buffers[this.bufferIndex],this.buffers.splice(this.bufferIndex+1,1),this.buffer.usedBytes=d,this.buffer.fileStart=h,e.debug("ISOFile","Concatenating buffer for box parsing (length: "+c+"->"+this.buffer.byteLength+")"),!0}else return!1;else return!1},s.prototype.findPosition=function(o,c,d){var h,g=null,y=-1;for(o===!0?h=0:h=this.bufferIndex;h<this.buffers.length&&(g=this.buffers[h],g.fileStart<=c);){y=h,d&&(g.fileStart+g.byteLength<=c?g.usedBytes=g.byteLength:g.usedBytes=c-g.fileStart,this.logBufferLevel());h++}return y!==-1?(g=this.buffers[y],g.fileStart+g.byteLength>=c?(e.debug("MultiBufferStream","Found position in existing buffer #"+y),y):-1):-1},s.prototype.findEndContiguousBuf=function(o){var c,d,h,g=o!==void 0?o:this.bufferIndex;if(d=this.buffers[g],this.buffers.length>g+1)for(c=g+1;c<this.buffers.length&&(h=this.buffers[c],h.fileStart===d.fileStart+d.byteLength);c++)d=h;return d.fileStart+d.byteLength},s.prototype.getEndFilePositionAfter=function(o){var c=this.findPosition(!0,o,!1);return c!==-1?this.findEndContiguousBuf(c):o},s.prototype.addUsedBytes=function(o){this.buffer.usedBytes+=o,this.logBufferLevel()},s.prototype.setAllUsedBytes=function(){this.buffer.usedBytes=this.buffer.byteLength,this.logBufferLevel()},s.prototype.seek=function(o,c,d){var h;return h=this.findPosition(c,o,d),h!==-1?(this.buffer=this.buffers[h],this.bufferIndex=h,this.position=o-this.buffer.fileStart,e.debug("MultiBufferStream","Repositioning parser at buffer position: "+this.position),!0):(e.debug("MultiBufferStream","Position "+o+" not found in buffered data"),!1)},s.prototype.getPosition=function(){if(this.bufferIndex===-1||this.buffers[this.bufferIndex]===null)throw"Error accessing position in the MultiBufferStream";return this.buffers[this.bufferIndex].fileStart+this.position},s.prototype.getLength=function(){return this.byteLength},s.prototype.getEndPosition=function(){if(this.bufferIndex===-1||this.buffers[this.bufferIndex]===null)throw"Error accessing position in the MultiBufferStream";return this.buffers[this.bufferIndex].fileStart+this.byteLength},t.MultiBufferStream=s;var l=function(){var o=3,c=4,d=5,h=6,g=[];g[o]="ES_Descriptor",g[c]="DecoderConfigDescriptor",g[d]="DecoderSpecificInfo",g[h]="SLConfigDescriptor",this.getDescriptorName=function(_){return g[_]};var y=this,v={};return this.parseOneDescriptor=function(_){var b=0,x,w,S;for(x=_.readUint8(),S=_.readUint8();S&128;)b=(S&127)<<7,S=_.readUint8();return b+=S&127,e.debug("MPEG4DescriptorParser","Found "+(g[x]||"Descriptor "+x)+", size "+b+" at position "+_.getPosition()),g[x]?w=new v[g[x]](b):w=new v.Descriptor(b),w.parse(_),w},v.Descriptor=function(_,b){this.tag=_,this.size=b,this.descs=[]},v.Descriptor.prototype.parse=function(_){this.data=_.readUint8Array(this.size)},v.Descriptor.prototype.findDescriptor=function(_){for(var b=0;b<this.descs.length;b++)if(this.descs[b].tag==_)return this.descs[b];return null},v.Descriptor.prototype.parseRemainingDescriptors=function(_){for(var b=_.position;_.position<b+this.size;){var x=y.parseOneDescriptor(_);this.descs.push(x)}},v.ES_Descriptor=function(_){v.Descriptor.call(this,o,_)},v.ES_Descriptor.prototype=new v.Descriptor,v.ES_Descriptor.prototype.parse=function(_){if(this.ES_ID=_.readUint16(),this.flags=_.readUint8(),this.size-=3,this.flags&128?(this.dependsOn_ES_ID=_.readUint16(),this.size-=2):this.dependsOn_ES_ID=0,this.flags&64){var b=_.readUint8();this.URL=_.readString(b),this.size-=b+1}else this.URL="";this.flags&32?(this.OCR_ES_ID=_.readUint16(),this.size-=2):this.OCR_ES_ID=0,this.parseRemainingDescriptors(_)},v.ES_Descriptor.prototype.getOTI=function(_){var b=this.findDescriptor(c);return b?b.oti:0},v.ES_Descriptor.prototype.getAudioConfig=function(_){var b=this.findDescriptor(c);if(!b)return null;var x=b.findDescriptor(d);if(x&&x.data){var w=(x.data[0]&248)>>3;return w===31&&x.data.length>=2&&(w=32+((x.data[0]&7)<<3)+((x.data[1]&224)>>5)),w}else return null},v.DecoderConfigDescriptor=function(_){v.Descriptor.call(this,c,_)},v.DecoderConfigDescriptor.prototype=new v.Descriptor,v.DecoderConfigDescriptor.prototype.parse=function(_){this.oti=_.readUint8(),this.streamType=_.readUint8(),this.bufferSize=_.readUint24(),this.maxBitrate=_.readUint32(),this.avgBitrate=_.readUint32(),this.size-=13,this.parseRemainingDescriptors(_)},v.DecoderSpecificInfo=function(_){v.Descriptor.call(this,d,_)},v.DecoderSpecificInfo.prototype=new v.Descriptor,v.SLConfigDescriptor=function(_){v.Descriptor.call(this,h,_)},v.SLConfigDescriptor.prototype=new v.Descriptor,this};t.MPEG4DescriptorParser=l;var a={ERR_INVALID_DATA:-1,ERR_NOT_ENOUGH_DATA:0,OK:1,BASIC_BOXES:["mdat","idat","free","skip","meco","strk"],FULL_BOXES:["hmhd","nmhd","iods","xml ","bxml","ipro","mere"],CONTAINER_BOXES:[["moov",["trak","pssh"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl",["sgpd","sbgp"]],["mvex",["trex"]],["moof",["traf"]],["traf",["trun","sgpd","sbgp"]],["vttc"],["tref"],["iref"],["mfra",["tfra"]],["meco"],["hnti"],["hinf"],["strk"],["strd"],["sinf"],["rinf"],["schi"],["trgr"],["udta",["kind"]],["iprp",["ipma"]],["ipco"]],boxCodes:[],fullBoxCodes:[],containerBoxCodes:[],sampleEntryCodes:{},sampleGroupEntryCodes:[],trackGroupTypes:[],UUIDBoxes:{},UUIDs:[],initialize:function(){a.FullBox.prototype=new a.Box,a.ContainerBox.prototype=new a.Box,a.SampleEntry.prototype=new a.Box,a.TrackGroupTypeBox.prototype=new a.FullBox,a.BASIC_BOXES.forEach(function(o){a.createBoxCtor(o)}),a.FULL_BOXES.forEach(function(o){a.createFullBoxCtor(o)}),a.CONTAINER_BOXES.forEach(function(o){a.createContainerBoxCtor(o[0],null,o[1])})},Box:function(o,c,d){this.type=o,this.size=c,this.uuid=d},FullBox:function(o,c,d){a.Box.call(this,o,c,d),this.flags=0,this.version=0},ContainerBox:function(o,c,d){a.Box.call(this,o,c,d),this.boxes=[]},SampleEntry:function(o,c,d,h){a.ContainerBox.call(this,o,c),this.hdr_size=d,this.start=h},SampleGroupEntry:function(o){this.grouping_type=o},TrackGroupTypeBox:function(o,c){a.FullBox.call(this,o,c)},createBoxCtor:function(o,c){a.boxCodes.push(o),a[o+"Box"]=function(d){a.Box.call(this,o,d)},a[o+"Box"].prototype=new a.Box,c&&(a[o+"Box"].prototype.parse=c)},createFullBoxCtor:function(o,c){a[o+"Box"]=function(d){a.FullBox.call(this,o,d)},a[o+"Box"].prototype=new a.FullBox,a[o+"Box"].prototype.parse=function(d){this.parseFullHeader(d),c&&c.call(this,d)}},addSubBoxArrays:function(o){if(o){this.subBoxNames=o;for(var c=o.length,d=0;d<c;d++)this[o[d]+"s"]=[]}},createContainerBoxCtor:function(o,c,d){a[o+"Box"]=function(h){a.ContainerBox.call(this,o,h),a.addSubBoxArrays.call(this,d)},a[o+"Box"].prototype=new a.ContainerBox,c&&(a[o+"Box"].prototype.parse=c)},createMediaSampleEntryCtor:function(o,c,d){a.sampleEntryCodes[o]=[],a[o+"SampleEntry"]=function(h,g){a.SampleEntry.call(this,h,g),a.addSubBoxArrays.call(this,d)},a[o+"SampleEntry"].prototype=new a.SampleEntry,c&&(a[o+"SampleEntry"].prototype.parse=c)},createSampleEntryCtor:function(o,c,d,h){a.sampleEntryCodes[o].push(c),a[c+"SampleEntry"]=function(g){a[o+"SampleEntry"].call(this,c,g),a.addSubBoxArrays.call(this,h)},a[c+"SampleEntry"].prototype=new a[o+"SampleEntry"],d&&(a[c+"SampleEntry"].prototype.parse=d)},createEncryptedSampleEntryCtor:function(o,c,d){a.createSampleEntryCtor.call(this,o,c,d,["sinf"])},createSampleGroupCtor:function(o,c){a[o+"SampleGroupEntry"]=function(d){a.SampleGroupEntry.call(this,o,d)},a[o+"SampleGroupEntry"].prototype=new a.SampleGroupEntry,c&&(a[o+"SampleGroupEntry"].prototype.parse=c)},createTrackGroupCtor:function(o,c){a[o+"TrackGroupTypeBox"]=function(d){a.TrackGroupTypeBox.call(this,o,d)},a[o+"TrackGroupTypeBox"].prototype=new a.TrackGroupTypeBox,c&&(a[o+"TrackGroupTypeBox"].prototype.parse=c)},createUUIDBox:function(o,c,d,h){a.UUIDs.push(o),a.UUIDBoxes[o]=function(g){c?a.FullBox.call(this,"uuid",g,o):d?a.ContainerBox.call(this,"uuid",g,o):a.Box.call(this,"uuid",g,o)},a.UUIDBoxes[o].prototype=c?new a.FullBox:d?new a.ContainerBox:new a.Box,h&&(c?a.UUIDBoxes[o].prototype.parse=function(g){this.parseFullHeader(g),h&&h.call(this,g)}:a.UUIDBoxes[o].prototype.parse=h)}};a.initialize(),a.TKHD_FLAG_ENABLED=1,a.TKHD_FLAG_IN_MOVIE=2,a.TKHD_FLAG_IN_PREVIEW=4,a.TFHD_FLAG_BASE_DATA_OFFSET=1,a.TFHD_FLAG_SAMPLE_DESC=2,a.TFHD_FLAG_SAMPLE_DUR=8,a.TFHD_FLAG_SAMPLE_SIZE=16,a.TFHD_FLAG_SAMPLE_FLAGS=32,a.TFHD_FLAG_DUR_EMPTY=65536,a.TFHD_FLAG_DEFAULT_BASE_IS_MOOF=131072,a.TRUN_FLAGS_DATA_OFFSET=1,a.TRUN_FLAGS_FIRST_FLAG=4,a.TRUN_FLAGS_DURATION=256,a.TRUN_FLAGS_SIZE=512,a.TRUN_FLAGS_FLAGS=1024,a.TRUN_FLAGS_CTS_OFFSET=2048,a.Box.prototype.add=function(o){return this.addBox(new a[o+"Box"])},a.Box.prototype.addBox=function(o){return this.boxes.push(o),this[o.type+"s"]?this[o.type+"s"].push(o):this[o.type]=o,o},a.Box.prototype.set=function(o,c){return this[o]=c,this},a.Box.prototype.addEntry=function(o,c){var d=c||"entries";return this[d]||(this[d]=[]),this[d].push(o),this},t.BoxParser=a,a.parseUUID=function(o){return a.parseHex16(o)},a.parseHex16=function(o){for(var c="",d=0;d<16;d++){var h=o.readUint8().toString(16);c+=h.length===1?"0"+h:h}return c},a.parseOneBox=function(o,c,d){var h,g=o.getPosition(),y=0,v,_;if(o.getEndPosition()-g<8)return e.debug("BoxParser","Not enough data in stream to parse the type and size of the box"),{code:a.ERR_NOT_ENOUGH_DATA};if(d&&d<8)return e.debug("BoxParser","Not enough bytes left in the parent box to parse a new box"),{code:a.ERR_NOT_ENOUGH_DATA};var b=o.readUint32(),x=o.readString(4),w=x;if(e.debug("BoxParser","Found box of type '"+x+"' and size "+b+" at position "+g),y=8,x=="uuid"){if(o.getEndPosition()-o.getPosition()<16||d-y<16)return o.seek(g),e.debug("BoxParser","Not enough bytes left in the parent box to parse a UUID box"),{code:a.ERR_NOT_ENOUGH_DATA};_=a.parseUUID(o),y+=16,w=_}if(b==1){if(o.getEndPosition()-o.getPosition()<8||d&&d-y<8)return o.seek(g),e.warn("BoxParser",'Not enough data in stream to parse the extended size of the "'+x+'" box'),{code:a.ERR_NOT_ENOUGH_DATA};b=o.readUint64(),y+=8}else if(b===0){if(d)b=d;else if(x!=="mdat")return e.error("BoxParser","Unlimited box size not supported for type: '"+x+"'"),h=new a.Box(x,b),{code:a.OK,box:h,size:h.size}}return b!==0&&b<y?(e.error("BoxParser","Box of type "+x+" has an invalid size "+b+" (too small to be a box)"),{code:a.ERR_NOT_ENOUGH_DATA,type:x,size:b,hdr_size:y,start:g}):b!==0&&d&&b>d?(e.error("BoxParser","Box of type '"+x+"' has a size "+b+" greater than its container size "+d),{code:a.ERR_NOT_ENOUGH_DATA,type:x,size:b,hdr_size:y,start:g}):b!==0&&g+b>o.getEndPosition()?(o.seek(g),e.info("BoxParser","Not enough data in stream to parse the entire '"+x+"' box"),{code:a.ERR_NOT_ENOUGH_DATA,type:x,size:b,hdr_size:y,start:g}):c?{code:a.OK,type:x,size:b,hdr_size:y,start:g}:(a[x+"Box"]?h=new a[x+"Box"](b):x!=="uuid"?(e.warn("BoxParser","Unknown box type: '"+x+"'"),h=new a.Box(x,b),h.has_unparsed_data=!0):a.UUIDBoxes[_]?h=new a.UUIDBoxes[_](b):(e.warn("BoxParser","Unknown uuid type: '"+_+"'"),h=new a.Box(x,b),h.uuid=_,h.has_unparsed_data=!0),h.hdr_size=y,h.start=g,h.write===a.Box.prototype.write&&h.type!=="mdat"&&(e.info("BoxParser","'"+w+"' box writing not yet implemented, keeping unparsed data in memory for later write"),h.parseDataAndRewind(o)),h.parse(o),v=o.getPosition()-(h.start+h.size),v<0?(e.warn("BoxParser","Parsing of box '"+w+"' did not read the entire indicated box data size (missing "+-v+" bytes), seeking forward"),o.seek(h.start+h.size)):v>0&&(e.error("BoxParser","Parsing of box '"+w+"' read "+v+" more bytes than the indicated box data size, seeking backwards"),h.size!==0&&o.seek(h.start+h.size)),{code:a.OK,box:h,size:h.size})},a.Box.prototype.parse=function(o){this.type!="mdat"?this.data=o.readUint8Array(this.size-this.hdr_size):this.size===0?o.seek(o.getEndPosition()):o.seek(this.start+this.size)},a.Box.prototype.parseDataAndRewind=function(o){this.data=o.readUint8Array(this.size-this.hdr_size),o.position-=this.size-this.hdr_size},a.FullBox.prototype.parseDataAndRewind=function(o){this.parseFullHeader(o),this.data=o.readUint8Array(this.size-this.hdr_size),this.hdr_size-=4,o.position-=this.size-this.hdr_size},a.FullBox.prototype.parseFullHeader=function(o){this.version=o.readUint8(),this.flags=o.readUint24(),this.hdr_size+=4},a.FullBox.prototype.parse=function(o){this.parseFullHeader(o),this.data=o.readUint8Array(this.size-this.hdr_size)},a.ContainerBox.prototype.parse=function(o){for(var c,d;o.getPosition()<this.start+this.size;)if(c=a.parseOneBox(o,!1,this.size-(o.getPosition()-this.start)),c.code===a.OK)if(d=c.box,this.boxes.push(d),this.subBoxNames&&this.subBoxNames.indexOf(d.type)!=-1)this[this.subBoxNames[this.subBoxNames.indexOf(d.type)]+"s"].push(d);else{var h=d.type!=="uuid"?d.type:d.uuid;this[h]?e.warn("Box of type "+h+" already stored in field of this type"):this[h]=d}else return},a.Box.prototype.parseLanguage=function(o){this.language=o.readUint16();var c=[];c[0]=this.language>>10&31,c[1]=this.language>>5&31,c[2]=this.language&31,this.languageString=String.fromCharCode(c[0]+96,c[1]+96,c[2]+96)},a.SAMPLE_ENTRY_TYPE_VISUAL="Visual",a.SAMPLE_ENTRY_TYPE_AUDIO="Audio",a.SAMPLE_ENTRY_TYPE_HINT="Hint",a.SAMPLE_ENTRY_TYPE_METADATA="Metadata",a.SAMPLE_ENTRY_TYPE_SUBTITLE="Subtitle",a.SAMPLE_ENTRY_TYPE_SYSTEM="System",a.SAMPLE_ENTRY_TYPE_TEXT="Text",a.SampleEntry.prototype.parseHeader=function(o){o.readUint8Array(6),this.data_reference_index=o.readUint16(),this.hdr_size+=8},a.SampleEntry.prototype.parse=function(o){this.parseHeader(o),this.data=o.readUint8Array(this.size-this.hdr_size)},a.SampleEntry.prototype.parseDataAndRewind=function(o){this.parseHeader(o),this.data=o.readUint8Array(this.size-this.hdr_size),this.hdr_size-=8,o.position-=this.size-this.hdr_size},a.SampleEntry.prototype.parseFooter=function(o){a.ContainerBox.prototype.parse.call(this,o)},a.createMediaSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_HINT),a.createMediaSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_METADATA),a.createMediaSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_SUBTITLE),a.createMediaSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_SYSTEM),a.createMediaSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_TEXT),a.createMediaSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,function(o){var c;this.parseHeader(o),o.readUint16(),o.readUint16(),o.readUint32Array(3),this.width=o.readUint16(),this.height=o.readUint16(),this.horizresolution=o.readUint32(),this.vertresolution=o.readUint32(),o.readUint32(),this.frame_count=o.readUint16(),c=Math.min(31,o.readUint8()),this.compressorname=o.readString(c),c<31&&o.readString(31-c),this.depth=o.readUint16(),o.readUint16(),this.parseFooter(o)}),a.createMediaSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_AUDIO,function(o){this.parseHeader(o),o.readUint32Array(2),this.channel_count=o.readUint16(),this.samplesize=o.readUint16(),o.readUint16(),o.readUint16(),this.samplerate=o.readUint32()/65536,this.parseFooter(o)}),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,"avc1"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,"avc2"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,"avc3"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,"avc4"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,"av01"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,"hvc1"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,"hev1"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,"vvc1"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,"vvi1"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,"vvs1"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,"vvcN"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,"vp08"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,"vp09"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_AUDIO,"mp4a"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_AUDIO,"ac-3"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_AUDIO,"ec-3"),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_AUDIO,"Opus"),a.createEncryptedSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_VISUAL,"encv"),a.createEncryptedSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_AUDIO,"enca"),a.createEncryptedSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_SUBTITLE,"encu"),a.createEncryptedSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_SYSTEM,"encs"),a.createEncryptedSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_TEXT,"enct"),a.createEncryptedSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_METADATA,"encm"),a.createBoxCtor("a1lx",function(o){var c=o.readUint8()&1,d=((c&1)+1)*16;this.layer_size=[];for(var h=0;h<3;h++)d==16?this.layer_size[h]=o.readUint16():this.layer_size[h]=o.readUint32()}),a.createBoxCtor("a1op",function(o){this.op_index=o.readUint8()}),a.createFullBoxCtor("auxC",function(o){this.aux_type=o.readCString();var c=this.size-this.hdr_size-(this.aux_type.length+1);this.aux_subtype=o.readUint8Array(c)}),a.createBoxCtor("av1C",function(o){var c=o.readUint8();if(c>>7&!1){e.error("av1C marker problem");return}if(this.version=c&127,this.version!==1){e.error("av1C version "+this.version+" not supported");return}if(c=o.readUint8(),this.seq_profile=c>>5&7,this.seq_level_idx_0=c&31,c=o.readUint8(),this.seq_tier_0=c>>7&1,this.high_bitdepth=c>>6&1,this.twelve_bit=c>>5&1,this.monochrome=c>>4&1,this.chroma_subsampling_x=c>>3&1,this.chroma_subsampling_y=c>>2&1,this.chroma_sample_position=c&3,c=o.readUint8(),this.reserved_1=c>>5&7,this.reserved_1!==0){e.error("av1C reserved_1 parsing problem");return}if(this.initial_presentation_delay_present=c>>4&1,this.initial_presentation_delay_present===1)this.initial_presentation_delay_minus_one=c&15;else if(this.reserved_2=c&15,this.reserved_2!==0){e.error("av1C reserved_2 parsing problem");return}var d=this.size-this.hdr_size-4;this.configOBUs=o.readUint8Array(d)}),a.createBoxCtor("avcC",function(o){var c,d;for(this.configurationVersion=o.readUint8(),this.AVCProfileIndication=o.readUint8(),this.profile_compatibility=o.readUint8(),this.AVCLevelIndication=o.readUint8(),this.lengthSizeMinusOne=o.readUint8()&3,this.nb_SPS_nalus=o.readUint8()&31,d=this.size-this.hdr_size-6,this.SPS=[],c=0;c<this.nb_SPS_nalus;c++)this.SPS[c]={},this.SPS[c].length=o.readUint16(),this.SPS[c].nalu=o.readUint8Array(this.SPS[c].length),d-=2+this.SPS[c].length;for(this.nb_PPS_nalus=o.readUint8(),d--,this.PPS=[],c=0;c<this.nb_PPS_nalus;c++)this.PPS[c]={},this.PPS[c].length=o.readUint16(),this.PPS[c].nalu=o.readUint8Array(this.PPS[c].length),d-=2+this.PPS[c].length;d>0&&(this.ext=o.readUint8Array(d))}),a.createBoxCtor("btrt",function(o){this.bufferSizeDB=o.readUint32(),this.maxBitrate=o.readUint32(),this.avgBitrate=o.readUint32()}),a.createBoxCtor("clap",function(o){this.cleanApertureWidthN=o.readUint32(),this.cleanApertureWidthD=o.readUint32(),this.cleanApertureHeightN=o.readUint32(),this.cleanApertureHeightD=o.readUint32(),this.horizOffN=o.readUint32(),this.horizOffD=o.readUint32(),this.vertOffN=o.readUint32(),this.vertOffD=o.readUint32()}),a.createBoxCtor("clli",function(o){this.max_content_light_level=o.readUint16(),this.max_pic_average_light_level=o.readUint16()}),a.createFullBoxCtor("co64",function(o){var c,d;if(c=o.readUint32(),this.chunk_offsets=[],this.version===0)for(d=0;d<c;d++)this.chunk_offsets.push(o.readUint64())}),a.createFullBoxCtor("CoLL",function(o){this.maxCLL=o.readUint16(),this.maxFALL=o.readUint16()}),a.createBoxCtor("colr",function(o){if(this.colour_type=o.readString(4),this.colour_type==="nclx"){this.colour_primaries=o.readUint16(),this.transfer_characteristics=o.readUint16(),this.matrix_coefficients=o.readUint16();var c=o.readUint8();this.full_range_flag=c>>7}else this.colour_type==="rICC"?this.ICC_profile=o.readUint8Array(this.size-4):this.colour_type==="prof"&&(this.ICC_profile=o.readUint8Array(this.size-4))}),a.createFullBoxCtor("cprt",function(o){this.parseLanguage(o),this.notice=o.readCString()}),a.createFullBoxCtor("cslg",function(o){this.version===0&&(this.compositionToDTSShift=o.readInt32(),this.leastDecodeToDisplayDelta=o.readInt32(),this.greatestDecodeToDisplayDelta=o.readInt32(),this.compositionStartTime=o.readInt32(),this.compositionEndTime=o.readInt32())}),a.createFullBoxCtor("ctts",function(o){var c,d;if(c=o.readUint32(),this.sample_counts=[],this.sample_offsets=[],this.version===0)for(d=0;d<c;d++){this.sample_counts.push(o.readUint32());var h=o.readInt32();h<0&&e.warn("BoxParser","ctts box uses negative values without using version 1"),this.sample_offsets.push(h)}else if(this.version==1)for(d=0;d<c;d++)this.sample_counts.push(o.readUint32()),this.sample_offsets.push(o.readInt32())}),a.createBoxCtor("dac3",function(o){var c=o.readUint8(),d=o.readUint8(),h=o.readUint8();this.fscod=c>>6,this.bsid=c>>1&31,this.bsmod=(c&1)<<2|d>>6&3,this.acmod=d>>3&7,this.lfeon=d>>2&1,this.bit_rate_code=d&3|h>>5&7}),a.createBoxCtor("dec3",function(o){var c=o.readUint16();this.data_rate=c>>3,this.num_ind_sub=c&7,this.ind_subs=[];for(var d=0;d<this.num_ind_sub+1;d++){var h={};this.ind_subs.push(h);var g=o.readUint8(),y=o.readUint8(),v=o.readUint8();h.fscod=g>>6,h.bsid=g>>1&31,h.bsmod=(g&1)<<4|y>>4&15,h.acmod=y>>1&7,h.lfeon=y&1,h.num_dep_sub=v>>1&15,h.num_dep_sub>0&&(h.chan_loc=(v&1)<<8|o.readUint8())}}),a.createFullBoxCtor("dfLa",function(o){var c=127,d=128,h=[],g=["STREAMINFO","PADDING","APPLICATION","SEEKTABLE","VORBIS_COMMENT","CUESHEET","PICTURE","RESERVED"];this.parseFullHeader(o);do{var y=o.readUint8(),v=Math.min(y&c,g.length-1);if(v?o.readUint8Array(o.readUint24()):(o.readUint8Array(13),this.samplerate=o.readUint32()>>12,o.readUint8Array(20)),h.push(g[v]),y&d)break}while(!0);this.numMetadataBlocks=h.length+" ("+h.join(", ")+")"}),a.createBoxCtor("dimm",function(o){this.bytessent=o.readUint64()}),a.createBoxCtor("dmax",function(o){this.time=o.readUint32()}),a.createBoxCtor("dmed",function(o){this.bytessent=o.readUint64()}),a.createBoxCtor("dOps",function(o){if(this.Version=o.readUint8(),this.OutputChannelCount=o.readUint8(),this.PreSkip=o.readUint16(),this.InputSampleRate=o.readUint32(),this.OutputGain=o.readInt16(),this.ChannelMappingFamily=o.readUint8(),this.ChannelMappingFamily!==0){this.StreamCount=o.readUint8(),this.CoupledCount=o.readUint8(),this.ChannelMapping=[];for(var c=0;c<this.OutputChannelCount;c++)this.ChannelMapping[c]=o.readUint8()}}),a.createFullBoxCtor("dref",function(o){var c,d;this.entries=[];for(var h=o.readUint32(),g=0;g<h;g++)if(c=a.parseOneBox(o,!1,this.size-(o.getPosition()-this.start)),c.code===a.OK)d=c.box,this.entries.push(d);else return}),a.createBoxCtor("drep",function(o){this.bytessent=o.readUint64()}),a.createFullBoxCtor("elng",function(o){this.extended_language=o.readString(this.size-this.hdr_size)}),a.createFullBoxCtor("elst",function(o){this.entries=[];for(var c=o.readUint32(),d=0;d<c;d++){var h={};this.entries.push(h),this.version===1?(h.segment_duration=o.readUint64(),h.media_time=o.readInt64()):(h.segment_duration=o.readUint32(),h.media_time=o.readInt32()),h.media_rate_integer=o.readInt16(),h.media_rate_fraction=o.readInt16()}}),a.createFullBoxCtor("emsg",function(o){this.version==1?(this.timescale=o.readUint32(),this.presentation_time=o.readUint64(),this.event_duration=o.readUint32(),this.id=o.readUint32(),this.scheme_id_uri=o.readCString(),this.value=o.readCString()):(this.scheme_id_uri=o.readCString(),this.value=o.readCString(),this.timescale=o.readUint32(),this.presentation_time_delta=o.readUint32(),this.event_duration=o.readUint32(),this.id=o.readUint32());var c=this.size-this.hdr_size-(4*4+(this.scheme_id_uri.length+1)+(this.value.length+1));this.version==1&&(c-=4),this.message_data=o.readUint8Array(c)}),a.createFullBoxCtor("esds",function(o){var c=o.readUint8Array(this.size-this.hdr_size);if(typeof l<"u"){var d=new l;this.esd=d.parseOneDescriptor(new i(c.buffer,0,i.BIG_ENDIAN))}}),a.createBoxCtor("fiel",function(o){this.fieldCount=o.readUint8(),this.fieldOrdering=o.readUint8()}),a.createBoxCtor("frma",function(o){this.data_format=o.readString(4)}),a.createBoxCtor("ftyp",function(o){var c=this.size-this.hdr_size;this.major_brand=o.readString(4),this.minor_version=o.readUint32(),c-=8,this.compatible_brands=[];for(var d=0;c>=4;)this.compatible_brands[d]=o.readString(4),c-=4,d++}),a.createFullBoxCtor("hdlr",function(o){this.version===0&&(o.readUint32(),this.handler=o.readString(4),o.readUint32Array(3),this.name=o.readString(this.size-this.hdr_size-20),this.name[this.name.length-1]==="\x00"&&(this.name=this.name.slice(0,-1)))}),a.createBoxCtor("hvcC",function(o){var c,d,h,g;this.configurationVersion=o.readUint8(),g=o.readUint8(),this.general_profile_space=g>>6,this.general_tier_flag=(g&32)>>5,this.general_profile_idc=g&31,this.general_profile_compatibility=o.readUint32(),this.general_constraint_indicator=o.readUint8Array(6),this.general_level_idc=o.readUint8(),this.min_spatial_segmentation_idc=o.readUint16()&4095,this.parallelismType=o.readUint8()&3,this.chroma_format_idc=o.readUint8()&3,this.bit_depth_luma_minus8=o.readUint8()&7,this.bit_depth_chroma_minus8=o.readUint8()&7,this.avgFrameRate=o.readUint16(),g=o.readUint8(),this.constantFrameRate=g>>6,this.numTemporalLayers=(g&13)>>3,this.temporalIdNested=(g&4)>>2,this.lengthSizeMinusOne=g&3,this.nalu_arrays=[];var y=o.readUint8();for(c=0;c<y;c++){var v=[];this.nalu_arrays.push(v),g=o.readUint8(),v.completeness=(g&128)>>7,v.nalu_type=g&63;var _=o.readUint16();for(d=0;d<_;d++){var b={};v.push(b),h=o.readUint16(),b.data=o.readUint8Array(h)}}}),a.createFullBoxCtor("iinf",function(o){var c;this.version===0?this.entry_count=o.readUint16():this.entry_count=o.readUint32(),this.item_infos=[];for(var d=0;d<this.entry_count;d++)if(c=a.parseOneBox(o,!1,this.size-(o.getPosition()-this.start)),c.code===a.OK)c.box.type!=="infe"&&e.error("BoxParser","Expected 'infe' box, got "+c.box.type),this.item_infos[d]=c.box;else return}),a.createFullBoxCtor("iloc",function(o){var c;c=o.readUint8(),this.offset_size=c>>4&15,this.length_size=c&15,c=o.readUint8(),this.base_offset_size=c>>4&15,this.version===1||this.version===2?this.index_size=c&15:this.index_size=0,this.items=[];var d=0;if(this.version<2)d=o.readUint16();else if(this.version===2)d=o.readUint32();else throw"version of iloc box not supported";for(var h=0;h<d;h++){var g={};if(this.items.push(g),this.version<2)g.item_ID=o.readUint16();else if(this.version===2)g.item_ID=o.readUint16();else throw"version of iloc box not supported";switch(this.version===1||this.version===2?g.construction_method=o.readUint16()&15:g.construction_method=0,g.data_reference_index=o.readUint16(),this.base_offset_size){case 0:g.base_offset=0;break;case 4:g.base_offset=o.readUint32();break;case 8:g.base_offset=o.readUint64();break;default:throw"Error reading base offset size"}var y=o.readUint16();g.extents=[];for(var v=0;v<y;v++){var _={};if(g.extents.push(_),this.version===1||this.version===2)switch(this.index_size){case 0:_.extent_index=0;break;case 4:_.extent_index=o.readUint32();break;case 8:_.extent_index=o.readUint64();break;default:throw"Error reading extent index"}switch(this.offset_size){case 0:_.extent_offset=0;break;case 4:_.extent_offset=o.readUint32();break;case 8:_.extent_offset=o.readUint64();break;default:throw"Error reading extent index"}switch(this.length_size){case 0:_.extent_length=0;break;case 4:_.extent_length=o.readUint32();break;case 8:_.extent_length=o.readUint64();break;default:throw"Error reading extent index"}}}}),a.createBoxCtor("imir",function(o){var c=o.readUint8();this.reserved=c>>7,this.axis=c&1}),a.createFullBoxCtor("infe",function(o){if((this.version===0||this.version===1)&&(this.item_ID=o.readUint16(),this.item_protection_index=o.readUint16(),this.item_name=o.readCString(),this.content_type=o.readCString(),this.content_encoding=o.readCString()),this.version===1){this.extension_type=o.readString(4),e.warn("BoxParser","Cannot parse extension type"),o.seek(this.start+this.size);return}this.version>=2&&(this.version===2?this.item_ID=o.readUint16():this.version===3&&(this.item_ID=o.readUint32()),this.item_protection_index=o.readUint16(),this.item_type=o.readString(4),this.item_name=o.readCString(),this.item_type==="mime"?(this.content_type=o.readCString(),this.content_encoding=o.readCString()):this.item_type==="uri "&&(this.item_uri_type=o.readCString()))}),a.createFullBoxCtor("ipma",function(o){var c,d;for(entry_count=o.readUint32(),this.associations=[],c=0;c<entry_count;c++){var h={};this.associations.push(h),this.version<1?h.id=o.readUint16():h.id=o.readUint32();var g=o.readUint8();for(h.props=[],d=0;d<g;d++){var y=o.readUint8(),v={};h.props.push(v),v.essential=(y&128)>>7===1,this.flags&1?v.property_index=(y&127)<<8|o.readUint8():v.property_index=y&127}}}),a.createFullBoxCtor("iref",function(o){var c,d;for(this.references=[];o.getPosition()<this.start+this.size;)if(c=a.parseOneBox(o,!0,this.size-(o.getPosition()-this.start)),c.code===a.OK)this.version===0?d=new a.SingleItemTypeReferenceBox(c.type,c.size,c.hdr_size,c.start):d=new a.SingleItemTypeReferenceBoxLarge(c.type,c.size,c.hdr_size,c.start),d.write===a.Box.prototype.write&&d.type!=="mdat"&&(e.warn("BoxParser",d.type+" box writing not yet implemented, keeping unparsed data in memory for later write"),d.parseDataAndRewind(o)),d.parse(o),this.references.push(d);else return}),a.createBoxCtor("irot",function(o){this.angle=o.readUint8()&3}),a.createFullBoxCtor("ispe",function(o){this.image_width=o.readUint32(),this.image_height=o.readUint32()}),a.createFullBoxCtor("kind",function(o){this.schemeURI=o.readCString(),this.value=o.readCString()}),a.createFullBoxCtor("leva",function(o){var c=o.readUint8();this.levels=[];for(var d=0;d<c;d++){var h={};this.levels[d]=h,h.track_ID=o.readUint32();var g=o.readUint8();switch(h.padding_flag=g>>7,h.assignment_type=g&127,h.assignment_type){case 0:h.grouping_type=o.readString(4);break;case 1:h.grouping_type=o.readString(4),h.grouping_type_parameter=o.readUint32();break;case 2:break;case 3:break;case 4:h.sub_track_id=o.readUint32();break;default:e.warn("BoxParser","Unknown leva assignement type")}}}),a.createBoxCtor("lsel",function(o){this.layer_id=o.readUint16()}),a.createBoxCtor("maxr",function(o){this.period=o.readUint32(),this.bytes=o.readUint32()}),a.createBoxCtor("mdcv",function(o){this.display_primaries=[],this.display_primaries[0]={},this.display_primaries[0].x=o.readUint16(),this.display_primaries[0].y=o.readUint16(),this.display_primaries[1]={},this.display_primaries[1].x=o.readUint16(),this.display_primaries[1].y=o.readUint16(),this.display_primaries[2]={},this.display_primaries[2].x=o.readUint16(),this.display_primaries[2].y=o.readUint16(),this.white_point={},this.white_point.x=o.readUint16(),this.white_point.y=o.readUint16(),this.max_display_mastering_luminance=o.readUint32(),this.min_display_mastering_luminance=o.readUint32()}),a.createFullBoxCtor("mdhd",function(o){this.version==1?(this.creation_time=o.readUint64(),this.modification_time=o.readUint64(),this.timescale=o.readUint32(),this.duration=o.readUint64()):(this.creation_time=o.readUint32(),this.modification_time=o.readUint32(),this.timescale=o.readUint32(),this.duration=o.readUint32()),this.parseLanguage(o),o.readUint16()}),a.createFullBoxCtor("mehd",function(o){this.flags&1&&(e.warn("BoxParser","mehd box incorrectly uses flags set to 1, converting version to 1"),this.version=1),this.version==1?this.fragment_duration=o.readUint64():this.fragment_duration=o.readUint32()}),a.createFullBoxCtor("meta",function(o){this.boxes=[],a.ContainerBox.prototype.parse.call(this,o)}),a.createFullBoxCtor("mfhd",function(o){this.sequence_number=o.readUint32()}),a.createFullBoxCtor("mfro",function(o){this._size=o.readUint32()}),a.createFullBoxCtor("mvhd",function(o){this.version==1?(this.creation_time=o.readUint64(),this.modification_time=o.readUint64(),this.timescale=o.readUint32(),this.duration=o.readUint64()):(this.creation_time=o.readUint32(),this.modification_time=o.readUint32(),this.timescale=o.readUint32(),this.duration=o.readUint32()),this.rate=o.readUint32(),this.volume=o.readUint16()>>8,o.readUint16(),o.readUint32Array(2),this.matrix=o.readUint32Array(9),o.readUint32Array(6),this.next_track_id=o.readUint32()}),a.createBoxCtor("npck",function(o){this.packetssent=o.readUint32()}),a.createBoxCtor("nump",function(o){this.packetssent=o.readUint64()}),a.createFullBoxCtor("padb",function(o){var c=o.readUint32();this.padbits=[];for(var d=0;d<Math.floor((c+1)/2);d++)this.padbits=o.readUint8()}),a.createBoxCtor("pasp",function(o){this.hSpacing=o.readUint32(),this.vSpacing=o.readUint32()}),a.createBoxCtor("payl",function(o){this.text=o.readString(this.size-this.hdr_size)}),a.createBoxCtor("payt",function(o){this.payloadID=o.readUint32();var c=o.readUint8();this.rtpmap_string=o.readString(c)}),a.createFullBoxCtor("pdin",function(o){var c=(this.size-this.hdr_size)/8;this.rate=[],this.initial_delay=[];for(var d=0;d<c;d++)this.rate[d]=o.readUint32(),this.initial_delay[d]=o.readUint32()}),a.createFullBoxCtor("pitm",function(o){this.version===0?this.item_id=o.readUint16():this.item_id=o.readUint32()}),a.createFullBoxCtor("pixi",function(o){var c;for(this.num_channels=o.readUint8(),this.bits_per_channels=[],c=0;c<this.num_channels;c++)this.bits_per_channels[c]=o.readUint8()}),a.createBoxCtor("pmax",function(o){this.bytes=o.readUint32()}),a.createFullBoxCtor("prft",function(o){this.ref_track_id=o.readUint32(),this.ntp_timestamp=o.readUint64(),this.version===0?this.media_time=o.readUint32():this.media_time=o.readUint64()}),a.createFullBoxCtor("pssh",function(o){if(this.system_id=a.parseHex16(o),this.version>0){var c=o.readUint32();this.kid=[];for(var d=0;d<c;d++)this.kid[d]=a.parseHex16(o)}var h=o.readUint32();h>0&&(this.data=o.readUint8Array(h))}),a.createFullBoxCtor("clef",function(o){this.width=o.readUint32(),this.height=o.readUint32()}),a.createFullBoxCtor("enof",function(o){this.width=o.readUint32(),this.height=o.readUint32()}),a.createFullBoxCtor("prof",function(o){this.width=o.readUint32(),this.height=o.readUint32()}),a.createContainerBoxCtor("tapt",null,["clef","prof","enof"]),a.createBoxCtor("rtp ",function(o){this.descriptionformat=o.readString(4),this.sdptext=o.readString(this.size-this.hdr_size-4)}),a.createFullBoxCtor("saio",function(o){this.flags&1&&(this.aux_info_type=o.readUint32(),this.aux_info_type_parameter=o.readUint32());var c=o.readUint32();this.offset=[];for(var d=0;d<c;d++)this.version===0?this.offset[d]=o.readUint32():this.offset[d]=o.readUint64()}),a.createFullBoxCtor("saiz",function(o){this.flags&1&&(this.aux_info_type=o.readUint32(),this.aux_info_type_parameter=o.readUint32()),this.default_sample_info_size=o.readUint8();var c=o.readUint32();if(this.sample_info_size=[],this.default_sample_info_size===0)for(var d=0;d<c;d++)this.sample_info_size[d]=o.readUint8()}),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_METADATA,"mett",function(o){this.parseHeader(o),this.content_encoding=o.readCString(),this.mime_format=o.readCString(),this.parseFooter(o)}),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_METADATA,"metx",function(o){this.parseHeader(o),this.content_encoding=o.readCString(),this.namespace=o.readCString(),this.schema_location=o.readCString(),this.parseFooter(o)}),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_SUBTITLE,"sbtt",function(o){this.parseHeader(o),this.content_encoding=o.readCString(),this.mime_format=o.readCString(),this.parseFooter(o)}),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_SUBTITLE,"stpp",function(o){this.parseHeader(o),this.namespace=o.readCString(),this.schema_location=o.readCString(),this.auxiliary_mime_types=o.readCString(),this.parseFooter(o)}),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_SUBTITLE,"stxt",function(o){this.parseHeader(o),this.content_encoding=o.readCString(),this.mime_format=o.readCString(),this.parseFooter(o)}),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_SUBTITLE,"tx3g",function(o){this.parseHeader(o),this.displayFlags=o.readUint32(),this.horizontal_justification=o.readInt8(),this.vertical_justification=o.readInt8(),this.bg_color_rgba=o.readUint8Array(4),this.box_record=o.readInt16Array(4),this.style_record=o.readUint8Array(12),this.parseFooter(o)}),a.createSampleEntryCtor(a.SAMPLE_ENTRY_TYPE_METADATA,"wvtt",function(o){this.parseHeader(o),this.parseFooter(o)}),a.createSampleGroupCtor("alst",function(o){var c,d=o.readUint16();for(this.first_output_sample=o.readUint16(),this.sample_offset=[],c=0;c<d;c++)this.sample_offset[c]=o.readUint32();var h=this.description_length-4-4*d;for(this.num_output_samples=[],this.num_total_samples=[],c=0;c<h/4;c++)this.num_output_samples[c]=o.readUint16(),this.num_total_samples[c]=o.readUint16()}),a.createSampleGroupCtor("avll",function(o){this.layerNumber=o.readUint8(),this.accurateStatisticsFlag=o.readUint8(),this.avgBitRate=o.readUint16(),this.avgFrameRate=o.readUint16()}),a.createSampleGroupCtor("avss",function(o){this.subSequenceIdentifier=o.readUint16(),this.layerNumber=o.readUint8();var c=o.readUint8();this.durationFlag=c>>7,this.avgRateFlag=c>>6&1,this.durationFlag&&(this.duration=o.readUint32()),this.avgRateFlag&&(this.accurateStatisticsFlag=o.readUint8(),this.avgBitRate=o.readUint16(),this.avgFrameRate=o.readUint16()),this.dependency=[];for(var d=o.readUint8(),h=0;h<d;h++){var g={};this.dependency.push(g),g.subSeqDirectionFlag=o.readUint8(),g.layerNumber=o.readUint8(),g.subSequenceIdentifier=o.readUint16()}}),a.createSampleGroupCtor("dtrt",function(o){e.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),a.createSampleGroupCtor("mvif",function(o){e.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),a.createSampleGroupCtor("prol",function(o){this.roll_distance=o.readInt16()}),a.createSampleGroupCtor("rap ",function(o){var c=o.readUint8();this.num_leading_samples_known=c>>7,this.num_leading_samples=c&127}),a.createSampleGroupCtor("rash",function(o){if(this.operation_point_count=o.readUint16(),this.description_length!==2+(this.operation_point_count===1?2:this.operation_point_count*6)+9)e.warn("BoxParser","Mismatch in "+this.grouping_type+" sample group length"),this.data=o.readUint8Array(this.description_length-2);else{if(this.operation_point_count===1)this.target_rate_share=o.readUint16();else{this.target_rate_share=[],this.available_bitrate=[];for(var c=0;c<this.operation_point_count;c++)this.available_bitrate[c]=o.readUint32(),this.target_rate_share[c]=o.readUint16()}this.maximum_bitrate=o.readUint32(),this.minimum_bitrate=o.readUint32(),this.discard_priority=o.readUint8()}}),a.createSampleGroupCtor("roll",function(o){this.roll_distance=o.readInt16()}),a.SampleGroupEntry.prototype.parse=function(o){e.warn("BoxParser","Unknown Sample Group type: "+this.grouping_type),this.data=o.readUint8Array(this.description_length)},a.createSampleGroupCtor("scif",function(o){e.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),a.createSampleGroupCtor("scnm",function(o){e.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),a.createSampleGroupCtor("seig",function(o){this.reserved=o.readUint8();var c=o.readUint8();this.crypt_byte_block=c>>4,this.skip_byte_block=c&15,this.isProtected=o.readUint8(),this.Per_Sample_IV_Size=o.readUint8(),this.KID=a.parseHex16(o),this.constant_IV_size=0,this.constant_IV=0,this.isProtected===1&&this.Per_Sample_IV_Size===0&&(this.constant_IV_size=o.readUint8(),this.constant_IV=o.readUint8Array(this.constant_IV_size))}),a.createSampleGroupCtor("stsa",function(o){e.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),a.createSampleGroupCtor("sync",function(o){var c=o.readUint8();this.NAL_unit_type=c&63}),a.createSampleGroupCtor("tele",function(o){var c=o.readUint8();this.level_independently_decodable=c>>7}),a.createSampleGroupCtor("tsas",function(o){e.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),a.createSampleGroupCtor("tscl",function(o){e.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),a.createSampleGroupCtor("vipr",function(o){e.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")}),a.createFullBoxCtor("sbgp",function(o){this.grouping_type=o.readString(4),this.version===1?this.grouping_type_parameter=o.readUint32():this.grouping_type_parameter=0,this.entries=[];for(var c=o.readUint32(),d=0;d<c;d++){var h={};this.entries.push(h),h.sample_count=o.readInt32(),h.group_description_index=o.readInt32()}}),a.createFullBoxCtor("schm",function(o){this.scheme_type=o.readString(4),this.scheme_version=o.readUint32(),this.flags&1&&(this.scheme_uri=o.readString(this.size-this.hdr_size-8))}),a.createBoxCtor("sdp ",function(o){this.sdptext=o.readString(this.size-this.hdr_size)}),a.createFullBoxCtor("sdtp",function(o){var c,d=this.size-this.hdr_size;this.is_leading=[],this.sample_depends_on=[],this.sample_is_depended_on=[],this.sample_has_redundancy=[];for(var h=0;h<d;h++)c=o.readUint8(),this.is_leading[h]=c>>6,this.sample_depends_on[h]=c>>4&3,this.sample_is_depended_on[h]=c>>2&3,this.sample_has_redundancy[h]=c&3}),a.createFullBoxCtor("senc"),a.createFullBoxCtor("sgpd",function(o){this.grouping_type=o.readString(4),e.debug("BoxParser","Found Sample Groups of type "+this.grouping_type),this.version===1?this.default_length=o.readUint32():this.default_length=0,this.version>=2&&(this.default_group_description_index=o.readUint32()),this.entries=[];for(var c=o.readUint32(),d=0;d<c;d++){var h;a[this.grouping_type+"SampleGroupEntry"]?h=new a[this.grouping_type+"SampleGroupEntry"](this.grouping_type):h=new a.SampleGroupEntry(this.grouping_type),this.entries.push(h),this.version===1?this.default_length===0?h.description_length=o.readUint32():h.description_length=this.default_length:h.description_length=this.default_length,h.write===a.SampleGroupEntry.prototype.write&&(e.info("BoxParser","SampleGroup for type "+this.grouping_type+" writing not yet implemented, keeping unparsed data in memory for later write"),h.data=o.readUint8Array(h.description_length),o.position-=h.description_length),h.parse(o)}}),a.createFullBoxCtor("sidx",function(o){this.reference_ID=o.readUint32(),this.timescale=o.readUint32(),this.version===0?(this.earliest_presentation_time=o.readUint32(),this.first_offset=o.readUint32()):(this.earliest_presentation_time=o.readUint64(),this.first_offset=o.readUint64()),o.readUint16(),this.references=[];for(var c=o.readUint16(),d=0;d<c;d++){var h={};this.references.push(h);var g=o.readUint32();h.reference_type=g>>31&1,h.referenced_size=g&2147483647,h.subsegment_duration=o.readUint32(),g=o.readUint32(),h.starts_with_SAP=g>>31&1,h.SAP_type=g>>28&7,h.SAP_delta_time=g&268435455}}),a.SingleItemTypeReferenceBox=function(o,c,d,h){a.Box.call(this,o,c),this.hdr_size=d,this.start=h},a.SingleItemTypeReferenceBox.prototype=new a.Box,a.SingleItemTypeReferenceBox.prototype.parse=function(o){this.from_item_ID=o.readUint16();var c=o.readUint16();this.references=[];for(var d=0;d<c;d++)this.references[d]=o.readUint16()},a.SingleItemTypeReferenceBoxLarge=function(o,c,d,h){a.Box.call(this,o,c),this.hdr_size=d,this.start=h},a.SingleItemTypeReferenceBoxLarge.prototype=new a.Box,a.SingleItemTypeReferenceBoxLarge.prototype.parse=function(o){this.from_item_ID=o.readUint32();var c=o.readUint16();this.references=[];for(var d=0;d<c;d++)this.references[d]=o.readUint32()},a.createFullBoxCtor("SmDm",function(o){this.primaryRChromaticity_x=o.readUint16(),this.primaryRChromaticity_y=o.readUint16(),this.primaryGChromaticity_x=o.readUint16(),this.primaryGChromaticity_y=o.readUint16(),this.primaryBChromaticity_x=o.readUint16(),this.primaryBChromaticity_y=o.readUint16(),this.whitePointChromaticity_x=o.readUint16(),this.whitePointChromaticity_y=o.readUint16(),this.luminanceMax=o.readUint32(),this.luminanceMin=o.readUint32()}),a.createFullBoxCtor("smhd",function(o){this.balance=o.readUint16(),o.readUint16()}),a.createFullBoxCtor("ssix",function(o){this.subsegments=[];for(var c=o.readUint32(),d=0;d<c;d++){var h={};this.subsegments.push(h),h.ranges=[];for(var g=o.readUint32(),y=0;y<g;y++){var v={};h.ranges.push(v),v.level=o.readUint8(),v.range_size=o.readUint24()}}}),a.createFullBoxCtor("stco",function(o){var c;if(c=o.readUint32(),this.chunk_offsets=[],this.version===0)for(var d=0;d<c;d++)this.chunk_offsets.push(o.readUint32())}),a.createFullBoxCtor("stdp",function(o){var c=(this.size-this.hdr_size)/2;this.priority=[];for(var d=0;d<c;d++)this.priority[d]=o.readUint16()}),a.createFullBoxCtor("sthd"),a.createFullBoxCtor("stri",function(o){this.switch_group=o.readUint16(),this.alternate_group=o.readUint16(),this.sub_track_id=o.readUint32();var c=(this.size-this.hdr_size-8)/4;this.attribute_list=[];for(var d=0;d<c;d++)this.attribute_list[d]=o.readUint32()}),a.createFullBoxCtor("stsc",function(o){var c,d;if(c=o.readUint32(),this.first_chunk=[],this.samples_per_chunk=[],this.sample_description_index=[],this.version===0)for(d=0;d<c;d++)this.first_chunk.push(o.readUint32()),this.samples_per_chunk.push(o.readUint32()),this.sample_description_index.push(o.readUint32())}),a.createFullBoxCtor("stsd",function(o){var c,d,h,g;for(this.entries=[],h=o.readUint32(),c=1;c<=h;c++)if(d=a.parseOneBox(o,!0,this.size-(o.getPosition()-this.start)),d.code===a.OK)a[d.type+"SampleEntry"]?(g=new a[d.type+"SampleEntry"](d.size),g.hdr_size=d.hdr_size,g.start=d.start):(e.warn("BoxParser","Unknown sample entry type: "+d.type),g=new a.SampleEntry(d.type,d.size,d.hdr_size,d.start)),g.write===a.SampleEntry.prototype.write&&(e.info("BoxParser","SampleEntry "+g.type+" box writing not yet implemented, keeping unparsed data in memory for later write"),g.parseDataAndRewind(o)),g.parse(o),this.entries.push(g);else return}),a.createFullBoxCtor("stsg",function(o){this.grouping_type=o.readUint32();var c=o.readUint16();this.group_description_index=[];for(var d=0;d<c;d++)this.group_description_index[d]=o.readUint32()}),a.createFullBoxCtor("stsh",function(o){var c,d;if(c=o.readUint32(),this.shadowed_sample_numbers=[],this.sync_sample_numbers=[],this.version===0)for(d=0;d<c;d++)this.shadowed_sample_numbers.push(o.readUint32()),this.sync_sample_numbers.push(o.readUint32())}),a.createFullBoxCtor("stss",function(o){var c,d;if(d=o.readUint32(),this.version===0)for(this.sample_numbers=[],c=0;c<d;c++)this.sample_numbers.push(o.readUint32())}),a.createFullBoxCtor("stsz",function(o){var c;if(this.sample_sizes=[],this.version===0)for(this.sample_size=o.readUint32(),this.sample_count=o.readUint32(),c=0;c<this.sample_count;c++)this.sample_size===0?this.sample_sizes.push(o.readUint32()):this.sample_sizes[c]=this.sample_size}),a.createFullBoxCtor("stts",function(o){var c,d,h;if(c=o.readUint32(),this.sample_counts=[],this.sample_deltas=[],this.version===0)for(d=0;d<c;d++)this.sample_counts.push(o.readUint32()),h=o.readInt32(),h<0&&(e.warn("BoxParser","File uses negative stts sample delta, using value 1 instead, sync may be lost!"),h=1),this.sample_deltas.push(h)}),a.createFullBoxCtor("stvi",function(o){var c=o.readUint32();this.single_view_allowed=c&3,this.stereo_scheme=o.readUint32();var d=o.readUint32();this.stereo_indication_type=o.readString(d);var h,g;for(this.boxes=[];o.getPosition()<this.start+this.size;)if(h=a.parseOneBox(o,!1,this.size-(o.getPosition()-this.start)),h.code===a.OK)g=h.box,this.boxes.push(g),this[g.type]=g;else return}),a.createBoxCtor("styp",function(o){a.ftypBox.prototype.parse.call(this,o)}),a.createFullBoxCtor("stz2",function(o){var c,d;if(this.sample_sizes=[],this.version===0)if(this.reserved=o.readUint24(),this.field_size=o.readUint8(),d=o.readUint32(),this.field_size===4)for(c=0;c<d;c+=2){var h=o.readUint8();this.sample_sizes[c]=h>>4&15,this.sample_sizes[c+1]=h&15}else if(this.field_size===8)for(c=0;c<d;c++)this.sample_sizes[c]=o.readUint8();else if(this.field_size===16)for(c=0;c<d;c++)this.sample_sizes[c]=o.readUint16();else e.error("BoxParser","Error in length field in stz2 box")}),a.createFullBoxCtor("subs",function(o){var c,d,h,g;for(h=o.readUint32(),this.entries=[],c=0;c<h;c++){var y={};if(this.entries[c]=y,y.sample_delta=o.readUint32(),y.subsamples=[],g=o.readUint16(),g>0)for(d=0;d<g;d++){var v={};y.subsamples.push(v),this.version==1?v.size=o.readUint32():v.size=o.readUint16(),v.priority=o.readUint8(),v.discardable=o.readUint8(),v.codec_specific_parameters=o.readUint32()}}}),a.createFullBoxCtor("tenc",function(o){if(o.readUint8(),this.version===0)o.readUint8();else{var c=o.readUint8();this.default_crypt_byte_block=c>>4&15,this.default_skip_byte_block=c&15}this.default_isProtected=o.readUint8(),this.default_Per_Sample_IV_Size=o.readUint8(),this.default_KID=a.parseHex16(o),this.default_isProtected===1&&this.default_Per_Sample_IV_Size===0&&(this.default_constant_IV_size=o.readUint8(),this.default_constant_IV=o.readUint8Array(this.default_constant_IV_size))}),a.createFullBoxCtor("tfdt",function(o){this.version==1?this.baseMediaDecodeTime=o.readUint64():this.baseMediaDecodeTime=o.readUint32()}),a.createFullBoxCtor("tfhd",function(o){var c=0;this.track_id=o.readUint32(),this.size-this.hdr_size>c&&this.flags&a.TFHD_FLAG_BASE_DATA_OFFSET?(this.base_data_offset=o.readUint64(),c+=8):this.base_data_offset=0,this.size-this.hdr_size>c&&this.flags&a.TFHD_FLAG_SAMPLE_DESC?(this.default_sample_description_index=o.readUint32(),c+=4):this.default_sample_description_index=0,this.size-this.hdr_size>c&&this.flags&a.TFHD_FLAG_SAMPLE_DUR?(this.default_sample_duration=o.readUint32(),c+=4):this.default_sample_duration=0,this.size-this.hdr_size>c&&this.flags&a.TFHD_FLAG_SAMPLE_SIZE?(this.default_sample_size=o.readUint32(),c+=4):this.default_sample_size=0,this.size-this.hdr_size>c&&this.flags&a.TFHD_FLAG_SAMPLE_FLAGS?(this.default_sample_flags=o.readUint32(),c+=4):this.default_sample_flags=0}),a.createFullBoxCtor("tfra",function(o){this.track_ID=o.readUint32(),o.readUint24();var c=o.readUint8();this.length_size_of_traf_num=c>>4&3,this.length_size_of_trun_num=c>>2&3,this.length_size_of_sample_num=c&3,this.entries=[];for(var d=o.readUint32(),h=0;h<d;h++)this.version===1?(this.time=o.readUint64(),this.moof_offset=o.readUint64()):(this.time=o.readUint32(),this.moof_offset=o.readUint32()),this.traf_number=o["readUint"+8*(this.length_size_of_traf_num+1)](),this.trun_number=o["readUint"+8*(this.length_size_of_trun_num+1)](),this.sample_number=o["readUint"+8*(this.length_size_of_sample_num+1)]()}),a.createFullBoxCtor("tkhd",function(o){this.version==1?(this.creation_time=o.readUint64(),this.modification_time=o.readUint64(),this.track_id=o.readUint32(),o.readUint32(),this.duration=o.readUint64()):(this.creation_time=o.readUint32(),this.modification_time=o.readUint32(),this.track_id=o.readUint32(),o.readUint32(),this.duration=o.readUint32()),o.readUint32Array(2),this.layer=o.readInt16(),this.alternate_group=o.readInt16(),this.volume=o.readInt16()>>8,o.readUint16(),this.matrix=o.readInt32Array(9),this.width=o.readUint32(),this.height=o.readUint32()}),a.createBoxCtor("tmax",function(o){this.time=o.readUint32()}),a.createBoxCtor("tmin",function(o){this.time=o.readUint32()}),a.createBoxCtor("totl",function(o){this.bytessent=o.readUint32()}),a.createBoxCtor("tpay",function(o){this.bytessent=o.readUint32()}),a.createBoxCtor("tpyl",function(o){this.bytessent=o.readUint64()}),a.TrackGroupTypeBox.prototype.parse=function(o){this.parseFullHeader(o),this.track_group_id=o.readUint32()},a.createTrackGroupCtor("msrc"),a.TrackReferenceTypeBox=function(o,c,d,h){a.Box.call(this,o,c),this.hdr_size=d,this.start=h},a.TrackReferenceTypeBox.prototype=new a.Box,a.TrackReferenceTypeBox.prototype.parse=function(o){this.track_ids=o.readUint32Array((this.size-this.hdr_size)/4)},a.trefBox.prototype.parse=function(o){for(var c,d;o.getPosition()<this.start+this.size;)if(c=a.parseOneBox(o,!0,this.size-(o.getPosition()-this.start)),c.code===a.OK)d=new a.TrackReferenceTypeBox(c.type,c.size,c.hdr_size,c.start),d.write===a.Box.prototype.write&&d.type!=="mdat"&&(e.info("BoxParser","TrackReference "+d.type+" box writing not yet implemented, keeping unparsed data in memory for later write"),d.parseDataAndRewind(o)),d.parse(o),this.boxes.push(d);else return},a.createFullBoxCtor("trep",function(o){for(this.track_ID=o.readUint32(),this.boxes=[];o.getPosition()<this.start+this.size;)if(ret=a.parseOneBox(o,!1,this.size-(o.getPosition()-this.start)),ret.code===a.OK)box=ret.box,this.boxes.push(box);else return}),a.createFullBoxCtor("trex",function(o){this.track_id=o.readUint32(),this.default_sample_description_index=o.readUint32(),this.default_sample_duration=o.readUint32(),this.default_sample_size=o.readUint32(),this.default_sample_flags=o.readUint32()}),a.createBoxCtor("trpy",function(o){this.bytessent=o.readUint64()}),a.createFullBoxCtor("trun",function(o){var c=0;if(this.sample_count=o.readUint32(),c+=4,this.size-this.hdr_size>c&&this.flags&a.TRUN_FLAGS_DATA_OFFSET?(this.data_offset=o.readInt32(),c+=4):this.data_offset=0,this.size-this.hdr_size>c&&this.flags&a.TRUN_FLAGS_FIRST_FLAG?(this.first_sample_flags=o.readUint32(),c+=4):this.first_sample_flags=0,this.sample_duration=[],this.sample_size=[],this.sample_flags=[],this.sample_composition_time_offset=[],this.size-this.hdr_size>c)for(var d=0;d<this.sample_count;d++)this.flags&a.TRUN_FLAGS_DURATION&&(this.sample_duration[d]=o.readUint32()),this.flags&a.TRUN_FLAGS_SIZE&&(this.sample_size[d]=o.readUint32()),this.flags&a.TRUN_FLAGS_FLAGS&&(this.sample_flags[d]=o.readUint32()),this.flags&a.TRUN_FLAGS_CTS_OFFSET&&(this.version===0?this.sample_composition_time_offset[d]=o.readUint32():this.sample_composition_time_offset[d]=o.readInt32())}),a.createFullBoxCtor("tsel",function(o){this.switch_group=o.readUint32();var c=(this.size-this.hdr_size-4)/4;this.attribute_list=[];for(var d=0;d<c;d++)this.attribute_list[d]=o.readUint32()}),a.createFullBoxCtor("txtC",function(o){this.config=o.readCString()}),a.createFullBoxCtor("url ",function(o){this.flags!==1&&(this.location=o.readCString())}),a.createFullBoxCtor("urn ",function(o){this.name=o.readCString(),this.size-this.hdr_size-this.name.length-1>0&&(this.location=o.readCString())}),a.createUUIDBox("a5d40b30e81411ddba2f0800200c9a66",!0,!1,function(o){this.LiveServerManifest=o.readString(this.size-this.hdr_size).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}),a.createUUIDBox("d08a4f1810f34a82b6c832d8aba183d3",!0,!1,function(o){this.system_id=a.parseHex16(o);var c=o.readUint32();c>0&&(this.data=o.readUint8Array(c))}),a.createUUIDBox("a2394f525a9b4f14a2446c427c648df4",!0,!1),a.createUUIDBox("8974dbce7be74c5184f97148f9882554",!0,!1,function(o){this.default_AlgorithmID=o.readUint24(),this.default_IV_size=o.readUint8(),this.default_KID=a.parseHex16(o)}),a.createUUIDBox("d4807ef2ca3946958e5426cb9e46a79f",!0,!1,function(o){this.fragment_count=o.readUint8(),this.entries=[];for(var c=0;c<this.fragment_count;c++){var d={},h=0,g=0;this.version===1?(h=o.readUint64(),g=o.readUint64()):(h=o.readUint32(),g=o.readUint32()),d.absolute_time=h,d.absolute_duration=g,this.entries.push(d)}}),a.createUUIDBox("6d1d9b0542d544e680e2141daff757b2",!0,!1,function(o){this.version===1?(this.absolute_time=o.readUint64(),this.duration=o.readUint64()):(this.absolute_time=o.readUint32(),this.duration=o.readUint32())}),a.createFullBoxCtor("vmhd",function(o){this.graphicsmode=o.readUint16(),this.opcolor=o.readUint16Array(3)}),a.createFullBoxCtor("vpcC",function(o){var c;this.version===1?(this.profile=o.readUint8(),this.level=o.readUint8(),c=o.readUint8(),this.bitDepth=c>>4,this.chromaSubsampling=c>>1&7,this.videoFullRangeFlag=c&1,this.colourPrimaries=o.readUint8(),this.transferCharacteristics=o.readUint8(),this.matrixCoefficients=o.readUint8(),this.codecIntializationDataSize=o.readUint16(),this.codecIntializationData=o.readUint8Array(this.codecIntializationDataSize)):(this.profile=o.readUint8(),this.level=o.readUint8(),c=o.readUint8(),this.bitDepth=c>>4&15,this.colorSpace=c&15,c=o.readUint8(),this.chromaSubsampling=c>>4&15,this.transferFunction=c>>1&7,this.videoFullRangeFlag=c&1,this.codecIntializationDataSize=o.readUint16(),this.codecIntializationData=o.readUint8Array(this.codecIntializationDataSize))}),a.createBoxCtor("vttC",function(o){this.text=o.readString(this.size-this.hdr_size)}),a.createFullBoxCtor("vvcC",function(o){var c,d,h={held_bits:void 0,num_held_bits:0,stream_read_1_bytes:function(T){this.held_bits=T.readUint8(),this.num_held_bits=8},stream_read_2_bytes:function(T){this.held_bits=T.readUint16(),this.num_held_bits=16},extract_bits:function(T){var M=this.held_bits>>this.num_held_bits-T&(1<<T)-1;return this.num_held_bits-=T,M}};if(h.stream_read_1_bytes(o),h.extract_bits(5),this.lengthSizeMinusOne=h.extract_bits(2),this.ptl_present_flag=h.extract_bits(1),this.ptl_present_flag){h.stream_read_2_bytes(o),this.ols_idx=h.extract_bits(9),this.num_sublayers=h.extract_bits(3),this.constant_frame_rate=h.extract_bits(2),this.chroma_format_idc=h.extract_bits(2),h.stream_read_1_bytes(o),this.bit_depth_minus8=h.extract_bits(3),h.extract_bits(5);{if(h.stream_read_2_bytes(o),h.extract_bits(2),this.num_bytes_constraint_info=h.extract_bits(6),this.general_profile_idc=h.extract_bits(7),this.general_tier_flag=h.extract_bits(1),this.general_level_idc=o.readUint8(),h.stream_read_1_bytes(o),this.ptl_frame_only_constraint_flag=h.extract_bits(1),this.ptl_multilayer_enabled_flag=h.extract_bits(1),this.general_constraint_info=new Uint8Array(this.num_bytes_constraint_info),this.num_bytes_constraint_info){for(c=0;c<this.num_bytes_constraint_info-1;c++){var g=h.extract_bits(6);h.stream_read_1_bytes(o);var y=h.extract_bits(2);this.general_constraint_info[c]=g<<2|y}this.general_constraint_info[this.num_bytes_constraint_info-1]=h.extract_bits(6)}else h.extract_bits(6);for(h.stream_read_1_bytes(o),this.ptl_sublayer_present_mask=0,d=this.num_sublayers-2;d>=0;--d){var v=h.extract_bits(1);this.ptl_sublayer_present_mask|=v<<d}for(d=this.num_sublayers;d<=8&&this.num_sublayers>1;++d)h.extract_bits(1);for(d=this.num_sublayers-2;d>=0;--d)this.ptl_sublayer_present_mask&1<<d&&(this.sublayer_level_idc[d]=o.readUint8());if(this.ptl_num_sub_profiles=o.readUint8(),this.general_sub_profile_idc=[],this.ptl_num_sub_profiles)for(c=0;c<this.ptl_num_sub_profiles;c++)this.general_sub_profile_idc.push(o.readUint32())}this.max_picture_width=o.readUint16(),this.max_picture_height=o.readUint16(),this.avg_frame_rate=o.readUint16()}var _=12,b=13;this.nalu_arrays=[];var x=o.readUint8();for(c=0;c<x;c++){var w=[];this.nalu_arrays.push(w),h.stream_read_1_bytes(o),w.completeness=h.extract_bits(1),h.extract_bits(2),w.nalu_type=h.extract_bits(5);var S=1;for(w.nalu_type!=b&&w.nalu_type!=_&&(S=o.readUint16()),d=0;d<S;d++){var C=o.readUint16();w.push({data:o.readUint8Array(C),length:C})}}}),a.createFullBoxCtor("vvnC",function(o){var c=strm.readUint8();this.lengthSizeMinusOne=c&3}),a.SampleEntry.prototype.isVideo=function(){return!1},a.SampleEntry.prototype.isAudio=function(){return!1},a.SampleEntry.prototype.isSubtitle=function(){return!1},a.SampleEntry.prototype.isMetadata=function(){return!1},a.SampleEntry.prototype.isHint=function(){return!1},a.SampleEntry.prototype.getCodec=function(){return this.type.replace(".","")},a.SampleEntry.prototype.getWidth=function(){return""},a.SampleEntry.prototype.getHeight=function(){return""},a.SampleEntry.prototype.getChannelCount=function(){return""},a.SampleEntry.prototype.getSampleRate=function(){return""},a.SampleEntry.prototype.getSampleSize=function(){return""},a.VisualSampleEntry.prototype.isVideo=function(){return!0},a.VisualSampleEntry.prototype.getWidth=function(){return this.width},a.VisualSampleEntry.prototype.getHeight=function(){return this.height},a.AudioSampleEntry.prototype.isAudio=function(){return!0},a.AudioSampleEntry.prototype.getChannelCount=function(){return this.channel_count},a.AudioSampleEntry.prototype.getSampleRate=function(){return this.samplerate},a.AudioSampleEntry.prototype.getSampleSize=function(){return this.samplesize},a.SubtitleSampleEntry.prototype.isSubtitle=function(){return!0},a.MetadataSampleEntry.prototype.isMetadata=function(){return!0},a.decimalToHex=function(o,c){var d=Number(o).toString(16);for(c=typeof c>"u"||c===null?c=2:c;d.length<c;)d="0"+d;return d},a.avc1SampleEntry.prototype.getCodec=a.avc2SampleEntry.prototype.getCodec=a.avc3SampleEntry.prototype.getCodec=a.avc4SampleEntry.prototype.getCodec=function(){var o=a.SampleEntry.prototype.getCodec.call(this);return this.avcC?o+"."+a.decimalToHex(this.avcC.AVCProfileIndication)+a.decimalToHex(this.avcC.profile_compatibility)+a.decimalToHex(this.avcC.AVCLevelIndication):o},a.hev1SampleEntry.prototype.getCodec=a.hvc1SampleEntry.prototype.getCodec=function(){var o,c=a.SampleEntry.prototype.getCodec.call(this);if(this.hvcC){switch(c+=".",this.hvcC.general_profile_space){case 0:c+="";break;case 1:c+="A";break;case 2:c+="B";break;case 3:c+="C";break}c+=this.hvcC.general_profile_idc,c+=".";var d=this.hvcC.general_profile_compatibility,h=0;for(o=0;o<32&&(h|=d&1,o!=31);o++)h<<=1,d>>=1;c+=a.decimalToHex(h,0),c+=".",this.hvcC.general_tier_flag===0?c+="L":c+="H",c+=this.hvcC.general_level_idc;var g=!1,y="";for(o=5;o>=0;o--)(this.hvcC.general_constraint_indicator[o]||g)&&(y="."+a.decimalToHex(this.hvcC.general_constraint_indicator[o],0)+y,g=!0);c+=y}return c},a.vvc1SampleEntry.prototype.getCodec=a.vvi1SampleEntry.prototype.getCodec=function(){var o,c=a.SampleEntry.prototype.getCodec.call(this);if(this.vvcC){c+="."+this.vvcC.general_profile_idc,this.vvcC.general_tier_flag?c+=".H":c+=".L",c+=this.vvcC.general_level_idc;var d="";if(this.vvcC.general_constraint_info){var h=[],g=0;g|=this.vvcC.ptl_frame_only_constraint<<7,g|=this.vvcC.ptl_multilayer_enabled<<6;var y;for(o=0;o<this.vvcC.general_constraint_info.length;++o)g|=this.vvcC.general_constraint_info[o]>>2&63,h.push(g),g&&(y=o),g=this.vvcC.general_constraint_info[o]>>2&3;if(y===void 0)d=".CA";else{d=".C";var v="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",_=0,b=0;for(o=0;o<=y;++o)for(_=_<<8|h[o],b+=8;b>=5;){var x=_>>b-5&31;d+=v[x],b-=5,_&=(1<<b)-1}b&&(_<<=5-b,d+=v[_&31])}}c+=d}return c},a.mp4aSampleEntry.prototype.getCodec=function(){var o=a.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var c=this.esds.esd.getOTI(),d=this.esds.esd.getAudioConfig();return o+"."+a.decimalToHex(c)+(d?"."+d:"")}else return o},a.stxtSampleEntry.prototype.getCodec=function(){var o=a.SampleEntry.prototype.getCodec.call(this);return this.mime_format?o+"."+this.mime_format:o},a.vp08SampleEntry.prototype.getCodec=a.vp09SampleEntry.prototype.getCodec=function(){var o=a.SampleEntry.prototype.getCodec.call(this),c=this.vpcC.level;c==0&&(c="00");var d=this.vpcC.bitDepth;return d==8&&(d="08"),o+".0"+this.vpcC.profile+"."+c+"."+d},a.av01SampleEntry.prototype.getCodec=function(){var o=a.SampleEntry.prototype.getCodec.call(this),c=this.av1C.seq_level_idx_0;c<10&&(c="0"+c);var d;return this.av1C.seq_profile===2&&this.av1C.high_bitdepth===1?d=this.av1C.twelve_bit===1?"12":"10":this.av1C.seq_profile<=2&&(d=this.av1C.high_bitdepth===1?"10":"08"),o+"."+this.av1C.seq_profile+"."+c+(this.av1C.seq_tier_0?"H":"M")+"."+d},a.Box.prototype.writeHeader=function(o,c){this.size+=8,this.size>r&&(this.size+=8),this.type==="uuid"&&(this.size+=16),e.debug("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+o.getPosition()+(c||"")),this.size>r?o.writeUint32(1):(this.sizePosition=o.getPosition(),o.writeUint32(this.size)),o.writeString(this.type,null,4),this.type==="uuid"&&o.writeUint8Array(this.uuid),this.size>r&&o.writeUint64(this.size)},a.FullBox.prototype.writeHeader=function(o){this.size+=4,a.Box.prototype.writeHeader.call(this,o," v="+this.version+" f="+this.flags),o.writeUint8(this.version),o.writeUint24(this.flags)},a.Box.prototype.write=function(o){this.type==="mdat"?this.data&&(this.size=this.data.length,this.writeHeader(o),o.writeUint8Array(this.data)):(this.size=this.data?this.data.length:0,this.writeHeader(o),this.data&&o.writeUint8Array(this.data))},a.ContainerBox.prototype.write=function(o){this.size=0,this.writeHeader(o);for(var c=0;c<this.boxes.length;c++)this.boxes[c]&&(this.boxes[c].write(o),this.size+=this.boxes[c].size);e.debug("BoxWriter","Adjusting box "+this.type+" with new size "+this.size),o.adjustUint32(this.sizePosition,this.size)},a.TrackReferenceTypeBox.prototype.write=function(o){this.size=this.track_ids.length*4,this.writeHeader(o),o.writeUint32Array(this.track_ids)},a.avcCBox.prototype.write=function(o){var c;for(this.size=7,c=0;c<this.SPS.length;c++)this.size+=2+this.SPS[c].length;for(c=0;c<this.PPS.length;c++)this.size+=2+this.PPS[c].length;for(this.ext&&(this.size+=this.ext.length),this.writeHeader(o),o.writeUint8(this.configurationVersion),o.writeUint8(this.AVCProfileIndication),o.writeUint8(this.profile_compatibility),o.writeUint8(this.AVCLevelIndication),o.writeUint8(this.lengthSizeMinusOne+252),o.writeUint8(this.SPS.length+224),c=0;c<this.SPS.length;c++)o.writeUint16(this.SPS[c].length),o.writeUint8Array(this.SPS[c].nalu);for(o.writeUint8(this.PPS.length),c=0;c<this.PPS.length;c++)o.writeUint16(this.PPS[c].length),o.writeUint8Array(this.PPS[c].nalu);this.ext&&o.writeUint8Array(this.ext)},a.co64Box.prototype.write=function(o){var c;for(this.version=0,this.flags=0,this.size=4+8*this.chunk_offsets.length,this.writeHeader(o),o.writeUint32(this.chunk_offsets.length),c=0;c<this.chunk_offsets.length;c++)o.writeUint64(this.chunk_offsets[c])},a.cslgBox.prototype.write=function(o){this.version=0,this.flags=0,this.size=4*5,this.writeHeader(o),o.writeInt32(this.compositionToDTSShift),o.writeInt32(this.leastDecodeToDisplayDelta),o.writeInt32(this.greatestDecodeToDisplayDelta),o.writeInt32(this.compositionStartTime),o.writeInt32(this.compositionEndTime)},a.cttsBox.prototype.write=function(o){var c;for(this.version=0,this.flags=0,this.size=4+8*this.sample_counts.length,this.writeHeader(o),o.writeUint32(this.sample_counts.length),c=0;c<this.sample_counts.length;c++)o.writeUint32(this.sample_counts[c]),this.version===1?o.writeInt32(this.sample_offsets[c]):o.writeUint32(this.sample_offsets[c])},a.drefBox.prototype.write=function(o){this.version=0,this.flags=0,this.size=4,this.writeHeader(o),o.writeUint32(this.entries.length);for(var c=0;c<this.entries.length;c++)this.entries[c].write(o),this.size+=this.entries[c].size;e.debug("BoxWriter","Adjusting box "+this.type+" with new size "+this.size),o.adjustUint32(this.sizePosition,this.size)},a.elngBox.prototype.write=function(o){this.version=0,this.flags=0,this.size=this.extended_language.length,this.writeHeader(o),o.writeString(this.extended_language)},a.elstBox.prototype.write=function(o){this.version=0,this.flags=0,this.size=4+12*this.entries.length,this.writeHeader(o),o.writeUint32(this.entries.length);for(var c=0;c<this.entries.length;c++){var d=this.entries[c];o.writeUint32(d.segment_duration),o.writeInt32(d.media_time),o.writeInt16(d.media_rate_integer),o.writeInt16(d.media_rate_fraction)}},a.emsgBox.prototype.write=function(o){this.version=0,this.flags=0,this.size=4*4+this.message_data.length+(this.scheme_id_uri.length+1)+(this.value.length+1),this.writeHeader(o),o.writeCString(this.scheme_id_uri),o.writeCString(this.value),o.writeUint32(this.timescale),o.writeUint32(this.presentation_time_delta),o.writeUint32(this.event_duration),o.writeUint32(this.id),o.writeUint8Array(this.message_data)},a.ftypBox.prototype.write=function(o){this.size=8+4*this.compatible_brands.length,this.writeHeader(o),o.writeString(this.major_brand,null,4),o.writeUint32(this.minor_version);for(var c=0;c<this.compatible_brands.length;c++)o.writeString(this.compatible_brands[c],null,4)},a.hdlrBox.prototype.write=function(o){this.size=5*4+this.name.length+1,this.version=0,this.flags=0,this.writeHeader(o),o.writeUint32(0),o.writeString(this.handler,null,4),o.writeUint32(0),o.writeUint32(0),o.writeUint32(0),o.writeCString(this.name)},a.kindBox.prototype.write=function(o){this.version=0,this.flags=0,this.size=this.schemeURI.length+1+(this.value.length+1),this.writeHeader(o),o.writeCString(this.schemeURI),o.writeCString(this.value)},a.mdhdBox.prototype.write=function(o){this.size=4*4+2*2,this.flags=0,this.version=0,this.writeHeader(o),o.writeUint32(this.creation_time),o.writeUint32(this.modification_time),o.writeUint32(this.timescale),o.writeUint32(this.duration),o.writeUint16(this.language),o.writeUint16(0)},a.mehdBox.prototype.write=function(o){this.version=0,this.flags=0,this.size=4,this.writeHeader(o),o.writeUint32(this.fragment_duration)},a.mfhdBox.prototype.write=function(o){this.version=0,this.flags=0,this.size=4,this.writeHeader(o),o.writeUint32(this.sequence_number)},a.mvhdBox.prototype.write=function(o){this.version=0,this.flags=0,this.size=23*4+2*2,this.writeHeader(o),o.writeUint32(this.creation_time),o.writeUint32(this.modification_time),o.writeUint32(this.timescale),o.writeUint32(this.duration),o.writeUint32(this.rate),o.writeUint16(this.volume<<8),o.writeUint16(0),o.writeUint32(0),o.writeUint32(0),o.writeUint32Array(this.matrix),o.writeUint32(0),o.writeUint32(0),o.writeUint32(0),o.writeUint32(0),o.writeUint32(0),o.writeUint32(0),o.writeUint32(this.next_track_id)},a.SampleEntry.prototype.writeHeader=function(o){this.size=8,a.Box.prototype.writeHeader.call(this,o),o.writeUint8(0),o.writeUint8(0),o.writeUint8(0),o.writeUint8(0),o.writeUint8(0),o.writeUint8(0),o.writeUint16(this.data_reference_index)},a.SampleEntry.prototype.writeFooter=function(o){for(var c=0;c<this.boxes.length;c++)this.boxes[c].write(o),this.size+=this.boxes[c].size;e.debug("BoxWriter","Adjusting box "+this.type+" with new size "+this.size),o.adjustUint32(this.sizePosition,this.size)},a.SampleEntry.prototype.write=function(o){this.writeHeader(o),o.writeUint8Array(this.data),this.size+=this.data.length,e.debug("BoxWriter","Adjusting box "+this.type+" with new size "+this.size),o.adjustUint32(this.sizePosition,this.size)},a.VisualSampleEntry.prototype.write=function(o){this.writeHeader(o),this.size+=2*7+6*4+32,o.writeUint16(0),o.writeUint16(0),o.writeUint32(0),o.writeUint32(0),o.writeUint32(0),o.writeUint16(this.width),o.writeUint16(this.height),o.writeUint32(this.horizresolution),o.writeUint32(this.vertresolution),o.writeUint32(0),o.writeUint16(this.frame_count),o.writeUint8(Math.min(31,this.compressorname.length)),o.writeString(this.compressorname,null,31),o.writeUint16(this.depth),o.writeInt16(-1),this.writeFooter(o)},a.AudioSampleEntry.prototype.write=function(o){this.writeHeader(o),this.size+=2*4+3*4,o.writeUint32(0),o.writeUint32(0),o.writeUint16(this.channel_count),o.writeUint16(this.samplesize),o.writeUint16(0),o.writeUint16(0),o.writeUint32(this.samplerate<<16),this.writeFooter(o)},a.stppSampleEntry.prototype.write=function(o){this.writeHeader(o),this.size+=this.namespace.length+1+this.schema_location.length+1+this.auxiliary_mime_types.length+1,o.writeCString(this.namespace),o.writeCString(this.schema_location),o.writeCString(this.auxiliary_mime_types),this.writeFooter(o)},a.SampleGroupEntry.prototype.write=function(o){o.writeUint8Array(this.data)},a.sbgpBox.prototype.write=function(o){this.version=1,this.flags=0,this.size=12+8*this.entries.length,this.writeHeader(o),o.writeString(this.grouping_type,null,4),o.writeUint32(this.grouping_type_parameter),o.writeUint32(this.entries.length);for(var c=0;c<this.entries.length;c++){var d=this.entries[c];o.writeInt32(d.sample_count),o.writeInt32(d.group_description_index)}},a.sgpdBox.prototype.write=function(o){var c,d;for(this.flags=0,this.size=12,c=0;c<this.entries.length;c++)d=this.entries[c],this.version===1&&(this.default_length===0&&(this.size+=4),this.size+=d.data.length);for(this.writeHeader(o),o.writeString(this.grouping_type,null,4),this.version===1&&o.writeUint32(this.default_length),this.version>=2&&o.writeUint32(this.default_sample_description_index),o.writeUint32(this.entries.length),c=0;c<this.entries.length;c++)d=this.entries[c],this.version===1&&this.default_length===0&&o.writeUint32(d.description_length),d.write(o)},a.sidxBox.prototype.write=function(o){this.version=0,this.flags=0,this.size=4*4+2+2+12*this.references.length,this.writeHeader(o),o.writeUint32(this.reference_ID),o.writeUint32(this.timescale),o.writeUint32(this.earliest_presentation_time),o.writeUint32(this.first_offset),o.writeUint16(0),o.writeUint16(this.references.length);for(var c=0;c<this.references.length;c++){var d=this.references[c];o.writeUint32(d.reference_type<<31|d.referenced_size),o.writeUint32(d.subsegment_duration),o.writeUint32(d.starts_with_SAP<<31|d.SAP_type<<28|d.SAP_delta_time)}},a.smhdBox.prototype.write=function(o){this.version=0,this.flags=1,this.size=4,this.writeHeader(o),o.writeUint16(this.balance),o.writeUint16(0)},a.stcoBox.prototype.write=function(o){this.version=0,this.flags=0,this.size=4+4*this.chunk_offsets.length,this.writeHeader(o),o.writeUint32(this.chunk_offsets.length),o.writeUint32Array(this.chunk_offsets)},a.stscBox.prototype.write=function(o){var c;for(this.version=0,this.flags=0,this.size=4+12*this.first_chunk.length,this.writeHeader(o),o.writeUint32(this.first_chunk.length),c=0;c<this.first_chunk.length;c++)o.writeUint32(this.first_chunk[c]),o.writeUint32(this.samples_per_chunk[c]),o.writeUint32(this.sample_description_index[c])},a.stsdBox.prototype.write=function(o){var c;for(this.version=0,this.flags=0,this.size=0,this.writeHeader(o),o.writeUint32(this.entries.length),this.size+=4,c=0;c<this.entries.length;c++)this.entries[c].write(o),this.size+=this.entries[c].size;e.debug("BoxWriter","Adjusting box "+this.type+" with new size "+this.size),o.adjustUint32(this.sizePosition,this.size)},a.stshBox.prototype.write=function(o){var c;for(this.version=0,this.flags=0,this.size=4+8*this.shadowed_sample_numbers.length,this.writeHeader(o),o.writeUint32(this.shadowed_sample_numbers.length),c=0;c<this.shadowed_sample_numbers.length;c++)o.writeUint32(this.shadowed_sample_numbers[c]),o.writeUint32(this.sync_sample_numbers[c])},a.stssBox.prototype.write=function(o){this.version=0,this.flags=0,this.size=4+4*this.sample_numbers.length,this.writeHeader(o),o.writeUint32(this.sample_numbers.length),o.writeUint32Array(this.sample_numbers)},a.stszBox.prototype.write=function(o){var c,d=!0;if(this.version=0,this.flags=0,this.sample_sizes.length>0)for(c=0;c+1<this.sample_sizes.length;)if(this.sample_sizes[c+1]!==this.sample_sizes[0]){d=!1;break}else c++;else d=!1;this.size=8,d||(this.size+=4*this.sample_sizes.length),this.writeHeader(o),d?o.writeUint32(this.sample_sizes[0]):o.writeUint32(0),o.writeUint32(this.sample_sizes.length),d||o.writeUint32Array(this.sample_sizes)},a.sttsBox.prototype.write=function(o){var c;for(this.version=0,this.flags=0,this.size=4+8*this.sample_counts.length,this.writeHeader(o),o.writeUint32(this.sample_counts.length),c=0;c<this.sample_counts.length;c++)o.writeUint32(this.sample_counts[c]),o.writeUint32(this.sample_deltas[c])},a.tfdtBox.prototype.write=function(o){var c=Math.pow(2,32)-1;this.version=this.baseMediaDecodeTime>c?1:0,this.flags=0,this.size=4,this.version===1&&(this.size+=4),this.writeHeader(o),this.version===1?o.writeUint64(this.baseMediaDecodeTime):o.writeUint32(this.baseMediaDecodeTime)},a.tfhdBox.prototype.write=function(o){this.version=0,this.size=4,this.flags&a.TFHD_FLAG_BASE_DATA_OFFSET&&(this.size+=8),this.flags&a.TFHD_FLAG_SAMPLE_DESC&&(this.size+=4),this.flags&a.TFHD_FLAG_SAMPLE_DUR&&(this.size+=4),this.flags&a.TFHD_FLAG_SAMPLE_SIZE&&(this.size+=4),this.flags&a.TFHD_FLAG_SAMPLE_FLAGS&&(this.size+=4),this.writeHeader(o),o.writeUint32(this.track_id),this.flags&a.TFHD_FLAG_BASE_DATA_OFFSET&&o.writeUint64(this.base_data_offset),this.flags&a.TFHD_FLAG_SAMPLE_DESC&&o.writeUint32(this.default_sample_description_index),this.flags&a.TFHD_FLAG_SAMPLE_DUR&&o.writeUint32(this.default_sample_duration),this.flags&a.TFHD_FLAG_SAMPLE_SIZE&&o.writeUint32(this.default_sample_size),this.flags&a.TFHD_FLAG_SAMPLE_FLAGS&&o.writeUint32(this.default_sample_flags)},a.tkhdBox.prototype.write=function(o){this.version=0,this.size=4*18+2*4,this.writeHeader(o),o.writeUint32(this.creation_time),o.writeUint32(this.modification_time),o.writeUint32(this.track_id),o.writeUint32(0),o.writeUint32(this.duration),o.writeUint32(0),o.writeUint32(0),o.writeInt16(this.layer),o.writeInt16(this.alternate_group),o.writeInt16(this.volume<<8),o.writeUint16(0),o.writeInt32Array(this.matrix),o.writeUint32(this.width),o.writeUint32(this.height)},a.trexBox.prototype.write=function(o){this.version=0,this.flags=0,this.size=4*5,this.writeHeader(o),o.writeUint32(this.track_id),o.writeUint32(this.default_sample_description_index),o.writeUint32(this.default_sample_duration),o.writeUint32(this.default_sample_size),o.writeUint32(this.default_sample_flags)},a.trunBox.prototype.write=function(o){this.version=0,this.size=4,this.flags&a.TRUN_FLAGS_DATA_OFFSET&&(this.size+=4),this.flags&a.TRUN_FLAGS_FIRST_FLAG&&(this.size+=4),this.flags&a.TRUN_FLAGS_DURATION&&(this.size+=4*this.sample_duration.length),this.flags&a.TRUN_FLAGS_SIZE&&(this.size+=4*this.sample_size.length),this.flags&a.TRUN_FLAGS_FLAGS&&(this.size+=4*this.sample_flags.length),this.flags&a.TRUN_FLAGS_CTS_OFFSET&&(this.size+=4*this.sample_composition_time_offset.length),this.writeHeader(o),o.writeUint32(this.sample_count),this.flags&a.TRUN_FLAGS_DATA_OFFSET&&(this.data_offset_position=o.getPosition(),o.writeInt32(this.data_offset)),this.flags&a.TRUN_FLAGS_FIRST_FLAG&&o.writeUint32(this.first_sample_flags);for(var c=0;c<this.sample_count;c++)this.flags&a.TRUN_FLAGS_DURATION&&o.writeUint32(this.sample_duration[c]),this.flags&a.TRUN_FLAGS_SIZE&&o.writeUint32(this.sample_size[c]),this.flags&a.TRUN_FLAGS_FLAGS&&o.writeUint32(this.sample_flags[c]),this.flags&a.TRUN_FLAGS_CTS_OFFSET&&(this.version===0?o.writeUint32(this.sample_composition_time_offset[c]):o.writeInt32(this.sample_composition_time_offset[c]))},a["url Box"].prototype.write=function(o){this.version=0,this.location?(this.flags=0,this.size=this.location.length+1):(this.flags=1,this.size=0),this.writeHeader(o),this.location&&o.writeCString(this.location)},a["urn Box"].prototype.write=function(o){this.version=0,this.flags=0,this.size=this.name.length+1+(this.location?this.location.length+1:0),this.writeHeader(o),o.writeCString(this.name),this.location&&o.writeCString(this.location)},a.vmhdBox.prototype.write=function(o){this.version=0,this.flags=1,this.size=8,this.writeHeader(o),o.writeUint16(this.graphicsmode),o.writeUint16Array(this.opcolor)},a.cttsBox.prototype.unpack=function(o){var c,d,h;for(h=0,c=0;c<this.sample_counts.length;c++)for(d=0;d<this.sample_counts[c];d++)o[h].pts=o[h].dts+this.sample_offsets[c],h++},a.sttsBox.prototype.unpack=function(o){var c,d,h;for(h=0,c=0;c<this.sample_counts.length;c++)for(d=0;d<this.sample_counts[c];d++)h===0?o[h].dts=0:o[h].dts=o[h-1].dts+this.sample_deltas[c],h++},a.stcoBox.prototype.unpack=function(o){var c;for(c=0;c<this.chunk_offsets.length;c++)o[c].offset=this.chunk_offsets[c]},a.stscBox.prototype.unpack=function(o){var c,d,h,g,y;for(g=0,y=0,c=0;c<this.first_chunk.length;c++)for(d=0;d<(c+1<this.first_chunk.length?this.first_chunk[c+1]:1/0);d++)for(y++,h=0;h<this.samples_per_chunk[c];h++){if(o[g])o[g].description_index=this.sample_description_index[c],o[g].chunk_index=y;else return;g++}},a.stszBox.prototype.unpack=function(o){var c;for(c=0;c<this.sample_sizes.length;c++)o[c].size=this.sample_sizes[c]},a.DIFF_BOXES_PROP_NAMES=["boxes","entries","references","subsamples","items","item_infos","extents","associations","subsegments","ranges","seekLists","seekPoints","esd","levels"],a.DIFF_PRIMITIVE_ARRAY_PROP_NAMES=["compatible_brands","matrix","opcolor","sample_counts","sample_counts","sample_deltas","first_chunk","samples_per_chunk","sample_sizes","chunk_offsets","sample_offsets","sample_description_index","sample_duration"],a.boxEqualFields=function(o,c){if(o&&!c)return!1;var d;for(d in o)if(!(a.DIFF_BOXES_PROP_NAMES.indexOf(d)>-1)){if(o[d]instanceof a.Box||c[d]instanceof a.Box)continue;if(typeof o[d]>"u"||typeof c[d]>"u")continue;if(typeof o[d]=="function"||typeof c[d]=="function")continue;if(o.subBoxNames&&o.subBoxNames.indexOf(d.slice(0,4))>-1||c.subBoxNames&&c.subBoxNames.indexOf(d.slice(0,4))>-1)continue;if(d==="data"||d==="start"||d==="size"||d==="creation_time"||d==="modification_time")continue;if(a.DIFF_PRIMITIVE_ARRAY_PROP_NAMES.indexOf(d)>-1)continue;if(o[d]!==c[d])return!1}return!0},a.boxEqual=function(o,c){if(!a.boxEqualFields(o,c))return!1;for(var d=0;d<a.DIFF_BOXES_PROP_NAMES.length;d++){var h=a.DIFF_BOXES_PROP_NAMES[d];if(o[h]&&c[h]&&!a.boxEqual(o[h],c[h]))return!1}return!0};var u=function(){};u.prototype.parseSample=function(o){var c={},d;c.resources=[];var h=new n(o.data.buffer);if(!o.subsamples||o.subsamples.length===0)c.documentString=h.readString(o.data.length);else if(c.documentString=h.readString(o.subsamples[0].size),o.subsamples.length>1)for(d=1;d<o.subsamples.length;d++)c.resources[d]=h.readUint8Array(o.subsamples[d].size);return typeof DOMParser<"u"&&(c.document=new DOMParser().parseFromString(c.documentString,"application/xml")),c};var f=function(){};f.prototype.parseSample=function(o){var c,d=new n(o.data.buffer);return c=d.readString(o.data.length),c},f.prototype.parseConfig=function(o){var c,d=new n(o.buffer);return d.readUint32(),c=d.readCString(),c},t.XMLSubtitlein4Parser=u,t.Textin4Parser=f;var p=function(o){this.stream=o||new s,this.boxes=[],this.mdats=[],this.moofs=[],this.isProgressive=!1,this.moovStartFound=!1,this.onMoovStart=null,this.moovStartSent=!1,this.onReady=null,this.readySent=!1,this.onSegment=null,this.onSamples=null,this.onError=null,this.sampleListBuilt=!1,this.fragmentedTracks=[],this.extractedTracks=[],this.isFragmentationInitialized=!1,this.sampleProcessingStarted=!1,this.nextMoofNumber=0,this.itemListBuilt=!1,this.onSidx=null,this.sidxSent=!1};p.prototype.setSegmentOptions=function(o,c,d){var h=this.getTrackById(o);if(h){var g={};this.fragmentedTracks.push(g),g.id=o,g.user=c,g.trak=h,h.nextSample=0,g.segmentStream=null,g.nb_samples=1e3,g.rapAlignement=!0,d&&(d.nbSamples&&(g.nb_samples=d.nbSamples),d.rapAlignement&&(g.rapAlignement=d.rapAlignement))}},p.prototype.unsetSegmentOptions=function(o){for(var c=-1,d=0;d<this.fragmentedTracks.length;d++){var h=this.fragmentedTracks[d];h.id==o&&(c=d)}c>-1&&this.fragmentedTracks.splice(c,1)},p.prototype.setExtractionOptions=function(o,c,d){var h=this.getTrackById(o);if(h){var g={};this.extractedTracks.push(g),g.id=o,g.user=c,g.trak=h,h.nextSample=0,g.nb_samples=1e3,g.samples=[],d&&d.nbSamples&&(g.nb_samples=d.nbSamples)}},p.prototype.unsetExtractionOptions=function(o){for(var c=-1,d=0;d<this.extractedTracks.length;d++){var h=this.extractedTracks[d];h.id==o&&(c=d)}c>-1&&this.extractedTracks.splice(c,1)},p.prototype.parse=function(){var o,c,d=!1;if(!(this.restoreParsePosition&&!this.restoreParsePosition()))for(;;)if(this.hasIncompleteMdat&&this.hasIncompleteMdat()){if(this.processIncompleteMdat())continue;return}else if(this.saveParsePosition&&this.saveParsePosition(),o=a.parseOneBox(this.stream,d),o.code===a.ERR_NOT_ENOUGH_DATA)if(this.processIncompleteBox){if(this.processIncompleteBox(o))continue;return}else return;else{var h;switch(c=o.box,h=c.type!=="uuid"?c.type:c.uuid,this.boxes.push(c),h){case"mdat":this.mdats.push(c);break;case"moof":this.moofs.push(c);break;case"moov":this.moovStartFound=!0,this.mdats.length===0&&(this.isProgressive=!0);default:this[h]!==void 0&&e.warn("ISOFile","Duplicate Box of type: "+h+", overriding previous occurrence"),this[h]=c;break}this.updateUsedBytes&&this.updateUsedBytes(c,o)}},p.prototype.checkBuffer=function(o){if(o==null)throw"Buffer must be defined and non empty";if(o.fileStart===void 0)throw"Buffer must have a fileStart property";return o.byteLength===0?(e.warn("ISOFile","Ignoring empty buffer (fileStart: "+o.fileStart+")"),this.stream.logBufferLevel(),!1):(e.info("ISOFile","Processing buffer (fileStart: "+o.fileStart+")"),o.usedBytes=0,this.stream.insertBuffer(o),this.stream.logBufferLevel(),this.stream.initialized()?!0:(e.warn("ISOFile","Not ready to start parsing"),!1))},p.prototype.appendBuffer=function(o,c){var d;if(this.checkBuffer(o))return this.parse(),this.moovStartFound&&!this.moovStartSent&&(this.moovStartSent=!0,this.onMoovStart&&this.onMoovStart()),this.moov?(this.sampleListBuilt||(this.buildSampleLists(),this.sampleListBuilt=!0),this.updateSampleLists(),this.onReady&&!this.readySent&&(this.readySent=!0,this.onReady(this.getInfo())),this.processSamples(c),this.nextSeekPosition?(d=this.nextSeekPosition,this.nextSeekPosition=void 0):d=this.nextParsePosition,this.stream.getEndFilePositionAfter&&(d=this.stream.getEndFilePositionAfter(d))):this.nextParsePosition?d=this.nextParsePosition:d=0,this.sidx&&this.onSidx&&!this.sidxSent&&(this.onSidx(this.sidx),this.sidxSent=!0),this.meta&&(this.flattenItemInfo&&!this.itemListBuilt&&(this.flattenItemInfo(),this.itemListBuilt=!0),this.processItems&&this.processItems(this.onItem)),this.stream.cleanBuffers&&(e.info("ISOFile","Done processing buffer (fileStart: "+o.fileStart+") - next buffer to fetch should have a fileStart position of "+d),this.stream.logBufferLevel(),this.stream.cleanBuffers(),this.stream.logBufferLevel(!0),e.info("ISOFile","Sample data size in memory: "+this.getAllocatedSampleDataSize())),d},p.prototype.getInfo=function(){var o,c,d={},h,g,y,v,_=(new Date("1904-01-01T00:00:00Z")).getTime();if(this.moov)for(d.hasMoov=!0,d.duration=this.moov.mvhd.duration,d.timescale=this.moov.mvhd.timescale,d.isFragmented=this.moov.mvex!=null,d.isFragmented&&this.moov.mvex.mehd&&(d.fragment_duration=this.moov.mvex.mehd.fragment_duration),d.isProgressive=this.isProgressive,d.hasIOD=this.moov.iods!=null,d.brands=[],d.brands.push(this.ftyp.major_brand),d.brands=d.brands.concat(this.ftyp.compatible_brands),d.created=new Date(_+this.moov.mvhd.creation_time*1e3),d.modified=new Date(_+this.moov.mvhd.modification_time*1e3),d.tracks=[],d.audioTracks=[],d.videoTracks=[],d.subtitleTracks=[],d.metadataTracks=[],d.hintTracks=[],d.otherTracks=[],o=0;o<this.moov.traks.length;o++){if(h=this.moov.traks[o],v=h.mdia.minf.stbl.stsd.entries[0],g={},d.tracks.push(g),g.id=h.tkhd.track_id,g.name=h.mdia.hdlr.name,g.references=[],h.tref)for(c=0;c<h.tref.boxes.length;c++)y={},g.references.push(y),y.type=h.tref.boxes[c].type,y.track_ids=h.tref.boxes[c].track_ids;h.edts&&(g.edits=h.edts.elst.entries),g.created=new Date(_+h.tkhd.creation_time*1e3),g.modified=new Date(_+h.tkhd.modification_time*1e3),g.movie_duration=h.tkhd.duration,g.movie_timescale=d.timescale,g.layer=h.tkhd.layer,g.alternate_group=h.tkhd.alternate_group,g.volume=h.tkhd.volume,g.matrix=h.tkhd.matrix,g.track_width=h.tkhd.width/65536,g.track_height=h.tkhd.height/65536,g.timescale=h.mdia.mdhd.timescale,g.cts_shift=h.mdia.minf.stbl.cslg,g.duration=h.mdia.mdhd.duration,g.samples_duration=h.samples_duration,g.codec=v.getCodec(),g.kind=h.udta&&h.udta.kinds.length?h.udta.kinds[0]:{schemeURI:"",value:""},g.language=h.mdia.elng?h.mdia.elng.extended_language:h.mdia.mdhd.languageString,g.nb_samples=h.samples.length,g.size=h.samples_size,g.bitrate=g.size*8*g.timescale/g.samples_duration,v.isAudio()?(g.type="audio",d.audioTracks.push(g),g.audio={},g.audio.sample_rate=v.getSampleRate(),g.audio.channel_count=v.getChannelCount(),g.audio.sample_size=v.getSampleSize()):v.isVideo()?(g.type="video",d.videoTracks.push(g),g.video={},g.video.width=v.getWidth(),g.video.height=v.getHeight()):v.isSubtitle()?(g.type="subtitles",d.subtitleTracks.push(g)):v.isHint()?(g.type="metadata",d.hintTracks.push(g)):v.isMetadata()?(g.type="metadata",d.metadataTracks.push(g)):(g.type="metadata",d.otherTracks.push(g))}else d.hasMoov=!1;if(d.mime="",d.hasMoov&&d.tracks){for(d.videoTracks&&d.videoTracks.length>0?d.mime+='video/mp4; codecs="':d.audioTracks&&d.audioTracks.length>0?d.mime+='audio/mp4; codecs="':d.mime+='application/mp4; codecs="',o=0;o<d.tracks.length;o++)o!==0&&(d.mime+=","),d.mime+=d.tracks[o].codec;d.mime+='"; profiles="',d.mime+=this.ftyp.compatible_brands.join(),d.mime+='"'}return d},p.prototype.processSamples=function(o){var c,d;if(this.sampleProcessingStarted){if(this.isFragmentationInitialized&&this.onSegment!==null)for(c=0;c<this.fragmentedTracks.length;c++){var h=this.fragmentedTracks[c];for(d=h.trak;d.nextSample<d.samples.length&&this.sampleProcessingStarted;){e.debug("ISOFile","Creating media fragment on track #"+h.id+" for sample "+d.nextSample);var g=this.createFragment(h.id,d.nextSample,h.segmentStream);if(g)h.segmentStream=g,d.nextSample++;else break;if((d.nextSample%h.nb_samples===0||o||d.nextSample>=d.samples.length)&&(e.info("ISOFile","Sending fragmented data on track #"+h.id+" for samples ["+Math.max(0,d.nextSample-h.nb_samples)+","+(d.nextSample-1)+"]"),e.info("ISOFile","Sample data size in memory: "+this.getAllocatedSampleDataSize()),this.onSegment&&this.onSegment(h.id,h.user,h.segmentStream.buffer,d.nextSample,o||d.nextSample>=d.samples.length),h.segmentStream=null,h!==this.fragmentedTracks[c]))break}}if(this.onSamples!==null)for(c=0;c<this.extractedTracks.length;c++){var y=this.extractedTracks[c];for(d=y.trak;d.nextSample<d.samples.length&&this.sampleProcessingStarted;){e.debug("ISOFile","Exporting on track #"+y.id+" sample #"+d.nextSample);var v=this.getSample(d,d.nextSample);if(v)d.nextSample++,y.samples.push(v);else break;if((d.nextSample%y.nb_samples===0||d.nextSample>=d.samples.length)&&(e.debug("ISOFile","Sending samples on track #"+y.id+" for sample "+d.nextSample),this.onSamples&&this.onSamples(y.id,y.user,y.samples),y.samples=[],y!==this.extractedTracks[c]))break}}}},p.prototype.getBox=function(o){var c=this.getBoxes(o,!0);return c.length?c[0]:null},p.prototype.getBoxes=function(o,c){var d=[];return p._sweep.call(this,o,d,c),d},p._sweep=function(o,c,d){this.type&&this.type==o&&c.push(this);for(var h in this.boxes){if(c.length&&d)return;p._sweep.call(this.boxes[h],o,c,d)}},p.prototype.getTrackSamplesInfo=function(o){var c=this.getTrackById(o);if(c)return c.samples},p.prototype.getTrackSample=function(o,c){var d=this.getTrackById(o),h=this.getSample(d,c);return h},p.prototype.releaseUsedSamples=function(o,c){var d=0,h=this.getTrackById(o);h.lastValidSample||(h.lastValidSample=0);for(var g=h.lastValidSample;g<c;g++)d+=this.releaseSample(h,g);e.info("ISOFile","Track #"+o+" released samples up to "+c+" (released size: "+d+", remaining: "+this.samplesDataSize+")"),h.lastValidSample=c},p.prototype.start=function(){this.sampleProcessingStarted=!0,this.processSamples(!1)},p.prototype.stop=function(){this.sampleProcessingStarted=!1},p.prototype.flush=function(){e.info("ISOFile","Flushing remaining samples"),this.updateSampleLists(),this.processSamples(!0),this.stream.cleanBuffers(),this.stream.logBufferLevel(!0)},p.prototype.seekTrack=function(o,c,d){var h,g,y=1/0,v=0,_=0,b;if(d.samples.length===0)return e.info("ISOFile","No sample in track, cannot seek! Using time "+e.getDurationString(0,1)+" and offset: 0"),{offset:0,time:0};for(h=0;h<d.samples.length;h++){if(g=d.samples[h],h===0)_=0,b=g.timescale;else if(g.cts>o*g.timescale){_=h-1;break}c&&g.is_sync&&(v=h)}for(c&&(_=v),o=d.samples[_].cts,d.nextSample=_;d.samples[_].alreadyRead===d.samples[_].size&&d.samples[_+1];)_++;return y=d.samples[_].offset+d.samples[_].alreadyRead,e.info("ISOFile","Seeking to "+(c?"RAP":"")+" sample #"+d.nextSample+" on track "+d.tkhd.track_id+", time "+e.getDurationString(o,b)+" and offset: "+y),{offset:y,time:o/b}},p.prototype.seek=function(o,c){var d=this.moov,h,g,y,v={offset:1/0,time:1/0};if(this.moov){for(y=0;y<d.traks.length;y++)h=d.traks[y],g=this.seekTrack(o,c,h),g.offset<v.offset&&(v.offset=g.offset),g.time<v.time&&(v.time=g.time);return e.info("ISOFile","Seeking at time "+e.getDurationString(v.time,1)+" needs a buffer with a fileStart position of "+v.offset),v.offset===1/0?v={offset:this.nextParsePosition,time:0}:v.offset=this.stream.getEndFilePositionAfter(v.offset),e.info("ISOFile","Adjusted seek position (after checking data already in buffer): "+v.offset),v}else throw"Cannot seek: moov not received!"},p.prototype.equal=function(o){for(var c=0;c<this.boxes.length&&c<o.boxes.length;){var d=this.boxes[c],h=o.boxes[c];if(!a.boxEqual(d,h))return!1;c++}return!0},t.ISOFile=p,p.prototype.lastBoxStartPosition=0,p.prototype.parsingMdat=null,p.prototype.nextParsePosition=0,p.prototype.discardMdatData=!1,p.prototype.processIncompleteBox=function(o){var c,d,h;return o.type==="mdat"?(c=new a[o.type+"Box"](o.size),this.parsingMdat=c,this.boxes.push(c),this.mdats.push(c),c.start=o.start,c.hdr_size=o.hdr_size,this.stream.addUsedBytes(c.hdr_size),this.lastBoxStartPosition=c.start+c.size,h=this.stream.seek(c.start+c.size,!1,this.discardMdatData),h?(this.parsingMdat=null,!0):(this.moovStartFound?this.nextParsePosition=this.stream.findEndContiguousBuf():this.nextParsePosition=c.start+c.size,!1)):(o.type==="moov"&&(this.moovStartFound=!0,this.mdats.length===0&&(this.isProgressive=!0)),d=this.stream.mergeNextBuffer?this.stream.mergeNextBuffer():!1,d?(this.nextParsePosition=this.stream.getEndPosition(),!0):(o.type?this.moovStartFound?this.nextParsePosition=this.stream.getEndPosition():this.nextParsePosition=this.stream.getPosition()+o.size:this.nextParsePosition=this.stream.getEndPosition(),!1))},p.prototype.hasIncompleteMdat=function(){return this.parsingMdat!==null},p.prototype.processIncompleteMdat=function(){var o,c;return o=this.parsingMdat,c=this.stream.seek(o.start+o.size,!1,this.discardMdatData),c?(e.debug("ISOFile","Found 'mdat' end in buffered data"),this.parsingMdat=null,!0):(this.nextParsePosition=this.stream.findEndContiguousBuf(),!1)},p.prototype.restoreParsePosition=function(){return this.stream.seek(this.lastBoxStartPosition,!0,this.discardMdatData)},p.prototype.saveParsePosition=function(){this.lastBoxStartPosition=this.stream.getPosition()},p.prototype.updateUsedBytes=function(o,c){this.stream.addUsedBytes&&(o.type==="mdat"?(this.stream.addUsedBytes(o.hdr_size),this.discardMdatData&&this.stream.addUsedBytes(o.size-o.hdr_size)):this.stream.addUsedBytes(o.size))},p.prototype.add=a.Box.prototype.add,p.prototype.addBox=a.Box.prototype.addBox,p.prototype.init=function(o){var c=o||{};this.add("ftyp").set("major_brand",c.brands&&c.brands[0]||"iso4").set("minor_version",0).set("compatible_brands",c.brands||["iso4"]);var d=this.add("moov");return d.add("mvhd").set("timescale",c.timescale||600).set("rate",c.rate||65536).set("creation_time",0).set("modification_time",0).set("duration",c.duration||0).set("volume",c.width?0:256).set("matrix",[65536,0,0,0,65536,0,0,0,1073741824]).set("next_track_id",1),d.add("mvex"),this},p.prototype.addTrack=function(o){this.moov||this.init(o);var c=o||{};c.width=c.width||320,c.height=c.height||320,c.id=c.id||this.moov.mvhd.next_track_id,c.type=c.type||"avc1";var d=this.moov.add("trak");this.moov.mvhd.next_track_id=c.id+1,d.add("tkhd").set("flags",a.TKHD_FLAG_ENABLED|a.TKHD_FLAG_IN_MOVIE|a.TKHD_FLAG_IN_PREVIEW).set("creation_time",0).set("modification_time",0).set("track_id",c.id).set("duration",c.duration||0).set("layer",c.layer||0).set("alternate_group",0).set("volume",1).set("matrix",[0,0,0,0,0,0,0,0,0]).set("width",c.width<<16).set("height",c.height<<16);var h=d.add("mdia");h.add("mdhd").set("creation_time",0).set("modification_time",0).set("timescale",c.timescale||1).set("duration",c.media_duration||0).set("language",c.language||"und"),h.add("hdlr").set("handler",c.hdlr||"vide").set("name",c.name||"Track created with MP4Box.js"),h.add("elng").set("extended_language",c.language||"fr-FR");var g=h.add("minf");if(a[c.type+"SampleEntry"]!==void 0){var y=new a[c.type+"SampleEntry"];y.data_reference_index=1;var v="";for(var _ in a.sampleEntryCodes)for(var b=a.sampleEntryCodes[_],x=0;x<b.length;x++)if(b.indexOf(c.type)>-1){v=_;break}switch(v){case"Visual":if(g.add("vmhd").set("graphicsmode",0).set("opcolor",[0,0,0]),y.set("width",c.width).set("height",c.height).set("horizresolution",72<<16).set("vertresolution",72<<16).set("frame_count",1).set("compressorname",c.type+" Compressor").set("depth",24),c.avcDecoderConfigRecord){var w=new a.avcCBox,S=new n(c.avcDecoderConfigRecord);w.parse(S),y.addBox(w)}break;case"Audio":g.add("smhd").set("balance",c.balance||0),y.set("channel_count",c.channel_count||2).set("samplesize",c.samplesize||16).set("samplerate",c.samplerate||65536);break;case"Hint":g.add("hmhd");break;case"Subtitle":switch(g.add("sthd"),c.type){case"stpp":y.set("namespace",c.namespace||"nonamespace").set("schema_location",c.schema_location||"").set("auxiliary_mime_types",c.auxiliary_mime_types||"");break}break;case"Metadata":g.add("nmhd");break;case"System":g.add("nmhd");break;default:g.add("nmhd");break}c.description&&y.addBox(c.description),c.description_boxes&&c.description_boxes.forEach(function(T){y.addBox(T)}),g.add("dinf").add("dref").addEntry(new a["url Box"]().set("flags",1));var C=g.add("stbl");return C.add("stsd").addEntry(y),C.add("stts").set("sample_counts",[]).set("sample_deltas",[]),C.add("stsc").set("first_chunk",[]).set("samples_per_chunk",[]).set("sample_description_index",[]),C.add("stco").set("chunk_offsets",[]),C.add("stsz").set("sample_sizes",[]),this.moov.mvex.add("trex").set("track_id",c.id).set("default_sample_description_index",c.default_sample_description_index||1).set("default_sample_duration",c.default_sample_duration||0).set("default_sample_size",c.default_sample_size||0).set("default_sample_flags",c.default_sample_flags||0),this.buildTrakSampleLists(d),c.id}},a.Box.prototype.computeSize=function(o){var c=o||new i;c.endianness=i.BIG_ENDIAN,this.write(c)},p.prototype.addSample=function(o,c,d){var h=d||{},g={},y=this.getTrackById(o);if(y!==null){g.number=y.samples.length,g.track_id=y.tkhd.track_id,g.timescale=y.mdia.mdhd.timescale,g.description_index=h.sample_description_index?h.sample_description_index-1:0,g.description=y.mdia.minf.stbl.stsd.entries[g.description_index],g.data=c,g.size=c.byteLength,g.alreadyRead=g.size,g.duration=h.duration||1,g.cts=h.cts||0,g.dts=h.dts||0,g.is_sync=h.is_sync||!1,g.is_leading=h.is_leading||0,g.depends_on=h.depends_on||0,g.is_depended_on=h.is_depended_on||0,g.has_redundancy=h.has_redundancy||0,g.degradation_priority=h.degradation_priority||0,g.offset=0,g.subsamples=h.subsamples,y.samples.push(g),y.samples_size+=g.size,y.samples_duration+=g.duration,y.first_dts||(y.first_dts=h.dts),this.processSamples();var v=this.createSingleSampleMoof(g);return this.addBox(v),v.computeSize(),v.trafs[0].truns[0].data_offset=v.size+8,this.add("mdat").data=new Uint8Array(c),g}},p.prototype.createSingleSampleMoof=function(o){var c=0;o.is_sync?c=1<<25:c=65536;var d=new a.moofBox;d.add("mfhd").set("sequence_number",this.nextMoofNumber),this.nextMoofNumber++;var h=d.add("traf"),g=this.getTrackById(o.track_id);return h.add("tfhd").set("track_id",o.track_id).set("flags",a.TFHD_FLAG_DEFAULT_BASE_IS_MOOF),h.add("tfdt").set("baseMediaDecodeTime",o.dts-(g.first_dts||0)),h.add("trun").set("flags",a.TRUN_FLAGS_DATA_OFFSET|a.TRUN_FLAGS_DURATION|a.TRUN_FLAGS_SIZE|a.TRUN_FLAGS_FLAGS|a.TRUN_FLAGS_CTS_OFFSET).set("data_offset",0).set("first_sample_flags",0).set("sample_count",1).set("sample_duration",[o.duration]).set("sample_size",[o.size]).set("sample_flags",[c]).set("sample_composition_time_offset",[o.cts-o.dts]),d},p.prototype.lastMoofIndex=0,p.prototype.samplesDataSize=0,p.prototype.resetTables=function(){var o,c,d,h,g,y,v,_;for(this.initial_duration=this.moov.mvhd.duration,this.moov.mvhd.duration=0,o=0;o<this.moov.traks.length;o++){c=this.moov.traks[o],c.tkhd.duration=0,c.mdia.mdhd.duration=0,d=c.mdia.minf.stbl.stco||c.mdia.minf.stbl.co64,d.chunk_offsets=[],h=c.mdia.minf.stbl.stsc,h.first_chunk=[],h.samples_per_chunk=[],h.sample_description_index=[],g=c.mdia.minf.stbl.stsz||c.mdia.minf.stbl.stz2,g.sample_sizes=[],y=c.mdia.minf.stbl.stts,y.sample_counts=[],y.sample_deltas=[],v=c.mdia.minf.stbl.ctts,v&&(v.sample_counts=[],v.sample_offsets=[]),_=c.mdia.minf.stbl.stss;var b=c.mdia.minf.stbl.boxes.indexOf(_);b!=-1&&(c.mdia.minf.stbl.boxes[b]=null)}},p.initSampleGroups=function(o,c,d,h,g){var y,v,_,b;function x(w,S,C){this.grouping_type=w,this.grouping_type_parameter=S,this.sbgp=C,this.last_sample_in_run=-1,this.entry_index=-1}for(c&&(c.sample_groups_info=[]),o.sample_groups_info||(o.sample_groups_info=[]),v=0;v<d.length;v++){for(b=d[v].grouping_type+"/"+d[v].grouping_type_parameter,_=new x(d[v].grouping_type,d[v].grouping_type_parameter,d[v]),c&&(c.sample_groups_info[b]=_),o.sample_groups_info[b]||(o.sample_groups_info[b]=_),y=0;y<h.length;y++)h[y].grouping_type===d[v].grouping_type&&(_.description=h[y],_.description.used=!0);if(g)for(y=0;y<g.length;y++)g[y].grouping_type===d[v].grouping_type&&(_.fragment_description=g[y],_.fragment_description.used=!0,_.is_fragment=!0)}if(c){if(g)for(v=0;v<g.length;v++)!g[v].used&&g[v].version>=2&&(b=g[v].grouping_type+"/0",_=new x(g[v].grouping_type,0),_.is_fragment=!0,c.sample_groups_info[b]||(c.sample_groups_info[b]=_))}else for(v=0;v<h.length;v++)!h[v].used&&h[v].version>=2&&(b=h[v].grouping_type+"/0",_=new x(h[v].grouping_type,0),o.sample_groups_info[b]||(o.sample_groups_info[b]=_))},p.setSampleGroupProperties=function(o,c,d,h){var g,y;c.sample_groups=[];for(g in h)if(c.sample_groups[g]={},c.sample_groups[g].grouping_type=h[g].grouping_type,c.sample_groups[g].grouping_type_parameter=h[g].grouping_type_parameter,d>=h[g].last_sample_in_run&&(h[g].last_sample_in_run<0&&(h[g].last_sample_in_run=0),h[g].entry_index++,h[g].entry_index<=h[g].sbgp.entries.length-1&&(h[g].last_sample_in_run+=h[g].sbgp.entries[h[g].entry_index].sample_count)),h[g].entry_index<=h[g].sbgp.entries.length-1?c.sample_groups[g].group_description_index=h[g].sbgp.entries[h[g].entry_index].group_description_index:c.sample_groups[g].group_description_index=-1,c.sample_groups[g].group_description_index!==0){var v;h[g].fragment_description?v=h[g].fragment_description:v=h[g].description,c.sample_groups[g].group_description_index>0?(c.sample_groups[g].group_description_index>65535?y=(c.sample_groups[g].group_description_index>>16)-1:y=c.sample_groups[g].group_description_index-1,v&&y>=0&&(c.sample_groups[g].description=v.entries[y])):v&&v.version>=2&&v.default_group_description_index>0&&(c.sample_groups[g].description=v.entries[v.default_group_description_index-1])}},p.process_sdtp=function(o,c,d){c&&(o?(c.is_leading=o.is_leading[d],c.depends_on=o.sample_depends_on[d],c.is_depended_on=o.sample_is_depended_on[d],c.has_redundancy=o.sample_has_redundancy[d]):(c.is_leading=0,c.depends_on=0,c.is_depended_on=0,c.has_redundancy=0))},p.prototype.buildSampleLists=function(){var o,c;for(o=0;o<this.moov.traks.length;o++)c=this.moov.traks[o],this.buildTrakSampleLists(c)},p.prototype.buildTrakSampleLists=function(o){var c,d,h,g,y,v,_,b,x,w,S,C,T,M,B,F,N,W,H,Y,ee,I,z,X;if(o.samples=[],o.samples_duration=0,o.samples_size=0,d=o.mdia.minf.stbl.stco||o.mdia.minf.stbl.co64,h=o.mdia.minf.stbl.stsc,g=o.mdia.minf.stbl.stsz||o.mdia.minf.stbl.stz2,y=o.mdia.minf.stbl.stts,v=o.mdia.minf.stbl.ctts,_=o.mdia.minf.stbl.stss,b=o.mdia.minf.stbl.stsd,x=o.mdia.minf.stbl.subs,C=o.mdia.minf.stbl.stdp,w=o.mdia.minf.stbl.sbgps,S=o.mdia.minf.stbl.sgpds,W=-1,H=-1,Y=-1,ee=-1,I=0,z=0,X=0,p.initSampleGroups(o,null,w,S),!(typeof g>"u")){for(c=0;c<g.sample_sizes.length;c++){var K={};K.number=c,K.track_id=o.tkhd.track_id,K.timescale=o.mdia.mdhd.timescale,K.alreadyRead=0,o.samples[c]=K,K.size=g.sample_sizes[c],o.samples_size+=K.size,c===0?(M=1,T=0,K.chunk_index=M,K.chunk_run_index=T,N=h.samples_per_chunk[T],F=0,T+1<h.first_chunk.length?B=h.first_chunk[T+1]-1:B=1/0):c<N?(K.chunk_index=M,K.chunk_run_index=T):(M++,K.chunk_index=M,F=0,M<=B||(T++,T+1<h.first_chunk.length?B=h.first_chunk[T+1]-1:B=1/0),K.chunk_run_index=T,N+=h.samples_per_chunk[T]),K.description_index=h.sample_description_index[K.chunk_run_index]-1,K.description=b.entries[K.description_index],K.offset=d.chunk_offsets[K.chunk_index-1]+F,F+=K.size,c>W&&(H++,W<0&&(W=0),W+=y.sample_counts[H]),c>0?(o.samples[c-1].duration=y.sample_deltas[H],o.samples_duration+=o.samples[c-1].duration,K.dts=o.samples[c-1].dts+o.samples[c-1].duration):K.dts=0,v?(c>=Y&&(ee++,Y<0&&(Y=0),Y+=v.sample_counts[ee]),K.cts=o.samples[c].dts+v.sample_offsets[ee]):K.cts=K.dts,_?(c==_.sample_numbers[I]-1?(K.is_sync=!0,I++):(K.is_sync=!1,K.degradation_priority=0),x&&x.entries[z].sample_delta+X==c+1&&(K.subsamples=x.entries[z].subsamples,X+=x.entries[z].sample_delta,z++)):K.is_sync=!0,p.process_sdtp(o.mdia.minf.stbl.sdtp,K,K.number),C?K.degradation_priority=C.priority[c]:K.degradation_priority=0,x&&x.entries[z].sample_delta+X==c&&(K.subsamples=x.entries[z].subsamples,X+=x.entries[z].sample_delta),(w.length>0||S.length>0)&&p.setSampleGroupProperties(o,K,c,o.sample_groups_info)}c>0&&(o.samples[c-1].duration=Math.max(o.mdia.mdhd.duration-o.samples[c-1].dts,0),o.samples_duration+=o.samples[c-1].duration)}},p.prototype.updateSampleLists=function(){var o,c,d,h,g,y,v,_,b,x,w,S,C,T,M;if(this.moov!==void 0){for(;this.lastMoofIndex<this.moofs.length;)if(b=this.moofs[this.lastMoofIndex],this.lastMoofIndex++,b.type=="moof")for(x=b,o=0;o<x.trafs.length;o++){for(w=x.trafs[o],S=this.getTrackById(w.tfhd.track_id),C=this.getTrexById(w.tfhd.track_id),w.tfhd.flags&a.TFHD_FLAG_SAMPLE_DESC?h=w.tfhd.default_sample_description_index:h=C?C.default_sample_description_index:1,w.tfhd.flags&a.TFHD_FLAG_SAMPLE_DUR?g=w.tfhd.default_sample_duration:g=C?C.default_sample_duration:0,w.tfhd.flags&a.TFHD_FLAG_SAMPLE_SIZE?y=w.tfhd.default_sample_size:y=C?C.default_sample_size:0,w.tfhd.flags&a.TFHD_FLAG_SAMPLE_FLAGS?v=w.tfhd.default_sample_flags:v=C?C.default_sample_flags:0,w.sample_number=0,w.sbgps.length>0&&p.initSampleGroups(S,w,w.sbgps,S.mdia.minf.stbl.sgpds,w.sgpds),c=0;c<w.truns.length;c++){var B=w.truns[c];for(d=0;d<B.sample_count;d++){T={},T.moof_number=this.lastMoofIndex,T.number_in_traf=w.sample_number,w.sample_number++,T.number=S.samples.length,w.first_sample_index=S.samples.length,S.samples.push(T),T.track_id=S.tkhd.track_id,T.timescale=S.mdia.mdhd.timescale,T.description_index=h-1,T.description=S.mdia.minf.stbl.stsd.entries[T.description_index],T.size=y,B.flags&a.TRUN_FLAGS_SIZE&&(T.size=B.sample_size[d]),S.samples_size+=T.size,T.duration=g,B.flags&a.TRUN_FLAGS_DURATION&&(T.duration=B.sample_duration[d]),S.samples_duration+=T.duration,S.first_traf_merged||d>0?T.dts=S.samples[S.samples.length-2].dts+S.samples[S.samples.length-2].duration:(w.tfdt?T.dts=w.tfdt.baseMediaDecodeTime:T.dts=0,S.first_traf_merged=!0),T.cts=T.dts,B.flags&a.TRUN_FLAGS_CTS_OFFSET&&(T.cts=T.dts+B.sample_composition_time_offset[d]),M=v,B.flags&a.TRUN_FLAGS_FLAGS?M=B.sample_flags[d]:d===0&&B.flags&a.TRUN_FLAGS_FIRST_FLAG&&(M=B.first_sample_flags),T.is_sync=!(M>>16&1),T.is_leading=M>>26&3,T.depends_on=M>>24&3,T.is_depended_on=M>>22&3,T.has_redundancy=M>>20&3,T.degradation_priority=M&65535;var F=!!(w.tfhd.flags&a.TFHD_FLAG_BASE_DATA_OFFSET),N=!!(w.tfhd.flags&a.TFHD_FLAG_DEFAULT_BASE_IS_MOOF),W=!!(B.flags&a.TRUN_FLAGS_DATA_OFFSET),H=0;F?H=w.tfhd.base_data_offset:N||c===0?H=x.start:H=_,c===0&&d===0?W?T.offset=H+B.data_offset:T.offset=H:T.offset=_,_=T.offset+T.size,(w.sbgps.length>0||w.sgpds.length>0||S.mdia.minf.stbl.sbgps.length>0||S.mdia.minf.stbl.sgpds.length>0)&&p.setSampleGroupProperties(S,T,T.number_in_traf,w.sample_groups_info)}}if(w.subs){S.has_fragment_subsamples=!0;var Y=w.first_sample_index;for(c=0;c<w.subs.entries.length;c++)Y+=w.subs.entries[c].sample_delta,T=S.samples[Y-1],T.subsamples=w.subs.entries[c].subsamples}}}},p.prototype.getSample=function(o,c){var d,h=o.samples[c];if(!this.moov)return null;if(!h.data)h.data=new Uint8Array(h.size),h.alreadyRead=0,this.samplesDataSize+=h.size,e.debug("ISOFile","Allocating sample #"+c+" on track #"+o.tkhd.track_id+" of size "+h.size+" (total: "+this.samplesDataSize+")");else if(h.alreadyRead==h.size)return h;for(;;){var g=this.stream.findPosition(!0,h.offset+h.alreadyRead,!1);if(g>-1){d=this.stream.buffers[g];var y=d.byteLength-(h.offset+h.alreadyRead-d.fileStart);if(h.size-h.alreadyRead<=y)return e.debug("ISOFile","Getting sample #"+c+" data (alreadyRead: "+h.alreadyRead+" offset: "+(h.offset+h.alreadyRead-d.fileStart)+" read size: "+(h.size-h.alreadyRead)+" full size: "+h.size+")"),i.memcpy(h.data.buffer,h.alreadyRead,d,h.offset+h.alreadyRead-d.fileStart,h.size-h.alreadyRead),d.usedBytes+=h.size-h.alreadyRead,this.stream.logBufferLevel(),h.alreadyRead=h.size,h;if(y===0)return null;e.debug("ISOFile","Getting sample #"+c+" partial data (alreadyRead: "+h.alreadyRead+" offset: "+(h.offset+h.alreadyRead-d.fileStart)+" read size: "+y+" full size: "+h.size+")"),i.memcpy(h.data.buffer,h.alreadyRead,d,h.offset+h.alreadyRead-d.fileStart,y),h.alreadyRead+=y,d.usedBytes+=y,this.stream.logBufferLevel()}else return null}},p.prototype.releaseSample=function(o,c){var d=o.samples[c];return d.data?(this.samplesDataSize-=d.size,d.data=null,d.alreadyRead=0,d.size):0},p.prototype.getAllocatedSampleDataSize=function(){return this.samplesDataSize},p.prototype.getCodecs=function(){var o,c="";for(o=0;o<this.moov.traks.length;o++){var d=this.moov.traks[o];o>0&&(c+=","),c+=d.mdia.minf.stbl.stsd.entries[0].getCodec()}return c},p.prototype.getTrexById=function(o){var c;if(!this.moov||!this.moov.mvex)return null;for(c=0;c<this.moov.mvex.trexs.length;c++){var d=this.moov.mvex.trexs[c];if(d.track_id==o)return d}return null},p.prototype.getTrackById=function(o){if(this.moov===void 0)return null;for(var c=0;c<this.moov.traks.length;c++){var d=this.moov.traks[c];if(d.tkhd.track_id==o)return d}return null},p.prototype.items=[],p.prototype.itemsDataSize=0,p.prototype.flattenItemInfo=function(){var o=this.items,c,d,h,g=this.meta;if(g!=null&&g.hdlr!==void 0&&g.iinf!==void 0){for(c=0;c<g.iinf.item_infos.length;c++)h={},h.id=g.iinf.item_infos[c].item_ID,o[h.id]=h,h.ref_to=[],h.name=g.iinf.item_infos[c].item_name,g.iinf.item_infos[c].protection_index>0&&(h.protection=g.ipro.protections[g.iinf.item_infos[c].protection_index-1]),g.iinf.item_infos[c].item_type?h.type=g.iinf.item_infos[c].item_type:h.type="mime",h.content_type=g.iinf.item_infos[c].content_type,h.content_encoding=g.iinf.item_infos[c].content_encoding;if(g.iloc)for(c=0;c<g.iloc.items.length;c++){var y=g.iloc.items[c];switch(h=o[y.item_ID],y.data_reference_index!==0&&(e.warn("Item storage with reference to other files: not supported"),h.source=g.dinf.boxes[y.data_reference_index-1]),y.construction_method){case 0:break;case 1:e.warn("Item storage with construction_method : not supported");break;case 2:e.warn("Item storage with construction_method : not supported");break}for(h.extents=[],h.size=0,d=0;d<y.extents.length;d++)h.extents[d]={},h.extents[d].offset=y.extents[d].extent_offset+y.base_offset,h.extents[d].length=y.extents[d].extent_length,h.extents[d].alreadyRead=0,h.size+=h.extents[d].length}if(g.pitm&&(o[g.pitm.item_id].primary=!0),g.iref)for(c=0;c<g.iref.references.length;c++){var v=g.iref.references[c];for(d=0;d<v.references.length;d++)o[v.from_item_ID].ref_to.push({type:v.type,id:v.references[d]})}if(g.iprp)for(var _=0;_<g.iprp.ipmas.length;_++){var b=g.iprp.ipmas[_];for(c=0;c<b.associations.length;c++){var x=b.associations[c];for(h=o[x.id],h.properties===void 0&&(h.properties={},h.properties.boxes=[]),d=0;d<x.props.length;d++){var w=x.props[d];if(w.property_index>0&&w.property_index-1<g.iprp.ipco.boxes.length){var S=g.iprp.ipco.boxes[w.property_index-1];h.properties[S.type]=S,h.properties.boxes.push(S)}}}}}},p.prototype.getItem=function(o){var c,d;if(!this.meta)return null;if(d=this.items[o],!d.data&&d.size)d.data=new Uint8Array(d.size),d.alreadyRead=0,this.itemsDataSize+=d.size,e.debug("ISOFile","Allocating item #"+o+" of size "+d.size+" (total: "+this.itemsDataSize+")");else if(d.alreadyRead===d.size)return d;for(var h=0;h<d.extents.length;h++){var g=d.extents[h];if(g.alreadyRead!==g.length){var y=this.stream.findPosition(!0,g.offset+g.alreadyRead,!1);if(y>-1){c=this.stream.buffers[y];var v=c.byteLength-(g.offset+g.alreadyRead-c.fileStart);if(g.length-g.alreadyRead<=v)e.debug("ISOFile","Getting item #"+o+" extent #"+h+" data (alreadyRead: "+g.alreadyRead+" offset: "+(g.offset+g.alreadyRead-c.fileStart)+" read size: "+(g.length-g.alreadyRead)+" full extent size: "+g.length+" full item size: "+d.size+")"),i.memcpy(d.data.buffer,d.alreadyRead,c,g.offset+g.alreadyRead-c.fileStart,g.length-g.alreadyRead),c.usedBytes+=g.length-g.alreadyRead,this.stream.logBufferLevel(),d.alreadyRead+=g.length-g.alreadyRead,g.alreadyRead=g.length;else return e.debug("ISOFile","Getting item #"+o+" extent #"+h+" partial data (alreadyRead: "+g.alreadyRead+" offset: "+(g.offset+g.alreadyRead-c.fileStart)+" read size: "+v+" full extent size: "+g.length+" full item size: "+d.size+")"),i.memcpy(d.data.buffer,d.alreadyRead,c,g.offset+g.alreadyRead-c.fileStart,v),g.alreadyRead+=v,d.alreadyRead+=v,c.usedBytes+=v,this.stream.logBufferLevel(),null}else return null}}return d.alreadyRead===d.size?d:null},p.prototype.releaseItem=function(o){var c=this.items[o];if(c.data){this.itemsDataSize-=c.size,c.data=null,c.alreadyRead=0;for(var d=0;d<c.extents.length;d++){var h=c.extents[d];h.alreadyRead=0}return c.size}else return 0},p.prototype.processItems=function(o){for(var c in this.items){var d=this.items[c];this.getItem(d.id),o&&!d.sent&&(o(d),d.sent=!0,d.data=null)}},p.prototype.hasItem=function(o){for(var c in this.items){var d=this.items[c];if(d.name===o)return d.id}return-1},p.prototype.getMetaHandler=function(){return this.meta?this.meta.hdlr.handler:null},p.prototype.getPrimaryItem=function(){return!this.meta||!this.meta.pitm?null:this.getItem(this.meta.pitm.item_id)},p.prototype.itemToFragmentedTrackFile=function(o){var c=o||{},d=null;if(c.itemId?d=this.getItem(c.itemId):d=this.getPrimaryItem(),d==null)return null;var h=new p;h.discardMdatData=!1;var g={type:d.type,description_boxes:d.properties.boxes};d.properties.ispe&&(g.width=d.properties.ispe.image_width,g.height=d.properties.ispe.image_height);var y=h.addTrack(g);return y?(h.addSample(y,d.data),h):null},p.prototype.write=function(o){for(var c=0;c<this.boxes.length;c++)this.boxes[c].write(o)},p.prototype.createFragment=function(o,c,d){var h=this.getTrackById(o),g=this.getSample(h,c);if(g==null)return g=h.samples[c],this.nextSeekPosition?this.nextSeekPosition=Math.min(g.offset+g.alreadyRead,this.nextSeekPosition):this.nextSeekPosition=h.samples[c].offset+g.alreadyRead,null;var y=d||new i;y.endianness=i.BIG_ENDIAN;var v=this.createSingleSampleMoof(g);v.write(y),v.trafs[0].truns[0].data_offset=v.size+8,e.debug("MP4Box","Adjusting data_offset with new value "+v.trafs[0].truns[0].data_offset),y.adjustUint32(v.trafs[0].truns[0].data_offset_position,v.trafs[0].truns[0].data_offset);var _=new a.mdatBox;return _.data=g.data,_.write(y),y},p.writeInitializationSegment=function(o,c,d,h){var g;e.debug("ISOFile","Generating initialization segment");var y=new i;y.endianness=i.BIG_ENDIAN,o.write(y);var v=c.add("mvex");for(d&&v.add("mehd").set("fragment_duration",d),g=0;g<c.traks.length;g++)v.add("trex").set("track_id",c.traks[g].tkhd.track_id).set("default_sample_description_index",1).set("default_sample_duration",h).set("default_sample_size",0).set("default_sample_flags",65536);return c.write(y),y.buffer},p.prototype.save=function(o){var c=new i;c.endianness=i.BIG_ENDIAN,this.write(c),c.save(o)},p.prototype.getBuffer=function(){var o=new i;return o.endianness=i.BIG_ENDIAN,this.write(o),o.buffer},p.prototype.initializeSegmentation=function(){var o,c,d,h;for(this.onSegment===null&&e.warn("MP4Box","No segmentation callback set!"),this.isFragmentationInitialized||(this.isFragmentationInitialized=!0,this.nextMoofNumber=0,this.resetTables()),c=[],o=0;o<this.fragmentedTracks.length;o++){var g=new a.moovBox;g.mvhd=this.moov.mvhd,g.boxes.push(g.mvhd),d=this.getTrackById(this.fragmentedTracks[o].id),g.boxes.push(d),g.traks.push(d),h={},h.id=d.tkhd.track_id,h.user=this.fragmentedTracks[o].user,h.buffer=p.writeInitializationSegment(this.ftyp,g,this.moov.mvex&&this.moov.mvex.mehd?this.moov.mvex.mehd.fragment_duration:void 0,this.moov.traks[o].samples.length>0?this.moov.traks[o].samples[0].duration:0),c.push(h)}return c},a.Box.prototype.printHeader=function(o){this.size+=8,this.size>r&&(this.size+=8),this.type==="uuid"&&(this.size+=16),o.log(o.indent+"size:"+this.size),o.log(o.indent+"type:"+this.type)},a.FullBox.prototype.printHeader=function(o){this.size+=4,a.Box.prototype.printHeader.call(this,o),o.log(o.indent+"version:"+this.version),o.log(o.indent+"flags:"+this.flags)},a.Box.prototype.print=function(o){this.printHeader(o)},a.ContainerBox.prototype.print=function(o){this.printHeader(o);for(var c=0;c<this.boxes.length;c++)if(this.boxes[c]){var d=o.indent;o.indent+=" ",this.boxes[c].print(o),o.indent=d}},p.prototype.print=function(o){o.indent="";for(var c=0;c<this.boxes.length;c++)this.boxes[c]&&this.boxes[c].print(o)},a.mvhdBox.prototype.print=function(o){a.FullBox.prototype.printHeader.call(this,o),o.log(o.indent+"creation_time: "+this.creation_time),o.log(o.indent+"modification_time: "+this.modification_time),o.log(o.indent+"timescale: "+this.timescale),o.log(o.indent+"duration: "+this.duration),o.log(o.indent+"rate: "+this.rate),o.log(o.indent+"volume: "+(this.volume>>8)),o.log(o.indent+"matrix: "+this.matrix.join(", ")),o.log(o.indent+"next_track_id: "+this.next_track_id)},a.tkhdBox.prototype.print=function(o){a.FullBox.prototype.printHeader.call(this,o),o.log(o.indent+"creation_time: "+this.creation_time),o.log(o.indent+"modification_time: "+this.modification_time),o.log(o.indent+"track_id: "+this.track_id),o.log(o.indent+"duration: "+this.duration),o.log(o.indent+"volume: "+(this.volume>>8)),o.log(o.indent+"matrix: "+this.matrix.join(", ")),o.log(o.indent+"layer: "+this.layer),o.log(o.indent+"alternate_group: "+this.alternate_group),o.log(o.indent+"width: "+this.width),o.log(o.indent+"height: "+this.height)};var m={};m.createFile=function(o,c){var d=o!==void 0?o:!0,h=new p(c);return h.discardMdatData=!d,h},t.createFile=m.createFile})(EE);const jb="osra-message",ty=t=>!!(globalThis.SharedArrayBuffer&&t instanceof globalThis.SharedArrayBuffer),ny=t=>globalThis.ArrayBuffer&&t instanceof globalThis.ArrayBuffer||globalThis.MessagePort&&t instanceof globalThis.MessagePort||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream||globalThis.WritableStream&&t instanceof globalThis.WritableStream||globalThis.TransformStream&&t instanceof globalThis.TransformStream?!0:!!(globalThis.ImageBitmap&&t instanceof globalThis.ImageBitmap),iy=t=>{const e=[],n=i=>ty(i)?void 0:ny(i)?e.push(i):Array.isArray(i)?i.map(n):i&&typeof i=="object"?Object.values(i).map(n):void 0;return n(t),e},Hg="__proxyFunctionPort__",ez=t=>{const{port1:e,port2:n}=new MessageChannel;return e.addEventListener("message",async i=>{try{const r=await t(...i.data),s=Wo(r),l=iy(s);e.postMessage({result:s},{transfer:l})}catch(r){e.postMessage({error:r})}}),e.start(),n},Wo=t=>ty(t)||ny(t)?t:typeof t=="function"?{[Hg]:ez(t)}:Array.isArray(t)?t.map(Wo):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,Wo(n)])):t,tz=t=>(...e)=>new Promise((n,i)=>{const r=Wo(e),s=iy(r),l=a=>{a.data.error?i(a.data.error):n(ry(a.data.result)),t.removeEventListener("message",l)};t.addEventListener("message",l),t.start(),t.postMessage(r,{transfer:s})}),ry=t=>ty(t)||ny(t)?t:t&&typeof t=="object"&&t[Hg]?tz(t[Hg]):Array.isArray(t)?t.map(Wo):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,ry(n)])):t,nz=(t,{key:e=jb}={key:jb})=>(n,i)=>new Promise((r,s)=>{const{port1:l,port2:a}=new MessageChannel;l.addEventListener("message",({data:p})=>{if(p.error)s(p.error);else{const m=ry(p.result);r(m)}l.close(),a.close()},{once:!0}),l.start();const u=Wo(i),f=iy(u);t.postMessage({source:e,type:n,data:u,port:a},{targetOrigin:"*",transfer:[a,...f??[]]})});var Wg={},iz={get exports(){return Wg},set exports(t){Wg=t}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function r(u,f,p){this.fn=u,this.context=f,this.once=p||!1}function s(u,f,p,m,o){if(typeof p!="function")throw new TypeError("The listener must be a function");var c=new r(p,m||u,o),d=n?n+f:f;return u._events[d]?u._events[d].fn?u._events[d]=[u._events[d],c]:u._events[d].push(c):(u._events[d]=c,u._eventsCount++),u}function l(u,f){--u._eventsCount===0?u._events=new i:delete u._events[f]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var f=[],p,m;if(this._eventsCount===0)return f;for(m in p=this._events)e.call(p,m)&&f.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},a.prototype.listeners=function(f){var p=n?n+f:f,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var o=0,c=m.length,d=new Array(c);o<c;o++)d[o]=m[o].fn;return d},a.prototype.listenerCount=function(f){var p=n?n+f:f,m=this._events[p];return m?m.fn?1:m.length:0},a.prototype.emit=function(f,p,m,o,c,d){var h=n?n+f:f;if(!this._events[h])return!1;var g=this._events[h],y=arguments.length,v,_;if(g.fn){switch(g.once&&this.removeListener(f,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,p),!0;case 3:return g.fn.call(g.context,p,m),!0;case 4:return g.fn.call(g.context,p,m,o),!0;case 5:return g.fn.call(g.context,p,m,o,c),!0;case 6:return g.fn.call(g.context,p,m,o,c,d),!0}for(_=1,v=new Array(y-1);_<y;_++)v[_-1]=arguments[_];g.fn.apply(g.context,v)}else{var b=g.length,x;for(_=0;_<b;_++)switch(g[_].once&&this.removeListener(f,g[_].fn,void 0,!0),y){case 1:g[_].fn.call(g[_].context);break;case 2:g[_].fn.call(g[_].context,p);break;case 3:g[_].fn.call(g[_].context,p,m);break;case 4:g[_].fn.call(g[_].context,p,m,o);break;default:if(!v)for(x=1,v=new Array(y-1);x<y;x++)v[x-1]=arguments[x];g[_].fn.apply(g[_].context,v)}}return!0},a.prototype.on=function(f,p,m){return s(this,f,p,m,!1)},a.prototype.once=function(f,p,m){return s(this,f,p,m,!0)},a.prototype.removeListener=function(f,p,m,o){var c=n?n+f:f;if(!this._events[c])return this;if(!p)return l(this,c),this;var d=this._events[c];if(d.fn)d.fn===p&&(!o||d.once)&&(!m||d.context===m)&&l(this,c);else{for(var h=0,g=[],y=d.length;h<y;h++)(d[h].fn!==p||o&&!d[h].once||m&&d[h].context!==m)&&g.push(d[h]);g.length?this._events[c]=g.length===1?g[0]:g:l(this,c)}return this},a.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&l(this,p)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(iz);const rz=Wg;let CE=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},sz=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}};const $b=t=>globalThis.DOMException===void 0?new sz(t):new DOMException(t),Vb=t=>{const e=t.reason===void 0?$b("This operation was aborted."):t.reason;return e instanceof Error?e:$b(e)};function oz(t,e,n,i){let r;const s=new Promise((l,a)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e===Number.POSITIVE_INFINITY){l(t);return}if(i={customTimers:{setTimeout,clearTimeout},...i},i.signal){const{signal:u}=i;u.aborted&&a(Vb(u)),u.addEventListener("abort",()=>{a(Vb(u))})}r=i.customTimers.setTimeout.call(void 0,()=>{if(typeof n=="function"){try{l(n())}catch(p){a(p)}return}const u=typeof n=="string"?n:`Promise timed out after ${e} milliseconds`,f=n instanceof Error?n:new CE(u);typeof t.cancel=="function"&&t.cancel(),a(f)},e),(async()=>{try{l(await t)}catch(u){a(u)}finally{i.customTimers.clearTimeout.call(void 0,r)}})()});return s.clear=()=>{clearTimeout(r),r=void 0},s}function az(t,e,n){let i=0,r=t.length;for(;r>0;){const s=Math.trunc(r/2);let l=i+s;n(t[l],e)<=0?(i=++l,r-=s+1):r=s}return i}var hs=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)},Qi;let lz=class{constructor(){Qi.set(this,[])}enqueue(e,n){n={priority:0,...n};const i={priority:n.priority,run:e};if(this.size&&hs(this,Qi,"f")[this.size-1].priority>=n.priority){hs(this,Qi,"f").push(i);return}const r=az(hs(this,Qi,"f"),i,(s,l)=>l.priority-s.priority);hs(this,Qi,"f").splice(r,0,i)}dequeue(){const e=hs(this,Qi,"f").shift();return e?.run}filter(e){return hs(this,Qi,"f").filter(n=>n.priority===e.priority).map(n=>n.run)}get size(){return hs(this,Qi,"f").length}};Qi=new WeakMap;var ut=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(t,n):r?r.value=n:e.set(t,n),n},le=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)},St,tl,nl,Lr,Td,il,gu,ai,Ua,On,mu,Dn,rl,Er,vu,Hb,Wb,TE,Gb,Yb,Kb,yu,Lh,Mh,Pd,_u;const cz=new CE;let uz=class extends Error{},Qb=class extends rz{constructor(e){var n,i,r,s;if(super(),St.add(this),tl.set(this,void 0),nl.set(this,void 0),Lr.set(this,0),Td.set(this,void 0),il.set(this,void 0),gu.set(this,0),ai.set(this,void 0),Ua.set(this,void 0),On.set(this,void 0),mu.set(this,void 0),Dn.set(this,0),rl.set(this,void 0),Er.set(this,void 0),vu.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:lz,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(i=(n=e.intervalCap)===null||n===void 0?void 0:n.toString())!==null&&i!==void 0?i:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(s=(r=e.interval)===null||r===void 0?void 0:r.toString())!==null&&s!==void 0?s:""}\` (${typeof e.interval})`);ut(this,tl,e.carryoverConcurrencyCount,"f"),ut(this,nl,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),ut(this,Td,e.intervalCap,"f"),ut(this,il,e.interval,"f"),ut(this,On,new e.queueClass,"f"),ut(this,mu,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,ut(this,vu,e.throwOnTimeout===!0,"f"),ut(this,Er,e.autoStart===!1,"f")}get concurrency(){return le(this,rl,"f")}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);ut(this,rl,e,"f"),le(this,St,"m",Pd).call(this)}async add(e,n={}){return new Promise((i,r)=>{const s=async()=>{var l,a,u;ut(this,Dn,(a=le(this,Dn,"f"),a++,a),"f"),ut(this,Lr,(u=le(this,Lr,"f"),u++,u),"f");try{if(!((l=n.signal)===null||l===void 0)&&l.aborted){r(new uz("The task was aborted."));return}const p=await (this.timeout===void 0&&n.timeout===void 0?e({signal:n.signal}):oz(Promise.resolve(e({signal:n.signal})),n.timeout===void 0?this.timeout:n.timeout,()=>{(n.throwOnTimeout===void 0?le(this,vu,"f"):n.throwOnTimeout)&&r(cz)}));i(p),this.emit("completed",p)}catch(f){r(f),this.emit("error",f)}le(this,St,"m",TE).call(this)};le(this,On,"f").enqueue(s,n),le(this,St,"m",yu).call(this),this.emit("add")})}async addAll(e,n){return Promise.all(e.map(async i=>this.add(i,n)))}start(){return le(this,Er,"f")?(ut(this,Er,!1,"f"),le(this,St,"m",Pd).call(this),this):this}pause(){ut(this,Er,!0,"f")}clear(){ut(this,On,new(le(this,mu,"f")),"f")}async onEmpty(){le(this,On,"f").size!==0&&await le(this,St,"m",_u).call(this,"empty")}async onSizeLessThan(e){le(this,On,"f").size<e||await le(this,St,"m",_u).call(this,"next",()=>le(this,On,"f").size<e)}async onIdle(){le(this,Dn,"f")===0&&le(this,On,"f").size===0||await le(this,St,"m",_u).call(this,"idle")}get size(){return le(this,On,"f").size}sizeBy(e){return le(this,On,"f").filter(e).length}get pending(){return le(this,Dn,"f")}get isPaused(){return le(this,Er,"f")}};tl=new WeakMap,nl=new WeakMap,Lr=new WeakMap,Td=new WeakMap,il=new WeakMap,gu=new WeakMap,ai=new WeakMap,Ua=new WeakMap,On=new WeakMap,mu=new WeakMap,Dn=new WeakMap,rl=new WeakMap,Er=new WeakMap,vu=new WeakMap,St=new WeakSet,Hb=function(){return le(this,nl,"f")||le(this,Lr,"f")<le(this,Td,"f")},Wb=function(){return le(this,Dn,"f")<le(this,rl,"f")},TE=function(){var e;ut(this,Dn,(e=le(this,Dn,"f"),e--,e),"f"),le(this,St,"m",yu).call(this),this.emit("next")},Gb=function(){this.emit("empty"),le(this,Dn,"f")===0&&this.emit("idle")},Yb=function(){le(this,St,"m",Mh).call(this),le(this,St,"m",Lh).call(this),ut(this,Ua,void 0,"f")},Kb=function(){const e=Date.now();if(le(this,ai,"f")===void 0){const n=le(this,gu,"f")-e;if(n<0)ut(this,Lr,le(this,tl,"f")?le(this,Dn,"f"):0,"f");else return le(this,Ua,"f")===void 0&&ut(this,Ua,setTimeout(()=>{le(this,St,"m",Yb).call(this)},n),"f"),!0}return!1},yu=function(){if(le(this,On,"f").size===0)return le(this,ai,"f")&&clearInterval(le(this,ai,"f")),ut(this,ai,void 0,"f"),le(this,St,"m",Gb).call(this),!1;if(!le(this,Er,"f")){const e=!le(this,St,"a",Kb);if(le(this,St,"a",Hb)&&le(this,St,"a",Wb)){const n=le(this,On,"f").dequeue();return n?(this.emit("active"),n(),e&&le(this,St,"m",Lh).call(this),!0):!1}}return!1},Lh=function(){le(this,nl,"f")||le(this,ai,"f")!==void 0||(ut(this,ai,setInterval(()=>{le(this,St,"m",Mh).call(this)},le(this,il,"f")),"f"),ut(this,gu,Date.now()+le(this,il,"f"),"f"))},Mh=function(){le(this,Lr,"f")===0&&le(this,Dn,"f")===0&&le(this,ai,"f")&&(clearInterval(le(this,ai,"f")),ut(this,ai,void 0,"f")),ut(this,Lr,le(this,tl,"f")?le(this,Dn,"f"):0,"f"),le(this,St,"m",Pd).call(this)},Pd=function(){for(;le(this,St,"m",yu).call(this););},_u=async function(e,n){return new Promise(i=>{const r=()=>{n&&!n()||(this.off(e,r),i())};this.on(e,r)})};var PE=(t=>(t[t.NONE=0]="NONE",t[t.AVSEEK_FLAG_BACKWARD=1]="AVSEEK_FLAG_BACKWARD",t[t.AVSEEK_FLAG_BYTE=2]="AVSEEK_FLAG_BYTE",t[t.AVSEEK_FLAG_ANY=4]="AVSEEK_FLAG_ANY",t[t.AVSEEK_FLAG_FRAME=8]="AVSEEK_FLAG_FRAME",t))(PE||{}),Fa=(t=>(t[t.SEEK_SET=0]="SEEK_SET",t[t.SEEK_CUR=1]="SEEK_CUR",t[t.SEEK_END=2]="SEEK_END",t[t.AVSEEK_SIZE=65536]="AVSEEK_SIZE",t))(Fa||{});const Zb=t=>new Date(t).toISOString().slice(11,22).replace(/^00/,"0"),dz=async({publicPath:t,workerUrl:e,workerOptions:n,read:i,seek:r,write:s,attachment:l,subtitle:a,length:u,bufferSize:f=1e6})=>{const p=new Worker(e,n);await new Promise((N,W)=>{const H=Y=>{Y.data==="init"&&(N(void 0),p.removeEventListener("message",H))};p.addEventListener("message",H),setTimeout(W,3e4)});const m=nz(p),o=new Qb,c=N=>o.add(N),d=new Map,{init:h,destroy:g,process:y,seek:v,getInfo:_}=await m("init",{publicPath:t,length:u,bufferSize:f,subtitle:async(N,W,H,...Y)=>{if(W){const[Be,Le]=Y,vt={streamIndex:N,header:H,language:Be,title:Le,dialogues:[]};d.set(N,vt),a(vt.title,vt.language,`${vt.header.trim()}
762
+ `);return}const ee=d.get(N);if(ee?.dialogues.some(({data:Be})=>Be===H))return;if(!ee)throw new Error("Subtitle data was received but no instance was found.");const[I,z]=Y,[X,K]=H.split(","),be=Zb(I),Ke=Zb(z),ue=H.replace(`${X},${K},`,""),fe={...ee,dialogues:[...ee?.dialogues??[],{index:Number(X),startTime:I,endTime:z,data:H,layerIndex:Number(K),dialogue:`Dialogue: ${K},${be},${Ke},${ue}`}].sort((Be,Le)=>Be.index-Le.index)};d.set(N,fe);const ke=`${ee.header.trim()}
763
+ ${fe.dialogues.map(({dialogue:Be})=>Be).join(`
764
+ `).trim()}`;a(ee.title,ee.language,ke)},attachment:async(N,W,H)=>l(N,W,H),read:(N,W)=>i(N,W),seek:(N,W,H)=>r(N,W,H),write:async({isHeader:N,offset:W,arrayBuffer:H,position:Y,pts:ee,duration:I})=>{const z={isHeader:N,offset:W,buffer:new Uint8Array(H),pts:ee,duration:I,pos:Y};N||B.push(z),await s(z)}}),b=new Qb({concurrency:1}),x=N=>(...W)=>b.add(()=>N(...W)),w=x(h),S=x(g),C=x(y),T=x(v),M=x(_);let B=[];return{init:()=>c(async()=>{B=[],await w()}),destroy:(N=!1)=>{if(N){p.terminate();return}return c(()=>S())},process:N=>c(async()=>{B=[],await C(N);const W=B;return B=[],W}),seek:N=>c(async()=>{B=[],await T(Math.max(0,N)*1e3,PE.NONE)}),getInfo:()=>M()}};typeof HTMLVideoElement<"u"&&!("requestVideoFrameCallback"in HTMLVideoElement.prototype)&&"getVideoPlaybackQuality"in HTMLVideoElement.prototype&&(HTMLVideoElement.prototype._rvfcpolyfillmap={},HTMLVideoElement.prototype.requestVideoFrameCallback=function(t){const e=performance.now(),n=this.getVideoPlaybackQuality(),i=this.mozPresentedFrames||this.mozPaintedFrames||n.totalVideoFrames-n.droppedVideoFrames,r=(s,l)=>{const a=this.getVideoPlaybackQuality(),u=this.mozPresentedFrames||this.mozPaintedFrames||a.totalVideoFrames-a.droppedVideoFrames;if(u>i){const f=this.mozFrameDelay||a.totalFrameDelay-n.totalFrameDelay||0,p=l-s;t(l,{presentationTime:l+f*1e3,expectedDisplayTime:l+p,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+p/1e3,presentedFrames:u,processingDuration:f}),delete this._rvfcpolyfillmap[e]}else this._rvfcpolyfillmap[e]=requestAnimationFrame(f=>r(l,f))};return this._rvfcpolyfillmap[e]=requestAnimationFrame(s=>r(e,s)),e},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(t){cancelAnimationFrame(this._rvfcpolyfillmap[t]),delete this._rvfcpolyfillmap[t]});const fz={bt709:"BT709",bt470bg:"BT601",smpte170m:"BT601"},hz={BT601:{BT709:"1.0863 -0.0723 -0.014 0 0 0.0965 0.8451 0.0584 0 0 -0.0141 -0.0277 1.0418"},BT709:{BT601:"0.9137 0.0784 0.0079 0 0 -0.1049 1.1722 -0.0671 0 0 0.0096 0.0322 0.9582"},FCC:{BT709:"1.0873 -0.0736 -0.0137 0 0 0.0974 0.8494 0.0531 0 0 -0.0127 -0.0251 1.0378",BT601:"1.001 -0.0008 -0.0002 0 0 0.0009 1.005 -0.006 0 0 0.0013 0.0027 0.996"},SMPTE240M:{BT709:"0.9993 0.0006 0.0001 0 0 -0.0004 0.9812 0.0192 0 0 -0.0034 -0.0114 1.0148",BT601:"0.913 0.0774 0.0096 0 0 -0.1051 1.1508 -0.0456 0 0 0.0063 0.0207 0.973"}};class mn extends EventTarget{constructor(e){if(super(),!globalThis.Worker)throw this.destroy("Worker not supported");if(!e)throw this.destroy("No options provided");this._loaded=new Promise(i=>{this._init=i});const n=mn._test();if(this._onDemandRender="requestVideoFrameCallback"in HTMLVideoElement.prototype&&(e.onDemandRender??!0),this._offscreenRender="transferControlToOffscreen"in HTMLCanvasElement.prototype&&!e.canvas&&(e.offscreenRender??!0),this.timeOffset=e.timeOffset||0,this._video=e.video,this._videoHeight=0,this._videoWidth=0,this._videoColorSpace=null,this._canvas=e.canvas,this._video&&!this._canvas)this._canvasParent=document.createElement("div"),this._canvasParent.className="JASSUB",this._canvasParent.style.position="relative",this._canvas=this._createCanvas(),this._video.insertAdjacentElement("afterend",this._canvasParent);else if(!this._canvas)throw this.destroy("Don't know where to render: you should give video or canvas in options.");if(this._bufferCanvas=document.createElement("canvas"),this._bufferCtx=this._bufferCanvas.getContext("2d"),!this._bufferCtx)throw this.destroy("Canvas rendering not supported");this._canvasctrl=this._offscreenRender?this._canvas.transferControlToOffscreen():this._canvas,this._ctx=!this._offscreenRender&&this._canvasctrl.getContext("2d"),this._lastRenderTime=0,this.debug=!!e.debug,this.prescaleFactor=e.prescaleFactor||1,this.prescaleHeightLimit=e.prescaleHeightLimit||1080,this.maxRenderHeight=e.maxRenderHeight||0,this._boundResize=this.resize.bind(this),this._boundTimeUpdate=this._timeupdate.bind(this),this._boundSetRate=this.setRate.bind(this),this._boundUpdateColorSpace=this._updateColorSpace.bind(this),this._video&&this.setVideo(e.video),this._onDemandRender&&(this.busy=!1,this._lastDemandTime=null),this._worker=new Worker(e.workerUrl||"jassub-worker.js"),this._worker.onmessage=i=>this._onmessage(i),this._worker.onerror=i=>this._error(i),n.then(()=>{this._worker.postMessage({target:"init",wasmUrl:mn._supportsSIMD&&e.modernWasmUrl?e.modernWasmUrl:e.wasmUrl||"jassub-worker.wasm",legacyWasmUrl:e.legacyWasmUrl||"jassub-worker.wasm.js",asyncRender:typeof createImageBitmap<"u"&&(e.asyncRender??!0),onDemandRender:this._onDemandRender,width:this._canvasctrl.width||0,height:this._canvasctrl.height||0,blendMode:e.blendMode||"js",subUrl:e.subUrl,subContent:e.subContent||null,fonts:e.fonts||[],availableFonts:e.availableFonts||{"liberation sans":"./default.woff2"},fallbackFont:e.fallbackFont||"liberation sans",debug:this.debug,targetFps:e.targetFps||24,dropAllAnimations:e.dropAllAnimations,dropAllBlur:e.dropAllBlur,libassMemoryLimit:e.libassMemoryLimit||0,libassGlyphLimit:e.libassGlyphLimit||0,useLocalFonts:typeof queryLocalFonts<"u"&&(e.useLocalFonts??!0),hasBitmapBug:mn._hasBitmapBug}),this._offscreenRender===!0&&this.sendMessage("offscreenCanvas",null,[this._canvasctrl])})}_createCanvas(){return this._canvas=document.createElement("canvas"),this._canvas.style.display="block",this._canvas.style.position="absolute",this._canvas.style.pointerEvents="none",this._canvasParent.appendChild(this._canvas),this._canvas}static _supportsSIMD=null;static _hasAlphaBug=null;static _hasBitmapBug=null;static async _test(){if(mn._hasBitmapBug!==null)return null;try{mn._supportsSIMD=WebAssembly.validate(Uint8Array.of(0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11))}catch{mn._supportsSIMD=!1}const e=document.createElement("canvas"),n=e.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("Canvas rendering not supported");if(typeof ImageData.prototype.constructor=="function")try{new ImageData(new Uint8ClampedArray([0,0,0,0]),1,1)}catch{console.log("Detected that ImageData is not constructable despite browser saying so"),self.ImageData=function(u,f,p){const m=n.createImageData(f,p);return u&&m.data.set(u),m}}const i=document.createElement("canvas"),r=i.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("Canvas rendering not supported");e.width=i.width=1,e.height=i.height=1,n.clearRect(0,0,1,1),r.clearRect(0,0,1,1);const s=r.getImageData(0,0,1,1).data;n.putImageData(new ImageData(new Uint8ClampedArray([0,255,0,0]),1,1),0,0),r.drawImage(e,0,0);const l=r.getImageData(0,0,1,1).data;if(mn._hasAlphaBug=s[1]!==l[1],mn._hasAlphaBug&&console.log("Detected a browser having issue with transparent pixels, applying workaround"),typeof createImageBitmap<"u"){const a=new Uint8ClampedArray([255,0,255,0,255]).subarray(1,5);r.drawImage(await createImageBitmap(new ImageData(a,1)),0,0);const{data:u}=r.getImageData(0,0,1,1);mn._hasBitmapBug=!1;for(const[f,p]of u.entries())if(Math.abs(a[f]-p)>15){mn._hasBitmapBug=!0,console.log("Detected a browser having issue with partial bitmaps, applying workaround");break}}else mn._hasBitmapBug=!1;e.remove(),i.remove()}resize(e=0,n=0,i=0,r=0,s=this._video?.paused){if((!e||!n)&&this._video){const l=this._getVideoPosition();let a=null;if(this._videoWidth){const u=this._video.videoWidth/this._videoWidth,f=this._video.videoHeight/this._videoHeight;a=this._computeCanvasSize((l.width||0)/u,(l.height||0)/f)}else a=this._computeCanvasSize(l.width||0,l.height||0);e=a.width,n=a.height,this._canvasParent&&(i=l.y-(this._canvasParent.getBoundingClientRect().top-this._video.getBoundingClientRect().top),r=l.x),this._canvas.style.width=l.width+"px",this._canvas.style.height=l.height+"px"}this._canvas.style.top=i+"px",this._canvas.style.left=r+"px",s&&this.busy===!1?this.busy=!0:s=!1,this.sendMessage("canvas",{width:e,height:n,force:s})}_getVideoPosition(e=this._video.videoWidth,n=this._video.videoHeight){const i=e/n,{offsetWidth:r,offsetHeight:s}=this._video,l=r/s;e=r,n=s,l>i?e=Math.floor(s*i):n=Math.floor(r/i);const a=(r-e)/2,u=(s-n)/2;return{width:e,height:n,x:a,y:u}}_computeCanvasSize(e=0,n=0){const i=this.prescaleFactor<=0?1:this.prescaleFactor,r=self.devicePixelRatio||1;if(e=e*r,n=n*r,n<=0||e<=0)e=0,n=0;else{const s=i<1?-1:1;let l=n*r;s*l*i<=s*this.prescaleHeightLimit?l*=i:s*l<s*this.prescaleHeightLimit&&(l=this.prescaleHeightLimit),this.maxRenderHeight>0&&l>this.maxRenderHeight&&(l=this.maxRenderHeight),e*=l/n,n=l}return{width:e,height:n}}_timeupdate({type:e}){const i={seeking:!0,waiting:!0,playing:!1}[e];i!=null&&(this._playstate=i),this.setCurrentTime(this._video.paused||this._playstate,this._video.currentTime+this.timeOffset)}setVideo(e){e instanceof HTMLVideoElement?(this._removeListeners(),this._video=e,this._onDemandRender?this._video.requestVideoFrameCallback(this._handleRVFC.bind(this)):(this._playstate=e.paused,e.addEventListener("timeupdate",this._boundTimeUpdate,!1),e.addEventListener("progress",this._boundTimeUpdate,!1),e.addEventListener("waiting",this._boundTimeUpdate,!1),e.addEventListener("seeking",this._boundTimeUpdate,!1),e.addEventListener("playing",this._boundTimeUpdate,!1),e.addEventListener("ratechange",this._boundSetRate,!1),e.addEventListener("resize",this._boundResize,!1)),"VideoFrame"in window&&(e.addEventListener("loadedmetadata",this._boundUpdateColorSpace,!1),e.readyState>2&&this._updateColorSpace()),e.videoWidth>0&&this.resize(),typeof ResizeObserver<"u"&&(this._ro||(this._ro=new ResizeObserver(()=>this.resize())),this._ro.observe(e))):this._error("Video element invalid!")}runBenchmark(){this.sendMessage("runBenchmark")}setTrackByUrl(e){this.sendMessage("setTrackByUrl",{url:e}),this._reAttachOffscreen(),this._ctx&&(this._ctx.filter="none")}setTrack(e){this.sendMessage("setTrack",{content:e}),this._reAttachOffscreen(),this._ctx&&(this._ctx.filter="none")}freeTrack(){this.sendMessage("freeTrack")}setIsPaused(e){this.sendMessage("video",{isPaused:e})}setRate(e){this.sendMessage("video",{rate:e})}setCurrentTime(e,n,i){this.sendMessage("video",{isPaused:e,currentTime:n,rate:i,colorSpace:this._videoColorSpace})}createEvent(e){this.sendMessage("createEvent",{event:e})}setEvent(e,n){this.sendMessage("setEvent",{event:e,index:n})}removeEvent(e){this.sendMessage("removeEvent",{index:e})}getEvents(e){this._fetchFromWorker({target:"getEvents"},(n,{events:i})=>{e(n,i)})}createStyle(e){this.sendMessage("createStyle",{style:e})}setStyle(e,n){this.sendMessage("setStyle",{style:e,index:n})}removeStyle(e){this.sendMessage("removeStyle",{index:e})}getStyles(e){this._fetchFromWorker({target:"getStyles"},(n,{styles:i})=>{e(n,i)})}addFont(e){this.sendMessage("addFont",{font:e})}_sendLocalFont(e){try{queryLocalFonts().then(n=>{const i=n?.find(r=>r.fullName.toLowerCase()===e);i&&i.blob().then(r=>{r.arrayBuffer().then(s=>{this.addFont(new Uint8Array(s))})})})}catch(n){console.warn("Local fonts API:",n)}}_getLocalFont({font:e}){try{navigator?.permissions?.query?navigator.permissions.query({name:"local-fonts"}).then(n=>{n.state==="granted"&&this._sendLocalFont(e)}):this._sendLocalFont(e)}catch(n){console.warn("Local fonts API:",n)}}_unbusy(){this._lastDemandTime?this._demandRender(this._lastDemandTime):this.busy=!1}_handleRVFC(e,{mediaTime:n,width:i,height:r}){if(this._destroyed)return null;this.busy?this._lastDemandTime={mediaTime:n,width:i,height:r}:(this.busy=!0,this._demandRender({mediaTime:n,width:i,height:r})),this._video.requestVideoFrameCallback(this._handleRVFC.bind(this))}_demandRender({mediaTime:e,width:n,height:i}){this._lastDemandTime=null,(n!==this._videoWidth||i!==this._videoHeight)&&(this._videoWidth=n,this._videoHeight=i,this.resize()),this.sendMessage("demand",{time:e+this.timeOffset})}_detachOffscreen(){if(!this._offscreenRender||this._ctx)return null;this._canvas.remove(),this._createCanvas(),this._canvasctrl=this._canvas,this._ctx=this._canvasctrl.getContext("2d"),this.sendMessage("detachOffscreen"),this.busy=!1,this.resize(0,0,0,0,!0)}_reAttachOffscreen(){if(!this._offscreenRender||!this._ctx)return null;this._canvas.remove(),this._createCanvas(),this._canvasctrl=this._canvas.transferControlToOffscreen(),this._ctx=!1,this.sendMessage("offscreenCanvas",null,[this._canvasctrl]),this.resize(0,0,0,0,!0)}_updateColorSpace(){this._video.requestVideoFrameCallback(()=>{try{const e=new VideoFrame(this._video);this._videoColorSpace=fz[e.colorSpace.matrix],e.close(),this.sendMessage("getColorSpace")}catch(e){console.warn(e)}})}_verifyColorSpace({subtitleColorSpace:e,videoColorSpace:n=this._videoColorSpace}){!e||!n||e!==n&&(this._detachOffscreen(),this._ctx.filter=`url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='f'><feColorMatrix type='matrix' values='${hz[e][n]} 0 0 0 0 0 1 0'/></filter></svg>#f")`)}_render({images:e,asyncRender:n,times:i,width:r,height:s,colorSpace:l}){this._unbusy(),this.debug&&(i.IPCTime=Date.now()-i.JSRenderTime),(this._canvasctrl.width!==r||this._canvasctrl.height!==s)&&(this._canvasctrl.width=r,this._canvasctrl.height=s,this._verifyColorSpace({subtitleColorSpace:l})),this._ctx.clearRect(0,0,this._canvasctrl.width,this._canvasctrl.height);for(const a of e)a.image&&(n?(this._ctx.drawImage(a.image,a.x,a.y),a.image.close()):(this._bufferCanvas.width=a.w,this._bufferCanvas.height=a.h,this._bufferCtx.putImageData(new ImageData(this._fixAlpha(new Uint8ClampedArray(a.image)),a.w,a.h),0,0),this._ctx.drawImage(this._bufferCanvas,a.x,a.y)));if(this.debug){i.JSRenderTime=Date.now()-i.JSRenderTime-i.IPCTime;let a=0;const u=i.bitmaps||e.length;delete i.bitmaps;for(const f in i)a+=i[f];console.log("Bitmaps: "+u+" Total: "+(a|0)+"ms",i)}}_fixAlpha(e){if(mn._hasAlphaBug)for(let n=3;n<e.length;n+=4)e[n]=e[n]>1?e[n]:1;return e}_ready(){this._init(),this.dispatchEvent(new CustomEvent("ready"))}async sendMessage(e,n={},i){await this._loaded,i?this._worker.postMessage({target:e,transferable:i,...n},[...i]):this._worker.postMessage({target:e,...n})}_fetchFromWorker(e,n){try{const i=e.target,r=setTimeout(()=>{l(new Error("Error: Timeout while try to fetch "+i))},5e3),s=({data:a})=>{a.target===i&&(n(null,a),this._worker.removeEventListener("message",s),this._worker.removeEventListener("error",l),clearTimeout(r))},l=a=>{n(a),this._worker.removeEventListener("message",s),this._worker.removeEventListener("error",l),clearTimeout(r)};this._worker.addEventListener("message",s),this._worker.addEventListener("error",l),this._worker.postMessage(e)}catch(i){this._error(i)}}_console({content:e,command:n}){console[n].apply(console,JSON.parse(e))}_onmessage({data:e}){this["_"+e.target]&&this["_"+e.target](e)}_error(e){const n=e instanceof Error?e:e instanceof ErrorEvent?e.error:new Error(e),i=e instanceof Event?new ErrorEvent(e.type,e):new ErrorEvent("error",{error:n});return this.dispatchEvent(i),console.error(n),n}_removeListeners(){this._video&&(this._ro&&this._ro.unobserve(this._video),this._ctx&&(this._ctx.filter="none"),this._video.removeEventListener("timeupdate",this._boundTimeUpdate),this._video.removeEventListener("progress",this._boundTimeUpdate),this._video.removeEventListener("waiting",this._boundTimeUpdate),this._video.removeEventListener("seeking",this._boundTimeUpdate),this._video.removeEventListener("playing",this._boundTimeUpdate),this._video.removeEventListener("ratechange",this._boundSetRate),this._video.removeEventListener("resize",this._boundResize),this._video.removeEventListener("loadedmetadata",this._boundUpdateColorSpace))}destroy(e){return e&&(e=this._error(e)),this._video&&this._canvasParent&&this._video.parentNode?.removeChild(this._canvasParent),this._destroyed=!0,this._removeListeners(),this.sendMessage("destroy"),this._worker?.terminate(),e}}var Xb=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),pz=new Uint8Array(16);function gz(){if(!Xb)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xb(pz)}var AE=[];for(var $c=0;$c<256;++$c)AE[$c]=($c+256).toString(16).substr(1);function mz(t,e){var n=e||0,i=AE;return[i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]]].join("")}function vz(t,e,n){var i=e&&n||0;typeof t=="string"&&(e=t==="binary"?new Array(16):null,t=null),t=t||{};var r=t.random||(t.rng||gz)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e)for(var s=0;s<16;++s)e[i+s]=r[s];return e||mz(r)}function qb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function Gg(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?qb(Object(n),!0).forEach(function(i){sl(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qb(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function yz(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jb(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _z(t,e,n){return e&&Jb(t.prototype,e),n&&Jb(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function sl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ad(){return Ad=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ad.apply(this,arguments)}function bz(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Yg(t,e)}function Od(t){return Od=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Od(t)}function Yg(t,e){return Yg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},Yg(t,e)}function xz(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function wz(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Sz(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wz(t)}function kz(t){var e=xz();return function(){var i=Od(t),r;if(e){var s=Od(this).constructor;r=Reflect.construct(i,arguments,s)}else r=i.apply(this,arguments);return Sz(this,r)}}function Ez(t,e){if(t){if(typeof t=="string")return ex(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ex(t,e)}}function ex(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Cz(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Ez(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(u){throw u},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
765
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,l=!1,a;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return s=u.done,u},e:function(u){l=!0,a=u},f:function(){try{!s&&n.return!=null&&n.return()}finally{if(l)throw a}}}}var tx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Vc=function(t){return t&&t.Math==Math&&t},vr=(Vc(typeof globalThis=="object"&&globalThis)||Vc(typeof window=="object"&&window)||Vc(typeof self=="object"&&self)||Vc(typeof tx=="object"&&tx)||function(){return this}()||Function("return this")()),sy={},yr=function(t){try{return!!t()}catch{return!0}},Tz=yr,os=!Tz(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Pz=yr,oy=!Pz(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),Az=oy,Hc=Function.prototype.call,ay=Az?Hc.bind(Hc):function(){return Hc.apply(Hc,arguments)},OE={},LE={}.propertyIsEnumerable,ME=Object.getOwnPropertyDescriptor,Oz=ME&&!LE.call({1:2},1);OE.f=Oz?function(e){var n=ME(this,e);return!!n&&n.enumerable}:LE;var DE=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},RE=oy,IE=Function.prototype,Kg=IE.call,Lz=RE&&IE.bind.bind(Kg,Kg),UE=function(t){return RE?Lz(t):function(){return Kg.apply(t,arguments)}},FE=UE,Mz=FE({}.toString),Dz=FE("".slice),Af=function(t){return Dz(Mz(t),8,-1)},Rz=Af,Iz=UE,$i=function(t){if(Rz(t)==="Function")return Iz(t)},Uz=$i,Fz=yr,zz=Af,Dh=Object,Nz=Uz("".split),zE=Fz(function(){return!Dh("z").propertyIsEnumerable(0)})?function(t){return zz(t)=="String"?Nz(t,""):Dh(t)}:Dh,NE=function(t){return t==null},Bz=NE,jz=TypeError,BE=function(t){if(Bz(t))throw jz("Can't call method on "+t);return t},$z=zE,Vz=BE,Of=function(t){return $z(Vz(t))},Qg=typeof document=="object"&&document.all,Hz=typeof Qg>"u"&&Qg!==void 0,jE={all:Qg,IS_HTMLDDA:Hz},$E=jE,Wz=$E.all,ti=$E.IS_HTMLDDA?function(t){return typeof t=="function"||t===Wz}:function(t){return typeof t=="function"},nx=ti,VE=jE,Gz=VE.all,ea=VE.IS_HTMLDDA?function(t){return typeof t=="object"?t!==null:nx(t)||t===Gz}:function(t){return typeof t=="object"?t!==null:nx(t)},Rh=vr,Yz=ti,Kz=function(t){return Yz(t)?t:void 0},oc=function(t,e){return arguments.length<2?Kz(Rh[t]):Rh[t]&&Rh[t][e]},Qz=$i,Zz=Qz({}.isPrototypeOf),Xz=oc,qz=Xz("navigator","userAgent")||"",HE=vr,Ih=qz,ix=HE.process,rx=HE.Deno,sx=ix&&ix.versions||rx&&rx.version,ox=sx&&sx.v8,hi,Ld;ox&&(hi=ox.split("."),Ld=hi[0]>0&&hi[0]<4?1:+(hi[0]+hi[1]));!Ld&&Ih&&(hi=Ih.match(/Edge\/(\d+)/),(!hi||hi[1]>=74)&&(hi=Ih.match(/Chrome\/(\d+)/),hi&&(Ld=+hi[1])));var Jz=Ld,ax=Jz,eN=yr,WE=!!Object.getOwnPropertySymbols&&!eN(function(){var t=Symbol();return!String(t)||!(Object(t) instanceof Symbol)||!Symbol.sham&&ax&&ax<41}),tN=WE,GE=tN&&!Symbol.sham&&typeof Symbol.iterator=="symbol",nN=oc,iN=ti,rN=Zz,sN=GE,oN=Object,YE=sN?function(t){return typeof t=="symbol"}:function(t){var e=nN("Symbol");return iN(e)&&rN(e.prototype,oN(t))},aN=String,lN=function(t){try{return aN(t)}catch{return"Object"}},cN=ti,uN=lN,dN=TypeError,KE=function(t){if(cN(t))return t;throw dN(uN(t)+" is not a function")},fN=KE,hN=NE,pN=function(t,e){var n=t[e];return hN(n)?void 0:fN(n)},Uh=ay,Fh=ti,zh=ea,gN=TypeError,mN=function(t,e){var n,i;if(e==="string"&&Fh(n=t.toString)&&!zh(i=Uh(n,t))||Fh(n=t.valueOf)&&!zh(i=Uh(n,t))||e!=="string"&&Fh(n=t.toString)&&!zh(i=Uh(n,t)))return i;throw gN("Can't convert object to primitive value")},ly={exports:{}},lx=vr,vN=Object.defineProperty,cy=function(t,e){try{vN(lx,t,{value:e,configurable:!0,writable:!0})}catch{lx[t]=e}return e},yN=vr,_N=cy,cx="__core-js_shared__",bN=yN[cx]||_N(cx,{}),uy=bN,ux=uy;(ly.exports=function(t,e){return ux[t]||(ux[t]=e!==void 0?e:{})})("versions",[]).push({version:"3.25.5",mode:"global",copyright:"\xa9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE",source:"https://github.com/zloirock/core-js"});var xN=BE,wN=Object,QE=function(t){return wN(xN(t))},SN=$i,kN=QE,EN=SN({}.hasOwnProperty),Vs=Object.hasOwn||function(e,n){return EN(kN(e),n)},CN=$i,TN=0,PN=Math.random(),AN=CN(1..toString),ZE=function(t){return"Symbol("+(t===void 0?"":t)+")_"+AN(++TN+PN,36)},ON=vr,LN=ly.exports,dx=Vs,MN=ZE,fx=WE,XE=GE,Ks=LN("wks"),Os=ON.Symbol,hx=Os&&Os.for,DN=XE?Os:Os&&Os.withoutSetter||MN,ac=function(t){if(!dx(Ks,t)||!(fx||typeof Ks[t]=="string")){var e="Symbol."+t;fx&&dx(Os,t)?Ks[t]=Os[t]:XE&&hx?Ks[t]=hx(e):Ks[t]=DN(e)}return Ks[t]},RN=ay,px=ea,gx=YE,IN=pN,UN=mN,FN=ac,zN=TypeError,NN=FN("toPrimitive"),BN=function(t,e){if(!px(t)||gx(t))return t;var n=IN(t,NN),i;if(n){if(e===void 0&&(e="default"),i=RN(n,t,e),!px(i)||gx(i))return i;throw zN("Can't convert object to primitive value")}return e===void 0&&(e="number"),UN(t,e)},jN=BN,$N=YE,qE=function(t){var e=jN(t,"string");return $N(e)?e:e+""},VN=vr,mx=ea,Zg=VN.document,HN=mx(Zg)&&mx(Zg.createElement),JE=function(t){return HN?Zg.createElement(t):{}},WN=os,GN=yr,YN=JE,e2=!WN&&!GN(function(){return Object.defineProperty(YN("div"),"a",{get:function(){return 7}}).a!=7}),KN=os,QN=ay,ZN=OE,XN=DE,qN=Of,JN=qE,e3=Vs,t3=e2,vx=Object.getOwnPropertyDescriptor;sy.f=KN?vx:function(e,n){if(e=qN(e),n=JN(n),t3)try{return vx(e,n)}catch{}if(e3(e,n))return XN(!QN(ZN.f,e,n),e[n])};var ta={},n3=os,i3=yr,t2=n3&&i3(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),r3=ea,s3=String,o3=TypeError,Lf=function(t){if(r3(t))return t;throw o3(s3(t)+" is not an object")},a3=os,l3=e2,c3=t2,Wc=Lf,yx=qE,u3=TypeError,Nh=Object.defineProperty,d3=Object.getOwnPropertyDescriptor,Bh="enumerable",jh="configurable",$h="writable";ta.f=a3?c3?function(e,n,i){if(Wc(e),n=yx(n),Wc(i),typeof e=="function"&&n==="prototype"&&"value"in i&&$h in i&&!i[$h]){var r=d3(e,n);r&&r[$h]&&(e[n]=i.value,i={configurable:jh in i?i[jh]:r[jh],enumerable:Bh in i?i[Bh]:r[Bh],writable:!1})}return Nh(e,n,i)}:Nh:function(e,n,i){if(Wc(e),n=yx(n),Wc(i),l3)try{return Nh(e,n,i)}catch{}if("get"in i||"set"in i)throw u3("Accessors not supported");return"value"in i&&(e[n]=i.value),e};var f3=os,h3=ta,p3=DE,n2=f3?function(t,e,n){return h3.f(t,e,p3(1,n))}:function(t,e,n){return t[e]=n,t},i2={exports:{}},Xg=os,g3=Vs,r2=Function.prototype,m3=Xg&&Object.getOwnPropertyDescriptor,dy=g3(r2,"name"),v3=dy&&function(){}.name==="something",y3=dy&&(!Xg||Xg&&m3(r2,"name").configurable),_3={EXISTS:dy,PROPER:v3,CONFIGURABLE:y3},b3=$i,x3=ti,qg=uy,w3=b3(Function.toString);x3(qg.inspectSource)||(qg.inspectSource=function(t){return w3(t)});var s2=qg.inspectSource,S3=vr,k3=ti,_x=S3.WeakMap,E3=k3(_x)&&/native code/.test(String(_x)),C3=ly.exports,T3=ZE,bx=C3("keys"),o2=function(t){return bx[t]||(bx[t]=T3(t))},fy={},P3=E3,a2=vr,A3=ea,O3=n2,Vh=Vs,Hh=uy,L3=o2,M3=fy,xx="Object already initialized",Jg=a2.TypeError,D3=a2.WeakMap,Md,$l,Dd,R3=function(t){return Dd(t)?$l(t):Md(t,{})},I3=function(t){return function(e){var n;if(!A3(e)||(n=$l(e)).type!==t)throw Jg("Incompatible receiver, "+t+" required");return n}};if(P3||Hh.state){var Si=Hh.state||(Hh.state=new D3);Si.get=Si.get,Si.has=Si.has,Si.set=Si.set,Md=function(t,e){if(Si.has(t))throw Jg(xx);return e.facade=t,Si.set(t,e),e},$l=function(t){return Si.get(t)||{}},Dd=function(t){return Si.has(t)}}else{var Qs=L3("state");M3[Qs]=!0,Md=function(t,e){if(Vh(t,Qs))throw Jg(xx);return e.facade=t,O3(t,Qs,e),e},$l=function(t){return Vh(t,Qs)?t[Qs]:{}},Dd=function(t){return Vh(t,Qs)}}var U3={set:Md,get:$l,has:Dd,enforce:R3,getterFor:I3},F3=yr,z3=ti,Gc=Vs,em=os,N3=_3.CONFIGURABLE,B3=s2,l2=U3,j3=l2.enforce,$3=l2.get,bu=Object.defineProperty,V3=em&&!F3(function(){return bu(function(){},"length",{value:8}).length!==8}),H3=String(String).split("String"),W3=i2.exports=function(t,e,n){String(e).slice(0,7)==="Symbol("&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!Gc(t,"name")||N3&&t.name!==e)&&(em?bu(t,"name",{value:e,configurable:!0}):t.name=e),V3&&n&&Gc(n,"arity")&&t.length!==n.arity&&bu(t,"length",{value:n.arity});try{n&&Gc(n,"constructor")&&n.constructor?em&&bu(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var i=j3(t);return Gc(i,"source")||(i.source=H3.join(typeof e=="string"?e:"")),t};Function.prototype.toString=W3(function(){return z3(this)&&$3(this).source||B3(this)},"toString");var G3=ti,Y3=ta,K3=i2.exports,Q3=cy,Z3=function(t,e,n,i){i||(i={});var r=i.enumerable,s=i.name!==void 0?i.name:e;if(G3(n)&&K3(n,s,i),i.global)r?t[e]=n:Q3(e,n);else{try{i.unsafe?t[e]&&(r=!0):delete t[e]}catch{}r?t[e]=n:Y3.f(t,e,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return t},c2={},X3=Math.ceil,q3=Math.floor,J3=Math.trunc||function(e){var n=+e;return(n>0?q3:X3)(n)},eB=J3,u2=function(t){var e=+t;return e!==e||e===0?0:eB(e)},tB=u2,nB=Math.max,iB=Math.min,rB=function(t,e){var n=tB(t);return n<0?nB(n+e,0):iB(n,e)},sB=u2,oB=Math.min,aB=function(t){return t>0?oB(sB(t),9007199254740991):0},lB=aB,d2=function(t){return lB(t.length)},cB=Of,uB=rB,dB=d2,wx=function(t){return function(e,n,i){var r=cB(e),s=dB(r),l=uB(i,s),a;if(t&&n!=n){for(;s>l;)if(a=r[l++],a!=a)return!0}else for(;s>l;l++)if((t||l in r)&&r[l]===n)return t||l||0;return!t&&-1}},fB={includes:wx(!0),indexOf:wx(!1)},hB=$i,Wh=Vs,pB=Of,gB=fB.indexOf,mB=fy,Sx=hB([].push),f2=function(t,e){var n=pB(t),i=0,r=[],s;for(s in n)!Wh(mB,s)&&Wh(n,s)&&Sx(r,s);for(;e.length>i;)Wh(n,s=e[i++])&&(~gB(r,s)||Sx(r,s));return r},hy=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],vB=f2,yB=hy,_B=yB.concat("length","prototype");c2.f=Object.getOwnPropertyNames||function(e){return vB(e,_B)};var h2={};h2.f=Object.getOwnPropertySymbols;var bB=oc,xB=$i,wB=c2,SB=h2,kB=Lf,EB=xB([].concat),CB=bB("Reflect","ownKeys")||function(e){var n=wB.f(kB(e)),i=SB.f;return i?EB(n,i(e)):n},kx=Vs,TB=CB,PB=sy,AB=ta,OB=function(t,e,n){for(var i=TB(e),r=AB.f,s=PB.f,l=0;l<i.length;l++){var a=i[l];!kx(t,a)&&!(n&&kx(n,a))&&r(t,a,s(e,a))}},LB=yr,MB=ti,DB=/#|\.prototype\./,lc=function(t,e){var n=IB[RB(t)];return n==FB?!0:n==UB?!1:MB(e)?LB(e):!!e},RB=lc.normalize=function(t){return String(t).replace(DB,".").toLowerCase()},IB=lc.data={},UB=lc.NATIVE="N",FB=lc.POLYFILL="P",zB=lc,Gh=vr,NB=sy.f,BB=n2,jB=Z3,$B=cy,VB=OB,HB=zB,WB=function(t,e){var n=t.target,i=t.global,r=t.stat,s,l,a,u,f,p;if(i?l=Gh:r?l=Gh[n]||$B(n,{}):l=(Gh[n]||{}).prototype,l)for(a in e){if(f=e[a],t.dontCallGetSet?(p=NB(l,a),u=p&&p.value):u=l[a],s=HB(i?a:n+(r?".":"#")+a,t.forced),!s&&u!==void 0){if(typeof f==typeof u)continue;VB(f,u)}(t.sham||u&&u.sham)&&BB(f,"sham",!0),jB(l,a,f,t)}},Ex=$i,GB=KE,YB=oy,KB=Ex(Ex.bind),QB=function(t,e){return GB(t),e===void 0?t:YB?KB(t,e):function(){return t.apply(e,arguments)}},ZB=Af,XB=Array.isArray||function(e){return ZB(e)=="Array"},qB=ac,JB=qB("toStringTag"),p2={};p2[JB]="z";var e4=String(p2)==="[object z]",t4=e4,n4=ti,xu=Af,i4=ac,r4=i4("toStringTag"),s4=Object,o4=xu(function(){return arguments}())=="Arguments",a4=function(t,e){try{return t[e]}catch{}},l4=t4?xu:function(t){var e,n,i;return t===void 0?"Undefined":t===null?"Null":typeof(n=a4(e=s4(t),r4))=="string"?n:o4?xu(e):(i=xu(e))=="Object"&&n4(e.callee)?"Arguments":i},c4=$i,u4=yr,g2=ti,d4=l4,f4=oc,h4=s2,m2=function(){},p4=[],v2=f4("Reflect","construct"),py=/^\s*(?:class|function)\b/,g4=c4(py.exec),m4=!py.exec(m2),Sa=function(e){if(!g2(e))return!1;try{return v2(m2,p4,e),!0}catch{return!1}},y2=function(e){if(!g2(e))return!1;switch(d4(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return m4||!!g4(py,h4(e))}catch{return!0}};y2.sham=!0;var v4=!v2||u4(function(){var t;return Sa(Sa.call)||!Sa(Object)||!Sa(function(){t=!0})||t})?y2:Sa,Cx=XB,y4=v4,_4=ea,b4=ac,x4=b4("species"),Tx=Array,w4=function(t){var e;return Cx(t)&&(e=t.constructor,y4(e)&&(e===Tx||Cx(e.prototype))?e=void 0:_4(e)&&(e=e[x4],e===null&&(e=void 0))),e===void 0?Tx:e},S4=w4,k4=function(t,e){return new(S4(t))(e===0?0:e)},E4=QB,C4=$i,T4=zE,P4=QE,A4=d2,O4=k4,Px=C4([].push),wr=function(t){var e=t==1,n=t==2,i=t==3,r=t==4,s=t==6,l=t==7,a=t==5||s;return function(u,f,p,m){for(var o=P4(u),c=T4(o),d=E4(f,p),h=A4(c),g=0,y=m||O4,v=e?y(u,h):n||l?y(u,0):void 0,_,b;h>g;g++)if((a||g in c)&&(_=c[g],b=d(_,g,o),t))if(e)v[g]=b;else if(b)switch(t){case 3:return!0;case 5:return _;case 6:return g;case 2:Px(v,_)}else switch(t){case 4:return!1;case 7:Px(v,_)}return s?-1:i||r?r:v}},L4={forEach:wr(0),map:wr(1),filter:wr(2),some:wr(3),every:wr(4),find:wr(5),findIndex:wr(6),filterReject:wr(7)},_2={},M4=f2,D4=hy,R4=Object.keys||function(e){return M4(e,D4)},I4=os,U4=t2,F4=ta,z4=Lf,N4=Of,B4=R4;_2.f=I4&&!U4?Object.defineProperties:function(e,n){z4(e);for(var i=N4(n),r=B4(n),s=r.length,l=0,a;s>l;)F4.f(e,a=r[l++],i[a]);return e};var j4=oc,$4=j4("document","documentElement"),V4=Lf,H4=_2,Ax=hy,W4=fy,G4=$4,Y4=JE,K4=o2,Ox=">",Lx="<",tm="prototype",nm="script",b2=K4("IE_PROTO"),Yh=function(){},x2=function(t){return Lx+nm+Ox+t+Lx+"/"+nm+Ox},Mx=function(t){t.write(x2("")),t.close();var e=t.parentWindow.Object;return t=null,e},Q4=function(){var t=Y4("iframe"),e="java"+nm+":",n;return t.style.display="none",G4.appendChild(t),t.src=String(e),n=t.contentWindow.document,n.open(),n.write(x2("document.F=Object")),n.close(),n.F},Yc,wu=function(){try{Yc=new ActiveXObject("htmlfile")}catch{}wu=typeof document<"u"?document.domain&&Yc?Mx(Yc):Q4():Mx(Yc);for(var t=Ax.length;t--;)delete wu[tm][Ax[t]];return wu()};W4[b2]=!0;var Z4=Object.create||function(e,n){var i;return e!==null?(Yh[tm]=V4(e),i=new Yh,Yh[tm]=null,i[b2]=e):i=wu(),n===void 0?i:H4.f(i,n)},X4=ac,q4=Z4,J4=ta.f,im=X4("unscopables"),rm=Array.prototype;rm[im]==null&&J4(rm,im,{configurable:!0,value:q4(null)});var e5=function(t){rm[im][t]=!0},t5=WB,n5=L4.find,i5=e5,sm="find",w2=!0;sm in[]&&Array(1)[sm](function(){w2=!1});t5({target:"Array",proto:!0,forced:w2},{find:function(e){return n5(this,e,arguments.length>1?arguments[1]:void 0)}});i5(sm);var Gn={GLOBAL:{HIDE:"__react_tooltip_hide_event",REBUILD:"__react_tooltip_rebuild_event",SHOW:"__react_tooltip_show_event"}},Kh=function(e,n){var i;typeof window.CustomEvent=="function"?i=new window.CustomEvent(e,{detail:n}):(i=document.createEvent("Event"),i.initEvent(e,!1,!0,n)),window.dispatchEvent(i)};function r5(t){t.hide=function(e){Kh(Gn.GLOBAL.HIDE,{target:e})},t.rebuild=function(){Kh(Gn.GLOBAL.REBUILD)},t.show=function(e){Kh(Gn.GLOBAL.SHOW,{target:e})},t.prototype.globalRebuild=function(){this.mount&&(this.unbindListener(),this.bindListener())},t.prototype.globalShow=function(e){if(this.mount){var n=e&&e.detail&&e.detail.target&&!0||!1;this.showTooltip({currentTarget:n&&e.detail.target},!0)}},t.prototype.globalHide=function(e){if(this.mount){var n=e&&e.detail&&e.detail.target&&!0||!1;this.hideTooltip({currentTarget:n&&e.detail.target},n)}}}function s5(t){t.prototype.bindWindowEvents=function(e){window.removeEventListener(Gn.GLOBAL.HIDE,this.globalHide),window.addEventListener(Gn.GLOBAL.HIDE,this.globalHide,!1),window.removeEventListener(Gn.GLOBAL.REBUILD,this.globalRebuild),window.addEventListener(Gn.GLOBAL.REBUILD,this.globalRebuild,!1),window.removeEventListener(Gn.GLOBAL.SHOW,this.globalShow),window.addEventListener(Gn.GLOBAL.SHOW,this.globalShow,!1),e&&(window.removeEventListener("resize",this.onWindowResize),window.addEventListener("resize",this.onWindowResize,!1))},t.prototype.unbindWindowEvents=function(){window.removeEventListener(Gn.GLOBAL.HIDE,this.globalHide),window.removeEventListener(Gn.GLOBAL.REBUILD,this.globalRebuild),window.removeEventListener(Gn.GLOBAL.SHOW,this.globalShow),window.removeEventListener("resize",this.onWindowResize)},t.prototype.onWindowResize=function(){this.mount&&this.hideTooltip()}}var S2=function(e,n){var i=this.state.show,r=this.props.id,s=this.isCapture(n.currentTarget),l=n.currentTarget.getAttribute("currentItem");s||n.stopPropagation(),i&&l==="true"?e||this.hideTooltip(n):(n.currentTarget.setAttribute("currentItem","true"),o5(n.currentTarget,this.getTargetArray(r)),this.showTooltip(n))},o5=function(e,n){for(var i=0;i<n.length;i++)e!==n[i]?n[i].setAttribute("currentItem","false"):n[i].setAttribute("currentItem","true")},Qh={id:"9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf",set:function(e,n,i){if(this.id in e){var r=e[this.id];r[n]=i}else Object.defineProperty(e,this.id,{configurable:!0,value:sl({},n,i)})},get:function(e,n){var i=e[this.id];if(i!==void 0)return i[n]}};function a5(t){t.prototype.isCustomEvent=function(e){var n=this.state.event;return n||!!e.getAttribute("data-event")},t.prototype.customBindListener=function(e){var n=this,i=this.state,r=i.event,s=i.eventOff,l=e.getAttribute("data-event")||r,a=e.getAttribute("data-event-off")||s;l.split(" ").forEach(function(u){e.removeEventListener(u,Qh.get(e,u));var f=S2.bind(n,a);Qh.set(e,u,f),e.addEventListener(u,f,!1)}),a&&a.split(" ").forEach(function(u){e.removeEventListener(u,n.hideTooltip),e.addEventListener(u,n.hideTooltip,!1)})},t.prototype.customUnbindListener=function(e){var n=this.state,i=n.event,r=n.eventOff,s=i||e.getAttribute("data-event"),l=r||e.getAttribute("data-event-off");e.removeEventListener(s,Qh.get(e,i)),l&&e.removeEventListener(l,this.hideTooltip)}}function l5(t){t.prototype.isCapture=function(e){return e&&e.getAttribute("data-iscapture")==="true"||this.props.isCapture||!1}}function c5(t){t.prototype.getEffect=function(e){var n=e.getAttribute("data-effect");return n||this.props.effect||"float"}}var u5=function(e){var n={};for(var i in e)typeof e[i]=="function"?n[i]=e[i].bind(e):n[i]=e[i];return n},ka=function(e,n,i){for(var r=n.respectEffect,s=r===void 0?!1:r,l=n.customEvent,a=l===void 0?!1:l,u=this.props.id,f=null,p,m=i.target,o;f===null&&m!==null;)o=m,f=m.getAttribute("data-tip")||null,p=m.getAttribute("data-for")||null,m=m.parentElement;if(m=o||i.target,!(this.isCustomEvent(m)&&!a)){var c=u==null&&p==null||p===u;if(f!=null&&(!s||this.getEffect(m)==="float")&&c){var d=u5(i);d.currentTarget=m,e(d)}}},Dx=function(e,n){var i={};return e.forEach(function(r){var s=r.getAttribute(n);s&&s.split(" ").forEach(function(l){return i[l]=!0})}),i},Rx=function(){return document.getElementsByTagName("body")[0]};function d5(t){t.prototype.isBodyMode=function(){return!!this.props.bodyMode},t.prototype.bindBodyListener=function(e){var n=this,i=this.state,r=i.event,s=i.eventOff,l=i.possibleCustomEvents,a=i.possibleCustomEventsOff,u=Rx(),f=Dx(e,"data-event"),p=Dx(e,"data-event-off");r!=null&&(f[r]=!0),s!=null&&(p[s]=!0),l.split(" ").forEach(function(h){return f[h]=!0}),a.split(" ").forEach(function(h){return p[h]=!0}),this.unbindBodyListener(u);var m=this.bodyModeListeners={};r==null&&(m.mouseover=ka.bind(this,this.showTooltip,{}),m.mousemove=ka.bind(this,this.updateTooltip,{respectEffect:!0}),m.mouseout=ka.bind(this,this.hideTooltip,{}));for(var o in f)m[o]=ka.bind(this,function(h){var g=h.currentTarget.getAttribute("data-event-off")||s;S2.call(n,g,h)},{customEvent:!0});for(var c in p)m[c]=ka.bind(this,this.hideTooltip,{customEvent:!0});for(var d in m)u.addEventListener(d,m[d])},t.prototype.unbindBodyListener=function(e){e=e||Rx();var n=this.bodyModeListeners;for(var i in n)e.removeEventListener(i,n[i])}}var f5=function(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver};function h5(t){t.prototype.bindRemovalTracker=function(){var e=this,n=f5();if(n!=null){var i=new n(function(r){for(var s=0;s<r.length;s++)for(var l=r[s],a=0;a<l.removedNodes.length;a++){var u=l.removedNodes[a];if(u===e.state.currentTarget){e.hideTooltip();return}}});i.observe(window.document,{childList:!0,subtree:!0}),this.removalTracker=i}},t.prototype.unbindRemovalTracker=function(){this.removalTracker&&(this.removalTracker.disconnect(),this.removalTracker=null)}}function Ix(t,e,n,i,r,s,l){var a=om(n),u=a.width,f=a.height,p=om(e),m=p.width,o=p.height,c=p5(t,e,s),d=c.mouseX,h=c.mouseY,g=g5(s,m,o,u,f),y=m5(l),v=y.extraOffsetX,_=y.extraOffsetY,b=window.innerWidth,x=window.innerHeight,w=v5(n),S=w.parentTop,C=w.parentLeft,T=function(fe){var ke=g[fe].l;return d+ke+v},M=function(fe){var ke=g[fe].r;return d+ke+v},B=function(fe){var ke=g[fe].t;return h+ke+_},F=function(fe){var ke=g[fe].b;return h+ke+_},N=function(fe){return T(fe)<0},W=function(fe){return M(fe)>b},H=function(fe){return B(fe)<0},Y=function(fe){return F(fe)>x},ee=function(fe){return N(fe)||W(fe)||H(fe)||Y(fe)},I=function(fe){return!ee(fe)},z={top:I("top"),bottom:I("bottom"),left:I("left"),right:I("right")};function X(){var ue=r.split(",").concat(i,["top","bottom","left","right"]),fe=Cz(ue),ke;try{for(fe.s();!(ke=fe.n()).done;){var Be=ke.value;if(z[Be])return Be}}catch(Le){fe.e(Le)}finally{fe.f()}return i}var K=X(),be=!1,Ke;return K&&K!==i&&(be=!0,Ke=K),be?{isNewState:!0,newState:{place:Ke}}:{isNewState:!1,position:{left:parseInt(T(i)-C,10),top:parseInt(B(i)-S,10)}}}var om=function(e){var n=e.getBoundingClientRect(),i=n.height,r=n.width;return{height:parseInt(i,10),width:parseInt(r,10)}},p5=function(e,n,i){var r=n.getBoundingClientRect(),s=r.top,l=r.left,a=om(n),u=a.width,f=a.height;return i==="float"?{mouseX:e.clientX,mouseY:e.clientY}:{mouseX:l+u/2,mouseY:s+f/2}},g5=function(e,n,i,r,s){var l,a,u,f,p=3,m=2,o=12;return e==="float"?(l={l:-(r/2),r:r/2,t:-(s+p+m),b:-p},u={l:-(r/2),r:r/2,t:p+o,b:s+p+m+o},f={l:-(r+p+m),r:-p,t:-(s/2),b:s/2},a={l:p,r:r+p+m,t:-(s/2),b:s/2}):e==="solid"&&(l={l:-(r/2),r:r/2,t:-(i/2+s+m),b:-(i/2)},u={l:-(r/2),r:r/2,t:i/2,b:i/2+s+m},f={l:-(r+n/2+m),r:-(n/2),t:-(s/2),b:s/2},a={l:n/2,r:r+n/2+m,t:-(s/2),b:s/2}),{top:l,bottom:u,left:f,right:a}},m5=function(e){var n=0,i=0;Object.prototype.toString.apply(e)==="[object String]"&&(e=JSON.parse(e.toString().replace(/'/g,'"')));for(var r in e)r==="top"?i-=parseInt(e[r],10):r==="bottom"?i+=parseInt(e[r],10):r==="left"?n-=parseInt(e[r],10):r==="right"&&(n+=parseInt(e[r],10));return{extraOffsetX:n,extraOffsetY:i}},v5=function(e){for(var n=e;n;){var i=window.getComputedStyle(n);if(i.getPropertyValue("transform")!=="none"||i.getPropertyValue("will-change")==="transform")break;n=n.parentElement}var r=n&&n.getBoundingClientRect().top||0,s=n&&n.getBoundingClientRect().left||0;return{parentTop:r,parentLeft:s}};function Ux(t,e,n,i){if(e)return e;if(n!=null)return n;if(n===null)return null;var r=/<br\s*\/?>/;return!i||i==="false"||!r.test(t)?t:t.split(r).map(function(s,l){return ae.createElement("span",{key:l,className:"multi-line"},s)})}function Fx(t){var e={};return Object.keys(t).filter(function(n){return/(^aria-\w+$|^role$)/.test(n)}).forEach(function(n){e[n]=t[n]}),e}function Zh(t){var e=t.length;return t.hasOwnProperty?Array.prototype.slice.call(t):new Array(e).fill().map(function(n){return t[n]})}function y5(){return"t"+vz()}var _5=`.__react_component_tooltip {
766
+ border-radius: 3px;
767
+ display: inline-block;
768
+ font-size: 13px;
769
+ left: -999em;
770
+ opacity: 0;
771
+ position: fixed;
772
+ pointer-events: none;
773
+ transition: opacity 0.3s ease-out;
774
+ top: -999em;
775
+ visibility: hidden;
776
+ z-index: 999;
777
+ }
778
+ .__react_component_tooltip.allow_hover, .__react_component_tooltip.allow_click {
779
+ pointer-events: auto;
780
+ }
781
+ .__react_component_tooltip::before, .__react_component_tooltip::after {
782
+ content: "";
783
+ width: 0;
784
+ height: 0;
785
+ position: absolute;
786
+ }
787
+ .__react_component_tooltip.show {
788
+ opacity: 0.9;
789
+ margin-top: 0;
790
+ margin-left: 0;
791
+ visibility: visible;
792
+ }
793
+ .__react_component_tooltip.place-top::before {
794
+ bottom: 0;
795
+ left: 50%;
796
+ margin-left: -11px;
797
+ }
798
+ .__react_component_tooltip.place-bottom::before {
799
+ top: 0;
800
+ left: 50%;
801
+ margin-left: -11px;
802
+ }
803
+ .__react_component_tooltip.place-left::before {
804
+ right: 0;
805
+ top: 50%;
806
+ margin-top: -9px;
807
+ }
808
+ .__react_component_tooltip.place-right::before {
809
+ left: 0;
810
+ top: 50%;
811
+ margin-top: -9px;
812
+ }
813
+ .__react_component_tooltip .multi-line {
814
+ display: block;
815
+ padding: 2px 0;
816
+ text-align: center;
817
+ }`,zx={dark:{text:"#fff",background:"#222",border:"transparent",arrow:"#222"},success:{text:"#fff",background:"#8DC572",border:"transparent",arrow:"#8DC572"},warning:{text:"#fff",background:"#F0AD4E",border:"transparent",arrow:"#F0AD4E"},error:{text:"#fff",background:"#BE6464",border:"transparent",arrow:"#BE6464"},info:{text:"#fff",background:"#337AB7",border:"transparent",arrow:"#337AB7"},light:{text:"#222",background:"#fff",border:"transparent",arrow:"#fff"}};function b5(t){return zx[t]?Gg({},zx[t]):void 0}var x5="8px 21px",w5={tooltip:3,arrow:0};function S5(t,e,n,i,r,s){return k5(t,E5(e,n,i),r,s)}function k5(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:x5,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:w5,r=e.text,s=e.background,l=e.border,a=e.arrow,u=i.arrow,f=i.tooltip;return`
818
+ .`.concat(t,` {
819
+ color: `).concat(r,`;
820
+ background: `).concat(s,`;
821
+ border: 1px solid `).concat(l,`;
822
+ border-radius: `).concat(f,`px;
823
+ padding: `).concat(n,`;
824
+ }
825
+
826
+ .`).concat(t,`.place-top {
827
+ margin-top: -10px;
828
+ }
829
+ .`).concat(t,`.place-top::before {
830
+ content: "";
831
+ background-color: inherit;
832
+ position: absolute;
833
+ z-index: 2;
834
+ width: 20px;
835
+ height: 12px;
836
+ }
837
+ .`).concat(t,`.place-top::after {
838
+ content: "";
839
+ position: absolute;
840
+ width: 10px;
841
+ height: 10px;
842
+ border-top-right-radius: `).concat(u,`px;
843
+ border: 1px solid `).concat(l,`;
844
+ background-color: `).concat(a,`;
845
+ z-index: -2;
846
+ bottom: -6px;
847
+ left: 50%;
848
+ margin-left: -6px;
849
+ transform: rotate(135deg);
850
+ }
851
+
852
+ .`).concat(t,`.place-bottom {
853
+ margin-top: 10px;
854
+ }
855
+ .`).concat(t,`.place-bottom::before {
856
+ content: "";
857
+ background-color: inherit;
858
+ position: absolute;
859
+ z-index: -1;
860
+ width: 18px;
861
+ height: 10px;
862
+ }
863
+ .`).concat(t,`.place-bottom::after {
864
+ content: "";
865
+ position: absolute;
866
+ width: 10px;
867
+ height: 10px;
868
+ border-top-right-radius: `).concat(u,`px;
869
+ border: 1px solid `).concat(l,`;
870
+ background-color: `).concat(a,`;
871
+ z-index: -2;
872
+ top: -6px;
873
+ left: 50%;
874
+ margin-left: -6px;
875
+ transform: rotate(45deg);
876
+ }
877
+
878
+ .`).concat(t,`.place-left {
879
+ margin-left: -10px;
880
+ }
881
+ .`).concat(t,`.place-left::before {
882
+ content: "";
883
+ background-color: inherit;
884
+ position: absolute;
885
+ z-index: -1;
886
+ width: 10px;
887
+ height: 18px;
888
+ }
889
+ .`).concat(t,`.place-left::after {
890
+ content: "";
891
+ position: absolute;
892
+ width: 10px;
893
+ height: 10px;
894
+ border-top-right-radius: `).concat(u,`px;
895
+ border: 1px solid `).concat(l,`;
896
+ background-color: `).concat(a,`;
897
+ z-index: -2;
898
+ right: -6px;
899
+ top: 50%;
900
+ margin-top: -6px;
901
+ transform: rotate(45deg);
902
+ }
903
+
904
+ .`).concat(t,`.place-right {
905
+ margin-left: 10px;
906
+ }
907
+ .`).concat(t,`.place-right::before {
908
+ content: "";
909
+ background-color: inherit;
910
+ position: absolute;
911
+ z-index: -1;
912
+ width: 10px;
913
+ height: 18px;
914
+ }
915
+ .`).concat(t,`.place-right::after {
916
+ content: "";
917
+ position: absolute;
918
+ width: 10px;
919
+ height: 10px;
920
+ border-top-right-radius: `).concat(u,`px;
921
+ border: 1px solid `).concat(l,`;
922
+ background-color: `).concat(a,`;
923
+ z-index: -2;
924
+ left: -6px;
925
+ top: 50%;
926
+ margin-top: -6px;
927
+ transform: rotate(-135deg);
928
+ }
929
+ `)}function E5(t,e,n){var i=t.text,r=t.background,s=t.border,l=t.arrow?t.arrow:t.background,a=b5(e);return i&&(a.text=i),r&&(a.background=r),n&&(s?a.border=s:a.border=e==="light"?"black":"white"),l&&(a.arrow=l),a}var gn,Ea,Zs=r5(gn=s5(gn=a5(gn=l5(gn=c5(gn=d5(gn=h5(gn=(Ea=function(t){bz(n,t);var e=kz(n);function n(i){var r;return yz(this,n),r=e.call(this,i),r.state={uuid:i.uuid||y5(),place:i.place||"top",desiredPlace:i.place||"top",type:i.type||"dark",effect:i.effect||"float",show:!1,border:!1,borderClass:"border",customColors:{},customRadius:{},offset:{},padding:i.padding,extraClass:"",html:!1,delayHide:0,delayShow:0,event:i.event||null,eventOff:i.eventOff||null,currentEvent:null,currentTarget:null,ariaProps:Fx(i),isEmptyTip:!1,disable:!1,possibleCustomEvents:i.possibleCustomEvents||"",possibleCustomEventsOff:i.possibleCustomEventsOff||"",originTooltip:null,isMultiline:!1},r.bind(["showTooltip","updateTooltip","hideTooltip","hideTooltipOnScroll","getTooltipContent","globalRebuild","globalShow","globalHide","onWindowResize","mouseOnToolTip"]),r.mount=!0,r.delayShowLoop=null,r.delayHideLoop=null,r.delayReshow=null,r.intervalUpdateContent=null,r}return _z(n,[{key:"bind",value:function(r){var s=this;r.forEach(function(l){s[l]=s[l].bind(s)})}},{key:"componentDidMount",value:function(){var r=this.props;r.insecure;var s=r.resizeHide,l=r.disableInternalStyle;this.mount=!0,this.bindListener(),this.bindWindowEvents(s),l||this.injectStyles()}},{key:"componentWillUnmount",value:function(){this.mount=!1,this.clearTimer(),this.unbindListener(),this.removeScrollListener(this.state.currentTarget),this.unbindWindowEvents()}},{key:"injectStyles",value:function(){var r=this.tooltipRef;if(r){for(var s=r.parentNode;s.parentNode;)s=s.parentNode;var l;switch(s.constructor.name){case"Document":case"HTMLDocument":case void 0:l=s.head;break;case"ShadowRoot":default:l=s;break}if(!l.querySelector("style[data-react-tooltip]")){var a=document.createElement("style");a.textContent=_5,a.setAttribute("data-react-tooltip","true"),l.appendChild(a)}}}},{key:"mouseOnToolTip",value:function(){var r=this.state.show;return r&&this.tooltipRef?(this.tooltipRef.matches||(this.tooltipRef.msMatchesSelector?this.tooltipRef.matches=this.tooltipRef.msMatchesSelector:this.tooltipRef.matches=this.tooltipRef.mozMatchesSelector),this.tooltipRef.matches(":hover")):!1}},{key:"getTargetArray",value:function(r){var s=[],l;if(!r)l="[data-tip]:not([data-for])";else{var a=r.replace(/\\/g,"\\\\").replace(/"/g,'\\"');l='[data-tip][data-for="'.concat(a,'"]')}return Zh(document.getElementsByTagName("*")).filter(function(u){return u.shadowRoot}).forEach(function(u){s=s.concat(Zh(u.shadowRoot.querySelectorAll(l)))}),s.concat(Zh(document.querySelectorAll(l)))}},{key:"bindListener",value:function(){var r=this,s=this.props,l=s.id,a=s.globalEventOff,u=s.isCapture,f=this.getTargetArray(l);f.forEach(function(p){p.getAttribute("currentItem")===null&&p.setAttribute("currentItem","false"),r.unbindBasicListener(p),r.isCustomEvent(p)&&r.customUnbindListener(p)}),this.isBodyMode()?this.bindBodyListener(f):f.forEach(function(p){var m=r.isCapture(p),o=r.getEffect(p);if(r.isCustomEvent(p)){r.customBindListener(p);return}p.addEventListener("mouseenter",r.showTooltip,m),p.addEventListener("focus",r.showTooltip,m),o==="float"&&p.addEventListener("mousemove",r.updateTooltip,m),p.addEventListener("mouseleave",r.hideTooltip,m),p.addEventListener("blur",r.hideTooltip,m)}),a&&(window.removeEventListener(a,this.hideTooltip),window.addEventListener(a,this.hideTooltip,u)),this.bindRemovalTracker()}},{key:"unbindListener",value:function(){var r=this,s=this.props,l=s.id,a=s.globalEventOff;if(this.isBodyMode())this.unbindBodyListener();else{var u=this.getTargetArray(l);u.forEach(function(f){r.unbindBasicListener(f),r.isCustomEvent(f)&&r.customUnbindListener(f)})}a&&window.removeEventListener(a,this.hideTooltip),this.unbindRemovalTracker()}},{key:"unbindBasicListener",value:function(r){var s=this.isCapture(r);r.removeEventListener("mouseenter",this.showTooltip,s),r.removeEventListener("mousemove",this.updateTooltip,s),r.removeEventListener("mouseleave",this.hideTooltip,s)}},{key:"getTooltipContent",value:function(){var r=this.props,s=r.getContent,l=r.children,a;return s&&(Array.isArray(s)?a=s[0]&&s[0](this.state.originTooltip):a=s(this.state.originTooltip)),Ux(this.state.originTooltip,l,a,this.state.isMultiline)}},{key:"isEmptyTip",value:function(r){return typeof r=="string"&&r===""||r===null}},{key:"showTooltip",value:function(r,s){if(this.tooltipRef){if(s){var l=this.getTargetArray(this.props.id),a=l.some(function(C){return C===r.currentTarget});if(!a)return}var u=this.props,f=u.multiline,p=u.getContent,m=r.currentTarget.getAttribute("data-tip"),o=r.currentTarget.getAttribute("data-multiline")||f||!1,c=r instanceof window.FocusEvent||s,d=!0;r.currentTarget.getAttribute("data-scroll-hide")?d=r.currentTarget.getAttribute("data-scroll-hide")==="true":this.props.scrollHide!=null&&(d=this.props.scrollHide),r&&r.currentTarget&&r.currentTarget.setAttribute&&r.currentTarget.setAttribute("aria-describedby",this.props.id||this.state.uuid);var h=r.currentTarget.getAttribute("data-place")||this.props.place||"top",g=c&&"solid"||this.getEffect(r.currentTarget),y=r.currentTarget.getAttribute("data-offset")||this.props.offset||{},v=Ix(r,r.currentTarget,this.tooltipRef,h.split(",")[0],h,g,y);v.position&&this.props.overridePosition&&(v.position=this.props.overridePosition(v.position,r,r.currentTarget,this.tooltipRef,h,h,g,y));var _=v.isNewState?v.newState.place:h.split(",")[0];this.clearTimer();var b=r.currentTarget,x=this.state.show?b.getAttribute("data-delay-update")||this.props.delayUpdate:0,w=this,S=function(){w.setState({originTooltip:m,isMultiline:o,desiredPlace:h,place:_,type:b.getAttribute("data-type")||w.props.type||"dark",customColors:{text:b.getAttribute("data-text-color")||w.props.textColor||null,background:b.getAttribute("data-background-color")||w.props.backgroundColor||null,border:b.getAttribute("data-border-color")||w.props.borderColor||null,arrow:b.getAttribute("data-arrow-color")||w.props.arrowColor||null},customRadius:{tooltip:b.getAttribute("data-tooltip-radius")||w.props.tooltipRadius||"3",arrow:b.getAttribute("data-arrow-radius")||w.props.arrowRadius||"0"},effect:g,offset:y,padding:b.getAttribute("data-padding")||w.props.padding,html:(b.getAttribute("data-html")?b.getAttribute("data-html")==="true":w.props.html)||!1,delayShow:b.getAttribute("data-delay-show")||w.props.delayShow||0,delayHide:b.getAttribute("data-delay-hide")||w.props.delayHide||0,delayUpdate:b.getAttribute("data-delay-update")||w.props.delayUpdate||0,border:(b.getAttribute("data-border")?b.getAttribute("data-border")==="true":w.props.border)||!1,borderClass:b.getAttribute("data-border-class")||w.props.borderClass||"border",extraClass:b.getAttribute("data-class")||w.props.class||w.props.className||"",disable:(b.getAttribute("data-tip-disable")?b.getAttribute("data-tip-disable")==="true":w.props.disable)||!1,currentTarget:b},function(){d&&w.addScrollListener(w.state.currentTarget),w.updateTooltip(r),p&&Array.isArray(p)&&(w.intervalUpdateContent=setInterval(function(){if(w.mount){var T=w.props.getContent,M=Ux(m,"",T[0](),o),B=w.isEmptyTip(M);w.setState({isEmptyTip:B}),w.updatePosition()}},p[1]))})};x?this.delayReshow=setTimeout(S,x):S()}}},{key:"updateTooltip",value:function(r){var s=this,l=this.state,a=l.delayShow,u=l.disable,f=this.props,p=f.afterShow,m=f.disable,o=this.getTooltipContent(),c=r.currentTarget||r.target;if(!this.mouseOnToolTip()&&!(this.isEmptyTip(o)||u||m)){var d=this.state.show?0:parseInt(a,10),h=function(){if(Array.isArray(o)&&o.length>0||o){var y=!s.state.show;s.setState({currentEvent:r,currentTarget:c,show:!0},function(){s.updatePosition(function(){y&&p&&p(r)})})}};this.delayShowLoop&&clearTimeout(this.delayShowLoop),d?this.delayShowLoop=setTimeout(h,d):(this.delayShowLoop=null,h())}}},{key:"listenForTooltipExit",value:function(){var r=this.state.show;r&&this.tooltipRef&&this.tooltipRef.addEventListener("mouseleave",this.hideTooltip)}},{key:"removeListenerForTooltipExit",value:function(){var r=this.state.show;r&&this.tooltipRef&&this.tooltipRef.removeEventListener("mouseleave",this.hideTooltip)}},{key:"hideTooltip",value:function(r,s){var l=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{isScroll:!1},u=this.state.disable,f=a.isScroll,p=f?0:this.state.delayHide,m=this.props,o=m.afterHide,c=m.disable,d=this.getTooltipContent();if(this.mount&&!(this.isEmptyTip(d)||u||c)){if(s){var h=this.getTargetArray(this.props.id),g=h.some(function(v){return v===r.currentTarget});if(!g||!this.state.show)return}r&&r.currentTarget&&r.currentTarget.removeAttribute&&r.currentTarget.removeAttribute("aria-describedby");var y=function(){var _=l.state.show;if(l.mouseOnToolTip()){l.listenForTooltipExit();return}l.removeListenerForTooltipExit(),l.setState({show:!1},function(){l.removeScrollListener(l.state.currentTarget),_&&o&&o(r)})};this.clearTimer(),p?this.delayHideLoop=setTimeout(y,parseInt(p,10)):y()}}},{key:"hideTooltipOnScroll",value:function(r,s){this.hideTooltip(r,s,{isScroll:!0})}},{key:"addScrollListener",value:function(r){var s=this.isCapture(r);window.addEventListener("scroll",this.hideTooltipOnScroll,s)}},{key:"removeScrollListener",value:function(r){var s=this.isCapture(r);window.removeEventListener("scroll",this.hideTooltipOnScroll,s)}},{key:"updatePosition",value:function(r){var s=this,l=this.state,a=l.currentEvent,u=l.currentTarget,f=l.place,p=l.desiredPlace,m=l.effect,o=l.offset,c=this.tooltipRef,d=Ix(a,u,c,f,p,m,o);if(d.position&&this.props.overridePosition&&(d.position=this.props.overridePosition(d.position,a,u,c,f,p,m,o)),d.isNewState)return this.setState(d.newState,function(){s.updatePosition(r)});r&&typeof r=="function"&&r(),c.style.left=d.position.left+"px",c.style.top=d.position.top+"px"}},{key:"clearTimer",value:function(){this.delayShowLoop&&(clearTimeout(this.delayShowLoop),this.delayShowLoop=null),this.delayHideLoop&&(clearTimeout(this.delayHideLoop),this.delayHideLoop=null),this.delayReshow&&(clearTimeout(this.delayReshow),this.delayReshow=null),this.intervalUpdateContent&&(clearInterval(this.intervalUpdateContent),this.intervalUpdateContent=null)}},{key:"hasCustomColors",value:function(){var r=this;return!!(Object.keys(this.state.customColors).find(function(s){return s!=="border"&&r.state.customColors[s]})||this.state.border&&this.state.customColors.border)}},{key:"render",value:function(){var r=this,s=this.state,l=s.extraClass,a=s.html,u=s.ariaProps,f=s.disable,p=s.uuid,m=this.getTooltipContent(),o=this.isEmptyTip(m),c=this.props.disableInternalStyle?"":S5(this.state.uuid,this.state.customColors,this.state.type,this.state.border,this.state.padding,this.state.customRadius),d="__react_component_tooltip"+" ".concat(this.state.uuid)+(this.state.show&&!f&&!o?" show":"")+(this.state.border?" "+this.state.borderClass:"")+" place-".concat(this.state.place)+" type-".concat(this.hasCustomColors()?"custom":this.state.type)+(this.props.delayUpdate?" allow_hover":"")+(this.props.clickable?" allow_click":""),h=this.props.wrapper;n.supportedWrappers.indexOf(h)<0&&(h=n.defaultProps.wrapper);var g=[d,l].filter(Boolean).join(" ");if(a){var y="".concat(m).concat(c?`
930
+ <style aria-hidden="true">`.concat(c,"</style>"):"");return ae.createElement(h,Ad({className:"".concat(g),id:this.props.id||p,ref:function(_){return r.tooltipRef=_}},u,{"data-id":"tooltip",dangerouslySetInnerHTML:{__html:y}}))}else return ae.createElement(h,Ad({className:"".concat(g),id:this.props.id||p},u,{ref:function(_){return r.tooltipRef=_},"data-id":"tooltip"}),c&&ae.createElement("style",{dangerouslySetInnerHTML:{__html:c},"aria-hidden":"true"}),m)}}],[{key:"propTypes",get:function(){return{uuid:R.string,children:R.any,place:R.string,type:R.string,effect:R.string,offset:R.object,padding:R.string,multiline:R.bool,border:R.bool,borderClass:R.string,textColor:R.string,backgroundColor:R.string,borderColor:R.string,arrowColor:R.string,arrowRadius:R.string,tooltipRadius:R.string,insecure:R.bool,class:R.string,className:R.string,id:R.string,html:R.bool,delayHide:R.number,delayUpdate:R.number,delayShow:R.number,event:R.string,eventOff:R.string,isCapture:R.bool,globalEventOff:R.string,getContent:R.any,afterShow:R.func,afterHide:R.func,overridePosition:R.func,disable:R.bool,scrollHide:R.bool,resizeHide:R.bool,wrapper:R.string,bodyMode:R.bool,possibleCustomEvents:R.string,possibleCustomEventsOff:R.string,clickable:R.bool,disableInternalStyle:R.bool}}},{key:"getDerivedStateFromProps",value:function(r,s){var l=s.ariaProps,a=Fx(r),u=Object.keys(a).some(function(f){return a[f]!==l[f]});return u?Gg(Gg({},s),{},{ariaProps:a}):null}}]),n}(ae.Component),sl(Ea,"defaultProps",{insecure:!0,resizeHide:!0,wrapper:"div",clickable:!1}),sl(Ea,"supportedWrappers",["div","span"]),sl(Ea,"displayName","ReactTooltip"),Ea))||gn)||gn)||gn)||gn)||gn)||gn)||gn,k2={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function r(u,f,p){this.fn=u,this.context=f,this.once=p||!1}function s(u,f,p,m,o){if(typeof p!="function")throw new TypeError("The listener must be a function");var c=new r(p,m||u,o),d=n?n+f:f;return u._events[d]?u._events[d].fn?u._events[d]=[u._events[d],c]:u._events[d].push(c):(u._events[d]=c,u._eventsCount++),u}function l(u,f){--u._eventsCount===0?u._events=new i:delete u._events[f]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var f=[],p,m;if(this._eventsCount===0)return f;for(m in p=this._events)e.call(p,m)&&f.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},a.prototype.listeners=function(f){var p=n?n+f:f,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var o=0,c=m.length,d=new Array(c);o<c;o++)d[o]=m[o].fn;return d},a.prototype.listenerCount=function(f){var p=n?n+f:f,m=this._events[p];return m?m.fn?1:m.length:0},a.prototype.emit=function(f,p,m,o,c,d){var h=n?n+f:f;if(!this._events[h])return!1;var g=this._events[h],y=arguments.length,v,_;if(g.fn){switch(g.once&&this.removeListener(f,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,p),!0;case 3:return g.fn.call(g.context,p,m),!0;case 4:return g.fn.call(g.context,p,m,o),!0;case 5:return g.fn.call(g.context,p,m,o,c),!0;case 6:return g.fn.call(g.context,p,m,o,c,d),!0}for(_=1,v=new Array(y-1);_<y;_++)v[_-1]=arguments[_];g.fn.apply(g.context,v)}else{var b=g.length,x;for(_=0;_<b;_++)switch(g[_].once&&this.removeListener(f,g[_].fn,void 0,!0),y){case 1:g[_].fn.call(g[_].context);break;case 2:g[_].fn.call(g[_].context,p);break;case 3:g[_].fn.call(g[_].context,p,m);break;case 4:g[_].fn.call(g[_].context,p,m,o);break;default:if(!v)for(x=1,v=new Array(y-1);x<y;x++)v[x-1]=arguments[x];g[_].fn.apply(g[_].context,v)}}return!0},a.prototype.on=function(f,p,m){return s(this,f,p,m,!1)},a.prototype.once=function(f,p,m){return s(this,f,p,m,!0)},a.prototype.removeListener=function(f,p,m,o){var c=n?n+f:f;if(!this._events[c])return this;if(!p)return l(this,c),this;var d=this._events[c];if(d.fn)d.fn===p&&(!o||d.once)&&(!m||d.context===m)&&l(this,c);else{for(var h=0,g=[],y=d.length;h<y;h++)(d[h].fn!==p||o&&!d[h].once||m&&d[h].context!==m)&&g.push(d[h]);g.length?this._events[c]=g.length===1?g[0]:g:l(this,c)}return this},a.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&l(this,p)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(k2);var C5=k2.exports;const T5=vw(C5);class E2 extends Error{constructor(e){super(e),this.name="TimeoutError"}}let P5=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}};const Nx=t=>globalThis.DOMException===void 0?new P5(t):new DOMException(t),Bx=t=>{const e=t.reason===void 0?Nx("This operation was aborted."):t.reason;return e instanceof Error?e:Nx(e)};function A5(t,e,n,i){let r;const s=new Promise((l,a)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e===Number.POSITIVE_INFINITY){l(t);return}if(i={customTimers:{setTimeout,clearTimeout},...i},i.signal){const{signal:u}=i;u.aborted&&a(Bx(u)),u.addEventListener("abort",()=>{a(Bx(u))})}r=i.customTimers.setTimeout.call(void 0,()=>{if(typeof n=="function"){try{l(n())}catch(p){a(p)}return}const u=typeof n=="string"?n:`Promise timed out after ${e} milliseconds`,f=n instanceof Error?n:new E2(u);typeof t.cancel=="function"&&t.cancel(),a(f)},e),(async()=>{try{l(await t)}catch(u){a(u)}finally{i.customTimers.clearTimeout.call(void 0,r)}})()});return s.clear=()=>{clearTimeout(r),r=void 0},s}function O5(t,e,n){let i=0,r=t.length;for(;r>0;){const s=Math.trunc(r/2);let l=i+s;n(t[l],e)<=0?(i=++l,r-=s+1):r=s}return i}var ps=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)},Zi;class L5{constructor(){Zi.set(this,[])}enqueue(e,n){n={priority:0,...n};const i={priority:n.priority,run:e};if(this.size&&ps(this,Zi,"f")[this.size-1].priority>=n.priority){ps(this,Zi,"f").push(i);return}const r=O5(ps(this,Zi,"f"),i,(s,l)=>l.priority-s.priority);ps(this,Zi,"f").splice(r,0,i)}dequeue(){const e=ps(this,Zi,"f").shift();return e?.run}filter(e){return ps(this,Zi,"f").filter(n=>n.priority===e.priority).map(n=>n.run)}get size(){return ps(this,Zi,"f").length}}Zi=new WeakMap;var dt=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(t,n):r?r.value=n:e.set(t,n),n},ce=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)},kt,ol,al,Mr,Rd,ll,Su,li,za,Ln,ku,Rn,cl,Cr,Eu,jx,$x,C2,Vx,Hx,Cu,Xh,qh,Id,T2,Tu;class P2 extends Error{}class Wx extends T5{constructor(e){var n,i,r,s;if(super(),kt.add(this),ol.set(this,void 0),al.set(this,void 0),Mr.set(this,0),Rd.set(this,void 0),ll.set(this,void 0),Su.set(this,0),li.set(this,void 0),za.set(this,void 0),Ln.set(this,void 0),ku.set(this,void 0),Rn.set(this,0),cl.set(this,void 0),Cr.set(this,void 0),Eu.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:L5,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(i=(n=e.intervalCap)===null||n===void 0?void 0:n.toString())!==null&&i!==void 0?i:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(s=(r=e.interval)===null||r===void 0?void 0:r.toString())!==null&&s!==void 0?s:""}\` (${typeof e.interval})`);dt(this,ol,e.carryoverConcurrencyCount,"f"),dt(this,al,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),dt(this,Rd,e.intervalCap,"f"),dt(this,ll,e.interval,"f"),dt(this,Ln,new e.queueClass,"f"),dt(this,ku,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,dt(this,Eu,e.throwOnTimeout===!0,"f"),dt(this,Cr,e.autoStart===!1,"f")}get concurrency(){return ce(this,cl,"f")}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);dt(this,cl,e,"f"),ce(this,kt,"m",Id).call(this)}async add(e,n={}){return n={timeout:this.timeout,throwOnTimeout:ce(this,Eu,"f"),...n},new Promise((i,r)=>{ce(this,Ln,"f").enqueue(async()=>{var s,l,a;dt(this,Rn,(l=ce(this,Rn,"f"),l++,l),"f"),dt(this,Mr,(a=ce(this,Mr,"f"),a++,a),"f");try{if(!((s=n.signal)===null||s===void 0)&&s.aborted)throw new P2("The task was aborted.");let u=e({signal:n.signal});n.timeout&&(u=A5(Promise.resolve(u),n.timeout)),n.signal&&(u=Promise.race([u,ce(this,kt,"m",T2).call(this,n.signal)]));const f=await u;i(f),this.emit("completed",f)}catch(u){if(u instanceof E2&&!n.throwOnTimeout){i();return}r(u),this.emit("error",u)}finally{ce(this,kt,"m",C2).call(this)}},n),this.emit("add"),ce(this,kt,"m",Cu).call(this)})}async addAll(e,n){return Promise.all(e.map(async i=>this.add(i,n)))}start(){return ce(this,Cr,"f")?(dt(this,Cr,!1,"f"),ce(this,kt,"m",Id).call(this),this):this}pause(){dt(this,Cr,!0,"f")}clear(){dt(this,Ln,new(ce(this,ku,"f")),"f")}async onEmpty(){ce(this,Ln,"f").size!==0&&await ce(this,kt,"m",Tu).call(this,"empty")}async onSizeLessThan(e){ce(this,Ln,"f").size<e||await ce(this,kt,"m",Tu).call(this,"next",()=>ce(this,Ln,"f").size<e)}async onIdle(){ce(this,Rn,"f")===0&&ce(this,Ln,"f").size===0||await ce(this,kt,"m",Tu).call(this,"idle")}get size(){return ce(this,Ln,"f").size}sizeBy(e){return ce(this,Ln,"f").filter(e).length}get pending(){return ce(this,Rn,"f")}get isPaused(){return ce(this,Cr,"f")}}ol=new WeakMap,al=new WeakMap,Mr=new WeakMap,Rd=new WeakMap,ll=new WeakMap,Su=new WeakMap,li=new WeakMap,za=new WeakMap,Ln=new WeakMap,ku=new WeakMap,Rn=new WeakMap,cl=new WeakMap,Cr=new WeakMap,Eu=new WeakMap,kt=new WeakSet,jx=function(){return ce(this,al,"f")||ce(this,Mr,"f")<ce(this,Rd,"f")},$x=function(){return ce(this,Rn,"f")<ce(this,cl,"f")},C2=function(){var e;dt(this,Rn,(e=ce(this,Rn,"f"),e--,e),"f"),ce(this,kt,"m",Cu).call(this),this.emit("next")},Vx=function(){ce(this,kt,"m",qh).call(this),ce(this,kt,"m",Xh).call(this),dt(this,za,void 0,"f")},Hx=function(){const e=Date.now();if(ce(this,li,"f")===void 0){const n=ce(this,Su,"f")-e;if(n<0)dt(this,Mr,ce(this,ol,"f")?ce(this,Rn,"f"):0,"f");else return ce(this,za,"f")===void 0&&dt(this,za,setTimeout(()=>{ce(this,kt,"m",Vx).call(this)},n),"f"),!0}return!1},Cu=function(){if(ce(this,Ln,"f").size===0)return ce(this,li,"f")&&clearInterval(ce(this,li,"f")),dt(this,li,void 0,"f"),this.emit("empty"),ce(this,Rn,"f")===0&&this.emit("idle"),!1;if(!ce(this,Cr,"f")){const e=!ce(this,kt,"a",Hx);if(ce(this,kt,"a",jx)&&ce(this,kt,"a",$x)){const n=ce(this,Ln,"f").dequeue();return n?(this.emit("active"),n(),e&&ce(this,kt,"m",Xh).call(this),!0):!1}}return!1},Xh=function(){ce(this,al,"f")||ce(this,li,"f")!==void 0||(dt(this,li,setInterval(()=>{ce(this,kt,"m",qh).call(this)},ce(this,ll,"f")),"f"),dt(this,Su,Date.now()+ce(this,ll,"f"),"f"))},qh=function(){ce(this,Mr,"f")===0&&ce(this,Rn,"f")===0&&ce(this,li,"f")&&(clearInterval(ce(this,li,"f")),dt(this,li,void 0,"f")),dt(this,Mr,ce(this,ol,"f")?ce(this,Rn,"f"):0,"f"),ce(this,kt,"m",Id).call(this)},Id=function(){for(;ce(this,kt,"m",Cu).call(this););},T2=async function(e){return new Promise((n,i)=>{e.addEventListener("abort",()=>{i(new P2("The task was aborted."))},{once:!0})})},Tu=async function(e,n){return new Promise(i=>{const r=()=>{n&&!n()||(this.off(e,r),i())};this.on(e,r)})};function M5(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function D5(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var R5=function(){function t(n){var i=this;this._insertTag=function(r){var s;i.tags.length===0?i.insertionPoint?s=i.insertionPoint.nextSibling:i.prepend?s=i.container.firstChild:s=i.before:s=i.tags[i.tags.length-1].nextSibling,i.container.insertBefore(r,s),i.tags.push(r)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(n){n.forEach(this._insertTag)},e.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(D5(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var r=M5(i);try{r.insertRule(n,r.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(n));this.ctr++},e.flush=function(){this.tags.forEach(function(n){return n.parentNode&&n.parentNode.removeChild(n)}),this.tags=[],this.ctr=0},t}(),en="-ms-",Ud="-moz-",Ve="-webkit-",A2="comm",gy="rule",my="decl",I5="@import",O2="@keyframes",U5=Math.abs,Mf=String.fromCharCode,F5=Object.assign;function z5(t,e){return Yt(t,0)^45?(((e<<2^Yt(t,0))<<2^Yt(t,1))<<2^Yt(t,2))<<2^Yt(t,3):0}function L2(t){return t.trim()}function N5(t,e){return(t=e.exec(t))?t[0]:t}function Ye(t,e,n){return t.replace(e,n)}function am(t,e){return t.indexOf(e)}function Yt(t,e){return t.charCodeAt(e)|0}function Vl(t,e,n){return t.slice(e,n)}function Oi(t){return t.length}function vy(t){return t.length}function Kc(t,e){return e.push(t),t}function B5(t,e){return t.map(e).join("")}var Df=1,Go=1,M2=0,Cn=0,Lt=0,na="";function Rf(t,e,n,i,r,s,l){return{value:t,root:e,parent:n,type:i,props:r,children:s,line:Df,column:Go,length:l,return:""}}function Ca(t,e){return F5(Rf("",null,null,"",null,null,0),t,{length:-t.length},e)}function j5(){return Lt}function $5(){return Lt=Cn>0?Yt(na,--Cn):0,Go--,Lt===10&&(Go=1,Df--),Lt}function Nn(){return Lt=Cn<M2?Yt(na,Cn++):0,Go++,Lt===10&&(Go=1,Df++),Lt}function Bi(){return Yt(na,Cn)}function Pu(){return Cn}function cc(t,e){return Vl(na,t,e)}function Hl(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function D2(t){return Df=Go=1,M2=Oi(na=t),Cn=0,[]}function R2(t){return na="",t}function Au(t){return L2(cc(Cn-1,lm(t===91?t+2:t===40?t+1:t)))}function V5(t){for(;(Lt=Bi())&&Lt<33;)Nn();return Hl(t)>2||Hl(Lt)>3?"":" "}function H5(t,e){for(;--e&&Nn()&&!(Lt<48||Lt>102||Lt>57&&Lt<65||Lt>70&&Lt<97););return cc(t,Pu()+(e<6&&Bi()==32&&Nn()==32))}function lm(t){for(;Nn();)switch(Lt){case t:return Cn;case 34:case 39:t!==34&&t!==39&&lm(Lt);break;case 40:t===41&&lm(t);break;case 92:Nn();break}return Cn}function W5(t,e){for(;Nn()&&t+Lt!==47+10&&!(t+Lt===42+42&&Bi()===47););return"/*"+cc(e,Cn-1)+"*"+Mf(t===47?t:Nn())}function G5(t){for(;!Hl(Bi());)Nn();return cc(t,Cn)}function Y5(t){return R2(Ou("",null,null,null,[""],t=D2(t),0,[0],t))}function Ou(t,e,n,i,r,s,l,a,u){for(var f=0,p=0,m=l,o=0,c=0,d=0,h=1,g=1,y=1,v=0,_="",b=r,x=s,w=i,S=_;g;)switch(d=v,v=Nn()){case 40:if(d!=108&&Yt(S,m-1)==58){am(S+=Ye(Au(v),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:S+=Au(v);break;case 9:case 10:case 13:case 32:S+=V5(d);break;case 92:S+=H5(Pu()-1,7);continue;case 47:switch(Bi()){case 42:case 47:Kc(K5(W5(Nn(),Pu()),e,n),u);break;default:S+="/"}break;case 123*h:a[f++]=Oi(S)*y;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+p:c>0&&Oi(S)-m&&Kc(c>32?Yx(S+";",i,n,m-1):Yx(Ye(S," ","")+";",i,n,m-2),u);break;case 59:S+=";";default:if(Kc(w=Gx(S,e,n,f,p,r,a,_,b=[],x=[],m),s),v===123)if(p===0)Ou(S,e,w,w,b,s,m,a,x);else switch(o===99&&Yt(S,3)===110?100:o){case 100:case 109:case 115:Ou(t,w,w,i&&Kc(Gx(t,w,w,0,0,r,a,_,r,b=[],m),x),r,x,m,a,i?b:x);break;default:Ou(S,w,w,w,[""],x,0,a,x)}}f=p=c=0,h=y=1,_=S="",m=l;break;case 58:m=1+Oi(S),c=d;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&$5()==125)continue}switch(S+=Mf(v),v*h){case 38:y=p>0?1:(S+="\f",-1);break;case 44:a[f++]=(Oi(S)-1)*y,y=1;break;case 64:Bi()===45&&(S+=Au(Nn())),o=Bi(),p=m=Oi(_=S+=G5(Pu())),v++;break;case 45:d===45&&Oi(S)==2&&(h=0)}}return s}function Gx(t,e,n,i,r,s,l,a,u,f,p){for(var m=r-1,o=r===0?s:[""],c=vy(o),d=0,h=0,g=0;d<i;++d)for(var y=0,v=Vl(t,m+1,m=U5(h=l[d])),_=t;y<c;++y)(_=L2(h>0?o[y]+" "+v:Ye(v,/&\f/g,o[y])))&&(u[g++]=_);return Rf(t,e,n,r===0?gy:a,u,f,p)}function K5(t,e,n){return Rf(t,e,n,A2,Mf(j5()),Vl(t,2,-2),0)}function Yx(t,e,n,i){return Rf(t,e,n,my,Vl(t,0,i),Vl(t,i+1,-1),i)}function To(t,e){for(var n="",i=vy(t),r=0;r<i;r++)n+=e(t[r],r,t,e)||"";return n}function Q5(t,e,n,i){switch(t.type){case I5:case my:return t.return=t.return||t.value;case A2:return"";case O2:return t.return=t.value+"{"+To(t.children,i)+"}";case gy:t.value=t.props.join(",")}return Oi(n=To(t.children,i))?t.return=t.value+"{"+n+"}":""}function Z5(t){var e=vy(t);return function(n,i,r,s){for(var l="",a=0;a<e;a++)l+=t[a](n,i,r,s)||"";return l}}function X5(t){return function(e){e.root||(e=e.return)&&t(e)}}function q5(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var J5=function(t,e,n){for(var i=0,r=0;i=r,r=Bi(),i===38&&r===12&&(e[n]=1),!Hl(r);)Nn();return cc(t,Cn)},e6=function(t,e){var n=-1,i=44;do switch(Hl(i)){case 0:i===38&&Bi()===12&&(e[n]=1),t[n]+=J5(Cn-1,e,n);break;case 2:t[n]+=Au(i);break;case 4:if(i===44){t[++n]=Bi()===58?"&\f":"",e[n]=t[n].length;break}default:t[n]+=Mf(i)}while(i=Nn());return t},t6=function(t,e){return R2(e6(D2(t),e))},Kx=new WeakMap,n6=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var e=t.value,n=t.parent,i=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&e.charCodeAt(0)!==58&&!Kx.get(n))&&!i){Kx.set(t,!0);for(var r=[],s=t6(e,r),l=n.props,a=0,u=0;a<s.length;a++)for(var f=0;f<l.length;f++,u++)t.props[u]=r[a]?s[a].replace(/&\f/g,l[f]):l[f]+" "+s[a]}}},i6=function(t){if(t.type==="decl"){var e=t.value;e.charCodeAt(0)===108&&e.charCodeAt(2)===98&&(t.return="",t.value="")}};function I2(t,e){switch(z5(t,e)){case 5103:return Ve+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ve+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Ve+t+Ud+t+en+t+t;case 6828:case 4268:return Ve+t+en+t+t;case 6165:return Ve+t+en+"flex-"+t+t;case 5187:return Ve+t+Ye(t,/(\w+).+(:[^]+)/,Ve+"box-$1$2"+en+"flex-$1$2")+t;case 5443:return Ve+t+en+"flex-item-"+Ye(t,/flex-|-self/,"")+t;case 4675:return Ve+t+en+"flex-line-pack"+Ye(t,/align-content|flex-|-self/,"")+t;case 5548:return Ve+t+en+Ye(t,"shrink","negative")+t;case 5292:return Ve+t+en+Ye(t,"basis","preferred-size")+t;case 6060:return Ve+"box-"+Ye(t,"-grow","")+Ve+t+en+Ye(t,"grow","positive")+t;case 4554:return Ve+Ye(t,/([^-])(transform)/g,"$1"+Ve+"$2")+t;case 6187:return Ye(Ye(Ye(t,/(zoom-|grab)/,Ve+"$1"),/(image-set)/,Ve+"$1"),t,"")+t;case 5495:case 3959:return Ye(t,/(image-set\([^]*)/,Ve+"$1$`$1");case 4968:return Ye(Ye(t,/(.+:)(flex-)?(.*)/,Ve+"box-pack:$3"+en+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ve+t+t;case 4095:case 3583:case 4068:case 2532:return Ye(t,/(.+)-inline(.+)/,Ve+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Oi(t)-1-e>6)switch(Yt(t,e+1)){case 109:if(Yt(t,e+4)!==45)break;case 102:return Ye(t,/(.+:)(.+)-([^]+)/,"$1"+Ve+"$2-$3$1"+Ud+(Yt(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~am(t,"stretch")?I2(Ye(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Yt(t,e+1)!==115)break;case 6444:switch(Yt(t,Oi(t)-3-(~am(t,"!important")&&10))){case 107:return Ye(t,":",":"+Ve)+t;case 101:return Ye(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ve+(Yt(t,14)===45?"inline-":"")+"box$3$1"+Ve+"$2$3$1"+en+"$2box$3")+t}break;case 5936:switch(Yt(t,e+11)){case 114:return Ve+t+en+Ye(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Ve+t+en+Ye(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Ve+t+en+Ye(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Ve+t+en+t+t}return t}var r6=function(t,e,n,i){if(t.length>-1&&!t.return)switch(t.type){case my:t.return=I2(t.value,t.length);break;case O2:return To([Ca(t,{value:Ye(t.value,"@","@"+Ve)})],i);case gy:if(t.length)return B5(t.props,function(r){switch(N5(r,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return To([Ca(t,{props:[Ye(r,/:(read-\w+)/,":"+Ud+"$1")]})],i);case"::placeholder":return To([Ca(t,{props:[Ye(r,/:(plac\w+)/,":"+Ve+"input-$1")]}),Ca(t,{props:[Ye(r,/:(plac\w+)/,":"+Ud+"$1")]}),Ca(t,{props:[Ye(r,/:(plac\w+)/,en+"input-$1")]})],i)}return""})}},s6=[r6],o6=function(t){var e=t.key;if(e==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(d){var h=d.getAttribute("data-emotion");h.indexOf(" ")!==-1&&(document.head.appendChild(d),d.setAttribute("data-s",""))})}var i=t.stylisPlugins||s6,r={},s,l=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+e+' "]'),function(d){for(var h=d.getAttribute("data-emotion").split(" "),g=1;g<h.length;g++)r[h[g]]=!0;l.push(d)});var a,u=[n6,i6];{var f,p=[Q5,X5(function(d){f.insert(d)})],m=Z5(u.concat(i,p)),o=function(d){return To(Y5(d),m)};a=function(d,h,g,y){f=g,o(d?d+"{"+h.styles+"}":h.styles),y&&(c.inserted[h.name]=!0)}}var c={key:e,sheet:new R5({key:e,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:r,registered:{},insert:a};return c.sheet.hydrate(l),c},cm={},a6={get exports(){return cm},set exports(t){cm=t}},Ge={},Qx;function l6(){if(Qx)return Ge;Qx=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,i=t?Symbol.for("react.fragment"):60107,r=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,l=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,f=t?Symbol.for("react.concurrent_mode"):60111,p=t?Symbol.for("react.forward_ref"):60112,m=t?Symbol.for("react.suspense"):60113,o=t?Symbol.for("react.suspense_list"):60120,c=t?Symbol.for("react.memo"):60115,d=t?Symbol.for("react.lazy"):60116,h=t?Symbol.for("react.block"):60121,g=t?Symbol.for("react.fundamental"):60117,y=t?Symbol.for("react.responder"):60118,v=t?Symbol.for("react.scope"):60119;function _(x){if(typeof x=="object"&&x!==null){var w=x.$$typeof;switch(w){case e:switch(x=x.type,x){case u:case f:case i:case s:case r:case m:return x;default:switch(x=x&&x.$$typeof,x){case a:case p:case d:case c:case l:return x;default:return w}}case n:return w}}}function b(x){return _(x)===f}return Ge.AsyncMode=u,Ge.ConcurrentMode=f,Ge.ContextConsumer=a,Ge.ContextProvider=l,Ge.Element=e,Ge.ForwardRef=p,Ge.Fragment=i,Ge.Lazy=d,Ge.Memo=c,Ge.Portal=n,Ge.Profiler=s,Ge.StrictMode=r,Ge.Suspense=m,Ge.isAsyncMode=function(x){return b(x)||_(x)===u},Ge.isConcurrentMode=b,Ge.isContextConsumer=function(x){return _(x)===a},Ge.isContextProvider=function(x){return _(x)===l},Ge.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},Ge.isForwardRef=function(x){return _(x)===p},Ge.isFragment=function(x){return _(x)===i},Ge.isLazy=function(x){return _(x)===d},Ge.isMemo=function(x){return _(x)===c},Ge.isPortal=function(x){return _(x)===n},Ge.isProfiler=function(x){return _(x)===s},Ge.isStrictMode=function(x){return _(x)===r},Ge.isSuspense=function(x){return _(x)===m},Ge.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===i||x===f||x===s||x===r||x===m||x===o||typeof x=="object"&&x!==null&&(x.$$typeof===d||x.$$typeof===c||x.$$typeof===l||x.$$typeof===a||x.$$typeof===p||x.$$typeof===g||x.$$typeof===y||x.$$typeof===v||x.$$typeof===h)},Ge.typeOf=_,Ge}(function(t){t.exports=l6()})(a6);var U2=cm,c6={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},u6={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},F2={};F2[U2.ForwardRef]=c6;F2[U2.Memo]=u6;var d6=!0;function f6(t,e,n){var i="";return n.split(" ").forEach(function(r){t[r]!==void 0?e.push(t[r]+";"):i+=r+" "}),i}var z2=function(t,e,n){var i=t.key+"-"+e.name;(n===!1||d6===!1)&&t.registered[i]===void 0&&(t.registered[i]=e.styles)},h6=function(t,e,n){z2(t,e,n);var i=t.key+"-"+e.name;if(t.inserted[e.name]===void 0){var r=e;do t.insert(e===r?"."+i:"",r,t.sheet,!0),r=r.next;while(r!==void 0)}};function p6(t){for(var e=0,n,i=0,r=t.length;r>=4;++i,r-=4)n=t.charCodeAt(i)&255|(t.charCodeAt(++i)&255)<<8|(t.charCodeAt(++i)&255)<<16|(t.charCodeAt(++i)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(t.charCodeAt(i+2)&255)<<16;case 2:e^=(t.charCodeAt(i+1)&255)<<8;case 1:e^=t.charCodeAt(i)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var g6={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},m6=/[A-Z]|^ms/g,v6=/_EMO_([^_]+?)_([^]*?)_EMO_/g,N2=function(t){return t.charCodeAt(1)===45},Zx=function(t){return t!=null&&typeof t!="boolean"},Jh=q5(function(t){return N2(t)?t:t.replace(m6,"-$&").toLowerCase()}),Xx=function(t,e){switch(t){case"animation":case"animationName":if(typeof e=="string")return e.replace(v6,function(n,i,r){return Li={name:i,styles:r,next:Li},i})}return g6[t]!==1&&!N2(t)&&typeof e=="number"&&e!==0?e+"px":e};function Wl(t,e,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Li={name:n.name,styles:n.styles,next:Li},n.name;if(n.styles!==void 0){var i=n.next;if(i!==void 0)for(;i!==void 0;)Li={name:i.name,styles:i.styles,next:Li},i=i.next;var r=n.styles+";";return r}return y6(t,e,n)}case"function":{if(t!==void 0){var s=Li,l=n(t);return Li=s,Wl(t,e,l)}break}}if(e==null)return n;var a=e[n];return a!==void 0?a:n}function y6(t,e,n){var i="";if(Array.isArray(n))for(var r=0;r<n.length;r++)i+=Wl(t,e,n[r])+";";else for(var s in n){var l=n[s];if(typeof l!="object")e!=null&&e[l]!==void 0?i+=s+"{"+e[l]+"}":Zx(l)&&(i+=Jh(s)+":"+Xx(s,l)+";");else if(Array.isArray(l)&&typeof l[0]=="string"&&(e==null||e[l[0]]===void 0))for(var a=0;a<l.length;a++)Zx(l[a])&&(i+=Jh(s)+":"+Xx(s,l[a])+";");else{var u=Wl(t,e,l);switch(s){case"animation":case"animationName":{i+=Jh(s)+":"+u+";";break}default:i+=s+"{"+u+"}"}}}return i}var qx=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Li,_6=function(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var i=!0,r="";Li=void 0;var s=t[0];s==null||s.raw===void 0?(i=!1,r+=Wl(n,e,s)):r+=s[0];for(var l=1;l<t.length;l++)r+=Wl(n,e,t[l]),i&&(r+=s[l]);qx.lastIndex=0;for(var a="",u;(u=qx.exec(r))!==null;)a+="-"+u[1];var f=p6(r)+a;return{name:f,styles:r,next:Li}},b6=function(t){return t()},x6=k.useInsertionEffect?k.useInsertionEffect:!1,w6=x6||b6,If={}.hasOwnProperty,B2=k.createContext(typeof HTMLElement<"u"?o6({key:"css"}):null);B2.Provider;var S6=function(t){return k.forwardRef(function(e,n){var i=k.useContext(B2);return t(e,i,n)})},k6=k.createContext({}),um="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",j2=function(t,e){var n={};for(var i in e)If.call(e,i)&&(n[i]=e[i]);return n[um]=t,n},E6=function(t){var e=t.cache,n=t.serialized,i=t.isStringTag;return z2(e,n,i),w6(function(){return h6(e,n,i)}),null},$2=S6(function(t,e,n){var i=t.css;typeof i=="string"&&e.registered[i]!==void 0&&(i=e.registered[i]);var r=t[um],s=[i],l="";typeof t.className=="string"?l=f6(e.registered,s,t.className):t.className!=null&&(l=t.className+" ");var a=_6(s,void 0,k.useContext(k6));l+=e.key+"-"+a.name;var u={};for(var f in t)If.call(t,f)&&f!=="css"&&f!==um&&(u[f]=t[f]);return u.ref=n,u.className=l,k.createElement(k.Fragment,null,k.createElement(E6,{cache:e,serialized:a,isStringTag:typeof r=="string"}),k.createElement(r,u))}),Gl={},C6={get exports(){return Gl},set exports(t){Gl=t}},Ta={},Jx;function T6(){if(Jx)return Ta;Jx=1;var t=ae,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(a,u,f){var p,m={},o=null,c=null;f!==void 0&&(o=""+f),u.key!==void 0&&(o=""+u.key),u.ref!==void 0&&(c=u.ref);for(p in u)i.call(u,p)&&!s.hasOwnProperty(p)&&(m[p]=u[p]);if(a&&a.defaultProps)for(p in u=a.defaultProps,u)m[p]===void 0&&(m[p]=u[p]);return{$$typeof:e,type:a,key:o,ref:c,props:m,_owner:r.current}}return Ta.Fragment=n,Ta.jsx=l,Ta.jsxs=l,Ta}(function(t){t.exports=T6()})(C6);const P6=Gl.Fragment,ew=Gl.jsx,tw=Gl.jsxs;var Xs=P6;function re(t,e,n){return If.call(e,"css")?ew($2,j2(t,e),n):ew(t,e,n)}function vn(t,e,n){return If.call(e,"css")?tw($2,j2(t,e),n):tw(t,e,n)}const nw=(t,e)=>{let n,i,r;const s=(l,a,u)=>f=>{const p=performance.now();return setTimeout(()=>{if(!r){n=void 0,i=void 0;return}const m=(async()=>e(...r))();r=void 0,m.then(a).catch(d=>{console.error(d),u(d)});let o,c;i=new Promise((d,h)=>{o=d,c=h}),n=m.then(s(p,o,c)).catch(d=>(console.error(d),s(l,o,c)(d)))},t-(p-l)),f};return(...l)=>{if(r=l,n)return i;{const a=performance.now(),u=(async()=>e(...l))();r=void 0;let f,p;return i=new Promise((m,o)=>{f=m,p=o}),n=u.then(s(a,f,p)).catch(m=>(console.error(m),s(a,f,p)(m))),u}}},A6=an`
931
+ position: relative;
932
+ display: grid;
933
+ grid-column: 1;
934
+ grid-row: 1;
935
+ display: grid;
936
+ height: 100%;
937
+ width: 100%;
938
+ justify-items: center;
939
+ align-items: center;
940
+
941
+ canvas {
942
+ pointer-events: none;
943
+ position: absolute;
944
+ inset: 0;
945
+ grid-column: 1;
946
+ grid-row: 1;
947
+ height: 100%;
948
+ width: 100%;
949
+ }
950
+
951
+ .loading {
952
+ grid-column: 1;
953
+ grid-row: 1;
954
+ }
955
+ `,O6=({loading:t,needsInitialInteraction:e,togglePlay:n,setCanvasRef:i})=>vn("div",{css:A6,onClick:n,children:[re("canvas",{ref:i}),e?re("svg",{xmlns:"http://www.w3.org/2000/svg",width:"60",height:"60",viewBox:"0 0 60 60",fill:"black",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-play",children:re("polygon",{points:"12 7 45 28 12 50 12 7"})}):t?re("svg",{className:"loading",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",shapeRendering:"auto",animationPlayState:"running",animationDelay:"0s"},width:"100",height:"100",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",children:re("circle",{cx:"50",cy:"50",fill:"none",stroke:"currentColor",strokeWidth:"9",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138",style:{animationPlayState:"running",animationDelay:"0s"},children:re("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1",style:{animationPlayState:"running",animationDelay:"0s"}})})}):null]}),iw=({ref:t,defaultValue:e})=>{const[n,i]=k.useState(e),[r,s]=k.useState(!1),l=a=>{if(s(!0),!t.current)return;const{clientX:u}=a,{left:f,right:p}=t.current.getBoundingClientRect();i(Math.min(Math.max((u-f)/(p-f),0),1))};return k.useEffect(()=>{if(!r)return;const a=()=>s(!1),u=f=>{if(!t.current)return;const{clientX:p}=f,{left:m,right:o}=t.current.getBoundingClientRect();i(Math.min(Math.max((p-m)/(o-m),0),1))};return document.addEventListener("mousemove",u),document.addEventListener("mouseup",a),()=>{document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",a)}},[r]),{value:n,scrubbing:r,scrub:l}},L6=JSON.parse(`[{"tag":"zu","name":"isiZulu","originalName":"isiZulu","locale":"zu-ZA"},{"tag":"zh","name":"Chinese","originalName":"中文","locale":"zh-CHS"},{"tag":"yo","name":"Yoruba","originalName":"Yoruba","locale":"yo-NG"},{"tag":"xh","name":"isiXhosa","originalName":"isiXhosa","locale":"xh-ZA"},{"tag":"wo","name":"Wolof","originalName":"Wolof","locale":"wo-SN"},{"tag":"vi","name":"Vietnamese","originalName":"Ti\xeáng Vi\xeạt","locale":"vi"},{"tag":"uz","name":"Uzbek","originalName":"U'zbek","locale":"uz"},{"tag":"ur","name":"Urdu","originalName":"اُردو","locale":"ur"},{"tag":"uk","name":"Ukrainian","originalName":"україньска","locale":"uk"},{"tag":"ug","name":"Uyghur","originalName":"ئۇيغۇرچە","locale":"ug-CN"},{"tag":"tzm","name":"Tamazight","originalName":"Tamazight","locale":"tzm-Latn-DZ"},{"tag":"tt","name":"Tatar","originalName":"Татар","locale":"tt"},{"tag":"tr","name":"Turkish","originalName":"T\xfcrk\xe7e","locale":"tr"},{"tag":"tn","name":"Setswana","originalName":"Setswana","locale":"tn-ZA"},{"tag":"tk","name":"Turkmen","originalName":"t\xfcrkmen\xe7e","locale":"tk-TM"},{"tag":"th","name":"Thai","originalName":"ไทย","locale":"th"},{"tag":"tg","name":"Tajik","originalName":"Тоҷикӣ","locale":"tg-Cyrl-TJ"},{"tag":"te","name":"Telugu","originalName":"తెలుగు","locale":"te"},{"tag":"ta","name":"Tamil","originalName":"தமிழ்","locale":"ta"},{"tag":"syr","name":"Syriac","originalName":"ܣܘܪܝܝܐ","locale":"syr"},{"tag":"sw","name":"Kiswahili","originalName":"Kiswahili","locale":"sw"},{"tag":"sv","name":"Swedish","originalName":"svenska","locale":"sv"},{"tag":"sr","name":"Serbian","originalName":"srpski","locale":"sr"},{"tag":"sq","name":"Albanian","originalName":"shqipe","locale":"sq"},{"tag":"sms","name":"Sami","originalName":"s\xe4\xe4m\xb4ǩi\xf5ll","locale":"sms-FI"},{"tag":"smn","name":"Sami","originalName":"s\xe4mikiel\xe2","locale":"smn-FI"},{"tag":"smj","name":"Sami","originalName":"julevus\xe1megiella","locale":"smj-NO"},{"tag":"sma","name":"Sami","originalName":"\xe5arjelsaemiengiele","locale":"sma-NO"},{"tag":"sl","name":"Slovenian","originalName":"slovenski","locale":"sl"},{"tag":"sk","name":"Slovak","originalName":"slovenčina","locale":"sk"},{"tag":"si","name":"Sinhala","originalName":"සිංහ","locale":"si-LK"},{"tag":"se","name":"Sami","originalName":"davvis\xe1megiella","locale":"se-FI"},{"tag":"sah","name":"Yakut","originalName":"саха","locale":"sah-RU"},{"tag":"sa","name":"Sanskrit","originalName":"संस्कृत","locale":"sa"},{"tag":"rw","name":"Kinyarwanda","originalName":"Kinyarwanda","locale":"rw-RW"},{"tag":"ru","name":"Russian","originalName":"русский","locale":"ru"},{"tag":"ro","name":"Romanian","originalName":"rom\xe2nă","locale":"ro"},{"tag":"rm","name":"Romansh","originalName":"Rumantsch","locale":"rm-CH"},{"tag":"quz","name":"Quechua","originalName":"runasimi","locale":"quz-BO"},{"tag":"qut","name":"K'iche","originalName":"K'iche","locale":"qut-GT"},{"tag":"pt","name":"Portuguese","originalName":"Portugu\xeas","locale":"pt"},{"tag":"ps","name":"Pashto","originalName":"پښتو","locale":"ps-AF"},{"tag":"prs","name":"Dari","originalName":"درى","locale":"prs-AF"},{"tag":"pl","name":"Polish","originalName":"polski","locale":"pl"},{"tag":"pa","name":"Punjabi","originalName":"ਪੰਜਾਬੀ","locale":"pa"},{"tag":"or","name":"Oriya","originalName":"ଓଡ଼ିଆ","locale":"or-IN"},{"tag":"oc","name":"Occitan","originalName":"Occitan","locale":"oc-FR"},{"tag":"nso","name":"Sesotho sa Leboa","originalName":"Sesotho sa Leboa","locale":"nso-ZA"},{"tag":"no","name":"Norwegian","originalName":"norsk","locale":"no"},{"tag":"nn","name":"Norwegian, Nynorsk","originalName":"norsk, nynorsk","locale":"nn-NO"},{"tag":"nl","name":"Dutch","originalName":"Nederlands","locale":"nl"},{"tag":"ne","name":"Nepali","originalName":"नेपाली","locale":"ne-NP"},{"tag":"nb","name":"Norwegian, Bokm\xe5l","originalName":"norsk, bokm\xe5l","locale":"nb-NO"},{"tag":"mt","name":"Maltese","originalName":"Malti","locale":"mt-MT"},{"tag":"ms","name":"Malay","originalName":"Bahasa Malaysia","locale":"ms"},{"tag":"mr","name":"Marathi","originalName":"मराठी","locale":"mr"},{"tag":"moh","name":"Mohawk","originalName":"Kanien'k\xe9ha","locale":"moh-CA"},{"tag":"mn","name":"Mongolian","originalName":"Монгол хэл","locale":"mn"},{"tag":"ml","name":"Malayalam","originalName":"മലയാളം","locale":"ml-IN"},{"tag":"mk","name":"Macedonian","originalName":"македонски јазик","locale":"mk"},{"tag":"mi","name":"Maori","originalName":"Reo Māori","locale":"mi-NZ"},{"tag":"lv","name":"Latvian","originalName":"latviešu","locale":"lv"},{"tag":"lt","name":"Lithuanian","originalName":"lietuvių","locale":"lt"},{"tag":"lo","name":"Lao","originalName":"ລາວ","locale":"lo-LA"},{"tag":"lb","name":"Luxembourgish","originalName":"L\xebtzebuergesch","locale":"lb-LU"},{"tag":"ky","name":"Kyrgyz","originalName":"Кыргыз","locale":"ky"},{"tag":"kok","name":"Konkani","originalName":"कोंकणी","locale":"kok"},{"tag":"ko","name":"Korean","originalName":"한국어","locale":"ko"},{"tag":"kn","name":"Kannada","originalName":"ಕನ್ನಡ","locale":"kn"},{"tag":"km","name":"Khmer","originalName":"ខ្មែរ","locale":"km-KH"},{"tag":"kl","name":"Greenlandic","originalName":"kalaallisut","locale":"kl-GL"},{"tag":"kk","name":"Kazakh","originalName":"Қазащb","locale":"kk"},{"tag":"ka","name":"Georgian","originalName":"ქართული","locale":"ka"},{"tag":"ja","name":"Japanese","originalName":"日本語","locale":"ja"},{"tag":"iu","name":"Inuktitut","originalName":"ᐃᓄᒃᑎᑐᑦ","locale":"iu-Cans-CA"},{"tag":"it","name":"Italian","originalName":"italiano","locale":"it"},{"tag":"is","name":"Icelandic","originalName":"\xedslenska","locale":"is"},{"tag":"ii","name":"Yi","originalName":"ꆈꌠꁱꂷ","locale":"ii-CN"},{"tag":"ig","name":"Igbo","originalName":"Igbo","locale":"ig-NG"},{"tag":"id","name":"Indonesian","originalName":"Bahasa Indonesia","locale":"id"},{"tag":"hy","name":"Armenian","originalName":"Հայերեն","locale":"hy"},{"tag":"hu","name":"Hungarian","originalName":"magyar","locale":"hu"},{"tag":"hsb","name":"Upper Sorbian","originalName":"hornjoserbšćina","locale":"hsb-DE"},{"tag":"hr","name":"Croatian","originalName":"hrvatski","locale":"hr"},{"tag":"hi","name":"Hindi","originalName":"हिंदी","locale":"hi"},{"tag":"he","name":"Hebrew","originalName":"עברית","locale":"he"},{"tag":"ha","name":"Hausa","originalName":"Hausa","locale":"ha-Latn-NG"},{"tag":"gu","name":"Gujarati","originalName":"ગુજરાતી","locale":"gu"},{"tag":"gsw","name":"Alsatian","originalName":"Els\xe4ssisch","locale":"gsw-FR"},{"tag":"gl","name":"Galician","originalName":"galego","locale":"gl"},{"tag":"gd","name":"Scottish Gaelic","originalName":"G\xe0idhlig","locale":"gd-GB"},{"tag":"ga","name":"Irish","originalName":"Gaeilge","locale":"ga-IE"},{"tag":"fy","name":"Frisian","originalName":"Frysk","locale":"fy-NL"},{"tag":"fr","name":"French","originalName":"fran\xe7ais","locale":"fr"},{"tag":"fo","name":"Faroese","originalName":"f\xf8royskt","locale":"fo"},{"tag":"fil","name":"Filipino","originalName":"Filipino","locale":"fil-PH"},{"tag":"fi","name":"Finnish","originalName":"suomi","locale":"fi"},{"tag":"fa","name":"Persian","originalName":"فارسى","locale":"fa"},{"tag":"eu","name":"Basque","originalName":"euskara","locale":"eu"},{"tag":"et","name":"Estonian","originalName":"eesti","locale":"et"},{"tag":"es","name":"Spanish","originalName":"espa\xf1ol","locale":"es"},{"tag":"en","name":"English","originalName":"English","locale":"en"},{"tag":"el","name":"Greek","originalName":"ελληνικά","locale":"el"},{"tag":"dv","name":"Divehi","originalName":"ދިވެހިބަސް","locale":"dv"},{"tag":"dsb","name":"Lower Sorbian","originalName":"dolnoserbšćina","locale":"dsb-DE"},{"tag":"de","name":"German","originalName":"Deutsch","locale":"de"},{"tag":"da","name":"Danish","originalName":"dansk","locale":"da"},{"tag":"cy","name":"Welsh","originalName":"Cymraeg","locale":"cy-GB"},{"tag":"cs","name":"Czech","originalName":"čeština","locale":"cs"},{"tag":"co","name":"Corsican","originalName":"Corsu","locale":"co-FR"},{"tag":"ca","name":"Catalan","originalName":"catal\xe0","locale":"ca"},{"tag":"bs","name":"Bosnian","originalName":"босански","locale":"bs-Cyrl-BA"},{"tag":"br","name":"Breton","originalName":"brezhoneg","locale":"br-FR"},{"tag":"bo","name":"Tibetan","originalName":"བོད་ཡིག","locale":"bo-CN"},{"tag":"bn","name":"Bengali","originalName":"বাংলা","locale":"bn-BD"},{"tag":"bg","name":"Bulgarian","originalName":"български","locale":"bg"},{"tag":"be","name":"Belarusian","originalName":"Беларускі","locale":"be"},{"tag":"ba","name":"Bashkir","originalName":"Башҡорт","locale":"ba-RU"},{"tag":"az","name":"Azeri","originalName":"Azərbaycan\xadılı","locale":"az"},{"tag":"as","name":"Assamese","originalName":"অসমীয়া","locale":"as-IN"},{"tag":"arn","name":"Mapudungun","originalName":"Mapudungun","locale":"arn-CL"},{"tag":"ar","name":"Arabic","originalName":"العربية","locale":"ar"},{"tag":"am","name":"Amharic","originalName":"አማርኛ","locale":"am-ET"},{"tag":"af","name":"Afrikaans","originalName":"Afrikaans","locale":"af"},{"tag":"iv","name":"Invariant Language","originalName":"Invariant Language","locale":""},{"tag":"Two letter","name":"English","originalName":"Native","locale":"Culture .NET"}]`),rw=t=>L6.find(e=>e.tag===t)?.name,M6=t=>{const[e,n]=k.useState(()=>{const i=localStorage.getItem(t);return i?JSON.parse(i):{}});return k.useEffect(()=>{localStorage.setItem(t,JSON.stringify(e))},[t,e]),(i,r)=>(k.useEffect(()=>{n(s=>({...s,[i]:r}))},[]),[e[i],s=>n(typeof s=="function"?l=>({...l,[i]:s(l[i])}):l=>({...l,[i]:s}))])},D6=an`
956
+ position: relative;
957
+ grid-column: 1;
958
+ grid-row: 1;
959
+ align-self: end;
960
+ height: calc(4.8rem + var(--background-padding));
961
+ width: 100%;
962
+ padding: 0 2rem;
963
+ margin: 0 auto;
964
+
965
+ /* subtle background black gradient for scenes with high brightness to properly display white progress bar */
966
+ padding-top: var(--background-padding);
967
+ background: linear-gradient(0deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) calc(100% - 1rem), rgba(0,0,0,0) 100%);
968
+
969
+ .progress-bar {
970
+ position: relative;
971
+ height: .4rem;
972
+ cursor: pointer;
973
+ user-select: none;
974
+ transition: transform .2s ease-in-out;
975
+
976
+
977
+ &:hover {
978
+ .background-bar {
979
+ transform: scaleY(1.5);
980
+ }
981
+ }
982
+ .background-bar {
983
+ position: absolute;
984
+ inset: 0;
985
+ background-color: hsla(0, 100%, 100%, .2);
986
+ }
987
+
988
+ .cursor-time {
989
+ pointer-events: none;
990
+ position: absolute;
991
+ top: -2rem;
992
+ width: 5rem;
993
+ margin-left: -2.5rem;
994
+ display: flex;
995
+ justify-content: center;
996
+ }
997
+
998
+ .load {
999
+ transform-origin: 0 0;
1000
+ background-color: hsla(0, 100%, 100%, .4);
1001
+ position: absolute;
1002
+ bottom: 0;
1003
+ height: .4rem;
1004
+ width: 100%;
1005
+ }
1006
+ .play {
1007
+ transform-origin: 0 0;
1008
+ background-color: hsla(0, 100%, 50%, .8);
1009
+ position: absolute;
1010
+ bottom: 0;
1011
+ height: .4rem;
1012
+ width: 100%;
1013
+ }
1014
+ .padding {
1015
+ position: absolute;
1016
+ bottom: -4px;
1017
+ height: 1.6rem;
1018
+ width: 100%;
1019
+ }
1020
+ }
1021
+
1022
+ .controls {
1023
+ height: 100%;
1024
+ display: grid;
1025
+ align-items: center;
1026
+ grid-template-columns: 5rem fit-content(4.8rem) 20rem auto fit-content(10rem) 5rem 5rem 5rem;
1027
+ grid-gap: 1rem;
1028
+ color: #fff;
1029
+ user-select: none;
1030
+
1031
+ .picture-in-picture, .fullscreen, .play-button {
1032
+ height: 100%;
1033
+ color: #fff;
1034
+ background-color: transparent;
1035
+ border: none;
1036
+ cursor: pointer;
1037
+ }
1038
+
1039
+ .volume-area {
1040
+ display: flex;
1041
+ /* grid-template-columns: 4.8rem fit-content(0rem); */
1042
+ height: 100%;
1043
+ cursor: pointer;
1044
+
1045
+ .mute-button {
1046
+ color: #fff;
1047
+ border: none;
1048
+ background: none;
1049
+ height: 100%;
1050
+ width: 4.8rem;
1051
+ cursor: pointer;
1052
+ }
1053
+
1054
+ .volume-panel {
1055
+ display: inline-block;
1056
+ width: 0;
1057
+ /* width: 100%; */
1058
+ /* width: 12rem; */
1059
+ height: 100%;
1060
+ -webkit-transition: margin .2s cubic-bezier(0.4,0,1,1),width .2s cubic-bezier(0.4,0,1,1);
1061
+ transition: margin .2s cubic-bezier(0.4,0,1,1),width .2s cubic-bezier(0.4,0,1,1);
1062
+ cursor: pointer;
1063
+ outline: 0;
1064
+
1065
+ &.volume-control-hover {
1066
+ width: 6rem;
1067
+ /* width: 52px; */
1068
+ margin-right: 3px;
1069
+ -webkit-transition: margin .2s cubic-bezier(0,0,0.2,1),width .2s cubic-bezier(0,0,0.2,1);
1070
+ transition: margin .2s cubic-bezier(0,0,0.2,1),width .2s cubic-bezier(0,0,0.2,1);
1071
+ }
1072
+
1073
+ .slider {
1074
+ height: 100%;
1075
+ min-height: 36px;
1076
+ position: relative;
1077
+ overflow: hidden;
1078
+
1079
+ .slider-handle {
1080
+ /* left: 40px; */
1081
+ position: absolute;
1082
+ top: 50%;
1083
+ width: 12px;
1084
+ height: 12px;
1085
+ border-radius: 6px;
1086
+ margin-top: -6px;
1087
+ margin-left: -5px;
1088
+ /* background: #fff; */
1089
+ }
1090
+ .slider-handle::before, .slider-handle::after {
1091
+ content: "";
1092
+ position: absolute;
1093
+ display: block;
1094
+ top: 50%;
1095
+ left: 0;
1096
+ height: 3px;
1097
+ margin-top: -2px;
1098
+ width: 64px;
1099
+ }
1100
+ .slider-handle::before {
1101
+ left: -58px;
1102
+ background: #fff;
1103
+ }
1104
+ .slider-handle::after {
1105
+ left: 6px;
1106
+ background: rgba(255,255,255,.2);
1107
+ }
1108
+ }
1109
+ }
1110
+ }
1111
+
1112
+ .time {
1113
+ font-family: Roboto;
1114
+ padding-bottom: .5rem;
1115
+ }
1116
+
1117
+ .custom-controls {
1118
+ display: flex;
1119
+ justify-content: end;
1120
+ }
1121
+
1122
+ .error-area {
1123
+ position: relative;
1124
+ height: 3.8rem;
1125
+
1126
+ .error-menu {
1127
+ position: absolute;
1128
+ bottom: 4.8rem;
1129
+ left: -10rem;
1130
+ width: 25rem;
1131
+ /* background: rgba(0, 0, 0, .2); */
1132
+ /* background: rgb(35, 35, 35); */
1133
+ padding: 1rem;
1134
+ background-color: rgb(51, 51, 51);
1135
+
1136
+ &.hide {
1137
+ display: none;
1138
+ }
1139
+
1140
+ .error-menu-message {
1141
+
1142
+ }
1143
+
1144
+ button {
1145
+ width: 100%;
1146
+ padding: 0.5rem 0;
1147
+ background: none;
1148
+ border: none;
1149
+ color: #fff;
1150
+ cursor: pointer;
1151
+ text-shadow: 2px 2px #000;
1152
+ }
1153
+ }
1154
+
1155
+ .error-menu-button {
1156
+ display: grid;
1157
+ grid-auto-flow: column;
1158
+ align-items: center;
1159
+ height: 100%;
1160
+ width: 100%;
1161
+ cursor: pointer;
1162
+ color: #eb1010;
1163
+ font-weight: bold;
1164
+ background: none;
1165
+ border: none;
1166
+ }
1167
+ }
1168
+
1169
+ .subtitle-area {
1170
+ position: relative;
1171
+ height: 3.8rem;
1172
+
1173
+ .subtitle-menu {
1174
+ position: absolute;
1175
+ bottom: 4.8rem;
1176
+ left: -1rem;
1177
+ /* background: rgba(0, 0, 0, .2); */
1178
+ /* background: rgb(35, 35, 35); */
1179
+ padding: 1rem 0;
1180
+ background-color: rgb(17, 17, 17);
1181
+ /* background-color: rgb(51, 51, 51); */
1182
+ border-radius: .3rem;
1183
+
1184
+ &.hide {
1185
+ display: none;
1186
+ }
1187
+
1188
+ button {
1189
+ width: 100%;
1190
+ padding: 1rem;
1191
+ /* padding: 0.5rem 0; */
1192
+ background: none;
1193
+ border: none;
1194
+ color: #fff;
1195
+ cursor: pointer;
1196
+ text-shadow: 2px 2px #000;
1197
+
1198
+ &:hover {
1199
+ background-color: rgb(51, 51, 51);
1200
+ }
1201
+ }
1202
+ }
1203
+
1204
+ .subtitle-menu-button {
1205
+ height: 100%;
1206
+ width: 100%;
1207
+ cursor: pointer;
1208
+ color: #fff;
1209
+ background: none;
1210
+ border: none;
1211
+ }
1212
+ }
1213
+ }
1214
+ `,R6=({duration:t,currentTime:e,togglePlay:n,seek:i,setVolume:r,isSubtitleMenuHidden:s,setIsSubtitleMenuHidden:l,isErrorMenuHidden:a,setIsErrorMenuHidden:u,setCurrentSubtitleTrack:f,loadedTime:p,isPlaying:m,tracks:o,isFullscreen:c,toggleFullscreen:d,subtitleTrack:h,pictureInPicture:g,errors:y,customControls:v,..._})=>{const b=k.useRef(null),x=k.useRef(null),[w,S]=k.useState(!1),{scrub:C,value:T}=iw({ref:b}),M=k.useMemo(()=>document.pictureInPictureEnabled,[]),[B,F]=k.useState(!1),N=M6("fkn-media-player"),[W,H]=N("volume",1),[Y,ee]=N("muted",!1),{scrub:I,value:z}=iw({ref:x,defaultValue:W});k.useEffect(()=>{B||(F(!0),fe(void 0))},[B,y.length]),k.useEffect(()=>{T!==void 0&&i(T*(t??0))},[T]),k.useEffect(()=>{if(Y){r(0),ee(Y),z&&H(z);return}z!==void 0&&(r(z**2),H(z),ee(Y))},[z,Y]);const X=()=>{S(!1)},K=ge=>{ge.currentTarget!==ge.relatedTarget&&ge.relatedTarget!==null||S(!0)},be=()=>{ee(ge=>!ge)},Ke=(ge,Me,nt)=>{f(Me===void 0?Me:nt)},ue=ge=>{if(!s&&ge.relatedTarget===null){l(nt=>!nt);return}l(!1);const Me=nt=>{nt.stopPropagation(),l(!0),document.removeEventListener("click",Me)};setTimeout(()=>{document.addEventListener("click",Me)},0)},fe=ge=>{if(!a&&ge?.relatedTarget===null){u(nt=>!nt);return}u(!1);const Me=nt=>{nt.stopPropagation(),u(!0),document.removeEventListener("click",Me)};setTimeout(()=>{document.addEventListener("click",Me)},0)},ke=({subtitleTrack:ge})=>{if(!ge)return re(Xs,{children:"Disabled"});if(!ge.title&&!ge.language)return re(Xs,{children:"Default"});const Me=ge.language==="jpn"?"ja":rw(ge.language)?rw(ge.language):ge.language;return ge.title?vn(Xs,{children:[ge.title?.replace("subs",""),Me?`(${Me})`:""]}):re(Xs,{children:Me})},Be=k.useMemo(()=>[...new Set(y.map(ge=>ge.message==="non monotonicaly increasing DTS values"?ge.count>2?"The video seems malformatted and might have issues(skipped frames) during playback":null:"An unexpected error occured while trying to play the video"))].filter(Boolean).map(ge=>re("div",{className:"error-menu-message",children:ge},ge)),[y]);k.useEffect(()=>{Zs.rebuild()},[o.length]),k.useEffect(()=>{const ge=Me=>{Me.key==="f"&&d(),Me.key==="k"&&n(),Me.key==="m"&&be()};return window.addEventListener("keydown",ge),()=>window.removeEventListener("keydown",ge)},[d,n,be]);const[Le,vt]=k.useState(void 0);return vn("div",{css:D6,onMouseOut:K,..._,children:[re("div",{className:"preview"}),vn("div",{ref:b,className:"progress-bar",onMouseMove:ge=>{const Me=ge.nativeEvent.offsetX/ge.currentTarget.offsetWidth*(t??0);vt(Me)},onMouseOut:()=>{b.current&&vt(void 0)},children:[re("div",{className:"background-bar"}),Le?re("div",{className:"cursor-time","data-tip":Le,style:{left:`${1/((t??0)/(Le??1))*100}%`},children:new Date((Le??0)*1e3).toISOString().substr((t??0)>=3600?11:14,(t??0)>=3600?8:5)}):void 0,re("div",{className:"progress"}),re("div",{className:"load",style:{transform:`scaleX(${1/((t??0)/(p?.[1]??0))})`}}),re("div",{className:"hover"}),re("div",{className:"play",style:{transform:`scaleX(${typeof t!="number"||typeof e!="number"?0:1/((t??0)/(e??0))})`}}),re("div",{className:"chapters"}),re("div",{className:"scrubber"}),re("div",{className:"padding",onMouseDown:C})]}),vn("div",{className:"controls",children:[re(Zs,{id:"play-button-tooltip",effect:"solid",place:"top",children:m?"Pause (k)":"Play (k)"}),re("button",{className:"play-button",type:"button","data-tip":!0,"data-for":"play-button-tooltip",onClick:n,children:m?vn("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-pause",children:[re("rect",{x:"6",y:"4",width:"4",height:"16"}),re("rect",{x:"14",y:"4",width:"4",height:"16"})]}):re("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-play",children:re("polygon",{points:"5 3 19 12 5 21 5 3"})})}),vn("div",{className:"volume-area",onMouseOver:X,children:[re(Zs,{id:"mute-button-tooltip",effect:"solid",place:"top",children:Y?"Unmute (m)":"Mute (m)"}),re("button",{className:"mute-button","data-tip":!0,"data-for":"mute-button-tooltip",onClick:be,children:Y?re(zb,{}):(W??0)>.66?re(LF,{}):(W??0)>.33?re(PF,{}):(W??0)>0?re(UF,{}):re(zb,{})}),re("div",{ref:x,className:`volume-panel${w?"":" volume-control-hover"}`,onMouseDown:I,children:re("div",{className:"slider",children:re("div",{className:"slider-handle",style:{left:`${(W??0)*100}%`}})})})]}),vn("div",{className:"time",children:[re("span",{children:new Date((e??0)*1e3).toISOString().substr(11,8)}),re("span",{children:" / "}),re("span",{children:t?new Date(t*1e3).toISOString().substr(11,8):""})]}),re("div",{className:"custom-controls",children:v?.length?v.map((ge,Me)=>re(ge,{},Me)):null}),re("div",{className:"error-area",children:Be.length?vn(Xs,{children:[re("div",{className:`error-menu ${a?"hide":""}`,children:a?null:Be}),vn("div",{className:"error-menu-button",onClick:fe,children:[re(nF,{}),"Error"]})]}):null}),re(Zs,{id:"subtitle-button-tooltip",globalEventOff:"click",effect:"solid",place:"top",disable:!s,children:"Subtitles"}),re("div",{className:"subtitle-area",children:o.length?vn(Xs,{children:[re("div",{className:`subtitle-menu ${s?"hide":""}`,children:s?null:[...o,void 0].map((ge,Me)=>re("button",{onClick:nt=>Ke(nt,ge,Me),children:re(ke,{subtitleTrack:ge})},ge?Me:"disabled"))}),re("button",{className:"subtitle-menu-button","data-tip":!0,"data-for":"subtitle-button-tooltip",onClick:ue,children:re(ke,{subtitleTrack:h})})]}):null}),re(Zs,{id:"pip-button-tooltip",effect:"solid",place:"top",children:"Picture in Picture"}),M?re("button",{className:"picture-in-picture","data-tip":!0,"data-for":"pip-button-tooltip",onClick:g,children:vn("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[re("rect",{x:"2",y:"3",width:"21",height:"14",rx:"2",ry:"2"}),re("rect",{x:"12.5",y:"8.5",width:"8",height:"6",rx:"2",ry:"2"})]})}):null,re(Zs,{id:"fullscreen-button-tooltip",effect:"solid",place:"top",children:c?"Exit full screen (f)":"Full screen (f)"}),re("button",{className:"fullscreen","data-tip":!0,"data-for":"fullscreen-button-tooltip",onClick:d,children:c?re("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-minimize",children:re("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})}):re("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-maximize",children:re("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})})})]})]})},I6=an`
1215
+ --background-padding: 2rem;
1216
+ display: grid;
1217
+ grid-template-rows: 1fr;
1218
+ overflow: hidden;
1219
+
1220
+ &.hide {
1221
+ cursor: none;
1222
+
1223
+ .bottom {
1224
+ opacity: 0;
1225
+ }
1226
+ }
1227
+
1228
+ .bottom {
1229
+ &.hide {
1230
+ opacity: 0 !important;
1231
+ }
1232
+ }
1233
+ `,U6=({customOverlay:t,isPlaying:e,loading:n,duration:i,loadedTime:r,currentTime:s,pictureInPicture:l,fullscreen:a,play:u,seek:f,getVolume:p,setVolume:m,attachments:o,tracks:c,video:d,errors:h,customControls:g,libassWorkerUrl:y,wasmUrl:v,needsInitialInteraction:_,...b})=>{const[x,w]=k.useState(),[S,C]=k.useState(!1),[T,M]=k.useState(!1),[B,F]=k.useState(!1),N=k.useRef(),[W,H]=k.useState(!0),[Y,ee]=k.useState(),[I,z]=k.useState(),X=k.useMemo(()=>I!==void 0?c[I]:void 0,[I,I!==void 0&&c[I]?.data]),[K,be]=k.useState(!0),Ke=Le=>{F(!1),N.current&&clearInterval(N.current);const vt=setTimeout(()=>{F(!0)},3e3);N.current=vt};k.useEffect(()=>{setTimeout(()=>{F(!0)},3e3)},[]);const ue=Le=>{if(!x?.parentElement?.parentElement?.contains(Le?.relatedTarget)){F(!0);return}Le.currentTarget.parentElement!==Le.relatedTarget&&Le.relatedTarget!==null||F(!0)},fe=()=>{W&&u()},ke=()=>{!x||!Y||(M(Le=>!Le),a())};k.useEffect(()=>{if(!d.current||!x||Y||!X?.data||!o)return;const Le=o.map(({filename:ge,data:Me})=>[ge.toLowerCase().replaceAll("-"," ").split(".").at(0),Me]),vt=new mn({video:d.current,canvas:x,subContent:X.data,fonts:Le.filter(Boolean).map(([,ge])=>ge),availableFonts:{...Object.fromEntries(Le),"liberation sans":new URL("/build/default.woff2",new URL(window.location.toString()).origin).toString()},workerUrl:y,modernWasmUrl:v});ee(vt)},[x,o,X?.data]),k.useEffect(()=>{c.length&&z(0)},[c.length]),k.useEffect(()=>{if(Y){if(!X){Y.freeTrack();return}Y.setTrack(X.data),!(!x?.parentElement||S)&&C(!0)}},[Y,X,S]);const Be=Le=>{Le&&w(Le)};return vn("div",{...b,css:I6,onMouseMove:Ke,onMouseOut:ue,className:`chrome ${b.className??""} ${B?"hide":""}`,children:[re(O6,{needsInitialInteraction:_,loading:n,togglePlay:fe,setCanvasRef:Be}),t,re(R6,{className:`bottom ${_?"hide":""}`,toggleFullscreen:ke,togglePlay:fe,isFullscreen:T,pictureInPicture:l,seek:f,setCurrentSubtitleTrack:z,isSubtitleMenuHidden:W,setIsSubtitleMenuHidden:H,isErrorMenuHidden:K,setIsErrorMenuHidden:be,setVolume:m,subtitleTrack:X,tracks:c,currentTime:s,duration:i,isPlaying:e,loadedTime:r,errors:h,customControls:g})]})},F6=5e6,Qc=10,qs=20,z6=60,N6=an`
1234
+ display: grid;
1235
+ justify-content: center;
1236
+ background-color: #111;
1237
+
1238
+ video {
1239
+ pointer-events: none;
1240
+ grid-column: 1;
1241
+ grid-row: 1;
1242
+
1243
+ height: 100%;
1244
+ max-height: 100vh;
1245
+ max-width: 100%;
1246
+ background-color: black;
1247
+ }
1248
+
1249
+ .chrome {
1250
+ grid-column: 1;
1251
+ grid-row: 1;
1252
+ }
1253
+ `,B6=k.forwardRef(({customOverlay:t,baseBufferSize:e=F6,size:n,fetch:i,customControls:r,publicPath:s,wasmUrl:l,libavWorkerUrl:a,libavWorkerOptions:u,libassWorkerUrl:f,makeTransmuxer:p=dz},m)=>{const[o,c]=k.useState(!0),d=k.useRef(null),h=k.useRef(),[g,y]=k.useState(),[v,_]=k.useState(!(h?.current?.paused??!0)),[b,x]=k.useState(0),[w,S]=k.useState(void 0),[C,T]=k.useState([]),[M,B]=k.useState([]),[F,N]=k.useState(),[W,H]=k.useState([0,0]),Y=k.useRef(),[ee,I]=k.useState(!1),z=k.useRef(i);k.useEffect(()=>{z.current=i},[i]),k.useEffect(()=>{if(!n||!g)return;let lt,ni;return(async()=>{let $t=EE.createFile();$t.onError=U=>console.error("mp4box error",U);let Vi;const Tn=new Promise(U=>{Vi=U});let hn='video/mp4; codecs="',E;$t.onReady=U=>{E=U;for(let oe=0;oe<E.tracks.length;oe++)oe!==0&&(hn+=","),hn+=E.tracks[oe].codec;hn+='"',Vi(E)};let A,D=[];lt=p({publicPath:s,workerUrl:a,workerOptions:u,bufferSize:e,length:n,read:(U,oe)=>z.current(U,Math.min(U+oe,n)-1).then(_e=>_e.arrayBuffer()),seek:async(U,oe,_e)=>_e===Fa.SEEK_CUR?U+oe:_e===Fa.SEEK_END?-1:_e===Fa.SEEK_SET?oe:_e===Fa.AVSEEK_SIZE?n:-1,subtitle:(U,oe,_e)=>{T(he=>he.find(({title:Ce})=>Ce===U)?he.map(Ce=>Ce.title===U?{title:U,language:oe,data:_e}:Ce):[...he,{title:U,language:oe,data:_e}])},attachment:(U,oe,_e)=>{w?.find(({filename:he})=>U===he)||S(he=>[...he??[],{filename:U,mimetype:oe,data:new Uint8Array(_e)}])},write:({isHeader:U,offset:oe,buffer:_e,pts:he,duration:Ce,pos:me})=>{if(U){A||(A={offset:oe,buffer:new Uint8Array(_e),pts:he,duration:Ce,pos:me});return}D=[...D,{offset:oe,buffer:new Uint8Array(_e),pts:he,duration:Ce,pos:me}]}});const J=new Wx({concurrency:1}),Z=(U=qs)=>J.add(()=>P.process(U),{throwOnTimeout:!0}),P=await lt;if(await P.init(),!A)throw new Error("No header chunk found after transmuxer init");A.buffer.buffer.fileStart=0,$t.appendBuffer(A.buffer.buffer);const $=(await P.getInfo()).input.duration/1e6;N($),await Tn;const se=g;se.addEventListener("error",U=>{console.error(U.target?.error)});const Ee=new MediaSource;g.src=URL.createObjectURL(Ee);const Ue=await new Promise(U=>Ee.addEventListener("sourceopen",()=>U(Ee.addSourceBuffer(hn)),{once:!0}));Ee.duration=$,Ue.mode="segments";const Vt=new Wx({concurrency:1}),Zt=()=>Array(Ue.buffered.length).fill(void 0).map((U,oe)=>({index:oe,start:Ue.buffered.start(oe),end:Ue.buffered.end(oe)})),Hn=(U,oe)=>{const _e=je=>{U(je),me()},he=je=>{U(je),me()},Ce=je=>{console.error(je),oe(je),me()},me=()=>{Ue.removeEventListener("updateend",_e),Ue.removeEventListener("abort",he),Ue.removeEventListener("error",Ce)};Ue.addEventListener("updateend",_e,{once:!0}),Ue.addEventListener("abort",he,{once:!0}),Ue.addEventListener("error",Ce,{once:!0})},Pn=U=>Vt.add(()=>new Promise((oe,_e)=>{Hn(oe,_e),Ue.appendBuffer(U)})),bi=U=>Pn(U.buffer.buffer),O=async(U,oe)=>Vt.add(()=>new Promise((_e,he)=>{Hn(_e,he),Ue.remove(U,oe)})),L=U=>O(U.pts,U.pts+U.duration),j=async U=>{if(D.indexOf(U)===-1)throw new RangeError("No chunk found");await L(U),D=D.filter(oe=>oe!==U)};let q=!1;const xe=nw(500,async U=>{const oe=!se.paused;g?.pause(),q=!0,x(U);const _e=Zt();if(_e.some(({start:me,end:je})=>U>=me&&U<=je)){se.currentTime=U,q=!1,oe&&se.play();return}const he=new Promise(me=>{J.size&&J.pending?J.on("next",()=>J.pending===0?me(void 0):void 0):me(void 0)});J.pause(),J.clear(),await he,J.start();const Ce=Math.max(0,U-Qc);await P.seek(Ce),await Z(qs+qs);for(const me of _e)await O(me.start,me.end);for(const me of D)me.pts<=Ce||await bi(me);se.currentTime=U,q=!1,oe&&se.play()});Y.current=xe;const we=async U=>{const oe=Zt(),_e=D.filter(({pts:Fe,duration:yt})=>U-Qc<Fe&&U+z6>Fe+yt),he=_e.filter(({pts:Fe,duration:yt})=>U-Qc<Fe&&U+qs>Fe+yt),Ce=D.filter(({pts:Fe,duration:yt})=>oe.some(({start:as,end:ls})=>as<Fe+yt/2&&Fe+yt/2<ls)).filter(Fe=>!he.includes(Fe)),me=D.filter(Fe=>!_e.includes(Fe));for(const Fe of Ce)await L(Fe);for(const Fe of me)await j(Fe);const je=_e.sort(({pts:Fe},{pts:yt})=>Fe-yt).at(0),ii=_e.sort(({pts:Fe,duration:yt},{pts:as,duration:ls})=>Fe+yt-(as+ls)).at(-1);for(const Fe of he)try{await bi(Fe)}catch(yt){if(console.error(yt),!(yt instanceof Event))throw yt;break}const xi=je?Math.max(je?.pts-Qc,0):void 0,_r=ii?Math.min(ii.pts+ii.duration+qs,$):void 0,ri=Zt();for(const{start:Fe,end:yt}of ri)!xi||!_r||(xi!==void 0&&Fe<xi&&await O(Fe,xi),_r!==void 0&&yt>_r&&await O(_r,yt))},Te=new Promise(U=>{se.addEventListener("loadedmetadata",()=>U(void 0),{once:!0})});se.addEventListener("canplay",()=>se.play().catch(U=>{!(U instanceof DOMException)||U.name!=="NotAllowedError"||(I(!0),c(!1))}),{once:!0}),await Pn(A.buffer),await Te,await Z(20),await we(0);const ye=nw(500,async U=>{const oe=D.sort(({pts:_e},{pts:he})=>_e-he).at(-1);oe&&oe.pts<U+qs&&await Z(),await we(U)});se.addEventListener("timeupdate",()=>{q||ye(se.currentTime)}),ni=window.setInterval(()=>{const U=Zt(),oe=U.sort(({start:me},{start:je})=>me-je).at(0),_e=U.sort(({end:me},{end:je})=>me-je).at(-1);if(!oe||!_e)return;let he=D.filter(({pts:me,duration:je})=>me+je/2>oe.start).sort(({pts:me},{pts:je})=>me-je).at(0)?.pts,Ce=D.filter(({pts:me,duration:je})=>me+je/2<_e.end).sort(({pts:me},{pts:je})=>me-je).at(-1)?.pts;he===void 0||Ce===void 0||H([he,Ce])},200)})(),()=>{lt.then($t=>$t.destroy(!0)),window.clearInterval(ni)}},[n,g]);const X=lt=>{c(!0)},[K,be]=k.useState(!1),Ke=lt=>{be(!1)},ue=lt=>{h.current&&(be(!0),x(h.current?.currentTime??0))},fe=lt=>{be(!0),Y.current?.(lt)},ke=lt=>{K||(x(h.current?.currentTime??0),c(!1))},Be=lt=>ni=>{_(lt)},Le=()=>{if(document.pictureInPictureElement)return document.exitPictureInPicture();h.current?.requestPictureInPicture()},vt=()=>{if(document.fullscreenElement)return document.exitFullscreen();d.current?.requestFullscreen()},ge=async()=>{I(!1),h.current?.paused?await h.current?.play():await h.current?.pause()},Me=lt=>{h.current&&(h.current.volume=lt)},nt=()=>{if(h.current)return h.current.volume};return vn("div",{css:N6,ref:d,children:[re("video",{ref:lt=>{typeof m=="function"&&m(lt),m&&"current"in m&&(m.current=lt),h.current=lt??void 0,y(h.current)},onWaiting:X,onSeeking:ue,onSeeked:Ke,onTimeUpdate:ke,onPlay:Be(!0),onPause:Be(!1)}),re(U6,{className:"chrome",customOverlay:t,isPlaying:v,video:h,needsInitialInteraction:ee,loading:o,duration:F,currentTime:b,loadedTime:W,pictureInPicture:Le,fullscreen:vt,play:ge,seek:fe,getVolume:nt,setVolume:Me,attachments:w,tracks:C,errors:M,customControls:r,libassWorkerUrl:f,wasmUrl:l})]})});var Po=(t=>(t.HOME="HOME",t.WATCH="WATCH",t.EMBED="EMBED",t))(Po||{});const j6={HOME:()=>"/",WATCH:({infoHash:t,fileIndex:e})=>`/watch/${t}/${e}`,EMBED:t=>`/embed?${new URLSearchParams(t).toString()}`},$6={HOME:"/",WATCH:"/watch/:infoHash/:fileIndex?",EMBED:"/embed"},ep=t=>$6[t],V2=(t,e)=>j6[t](e),V6=an`
1254
+ height: 100%;
1255
+ width: 100%;
1256
+ overflow-x: hidden;
1257
+ /* width: 100%; */
1258
+ & > div {
1259
+ height: 100%;
1260
+ width: 100%;
1261
+ & > video, & > div {
1262
+ height: 100vh;
1263
+ max-height: 100%;
1264
+ width: 100vw;
1265
+ max-width: 100%;
1266
+ }
1267
+ }
1268
+
1269
+ grid-column: 1;
1270
+ grid-row: 1;
1271
+
1272
+ div canvas {
1273
+ margin: auto;
1274
+ }
1275
+
1276
+ .player-overlay {
1277
+ display: flex;
1278
+ justify-content: space-between;
1279
+ align-items: start;
1280
+ grid-column: 1;
1281
+ grid-row: 1;
1282
+ & > div, & > a {
1283
+ display: flex;
1284
+ align-items: center;
1285
+ justify-content: center;
1286
+ color: white;
1287
+ font-size: 3rem;
1288
+ font-weight: bold;
1289
+ cursor: pointer;
1290
+
1291
+ & > svg {
1292
+ margin-right: 1rem;
1293
+ }
1294
+ text-decoration: none;
1295
+ margin: 1.5rem;
1296
+ padding: 1rem;
1297
+ position: relative;
1298
+ /* background-color: rgb(35, 35, 35); */
1299
+ /* background: linear-gradient(0deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) calc(100% - 1rem), rgba(0,0,0,0) 100%); */
1300
+ background: radial-gradient(ellipse at center, rgba(0,0,0,0.4) 0%,rgba(0,0,0,0.1) calc(100% - 1rem),rgba(0,0,0,0) 100%);
1301
+ }
1302
+ }
1303
+
1304
+ .hide {
1305
+ .player-overlay {
1306
+ display: none;
1307
+ }
1308
+ }
1309
+ `,H6=(t,e,n)=>t?.downloadedRanges.filter(i=>i.start<=e&&n<=i.end),W6=()=>{const{infoHash:t,fileIndex:e}=TI(),[n,i]=k.useState(),s=yi.useRxCollection("torrents")?.findOne({selector:{infoHash:t}}),{result:[l]}=yi.useRxQuery(s),a=l?.state?.files?.[e],u=k.useRef(a);k.useEffect(()=>{if(!a)return;const c=l.$.subscribe(d=>{const h=d.state.files?.[e];u.current=h});return()=>c.unsubscribe()},[!!a]),k.useEffect(()=>{a&&i(a.length)},[a]);const f=k.useMemo(()=>{const c=new URL("/jassub-worker.js",new URL(window.location.toString()).origin).toString(),d=new Blob([`importScripts(${JSON.stringify(c)})`],{type:"application/javascript"});return URL.createObjectURL(d)},[]),p=k.useMemo(()=>{const c=new URL("/libav-worker.js",new URL(window.location.toString()).origin).toString(),d=new Blob([`importScripts(${JSON.stringify(c)})`],{type:"application/javascript"});return URL.createObjectURL(d)},[]),m=async(c,d)=>{const h=u.current;if(H6(h,c,d)?.length){const y=await sC({infoHash:t,filePath:h.path,offset:c,size:d-c+1});return new Response(y)}else{if(c>=h?.length-1e6){const y=await fC({magnet:l.state.magnet,path:h.path,offset:c,end:h?.length});return new Response(await y.arrayBuffer())}return await new Promise(y=>setTimeout(y,250)),m(c,d)}},o=k.useMemo(()=>V("div",{className:"player-overlay",children:pe(gg,{to:V2(Po.HOME),className:"home",children:[V(vF,{}),V("span",{children:"Back"})]})}),[]);return V("div",{css:V6,children:V(B6,{size:n,fetch:(c,d)=>m(c,d),publicPath:new URL("/",new URL(window.location.toString()).origin).toString(),libavWorkerUrl:p,libassWorkerUrl:f,wasmUrl:new URL("/jassub-worker-modern.wasm",new URL(window.location.toString()).origin).toString(),customOverlay:o})})},G6=an`
1310
+ height: 100%;
1311
+ width: 100%;
1312
+
1313
+ display: flex;
1314
+ align-items: center;
1315
+ justify-content: center;
1316
+
1317
+ font-size: 3rem;
1318
+ font-weight: bold;
1319
+ `,Y6=()=>{const[t]=tU(),{magnet:e,torrentFile:n}=Object.fromEntries(t.entries()),i=k.useMemo(()=>e&&atob(e),[e]),r=Iv(),[s,l]=k.useState();k.useEffect(()=>{i&&mm(i).then(m=>l(m))},[i]);const a=yi.useRxCollection("torrents");console.log("collection",a);const u=a?.findOne({selector:{infoHash:s?.infoHash}});console.log("torrentDocQuery",u);const{result:[f],isFetching:p}=yi.useRxQuery(u);return console.log("torrentDoc",f),k.useEffect(()=>{console.log("aaa",!i,!s,p,f),!(!i||!s||p||f)&&setTimeout(()=>{console.log("addTorrent",{magnet:i,torrentFile:s}),vm({magnet:i})},1e3)},[i,p,s,f]),k.useEffect(()=>{if(!s||!Na||!r)return;const m=async()=>{const c=await Na?.find({}).exec(),d=c.find(y=>y.infoHash===s.infoHash);if(console.log("tryWithDocument",c),!d)return;const g=d.state.files?.filter(y=>Vg.includes(y.name.split(".").pop()??""))?.[0];clearInterval(o),setTimeout(()=>{r(V2(Po.WATCH,{infoHash:d.infoHash,fileIndex:g?.index}))},1e3)},o=setInterval(m,200);return m(),()=>clearInterval(o)},[Na,r,s]),V("div",{css:G6,children:V("div",{children:"Fetching torrent metadata"})})};var K6=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function uc(t,e){var n=Q6(t);if(typeof n.path!="string"){var i=t.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof e=="string"?e:typeof i=="string"&&i.length>0?i:t.name,writable:!1,configurable:!1,enumerable:!0})}return n}function Q6(t){var e=t.name,n=e&&e.lastIndexOf(".")!==-1;if(n&&!t.type){var i=e.split(".").pop().toLowerCase(),r=K6.get(i);r&&Object.defineProperty(t,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return t}var Z6=[".DS_Store","Thumbs.db"];function X6(t){return Yo(this,void 0,void 0,function(){return Ko(this,function(e){return Fd(t)&&q6(t.dataTransfer)?[2,nj(t.dataTransfer,t.type)]:J6(t)?[2,ej(t)]:Array.isArray(t)&&t.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,tj(t)]:[2,[]]})})}function q6(t){return Fd(t)}function J6(t){return Fd(t)&&Fd(t.target)}function Fd(t){return typeof t=="object"&&t!==null}function ej(t){return dm(t.target.files).map(function(e){return uc(e)})}function tj(t){return Yo(this,void 0,void 0,function(){var e;return Ko(this,function(n){switch(n.label){case 0:return[4,Promise.all(t.map(function(i){return i.getFile()}))];case 1:return e=n.sent(),[2,e.map(function(i){return uc(i)})]}})})}function nj(t,e){return Yo(this,void 0,void 0,function(){var n,i;return Ko(this,function(r){switch(r.label){case 0:return t.items?(n=dm(t.items).filter(function(s){return s.kind==="file"}),e!=="drop"?[2,n]:[4,Promise.all(n.map(ij))]):[3,2];case 1:return i=r.sent(),[2,sw(H2(i))];case 2:return[2,sw(dm(t.files).map(function(s){return uc(s)}))]}})})}function sw(t){return t.filter(function(e){return Z6.indexOf(e.name)===-1})}function dm(t){if(t===null)return[];for(var e=[],n=0;n<t.length;n++){var i=t[n];e.push(i)}return e}function ij(t){if(typeof t.webkitGetAsEntry!="function")return ow(t);var e=t.webkitGetAsEntry();return e&&e.isDirectory?W2(e):ow(t)}function H2(t){return t.reduce(function(e,n){return by(by([],xy(e),!1),xy(Array.isArray(n)?H2(n):[n]),!1)},[])}function ow(t){var e=t.getAsFile();if(!e)return Promise.reject("".concat(t," is not a File"));var n=uc(e);return Promise.resolve(n)}function rj(t){return Yo(this,void 0,void 0,function(){return Ko(this,function(e){return[2,t.isDirectory?W2(t):sj(t)]})})}function W2(t){var e=t.createReader();return new Promise(function(n,i){var r=[];function s(){var l=this;e.readEntries(function(a){return Yo(l,void 0,void 0,function(){var u,f,p;return Ko(this,function(m){switch(m.label){case 0:if(a.length)return[3,5];m.label=1;case 1:return m.trys.push([1,3,,4]),[4,Promise.all(r)];case 2:return u=m.sent(),n(u),[3,4];case 3:return f=m.sent(),i(f),[3,4];case 4:return[3,6];case 5:p=Promise.all(a.map(rj)),r.push(p),s(),m.label=6;case 6:return[2]}})})},function(a){i(a)})}s()})}function sj(t){return Yo(this,void 0,void 0,function(){return Ko(this,function(e){return[2,new Promise(function(n,i){t.file(function(r){var s=uc(r,t.fullPath);n(s)},function(r){i(r)})})]})})}var oj=function(t,e){if(t&&e){var n=Array.isArray(e)?e:e.split(","),i=t.name||"",r=(t.type||"").toLowerCase(),s=r.replace(/\/.*$/,"");return n.some(function(l){var a=l.trim().toLowerCase();return a.charAt(0)==="."?i.toLowerCase().endsWith(a):a.endsWith("/*")?s===a.replace(/\/.*$/,""):r===a})}return!0};function aw(t){return cj(t)||lj(t)||Y2(t)||aj()}function aj(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1320
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lj(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function cj(t){if(Array.isArray(t))return fm(t)}function lw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function cw(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?lw(Object(n),!0).forEach(function(i){G2(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lw(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function G2(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yl(t,e){return fj(t)||dj(t,e)||Y2(t,e)||uj()}function uj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1321
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Y2(t,e){if(t){if(typeof t=="string")return fm(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fm(t,e)}}function fm(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function dj(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i=[],r=!0,s=!1,l,a;try{for(n=n.call(t);!(r=(l=n.next()).done)&&(i.push(l.value),!(e&&i.length===e));r=!0);}catch(u){s=!0,a=u}finally{try{!r&&n.return!=null&&n.return()}finally{if(s)throw a}}return i}}function fj(t){if(Array.isArray(t))return t}var hj="file-invalid-type",pj="file-too-large",gj="file-too-small",mj="too-many-files",vj=function(e){e=Array.isArray(e)&&e.length===1?e[0]:e;var n=Array.isArray(e)?"one of ".concat(e.join(", ")):e;return{code:hj,message:"File type must be ".concat(n)}},uw=function(e){return{code:pj,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},dw=function(e){return{code:gj,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},yj={code:mj,message:"Too many files"};function K2(t,e){var n=t.type==="application/x-moz-file"||oj(t,e);return[n,n?null:vj(e)]}function Q2(t,e,n){if(bs(t.size))if(bs(e)&&bs(n)){if(t.size>n)return[!1,uw(n)];if(t.size<e)return[!1,dw(e)]}else{if(bs(e)&&t.size<e)return[!1,dw(e)];if(bs(n)&&t.size>n)return[!1,uw(n)]}return[!0,null]}function bs(t){return t!=null}function _j(t){var e=t.files,n=t.accept,i=t.minSize,r=t.maxSize,s=t.multiple,l=t.maxFiles,a=t.validator;return!s&&e.length>1||s&&l>=1&&e.length>l?!1:e.every(function(u){var f=K2(u,n),p=Yl(f,1),m=p[0],o=Q2(u,i,r),c=Yl(o,1),d=c[0],h=a?a(u):null;return m&&d&&!h})}function zd(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble<"u"?t.cancelBubble:!1}function Zc(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function fw(t){t.preventDefault()}function bj(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function xj(t){return t.indexOf("Edge/")!==-1}function wj(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return bj(t)||xj(t)}function ki(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(i){for(var r=arguments.length,s=new Array(r>1?r-1:0),l=1;l<r;l++)s[l-1]=arguments[l];return e.some(function(a){return!zd(i)&&a&&a.apply(void 0,[i].concat(s)),zd(i)})}}function Sj(){return"showOpenFilePicker"in window}function kj(t){if(bs(t)){var e=Object.entries(t).filter(function(n){var i=Yl(n,2),r=i[0],s=i[1],l=!0;return Z2(r)||(console.warn('Skipped "'.concat(r,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),l=!1),(!Array.isArray(s)||!s.every(X2))&&(console.warn('Skipped "'.concat(r,'" because an invalid file extension was provided.')),l=!1),l}).reduce(function(n,i){var r=Yl(i,2),s=r[0],l=r[1];return cw(cw({},n),{},G2({},s,l))},{});return[{description:"Files",accept:e}]}return t}function Ej(t){if(bs(t))return Object.entries(t).reduce(function(e,n){var i=Yl(n,2),r=i[0],s=i[1];return[].concat(aw(e),[r],aw(s))},[]).filter(function(e){return Z2(e)||X2(e)}).join(",")}function Cj(t){return t instanceof DOMException&&(t.name==="AbortError"||t.code===t.ABORT_ERR)}function Tj(t){return t instanceof DOMException&&(t.name==="SecurityError"||t.code===t.SECURITY_ERR)}function Z2(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||/\w+\/[-+.\w]+/g.test(t)}function X2(t){return/^.*\.[\w]+$/.test(t)}var Pj=["children"],Aj=["open"],Oj=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Lj=["refKey","onChange","onClick"];function Mj(t){return Ij(t)||Rj(t)||q2(t)||Dj()}function Dj(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1322
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rj(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Ij(t){if(Array.isArray(t))return hm(t)}function tp(t,e){return zj(t)||Fj(t,e)||q2(t,e)||Uj()}function Uj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1323
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q2(t,e){if(t){if(typeof t=="string")return hm(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hm(t,e)}}function hm(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Fj(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i=[],r=!0,s=!1,l,a;try{for(n=n.call(t);!(r=(l=n.next()).done)&&(i.push(l.value),!(e&&i.length===e));r=!0);}catch(u){s=!0,a=u}finally{try{!r&&n.return!=null&&n.return()}finally{if(s)throw a}}return i}}function zj(t){if(Array.isArray(t))return t}function hw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function ft(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?hw(Object(n),!0).forEach(function(i){pm(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hw(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function pm(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nd(t,e){if(t==null)return{};var n=Nj(t,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function Nj(t,e){if(t==null)return{};var n={},i=Object.keys(t),r,s;for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}var yy=k.forwardRef(function(t,e){var n=t.children,i=Nd(t,Pj),r=eC(i),s=r.open,l=Nd(r,Aj);return k.useImperativeHandle(e,function(){return{open:s}},[s]),ae.createElement(k.Fragment,null,n(ft(ft({},l),{},{open:s})))});yy.displayName="Dropzone";var J2={disabled:!1,getFilesFromEvent:X6,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};yy.defaultProps=J2;yy.propTypes={children:R.func,accept:R.objectOf(R.arrayOf(R.string)),multiple:R.bool,preventDropOnDocument:R.bool,noClick:R.bool,noKeyboard:R.bool,noDrag:R.bool,noDragEventsBubbling:R.bool,minSize:R.number,maxSize:R.number,maxFiles:R.number,disabled:R.bool,getFilesFromEvent:R.func,onFileDialogCancel:R.func,onFileDialogOpen:R.func,useFsAccessApi:R.bool,autoFocus:R.bool,onDragEnter:R.func,onDragLeave:R.func,onDragOver:R.func,onDrop:R.func,onDropAccepted:R.func,onDropRejected:R.func,onError:R.func,validator:R.func};var gm={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function eC(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=ft(ft({},J2),t),n=e.accept,i=e.disabled,r=e.getFilesFromEvent,s=e.maxSize,l=e.minSize,a=e.multiple,u=e.maxFiles,f=e.onDragEnter,p=e.onDragLeave,m=e.onDragOver,o=e.onDrop,c=e.onDropAccepted,d=e.onDropRejected,h=e.onFileDialogCancel,g=e.onFileDialogOpen,y=e.useFsAccessApi,v=e.autoFocus,_=e.preventDropOnDocument,b=e.noClick,x=e.noKeyboard,w=e.noDrag,S=e.noDragEventsBubbling,C=e.onError,T=e.validator,M=k.useMemo(function(){return Ej(n)},[n]),B=k.useMemo(function(){return kj(n)},[n]),F=k.useMemo(function(){return typeof g=="function"?g:pw},[g]),N=k.useMemo(function(){return typeof h=="function"?h:pw},[h]),W=k.useRef(null),H=k.useRef(null),Y=k.useReducer(Bj,gm),ee=tp(Y,2),I=ee[0],z=ee[1],X=I.isFocused,K=I.isFileDialogActive,be=k.useRef(typeof window<"u"&&window.isSecureContext&&y&&Sj()),Ke=function(){!be.current&&K&&setTimeout(function(){if(H.current){var $=H.current.files;$.length||(z({type:"closeDialog"}),N())}},300)};k.useEffect(function(){return window.addEventListener("focus",Ke,!1),function(){window.removeEventListener("focus",Ke,!1)}},[H,K,N,be]);var ue=k.useRef([]),fe=function($){W.current&&W.current.contains($.target)||($.preventDefault(),ue.current=[])};k.useEffect(function(){return _&&(document.addEventListener("dragover",fw,!1),document.addEventListener("drop",fe,!1)),function(){_&&(document.removeEventListener("dragover",fw),document.removeEventListener("drop",fe))}},[W,_]),k.useEffect(function(){return!i&&v&&W.current&&W.current.focus(),function(){}},[W,v,i]);var ke=k.useCallback(function(P){C?C(P):console.error(P)},[C]),Be=k.useCallback(function(P){P.preventDefault(),P.persist(),A(P),ue.current=[].concat(Mj(ue.current),[P.target]),Zc(P)&&Promise.resolve(r(P)).then(function($){if(!(zd(P)&&!S)){var se=$.length,Ee=se>0&&_j({files:$,accept:M,minSize:l,maxSize:s,multiple:a,maxFiles:u,validator:T}),Ue=se>0&&!Ee;z({isDragAccept:Ee,isDragReject:Ue,isDragActive:!0,type:"setDraggedFiles"}),f&&f(P)}}).catch(function($){return ke($)})},[r,f,ke,S,M,l,s,a,u,T]),Le=k.useCallback(function(P){P.preventDefault(),P.persist(),A(P);var $=Zc(P);if($&&P.dataTransfer)try{P.dataTransfer.dropEffect="copy"}catch{}return $&&m&&m(P),!1},[m,S]),vt=k.useCallback(function(P){P.preventDefault(),P.persist(),A(P);var $=ue.current.filter(function(Ee){return W.current&&W.current.contains(Ee)}),se=$.indexOf(P.target);se!==-1&&$.splice(se,1),ue.current=$,!($.length>0)&&(z({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Zc(P)&&p&&p(P))},[W,p,S]),ge=k.useCallback(function(P,$){var se=[],Ee=[];P.forEach(function(Ue){var Vt=K2(Ue,M),Zt=tp(Vt,2),Hn=Zt[0],Pn=Zt[1],bi=Q2(Ue,l,s),O=tp(bi,2),L=O[0],j=O[1],q=T?T(Ue):null;if(Hn&&L&&!q)se.push(Ue);else{var xe=[Pn,j];q&&(xe=xe.concat(q)),Ee.push({file:Ue,errors:xe.filter(function(we){return we})})}}),(!a&&se.length>1||a&&u>=1&&se.length>u)&&(se.forEach(function(Ue){Ee.push({file:Ue,errors:[yj]})}),se.splice(0)),z({acceptedFiles:se,fileRejections:Ee,type:"setFiles"}),o&&o(se,Ee,$),Ee.length>0&&d&&d(Ee,$),se.length>0&&c&&c(se,$)},[z,a,M,l,s,u,o,c,d,T]),Me=k.useCallback(function(P){P.preventDefault(),P.persist(),A(P),ue.current=[],Zc(P)&&Promise.resolve(r(P)).then(function($){zd(P)&&!S||ge($,P)}).catch(function($){return ke($)}),z({type:"reset"})},[r,ge,ke,S]),nt=k.useCallback(function(){if(be.current){z({type:"openDialog"}),F();var P={multiple:a,types:B};window.showOpenFilePicker(P).then(function($){return r($)}).then(function($){ge($,null),z({type:"closeDialog"})}).catch(function($){Cj($)?(N($),z({type:"closeDialog"})):Tj($)?(be.current=!1,H.current?(H.current.value=null,H.current.click()):ke(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ke($)});return}H.current&&(z({type:"openDialog"}),F(),H.current.value=null,H.current.click())},[z,F,N,y,ge,ke,B,a]),lt=k.useCallback(function(P){!W.current||!W.current.isEqualNode(P.target)||(P.key===" "||P.key==="Enter"||P.keyCode===32||P.keyCode===13)&&(P.preventDefault(),nt())},[W,nt]),ni=k.useCallback(function(){z({type:"focus"})},[]),$t=k.useCallback(function(){z({type:"blur"})},[]),Vi=k.useCallback(function(){b||(wj()?setTimeout(nt,0):nt())},[b,nt]),Tn=function($){return i?null:$},hn=function($){return x?null:Tn($)},E=function($){return w?null:Tn($)},A=function($){S&&$.stopPropagation()},D=k.useMemo(function(){return function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},$=P.refKey,se=$===void 0?"ref":$,Ee=P.role,Ue=P.onKeyDown,Vt=P.onFocus,Zt=P.onBlur,Hn=P.onClick,Pn=P.onDragEnter,bi=P.onDragOver,O=P.onDragLeave,L=P.onDrop,j=Nd(P,Oj);return ft(ft(pm({onKeyDown:hn(ki(Ue,lt)),onFocus:hn(ki(Vt,ni)),onBlur:hn(ki(Zt,$t)),onClick:Tn(ki(Hn,Vi)),onDragEnter:E(ki(Pn,Be)),onDragOver:E(ki(bi,Le)),onDragLeave:E(ki(O,vt)),onDrop:E(ki(L,Me)),role:typeof Ee=="string"&&Ee!==""?Ee:"presentation"},se,W),!i&&!x?{tabIndex:0}:{}),j)}},[W,lt,ni,$t,Vi,Be,Le,vt,Me,x,w,i]),J=k.useCallback(function(P){P.stopPropagation()},[]),Z=k.useMemo(function(){return function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},$=P.refKey,se=$===void 0?"ref":$,Ee=P.onChange,Ue=P.onClick,Vt=Nd(P,Lj),Zt=pm({accept:M,multiple:a,type:"file",style:{display:"none"},onChange:Tn(ki(Ee,Me)),onClick:Tn(ki(Ue,J)),tabIndex:-1},se,H);return ft(ft({},Zt),Vt)}},[H,n,a,Me,i]);return ft(ft({},I),{},{isFocused:X&&!i,getRootProps:D,getInputProps:Z,rootRef:W,inputRef:H,open:Tn(nt)})}function Bj(t,e){switch(e.type){case"focus":return ft(ft({},t),{},{isFocused:!0});case"blur":return ft(ft({},t),{},{isFocused:!1});case"openDialog":return ft(ft({},gm),{},{isFileDialogActive:!0});case"closeDialog":return ft(ft({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return ft(ft({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return ft(ft({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return ft({},gm);default:return t}}function pw(){}const jj=an`
1324
+ position: relative;
1325
+
1326
+ :after {
1327
+ content: "You can now drop your torrent files";
1328
+ position: absolute;
1329
+ display: flex;
1330
+ inset: 1rem;
1331
+ bottom: 3.5rem;
1332
+ align-items: center;
1333
+ justify-content: center;
1334
+ background-color: rgba(0,0,0,.1);
1335
+ border: 2px dashed #fff;
1336
+ border-color: var(--pink);
1337
+ border-radius: 10px;
1338
+ opacity: 0;
1339
+ transform: scale(.95);
1340
+ transition: all .2s ease-in;
1341
+ transition-property: transform,opacity;
1342
+ pointer-events: none;
1343
+
1344
+ background-color: rgba(0, 0, 0, 0.4);
1345
+ border-color: var(--darkreader-border--pink);
1346
+ }
1347
+
1348
+ &.active:after {
1349
+ opacity: 1;
1350
+ transform: scale(1);
1351
+ transition-timing-function: ease-out;
1352
+ }
1353
+ `,$j=({children:t})=>{const e=k.useCallback(async(s,l)=>{(await Promise.all([...await Promise.all(s.map(u=>{const f=new FileReader;return new Promise((p,m)=>{f.onload=()=>{!f.result||!(f.result instanceof ArrayBuffer)||p(yw.Buffer.from(f.result))},f.onerror=m,f.readAsArrayBuffer(u)})})),...l?[l]:[]].map(mm))).forEach(async u=>{vm({magnet:l,torrentFile:u})})},[]),{getRootProps:n,getInputProps:i,isDragActive:r}=eC({onDrop:s=>e(s,void 0),noClick:!0});return k.useEffect(()=>{const s=l=>e([...l.clipboardData?.files??[]],l.clipboardData?.getData("Text"));return addEventListener("paste",s),()=>removeEventListener("paste",s)},[e]),pe("div",{css:jj,...n(),className:`drag-zone ${r?"active":""}`,children:[V("input",{...i()}),t]})};an`
1354
+ `;const gw=t=>V($j,{children:t}),Vj=QI([{path:ep(Po.HOME),element:gw(V(JF,{}))},{path:ep(Po.WATCH),element:V(W6,{})},{path:ep(Po.EMBED),element:V(Y6,{})},{path:"/*",element:gw(V("div",{children:"404 No page found"}))}]),Hj=()=>V(BI,{router:Vj}),Wj=()=>V(k.Fragment,{children:V(Hj,{})}),Gj=an`
1355
+ @import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,500;1,600;1,700;1,800;1,900&family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
1356
+
1357
+ :root {
1358
+ color-scheme: dark;
1359
+ }
1360
+
1361
+ *, *::before, *::after {
1362
+ box-sizing: border-box;
1363
+ margin: 0;
1364
+ padding: 0;
1365
+ }
1366
+
1367
+ html {
1368
+ font-size: 62.5%;
1369
+ height: 100vh;
1370
+ width: 100%;
1371
+ }
1372
+
1373
+ body {
1374
+ margin: 0;
1375
+ height: 100vh;
1376
+ width: 100%;
1377
+ font-size: 1.6rem;
1378
+ font-family: Fira Sans;
1379
+ background-color: #0f0f0f;
1380
+ color: #fff;
1381
+
1382
+ font-family: Montserrat;
1383
+ // font-family: "Segoe UI", Roboto, "Fira Sans", "Helvetica Neue", Arial, sans-serif;
1384
+ }
1385
+
1386
+ body > .mount {
1387
+ height: 100vh;
1388
+ width: 100%;
1389
+ }
1390
+
1391
+ a {
1392
+ color: #777777;
1393
+ text-decoration: none;
1394
+ }
1395
+
1396
+ a:hover {
1397
+ color: #fff;
1398
+ text-decoration: underline;
1399
+ }
1400
+
1401
+ ul {
1402
+ list-style: none;
1403
+ }
1404
+ `,tC=document.body.appendChild(document.createElement("div"));tC.classList.add("mount");const Yj=Wk(tC);Yj.render(pe(yi.Provider,{db:mw,children:[V(MM,{styles:Gj}),V(Wj,{})]}))});export{tf as default,__tla};